summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: create `frr_daemon_state_{load,save}`David Lamparter2024-01-273-0/+164
| | | | | | | | | | | These functions load daemon-specific persistent state from `/var/lib/frr` and supersede open-coded variants of similar calls in ospfd, ospf6d and isisd to save GR state and/or sequence numbers. Unlike the open-coded variants, the save call correctly `fsync()`s the saved data to ensure disk contents are consistent. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: set up `frr_libstatedir`David Lamparter2024-01-272-0/+5
| | | | | | | This needs to be used for persistent state, which currently is misplaced into `/var/run` / `/run` where it gets deleted across reboots. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* build: nuke `ZEBRA_SERV_PATH`David Lamparter2024-01-272-7/+8
| | | | | | This just unnecessarily complicates things by involving autoconf. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib, mgmtd: fix wrong mgmtd socket pathsDavid Lamparter2024-01-273-2/+12
| | | | | | These paths were ignoring the `-N` namespacing option. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: rename `frr_vtydir` to `frr_runstatedir`David Lamparter2024-01-272-16/+9
| | | | | | Also remove frr_init_vtydir(), just initialize to default. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripngd: convert ripngd to mgmtdChristian Hopps2024-01-261-0/+3
| | | | | | - a couple small fixes for ripd conversion as well. Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #15220 from LabNConsulting/chopps/ripd-convertIgor Ryzhov2024-01-2610-183/+221
|\ | | | | ripd to mgmtd
| * ripd: ripd convert to mgmtdChristian Hopps2024-01-261-0/+3
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
| * lib: fix removing access/prefix listsIgor Ryzhov2024-01-261-177/+80
| | | | | | | | | | | | | | | | CLI for access/prefix list removal was using `nb_cli_apply_changes` multiple times in the same command. It's fine for regular daemons but not for mgmtd. Refactor the code to apply changes only once. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * lib: add yang function for counting data nodesIgor Ryzhov2024-01-262-0/+39
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * lib: convert filters to mgmtdChristian Hopps2024-01-263-4/+45
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
| * lib: convert route-map to mgmtdChristian Hopps2024-01-263-2/+54
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #15221 from mjstapp/log_immed_configDonatas Abraitis2024-01-253-3/+11
|\ \ | |/ |/| lib: add log immediate-mode to running config output
| * lib: add log immediate-mode to running config outputMark Stapp2024-01-243-3/+11
| | | | | | | | | | | | | | The immediate-mode config wasn't in the running config output; add it. Signed-off-by: Mark Stapp <mjs@labn.net>
* | Merge pull request #15173 from louis-6wind/nhrp-noarpDonald Sharp2024-01-242-0/+22
|\ \ | | | | | | nhrpd: unset noarp flag using a zapi message
| * | lib,zebra: add zapi message to control noarp flagLouis Scalbert2024-01-242-0/+22
| |/ | | | | | | | | | | Add a ZAPI message to control the setting of the IFF_NOARP flag. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | Merge pull request #15196 from idryzhov/nb-leaf-listDonald Sharp2024-01-244-26/+9
|\ \ | |/ |/| lib: remove leaf-list xpath hack from northbound
| * lib: remove leaf-list xpath hack from northboundIgor Ryzhov2024-01-234-26/+9
| | | | | | | | | | | | | | | | | | | | | | Currently, when editing a leaf-list, `nb_candidate_edit` expects to receive it's xpath without a predicate and the value in a separate argument, and then creates the full xpath. This hack is complicated, because it depends on the operation and on the caller being a backend or not. Instead, let's require to always include the predicate in a leaf-list xpath. Update all the usages in the code accordingly. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #15179 from donaldsharp/zebra_neigh_updateDonatas Abraitis2024-01-233-12/+38
|\ \ | | | | | | Zebra neigh update
| * | lib, nhrpd: Move neighbor reg/unreg to lib/zclient.cDonald Sharp2024-01-222-2/+28
| | | | | | | | | | | | | | | | | | This is needed to be generic. Let's make it so. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Rename ZEBRA_NHRP_NEIGH_XXX to ZEBRA_NEIGH_XXXDonald Sharp2024-01-222-10/+10
| |/ | | | | | | | | | | This does not need to be nhrp specific. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | lib: add address-family-specific autocompletion for prefix-listsIgor Ryzhov2024-01-221-0/+14
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | lib: remove global list of distribute-listsIgor Ryzhov2024-01-221-20/+4
|/ | | | | | It's not needed anymore, all daemons always pass context. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Merge pull request #15185 from LabNConsulting/chopps/distlistIgor Ryzhov2024-01-222-11/+169
|\ | | | | add northbound support to distribute-list code.
| * lib: enable multiple instance support with distribute listsChristian Hopps2024-01-222-16/+22
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
| * lib: add northbound support to distribute-list code.Christian Hopps2024-01-222-1/+153
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #15052 from louis-6wind/rpki-vrf-92Donatas Abraitis2024-01-221-0/+1
|\ \ | | | | | | bgpd: add VRF support to RPKI
| * | bgpd: add support of rpki in vrf configure contextPhilippe Guibert2024-01-181-0/+1
| |/ | | | | | | | | | | | | Add support of RPKI commands in the VRF configure context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | Merge pull request #15176 from LabNConsulting/chopps/mgmtd-northbound-fixesIgor Ryzhov2024-01-226-32/+68
|\ \ | | | | | | Chopps/mgmtd northbound fixes
| * | mgmtd: remove heavy duplication in mgmtd config readChristian Hopps2024-01-192-9/+21
| | | | | | | | | | | | | | | | | | | | | Previously each container created all it's decendents before descending into the children and repeating the process. Signed-off-by: Christian Hopps <chopps@labn.net>
| * | lib: better conditionalize leaf-list predicate xpath additionChristian Hopps2024-01-196-21/+36
| | | | | | | | | | | | | | | | | | | | | If we're in the backend we already have the predicate added by mgmtd -- don't add it again. Signed-off-by: Christian Hopps <chopps@labn.net>
| * | lib: libyang logging temp off to avoid unwanted log messageChristian Hopps2024-01-191-1/+10
| |/ | | | | | | | | | | | | We don't want libyang logging when an schema path doesn't exist since this is an acceptable outcome. Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #15175 from idryzhov/affinity-map-fixesChristian Hopps2024-01-194-78/+2
|\ \
| * | zebra: fix default value for affinity-modeIgor Ryzhov2024-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - initialize the necessary bit when creating if_link_params - fix CLI description to mark extended as the default mode - correctly set mode to extended when using the "no" form of the command - handle the "show_defaults" parameter correctly in cli_show callback Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: make affinity-map value mandatoryIgor Ryzhov2024-01-191-6/+0
| | | | | | | | | | | | | | | | | | There can't be an affinity map without a bit position. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: validate affinity-map bit position using the yang modelIgor Ryzhov2024-01-193-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | When affinity mode is "standard", bit position cannot be greater than 31. Add a "must" statement to the YANG model to validate this, and remove our custom validation code that does the same. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: make affinity-map value unique in the yang modelIgor Ryzhov2024-01-193-24/+0
| | | | | | | | | | | | | | | | | | It allows us to remove the code that does the same thing manually. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: validate affinity-map reference using yang modelIgor Ryzhov2024-01-193-22/+1
| |/ | | | | | | | | | | | | | | | | | | Change the type of affinity leaf-list in frr-zebra to a leafref with "require-instance" property set to true. This change tells libyang to automatically check that affinity-map exists before usage and doesn't allow it to be deleted if it's referenced. It allows us to remove all the manual code that is doing the same thing. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #15168 from mjstapp/daemon_logsDonatas Abraitis2024-01-193-0/+78
|\ \ | |/ |/| lib,vtysh: add per-daemon log file config
| * lib,vtysh: add per-daemon log file configMark Stapp2024-01-173-0/+78
| | | | | | | | | | | | | | | | Add a config that specifies per-deamon log file names. Move the handy generated list of daemon names from vtysh to lib; edit the gitignore files to match. Signed-off-by: Mark Stapp <mjs@labn.net>
* | Merge pull request #15154 from idryzhov/mgmt-get-dataChristian Hopps2024-01-158-35/+82
|\ \ | | | | | | mgmtd get-data request expansion
| * | lib, mgmtd: add ability to request the exact node in get-data requestIgor Ryzhov2024-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | RESTCONF expects to receive the exact node as a result, not the whole data tree. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: fix oper data leaf creationIgor Ryzhov2024-01-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating an initial tree trunk for oper data walk, if the xpath represents a leaf, the leaf is created with an incorrect empty value. If it doesn't actually exist in daemon's oper data, its value is not overwritten later and an empty value is returned in the result. For example, when requesting `/frr-interface:lib/interface[name='eth0']/description`, the result is: ``` { "frr-interface:lib": { "interface": [ { "name": "eth0", "description": "" } ] } } ``` instead of an empty JSON that it should be. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib, mgmtd: add ability to set content type in get-data requestIgor Ryzhov2024-01-155-8/+21
| | | | | | | | | | | | | | | | | | | | | Like in RESTCONF GET request and NETCONF get-data request, make it possible to request state-only, config-only, or all data. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib, mgmtd: add separate get-data request for the frontendIgor Ryzhov2024-01-146-16/+36
| | | | | | | | | | | | | | | | | | | | | Currently it's the same as get-tree request for the backend, but it is going to be expanded in the following commits. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * | lib: fix yang_lyd_trim_xpathIgor Ryzhov2024-01-141-12/+15
| | | | | | | | | | | | | | | | | | We should traverse all top-level siblings, not only the first one. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | yang: lib: interface MTUs can be larger than uint16Christian Hopps2024-01-141-1/+1
|/ / | | | | | | | | | | | | Technically changing a leaf from uint16 to uint32 is a NBC change; however, increasing this to uint32 should not break anyone in reality. Signed-off-by: Christian Hopps <chopps@labn.net>
* | lib: fix coverity issueChristian Hopps2024-01-121-1/+2
| | | | | | | | | | | | ** CID 1575595: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #15133 from LabNConsulting/chopps/coverity-fixesDonatas Abraitis2024-01-122-3/+2
|\ \ | |/ |/| lib: fix coverity issues
| * lib: fix coverity issuesChristian Hopps2024-01-112-3/+2
| | | | | | | | | | | | | | | | | | ** CID 1575504: Insecure data handling (TAINTED_SCALAR) (maybe) ** CID 1575505: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575506: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575507: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>