summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2024-01-26lib: fix removing access/prefix listsIgor Ryzhov
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>
2024-01-26lib: add yang function for counting data nodesIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26lib: convert filters to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26lib: convert route-map to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-24Merge pull request #15173 from louis-6wind/nhrp-noarpDonald Sharp
nhrpd: unset noarp flag using a zapi message
2024-01-24Merge pull request #15196 from idryzhov/nb-leaf-listDonald Sharp
lib: remove leaf-list xpath hack from northbound
2024-01-24lib,zebra: add zapi message to control noarp flagLouis Scalbert
Add a ZAPI message to control the setting of the IFF_NOARP flag. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-23lib: remove leaf-list xpath hack from northboundIgor Ryzhov
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>
2024-01-23Merge pull request #15179 from donaldsharp/zebra_neigh_updateDonatas Abraitis
Zebra neigh update
2024-01-22lib: add address-family-specific autocompletion for prefix-listsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22lib: remove global list of distribute-listsIgor Ryzhov
It's not needed anymore, all daemons always pass context. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22lib, nhrpd: Move neighbor reg/unreg to lib/zclient.cDonald Sharp
This is needed to be generic. Let's make it so. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22*: Rename ZEBRA_NHRP_NEIGH_XXX to ZEBRA_NEIGH_XXXDonald Sharp
This does not need to be nhrp specific. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-22Merge pull request #15185 from LabNConsulting/chopps/distlistIgor Ryzhov
add northbound support to distribute-list code.
2024-01-22Merge pull request #15052 from louis-6wind/rpki-vrf-92Donatas Abraitis
bgpd: add VRF support to RPKI
2024-01-22lib: enable multiple instance support with distribute listsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22lib: add northbound support to distribute-list code.Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22Merge pull request #15176 from LabNConsulting/chopps/mgmtd-northbound-fixesIgor Ryzhov
Chopps/mgmtd northbound fixes
2024-01-19mgmtd: remove heavy duplication in mgmtd config readChristian Hopps
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>
2024-01-19lib: better conditionalize leaf-list predicate xpath additionChristian Hopps
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>
2024-01-19lib: libyang logging temp off to avoid unwanted log messageChristian Hopps
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>
2024-01-19Merge pull request #15175 from idryzhov/affinity-map-fixesChristian Hopps
2024-01-19Merge pull request #15168 from mjstapp/daemon_logsDonatas Abraitis
lib,vtysh: add per-daemon log file config
2024-01-19zebra: fix default value for affinity-modeIgor Ryzhov
- 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>
2024-01-19lib: make affinity-map value mandatoryIgor Ryzhov
There can't be an affinity map without a bit position. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-19lib: validate affinity-map bit position using the yang modelIgor Ryzhov
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>
2024-01-19lib: make affinity-map value unique in the yang modelIgor Ryzhov
It allows us to remove the code that does the same thing manually. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-19lib: validate affinity-map reference using yang modelIgor Ryzhov
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>
2024-01-18bgpd: add support of rpki in vrf configure contextPhilippe Guibert
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>
2024-01-17lib,vtysh: add per-daemon log file configMark Stapp
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>
2024-01-15Merge pull request #15154 from idryzhov/mgmt-get-dataChristian Hopps
mgmtd get-data request expansion
2024-01-15lib, mgmtd: add ability to request the exact node in get-data requestIgor Ryzhov
RESTCONF expects to receive the exact node as a result, not the whole data tree. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15lib: fix oper data leaf creationIgor Ryzhov
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>
2024-01-15lib, mgmtd: add ability to set content type in get-data requestIgor Ryzhov
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>
2024-01-14lib, mgmtd: add separate get-data request for the frontendIgor Ryzhov
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>
2024-01-14lib: fix yang_lyd_trim_xpathIgor Ryzhov
We should traverse all top-level siblings, not only the first one. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14yang: lib: interface MTUs can be larger than uint16Christian Hopps
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>
2024-01-12lib: fix coverity issueChristian Hopps
** CID 1575595: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-12Merge pull request #15133 from LabNConsulting/chopps/coverity-fixesDonatas Abraitis
lib: fix coverity issues
2024-01-12Merge pull request #14542 from idryzhov/nb-op-cb-splitChristian Hopps
Add more northbound operation types
2024-01-12Merge pull request #15136 from idryzhov/ignore-cbsDonatas Abraitis
lib, mgmtd: rename ignore_cbs to ignore_cfg_cbs
2024-01-11lib, mgmtd: rename ignore_cbs to ignore_cfg_cbsIgor Ryzhov
Setting this variable to true makes NB ignore only configuration-related callbacks. CLI-related callbacks are still loaded and executed, so rename the variable to make it clearer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11lib: fix coverity issuesChristian Hopps
** 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>
2024-01-11lib: change type of `inner` to `struct lyd_node *`, cleaner codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11lib: implement missing YANG choice/case statements.Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11lib: explain semantics of northbound operationsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmt, lib: implement REPLACE operationIgor Ryzhov
Replace operation removes the current data node configuration and sets the provided value. As current northbound code works only with one xpath at a time, the operation only makes sense to clear the config of a container without deleting it itself. However, the next step is to allow passing JSON-encoded complex values to northbound operations which will make replace operation much more useful. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11lib: move dnode creation into a separate functionIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmt, lib: differentiate DELETE and REMOVE operationsIgor Ryzhov
Currently, there's a single operation type which doesn't return error if the object doesn't exists. To be compatible with NETCONF/RESTCONF, we should support differentiate between DELETE (fails when object doesn't exist) and REMOVE (doesn't fail if the object doesn't exist). Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmtd, lib: implement CREATE_EXCL operationIgor Ryzhov
Currently, there's no difference between CREATE and MODIFY operations. To be compatible with NETCONF/RESTCONF, add new CREATE_EXCL operation that throws an error if the configuration data already exists. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>