Daniel Walton [Sun, 25 Sep 2016 14:22:48 +0000 (14:22 +0000)]
Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Sam Tannous <stannous@cumulusnetworks.com>
Ticket:
Quentin Young [Fri, 23 Sep 2016 20:08:47 +0000 (20:08 +0000)]
lib: Implement removed ALIAS into DEFUN
N.B.: some of these are de-facto ALIAS resurrections
that are necessary due to some parser limitations; these
are marked with ALIAS_FIXME so I can go back and add
capability to the parser to handle these special cases.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
These commands were ported forward from these
commits: f9b6c39 bgpd: Add back old forms of 'show <afi> <safi>' for compatibility bf1ae6c bgpd: drop machineparse / random "show" improvements 651b402 bgpd: encap show commands 35c3686 bgpd: VPNv6 show commands 135ca15 bgpd: cleanup vty bgp_node_afi/safi utils
This is the first drop of those commits. The files have
changed too much and the diffs to extensive to try to do it
in one piece. Break it up into smaller code chunks.
Original Code: Signed-off-by: Lou Berger <lberger@labn.net>
Forward Port: Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Mon, 19 Sep 2016 23:46:51 +0000 (23:46 +0000)]
lib: Initial refactor pass on CLI backend
Shotgun commit:
* Remove shim sources from Makefile.am
* Move new types to command.c / command.h
* Rewrite command.c / command.h
* Refactor shim types to real types in matcher
and parser
* Initial refactor pass on vty.c
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
David Lamparter [Tue, 16 Aug 2016 15:48:44 +0000 (17:48 +0200)]
vtysh: work around gcc bug #69981
The memtypes changes break gcc -O0 build (none of the other optimisation
levels are affected, *any* of -Og, -Os, -O1, etc. make this go away).
Unfortunately, the option supposed to control this doesn't actually work
(-fno-keep-static-const; that not working is the actual gcc bug).
The workaround is to avoid DECLARE_MTYPE statements when their paired
DEFINE_MTYPE isn't linked in. Thankfully, that's only a problem in a
single place in vtysh where bgp_memory.h gets chain-included.
(vtysh.c -> bgp_vty.h -> bgpd.h -> bgp_memory.h)
So, this just breaks the chain at bgp_vty.h.
No other compiler (clang & icc tested) has exhibited this problem.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 29 May 2015 03:16:41 +0000 (05:16 +0200)]
build: goodbye, gawk
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
David Lamparter [Thu, 11 Feb 2016 16:12:44 +0000 (17:12 +0100)]
lib: clean/restore memory debugging functions
This adapts the dump-at-exit handler and removes the old leftover code.
(Note the text in log_memtype_stderr was actually incorrect as the only
caller in bgpd cleans up configuration before calling it, i.e. any
remaining allocations are missing-cleanup bugs.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
David Lamparter [Fri, 29 May 2015 03:48:31 +0000 (05:48 +0200)]
*: split & distribute memtypes and stop (re|ab)using lib/ MTYPEs
This is a rather large mechanical commit that splits up the memory types
defined in lib/memtypes.c and distributes them into *_memory.[ch] files
in the individual daemons.
The zebra change is slightly annoying because there is no nice place to
put the #include "zebra_memory.h" statement.
bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the
library for its own use. This is bad practice and would break when the
memtype are made static.
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: rebased for cmaster-next] Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Christian Franke <chris@opensourcerouting.org>
David Lamparter [Wed, 27 May 2015 01:45:30 +0000 (03:45 +0200)]
lib: add new extensible memory-type handling
This rewrites Quagga's memory per-type allocation counting, without
using a fixed global list of types. Instead, source files can declare
memory types which get handled through constructor functions called by
the dynamic linker during startup.
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v3: forgot "nonnull" attribute on XFREE] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 29 May 2015 02:32:33 +0000 (04:32 +0200)]
lib: move memory.[ch] out of the way
The following commit will recreate memory.[ch].
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>