summaryrefslogtreecommitdiff
path: root/ospfd/ospf_apiserver.c
AgeCommit message (Collapse)Author
2024-04-25ospfd: OSPFAPI Server options to limit to local connections and per-instance TCPAcee Lindem
This commit include OSPFAPI Server options to: 1. Allow specification of the OSPFAPI server local address. 2. Allow different OSPFAPI server TCP ports to be specified for different OSPF instances in /etc/services. Signed-off-by: Acee Lindem <acee@lindem.com>
2023-12-20ospfd: Fix opaque functab leak and opaque AS cleanup problemsAcee
1. Fix ospf opaque LSA function table memory leak. 2. Remove incorrect one-to-one association of OSPF info-per-type to function table (since there many be many). 3. Fix a problem with opaque AS external cleanup that was exposed by #2. 4. Fix LSA memory leak in ospf_opaque_type9_lsa_if_cleanup(). Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-09 ospfd: OSPF opaque LSA stale processing fix and topotests.Acee
1. Fix OSPF opaque LSA processing to preserve the stale opaque LSAs in the Link State Database for 60 seconds consistent with what is done for other LSA types. 2. Add a topotest that tests for cases where ospfd is restarted and a stale OSPF opaque LSA exists in the OSPF routing domain both when the LSA is purged and when the LSA is reoriginagted with a more recent instance. Signed-off-by: Acee <aceelindem@gmail.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-18ospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.cDonald Sharp
Clean up some memory leaks found in ospf_apiserver.c Also a crash in the original implementation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-20ospfd: compare prefix values in host orderChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-12-05ospfd: Remove MTYPE_TMPDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-21ospfd/ospfclient: add option to flush/withdrawal with zero lengthLou Berger
default behavior is unchanged, i.e., to not zero Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-21ospfd: ospf_apiserver.c - fix link local opaque LSA deleteLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2022-08-22ospfd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-07-21ospfd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23ospfd: add router id support to ospf apiChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02ospfd: api: always ready to receive opaque from clientChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02ospfd: api: add new ISM and NSM sync requestsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02ospfd: api: remove unused api code/message creationChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02ospfd: api: fix recovery of LSA after restart of api clientChristian Hopps
Prior to this fix, restarting the client just failed b/c the code tried to "refresh" the existing LSA being added, except that code checked for meta-data to exist, which was deleted when the client disconnected previously (or had never connected and the LSA state was picked up from the network). Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02ospfd: api: add reachable router notificationsChristian Hopps
Reachable router information is used by OSPF opaque clients in order to determine if the router advertising the opaque LSA data is reachable (i.e., 2-way conectivity check). Signed-off-by: Christian Hopps <chopps@labn.net>
2022-05-26ospfd: cli: add opaque data to json outputChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-01*: Fix spelling of FollowingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02ospfd: Convert `enum event` to `enum ospf_apiserver_event`Donald Sharp
Let's name this something more appropriate to what is being done. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-08ospfd: fix display of plain-text data on "show ... json" commandsRenato Westphal
Add a 'json' parameter to the 'show_opaque_info' callback definition, and update all instances of that callback to not display plain-text data when the user requested JSON data. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-05-19ospfd: Correct Coverity defectsOlivier Dugeon
When browsing or parsing OSPF LSA TLVs, we need to use the LSA length which is part of the LSA header. This length, encoded in 16 bits, must be first converted to host byte order with ntohs() function. However, Coverity Scan considers that ntohs() function return TAINTED data. Thus, when the length is used to control for() loop, Coverity Scan marks this part of the code as defect with "Untrusted Loop Bound" due to the usage of Tainted variable. Similar problems occur when browsing sub-TLV where length is extracted with ntohs(). To overcome this limitation, a size attribute has been added to the ospf_lsa structure. The size is set when lsa->data buffer is allocated. In addition, when an OSPF packet is received, the size of the payload is controlled before contains is processed. For OSPF LSA, this allow a secure buffer allocation. Thus, new size attribute contains the exact buffer allocation allowing a strict control during TLV browsing. This patch adds extra control to bound for() loop during TLV browsing to avoid potential problem as suggested by Coverity Scan. Controls are based on new size attribute of the ospf_lsa structure to avoid any ambiguity. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-10-23* : update signature of thread_cancel apiMark Stapp
Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22ospfd: replace inet_ntoaMark Stapp
Stop using inet_ntoa, use %pI4 etc or inet_ntop instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-05ospfd: clean up SA warningMark Stapp
remove an unneeded initialization to clear up an SA report. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-11-21ospfd: nbr->oi is never nullDonald Sharp
We test nbr->oi in a couple of places for null, but in the majority of places of the nbr->oi data is being used we just access it. Touch up code to trust this assertion and make the code more consistent in others. Found in Coverity. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-19ospfd: remove empty debugMark Stapp
Remove empty debug line - empty format string generates a compile warning. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-03-14*: remove trailing newlines from zlog messagesQuentin Young
Zlog puts its own newlines on, and doing this makes logs look nasty. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-13ospfd: OSPF_[ERR|WARN] -> EC_OSPFQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06*: style for flog_warn conversionsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06ospfd: Add OSPF_WARN_LSA_INSTALL_FAILURE error codeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06ospfd: Add OSPF_WARN_OPAQUE_REGISTRATIONDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-20ospfd: Add ospf_lsa_new_and_data function and abstract awayDonald Sharp
In all but one instance we were following this pattern with ospf_lsa_new: ospf_lsa_new() ospf_lsa_data_new() so let's create a ospf_lsa_new_and_data to abstract this bit of fun and cleanup all the places where it assumes these function calls can fail. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11*: ALLOC calls cannot failDonald Sharp
There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-27ospfd: null check (Coverity 23110)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20ospfd: null check (Coverity 23110)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-01-17ospfd: LSDB_LOOP treat it as a loop.Donald Sharp
Inform the .clang-format file about LSDB_LOOP and put the proper indentation for this loop into the code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>