summaryrefslogtreecommitdiffstats
path: root/isisd/isis_misc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* isisd: replace gmtime with gmtime_rMark Stapp2023-07-101-8/+8
| | | | | | No gmtime() allowed - use gmtime_r() Signed-off-by: Mark Stapp <mjs@labn.net>
* isisd: Update to the new printfrr ISO formatOlivier Dugeon2023-03-211-95/+7
| | | | | | | | | This path replaces isisd_format_id, sysid_print, snpa_print, rawlspid_print and isonet_print functions by the new printfrr ISO System ID & Network Address format facilities. It also updates the isisd code to the new iso_address structure defined in lib/iso.h Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* isisd,tests,doc: Rename hello padding sometimes to hello padding ↵Diogo Oliveira2023-02-281-2/+2
| | | | | | during-adjacency-formation Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
* isisd: Add support for isis hello padding sometimesDiogo Oliveira2023-02-281-0/+13
| | | | | | New configuration to pad ISIS hello packets during adjacency formation only. Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: per-instance dynamic hostname cacheIgor Ryzhov2021-06-111-3/+6
| | | | | | | | | | | | | Currently, the dynamic hostname cache is global. It is incorrect because neighbors in different VRFs may have the same system ID and different hostnames. This also fixes a memory leak - when the instance is deleted, the cache must be cleaned up and the cleanup thread must be cancelled. Fixes #8832. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: remove more sprintf()Quentin Young2021-02-091-30/+47
| | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* tests, isisd: add IS-IS SPF unit testsRenato Westphal2020-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | Now that the IS-IS SPF code is more modular, write some unit tests for it. This commit includes a new test program called "test_isis_spf" which can load any test topology (there are 13 different ones available) and run SPF on any desired node. In the future this same test program and topologies will also be used to test reverse SPF and TI-LFA. The "test_common.c" file contains helper functions used to parse the topology descriptions from "test_topologies.c" into LSP databases that can be used as an input to the SPF code. This commit also introduces the F_ISIS_UNIT_TEST flag which is used to prevent the IS-IS code from scheduling any event when running under the context of an unit test. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: minor cleanupRenato Westphal2020-08-271-3/+2
| | | | | | | | | | * Bring back some consts that were removed; * Replace ALL_LIST_ELEMENTS by ALL_LIST_ELEMENTS_RO whenever possible; * Fix some CLI return values; * Remove some unnecessary initializations. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd : Transformational changes to support different VRFs.Kaushik2020-08-141-2/+5
| | | | | | | | | 1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
* *: remove PRI[udx](8|16|32)David Lamparter2020-07-141-1/+1
| | | | | | | | | | | These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
* isisd: split vty_out_timestr() into two helper functionsRenato Westphal2020-04-301-0/+20
| | | | | | | | | The new log_uptime() function logs an UNIX timestamp to a buffer provided by the user. It's very flexibile and can be used in a variety of contexts, different from vty_out_timestr() which is too tied to the VTY code. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: replace all random() callsRafael Zalamena2020-04-181-1/+2
| | | | | | | | | | | Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* lib, *: add a common time interval formatting apiMark Stapp2020-03-091-13/+5
| | | | | | | | Add a common api that formats a time interval into a string with different output for short and longer intervals. We do this in several places, for cli/ui output. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: use gmtime_r, localtime_r exclusivelyMark Stapp2020-03-051-8/+9
| | | | | | Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: fix ctype (isalpha & co.) castsDavid Lamparter2019-08-061-2/+4
| | | | | | | | | The correct cast for these is (unsigned char), because "char" could be signed and thus have some negative value. isalpha & co. expect an int arg that is positive, i.e. 0-255. So we need to cast to (unsigned char) when calling any of these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix printfrr derpDavid Lamparter2019-07-031-2/+2
| | | | | | | Yeah, gotta use v... if the arg is a va_list... Fixes: #4600 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: use snprintfrr() in "hidden" printfsDavid Lamparter2019-06-121-33/+9
| | | | | | | | We need to be calling snprintfrr() instead of snprintf() in places that wrap snprintf in some user-exposed way; otherwise the extensions won't be available for those functions. Signed-off-by: David Lamparter <equinox@diac24.net>
* Merge pull request #3045 from opensourcerouting/atomsLou Berger2019-04-301-1/+0
|\ | | | | READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
| * isisd: replace dict_* with DECLARE_RBTREEDavid Lamparter2019-04-271-1/+0
| | | | | | | | | | | | | | | | Historically, isisd has been carrying around its own red-black tree to manage its LSP DB in. This replaces that with the newly-added DECLARE_RBTREE_*. This allows completely removing the dict_* code. Signed-off-by: David Lamparter <equinox@diac24.net>
* | lib: move zlog() prototype back to the public logging APIRenato Westphal2019-04-181-1/+0
|/ | | | | | | | zlog() should be part of the public logging API as it's useful in the cases where the logging priority isn't known at compile time (i.e. it depends on a variable). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | 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>
* lib: new APIs for get/set system hostname/domainnameMitesh Kanjariya2017-08-291-1/+1
| | | | | | | | | 1. Change hostname_get to cmd_hostname_get 2. Change domainname_get to cmd_domainname_get 3. New API to set domainname 3. Provide a CLI command to set domainname Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* lib/bgpd: provide/use API to get hostname/domainnameMitesh Kanjariya2017-08-251-19/+1
| | | | Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* *: Define the number of seconds in a Day, Week and yearDonald Sharp2017-08-081-2/+0
| | | | | | | | | | | | | The defines: ONE_DAY_SECOND ONE_WEEK_SECOND ONE_YEAR_SECOND were being defined all over the system, move the define to a central location. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: make isis_spftree non-publicChristian Franke2017-08-031-0/+21
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: send/receive LSPs with new parserChristian Franke2017-08-031-21/+1
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: add formatter codeChristian Franke2017-08-031-80/+129
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-445/+386
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+4
| | | | | | | | | | | 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>
* Quagga: Fix code to use srandom/randomDonald Sharp2016-05-301-1/+1
| | | | | | | | Quagga was using a mix of srand/rand and srandom/random. Consolidate to use srandom/random which are the POSIX versions of random number generators Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: annotate some function arguments with constChristian Franke2016-03-301-5/+5
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: add Google's changes to IS-ISJosh Bailey2012-04-071-6/+128
|
* [isisd] Fix compiler warnings and allow v4-only compilationPaul Jakma2006-12-081-8/+8
| | | | | | | | | | | 2006-12-08 Hannes Gredler <hannes@gredler.at> * isis_adjacency.c: (isis_new_adj) Allow NULL snpa argument. * isis_pdu.c: (various) Update calls to isis_new_adj() to pass NULL and use default. * (general) Add forward declarations where required. Fix up const char *'s. Allow V4-only compilation.
* [isisd] remove includes of common system headers.paul2005-11-201-5/+0
| | | | | | | | | | | 2005-11-20 Paul Jakma <paul.jakma@sun.com> * (general) remove includes of very common system headers, these are already picked up by zebra.h. Further, including them before zebra.h messes up all our lovely (sarcasm) autoconf'd detecting of platform specific things. Recent addition of stdint.h to configure.ac and zebra.h appears particularly to throw up this problem.
* * isis_misc.[ch]: Fix some warnings, making some strings const.hasso2005-08-161-2/+2
|
* No warnings here any more.hasso2004-10-071-5/+5
|
* Compiler warnings fixes.hasso2004-09-261-11/+11
|
* * isisd.c: thread_master *master is already defined in isis_main.c.hasso2004-09-241-0/+15
| | | | | * isis_misc.[c|h], isis_lsp.[c|h]: Move static variables out of header files.
* Indentation only. No any functional changes.hasso2004-09-101-213/+252
|
* Make it compile in NetBSD and OpenBSD.hasso2004-05-191-1/+0
|
* Some fixes to isisd done by me and Cougar in the spring of 2003. Seehasso2003-12-231-1/+10
| | | | changelog for details.
* Merge isisd into the Quagga's framework:jardin2003-12-231-4/+20
| | | | | | | | | | - add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma.
* Initial revisionjardin2003-12-231-0/+438