mirror_frr/lib
Renato Westphal ec3ee0ebb8 lib: make nb_candidate_edit() more flexible
Certain operations, like removing non-presence containers or
modifying list keys, are not considered to be valid from the
perspective of the northbound layer. This is because we want to
implement a minimum set of northbound configuration callbacks and
use them to process all possible configuration changes.

The removal of a np-container [1], for example, can be processed by
calling the "delete" callback of all of its child nodes (recursion
is used for np-container child nodes). Similarly, the modification
of a list key can be processed as if the corresponding list entry
was removed and readded with updated key values. This strategy saves
us the burden of implementing lots of extra configuration callbacks.

That said, the nb_operation_is_valid() function shouldn't be used
for anything other than checking which callbacks are valid for
which YANG nodes. Using it in the nb_candidate_edit() function
is inappropriate as we want as much flexibility as possible when
editing a candidate configuration. We should allow CLI commands,
for example, to remove np-containers (the northbound layer will then
figure out which callbacks need to be called when this candidate
is committed). Remove the check.

[1] We can't do the same for presence containers since they have a
"create" callback associated with them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-04-18 13:15:13 -03:00
..
.gitignore *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
agentx.c lib: remove agentx already enabled warning 2018-10-28 02:50:47 +00:00
agg_table.c bgpd, lib, zebra: Wrapper get/set of table->info pointer 2018-09-23 20:04:39 -04:00
agg_table.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
bfd.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
bfd.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
bitfield.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
buffer.c *: LIB_[ERR|WARN] -> EC_LIB 2018-09-13 19:34:28 +00:00
buffer.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
checksum.c *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
checksum.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
clippy.c lib: untrusted argument (Coverity 1448386) 2018-06-27 15:50:04 +02:00
clippy.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
command_graph.c *: use proper bool initializers & fix comparisons 2019-02-25 23:00:16 +00:00
command_graph.h lib: a few more trivial changes for C++ compatibility 2019-02-11 22:34:12 -02:00
command_lex.l lib: change M:A:C to X:X:X:X:X:X 2018-10-24 21:44:33 +00:00
command_match.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
command_match.h lib: rename enum to avoid conflict 2019-02-11 22:34:12 -02:00
command_parse.y lib: Convert zlog_err for clippy build 2018-08-14 20:02:05 +00:00
command_py.c Revert "isisd lib ospfd pbrd python: fix empty init" 2018-12-01 16:49:45 +01:00
command.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
command.h lib: Allow DEFPY_HIDDEN to exist in vtysh 2019-02-20 19:26:15 -05:00
compiler.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
csv.c Merge pull request #2965 from opensourcerouting/buildfoo-20180904 2018-09-09 14:11:10 -04:00
csv.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
db.c lib: introduce new northbound API 2018-10-27 16:16:12 -02:00
db.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
debug.c lib: fix inverted logic in the "debug all" command 2019-04-15 12:53:54 -03:00
debug.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
defun_lex.l lib: early-include "config.h" in flex lexers 2018-09-09 01:16:25 +02:00
distribute.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
distribute.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
ferr.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
ferr.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
fifo.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
filter.c *: remove casts of XMALLOC / XCALLOC 2019-02-25 23:00:46 +00:00
filter.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
freebsd-queue.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
frr_pthread.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
frr_pthread.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
frr_zmq.c *: do not check XMALLOC / XCALLOC for null ret 2019-02-25 23:00:44 +00:00
frr_zmq.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
frratomic.h lib: make atomic ops C++ compatible 2019-02-11 15:49:49 -02:00
frrstr.c *: return bool from boolean functions 2019-02-25 23:00:16 +00:00
frrstr.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
getopt1.c *: reindent 2017-07-17 14:04:07 +02:00
getopt.c Revert "*: reindent pt. 2" 2017-07-22 14:52:33 +02:00
getopt.h *: reindent 2017-07-17 14:04:07 +02:00
gitversion.pl build: make gitversion more useful 2017-08-02 02:59:51 +02:00
grammar_sandbox_main.c *: fix config.h/zebra.h include order 2018-09-08 21:30:42 +02:00
grammar_sandbox.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
graph.c Treewide: use ANSI function definitions 2019-01-24 11:21:59 +01:00
graph.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
hash.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
hash.h lib: add compatibility #define for hash_backet 2019-02-25 17:08:45 +00:00
hook.c lib: flip to ISC on hook & module code 2018-12-14 16:24:06 +01:00
hook.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
id_alloc.c libs: rename two id_alloc macros to resolve bsd conflict 2018-11-14 14:04:55 -05:00
id_alloc.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
if_rmap.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
if_rmap.h eigrp, rip, ripng, lib: unlink if_rmap from vrf 2019-02-19 21:11:37 +01:00
if.c lib: Fixup IFF_OUT_LOG macro to make SA happy 2019-04-06 20:10:52 -04:00
if.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
imsg-buffer.c lib, ldpd: fix SA warnings from TAILQ oddness 2018-09-08 20:34:32 +02:00
imsg.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
imsg.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
ipaddr.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
jhash.c *: remove unnecessary semicolon from switches 2019-02-25 23:00:16 +00:00
jhash.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
json.c bgpd/ospfd: make bgp and ospf json response a bit more consistent 2018-08-30 12:40:18 +00:00
json.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
keychain.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
keychain.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
lib_errors.c lib: update suggestions related to some northbound errors 2019-01-14 16:33:37 -02:00
lib_errors.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
libfrr.c lib: don't initialize the northbound database in the unit tests 2019-04-18 13:06:14 -03:00
libfrr.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
libospf.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
linklist.c lib: add listnode_add_force utility routine 2019-03-29 15:04:49 +01:00
linklist.h lib: add listnode_add_force utility routine 2019-03-29 15:04:49 +01:00
log_int.h lib: move zlog() prototype back to the public logging API 2019-04-18 13:15:13 -03:00
log.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
log.h lib: introduce flog() to simplify the northbound code a little bit 2019-04-18 13:17:54 -03:00
logicalrouter.c *: conform with COMMUNITY.md formatting rules, via 'make indent' 2018-03-06 14:04:32 -05:00
logicalrouter.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
lua.c lua: Initial Lua import 2018-09-26 21:21:23 -04:00
lua.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
Makefile build: convert lib/ to non-recursive build 2017-07-31 23:03:27 +02:00
md5.c Treewide: use ANSI function definitions 2019-01-24 11:21:59 +01:00
md5.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
memory_vty.c lib: Cleanup include of link.h 2018-09-08 12:00:17 -04:00
memory_vty.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
memory.c lib: MTYPE_PREFIX_FLOWSPEC should not be exposed by memory.h 2019-02-07 09:35:49 -05:00
memory.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
mlag.c lib: Add mlag_role2str function 2019-01-04 12:21:00 -05:00
mlag.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
module.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
module.h lib: a few more trivial changes for C++ compatibility 2019-02-11 22:34:12 -02:00
monotime.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
mpls.c lib, zebra: Move label conversion strings to lib 2018-04-18 07:06:11 -04:00
mpls.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
netns_linux.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
netns_other.c zebra: add an indirection table for ns_id 2018-04-13 16:40:32 +02:00
network.c *: LIB_[ERR|WARN] -> EC_LIB 2018-09-13 19:34:28 +00:00
network.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
nexthop_group.c lib: Add hash function for nexthop groups 2019-04-05 14:19:44 -04:00
nexthop_group.h lib: Add hash function for nexthop groups 2019-04-05 14:19:44 -04:00
nexthop.c lib: Add hash function for nexthop groups 2019-04-05 14:19:44 -04:00
nexthop.h lib: Add hash function for nexthop groups 2019-04-05 14:19:44 -04:00
northbound_cli.c lib: add fine-grained debugging in the northbound 2019-04-15 15:59:38 -03:00
northbound_cli.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
northbound_confd.c lib: add fine-grained debugging in the northbound 2019-04-15 15:59:38 -03:00
northbound_db.c lib: introduce new northbound API 2018-10-27 16:16:12 -02:00
northbound_db.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
northbound_sysrepo.c lib: sync sysrepo module with latest API changes 2019-04-18 13:06:14 -03:00
northbound.c lib: make nb_candidate_edit() more flexible 2019-04-18 13:15:13 -03:00
northbound.h lib: add fine-grained debugging in the northbound 2019-04-15 15:59:38 -03:00
ns.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
openbsd-queue.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
openbsd-tree.c lib: RB-tree copy-paste error (Coverity 1446184) 2018-09-28 20:37:27 +02:00
openbsd-tree.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
pbr.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
pid_output.c lib: When we can't lock the pid file provide a meaningfull message 2018-09-22 14:18:52 -04:00
plist_int.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
plist.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
plist.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
pqueue.c *: do not check XMALLOC / XCALLOC for null ret 2019-02-25 23:00:44 +00:00
pqueue.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
prefix.c Merge pull request #3869 from qlyoung/cocci-fixes 2019-03-06 15:54:44 +01:00
prefix.h *: do not register nexthop 0.0.0.0 to nht 2019-04-03 11:17:57 -07:00
privs.c libs: fix race in privs changes 2019-03-17 13:25:16 -04:00
privs.h libs: make privilege escalation thread-safe 2019-03-05 11:08:31 -05:00
ptm_lib.c *: fix config.h/zebra.h include order 2018-09-08 21:30:42 +02:00
ptm_lib.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
pw.h lib: a few more trivial changes for C++ compatibility 2019-02-11 22:34:12 -02:00
qobj.c *: Replace hash_cmp function return value to a bool 2018-10-19 13:14:45 -04:00
qobj.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
queue.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
ringbuf.c *: conform with COMMUNITY.md formatting rules, via 'make indent' 2018-03-06 14:04:32 -05:00
ringbuf.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
route_types.pl lib, zebra: Fix 'show ip route' char collision 2019-01-29 20:41:36 -05:00
route_types.txt fabricd: add new daemon as build of isisd 2018-09-05 11:38:12 +02:00
routemap.c *: remove null check before XFREE 2019-02-25 23:00:46 +00:00
routemap.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
sbuf.c lib: out-of-bounds access (Coverity 1452539) 2018-06-22 00:06:07 +02:00
sbuf.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
sha256.c lib: Fix memset usage 2017-10-03 12:03:56 -04:00
sha256.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
sigevent.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
sigevent.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
skiplist.c Treewide: use ANSI function definitions 2019-01-24 11:21:59 +01:00
skiplist.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
smux.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
snmp.c *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
sockopt.c lib: add support for extended TCP MD5 auth 2019-04-16 15:26:20 +00:00
sockopt.h lib: add support for extended TCP MD5 auth 2019-04-16 15:26:20 +00:00
sockunion.c *: spelchek 2018-10-25 20:10:57 +02:00
sockunion.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
spf_backoff.c lib: Remove default case statement from a enum driven switch 2018-08-23 08:36:07 -04:00
spf_backoff.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
srcdest_table.c bgpd, lib, zebra: Wrapper get/set of table->info pointer 2018-09-23 20:04:39 -04:00
srcdest_table.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
stream.c *: style for EC replacements 2018-09-13 19:38:57 +00:00
stream.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
strlcat.c *: fix config.h/zebra.h include order 2018-09-08 21:30:42 +02:00
strlcpy.c *: fix config.h/zebra.h include order 2018-09-08 21:30:42 +02:00
subdir.am lib: remove event_counter.[ch] 2019-04-03 20:18:08 +00:00
systemd.c *: reindent 2017-07-17 14:04:07 +02:00
systemd.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
table.c Merge pull request #3180 from qlyoung/prefixlen-u8-to-u16 2019-01-15 00:39:39 -02:00
table.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
termtable.c lib: protect termtable from bad fmt string 2019-01-28 20:44:20 +00:00
termtable.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
thread.c Merge pull request #4073 from donaldsharp/undebug_me_or_not 2019-04-04 10:08:34 -04:00
thread.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
vector.c lib: add vector_compact(), use after str splits 2018-06-06 16:16:12 +00:00
vector.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
version.h.in lib: add cli preprocessor for | actions 2018-06-06 16:15:34 +00:00
vlan.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
vrf_int.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
vrf.c Merge pull request #3720 from donaldsharp/bgp_vrf_peering 2019-04-16 12:25:26 -03:00
vrf.h Merge pull request #3548 from opensourcerouting/rip-vrf 2019-04-04 19:24:14 -04:00
vty.c lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
vty.h lib: reduce exported var symbols 2019-04-03 20:34:18 +00:00
vxlan.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
wheel.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
wheel.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
workqueue.c lib: STAILQ_FOREACH_SAFE never gives a null elem 2019-02-25 23:00:46 +00:00
workqueue.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
yang_translator.c lib: strncpy -> strlcpy | memcpy 2019-02-26 20:50:17 +00:00
yang_translator.h lib: add extern "C" {} blocks to all libfrr headers 2019-02-11 22:34:12 -02:00
yang_wrappers.c *: use proper bool initializers & fix comparisons 2019-02-25 23:00:16 +00:00
yang_wrappers.h lib: use prefixconstptr instead of const prefixptr 2018-11-26 17:35:58 -02:00
yang.c lib: move zlog() prototype back to the public logging API 2019-04-18 13:15:13 -03:00
yang.h Merge remote-tracking branch 'frr/master' into rip-vrf 2019-03-29 11:32:21 -03:00
zassert.h *: Remove cvs control points 2017-12-05 17:28:12 -05:00
zclient.c *: setting the socket send/recv buffer sizes doesn't need elevated privs 2019-04-08 13:11:28 -03:00
zclient.h lib: advertise svi ip as macip opcode 2019-02-06 19:57:00 -08:00
zebra.h lib: add macro that performs explicit static casts when using a C++ compiler 2019-02-11 22:34:12 -02:00