summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-09-20lib: Fixup json code to use struct cmd_tokenDonald Sharp
2016-09-20lib: Fixup more filesDonald Sharp
2016-09-22Merge branch 'vtysh-grammar' of ↵Quentin Young
ssh://stash.cumulusnetworks.com:7999/quag/quagga into vtysh-grammar
2016-09-22lib: Remove NUMBER_TKN leftoversQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-21lib: Use listnode_add_before for prepending nodesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-21lib: Update copyright headersQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-20lib: Fixup plist.cDonald Sharp
2016-09-20lib: Fixup ns.cDonald Sharp
2016-09-20lib: Fix vty.c to compile with new parserDonald Sharp
2016-09-20lib, zebra: Fixup if.c to work in the new regimeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-20lib: Get thread.c to compileDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-20Merge remote-tracking branch 'origin/cmaster-next' into vtysh-grammarDonald Sharp
2016-09-21Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: lib/.gitignore lib/command.c lib/command.h
2016-09-21lib: Add #define str for JavaScript help stringDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-19lib: Initial refactor pass on CLI backendQuentin Young
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>
2016-09-19lib: deregister memtypes on exit/unloadDavid Lamparter
This is useful for DSO modules in order to get support for unloading them dynamically. It also runs on exit, which doesn't matter much. At some future point, the code could be extended to check that allocation counts are 0 on unloading a module. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-09-19lib: clean/restore memory debugging functionsDavid Lamparter
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>
2016-09-19*: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter
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>
2016-09-19lib: migrate to new memory-type handlingDavid Lamparter
Move over to the new allocation counting added in the previous commit. (This commit is mostly mechanical.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
2016-09-19lib: add new extensible memory-type handlingDavid Lamparter
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>
2016-09-19lib: move memory.[ch] out of the wayDavid Lamparter
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>
2016-09-18lib: Allow nesting options in selectorsQuentin Young
Options may now be nested in selectors as long as they are not the first token in sequence. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-18lib: Add edge removal to graph data structureQuentin Young
Ability to remove directed edge between two nodes. Also ensures that adjacency vectors have no null entries. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-17isisd, lib, vtysh: Allow extract.pl to fully workDonald Sharp
The regular expression for finding DEFUN/ALIAS in extract.pl looks for "DEFUN (" or "ALIAS (" if the *.c file does not have this then it will just silently ignore the cli. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-16lib, bgpd: Remove 'struct fifo' from lib/zebra.hDonald Sharp
The 'struct fifo' and it's accompanying #defines do not belong in lib/zebra.h. Move them into their own header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit b0d02889624eaafa0984873dcd78c086418bdf13)
2016-09-16lib: Remove ZEBRA_INTERFACE_RENAMEDonald Sharp
Api in name only. No code, so let's remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-16lib, ospfd: Remove ospf specific #define from zebra.hDonald Sharp
zebra.h should not know or care about ospf specific code Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-14lib, zebra: Remove ZEBRA_IPV[4|6]_IMPORT_NEXTHOPDonald Sharp
Zebra api that was never used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 33361d3992c8bff66247b76e5adaf4b0de8217df)
2016-09-14lib, zebra: Remove unused zserv/zclient callsDonald Sharp
ZEBRA_IPV4_NEXTHOP_LOOKUP and ZEBRA_IPV6_NEXTHOP_LOOKUP were never used by any protocol. Remove dead code Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 22cd6214bf44863bfb5a34b40ab4abba3c5c4574)
2016-09-14lib: Make zebra messages types a enumDonald Sharp
The #define nature of zebra message types makes it stupidly difficult to add /remove message types. Switch to enum Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 0d63e3c7df981f5b50f27789672f30987911a8cd)
2016-09-14lib: Add support for selectors inside optionsQuentin Young
Selectors may be nested inside options [<like|so>]. Removed the ability to make multipart options [like|so]. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix memory leak in ipv6_prefix_matchQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix various memory leaksQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix memory leak in matcherQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Move string completions out of command_match.cQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix various matching bugsQuentin Young
Missed a copy, disambigs forgot to walkback Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-09lib: Fix tab completions memleak, memory stats corruptionQuentin Young
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-09lib: Reorganize grammar sandboxQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-09lib: Add testing shim for graph deletionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-09lib: Add nullcheck before graph node deletionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-09vrf: add a runtime check before playing with netnsNicolas Dichtel
This patch adds a runtime check to determine if netns are available. Some systems like OpenWRT have the system call setns() but don't have the kernel option CONFIG_NET_NS enabled. Reported-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Tested-by: Christian Franke <chris@opensourcerouting.org> (cherry picked from commit 04a3aabf58d95d01c4c8168eeff43cf9d9892eee)
2016-09-09lib, vtysh: support multiple VRFs by using linux netnsFeng Lu
We realize VRFs with linux netns by default. The main job is to associate a VRF with a netns. Currently this is done by the configuration: [no] vrf N netns <netns-name> This command is also available in vtysh and goes to only zebra, because presently only zebra supports multiple VRF. A file descriptor is added to "struct vrf". This is for the associated netns file. Once the command "vrf N netns NAME" is executed, the specified file is opened and the file descriptor is stored in the VRF N. In this way the association is formed. In vrf_socket(), we first switch to the specified VRF by using the stored file descriptor, and then can allocate a socket which is working in the associated netns. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> (cherry picked from commit 55cfa2f190620f7c711944637659bc208970324d)
2016-09-09lib: Create ns.cDonald Sharp
Create the ns.c files from the original vrf.c code to allow us to create the 'logical-router' command to work within namespaces. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-09-08lib: Fix dangling pointer in matcherQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08quagga: remove refix directory from git statusDonald Sharp
During one of our build processes we are getting a refix directory in some places. Remove these from files that git considers Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 844cbf5d6cdfc6961e99e1c9ed35b826f3aa7562)
2016-09-08Merge remote-tracking branch 'origin/cmaster' into cmaster-nextDonald Sharp
2016-09-08lib: Fix uninitialized pointer segfaultQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Update grammar sandbox driverQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Add <cr> text for end nodesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Remove automatic node deletionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>