summaryrefslogtreecommitdiffstats
path: root/lib/keychain.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: use gmtime_r, localtime_r exclusivelyMark Stapp2020-03-051-3/+3
| | | | | | Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* lib: reduce exported var symbolsQuentin Young2019-04-031-1/+1
| | | | | | Don't need these in our DSO tables Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove null check before XFREEQuentin Young2019-02-261-4/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-241-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* ripd: null check keylyq1402018-08-011-1/+1
| | | | | | | | | Fix ripd crash of null pointer. when authenticate a rip packet, the key pointer or the key string pointer may be null, the code have to return then. Signed-off-by: lyq140 <34637052+lyq140@users.noreply.github.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-4/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* lib: 'no accept-lifetime' and 'no send-lifetime' for keychaindturlupov2018-02-071-0/+40
| | | | Signed-off-by: Dmitrii Turlupov <dturlupov@factor-rs.ru>
* *: add missing \n in some help stringsRenato Westphal2017-10-241-4/+4
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-652/+655
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-7/+7
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-7/+7
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
* | *: remove VTYNL, part 1 of 6David Lamparter2017-07-141-2/+2
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-11/+11
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young2017-06-291-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use vty_outlnQuentin Young2017-06-291-13/+13
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove VTY_GET_*Quentin Young2017-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CLI validates input tokens, so there's no need to do it in handler functions anymore. spatch follows ---------------- @getull@ expression v; expression str; @@ <... - VTY_GET_ULL(..., v, str) + v = strtoull (str, NULL, 10) ...> @getul@ expression v; expression str; @@ <... - VTY_GET_ULONG(..., v, str) + v = strtoul (str, NULL, 10) ...> @getintrange@ expression name; expression v; expression str; @@ <... - VTY_GET_INTEGER_RANGE(name, v, str, ...) + v = strtoul (str, NULL, 10) ...> @getint@ expression v; expression str; @@ <... - VTY_GET_INTEGER(..., v, str) + v = strtoul (str, NULL, 10) ...> @getv4@ expression v; expression str; @@ <... - VTY_GET_IPV4_ADDRESS(..., v, str) + inet_aton (str, &v) ...> @getv4pfx@ expression v; expression str; @@ <... - VTY_GET_IPV4_PREFIX(..., v, str) + str2prefix_ipv4 (str, &v) ...> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-18/+18
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter2017-03-281-2/+2
| | | | | | | | | | These have copies in vtysh that do the node-switch locally and are listed in extract.pl's ignore list. The ignore list however is redundant since DEFUN_NOSH does the same thing... ldpd is a bit hacky, but Renato is reworking this anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: remove vty->indexDavid Lamparter2016-12-091-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'cmaster-next' into vtysh-grammarQuentin Young2016-10-181-66/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_route.c bgpd/bgp_routemap.c bgpd/bgp_vty.c isisd/isis_redist.c isisd/isis_routemap.c isisd/isis_vty.c isisd/isisd.c lib/command.c lib/distribute.c lib/if.c lib/keychain.c lib/routemap.c lib/routemap.h ospf6d/ospf6_asbr.c ospf6d/ospf6_interface.c ospf6d/ospf6_neighbor.c ospf6d/ospf6_top.c ospf6d/ospf6_zebra.c ospf6d/ospf6d.c ospfd/ospf_routemap.c ospfd/ospf_vty.c ripd/rip_routemap.c ripngd/ripng_routemap.c vtysh/extract.pl.in vtysh/vtysh.c zebra/interface.c zebra/irdp_interface.c zebra/rt_netlink.c zebra/rtadv.c zebra/test_main.c zebra/zebra_routemap.c zebra/zebra_vty.c
| * lib: replace vty->index_sub with qobjDavid Lamparter2016-10-071-57/+20
| | | | | | | | | | | | | | The keychain code is the only user of vty->index_sub; this is also replaced with a qobj safe-pointer. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib: use qobj for vty->index context positionDavid Lamparter2016-10-071-8/+3
| | | | | | | | | | | | | | Prepares the library CLI functions for concurrent config access. Note the vty->index pointer is still kept functional for the daemons to use. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib: qobj: register ifaces, routemaps & keychainsDavid Lamparter2016-10-071-2/+12
| | | | | | | | | | | | | | This places the appropriate calls so library objects can be used with qobj "pointers", especially in the CLI. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib: add 'int idx_foo' argv index variablesDaniel Walton2016-09-231-38/+143
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | convert <1-255> to (1-255), ()s to <>s, etcDaniel Walton2016-09-231-18/+18
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | lib: argv update for filter.c, if_rmap.c keychain.c and plist.cDaniel Walton2016-09-231-38/+38
| | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | Revert "lib: Fixup more files"Daniel Walton2016-09-221-38/+38
| | | | | | | | This reverts commit f68cec764abf50b35945b907a2e005bc50c50831.
* | lib: Fixup more filesDonald Sharp2016-09-211-38/+38
|/
* *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter2016-09-191-0/+3
| | | | | | | | | | | | | | | | | | | 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>
* lib: silence type range warning in macroDavid Lamparter2016-05-261-6/+10
| | | | | | | | | While splitting up the CLI input macro is a bit annoying, this seems to be the least annoying way to get rid of the "< 0" comparison warning for unsigned long. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 81a4e85442e2011a47bbb25e8301dc40ec4ed9b6)
* Fixup code to use correct XMALLOC operatorsDonald Sharp2015-08-261-6/+6
| | | | | | | | | | | Ticket: CM-7177 Reviewed-by: CCR-3396 Testing: See bug This code change does several small things: (A) Fix a couple detected memory leaks (B) Fix all malloc operations to use the correct XMALLOC operation in bgpd and parts of lib (C) Adds a few new memory types to make it easier to detect issues
* *: nuke ^L (page feed)David Lamparter2014-06-041-4/+4
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* [cleanup] Make command nodes staticStephen Hemminger2009-06-121-2/+2
| | | | | The cmd_nodes used to configure vty, can mostly be static so (basic data hiding 101).
* [cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger2009-06-121-8/+2
| | | | Simple conversion of XMALLOC/memset to XCALLOC
* 2005-05-06 Paul Jakma <paul@dishone.st>paul2005-05-061-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | * (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h
* 2005-04-07 Paul Jakma <paul.jakma@sun.com>paul2005-04-071-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
* 2004-10-31 Paul Jakma <paul@dishone.st>paul2004-10-311-24/+5
| | | | * keychain.c: Convert some more strtoul users to VTY_GET_INTEGER.
* Number of warnings is down to 3 again in lib directory. A lot of const'shasso2004-10-051-20/+23
| | | | added to strings and a lot of int -> unsigned int changes.
* Many warning fixes from PC Drew ([quagga-dev 940]) and removing using PAGERhasso2004-03-041-2/+2
| | | | from vtysh ([quagga-dev 932]).
* Initial revisionpaul2002-12-131-0/+1001