]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12863 from sri-mohan1/sri-mohan-ldp
authorDonald Sharp <donaldsharp72@gmail.com>
Wed, 22 Feb 2023 17:14:23 +0000 (12:14 -0500)
committerGitHub <noreply@github.com>
Wed, 22 Feb 2023 17:14:23 +0000 (12:14 -0500)
ldpd: changes for code maintainability

1866 files changed:
.github/commitlint.config.js [new file with mode: 0644]
.github/workflows/commitlint.yml [new file with mode: 0644]
COPYING
COPYING-LGPLv2.1 [deleted file]
babeld/LICENCE [deleted file]
babeld/babel_errors.c
babeld/babel_errors.h
babeld/babel_filter.c
babeld/babel_filter.h
babeld/babel_interface.c
babeld/babel_interface.h
babeld/babel_main.c
babeld/babel_main.h
babeld/babel_zebra.c
babeld/babel_zebra.h
babeld/babeld.c
babeld/babeld.h
babeld/kernel.c
babeld/kernel.h
babeld/message.c
babeld/message.h
babeld/neighbour.c
babeld/neighbour.h
babeld/net.c
babeld/net.h
babeld/resend.c
babeld/resend.h
babeld/route.c
babeld/route.h
babeld/source.c
babeld/source.h
babeld/util.c
babeld/util.h
babeld/xroute.c
babeld/xroute.h
bfdd/bfd.c
bfdd/bfd.h
bfdd/bfd_packet.c
bfdd/bfdctl.h
bfdd/bfdd.c
bfdd/bfdd_cli.c
bfdd/bfdd_nb.c
bfdd/bfdd_nb.h
bfdd/bfdd_nb_config.c
bfdd/bfdd_nb_state.c
bfdd/bfdd_vty.c
bfdd/bfddp_packet.h
bfdd/config.c
bfdd/control.c
bfdd/dplane.c
bfdd/event.c
bfdd/ptm_adapter.c
bgpd/bgp_addpath.c
bgpd/bgp_addpath.h
bgpd/bgp_addpath_types.h
bgpd/bgp_advertise.c
bgpd/bgp_advertise.h
bgpd/bgp_aspath.c
bgpd/bgp_aspath.h
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_attr_evpn.c
bgpd/bgp_attr_evpn.h
bgpd/bgp_bfd.c
bgpd/bgp_bfd.h
bgpd/bgp_bmp.c
bgpd/bgp_bmp.h
bgpd/bgp_btoa.c
bgpd/bgp_clist.c
bgpd/bgp_clist.h
bgpd/bgp_community.c
bgpd/bgp_community.h
bgpd/bgp_community_alias.c
bgpd/bgp_community_alias.h
bgpd/bgp_conditional_adv.c
bgpd/bgp_conditional_adv.h
bgpd/bgp_damp.c
bgpd/bgp_damp.h
bgpd/bgp_debug.c
bgpd/bgp_debug.h
bgpd/bgp_dump.c
bgpd/bgp_dump.h
bgpd/bgp_ecommunity.c
bgpd/bgp_ecommunity.h
bgpd/bgp_encap_tlv.c
bgpd/bgp_encap_tlv.h
bgpd/bgp_encap_types.h
bgpd/bgp_errors.c
bgpd/bgp_errors.h
bgpd/bgp_evpn.c
bgpd/bgp_evpn.h
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_mh.h
bgpd/bgp_evpn_private.h
bgpd/bgp_evpn_vty.c
bgpd/bgp_evpn_vty.h
bgpd/bgp_filter.c
bgpd/bgp_filter.h
bgpd/bgp_flowspec.c
bgpd/bgp_flowspec.h
bgpd/bgp_flowspec_private.h
bgpd/bgp_flowspec_util.c
bgpd/bgp_flowspec_util.h
bgpd/bgp_flowspec_vty.c
bgpd/bgp_fsm.c
bgpd/bgp_fsm.h
bgpd/bgp_io.c
bgpd/bgp_io.h
bgpd/bgp_keepalives.c
bgpd/bgp_keepalives.h
bgpd/bgp_label.c
bgpd/bgp_label.h
bgpd/bgp_labelpool.c
bgpd/bgp_labelpool.h
bgpd/bgp_lcommunity.c
bgpd/bgp_lcommunity.h
bgpd/bgp_mac.c
bgpd/bgp_mac.h
bgpd/bgp_main.c
bgpd/bgp_memory.c
bgpd/bgp_memory.h
bgpd/bgp_mpath.c
bgpd/bgp_mpath.h
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_mplsvpn_snmp.c
bgpd/bgp_mplsvpn_snmp.h
bgpd/bgp_network.c
bgpd/bgp_network.h
bgpd/bgp_nexthop.c
bgpd/bgp_nexthop.h
bgpd/bgp_nht.c
bgpd/bgp_nht.h
bgpd/bgp_open.c
bgpd/bgp_open.h
bgpd/bgp_packet.c
bgpd/bgp_packet.h
bgpd/bgp_pbr.c
bgpd/bgp_pbr.h
bgpd/bgp_rd.c
bgpd/bgp_rd.h
bgpd/bgp_regex.c
bgpd/bgp_regex.h
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_routemap.c
bgpd/bgp_routemap_nb.c
bgpd/bgp_routemap_nb.h
bgpd/bgp_routemap_nb_config.c
bgpd/bgp_rpki.c
bgpd/bgp_rpki.h
bgpd/bgp_script.c
bgpd/bgp_script.h
bgpd/bgp_snmp.c
bgpd/bgp_snmp.h
bgpd/bgp_snmp_bgp4.c
bgpd/bgp_snmp_bgp4.h
bgpd/bgp_snmp_bgp4v2.c
bgpd/bgp_snmp_bgp4v2.h
bgpd/bgp_table.c
bgpd/bgp_table.h
bgpd/bgp_trace.h
bgpd/bgp_updgrp.c
bgpd/bgp_updgrp.h
bgpd/bgp_updgrp_adv.c
bgpd/bgp_updgrp_packet.c
bgpd/bgp_vnc_types.h
bgpd/bgp_vpn.c
bgpd/bgp_vpn.h
bgpd/bgp_vty.c
bgpd/bgp_vty.h
bgpd/bgp_zebra.c
bgpd/bgp_zebra.h
bgpd/bgpd.c
bgpd/bgpd.h
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/bgp_rfapi_cfg.h
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi.h
bgpd/rfapi/rfapi_ap.c
bgpd/rfapi/rfapi_ap.h
bgpd/rfapi/rfapi_backend.h
bgpd/rfapi/rfapi_descriptor_rfp_utils.c
bgpd/rfapi/rfapi_descriptor_rfp_utils.h
bgpd/rfapi/rfapi_encap_tlv.c
bgpd/rfapi/rfapi_encap_tlv.h
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_import.h
bgpd/rfapi/rfapi_monitor.c
bgpd/rfapi/rfapi_monitor.h
bgpd/rfapi/rfapi_nve_addr.c
bgpd/rfapi/rfapi_nve_addr.h
bgpd/rfapi/rfapi_private.h
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/rfapi_rib.h
bgpd/rfapi/rfapi_vty.c
bgpd/rfapi/rfapi_vty.h
bgpd/rfapi/vnc_debug.c
bgpd/rfapi/vnc_debug.h
bgpd/rfapi/vnc_export_bgp.c
bgpd/rfapi/vnc_export_bgp.h
bgpd/rfapi/vnc_export_bgp_p.h
bgpd/rfapi/vnc_export_table.c
bgpd/rfapi/vnc_export_table.h
bgpd/rfapi/vnc_import_bgp.c
bgpd/rfapi/vnc_import_bgp.h
bgpd/rfapi/vnc_import_bgp_p.h
bgpd/rfapi/vnc_zebra.c
bgpd/rfapi/vnc_zebra.h
bgpd/rfp-example/librfp/rfp.h
bgpd/rfp-example/librfp/rfp_example.c
bgpd/rfp-example/librfp/rfp_internal.h
bgpd/rfp-example/rfptest/rfptest.c
bgpd/rfp-example/rfptest/rfptest.h
buildtest.sh
configure.ac
debian/changelog
doc/developer/cli.rst
doc/developer/workflow.rst
doc/extra/frrlexer.py
doc/licenses/BSD-2-Clause [new file with mode: 0644]
doc/licenses/BSD-3-Clause [new file with mode: 0644]
doc/licenses/GPL-2.0 [new file with mode: 0644]
doc/licenses/GPL-3.0 [new file with mode: 0644]
doc/licenses/ISC [new file with mode: 0644]
doc/licenses/LGPL-2.1 [new file with mode: 0644]
doc/licenses/LicenseRef-Skiplist-BSD-0-Clause [new file with mode: 0644]
doc/licenses/MIT [new file with mode: 0644]
doc/licenses/Unlicense [new file with mode: 0644]
doc/user/affinitymap.rst [new file with mode: 0644]
doc/user/basic.rst
doc/user/bgp.rst
doc/user/eigrpd.rst
doc/user/pim.rst
doc/user/pimv6.rst
doc/user/ripd.rst
doc/user/ripngd.rst
doc/user/subdir.am
doc/user/zebra.rst
eigrpd/eigrp_cli.c
eigrpd/eigrp_cli.h
eigrpd/eigrp_const.h
eigrpd/eigrp_dump.c
eigrpd/eigrp_dump.h
eigrpd/eigrp_errors.c
eigrpd/eigrp_errors.h
eigrpd/eigrp_filter.c
eigrpd/eigrp_filter.h
eigrpd/eigrp_fsm.c
eigrpd/eigrp_fsm.h
eigrpd/eigrp_hello.c
eigrpd/eigrp_interface.c
eigrpd/eigrp_interface.h
eigrpd/eigrp_macros.h
eigrpd/eigrp_main.c
eigrpd/eigrp_metric.c
eigrpd/eigrp_metric.h
eigrpd/eigrp_neighbor.c
eigrpd/eigrp_neighbor.h
eigrpd/eigrp_network.c
eigrpd/eigrp_network.h
eigrpd/eigrp_northbound.c
eigrpd/eigrp_packet.c
eigrpd/eigrp_packet.h
eigrpd/eigrp_query.c
eigrpd/eigrp_reply.c
eigrpd/eigrp_routemap.c
eigrpd/eigrp_siaquery.c
eigrpd/eigrp_siareply.c
eigrpd/eigrp_snmp.c
eigrpd/eigrp_snmp.h
eigrpd/eigrp_structs.h
eigrpd/eigrp_topology.c
eigrpd/eigrp_topology.h
eigrpd/eigrp_types.h
eigrpd/eigrp_update.c
eigrpd/eigrp_vrf.c
eigrpd/eigrp_vrf.h
eigrpd/eigrp_vty.c
eigrpd/eigrp_vty.h
eigrpd/eigrp_yang.h
eigrpd/eigrp_zebra.c
eigrpd/eigrp_zebra.h
eigrpd/eigrpd.c
eigrpd/eigrpd.h
fpm/fpm.h
fpm/fpm.proto
fpm/fpm_pb.c
fpm/fpm_pb.h
grpc/frr-northbound.proto
include/linux/if_bridge.h
include/linux/seg6_local.h
isisd/fabricd.c
isisd/fabricd.h
isisd/isis_adjacency.c
isisd/isis_adjacency.h
isisd/isis_bfd.c
isisd/isis_bfd.h
isisd/isis_bpf.c
isisd/isis_circuit.c
isisd/isis_circuit.h
isisd/isis_cli.c
isisd/isis_common.h
isisd/isis_constants.h
isisd/isis_csm.c
isisd/isis_csm.h
isisd/isis_dlpi.c
isisd/isis_dr.c
isisd/isis_dr.h
isisd/isis_dynhn.c
isisd/isis_dynhn.h
isisd/isis_errors.c
isisd/isis_errors.h
isisd/isis_events.c
isisd/isis_events.h
isisd/isis_flags.c
isisd/isis_flags.h
isisd/isis_ldp_sync.c
isisd/isis_ldp_sync.h
isisd/isis_lfa.c
isisd/isis_lfa.h
isisd/isis_lsp.c
isisd/isis_lsp.h
isisd/isis_main.c
isisd/isis_misc.c
isisd/isis_misc.h
isisd/isis_mt.c
isisd/isis_mt.h
isisd/isis_nb.c
isisd/isis_nb.h
isisd/isis_nb_config.c
isisd/isis_nb_notifications.c
isisd/isis_nb_state.c
isisd/isis_network.h
isisd/isis_pdu.c
isisd/isis_pdu.h
isisd/isis_pdu_counter.c
isisd/isis_pdu_counter.h
isisd/isis_pfpacket.c
isisd/isis_redist.c
isisd/isis_redist.h
isisd/isis_route.c
isisd/isis_route.h
isisd/isis_routemap.c
isisd/isis_routemap.h
isisd/isis_snmp.c
isisd/isis_spf.c
isisd/isis_spf.h
isisd/isis_spf_private.h
isisd/isis_sr.c
isisd/isis_sr.h
isisd/isis_te.c
isisd/isis_te.h
isisd/isis_tlvs.c
isisd/isis_tlvs.h
isisd/isis_tx_queue.c
isisd/isis_tx_queue.h
isisd/isis_vty_fabricd.c
isisd/isis_zebra.c
isisd/isis_zebra.h
isisd/isisd.c
isisd/isisd.h
isisd/iso_checksum.c
isisd/iso_checksum.h
ldpd/accept.c
ldpd/address.c
ldpd/adjacency.c
ldpd/control.c
ldpd/control.h
ldpd/hello.c
ldpd/init.c
ldpd/interface.c
ldpd/keepalive.c
ldpd/l2vpn.c
ldpd/labelmapping.c
ldpd/lde.c
ldpd/lde.h
ldpd/lde_lib.c
ldpd/ldp.h
ldpd/ldp_debug.c
ldpd/ldp_debug.h
ldpd/ldp_snmp.c
ldpd/ldp_vty.h
ldpd/ldp_vty_cmds.c
ldpd/ldp_vty_conf.c
ldpd/ldp_vty_exec.c
ldpd/ldp_zebra.c
ldpd/ldpd.c
ldpd/ldpd.h
ldpd/ldpe.c
ldpd/ldpe.h
ldpd/log.c
ldpd/log.h
ldpd/logmsg.c
ldpd/neighbor.c
ldpd/notification.c
ldpd/packet.c
ldpd/pfkey.c
ldpd/rlfa.c
ldpd/rlfa.h
ldpd/socket.c
ldpd/util.c
lib/admin_group.c [new file with mode: 0644]
lib/admin_group.h [new file with mode: 0644]
lib/affinitymap.c [new file with mode: 0644]
lib/affinitymap.h [new file with mode: 0644]
lib/affinitymap_cli.c [new file with mode: 0644]
lib/affinitymap_northbound.c [new file with mode: 0644]
lib/agentx.c
lib/agg_table.c
lib/agg_table.h
lib/asn.c [new file with mode: 0644]
lib/asn.h [new file with mode: 0644]
lib/assert/assert.h
lib/atomlist.c
lib/atomlist.h
lib/base64.c
lib/base64.h
lib/bfd.c
lib/bfd.h
lib/bitfield.h
lib/buffer.c
lib/buffer.h
lib/clippy.c
lib/clippy.h
lib/command.c
lib/command.h
lib/command_graph.c
lib/command_graph.h
lib/command_lex.l
lib/command_match.c
lib/command_match.h
lib/command_parse.y
lib/command_py.c
lib/compiler.h
lib/cspf.c
lib/cspf.h
lib/csv.c
lib/csv.h
lib/db.c
lib/db.h
lib/debug.c
lib/debug.h
lib/defaults.c
lib/defaults.h
lib/defun_lex.l
lib/distribute.c
lib/distribute.h
lib/elf_py.c
lib/ferr.c
lib/ferr.h
lib/filter.c
lib/filter.h
lib/filter_cli.c
lib/filter_nb.c
lib/freebsd-queue.h
lib/frr_pthread.c
lib/frr_pthread.h
lib/frr_zmq.c
lib/frr_zmq.h
lib/frratomic.h
lib/frrcu.c
lib/frrcu.h
lib/frrlua.c
lib/frrlua.h
lib/frrscript.c
lib/frrscript.h
lib/frrstr.c
lib/frrstr.h
lib/getopt.c
lib/getopt.h
lib/getopt1.c
lib/grammar_sandbox.c
lib/grammar_sandbox_main.c
lib/graph.c
lib/graph.h
lib/hash.c
lib/hash.h
lib/hook.c
lib/hook.h
lib/iana_afi.h
lib/id_alloc.c
lib/id_alloc.h
lib/if.c
lib/if.h
lib/if_rmap.c
lib/if_rmap.h
lib/imsg-buffer.c
lib/imsg.c
lib/imsg.h
lib/ipaddr.h
lib/json.c
lib/json.h
lib/keychain.c
lib/keychain.h
lib/ldp_sync.c
lib/ldp_sync.h
lib/lib_errors.c
lib/lib_errors.h
lib/lib_vty.c
lib/lib_vty.h
lib/libfrr.c
lib/libfrr.h
lib/libfrr_trace.h
lib/libospf.h
lib/link_state.c
lib/link_state.h
lib/linklist.c
lib/linklist.h
lib/log.c
lib/log.h
lib/log_filter.c
lib/log_vty.c
lib/log_vty.h
lib/md5.c
lib/md5.h
lib/memory.c
lib/memory.h
lib/mlag.c
lib/mlag.h
lib/module.c
lib/module.h
lib/monotime.h
lib/mpls.c
lib/mpls.h
lib/netns_linux.c
lib/netns_other.c
lib/network.c
lib/network.h
lib/nexthop.c
lib/nexthop.h
lib/nexthop_group.c
lib/nexthop_group.h
lib/nexthop_group_private.h
lib/northbound.c
lib/northbound.h
lib/northbound_cli.c
lib/northbound_cli.h
lib/northbound_confd.c
lib/northbound_db.c
lib/northbound_db.h
lib/northbound_grpc.cpp
lib/northbound_sysrepo.c
lib/ns.h
lib/ntop.c
lib/openbsd-queue.h
lib/openbsd-tree.c
lib/openbsd-tree.h
lib/pbr.h
lib/pid_output.c
lib/plist.c
lib/plist.h
lib/plist_int.h
lib/prefix.c
lib/prefix.h
lib/printf/glue.c
lib/printfrr.h
lib/privs.c
lib/privs.h
lib/ptm_lib.c
lib/ptm_lib.h
lib/pullwr.c
lib/pullwr.h
lib/pw.h
lib/qobj.c
lib/qobj.h
lib/queue.h
lib/resolver.c [changed mode: 0755->0644]
lib/resolver.h
lib/ringbuf.c
lib/ringbuf.h
lib/route_opaque.h
lib/route_types.pl
lib/routemap.c
lib/routemap.h
lib/routemap_cli.c
lib/routemap_northbound.c
lib/routing_nb.c
lib/routing_nb_config.c
lib/sbuf.c
lib/sbuf.h
lib/seqlock.c
lib/seqlock.h
lib/sha256.c
lib/sha256.h
lib/sigevent.c
lib/sigevent.h
lib/skiplist.c
lib/skiplist.h
lib/smux.h
lib/snmp.c
lib/sockopt.c
lib/sockopt.h
lib/sockunion.c
lib/sockunion.h
lib/spf_backoff.c
lib/spf_backoff.h
lib/srcdest_table.c
lib/srcdest_table.h
lib/srte.h
lib/srv6.c
lib/srv6.h
lib/stream.c
lib/stream.h
lib/strformat.c
lib/strlcat.c
lib/strlcpy.c
lib/subdir.am
lib/systemd.c
lib/systemd.h
lib/table.c
lib/table.h
lib/tc.c
lib/tc.h
lib/termtable.c
lib/termtable.h
lib/thread.c
lib/thread.h
lib/trace.h
lib/typerb.c
lib/typerb.h
lib/typesafe.c
lib/typesafe.h
lib/vector.c
lib/vector.h
lib/version.h.in
lib/vlan.h
lib/vrf.c
lib/vrf.h
lib/vrf_int.h
lib/vty.c
lib/vty.h
lib/vxlan.h
lib/wheel.c
lib/wheel.h
lib/workqueue.c
lib/workqueue.h
lib/xref.c
lib/xref.h
lib/yang.c
lib/yang.h
lib/yang_translator.c
lib/yang_translator.h
lib/yang_wrappers.c
lib/yang_wrappers.h
lib/zclient.c
lib/zclient.h
lib/zebra.h
lib/zlog.c
lib/zlog.h
lib/zlog_5424.c
lib/zlog_5424.h
lib/zlog_5424_cli.c
lib/zlog_live.c
lib/zlog_live.h
lib/zlog_targets.c
lib/zlog_targets.h
nhrpd/linux.c
nhrpd/netlink.h
nhrpd/netlink_arp.c
nhrpd/nhrp_cache.c
nhrpd/nhrp_errors.c
nhrpd/nhrp_errors.h
nhrpd/nhrp_event.c
nhrpd/nhrp_interface.c
nhrpd/nhrp_main.c
nhrpd/nhrp_multicast.c
nhrpd/nhrp_nhs.c
nhrpd/nhrp_packet.c
nhrpd/nhrp_peer.c
nhrpd/nhrp_protocol.h
nhrpd/nhrp_route.c
nhrpd/nhrp_shortcut.c
nhrpd/nhrp_vc.c
nhrpd/nhrp_vty.c
nhrpd/nhrpd.h
nhrpd/vici.c
nhrpd/zbuf.c
nhrpd/zbuf.h
nhrpd/znl.c
nhrpd/znl.h
ospf6d/ospf6_abr.c
ospf6d/ospf6_abr.h
ospf6d/ospf6_area.c
ospf6d/ospf6_area.h
ospf6d/ospf6_asbr.c
ospf6d/ospf6_asbr.h
ospf6d/ospf6_auth_trailer.c
ospf6d/ospf6_auth_trailer.h
ospf6d/ospf6_bfd.c
ospf6d/ospf6_bfd.h
ospf6d/ospf6_flood.c
ospf6d/ospf6_flood.h
ospf6d/ospf6_gr.c
ospf6d/ospf6_gr.h
ospf6d/ospf6_gr_helper.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h
ospf6d/ospf6_intra.c
ospf6d/ospf6_intra.h
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsa.h
ospf6d/ospf6_lsdb.c
ospf6d/ospf6_lsdb.h
ospf6d/ospf6_main.c
ospf6d/ospf6_message.c
ospf6d/ospf6_message.h
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_neighbor.h
ospf6d/ospf6_network.c
ospf6d/ospf6_network.h
ospf6d/ospf6_nssa.c
ospf6d/ospf6_nssa.h
ospf6d/ospf6_proto.c
ospf6d/ospf6_proto.h
ospf6d/ospf6_route.c
ospf6d/ospf6_route.h
ospf6d/ospf6_routemap_nb.c
ospf6d/ospf6_routemap_nb.h
ospf6d/ospf6_routemap_nb_config.c
ospf6d/ospf6_snmp.c
ospf6d/ospf6_spf.c
ospf6d/ospf6_spf.h
ospf6d/ospf6_top.c
ospf6d/ospf6_top.h
ospf6d/ospf6_zebra.c
ospf6d/ospf6_zebra.h
ospf6d/ospf6d.c
ospf6d/ospf6d.h
ospfclient/COPYING [deleted file]
ospfclient/ospf_apiclient.c
ospfclient/ospf_apiclient.h
ospfclient/ospfclient.c
ospfclient/ospfclient.py
ospfd/ospf_abr.c
ospfd/ospf_abr.h
ospfd/ospf_api.c
ospfd/ospf_api.h
ospfd/ospf_apiserver.c
ospfd/ospf_apiserver.h
ospfd/ospf_asbr.c
ospfd/ospf_asbr.h
ospfd/ospf_ase.c
ospfd/ospf_ase.h
ospfd/ospf_bfd.c
ospfd/ospf_bfd.h
ospfd/ospf_dump.c
ospfd/ospf_dump.h
ospfd/ospf_dump_api.c
ospfd/ospf_dump_api.h
ospfd/ospf_errors.c
ospfd/ospf_errors.h
ospfd/ospf_ext.c
ospfd/ospf_ext.h
ospfd/ospf_flood.c
ospfd/ospf_flood.h
ospfd/ospf_gr.c
ospfd/ospf_gr.h
ospfd/ospf_gr_helper.c
ospfd/ospf_ia.c
ospfd/ospf_ia.h
ospfd/ospf_interface.c
ospfd/ospf_interface.h
ospfd/ospf_ism.c
ospfd/ospf_ism.h
ospfd/ospf_ldp_sync.c
ospfd/ospf_ldp_sync.h
ospfd/ospf_lsa.c
ospfd/ospf_lsa.h
ospfd/ospf_lsdb.c
ospfd/ospf_lsdb.h
ospfd/ospf_main.c
ospfd/ospf_memory.c
ospfd/ospf_memory.h
ospfd/ospf_neighbor.c
ospfd/ospf_neighbor.h
ospfd/ospf_network.c
ospfd/ospf_network.h
ospfd/ospf_nsm.c
ospfd/ospf_nsm.h
ospfd/ospf_opaque.c
ospfd/ospf_opaque.h
ospfd/ospf_packet.c
ospfd/ospf_packet.h
ospfd/ospf_ri.c
ospfd/ospf_ri.h
ospfd/ospf_route.c
ospfd/ospf_route.h
ospfd/ospf_routemap.c
ospfd/ospf_routemap_nb.c
ospfd/ospf_routemap_nb.h
ospfd/ospf_routemap_nb_config.c
ospfd/ospf_snmp.c
ospfd/ospf_spf.c
ospfd/ospf_spf.h
ospfd/ospf_sr.c
ospfd/ospf_sr.h
ospfd/ospf_te.c
ospfd/ospf_te.h
ospfd/ospf_ti_lfa.c
ospfd/ospf_ti_lfa.h
ospfd/ospf_vty.c
ospfd/ospf_vty.h
ospfd/ospf_zebra.c
ospfd/ospf_zebra.h
ospfd/ospfd.c
ospfd/ospfd.h
pathd/path_cli.c
pathd/path_debug.c
pathd/path_debug.h
pathd/path_errors.c
pathd/path_errors.h
pathd/path_main.c
pathd/path_nb.c
pathd/path_nb.h
pathd/path_nb_config.c
pathd/path_nb_state.c
pathd/path_pcep.c
pathd/path_pcep.h
pathd/path_pcep_cli.c
pathd/path_pcep_cli.h
pathd/path_pcep_config.c
pathd/path_pcep_config.h
pathd/path_pcep_controller.c
pathd/path_pcep_controller.h
pathd/path_pcep_debug.c
pathd/path_pcep_debug.h
pathd/path_pcep_lib.c
pathd/path_pcep_lib.h
pathd/path_pcep_pcc.c
pathd/path_pcep_pcc.h
pathd/path_ted.c
pathd/path_ted.h
pathd/path_zebra.c
pathd/path_zebra.h
pathd/pathd.c
pathd/pathd.h
pbrd/pbr_debug.c
pbrd/pbr_debug.h
pbrd/pbr_main.c
pbrd/pbr_map.c
pbrd/pbr_map.h
pbrd/pbr_memory.c
pbrd/pbr_memory.h
pbrd/pbr_nht.c
pbrd/pbr_nht.h
pbrd/pbr_vrf.c
pbrd/pbr_vrf.h
pbrd/pbr_vty.c
pbrd/pbr_vty.h
pbrd/pbr_zebra.c
pbrd/pbr_zebra.h
pceplib/pcep.h
pceplib/pcep_msg_encoding.h
pceplib/pcep_msg_messages.c
pceplib/pcep_msg_messages.h
pceplib/pcep_msg_messages_encoding.c
pceplib/pcep_msg_object_error_types.c
pceplib/pcep_msg_object_error_types.h
pceplib/pcep_msg_objects.c
pceplib/pcep_msg_objects.h
pceplib/pcep_msg_objects_encoding.c
pceplib/pcep_msg_tlvs.c
pceplib/pcep_msg_tlvs.h
pceplib/pcep_msg_tlvs_encoding.c
pceplib/pcep_msg_tools.c
pceplib/pcep_msg_tools.h
pceplib/pcep_pcc.c
pceplib/pcep_pcc_api.c
pceplib/pcep_pcc_api.h
pceplib/pcep_session_logic.c
pceplib/pcep_session_logic.h
pceplib/pcep_session_logic_counters.c
pceplib/pcep_session_logic_internals.h
pceplib/pcep_session_logic_loop.c
pceplib/pcep_session_logic_states.c
pceplib/pcep_socket_comm.c
pceplib/pcep_socket_comm.h
pceplib/pcep_socket_comm_internals.h
pceplib/pcep_socket_comm_loop.c
pceplib/pcep_socket_comm_loop.h
pceplib/pcep_socket_comm_mock.c
pceplib/pcep_socket_comm_mock.h
pceplib/pcep_timer_internals.h
pceplib/pcep_timers.c
pceplib/pcep_timers.h
pceplib/pcep_timers_event_loop.c
pceplib/pcep_timers_event_loop.h
pceplib/pcep_utils_counters.c
pceplib/pcep_utils_counters.h
pceplib/pcep_utils_double_linked_list.c
pceplib/pcep_utils_double_linked_list.h
pceplib/pcep_utils_logging.c
pceplib/pcep_utils_logging.h
pceplib/pcep_utils_memory.c
pceplib/pcep_utils_memory.h
pceplib/pcep_utils_ordered_list.c
pceplib/pcep_utils_ordered_list.h
pceplib/pcep_utils_queue.c
pceplib/pcep_utils_queue.h
pceplib/test/pcep_msg_messages_test.c
pceplib/test/pcep_msg_messages_test.h
pceplib/test/pcep_msg_messages_tests.c
pceplib/test/pcep_msg_object_error_types_test.c
pceplib/test/pcep_msg_object_error_types_test.h
pceplib/test/pcep_msg_objects_test.c
pceplib/test/pcep_msg_objects_test.h
pceplib/test/pcep_msg_tlvs_test.c
pceplib/test/pcep_msg_tlvs_test.h
pceplib/test/pcep_msg_tools_test.c
pceplib/test/pcep_msg_tools_test.h
pceplib/test/pcep_pcc_api_test.c
pceplib/test/pcep_pcc_api_test.h
pceplib/test/pcep_pcc_api_tests.c
pceplib/test/pcep_session_logic_loop_test.c
pceplib/test/pcep_session_logic_loop_test.h
pceplib/test/pcep_session_logic_states_test.c
pceplib/test/pcep_session_logic_states_test.h
pceplib/test/pcep_session_logic_test.c
pceplib/test/pcep_session_logic_test.h
pceplib/test/pcep_session_logic_tests.c
pceplib/test/pcep_socket_comm_loop_test.c
pceplib/test/pcep_socket_comm_loop_test.h
pceplib/test/pcep_socket_comm_test.c
pceplib/test/pcep_socket_comm_test.h
pceplib/test/pcep_socket_comm_tests.c
pceplib/test/pcep_timers_event_loop_test.c
pceplib/test/pcep_timers_event_loop_test.h
pceplib/test/pcep_timers_test.c
pceplib/test/pcep_timers_test.h
pceplib/test/pcep_timers_tests.c
pceplib/test/pcep_utils_counters_test.c
pceplib/test/pcep_utils_counters_test.h
pceplib/test/pcep_utils_double_linked_list_test.c
pceplib/test/pcep_utils_double_linked_list_test.h
pceplib/test/pcep_utils_memory_test.c
pceplib/test/pcep_utils_memory_test.h
pceplib/test/pcep_utils_ordered_list_test.c
pceplib/test/pcep_utils_ordered_list_test.h
pceplib/test/pcep_utils_queue_test.c
pceplib/test/pcep_utils_queue_test.h
pceplib/test/pcep_utils_tests.c
pimd/COPYING [deleted file]
pimd/mtracebis.c
pimd/mtracebis_netlink.c
pimd/mtracebis_netlink.h
pimd/mtracebis_routeget.c
pimd/mtracebis_routeget.h
pimd/pim6_cmd.c
pimd/pim6_cmd.h
pimd/pim6_main.c
pimd/pim6_mld.c
pimd/pim6_mld.h
pimd/pim6_mld_protocol.h
pimd/pim_addr.c
pimd/pim_addr.h
pimd/pim_assert.c
pimd/pim_assert.h
pimd/pim_bfd.c
pimd/pim_bfd.h
pimd/pim_bsm.c
pimd/pim_bsm.h
pimd/pim_cmd.c
pimd/pim_cmd.h
pimd/pim_cmd_common.c
pimd/pim_cmd_common.h
pimd/pim_errors.c
pimd/pim_errors.h
pimd/pim_hello.c
pimd/pim_hello.h
pimd/pim_iface.c
pimd/pim_iface.h
pimd/pim_ifchannel.c
pimd/pim_ifchannel.h
pimd/pim_igmp.c
pimd/pim_igmp.h
pimd/pim_igmp_join.h
pimd/pim_igmp_mtrace.c
pimd/pim_igmp_mtrace.h
pimd/pim_igmp_stats.c
pimd/pim_igmp_stats.h
pimd/pim_igmpv2.c
pimd/pim_igmpv2.h
pimd/pim_igmpv3.c
pimd/pim_igmpv3.h
pimd/pim_instance.c
pimd/pim_instance.h
pimd/pim_int.c
pimd/pim_int.h
pimd/pim_join.c
pimd/pim_join.h
pimd/pim_jp_agg.c
pimd/pim_jp_agg.h
pimd/pim_macro.c
pimd/pim_macro.h
pimd/pim_main.c
pimd/pim_memory.c
pimd/pim_memory.h
pimd/pim_mlag.c
pimd/pim_mlag.h
pimd/pim_mroute.c
pimd/pim_mroute.h
pimd/pim_msdp.c
pimd/pim_msdp.h
pimd/pim_msdp_packet.c
pimd/pim_msdp_packet.h
pimd/pim_msdp_socket.c
pimd/pim_msdp_socket.h
pimd/pim_msg.c
pimd/pim_msg.h
pimd/pim_nb.c
pimd/pim_nb.h
pimd/pim_nb_config.c
pimd/pim_neighbor.c
pimd/pim_neighbor.h
pimd/pim_nht.c
pimd/pim_nht.h
pimd/pim_oil.c
pimd/pim_oil.h
pimd/pim_pim.c
pimd/pim_pim.h
pimd/pim_register.c
pimd/pim_register.h
pimd/pim_routemap.c
pimd/pim_rp.c
pimd/pim_rp.h
pimd/pim_rpf.c
pimd/pim_rpf.h
pimd/pim_signals.c
pimd/pim_signals.h
pimd/pim_sock.c
pimd/pim_sock.h
pimd/pim_ssm.c
pimd/pim_ssm.h
pimd/pim_ssmpingd.c
pimd/pim_ssmpingd.h
pimd/pim_static.c
pimd/pim_static.h
pimd/pim_str.c
pimd/pim_str.h
pimd/pim_tib.c
pimd/pim_tib.h
pimd/pim_time.c
pimd/pim_time.h
pimd/pim_tlv.c
pimd/pim_tlv.h
pimd/pim_upstream.c
pimd/pim_upstream.h
pimd/pim_util.c
pimd/pim_util.h
pimd/pim_vty.c
pimd/pim_vty.h
pimd/pim_vxlan.c
pimd/pim_vxlan.h
pimd/pim_vxlan_instance.h
pimd/pim_zebra.c
pimd/pim_zebra.h
pimd/pim_zlookup.c
pimd/pim_zlookup.h
pimd/pim_zpthread.c
pimd/pimd.c
pimd/pimd.h
pimd/test_igmpv3_join.c
python/callgraph-dot.py
python/clidef.py
python/clippy/__init__.py
python/clippy/elf.py
python/clippy/uidhash.py
python/firstheader.py
python/test_xrelfo.py
python/tiabwarfo.py
python/xref2vtysh.py
python/xrelfo.py
qpb/linear_allocator.h
qpb/qpb.c
qpb/qpb.h
qpb/qpb.proto
qpb/qpb_allocator.c
qpb/qpb_allocator.h
redhat/frr.spec.in
ripd/rip_cli.c
ripd/rip_debug.c
ripd/rip_debug.h
ripd/rip_errors.c
ripd/rip_errors.h
ripd/rip_interface.c
ripd/rip_interface.h
ripd/rip_main.c
ripd/rip_nb.c
ripd/rip_nb.h
ripd/rip_nb_config.c
ripd/rip_nb_notifications.c
ripd/rip_nb_rpcs.c
ripd/rip_nb_state.c
ripd/rip_offset.c
ripd/rip_peer.c
ripd/rip_routemap.c
ripd/rip_snmp.c
ripd/rip_zebra.c
ripd/ripd.c
ripd/ripd.h
ripngd/ripng_cli.c
ripngd/ripng_debug.c
ripngd/ripng_debug.h
ripngd/ripng_interface.c
ripngd/ripng_main.c
ripngd/ripng_nb.c
ripngd/ripng_nb.h
ripngd/ripng_nb_config.c
ripngd/ripng_nb_rpcs.c
ripngd/ripng_nb_state.c
ripngd/ripng_nexthop.c
ripngd/ripng_nexthop.h
ripngd/ripng_offset.c
ripngd/ripng_peer.c
ripngd/ripng_route.c
ripngd/ripng_route.h
ripngd/ripng_routemap.c
ripngd/ripng_zebra.c
ripngd/ripngd.c
ripngd/ripngd.h
sharpd/sharp_globals.h
sharpd/sharp_logpump.c
sharpd/sharp_main.c
sharpd/sharp_nht.c
sharpd/sharp_nht.h
sharpd/sharp_vty.c
sharpd/sharp_vty.h
sharpd/sharp_zebra.c
sharpd/sharp_zebra.h
staticd/static_bfd.c
staticd/static_debug.c
staticd/static_debug.h
staticd/static_main.c
staticd/static_nb.c
staticd/static_nb.h
staticd/static_nb_config.c
staticd/static_nht.c
staticd/static_nht.h
staticd/static_routes.c
staticd/static_routes.h
staticd/static_vrf.c
staticd/static_vrf.h
staticd/static_vty.c
staticd/static_vty.h
staticd/static_zebra.c
staticd/static_zebra.h
tests/bgpd/test_aspath.c
tests/bgpd/test_bgp_table.c
tests/bgpd/test_capability.c
tests/bgpd/test_ecommunity.c
tests/bgpd/test_mp_attr.c
tests/bgpd/test_mpath.c
tests/bgpd/test_packet.c
tests/bgpd/test_peer_attr.c
tests/helpers/c/main.c
tests/helpers/c/prng.c
tests/helpers/c/prng.h
tests/helpers/c/tests.h
tests/helpers/python/frrsix.py
tests/helpers/python/frrtest.py
tests/isisd/test_common.c
tests/isisd/test_common.h
tests/isisd/test_isis_spf.c
tests/isisd/test_topologies.c
tests/lib/cli/common_cli.c
tests/lib/cli/common_cli.h
tests/lib/cli/test_cli.c
tests/lib/cli/test_commands.c
tests/lib/cxxcompat.c
tests/lib/fuzz_zlog.c
tests/lib/fuzz_zlog_inputs.py
tests/lib/northbound/test_oper_data.c
tests/lib/test_assert.c
tests/lib/test_atomlist.c
tests/lib/test_buffer.c
tests/lib/test_checksum.c
tests/lib/test_frrlua.c
tests/lib/test_frrscript.c
tests/lib/test_graph.c
tests/lib/test_grpc.cpp
tests/lib/test_heavy.c
tests/lib/test_heavy_thread.c
tests/lib/test_heavy_wq.c
tests/lib/test_memory.c
tests/lib/test_nexthop.c
tests/lib/test_nexthop_iter.c
tests/lib/test_ntop.c
tests/lib/test_plist.c
tests/lib/test_prefix2str.c
tests/lib/test_printfrr.c
tests/lib/test_privs.c
tests/lib/test_resolver.c
tests/lib/test_ringbuf.c
tests/lib/test_segv.c
tests/lib/test_seqlock.c
tests/lib/test_sig.c
tests/lib/test_skiplist.c
tests/lib/test_srcdest_table.c
tests/lib/test_stream.c
tests/lib/test_table.c
tests/lib/test_timer_correctness.c
tests/lib/test_timer_performance.c
tests/lib/test_ttable.c
tests/lib/test_typelist.c
tests/lib/test_typelist.h
tests/lib/test_versioncmp.c
tests/lib/test_xref.c
tests/lib/test_zlog.c
tests/lib/test_zmq.c
tests/ospf6d/test_lsdb.c
tests/ospfd/common.c
tests/ospfd/test_ospf_spf.c
tests/topotests/all_protocol_startup/test_all_protocol_startup.py
tests/topotests/analyze.py
tests/topotests/babel_topo1/test_babel_topo1.py
tests/topotests/bfd_bgp_cbit_topo3/test_bfd_bgp_cbit_topo3.py
tests/topotests/bfd_isis_topo1/test_bfd_isis_topo1.py
tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py
tests/topotests/bfd_profiles_topo1/test_bfd_profiles_topo1.py
tests/topotests/bfd_topo1/test_bfd_topo1.py
tests/topotests/bfd_topo2/test_bfd_topo2.py
tests/topotests/bfd_topo3/test_bfd_topo3.py
tests/topotests/bfd_vrf_topo1/test_bfd_vrf_topo1.py
tests/topotests/bfd_vrflite_topo1/test_bfd_vrflite_topo1.py
tests/topotests/bgp_accept_own/test_bgp_accept_own.py
tests/topotests/bgp_aggregate_address_matching_med/test_bgp_aggregate_address_matching_med.py
tests/topotests/bgp_aggregate_address_origin/test_bgp_aggregate-address_origin.py
tests/topotests/bgp_aggregate_address_route_map/test_bgp_aggregate-address_route-map.py
tests/topotests/bgp_aggregate_address_topo1/test_bgp_aggregate_address_topo1.py
tests/topotests/bgp_aggregator_zero/test_bgp_aggregator_zero.py
tests/topotests/bgp_aigp/test_bgp_aigp.py
tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py
tests/topotests/bgp_as_override/test_bgp_as_override.py
tests/topotests/bgp_as_wide_bgp_identifier/test_bgp_as_wide_bgp_identifier.py
tests/topotests/bgp_asdot_regex/__init__.py [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r1/show_bgp_ipv4.json [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r2/show_bgp_ipv4.json [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/r2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_asdot_regex/test_bgp_asdot_regex.py [new file with mode: 0644]
tests/topotests/bgp_aspath_zero/test_bgp_aspath_zero.py
tests/topotests/bgp_auth/bgp_auth_common.py
tests/topotests/bgp_auth/test_bgp_auth1.py
tests/topotests/bgp_auth/test_bgp_auth2.py
tests/topotests/bgp_auth/test_bgp_auth3.py
tests/topotests/bgp_auth/test_bgp_auth4.py
tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
tests/topotests/bgp_bfd_down_cease_notification/test_bgp_bfd_down_cease_notification.py
tests/topotests/bgp_blackhole_community/test_bgp_blackhole_community.py
tests/topotests/bgp_comm_list_delete/test_bgp_comm-list_delete.py
tests/topotests/bgp_comm_list_match/test_bgp_comm_list_match.py
tests/topotests/bgp_communities_topo1/test_bgp_communities.py
tests/topotests/bgp_communities_topo1/test_bgp_communities_topo2.py
tests/topotests/bgp_community_alias/test_bgp-community-alias.py
tests/topotests/bgp_community_change_update/test_bgp_community_change_update.py
tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py
tests/topotests/bgp_conditional_advertisement_track_peer/test_bgp_conditional_advertisement_track_peer.py
tests/topotests/bgp_confed1/test_bgp_confed1.py
tests/topotests/bgp_default_afi_safi/test_bgp-default-afi-safi.py
tests/topotests/bgp_default_originate/test_bgp_default_originate_2links.py
tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_1.py
tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_2.py
tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_3.py
tests/topotests/bgp_default_originate/test_default_orginate_vrf.py
tests/topotests/bgp_default_originate/test_default_originate_conditional_routemap.py
tests/topotests/bgp_default_originate_withdraw/__init__.py [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r3/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/r3/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_default_originate_withdraw/test_bgp_default_originate_withdraw.py [new file with mode: 0644]
tests/topotests/bgp_default_route/test_bgp_default-originate.py
tests/topotests/bgp_default_route_route_map_match/test_bgp_default-originate_route-map_match.py
tests/topotests/bgp_default_route_route_map_match2/test_bgp_default-originate_route-map_match2.py
tests/topotests/bgp_default_route_route_map_match_set/test_bgp_default-originate_route-map_match_set.py
tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py
tests/topotests/bgp_disable_addpath_rx/test_disable_addpath_rx.py
tests/topotests/bgp_distance_change/test_bgp_admin_dist.py
tests/topotests/bgp_distance_change/test_bgp_admin_dist_vrf.py
tests/topotests/bgp_distance_change/test_bgp_distance_change.py
tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py
tests/topotests/bgp_ebgp_common_subnet_nexthop_unchanged/test_bgp-ebgp-common-subnet-nexthop-unchanged.py
tests/topotests/bgp_ebgp_requires_policy/test_bgp_ebgp_requires_policy.py
tests/topotests/bgp_ecmp_topo1/test_bgp_ecmp_topo1.py
tests/topotests/bgp_ecmp_topo2/test_ebgp_ecmp_topo2.py
tests/topotests/bgp_ecmp_topo2/test_ibgp_ecmp_topo2.py
tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py
tests/topotests/bgp_evpn_mh/test_evpn_mh.py
tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/ospfd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/evpn.vni.json [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/ospfd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/evpn.vni.json [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/ospfd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/__init__.py [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/ospfd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/ospfd.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_evpn_vxlan_svd_topo1/test_bgp_evpn_vxlan_svd.py [new file with mode: 0755]
tests/topotests/bgp_evpn_vxlan_topo1/PE1/evpn.vni.json
tests/topotests/bgp_evpn_vxlan_topo1/PE2/evpn.vni.json
tests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py
tests/topotests/bgp_extended_optional_parameters_length/test_bgp_extended_optional_parameters_length.py
tests/topotests/bgp_features/test_bgp_features.py
tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py
tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-1.py
tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-2.py
tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-3.py
tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1-4.py
tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-1.py
tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-2.py
tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
tests/topotests/bgp_gr_functionality_topo3/bgp_gr_functionality_topo3.py
tests/topotests/bgp_gr_notification/test_bgp_gr_notification.py
tests/topotests/bgp_gr_restart_retain_routes/test_bgp_gr_restart_retain_routes.py
tests/topotests/bgp_gshut/test_bgp_gshut.py
tests/topotests/bgp_gshut_topo1/test_ebgp_gshut_topo1.py
tests/topotests/bgp_gshut_topo1/test_ibgp_gshut_topo1.py
tests/topotests/bgp_instance_del_test/test_bgp_instance_del_test.py
tests/topotests/bgp_ipv4_class_e_peer/test_bgp_ipv4_class_e_peer.py
tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_ibgp_nbr.py
tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_nbr.py
tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py
tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ibgp_nbr.py
tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ibgp_unnumbered_nbr.py
tests/topotests/bgp_ipv6_rtadv/test_bgp_ipv6_rtadv.py
tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py
tests/topotests/bgp_l3vpn_to_bgp_direct/test_bgp_l3vpn_to_bgp_direct.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py
tests/topotests/bgp_labeled_unicast_addpath/test_bgp_labeled_unicast_addpath.py
tests/topotests/bgp_labeled_unicast_default_originate/test_bgp_labeled_unicast_default_originate.py
tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py
tests/topotests/bgp_large_community/test_bgp_large_community_topo_2.py
tests/topotests/bgp_link_bw_ip/test_bgp_linkbw_ip.py
tests/topotests/bgp_listen_on_multiple_addresses/test_bgp_listen_on_multiple_addresses.py
tests/topotests/bgp_llgr/test_bgp_llgr.py
tests/topotests/bgp_local_as/test_bgp_local_as.py
tests/topotests/bgp_local_as_dotplus_private_remove/__init__.py [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r3/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r3/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r4/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/r4/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_local_as_dotplus_private_remove/test_bgp_local_as_dotplus_private_remove.py [new file with mode: 0644]
tests/topotests/bgp_local_as_private_remove/test_bgp_local_as_private_remove.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_agg.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_ecmp.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_topo1.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_topo2.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo1.py
tests/topotests/bgp_local_asn/test_bgp_local_asn_vrf_topo2.py
tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_agg.json [new file with mode: 0644]
tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_ecmp.json [new file with mode: 0644]
tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_topo1.json [new file with mode: 0644]
tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py [new file with mode: 0644]
tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py [new file with mode: 0644]
tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py [new file with mode: 0644]
tests/topotests/bgp_lu_topo1/test_bgp_lu.py
tests/topotests/bgp_lu_topo2/test_bgp_lu2.py
tests/topotests/bgp_max_med_on_startup/test_bgp_max_med_on_startup.py
tests/topotests/bgp_maximum_prefix_invalid_update/test_bgp_maximum_prefix_invalid_update.py
tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py
tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py
tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py
tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py
tests/topotests/bgp_orf/test_bgp_orf.py
tests/topotests/bgp_path_attribute_discard/test_bgp_path_attribute_discard.py
tests/topotests/bgp_path_attribute_treat_as_withdraw/__init__.py [new file with mode: 0644]
tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_path_attribute_treat_as_withdraw/test_bgp_path_attribute_treat_as_withdraw.py [new file with mode: 0644]
tests/topotests/bgp_path_attributes_topo1/test_bgp_path_attributes.py
tests/topotests/bgp_path_selection/test_bgp_path_selection.py
tests/topotests/bgp_peer_graceful_shutdown/test_bgp_peer_graceful_shutdown.py
tests/topotests/bgp_peer_group/test_bgp_peer-group.py
tests/topotests/bgp_peer_type_multipath_relax/test_bgp_peer-type_multipath-relax.py
tests/topotests/bgp_prefix_list_topo1/test_prefix_lists.py
tests/topotests/bgp_prefix_sid/test_bgp_prefix_sid.py
tests/topotests/bgp_prefix_sid2/test_bgp_prefix_sid2.py
tests/topotests/bgp_recursive_route_ebgp_multi_hop/test_bgp_recursive_route_ebgp_multi_hop.py
tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py
tests/topotests/bgp_remove_private_as/test_bgp_remove_private_as.py
tests/topotests/bgp_rfapi_basic_sanity/customize.py
tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py
tests/topotests/bgp_rmap_extcommunity_none/test_bgp_rmap_extcommunity_none.py
tests/topotests/bgp_roles_capability/test_bgp_roles_capability.py
tests/topotests/bgp_roles_filtering/test_bgp_roles_filtering.py
tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
tests/topotests/bgp_route_map/test_route_map_topo1.py
tests/topotests/bgp_route_map/test_route_map_topo2.py
tests/topotests/bgp_route_map_match_ipv6_nexthop/test_bgp_route_map_match_ipv6_nexthop.py
tests/topotests/bgp_route_map_vpn_import/__init__.py [new file with mode: 0644]
tests/topotests/bgp_route_map_vpn_import/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_route_map_vpn_import/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py [new file with mode: 0644]
tests/topotests/bgp_route_server_client/test_bgp_route_server_client.py
tests/topotests/bgp_rr_ibgp/test_bgp_rr_ibgp_topo1.py
tests/topotests/bgp_sender_as_path_loop_detection/test_bgp_sender-as-path-loop-detection.py
tests/topotests/bgp_set_aspath_replace/test_bgp_set_aspath_replace.py
tests/topotests/bgp_set_local_preference_add_subtract/test_bgp_set_local-preference_add_subtract.py
tests/topotests/bgp_snmp_bgp4v2mib/test_bgp_snmp_bgp4v2mib.py
tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
tests/topotests/bgp_software_version/__init__.py [new file with mode: 0644]
tests/topotests/bgp_software_version/r1/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_software_version/r1/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_software_version/r2/bgpd.conf [new file with mode: 0644]
tests/topotests/bgp_software_version/r2/zebra.conf [new file with mode: 0644]
tests/topotests/bgp_software_version/test_bgp_software_version.py [new file with mode: 0644]
tests/topotests/bgp_soo/test_bgp_soo.py
tests/topotests/bgp_srv6l3vpn_over_ipv6/test_bgp_srv6l3vpn_over_ipv6.py
tests/topotests/bgp_srv6l3vpn_route_leak/test_bgp_srv6l3vpn_route_leak.py
tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py
tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/test_bgp_srv6l3vpn_to_bgp_vrf2.py
tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/test_bgp_srv6l3vpn_to_bgp_vrf3.py
tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py
tests/topotests/bgp_tcp_mss/test_bgp_tcp_mss.py
tests/topotests/bgp_tcp_mss/test_bgp_vrf_tcp_mss.py
tests/topotests/bgp_unique_rid/test_bgp_unique_rid.py
tests/topotests/bgp_unique_rid/test_bgp_unique_rid_vrf.py
tests/topotests/bgp_unnumbered/test_bgp_unnumbered.py
tests/topotests/bgp_update_delay/test_bgp_update_delay.py
tests/topotests/bgp_vpn_5549_route_map/test_bgp_vpn_5549_route_map.py
tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py
tests/topotests/bgp_vpnv4_gre/test_bgp_vpnv4_gre.py
tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo1.py
tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo2.py
tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
tests/topotests/bgp_vrf_leaking_5549_routes/test_bgp_vrf_leaking.py
tests/topotests/bgp_vrf_leaking_rt_change_route_maps/test_bgp_vrf_leaking_rt_change_route_maps.py
tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo1.py
tests/topotests/bgp_vrf_lite_best_path_test/test_bgp_vrf_lite_best_path_topo2.py
tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py
tests/topotests/bgp_vrf_netns/test_bgp_vrf_netns_topo.py
tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py
tests/topotests/config_timing/test_config_timing.py
tests/topotests/cspf_topo1/test_cspf_topo1.py
tests/topotests/docker/build.sh
tests/topotests/docker/frr-topotests.sh
tests/topotests/docker/inner/compile_frr.sh
tests/topotests/docker/inner/entrypoint.sh
tests/topotests/docker/inner/funcs.sh
tests/topotests/docker/inner/openvswitch.sh
tests/topotests/eigrp_topo1/test_eigrp_topo1.py
tests/topotests/evpn_pim_1/test_evpn_pim_topo1.py
tests/topotests/evpn_type5_test_topo1/test_evpn_type5_chaos_topo1.py
tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py
tests/topotests/example_test/test_template.py
tests/topotests/example_test/test_template_json.py
tests/topotests/example_topojson_test/test_topo_json_multiple_links/test_example_topojson_multiple_links.py
tests/topotests/example_topojson_test/test_topo_json_single_link/test_example_topojson.py
tests/topotests/example_topojson_test/test_topo_json_single_link_loopback/test_example_topojson.py
tests/topotests/grpc_basic/test_basic_grpc.py
tests/topotests/isis_lfa_topo1/test_isis_lfa_topo1.py
tests/topotests/isis_lsp_bits_topo1/test_isis_lsp_bits_topo1.py
tests/topotests/isis_rlfa_topo1/test_isis_rlfa_topo1.py
tests/topotests/isis_snmp/test_isis_snmp.py
tests/topotests/isis_sr_te_topo1/test_isis_sr_te_topo1.py
tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py
tests/topotests/isis_te_topo1/reference/ted_step10.json [new file with mode: 0644]
tests/topotests/isis_te_topo1/reference/ted_step7.json [new file with mode: 0644]
tests/topotests/isis_te_topo1/reference/ted_step8.json [new file with mode: 0644]
tests/topotests/isis_te_topo1/reference/ted_step9.json [new symlink]
tests/topotests/isis_te_topo1/test_isis_te_topo1.py
tests/topotests/isis_tilfa_topo1/test_isis_tilfa_topo1.py
tests/topotests/isis_topo1/test_isis_topo1.py
tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
tests/topotests/ldp_oc_acl_topo1/test_ldp_oc_acl_topo1.py
tests/topotests/ldp_oc_topo1/test_ldp_oc_topo1.py
tests/topotests/ldp_snmp/test_ldp_snmp_topo1.py
tests/topotests/ldp_sync_isis_topo1/test_ldp_sync_isis_topo1.py
tests/topotests/ldp_sync_ospf_topo1/test_ldp_sync_ospf_topo1.py
tests/topotests/ldp_topo1/test_ldp_topo1.py
tests/topotests/ldp_vpls_topo1/test_ldp_vpls_topo1.py
tests/topotests/lib/bgp.py
tests/topotests/lib/bgprib.py
tests/topotests/lib/common_config.py
tests/topotests/lib/fixtures.py
tests/topotests/lib/grpc-query.py
tests/topotests/lib/ltemplate.py
tests/topotests/lib/lutil.py
tests/topotests/lib/mcast-tester.py
tests/topotests/lib/micronet.py
tests/topotests/lib/micronet_cli.py
tests/topotests/lib/micronet_compat.py
tests/topotests/lib/ospf.py
tests/topotests/lib/pim.py
tests/topotests/lib/scapy_sendpkt.py
tests/topotests/lib/send_bsr_packet.py
tests/topotests/lib/snmptest.py
tests/topotests/lib/test/test_json.py
tests/topotests/lib/test/test_run_and_expect.py
tests/topotests/lib/test/test_version.py
tests/topotests/lib/topogen.py
tests/topotests/lib/topojson.py
tests/topotests/lib/topolog.py
tests/topotests/lib/topotest.py
tests/topotests/msdp_mesh_topo1/test_msdp_mesh_topo1.py
tests/topotests/msdp_topo1/test_msdp_topo1.py
tests/topotests/multicast_pim6_static_rp_topo1/test_multicast_pim6_static_rp1.py
tests/topotests/multicast_pim6_static_rp_topo1/test_multicast_pim6_static_rp2.py
tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py
tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py
tests/topotests/multicast_pim_dr_nondr_test/test_pim_dr_nondr_with_ospf_topo2.py
tests/topotests/multicast_pim_dr_nondr_test/test_pim_dr_nondr_with_static_routes_topo1.py
tests/topotests/multicast_pim_dr_nondr_test/test_pim_dr_nondr_with_transit_router_topo3.py
tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py
tests/topotests/multicast_pim_sm_topo2/test_multicast_pim_sm_topo2.py
tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py
tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo4.py
tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py
tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp1.py
tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp2.py
tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
tests/topotests/nhrp_topo/test_nhrp_topo.py
tests/topotests/ospf6_ecmp_inter_area/test_ospf6_ecmp_inter_area.py
tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py
tests/topotests/ospf6_topo1/test_ospf6_topo1.py
tests/topotests/ospf6_topo1_vrf/test_ospf6_topo1_vrf.py
tests/topotests/ospf6_topo2/test_ospf6_topo2.py
tests/topotests/ospf_basic_functionality/ospf_flood_reduction.json [new file with mode: 0644]
tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py
tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_type7_lsa.py
tests/topotests/ospf_basic_functionality/test_ospf_authentication.py
tests/topotests/ospf_basic_functionality/test_ospf_chaos.py
tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py
tests/topotests/ospf_basic_functionality/test_ospf_flood_reduction.py [new file with mode: 0644]
tests/topotests/ospf_basic_functionality/test_ospf_lan.py
tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py
tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py
tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py
tests/topotests/ospf_basic_functionality/test_ospf_single_area.py
tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py
tests/topotests/ospf_gr_helper/test_ospf_gr_helper2.py
tests/topotests/ospf_gr_helper/test_ospf_gr_helper3.py
tests/topotests/ospf_gr_topo1/test_ospf_gr_topo1.py
tests/topotests/ospf_instance_redistribute/test_ospf_instance_redistribute.py
tests/topotests/ospf_multi_vrf_bgp_route_leak/test_ospf_multi_vrf_bgp_route_leak.py
tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py
tests/topotests/ospf_sr_te_topo1/test_ospf_sr_te_topo1.py
tests/topotests/ospf_sr_topo1/test_ospf_sr_topo1.py
tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py
tests/topotests/ospf_te_topo1/test_ospf_te_topo1.py
tests/topotests/ospf_tilfa_topo1/test_ospf_tilfa_topo1.py
tests/topotests/ospf_topo1/test_ospf_topo1.py
tests/topotests/ospf_unnumbered/test_ospf_unnumbered.py
tests/topotests/ospfapi/ctester.py
tests/topotests/ospfapi/r1/ospfd.conf
tests/topotests/ospfapi/r1/zebra.conf
tests/topotests/ospfapi/r2/ospfd.conf
tests/topotests/ospfapi/r3/ospfd.conf
tests/topotests/ospfapi/r4/ospfd.conf
tests/topotests/ospfapi/r4/zebra.conf
tests/topotests/ospfapi/test_ospf_clientapi.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp_lan.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa2.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_routemaps.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py
tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py
tests/topotests/pbr_topo1/test_pbr_topo1.py
tests/topotests/pim_acl/test_pim_acl.py
tests/topotests/pim_basic/mcast-rx.py
tests/topotests/pim_basic/mcast-tx.py
tests/topotests/pim_basic/test_pim.py
tests/topotests/pim_basic_topo2/test_pim_basic_topo2.py
tests/topotests/pim_igmp_vrf/test_pim_vrf.py
tests/topotests/rip_topo1/test_rip_topo1.py
tests/topotests/ripng_topo1/test_ripng_topo1.py
tests/topotests/route_scale/scale_test_common.py
tests/topotests/route_scale/test_route_scale1.py
tests/topotests/route_scale/test_route_scale2.py
tests/topotests/simple_snmp_test/test_simple_snmp.py
tests/topotests/srv6_locator/test_srv6_locator.py
tests/topotests/srv6_locator_custom_bits_length/test_srv6_locator.py
tests/topotests/srv6_locator_usid/test_srv6_locator_usid.py
tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py
tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py
tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py
tests/topotests/static_routing_with_ebgp/test_static_routes_topo4_ebgp.py
tests/topotests/static_routing_with_ibgp/test_static_routes_topo1_ibgp.py
tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py
tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py
tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py
tests/topotests/tc_basic/test_tc_basic.py
tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py
tests/topotests/zebra_netlink/test_zebra_netlink.py
tests/topotests/zebra_nht_resolution/test_verify_nh_resolution.py
tests/topotests/zebra_opaque/test_zebra_opaque.py
tests/topotests/zebra_rib/test_zebra_rib.py
tests/topotests/zebra_seg6_route/test_zebra_seg6_route.py
tests/topotests/zebra_seg6local_route/test_zebra_seg6local_route.py
tests/zebra/test_lm_plugin.c
tools/build-debian-package.sh
tools/checkpatch.pl
tools/etc/rsyslog.d/45-frr.conf
tools/fixup-deprecated.py
tools/frr-llvm-cg.c
tools/frr-llvm-debuginfo.cpp
tools/frr-llvm-debuginfo.h
tools/frr-reload.py
tools/frr.vim
tools/frr_babeltrace.py
tools/gcc-plugins/COPYING.GPLv3 [deleted file]
tools/gcc-plugins/frr-format.c
tools/gcc-plugins/frr-format.h
tools/gen_northbound_callbacks.c
tools/gen_yang_deviations.c
tools/generate_support_bundle.py
tools/indent.py
tools/nhrpd-event-handler.sh
tools/permutations.c
tools/render_md.py
tools/start-stop-daemon.c
tools/stringmangle.py
tools/symalyzer.html
tools/symalyzer.py
tools/zc.pl
vrrpd/vrrp.c
vrrpd/vrrp.h
vrrpd/vrrp_arp.c
vrrpd/vrrp_arp.h
vrrpd/vrrp_debug.c
vrrpd/vrrp_debug.h
vrrpd/vrrp_main.c
vrrpd/vrrp_ndisc.c
vrrpd/vrrp_ndisc.h
vrrpd/vrrp_northbound.c
vrrpd/vrrp_packet.c
vrrpd/vrrp_packet.h
vrrpd/vrrp_vty.c
vrrpd/vrrp_vty.h
vrrpd/vrrp_zebra.c
vrrpd/vrrp_zebra.h
vtysh/daemons.pl
vtysh/vtysh.c
vtysh/vtysh.h
vtysh/vtysh_config.c
vtysh/vtysh_main.c
vtysh/vtysh_user.c
vtysh/vtysh_user.h
watchfrr/watchfrr.c
watchfrr/watchfrr.h
watchfrr/watchfrr_errors.c
watchfrr/watchfrr_errors.h
watchfrr/watchfrr_vty.c
yang/LICENSE [deleted file]
yang/embedmodel.py
yang/frr-affinity-map.yang [new file with mode: 0644]
yang/frr-bfdd.yang
yang/frr-bgp-bmp.yang
yang/frr-bgp-common-multiprotocol.yang
yang/frr-bgp-common-structure.yang
yang/frr-bgp-neighbor.yang
yang/frr-bgp-peer-group.yang
yang/frr-bgp-route-map.yang
yang/frr-bgp-rpki.yang
yang/frr-bgp-types.yang
yang/frr-bgp.yang
yang/frr-deviations-bgp-datacenter.yang
yang/frr-eigrpd.yang
yang/frr-filter.yang
yang/frr-gmp.yang
yang/frr-interface.yang
yang/frr-isisd.yang
yang/frr-module-translator.yang
yang/frr-nexthop.yang
yang/frr-pim-rp.yang
yang/frr-pim.yang
yang/frr-ripd.yang
yang/frr-ripngd.yang
yang/frr-route-map.yang
yang/frr-route-types.yang
yang/frr-routing.yang
yang/frr-staticd.yang
yang/frr-test-module.yang
yang/frr-vrf.yang
yang/frr-vrrpd.yang
yang/frr-zebra.yang
yang/libyang_plugins/frr_user_types.c
yang/subdir.am
zebra/connected.c
zebra/connected.h
zebra/debug.c
zebra/debug.h
zebra/debug_nl.c
zebra/dpdk/zebra_dplane_dpdk.c
zebra/dpdk/zebra_dplane_dpdk.h
zebra/dpdk/zebra_dplane_dpdk_private.h
zebra/dpdk/zebra_dplane_dpdk_vty.c
zebra/dplane_fpm_nl.c
zebra/if_ioctl.c
zebra/if_netlink.c
zebra/if_netlink.h
zebra/if_socket.c
zebra/if_sysctl.c
zebra/interface.c
zebra/interface.h
zebra/ioctl.c
zebra/ioctl.h
zebra/ipforward.h
zebra/ipforward_proc.c
zebra/ipforward_sysctl.c
zebra/irdp.h
zebra/irdp_interface.c
zebra/irdp_main.c
zebra/irdp_packet.c
zebra/kernel_netlink.c
zebra/kernel_netlink.h
zebra/kernel_socket.c
zebra/kernel_socket.h
zebra/label_manager.c
zebra/label_manager.h
zebra/main.c
zebra/netconf_netlink.c
zebra/netconf_netlink.h
zebra/redistribute.c
zebra/redistribute.h
zebra/rib.h
zebra/router-id.c
zebra/router-id.h
zebra/rt.h
zebra/rt_netlink.c
zebra/rt_netlink.h
zebra/rt_socket.c
zebra/rtadv.c
zebra/rtadv.h
zebra/rtread_netlink.c
zebra/rtread_sysctl.c
zebra/rule_netlink.c
zebra/rule_netlink.h
zebra/rule_socket.c
zebra/sample_plugin.c
zebra/subdir.am
zebra/table_manager.c
zebra/table_manager.h
zebra/tc_netlink.c
zebra/tc_netlink.h
zebra/tc_socket.c
zebra/zapi_msg.c
zebra/zapi_msg.h
zebra/zebra_affinitymap.c [new file with mode: 0644]
zebra/zebra_affinitymap.h [new file with mode: 0644]
zebra/zebra_dplane.c
zebra/zebra_dplane.h
zebra/zebra_errors.c
zebra/zebra_errors.h
zebra/zebra_evpn.c
zebra/zebra_evpn.h
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_mac.h
zebra/zebra_evpn_mh.c
zebra/zebra_evpn_mh.h
zebra/zebra_evpn_neigh.c
zebra/zebra_evpn_neigh.h
zebra/zebra_evpn_vxlan.h
zebra/zebra_fpm.c
zebra/zebra_fpm_dt.c
zebra/zebra_fpm_netlink.c
zebra/zebra_fpm_private.h
zebra/zebra_fpm_protobuf.c
zebra/zebra_gr.c
zebra/zebra_l2.c
zebra/zebra_l2.h
zebra/zebra_l2_bridge_if.c [new file with mode: 0644]
zebra/zebra_l2_bridge_if.h [new file with mode: 0644]
zebra/zebra_mlag.c
zebra/zebra_mlag.h
zebra/zebra_mlag_private.c
zebra/zebra_mlag_vty.c
zebra/zebra_mlag_vty.h
zebra/zebra_mpls.c
zebra/zebra_mpls.h
zebra/zebra_mpls_netlink.c
zebra/zebra_mpls_null.c
zebra/zebra_mpls_openbsd.c
zebra/zebra_mpls_vty.c
zebra/zebra_mroute.c
zebra/zebra_mroute.h
zebra/zebra_nb.c
zebra/zebra_nb.h
zebra/zebra_nb_config.c
zebra/zebra_nb_rpcs.c
zebra/zebra_nb_state.c
zebra/zebra_neigh.c
zebra/zebra_neigh.h
zebra/zebra_netns_id.c
zebra/zebra_netns_id.h
zebra/zebra_netns_notify.c
zebra/zebra_netns_notify.h
zebra/zebra_nhg.c
zebra/zebra_nhg.h
zebra/zebra_nhg_private.h
zebra/zebra_ns.c
zebra/zebra_ns.h
zebra/zebra_opaque.c
zebra/zebra_opaque.h
zebra/zebra_pbr.c
zebra/zebra_pbr.h
zebra/zebra_ptm.c
zebra/zebra_ptm.h
zebra/zebra_ptm_redistribute.c
zebra/zebra_ptm_redistribute.h
zebra/zebra_pw.c
zebra/zebra_pw.h
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_rnh.h
zebra/zebra_routemap.c
zebra/zebra_routemap.h
zebra/zebra_routemap_nb.c
zebra/zebra_routemap_nb.h
zebra/zebra_router.c
zebra/zebra_router.h
zebra/zebra_script.c
zebra/zebra_script.h
zebra/zebra_snmp.c
zebra/zebra_srte.c
zebra/zebra_srte.h
zebra/zebra_srv6.c
zebra/zebra_srv6.h
zebra/zebra_srv6_vty.c
zebra/zebra_srv6_vty.h
zebra/zebra_tc.c
zebra/zebra_tc.h
zebra/zebra_trace.h
zebra/zebra_vrf.c
zebra/zebra_vrf.h
zebra/zebra_vty.c
zebra/zebra_vxlan.c
zebra/zebra_vxlan.h
zebra/zebra_vxlan_if.c [new file with mode: 0644]
zebra/zebra_vxlan_if.h [new file with mode: 0644]
zebra/zebra_vxlan_private.h
zebra/zserv.c
zebra/zserv.h

diff --git a/.github/commitlint.config.js b/.github/commitlint.config.js
new file mode 100644 (file)
index 0000000..bee965b
--- /dev/null
@@ -0,0 +1,45 @@
+module.exports = {
+       rules: {
+               'header-max-length': [2, 'always', 72],
+               'type-case': [2, 'always', 'lower-case'],
+               'type-empty': [2, 'never'],
+               'type-enum': [
+                       2,
+                       'always',
+                       [
+                               'babeld',
+                               'bfdd',
+                               'bgpd',
+                               'build',
+                               'doc',
+                               'docker',
+                               'eigrpd',
+                               'fpm',
+                               'isisd',
+                               'ldpd',
+                               'lib',
+                               'multi',
+                               'nhrpd',
+                               'ospf6d',
+                               'ospfd',
+                               'pbrd',
+                               'pimd',
+                               'pim6d',
+                               'ripd',
+                               'ripngd',
+                               'sharpd',
+                               'staticd',
+                               'tests',
+                               'tools',
+                               'vtysh',
+                               'vrrpd',
+                               'yang',
+                               'zebra',
+                               'all',
+                       ],
+               ],
+               'subject-empty': [2, 'never'],
+               'subject-full-stop': [2, 'never', '.'],
+               'subject-case': [2, 'always', 'sentence-case'],
+       },
+};
diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml
new file mode 100644 (file)
index 0000000..e9c66a9
--- /dev/null
@@ -0,0 +1,27 @@
+name: commitlint
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - reopened
+      - synchronize
+      - labeled
+      - unlabeled
+
+jobs:
+  lint:
+    if: github.repository == 'frrouting/frr'
+    permissions:
+      contents: read
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+
+      - name: Check Commit
+        uses: wagoid/commitlint-github-action@v5
+        with:
+          configFile: .github/commitlint.config.js
diff --git a/COPYING b/COPYING
index d159169d1050894d3ea3b98e1c965c4058208fe1..84ba352e48e96a51d59e668953ba70bdd7960ef6 100644 (file)
--- a/COPYING
+++ b/COPYING
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
+The FRRouting project consists of parts with various licenses.  Any particular
+file's license should be indicated at the top of the file with an SPDX License
+identifier.
+
+The full text of all licenses used can be found in doc/licenses.
+
+The composite work (binary) resulting from compiling FRR is thought to always
+be distributable under GPLv2 or later.  However, please note that this is
+simply an expression of the community's best-effort understanding, it is not a
+legal statement, guarantee, or advice of any kind.  If necessary, please
+familiarize yourself with the specifics and/or consult a lawyer.
+
+Also please be advised that FRR's documentation is, for historical reasons,
+licensed under a custom (but relatively permissive) license.  This license
+dates back to the GNU Zebra project and cannot easily be changed into something
+more common, short of rewriting the entire documentation.
diff --git a/COPYING-LGPLv2.1 b/COPYING-LGPLv2.1
deleted file mode 100644 (file)
index 4362b49..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/babeld/LICENCE b/babeld/LICENCE
deleted file mode 100644 (file)
index 2a340a4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
index b22b1d5cbfc783e797e2affdd75e7d6fccecf822..b093bdbc6ff18cdb77f402ad3f68409c0a5d7e9f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Babel-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 629b6604be23fec5349130f11f9f91be1e051862..47539c70424cd2da5ecdee369fffb276d5a3d6c7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Babel-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __BABEL_ERRORS_H__
index f49fee8daeab5caada5d0248e0ec10b55c19b5c1..053493274dcf175fc3a6097f6726ec381cad2488 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index b88b18d8a0c37b986106187e41113fb91d937b07..d2535432b51ea1bf5fd09b314953fbffddf97f19 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABELD_BABEL_FILTER_H
index 4ca875206f3bf3d69b02481c3c6ef08a1dde089c..ceff472c2a27f180550fd89610323bdd1f68a933 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #include <zebra.h>
@@ -66,7 +49,7 @@ static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 
 int babel_ifp_up(struct interface *ifp)
 {
-    debugf(BABEL_DEBUG_IF, "receive a 'interface up'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface up'");
 
     interface_recalculate(ifp);
     return 0;
@@ -75,7 +58,7 @@ int babel_ifp_up(struct interface *ifp)
 int
 babel_ifp_down(struct interface *ifp)
 {
-    debugf(BABEL_DEBUG_IF, "receive a 'interface down'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface down'");
 
     if (ifp == NULL) {
         return 0;
@@ -87,7 +70,7 @@ babel_ifp_down(struct interface *ifp)
 
 int babel_ifp_create (struct interface *ifp)
 {
-    debugf(BABEL_DEBUG_IF, "receive a 'interface add'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface add'");
 
     interface_recalculate(ifp);
 
@@ -97,7 +80,7 @@ int babel_ifp_create (struct interface *ifp)
 int
 babel_ifp_destroy(struct interface *ifp)
 {
-    debugf(BABEL_DEBUG_IF, "receive a 'interface delete'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface delete'");
 
     if (IS_ENABLE(ifp))
         interface_reset(ifp);
@@ -112,7 +95,7 @@ babel_interface_address_add (ZAPI_CALLBACK_ARGS)
     struct connected *ifc;
     struct prefix *prefix;
 
-    debugf(BABEL_DEBUG_IF, "receive a 'interface address add'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface address add'");
 
     ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
                                         zclient->ibuf, vrf_id);
@@ -148,7 +131,7 @@ babel_interface_address_delete (ZAPI_CALLBACK_ARGS)
     struct connected *ifc;
     struct prefix *prefix;
 
-    debugf(BABEL_DEBUG_IF, "receive a 'interface address delete'");
+    debugf(BABEL_DEBUG_IF, "receive an 'interface address delete'");
 
     ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
                                         zclient->ibuf, vrf_id);
@@ -295,17 +278,18 @@ static void
 babel_set_wired_internal(babel_interface_nfo *babel_ifp, int wired)
 {
     if(wired) {
-        babel_ifp->flags |= BABEL_IF_WIRED;
-        babel_ifp->flags |= BABEL_IF_SPLIT_HORIZON;
+        SET_FLAG(babel_ifp->flags, BABEL_IF_WIRED);
+        SET_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON);
         babel_ifp->cost = BABEL_DEFAULT_RXCOST_WIRED;
         babel_ifp->channel = BABEL_IF_CHANNEL_NONINTERFERING;
-        babel_ifp->flags &= ~BABEL_IF_LQ;
-    } else {
-        babel_ifp->flags &= ~BABEL_IF_WIRED;
-        babel_ifp->flags &= ~BABEL_IF_SPLIT_HORIZON;
+        UNSET_FLAG(babel_ifp->flags, BABEL_IF_LQ);
+    } 
+    else {
+        UNSET_FLAG(babel_ifp->flags, BABEL_IF_WIRED);
+        UNSET_FLAG(babel_ifp->flags, BABEL_IF_SPLIT_HORIZON);
         babel_ifp->cost = BABEL_DEFAULT_RXCOST_WIRELESS;
         babel_ifp->channel = BABEL_IF_CHANNEL_INTERFERING;
-        babel_ifp->flags |= BABEL_IF_LQ;
+        SET_FLAG(babel_ifp->flags, BABEL_IF_LQ);
     }
 
 }
@@ -595,7 +579,7 @@ interface_recalculate(struct interface *ifp)
         return -1;
     }
 
-    babel_ifp->flags |= BABEL_IF_IS_UP;
+    SET_FLAG(babel_ifp->flags, BABEL_IF_IS_UP);
 
     mtu = MIN(ifp->mtu, ifp->mtu6);
 
@@ -653,7 +637,7 @@ interface_recalculate(struct interface *ifp)
     debugf(BABEL_DEBUG_COMMON,
            "Upped interface %s (%s, cost=%d, channel=%d%s).",
            ifp->name,
-           (babel_ifp->flags & BABEL_IF_WIRED) ? "wired" : "wireless",
+           CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless",
            babel_ifp->cost,
            babel_ifp->channel,
            babel_ifp->ipv4 ? ", IPv4" : "");
@@ -673,11 +657,12 @@ interface_reset(struct interface *ifp)
     struct ipv6_mreq mreq;
     babel_interface_nfo *babel_ifp = babel_get_if_nfo(ifp);
 
-    if (!(babel_ifp->flags & BABEL_IF_IS_UP))
+    if (!CHECK_FLAG(babel_ifp->flags, BABEL_IF_IS_UP))
         return 0;
 
     debugf(BABEL_DEBUG_IF, "interface reset: %s", ifp->name);
-    babel_ifp->flags &= ~BABEL_IF_IS_UP;
+
+    UNSET_FLAG(babel_ifp->flags, BABEL_IF_IS_UP);
 
     flush_interface_routes(ifp, 0);
     babel_ifp->buffered = 0;
@@ -706,7 +691,7 @@ interface_reset(struct interface *ifp)
 
     debugf(BABEL_DEBUG_COMMON,"Upped network %s (%s, cost=%d%s).",
            ifp->name,
-           (babel_ifp->flags & BABEL_IF_WIRED) ? "wired" : "wireless",
+           CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? "wired" : "wireless",
            babel_ifp->cost,
            babel_ifp->ipv4 ? ", IPv4" : "");
 
index 9833827927e64900bd84e83a2d6f2a7647d5bc1f..12fa6e2bad9a5a4b884ff6553bd082c3e035bd77 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_INTERFACE_H
@@ -100,7 +83,7 @@ if_up(struct interface *ifp)
 {
     return (if_is_operative(ifp) &&
             ifp->connected != NULL &&
-            (babel_get_if_nfo(ifp)->flags & BABEL_IF_IS_UP));
+            CHECK_FLAG(babel_get_if_nfo(ifp)->flags, BABEL_IF_IS_UP));
 }
 
 struct buffered_update {
index 9aa5ce3a01c134e5efae7e87b0a4ec9ba1481151..0869c120ac827058c471c6c6d5446f18574692ed 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 /* include zebra library */
index 6fd27bf4cf910218e8ae0cd144a352fb9a0333f3..659ddc70cf4b3189650c854f66b68b31547d748c 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_MAIN_H
index daaa870a646a700959f0fa11c4e84b9adcdbaa84..bead9f27ef1672bd99e296f1ff833481dc7cb5cc 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 /* FRR's includes */
@@ -139,7 +122,7 @@ DEFUN (debug_babel,
     for(i = 0; debug_type[i].str != NULL; i++) {
         if (strncmp (debug_type[i].str, argv[2]->arg,
                      debug_type[i].str_min_len) == 0) {
-            debug |= debug_type[i].type;
+            SET_FLAG(debug, debug_type[i].type);
             return CMD_SUCCESS;
         }
     }
@@ -169,7 +152,7 @@ DEFUN (no_debug_babel,
     for (i = 0; debug_type[i].str; i++) {
         if (strncmp(debug_type[i].str, argv[3]->arg,
                     debug_type[i].str_min_len) == 0) {
-            debug &= ~debug_type[i].type;
+            UNSET_FLAG(debug, debug_type[i].type);
             return CMD_SUCCESS;
         }
     }
@@ -195,16 +178,18 @@ debug_babel_config_write (struct vty * vty)
         lines++;
     }
     else
+    {
         for (i = 0; debug_type[i].str != NULL; i++)
-            if
-            (
-                debug_type[i].type != BABEL_DEBUG_ALL
-                && CHECK_FLAG (debug, debug_type[i].type)
-            )
+        {
+            if (debug_type[i].type != BABEL_DEBUG_ALL
+                && CHECK_FLAG (debug, debug_type[i].type))
             {
                 vty_out (vty, "debug babel %s\n", debug_type[i].str);
                 lines++;
             }
+        }
+    }
+
     if (lines)
     {
         vty_out (vty, "!\n");
index c064146bd752fb1f680a34d2aed98ac8442ab5fe..7f960d3961d69b51553e9da5255696068842a070 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_ZEBRA_H
index 972d52819b879e43a4d1b8509a0657cfcc3a512e..5104155936638b75dd19ec553fffb1993ad9728e 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #include <zebra.h>
@@ -277,7 +260,7 @@ babel_get_myid(void)
         exit(1);
     }
     /* Clear group and global bits */
-    myid[0] &= ~3;
+    UNSET_FLAG (myid[0], 3);
 }
 
 /* Make some noise so that others notice us, and send retractions in
index 38859f54daaa79487c7dda6fd326d3d3d84bba04..a9ffb7ee435ad4cc49cff9eee6434b116acfe893 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_BABELD_H
index 5aa01ceb44dcfa9bd9f29feb2ad63a89a2525d02..f89fe268df370d362fbab054fda02eddc544666f 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright 2007, 2008 by Grégoire Henry, Julien Cristau and Juliusz Chroboczek
 Copyright 2011, 2012 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index f39bc35bdb2ab4b135d37093bbb2015243182a03..414584329f9fead5b0e1dbfe89f8f23bf12d9423 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_KERNEL_H
index 7d45d91bf7a50f73171fc8fea8061e1890585739..687f76844694d60775efd26eb62449755221e64a 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #include <zebra.h>
index 22db35e2a0106a48611b1073e80218a55709ab2f..0797a5a77de465c91456249555603f9973f87e0e 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_MESSAGE_H
index d962a0961c9299c0a4c66c94c6458dc3d69ec2dc..51e595a84ba88311891e594370d1b853469eaf1a 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index 39ee7e483ee9bc8bb155163ac841be2cb71f0a46..21116635946e3d9aca8879979bd95db895353fb5 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_NEIGHBOUR_H
index 40716a701d5631703babf0aac7e321c1c209705d..15ea2de0ff124dfa12c2217f35a2b8108501a05f 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index b3ca3767b6fb40444e5e59f0c3cf838267ce0a75..25596020696f65e66ae75521cd43ebf2a4d17464 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_NET_H
index f08897fbd1cbe3b8083cf0cd559636e48b24b9d6..254faac95f05febd2e9618b0fde78fb0b54d8390 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index 72b6986eb35f1791d1e9f6c85c59ecbd913cfd78..d0ec046472b88a04e00d9994863700a9ea39d1b8 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 #ifndef BABEL_RESEND_H
 #define BABEL_RESEND_H
index 8dd1e40431233521a792cda4f0a411aac19d7f58..2c7e92374896c9936cb437dfb06625cc8f32437d 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #include <zebra.h>
index c994d22a9fb01acfb24b04170d9bb010cb8e6290..89427b84152515379b082a4af9710b3db30f9bc8 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_ROUTE_H
index 2c303b624fde950df5c8bdb24ee06fec0d6639ed..049fa32723c1484716c90e395afe2b7ce550e0d5 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index 5b0ba44aa35e18fe5b1c1e45f924fd8d62422151..5b37ca93bd360e72f0ceb31e103f3229b17b857c 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_SOURCE_H
index e2db75996e2e684d60b71c817354a0272d57b277..4facdabbc6e34deb3fbfc90f2f89d989267ad9ce 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifdef HAVE_CONFIG_H
index ef1387364c5c21e1b03f7441e012d4ecefcf3860..5e5843543a22cba1e47e7438caf370c3dc155b7e 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_UTIL_H
index 61ea5a1ac13b74a9489b923d90bbcffc1c12d3f8..30204cd6ff3a092ac6d894435936ac7ec9230234 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #include <zebra.h>
index 59afccb5904f2de673e29b3a2bbc3c8a39237606..d2d191ce4b90e4b30a960d4483fee011d9c2fded 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: MIT
 /*
 Copyright (c) 2007, 2008 by Juliusz Chroboczek
 Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
 */
 
 #ifndef BABEL_XROUTE_H
index 4367f253e11955f4e8a418c6681b12c2a278941a..2586c0b99cade13a8b1f2a4f46c0cd47b72973ff 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2013 Cumulus Networks, LLC.  All rights reserved.
  * Copyright 2014,2015,2016,2017 Cumulus Networks, Inc.  All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * bfd.c: implements the BFD protocol.
  *
  * Authors
index a5881cddb0ec5d7f641b71e2e4ccd4a111435c7e..97e45bb2c2c53a100c8108e6f4a370a4e76b923c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2014,2015,2016,2017 Cumulus Networks, Inc.  All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * bfd.h: implements the BFD protocol.
  */
 
index 30f54f130fb37eeb50f2c588abbaa8bb088bf4a9..7be235326c5e49202ed94c563e2d4bae7855d63b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2017 Cumulus Networks, Inc.  All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * bfd_packet.c: implements the BFD protocol packet handling.
  *
  * Authors
index c4b2e803060d42d424db8f19486b7a1bf22beae7..f1f8185c3bbf7da86f6ffeb86d2bbb0467555979 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2017-2018 Network Device Education Foundation, Inc. ("NetDEF")
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * bfdctl.h: all BFDd control socket protocol definitions.
  *
  * Authors
index 7ef229da1bb73a6b0c593d0599bb4533bb19cd0d..a3751e4d330daf05a3979d008416b654aadba61c 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon code
  * Copyright (C) 2018 Network Device Education Foundation, Inc. ("NetDEF")
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index 52f2dd8fd32553649faf1a0eb05ce823c53c4996..44439c67565e78b1631566216ee211cec20a85bd 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon CLI implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 29a9b5f2d527028c2da07fded678e49ecc2ea21f..7135c507638a282922070122c0e06c0e1e886273 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index d7ac320638e71355ea94f44d50f7882615b6480e..7a0e724d28e24542268fc964e3c17cc640dc56a5 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #ifndef _FRR_BFDD_NB_H_
index c1a2ad7bb43e065b921426a3820305e9d2f2c400..e4e97404d8b9cc8140a951de5ceb2aa7a2cd3b9b 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index de0dcebfea11f9156d14c3871e5d7f6c0e0c4472..12acda8fd8a62683bdf97c0dd24a88179835fd8b 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 7b7a001e24b2f510376fae6b106ccc3cf214776d..15444e4e9d3007e69e8df856594145c6b8e05d7c 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD daemon code
  * Copyright (C) 2018 Network Device Education Foundation, Inc. ("NetDEF")
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index 4ece94f577716d4aa003d5e5abc85b64705f48ea..afcbdd758167101a103e2f8b36bebf52cedf8a5c 100644 (file)
@@ -1,26 +1,9 @@
+// SPDX-License-Identifier: MIT
 /*
  * BFD Data Plane protocol messages header.
  *
  * Copyright (C) 2020 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael F. Zalamena
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the “Software”), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
  */
 
 /**
index 22ec91235941ffa25ea18bce3aa4bbf486ad0640..22d7d7deee23dc13eb81fb22905c77e08d462b01 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2017-2018 Network Device Education Foundation, Inc. ("NetDEF")
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * config.c: implements the BFD daemon configuration handling.
  *
  * Authors
index 01cfed8f906ecf39c34012165c8c6877c8aef61f..a11ed3d895f134f1f84b77097de70259920f793d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2017-2018 Network Device Education Foundation, Inc. ("NetDEF")
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * control.c: implements the BFD daemon control socket. It will be used
  * to talk with clients daemon/scripts/consumers.
  *
index c1081643e34d477a123f9713a3daa83d3cb01f12..99bd1886f48c13845c660fe7734a3568f7e991c4 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD data plane implementation (distributed BFD).
  *
  * Copyright (C) 2020 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 654928b9b3759a7bd745dbe3aa7cd25935023328..5a9ae39c3e4e494340e0598a139f1d01e6502b37 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*********************************************************************
  * Copyright 2017-2018 Network Device Education Foundation, Inc. ("NetDEF")
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * event.c: implements the BFD loop event handlers.
  *
  * Authors
index 8a27fced5fac329a2cf9d2fba50a4f6bc9d60825..490bc30d74f4f427b7e9dcf6252356e4c0a140d6 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BFD PTM adapter code
  * Copyright (C) 2018 Network Device Education Foundation, Inc. ("NetDEF")
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index 461e60dbfcf3147bb96200a060e7410404c7ebac..7f746541ff243fa8d74a83aa364315c0ef807886 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Addpath TX ID selection, and related utilities
  * Copyright (C) 2018  Amazon.com, Inc. or its affiliates
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
@@ -174,9 +161,11 @@ bool bgp_addpath_tx_path(enum bgp_addpath_strat strat, struct bgp_path_info *pi)
                        return true;
                else
                        return false;
-       default:
+       case BGP_ADDPATH_MAX:
                return false;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static void bgp_addpath_flush_type_rn(struct bgp *bgp, afi_t afi, safi_t safi,
index 0350ee8a76a4c84d5a846e9159ab462183e080f0..909a9710c44dbc4151c0a04551b6ed21a9edea6b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Addpath TX ID selection, and related utilities
  * Copyright (C) 2018  Amazon.com, Inc. or its affiliates
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGPD_TX_ADDPATH_H
index b0b330297902439145f72663ad70213df785e671..3de9546a6d0bfc808979365151a99dca3f5e679e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Addpath TX ID selection, and related utilities
  * Copyright (C) 2018  Amazon.com, Inc. or its affiliates
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGPD_TX_ADDPATH_DATA_H
index f62a54b03cb01683fb5937c5bb1237e283860d37..3469d129e4c5c09633b36d654bd893f992f9ff2c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP advertisement and adjacency
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 70294c2d89071e3ae7fa2d82e99f843ff18a4739..c5e2a5f216f1bb1c13f815d2d9d68429ed0b2d7f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP advertisement and adjacency
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ADVERTISE_H
index 2ae693cd306824c9d19f280b37521f595a81b4ba..2cc7e46573a46fbf9be837104756c824176a7a6d 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS path management routines.
  * Copyright (C) 1996, 97, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2005 Sun Microsystems, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -302,9 +287,13 @@ static struct assegment *assegment_normalise(struct assegment *head)
        return head;
 }
 
-static struct aspath *aspath_new(void)
+static struct aspath *aspath_new(enum asnotation_mode asnotation)
 {
-       return XCALLOC(MTYPE_AS_PATH, sizeof(struct aspath));
+       struct aspath *as;
+
+       as = XCALLOC(MTYPE_AS_PATH, sizeof(struct aspath));
+       as->asnotation = asnotation;
+       return as;
 }
 
 /* Free AS path structure. */
@@ -552,8 +541,10 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
  *
  * This was changed to 10 after the well-known BGP assertion, which
  * had hit some parts of the Internet in May of 2009.
+ * plain format : '4294967295 ' : 10 + 1
+ * astod format : '65535.65535 ': 11 + 1
  */
-#define ASN_STR_LEN (10 + 1)
+#define ASN_STR_LEN (11 + 1)
        str_size = MAX(assegment_count_asns(seg, 0) * ASN_STR_LEN + 2 + 1,
                       ASPATH_STR_DEFAULT_LEN);
        str_buf = XMALLOC(MTYPE_AS_STR, str_size);
@@ -584,7 +575,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
 
 /* We might need to increase str_buf, particularly if path has
  * differing segments types, our initial guesstimate above will
- * have been wrong. Need 10 chars for ASN, a separator each and
+ * have been wrong. Need 11 chars for ASN, a separator each and
  * potentially two segment delimiters, plus a space between each
  * segment and trailing zero.
  *
@@ -610,12 +601,11 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
                /* write out the ASNs, with their separators, bar the last one*/
                for (i = 0; i < seg->length; i++) {
                        if (make_json)
-                               json_object_array_add(
-                                       jseg_list,
-                                       json_object_new_int64(seg->as[i]));
-
-                       len += snprintf(str_buf + len, str_size - len, "%u",
-                                       seg->as[i]);
+                               asn_asn2json_array(jseg_list, seg->as[i],
+                                                  as->asnotation);
+                       len += snprintfrr(str_buf + len, str_size - len,
+                                         ASN_FORMAT(as->asnotation),
+                                         &seg->as[i]);
 
                        if (i < (seg->length - 1))
                                len += snprintf(str_buf + len, str_size - len,
@@ -706,6 +696,7 @@ struct aspath *aspath_dup(struct aspath *aspath)
 
        new->str = XMALLOC(MTYPE_AS_STR, buflen);
        new->str_len = aspath->str_len;
+       new->asnotation = aspath->asnotation;
 
        /* copy the string data */
        if (aspath->str_len > 0)
@@ -733,6 +724,7 @@ static void *aspath_hash_alloc(void *arg)
        new->str = aspath->str;
        new->str_len = aspath->str_len;
        new->json = aspath->json;
+       new->asnotation = aspath->asnotation;
 
        return new;
 }
@@ -840,7 +832,8 @@ static int assegments_parse(struct stream *s, size_t length,
 
    On error NULL is returned.
  */
-struct aspath *aspath_parse(struct stream *s, size_t length, int use32bit)
+struct aspath *aspath_parse(struct stream *s, size_t length, int use32bit,
+                           enum asnotation_mode asnotation)
 {
        struct aspath as;
        struct aspath *find;
@@ -855,6 +848,7 @@ struct aspath *aspath_parse(struct stream *s, size_t length, int use32bit)
                return NULL;
 
        memset(&as, 0, sizeof(as));
+       as.asnotation = asnotation;
        if (assegments_parse(s, length, &as.segments, use32bit) < 0)
                return NULL;
 
@@ -1072,7 +1066,7 @@ struct aspath *aspath_aggregate(struct aspath *as1, struct aspath *as2)
                        seg = assegment_append_asns(seg, seg1->as, match);
 
                        if (!aspath) {
-                               aspath = aspath_new();
+                               aspath = aspath_new(as1->asnotation);
                                aspath->segments = seg;
                        } else
                                prevseg->next = seg;
@@ -1092,7 +1086,7 @@ struct aspath *aspath_aggregate(struct aspath *as1, struct aspath *as2)
        }
 
        if (!aspath)
-               aspath = aspath_new();
+               aspath = aspath_new(as1->asnotation);
 
        /* Make as-set using rest of all information. */
        from = match;
@@ -1536,7 +1530,7 @@ struct aspath *aspath_filter_exclude(struct aspath *source,
        struct assegment *srcseg, *exclseg, *lastseg;
        struct aspath *newpath;
 
-       newpath = aspath_new();
+       newpath = aspath_new(source->asnotation);
        lastseg = NULL;
 
        for (srcseg = source->segments; srcseg; srcseg = srcseg->next) {
@@ -1766,7 +1760,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
                newseg = assegment_append_asns(newseg, seg->as, cpasns);
 
                if (!newpath) {
-                       newpath = aspath_new();
+                       newpath = aspath_new(aspath->asnotation);
                        newpath->segments = newseg;
                } else
                        prevseg->next = newseg;
@@ -1895,16 +1889,16 @@ static void aspath_segment_add(struct aspath *as, int type)
                as->segments = new;
 }
 
-struct aspath *aspath_empty(void)
+struct aspath *aspath_empty(enum asnotation_mode asnotation)
 {
-       return aspath_parse(NULL, 0, 1); /* 32Bit ;-) */
+       return aspath_parse(NULL, 0, 1, asnotation); /* 32Bit ;-) */
 }
 
 struct aspath *aspath_empty_get(void)
 {
        struct aspath *aspath;
 
-       aspath = aspath_new();
+       aspath = aspath_new(bgp_get_asnotation(NULL));
        aspath_make_str_count(aspath, false);
        return aspath;
 }
@@ -1940,6 +1934,8 @@ static const char *aspath_gettoken(const char *buf, enum as_token *token,
                                   unsigned long *asno)
 {
        const char *p = buf;
+       as_t asval;
+       bool found = false;
 
        /* Skip separators (space for sequences, ',' for sets). */
        while (isspace((unsigned char)*p) || *p == ',')
@@ -1976,30 +1972,18 @@ static const char *aspath_gettoken(const char *buf, enum as_token *token,
                return p;
        }
 
-       /* Check actual AS value. */
-       if (isdigit((unsigned char)*p)) {
-               as_t asval;
-
-               *token = as_token_asval;
-               asval = (*p - '0');
-               p++;
-
-               while (isdigit((unsigned char)*p)) {
-                       asval *= 10;
-                       asval += (*p - '0');
-                       p++;
-               }
+       asval = 0;
+       p = asn_str2asn_parse(p, &asval, &found);
+       if (found) {
                *asno = asval;
-               return p;
-       }
-
-       /* There is no match then return unknown token. */
-       *token = as_token_unknown;
-       p++;
+               *token = as_token_asval;
+       } else
+               *token = as_token_unknown;
        return p;
 }
 
-struct aspath *aspath_str2aspath(const char *str)
+struct aspath *aspath_str2aspath(const char *str,
+                                enum asnotation_mode asnotation)
 {
        enum as_token token = as_token_unknown;
        unsigned short as_type;
@@ -2007,7 +1991,7 @@ struct aspath *aspath_str2aspath(const char *str)
        struct aspath *aspath;
        int needtype;
 
-       aspath = aspath_new();
+       aspath = aspath_new(asnotation);
 
        /* We start default type as AS_SEQUENCE. */
        as_type = AS_SEQUENCE;
@@ -2081,6 +2065,10 @@ bool aspath_cmp(const void *arg1, const void *arg2)
        const struct assegment *seg1 = ((const struct aspath *)arg1)->segments;
        const struct assegment *seg2 = ((const struct aspath *)arg2)->segments;
 
+       if (((const struct aspath *)arg1)->asnotation !=
+           ((const struct aspath *)arg2)->asnotation)
+               return false;
+
        while (seg1 || seg2) {
                int i;
                if ((!seg1 && seg2) || (seg1 && !seg2))
index a814d73dddc640b091059b1d3527cd1dee9905a7..18af375c13317cb748ad03a014c2cd45093094ca 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS path related definitions.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ASPATH_H
@@ -72,6 +57,9 @@ struct aspath {
           and AS path regular expression match.  */
        char *str;
        unsigned short str_len;
+
+       /* AS notation used by string expression of AS path */
+       enum asnotation_mode asnotation;
 };
 
 #define ASPATH_STR_DEFAULT_LEN 32
@@ -80,7 +68,9 @@ struct aspath {
 extern void aspath_init(void);
 extern void aspath_finish(void);
 extern struct aspath *aspath_parse(struct stream *s, size_t length,
-                                  int use32bit);
+                                  int use32bit,
+                                  enum asnotation_mode asnotation);
+
 extern struct aspath *aspath_dup(struct aspath *aspath);
 extern struct aspath *aspath_aggregate(struct aspath *as1, struct aspath *as2);
 extern struct aspath *aspath_prepend(struct aspath *as1, struct aspath *as2);
@@ -96,9 +86,10 @@ extern bool aspath_cmp_left(const struct aspath *aspath1,
 extern bool aspath_cmp_left_confed(const struct aspath *as1,
                                   const struct aspath *as2);
 extern struct aspath *aspath_delete_confed_seq(struct aspath *aspath);
-extern struct aspath *aspath_empty(void);
+extern struct aspath *aspath_empty(enum asnotation_mode asnotation);
 extern struct aspath *aspath_empty_get(void);
-extern struct aspath *aspath_str2aspath(const char *str);
+extern struct aspath *aspath_str2aspath(const char *str,
+                                       enum asnotation_mode asnotation);
 extern void aspath_str_update(struct aspath *as, bool make_json);
 extern void aspath_free(struct aspath *aspath);
 extern struct aspath *aspath_intern(struct aspath *aspath);
index 392b558805272259d42cb1433ff4a99164bc7577..fcfb1d64e0fd954bfe19200e06773474b56c8be8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP attributes management routines.
  * Copyright (C) 1996, 97, 98, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1069,7 +1054,7 @@ struct attr *bgp_attr_default_set(struct attr *attr, struct bgp *bgp,
 
        attr->origin = origin;
        attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_ORIGIN);
-       attr->aspath = aspath_empty();
+       attr->aspath = aspath_empty(bgp->asnotation);
        attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AS_PATH);
        attr->weight = BGP_ATTR_DEFAULT_WEIGHT;
        attr->tag = 0;
@@ -1107,7 +1092,7 @@ struct attr *bgp_attr_aggregate_intern(
        if (aspath)
                attr.aspath = aspath_intern(aspath);
        else
-               attr.aspath = aspath_empty();
+               attr.aspath = aspath_empty(bgp->asnotation);
        attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_AS_PATH);
 
        /* Next hop attribute.  */
@@ -1605,15 +1590,19 @@ static int bgp_attr_aspath(struct bgp_attr_parser_args *args)
        struct attr *const attr = args->attr;
        struct peer *const peer = args->peer;
        const bgp_size_t length = args->length;
+       enum asnotation_mode asnotation;
 
+       asnotation = bgp_get_asnotation(
+               args->peer && args->peer->bgp ? args->peer->bgp : NULL);
        /*
         * peer with AS4 => will get 4Byte ASnums
         * otherwise, will get 16 Bit
         */
-       attr->aspath = aspath_parse(
-               peer->curr, length,
-               CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV)
-                       && CHECK_FLAG(peer->cap, PEER_CAP_AS4_ADV));
+       attr->aspath =
+               aspath_parse(peer->curr, length,
+                            CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV) &&
+                                    CHECK_FLAG(peer->cap, PEER_CAP_AS4_ADV),
+                            asnotation);
 
        /* In case of IBGP, length will be zero. */
        if (!attr->aspath) {
@@ -1629,7 +1618,8 @@ static int bgp_attr_aspath(struct bgp_attr_parser_args *args)
         * such messages, conformant BGP speakers SHOULD use the "Treat-as-
         * withdraw" error handling behavior as per [RFC7606].
         */
-       if (peer->bgp->reject_as_sets && aspath_check_as_sets(attr->aspath)) {
+       if (peer->bgp && peer->bgp->reject_as_sets &&
+           aspath_check_as_sets(attr->aspath)) {
                flog_err(EC_BGP_ATTR_MAL_AS_PATH,
                         "AS_SET and AS_CONFED_SET are deprecated from %pBP",
                         peer);
@@ -1705,8 +1695,11 @@ static int bgp_attr_as4_path(struct bgp_attr_parser_args *args,
        struct peer *const peer = args->peer;
        struct attr *const attr = args->attr;
        const bgp_size_t length = args->length;
+       enum asnotation_mode asnotation;
+
+       asnotation = bgp_get_asnotation(peer->bgp);
 
-       *as4_path = aspath_parse(peer->curr, length, 1);
+       *as4_path = aspath_parse(peer->curr, length, 1, asnotation);
 
        /* In case of IBGP, length will be zero. */
        if (!*as4_path) {
@@ -1864,7 +1857,7 @@ static int bgp_attr_atomic(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto atomic_ignore;
 
        /* Set atomic aggregate flag. */
@@ -1875,11 +1868,7 @@ static int bgp_attr_atomic(struct bgp_attr_parser_args *args)
 atomic_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Aggregator attribute */
@@ -1905,7 +1894,7 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto aggregator_ignore;
 
        if (CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV))
@@ -1938,11 +1927,7 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
 aggregator_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* New Aggregator attribute */
@@ -1963,7 +1948,7 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
                                          0);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto as4_aggregator_ignore;
 
        aggregator_as = stream_getl(peer->curr);
@@ -1993,11 +1978,7 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
 as4_aggregator_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Munge Aggregator and New-Aggregator, AS_PATH and NEW_AS_PATH.
@@ -2117,7 +2098,7 @@ bgp_attr_community(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto community_ignore;
 
        bgp_attr_set_community(
@@ -2139,11 +2120,7 @@ bgp_attr_community(struct bgp_attr_parser_args *args)
 community_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Originator ID attribute. */
@@ -2167,7 +2144,7 @@ bgp_attr_originator_id(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto originator_id_ignore;
 
        attr->originator_id.s_addr = stream_get_ipv4(peer->curr);
@@ -2179,11 +2156,7 @@ bgp_attr_originator_id(struct bgp_attr_parser_args *args)
 originator_id_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Cluster list attribute. */
@@ -2206,7 +2179,7 @@ bgp_attr_cluster_list(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto cluster_list_ignore;
 
        bgp_attr_set_cluster(
@@ -2223,11 +2196,7 @@ bgp_attr_cluster_list(struct bgp_attr_parser_args *args)
 cluster_list_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Multiprotocol reachability information parse. */
@@ -2487,7 +2456,7 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto large_community_ignore;
 
        bgp_attr_set_lcommunity(
@@ -2504,11 +2473,7 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args)
 large_community_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Extended Community attribute. */
@@ -2600,7 +2565,7 @@ bgp_attr_ipv6_ext_communities(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto ipv6_ext_community_ignore;
 
        ipv6_ecomm = ecommunity_parse_ipv6(
@@ -2621,11 +2586,7 @@ bgp_attr_ipv6_ext_communities(struct bgp_attr_parser_args *args)
 ipv6_ext_community_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* Parse Tunnel Encap attribute in an UPDATE */
@@ -3300,7 +3261,7 @@ static enum bgp_attr_parse_ret bgp_attr_aigp(struct bgp_attr_parser_args *args)
                goto aigp_ignore;
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto aigp_ignore;
 
        if (!bgp_attr_aigp_valid(s, length))
@@ -3313,11 +3274,7 @@ static enum bgp_attr_parse_ret bgp_attr_aigp(struct bgp_attr_parser_args *args)
 aigp_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* OTC attribute. */
@@ -3335,7 +3292,7 @@ static enum bgp_attr_parse_ret bgp_attr_otc(struct bgp_attr_parser_args *args)
                                          args->total);
        }
 
-       if (peer->discard_attrs[args->type])
+       if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
                goto otc_ignore;
 
        attr->otc = stream_getl(peer->curr);
@@ -3352,11 +3309,7 @@ static enum bgp_attr_parse_ret bgp_attr_otc(struct bgp_attr_parser_args *args)
 otc_ignore:
        stream_forward_getp(peer->curr, length);
 
-       if (bgp_debug_update(peer, NULL, NULL, 1))
-               zlog_debug("%pBP: Ignoring attribute %s", peer,
-                          lookup_msg(attr_str, args->type, NULL));
-
-       return BGP_ATTR_PARSE_PROCEED;
+       return bgp_attr_ignore(peer, args->type);
 }
 
 /* BGP unknown attribute treatment. */
@@ -3380,13 +3333,8 @@ bgp_attr_unknown(struct bgp_attr_parser_args *args)
        /* Forward read pointer of input stream. */
        stream_forward_getp(peer->curr, length);
 
-       if (peer->discard_attrs[type]) {
-               if (bgp_debug_update(peer, NULL, NULL, 1))
-                       zlog_debug("%pBP: Ignoring attribute %s", peer,
-                                  lookup_msg(attr_str, args->type, NULL));
-
-               return BGP_ATTR_PARSE_PROCEED;
-       }
+       if (peer->discard_attrs[type] || peer->withdraw_attrs[type])
+               return bgp_attr_ignore(peer, type);
 
        /* If any of the mandatory well-known attributes are not recognized,
           then the Error Subcode is set to Unrecognized Well-known
@@ -4028,23 +3976,21 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
                        }
                } break;
                case SAFI_MPLS_VPN: {
+                       if (attr->mp_nexthop_len ==
+                           BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
+                               stream_putc(s, attr->mp_nexthop_len);
+                       else
+                               stream_putc(s, BGP_ATTR_NHLEN_VPNV6_GLOBAL);
+                       stream_putl(s, 0); /* RD = 0, per RFC */
+                       stream_putl(s, 0);
+                       stream_put(s, &attr->mp_nexthop_global,
+                                  IPV6_MAX_BYTELEN);
                        if (attr->mp_nexthop_len ==
                            BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL) {
-                               stream_putc(s, 48);
-                               stream_putl(s, 0); /* RD = 0, per RFC */
-                               stream_putl(s, 0);
-                               stream_put(s, &attr->mp_nexthop_global,
-                                          IPV6_MAX_BYTELEN);
                                stream_putl(s, 0); /* RD = 0, per RFC */
                                stream_putl(s, 0);
                                stream_put(s, &attr->mp_nexthop_local,
                                           IPV6_MAX_BYTELEN);
-                       } else {
-                               stream_putc(s, 24);
-                               stream_putl(s, 0); /* RD = 0, per RFC */
-                               stream_putl(s, 0);
-                               stream_put(s, &attr->mp_nexthop_global,
-                                          IPV6_MAX_BYTELEN);
                        }
                } break;
                case SAFI_ENCAP:
@@ -5165,3 +5111,86 @@ void bgp_path_attribute_discard_vty(struct vty *vty, struct peer *peer,
                        peer_clear_soft(peer, afi, safi, BGP_CLEAR_SOFT_IN);
        }
 }
+
+void bgp_path_attribute_withdraw_vty(struct vty *vty, struct peer *peer,
+                                    const char *withdraw_attrs, bool set)
+{
+       int i, num_attributes;
+       char **attributes;
+       afi_t afi;
+       safi_t safi;
+
+       /* If `no` command specified without arbitrary attributes,
+        * then flush all.
+        */
+       if (!withdraw_attrs) {
+               for (i = 0; i < BGP_ATTR_MAX; i++)
+                       peer->withdraw_attrs[i] = false;
+               goto withdraw_soft_clear;
+       }
+
+       if (withdraw_attrs) {
+               frrstr_split(withdraw_attrs, " ", &attributes, &num_attributes);
+
+               if (set)
+                       for (i = 0; i < BGP_ATTR_MAX; i++)
+                               peer->withdraw_attrs[i] = false;
+
+               for (i = 0; i < num_attributes; i++) {
+                       uint8_t attr_num = strtoul(attributes[i], NULL, 10);
+
+                       XFREE(MTYPE_TMP, attributes[i]);
+
+                       /* Some of the attributes, just can't be ignored. */
+                       if (attr_num == BGP_ATTR_ORIGIN ||
+                           attr_num == BGP_ATTR_AS_PATH ||
+                           attr_num == BGP_ATTR_NEXT_HOP ||
+                           attr_num == BGP_ATTR_MULTI_EXIT_DISC ||
+                           attr_num == BGP_ATTR_MP_REACH_NLRI ||
+                           attr_num == BGP_ATTR_MP_UNREACH_NLRI ||
+                           attr_num == BGP_ATTR_EXT_COMMUNITIES) {
+                               vty_out(vty,
+                                       "%% Can't treat-as-withdraw path-attribute %s, ignoring.\n",
+                                       lookup_msg(attr_str, attr_num, NULL));
+                               continue;
+                       }
+
+                       /* Ignore local-pref, originator-id, cluster-list only
+                        * for eBGP.
+                        */
+                       if (peer->sort != BGP_PEER_EBGP &&
+                           (attr_num == BGP_ATTR_LOCAL_PREF ||
+                            attr_num == BGP_ATTR_ORIGINATOR_ID ||
+                            attr_num == BGP_ATTR_CLUSTER_LIST)) {
+                               vty_out(vty,
+                                       "%% Can treat-as-withdraw path-attribute %s only for eBGP, ignoring.\n",
+                                       lookup_msg(attr_str, attr_num, NULL));
+                               continue;
+                       }
+
+                       peer->withdraw_attrs[attr_num] = set;
+               }
+               XFREE(MTYPE_TMP, attributes);
+       withdraw_soft_clear:
+               /* Configuring path attributes to be treated as withdraw will
+                * trigger
+                * an inbound Route Refresh to ensure that the routing table
+                * is up to date.
+                */
+               FOREACH_AFI_SAFI (afi, safi)
+                       peer_clear_soft(peer, afi, safi, BGP_CLEAR_SOFT_IN);
+       }
+}
+
+enum bgp_attr_parse_ret bgp_attr_ignore(struct peer *peer, uint8_t type)
+{
+       bool discard = peer->discard_attrs[type];
+       bool withdraw = peer->withdraw_attrs[type];
+
+       if (bgp_debug_update(peer, NULL, NULL, 1) && (discard || withdraw))
+               zlog_debug("%pBP: Ignoring attribute %s (%s)", peer,
+                          lookup_msg(attr_str, type, NULL),
+                          withdraw ? "treat-as-withdraw" : "discard");
+
+       return withdraw ? BGP_ATTR_PARSE_WITHDRAW : BGP_ATTR_PARSE_PROCEED;
+}
index 33283f4bf6d12d2c9a3a8d1b94e52f596f31d828..1c7e88a4f9e2a7526ec3a27daa020d06c52dfc82 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP attributes.
  * Copyright (C) 1996, 97, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ATTR_H
@@ -416,6 +401,10 @@ extern unsigned long int attr_count(void);
 extern unsigned long int attr_unknown_count(void);
 extern void bgp_path_attribute_discard_vty(struct vty *vty, struct peer *peer,
                                           const char *discard_attrs, bool set);
+extern void bgp_path_attribute_withdraw_vty(struct vty *vty, struct peer *peer,
+                                           const char *withdraw_attrs,
+                                           bool set);
+extern enum bgp_attr_parse_ret bgp_attr_ignore(struct peer *peer, uint8_t type);
 
 /* Cluster list prototypes. */
 extern bool cluster_loop_check(struct cluster_list *cluster,
index d379f40a88f1f58fea96a6417e1b9d930a3321d5..bbc4ba9525d458543976ef51b9a10f15648a6e9a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Ethernet-VPN Attribute handling file
  * Copyright (C) 2016 6WIND
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index bb4a8169301233a4aaba7dd7b0f94b5a269b70ea..f8d3978b960b80755a522402ade3bc440138a98f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* E-VPN attribute handling structure file
  * Copyright (C) 2016 6WIND
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ATTR_EVPN_H
index 11b074af2e6e6f08fe23800f4fcb901ff8364229..4a81b69ced305756f4abc8da3d13dce9c0f533ed 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_bfd.c: BGP BFD handling routines
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9dca48a437bb402f8ee6d6cb03176090d47d2492..c4045d47450749e5ab850fc2dd7251b9190316a8 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_bfd.h: BGP BFD definitions and structures
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_BFD_H
index 2a65dbac804dd72dd6b4f758a35151a655aec523..d89f6de6494efa8554abd77b7f7b359b35c69667 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BMP support.
  * Copyright (C) 2018 Yasuhiro Ohara
  * Copyright (C) 2019 David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1693b443eff7b06b6f0ddb091f391ed71af3adc4..0c909e139bce6452ae283c2531706d8a366a20e2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BMP support.
  * Copyright (C) 2018 Yasuhiro Ohara
  * Copyright (C) 2019 David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _BGP_BMP_H_
index aa14d99f18563895721dea776c64da5c10ee6512..fc3363b098e705402a2060134b8413d6dcd1a7ca 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP dump to ascii converter
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -101,7 +86,8 @@ static void attr_parse(struct stream *s, uint16_t len)
                case BGP_ATTR_AS_PATH: {
                        struct aspath *aspath;
 
-                       aspath = aspath_parse(s, length, 1);
+                       aspath = aspath_parse(s, length, 1,
+                                             bgp_get_asnotation(NULL));
                        printf("ASPATH: %s\n", aspath->str);
                        aspath_free(aspath);
                } break;
index 34d4be8c93a27971ff076f6f8539538081c0379c..1d2ba3bf5845eff39742cd91bff8670c8b5545d9 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP community-list and extcommunity-list.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -464,8 +449,12 @@ static char *community_str_get(struct community *com, int i)
        comval = ntohl(comval);
 
        switch (comval) {
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
        case COMMUNITY_INTERNET:
                str = XSTRDUP(MTYPE_COMMUNITY_STR, "internet");
+               zlog_warn("`internet` community is deprecated");
                break;
        case COMMUNITY_GSHUT:
                str = XSTRDUP(MTYPE_COMMUNITY_STR, "graceful-shutdown");
index fb80787618846e8b9623c744a0858702c164607e..7a9b28038c2c1ae5d5749fa6fde9f2e32cbd9c60 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Community list.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_CLIST_H
index 9f6f337c8808f852ddfc91a9b4b0c120e82ee415..ff6e477355b6026efb5cee9a75ca24f61e10987e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Community attribute related functions.
  * Copyright (C) 1998, 2001 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -183,7 +168,6 @@ struct community *community_uniq_sort(struct community *com)
 
    For Well-known communities value, below keyword is used.
 
-   0x0             "internet"
    0xFFFF0000      "graceful-shutdown"
    0xFFFF0001      "accept-own"
    0xFFFF0002      "route-filter-translated-v4"
@@ -244,8 +228,12 @@ static void set_community_string(struct community *com, bool make_json,
                comval = ntohl(comval);
 
                switch (comval) {
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
                case COMMUNITY_INTERNET:
                        len += strlen(" internet");
+                       zlog_warn("`internet` community is deprecated");
                        break;
                case COMMUNITY_GSHUT:
                        len += strlen(" graceful-shutdown");
@@ -310,6 +298,9 @@ static void set_community_string(struct community *com, bool make_json,
                        strlcat(str, " ", len);
 
                switch (comval) {
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
                case COMMUNITY_INTERNET:
                        strlcat(str, "internet", len);
                        if (make_json) {
@@ -318,6 +309,7 @@ static void set_community_string(struct community *com, bool make_json,
                                json_object_array_add(json_community_list,
                                                      json_string);
                        }
+                       zlog_warn("`internet` community is deprecated");
                        break;
                case COMMUNITY_GSHUT:
                        strlcat(str, "graceful-shutdown", len);
@@ -688,10 +680,14 @@ community_gettoken(const char *buf, enum community_token *token, uint32_t *val)
 
        /* Well known community string check. */
        if (isalpha((unsigned char)*p)) {
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
                if (strncmp(p, "internet", strlen("internet")) == 0) {
                        *val = COMMUNITY_INTERNET;
                        *token = community_token_no_export;
                        p += strlen("internet");
+                       zlog_warn("`internet` community is deprecated");
                        return p;
                }
                if (strncmp(p, "graceful-shutdown", strlen("graceful-shutdown"))
index 05a5d4486a0a95c74fce9cbde0466006270e5dc2..e7af362ea845d3c0ff8b1443c8ba3ae0b4b3ad58 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Community attribute related functions.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_COMMUNITY_H
@@ -45,6 +30,9 @@ struct community {
 };
 
 /* Well-known communities value.  */
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
 #define COMMUNITY_INTERNET                      0x0
 #define COMMUNITY_GSHUT                         0xFFFF0000
 #define COMMUNITY_ACCEPT_OWN                    0xFFFF0001
index 3750a24680a159b56638775134974a5530f6a575..1ebe7c4c8c14bd86cbb8b7c9c31ccddb89adaaad 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP community, large-community aliasing.
  *
  * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index 57cde0ad4454461eccdcf3e04b9a84c01b2e0ce7..cb7983e1a70cfb75a80051bdefd4b65fd69619db 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP community, large-community aliasing.
  *
  * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "bgpd/bgp_lcommunity.h"
index 4ad00ed121bb2fcb9fa51c09f3a4b912f81006e3..051e336e525b063f7e7a83b9c7e05c7318a8fee5 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Conditional advertisement
  * Copyright (C) 2020  Samsung R&D Institute India - Bangalore.
  *                     Madhurilatha Kuruganti
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a4f1403a441ac3428c2d5fe15b2d5200206ec3bd..b1be59366ae835c1e40365708308e7bc9e0b9061 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Conditional advertisement
  * Copyright (C) 2020  Samsung R&D Institute India - Bangalore.
  *                     Madhurilatha Kuruganti
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_CONDITION_ADV_H
index 56bbaf419478412e8f68ed74b0eb9bc1db4af228..54bbf9b9ca9d09bebea000d3e97521394b3c31ae 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP flap dampening
  * Copyright (C) 2001 IP Infusion Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f7deea53857a406fba89d91264db383256e2139b..129e444164569aaaf930b7944f2bd64df6df87d0 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP flap dampening
  * Copyright (C) 2001 IP Infusion Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_DAMP_H
index f01c3e4f3570fe48c46668faa0f3bc3c657abf6e..782245e5121434488453616bc802ed158652db66 100644 (file)
@@ -1,26 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP-4, BGP-4+ packet debug routine
  * Copyright (C) 1996, 97, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
 
-#include <lib/version.h>
 #include "lib/bfd.h"
 #include "lib/printfrr.h"
 #include "prefix.h"
@@ -2651,6 +2635,7 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi,
        char tag_buf[30];
        char overlay_index_buf[INET6_ADDRSTRLEN + 14];
        const struct prefix_evpn *evp;
+       int len = 0;
 
        /* ' with addpath ID '          17
         * max strlen of uint32       + 10
@@ -2704,11 +2689,15 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi,
                }
        }
 
-       if (prd)
-               snprintfrr(str, size, "RD %pRD %pFX%s%s%s %s %s", prd, pu.p,
+       if (prd) {
+               len += snprintfrr(str + len, size - len, "RD ");
+               len += snprintfrr(str + len, size - len,
+                                 BGP_RD_AS_FORMAT(bgp_get_asnotation(NULL)),
+                                 prd);
+               snprintfrr(str + len, size - len, " %pFX%s%s%s %s %s", pu.p,
                           overlay_index_buf, tag_buf, pathid_buf, afi2str(afi),
                           safi2str(safi));
-       else if (safi == SAFI_FLOWSPEC) {
+       else if (safi == SAFI_FLOWSPEC) {
                char return_string[BGP_FLOWSPEC_NLRI_STRING_MAX];
                const struct prefix_fs *fs = pu.fs;
 
index be5ed0afdc8d0f8178c13ce33205cebabdcdfa04..118325e0a34e715b93d504e39c9304470a4acbd4 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP message debug header.
  * Copyright (C) 1996, 97, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_DEBUG_H
index 98a2f95eadcaf638e8d3a851d696ca006b521c09..794dd7b8b65c5a2a8f453844e2aef093a3e5d8fe 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP-4 dump routine
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 70e430a9b8aac503107a5052e097d80c87612fae..2235bbc52f41de180d6e7fd0cf39e594bf274ea1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP dump routine.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_DUMP_H
index 62fba1f58ec20770192398aec3354df71149fb43..0a4ebc5130857cf3ec6997aa446edd59f79105b7 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Extended Communities Attribute
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -699,6 +684,7 @@ static struct ecommunity *ecommunity_str2com_internal(const char *str, int type,
        while ((str = ecommunity_gettoken(str, (void *)&eval, &token))) {
                switch (token) {
                case ecommunity_token_rt:
+               case ecommunity_token_rt6:
                case ecommunity_token_soo:
                        if (!keyword_included || keyword) {
                                if (ecom)
@@ -746,7 +732,6 @@ static struct ecommunity *ecommunity_str2com_internal(const char *str, int type,
                                                    ecom->unit_size);
                        break;
                case ecommunity_token_unknown:
-               default:
                        if (ecom)
                                ecommunity_free(&ecom);
                        return NULL;
index 4d7d4234a261ff6221c03dfceccce84968c6191b..83a1584489a92ea45e250c64491cca3fb3070919 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Extended Communities Attribute.
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ECOMMUNITY_H
index fd429120e69575b1f168ea352f446592ee1d5c12..fde11970ceabc91242f8fd286488218c553b3d38 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 64f9a9c743e956a5e61c2976149d331426d2ccaf..e7188442d11662b8b5b6a269cb18df88697f658b 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ENCAP_TLV_H
index 8d1bf682ad1f10263f8fc22507ad2ac31a9b75ab..ea5b54c9e84c5f7019d70c47c2f70d34d096a0f7 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ENCAP_TYPES_H
index 8bc2dbca7a2273edf11f8868d0ff926c4d56f7be..cfcefed996a504f4bc8d2b98786c20f06eb92cc2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Don Slice
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4986c314a182498a652c90f57cd569eaae73a363..4567f87835480fda2750fa02f58ecc262388b44a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Don Slice
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __BGP_ERRORS_H__
index c993707206847cdb687830006d21c157e925f8c4..a8560ab53922c388eca49f9ae47a396e2e8ca930 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Ethernet-VPN Packet and vty Processing File
  * Copyright (C) 2016 6WIND
  * Copyright (C) 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -55,6 +40,7 @@
 #include "bgpd/bgp_vty.h"
 #include "bgpd/bgp_nht.h"
 #include "bgpd/bgp_trace.h"
+#include "bgpd/bgp_mpath.h"
 
 /*
  * Definitions and external declarations.
@@ -1228,7 +1214,7 @@ static int evpn_zebra_install(struct bgp *bgp, struct bgpevpn *vpn,
 {
        int ret;
        uint8_t flags;
-       int flood_control;
+       int flood_control = VXLAN_FLOOD_DISABLED;
        uint32_t seq;
 
        if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) {
@@ -1298,7 +1284,12 @@ static int evpn_zebra_install(struct bgp *bgp, struct bgpevpn *vpn,
                        flood_control = VXLAN_FLOOD_PIM_SM;
                        break;
 
-               default:
+               case PMSI_TNLTYPE_NO_INFO:
+               case PMSI_TNLTYPE_RSVP_TE_P2MP:
+               case PMSI_TNLTYPE_MLDP_P2MP:
+               case PMSI_TNLTYPE_PIM_SSM:
+               case PMSI_TNLTYPE_PIM_BIDIR:
+               case PMSI_TNLTYPE_MLDP_MP2MP:
                        flood_control = VXLAN_FLOOD_DISABLED;
                        break;
                }
@@ -4526,9 +4517,9 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
                           safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
                           &label[0], num_labels, 0, &evpn);
        else
-               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
-                            safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
-                            &label[0], num_labels, &evpn);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
+                            ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, &label[0],
+                            num_labels, &evpn);
        goto done;
 
 fail:
@@ -4617,9 +4608,9 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
                           safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
                           0, 0, NULL);
        else
-               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
-                            safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
-                            NULL, 0, NULL);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
+                            ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0,
+                            NULL);
        return 0;
 }
 
@@ -4760,9 +4751,9 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
                                peer->hostname, peer->bgp->vrf_id, &p,
                                attr_str);
                }
-               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
-                            safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
-                            &label, 1, &evpn);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
+                            ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, &label, 1,
+                            &evpn);
        }
 
        return 0;
@@ -5932,6 +5923,8 @@ void bgp_evpn_derive_auto_rd(struct bgp *bgp, struct bgpevpn *vpn)
        vpn->prd.prefixlen = 64;
        snprintfrr(buf, sizeof(buf), "%pI4:%hu", &bgp->router_id, vpn->rd_id);
        (void)str2prefix_rd(buf, &vpn->prd);
+       if (vpn->prd_pretty)
+               XFREE(MTYPE_BGP, vpn->prd_pretty);
        UNSET_FLAG(vpn->flags, VNI_FLAG_RD_CFGD);
 }
 
@@ -6036,6 +6029,8 @@ void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn)
        bf_release_index(bm->rd_idspace, vpn->rd_id);
        hash_release(bgp->vni_svi_hash, vpn);
        hash_release(bgp->vnihash, vpn);
+       if (vpn->prd_pretty)
+               XFREE(MTYPE_BGP, vpn->prd_pretty);
        QOBJ_UNREG(vpn);
        XFREE(MTYPE_BGP_EVPN, vpn);
 }
@@ -6247,13 +6242,14 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,
 
                ret = bgp_get_vty(&bgp_vrf, &as, vrf_id_to_name(vrf_id),
                                  vrf_id == VRF_DEFAULT
-                                 ? BGP_INSTANCE_TYPE_DEFAULT
-                                 : BGP_INSTANCE_TYPE_VRF);
+                                         ? BGP_INSTANCE_TYPE_DEFAULT
+                                         : BGP_INSTANCE_TYPE_VRF,
+                                 NULL, ASNOTATION_UNDEFINED);
                switch (ret) {
                case BGP_ERR_AS_MISMATCH:
                        flog_err(EC_BGP_EVPN_AS_MISMATCH,
-                                "BGP instance is already running; AS is %u",
-                                as);
+                                "BGP instance is already running; AS is %s",
+                                bgp_vrf->as_pretty);
                        return -1;
                case BGP_ERR_INSTANCE_MISMATCH:
                        flog_err(EC_BGP_EVPN_INSTANCE_MISMATCH,
@@ -6669,6 +6665,9 @@ void bgp_evpn_cleanup(struct bgp *bgp)
        list_delete(&bgp->vrf_import_rtl);
        list_delete(&bgp->vrf_export_rtl);
        list_delete(&bgp->l2vnis);
+
+       if (bgp->vrf_prd_pretty)
+               XFREE(MTYPE_BGP, bgp->vrf_prd_pretty);
 }
 
 /*
@@ -7173,3 +7172,66 @@ void bgp_evpn_handle_resolve_overlay_index_unset(struct hash_bucket *bucket,
 
        bgp_evpn_remote_ip_hash_destroy(vpn);
 }
+
+/*
+ * Helper function for getting the correct label index for l3vni.
+ *
+ * Returns the label with the l3vni of the path's label stack.
+ *
+ * L3vni is always last label. Type5 will only
+ * have one label, Type2 will have two.
+ *
+ */
+mpls_label_t *bgp_evpn_path_info_labels_get_l3vni(mpls_label_t *labels,
+                                                 uint32_t num_labels)
+{
+       if (!labels)
+               return NULL;
+
+       if (!num_labels)
+               return NULL;
+
+       return &labels[num_labels - 1];
+}
+
+/*
+ * Returns the l3vni of the path converted from the label stack.
+ */
+vni_t bgp_evpn_path_info_get_l3vni(const struct bgp_path_info *pi)
+{
+       if (!pi->extra)
+               return 0;
+
+       return label2vni(bgp_evpn_path_info_labels_get_l3vni(
+               pi->extra->label, pi->extra->num_labels));
+}
+
+/*
+ * Returns true if the l3vni of any of this path doesn't match vrf's l3vni.
+ */
+static bool bgp_evpn_path_is_dvni(const struct bgp *bgp_vrf,
+                                 const struct bgp_path_info *pi)
+{
+       vni_t vni = 0;
+
+       vni = bgp_evpn_path_info_get_l3vni(pi);
+
+       if ((vni > 0) && (vni != bgp_vrf->l3vni))
+               return true;
+
+       return false;
+}
+
+/*
+ * Returns true if the l3vni of any of the mpath's doesn't match vrf's l3vni.
+ */
+bool bgp_evpn_mpath_has_dvni(const struct bgp *bgp_vrf,
+                            struct bgp_path_info *mpinfo)
+{
+       for (; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) {
+               if (bgp_evpn_path_is_dvni(bgp_vrf, mpinfo))
+                       return true;
+       }
+
+       return false;
+}
index 67659ea1985d73b91ddaf0de5df31863f550fe4b..1dce4820d680a05a67bbe8f202c1aa14cad388d6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* E-VPN header for packet handling
  * Copyright (C) 2016 6WIND
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_EVPN_H
@@ -36,27 +21,6 @@ static inline int is_evpn_enabled(void)
        return bgp ? EVPN_ENABLED(bgp) : 0;
 }
 
-static inline void vni2label(vni_t vni, mpls_label_t *label)
-{
-       uint8_t *tag = (uint8_t *)label;
-
-       tag[0] = (vni >> 16) & 0xFF;
-       tag[1] = (vni >> 8) & 0xFF;
-       tag[2] = vni & 0xFF;
-}
-
-static inline vni_t label2vni(mpls_label_t *label)
-{
-       uint8_t *tag = (uint8_t *)label;
-       vni_t vni;
-
-       vni = ((uint32_t)*tag++ << 16);
-       vni |= (uint32_t)*tag++ << 8;
-       vni |= (uint32_t)(*tag & 0xFF);
-
-       return vni;
-}
-
 static inline int advertise_type5_routes(struct bgp *bgp_vrf,
                                         afi_t afi)
 {
@@ -229,5 +193,10 @@ bgp_evpn_handle_resolve_overlay_index_set(struct hash_bucket *bucket,
 extern void
 bgp_evpn_handle_resolve_overlay_index_unset(struct hash_bucket *bucket,
                                            void *arg);
+extern mpls_label_t *bgp_evpn_path_info_labels_get_l3vni(mpls_label_t *labels,
+                                                        uint32_t num_labels);
+extern vni_t bgp_evpn_path_info_get_l3vni(const struct bgp_path_info *pi);
+extern bool bgp_evpn_mpath_has_dvni(const struct bgp *bgp_vrf,
+                                   struct bgp_path_info *mpinfo);
 
 #endif /* _QUAGGA_BGP_EVPN_H */
index 7ad08166311aeb69df7ffde625dee0c619261be7..2f95023aa9773905472483278f12697858f9e08c 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* EVPN Multihoming procedures
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Anuradha Karuppiah
  *
- * This file is part of FRR.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
  */
 
 #include <zebra.h>
@@ -753,9 +742,9 @@ int bgp_evpn_type4_route_process(struct peer *peer, afi_t afi, safi_t safi,
                           safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
                           0, 0, NULL);
        } else {
-               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
-                            safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
-                            NULL, 0, NULL);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
+                            ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0,
+                            NULL);
        }
        return 0;
 }
@@ -1221,9 +1210,9 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
                           safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
                           0, 0, NULL);
        } else {
-               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
-                            safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
-                            NULL, 0, NULL);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
+                            ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0,
+                            NULL);
        }
        return 0;
 }
@@ -2406,7 +2395,8 @@ static void bgp_evpn_es_json_frag_fill(json_object *json_frags,
        for (ALL_LIST_ELEMENTS_RO(es->es_frag_list, node, es_frag)) {
                json_frag = json_object_new_object();
 
-               json_object_string_addf(json_frag, "rd", "%pRD", &es_frag->prd);
+               json_object_string_addf(json_frag, "rd", "%pRDP",
+                                       &es_frag->prd);
                json_object_int_add(json_frag, "eviCount",
                                    listcount(es_frag->es_evi_frag_list));
 
@@ -2421,7 +2411,7 @@ static void bgp_evpn_es_frag_show_detail(struct vty *vty,
        struct bgp_evpn_es_frag *es_frag;
 
        for (ALL_LIST_ELEMENTS_RO(es->es_frag_list, node, es_frag)) {
-               vty_out(vty, "  %pRD EVIs: %d\n", &es_frag->prd,
+               vty_out(vty, "  %pRDP EVIs: %d\n", &es_frag->prd,
                        listcount(es_frag->es_evi_frag_list));
        }
 }
@@ -2535,7 +2525,7 @@ static void bgp_evpn_es_show_entry(struct vty *vty,
 
                json_object_string_add(json, "esi", es->esi_str);
                if (es->es_base_frag)
-                       json_object_string_addf(json, "rd", "%pRD",
+                       json_object_string_addf(json, "rd", "%pRDP",
                                                &es->es_base_frag->prd);
 
                if (es->flags & (BGP_EVPNES_LOCAL | BGP_EVPNES_REMOTE)) {
@@ -2573,7 +2563,7 @@ static void bgp_evpn_es_show_entry(struct vty *vty,
 
                bgp_evpn_es_vteps_str(vtep_str, es, sizeof(vtep_str));
 
-               vty_out(vty, "%-30s %-5s %-21pRD %-8d %s\n", es->esi_str,
+               vty_out(vty, "%-30s %-5s %-21pRDP %-8d %s\n", es->esi_str,
                        type_str, &es->es_base_frag->prd,
                        listcount(es->es_evi_list), vtep_str);
        }
@@ -2650,7 +2640,7 @@ static void bgp_evpn_es_show_entry_detail(struct vty *vty,
 
                vty_out(vty, "ESI: %s\n", es->esi_str);
                vty_out(vty, " Type: %s\n", type_str);
-               vty_out(vty, " RD: %pRD\n", &es->es_base_frag->prd);
+               vty_out(vty, " RD: %pRDP\n", &es->es_base_frag->prd);
                vty_out(vty, " Originator-IP: %pI4\n", &es->originator_ip);
                if (es->flags & BGP_EVPNES_LOCAL)
                        vty_out(vty, " Local ES DF preference: %u\n",
@@ -3184,6 +3174,10 @@ bool bgp_evpn_path_es_use_nhg(struct bgp *bgp_vrf, struct bgp_path_info *pi,
        if (!memcmp(esi, zero_esi, sizeof(*esi)))
                return false;
 
+       /* we don't support NHG for d-vni yet */
+       if (bgp_evpn_mpath_has_dvni(bgp_vrf, pi))
+               return false;
+
        bgp_evpn_es_vrf_use_nhg(bgp_vrf, esi, &use_l3nhg, &is_l3nhg_active,
                                &es_vrf);
 
@@ -3965,7 +3959,8 @@ static void bgp_evpn_es_evi_show_entry(struct vty *vty,
                json_object *json_types;
 
                json_object_string_add(json, "esi", es_evi->es->esi_str);
-               json_object_int_add(json, "vni", es_evi->vpn->vni);
+               if (es_evi->vpn)
+                       json_object_int_add(json, "vni", es_evi->vpn->vni);
 
                if (es_evi->flags & (BGP_EVPNES_EVI_LOCAL |
                                        BGP_EVPNES_EVI_REMOTE)) {
@@ -4009,13 +4004,18 @@ static void bgp_evpn_es_evi_show_entry(struct vty *vty,
 static void bgp_evpn_es_evi_show_entry_detail(struct vty *vty,
                struct bgp_evpn_es_evi *es_evi, json_object *json)
 {
+       enum asnotation_mode mode;
+
+       mode = bgp_get_asnotation(es_evi->vpn->bgp_vrf);
+
        if (json) {
                json_object *json_flags;
 
                /* Add the "brief" info first */
                bgp_evpn_es_evi_show_entry(vty, es_evi, json);
                if (es_evi->es_frag)
-                       json_object_string_addf(json, "esFragmentRd", "%pRD",
+                       json_object_string_addf(json, "esFragmentRd",
+                                               BGP_RD_AS_FORMAT(mode),
                                                &es_evi->es_frag->prd);
                if (es_evi->flags & BGP_EVPNES_EVI_INCONS_VTEP_LIST) {
                        json_flags = json_object_new_array();
@@ -4039,9 +4039,12 @@ static void bgp_evpn_es_evi_show_entry_detail(struct vty *vty,
                vty_out(vty, "VNI: %d ESI: %s\n",
                                es_evi->vpn->vni, es_evi->es->esi_str);
                vty_out(vty, " Type: %s\n", type_str);
-               if (es_evi->es_frag)
-                       vty_out(vty, " ES fragment RD: %pRD\n",
+               if (es_evi->es_frag) {
+                       vty_out(vty, " ES fragment RD: ");
+                       vty_out(vty, BGP_RD_AS_FORMAT(mode),
                                &es_evi->es_frag->prd);
+                       vty_out(vty, "\n");
+               }
                vty_out(vty, " Inconsistencies: %s\n",
                        (es_evi->flags & BGP_EVPNES_EVI_INCONS_VTEP_LIST) ?
                        "es-vtep-mismatch":"-");
index 11030e323fb1c6f8b43f1a9184b6903002398d77..613fece4d45e3cb2aff154dd10b2dce3a6f77b90 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* EVPN header for multihoming procedures
  *
  * Copyright (C) 2019 Cumulus Networks
  * Anuradha Karuppiah
  *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
  */
 
 #ifndef _FRR_BGP_EVPN_MH_H
index 3f18e4e9f1d7822071459bdaad465cbd26c12ba7..fbf3b19c37cb5de85a2df37562880c4f8c8caddb 100644 (file)
@@ -1,22 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP EVPN internal definitions
  * Copyright (C) 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _BGP_EVPN_PRIVATE_H
@@ -92,6 +76,7 @@ struct bgpevpn {
 
        /* RD for this VNI. */
        struct prefix_rd prd;
+       char *prd_pretty;
 
        /* Route type 3 field */
        struct in_addr originator_ip;
index 0b5f81ccb006a48259242c6ebe3240b018367141..e28a8c8057ed1dc3c847fcd1257066ca84aafe85 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Ethernet-VPN Packet and vty Processing File
  * Copyright (C) 2017 6WIND
  *
  * This file is part of FRRouting
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -387,7 +374,9 @@ static void display_l3vni(struct vty *vty, struct bgp *bgp_vrf,
                json_object_int_add(json, "vni", bgp_vrf->l3vni);
                json_object_string_add(json, "type", "L3");
                json_object_string_add(json, "inKernel", "True");
-               json_object_string_addf(json, "rd", "%pRD", &bgp_vrf->vrf_prd);
+               json_object_string_addf(json, "rd",
+                                       BGP_RD_AS_FORMAT(bgp_vrf->asnotation),
+                                       &bgp_vrf->vrf_prd);
                json_object_string_addf(json, "originatorIp", "%pI4",
                                        &bgp_vrf->originator_ip);
                json_object_string_add(json, "advertiseGatewayMacip", "n/a");
@@ -411,7 +400,10 @@ static void display_l3vni(struct vty *vty, struct bgp *bgp_vrf,
                vty_out(vty, "  Type: %s\n", "L3");
                vty_out(vty, "  Tenant VRF: %s\n",
                        vrf_id_to_name(bgp_vrf->vrf_id));
-               vty_out(vty, "  RD: %pRD\n", &bgp_vrf->vrf_prd);
+               vty_out(vty, "  RD: ");
+               vty_out(vty, BGP_RD_AS_FORMAT(bgp_vrf->asnotation),
+                       &bgp_vrf->vrf_prd);
+               vty_out(vty, "\n");
                vty_out(vty, "  Originator IP: %pI4\n",
                        &bgp_vrf->originator_ip);
                vty_out(vty, "  Advertise-gw-macip : %s\n", "n/a");
@@ -474,8 +466,10 @@ static void display_vni(struct vty *vty, struct bgpevpn *vpn, json_object *json)
        json_object *json_import_rtl = NULL;
        json_object *json_export_rtl = NULL;
        struct bgp *bgp_evpn;
+       enum asnotation_mode asnotation;
 
        bgp_evpn = bgp_get_evpn();
+       asnotation = bgp_get_asnotation(bgp_evpn);
 
        if (json) {
                json_import_rtl = json_object_new_array();
@@ -484,7 +478,8 @@ static void display_vni(struct vty *vty, struct bgpevpn *vpn, json_object *json)
                json_object_string_add(json, "type", "L2");
                json_object_string_add(json, "inKernel",
                                       is_vni_live(vpn) ? "True" : "False");
-               json_object_string_addf(json, "rd", "%pRD", &vpn->prd);
+               json_object_string_addf(
+                       json, "rd", BGP_RD_AS_FORMAT(asnotation), &vpn->prd);
                json_object_string_addf(json, "originatorIp", "%pI4",
                                        &vpn->originator_ip);
                json_object_string_addf(json, "mcastGroup", "%pI4",
@@ -525,7 +520,9 @@ static void display_vni(struct vty *vty, struct bgpevpn *vpn, json_object *json)
                vty_out(vty, "  Type: %s\n", "L2");
                vty_out(vty, "  Tenant-Vrf: %s\n",
                        vrf_id_to_name(vpn->tenant_vrf_id));
-               vty_out(vty, "  RD: %pRD\n", &vpn->prd);
+               vty_out(vty, "  RD: ");
+               vty_out(vty, BGP_RD_AS_FORMAT(asnotation), &vpn->prd);
+               vty_out(vty, "\n");
                vty_out(vty, "  Originator IP: %pI4\n", &vpn->originator_ip);
                vty_out(vty, "  Mcast group: %pI4\n", &vpn->mcast_grp);
                if (!vpn->advertise_gw_macip &&
@@ -1004,7 +1001,9 @@ static void show_l3vni_entry(struct vty *vty, struct bgp *bgp,
                json_object_string_add(json_vni, "inKernel", "True");
                json_object_string_addf(json_vni, "originatorIp", "%pI4",
                                        &bgp->originator_ip);
-               json_object_string_addf(json_vni, "rd", "%pRD", &bgp->vrf_prd);
+               json_object_string_addf(json_vni, "rd",
+                                       BGP_RD_AS_FORMAT(bgp->asnotation),
+                                       &bgp->vrf_prd);
                json_object_string_add(json_vni, "advertiseGatewayMacip",
                                       "n/a");
                json_object_string_add(json_vni, "advertiseSviMacIp", "n/a");
@@ -1020,7 +1019,8 @@ static void show_l3vni_entry(struct vty *vty, struct bgp *bgp,
                        json_vni, "rmac",
                        prefix_mac2str(&bgp->rmac, buf2, sizeof(buf2)));
        } else {
-               vty_out(vty, "%-1s %-10u %-4s %-21pRD", buf1, bgp->l3vni, "L3",
+               vty_out(vty, "%-1s %-10u %-4s ", buf1, bgp->l3vni, "L3");
+               vty_out(vty, BGP_RD_AS_FORMAT_SPACE(bgp->asnotation),
                        &bgp->vrf_prd);
        }
 
@@ -1104,11 +1104,13 @@ static void show_vni_entry(struct hash_bucket *bucket, void *args[])
        struct listnode *node, *nnode;
        struct ecommunity *ecom;
        struct bgp *bgp_evpn;
+       enum asnotation_mode asnotation;
 
        vty = args[0];
        json = args[1];
 
        bgp_evpn = bgp_get_evpn();
+       asnotation = bgp_get_asnotation(bgp_evpn);
 
        if (json) {
                json_vni = json_object_new_object();
@@ -1125,7 +1127,9 @@ static void show_vni_entry(struct hash_bucket *bucket, void *args[])
                json_object_string_add(json_vni, "type", "L2");
                json_object_string_add(json_vni, "inKernel",
                                       is_vni_live(vpn) ? "True" : "False");
-               json_object_string_addf(json_vni, "rd", "%pRD", &vpn->prd);
+               json_object_string_addf(json_vni, "rd",
+                                       BGP_RD_AS_FORMAT(asnotation),
+                                       &vpn->prd);
                json_object_string_addf(json_vni, "originatorIp", "%pI4",
                                        &vpn->originator_ip);
                json_object_string_addf(json_vni, "mcastGroup", "%pI4",
@@ -1155,8 +1159,8 @@ static void show_vni_entry(struct hash_bucket *bucket, void *args[])
                        json_object_string_add(json_vni, "advertiseSviMacIp",
                                               "Disabled");
        } else {
-               vty_out(vty, "%-1s %-10u %-4s %-21pRD", buf1, vpn->vni, "L2",
-                       &vpn->prd);
+               vty_out(vty, "%-1s %-10u %-4s ", buf1, vpn->vni, "L2");
+               vty_out(vty, BGP_RD_AS_FORMAT_SPACE(asnotation), &vpn->prd);
        }
 
        for (ALL_LIST_ELEMENTS(vpn->import_rtl, node, nnode, ecom)) {
@@ -1345,9 +1349,9 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
                                                        json,
                                                        "defaultLocPrf",
                                                        bgp->default_local_pref);
-                                               json_object_int_add(
-                                                       json, "localAS",
-                                                       bgp->as);
+                                               asn_asn2json(json, "localAS",
+                                                            bgp->as,
+                                                            bgp->asnotation);
                                        } else {
                                                if (option == SHOW_DISPLAY_TAGS)
                                                        vty_out(vty,
@@ -2216,7 +2220,8 @@ static void evpn_unconfigure_export_rt(struct bgp *bgp, struct bgpevpn *vpn,
 /*
  * Configure RD for VRF
  */
-static void evpn_configure_vrf_rd(struct bgp *bgp_vrf, struct prefix_rd *rd)
+static void evpn_configure_vrf_rd(struct bgp *bgp_vrf, struct prefix_rd *rd,
+                                 const char *rd_pretty)
 {
        /* If we have already advertise type-5 routes with a diffrent RD, we
         * have to delete and withdraw them firs
@@ -2225,6 +2230,7 @@ static void evpn_configure_vrf_rd(struct bgp *bgp_vrf, struct prefix_rd *rd)
 
        /* update RD */
        memcpy(&bgp_vrf->vrf_prd, rd, sizeof(struct prefix_rd));
+       bgp_vrf->vrf_prd_pretty = XSTRDUP(MTYPE_BGP, rd_pretty);
        SET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_RD_CFGD);
 
        /* We have a new RD for VRF.
@@ -2246,7 +2252,8 @@ static void evpn_unconfigure_vrf_rd(struct bgp *bgp_vrf)
        /* fall back to default RD */
        bgp_evpn_derive_auto_rd_for_vrf(bgp_vrf);
        UNSET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_RD_CFGD);
-
+       if (bgp_vrf->vrf_prd_pretty)
+               XFREE(MTYPE_BGP, bgp_vrf->vrf_prd_pretty);
        /* We have a new RD for VRF.
         * Advertise all type-5 routes again with the new RD
         */
@@ -2257,7 +2264,7 @@ static void evpn_unconfigure_vrf_rd(struct bgp *bgp_vrf)
  * Configure RD for a VNI (vty handler)
  */
 static void evpn_configure_rd(struct bgp *bgp, struct bgpevpn *vpn,
-                             struct prefix_rd *rd)
+                             struct prefix_rd *rd, const char *rd_pretty)
 {
        /* If the VNI is "live", we need to delete and withdraw this VNI's
         * local routes with the prior RD first. Then, after updating RD,
@@ -2268,6 +2275,7 @@ static void evpn_configure_rd(struct bgp *bgp, struct bgpevpn *vpn,
 
        /* update RD */
        memcpy(&vpn->prd, rd, sizeof(struct prefix_rd));
+       vpn->prd_pretty = XSTRDUP(MTYPE_BGP, rd_pretty);
        SET_FLAG(vpn->flags, VNI_FLAG_RD_CFGD);
 
        if (is_vni_live(vpn))
@@ -2485,7 +2493,7 @@ static void evpn_show_route_vni_multicast(struct vty *vty, struct bgp *bgp,
 
        /* Prefix and num paths displayed once per prefix. */
        route_vty_out_detail_header(vty, bgp, dest, bgp_dest_get_prefix(dest),
-                                   NULL, afi, safi, json);
+                                   NULL, afi, safi, json, false);
 
        /* Display each path for this prefix. */
        for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
@@ -2587,7 +2595,7 @@ static void evpn_show_route_vni_macip(struct vty *vty, struct bgp *bgp,
 
        /* Prefix and num paths displayed once per prefix. */
        route_vty_out_detail_header(vty, bgp, dest, (struct prefix *)&p, NULL,
-                                   afi, safi, json);
+                                   afi, safi, json, false);
 
        evp = (const struct prefix_evpn *)bgp_dest_get_prefix(dest);
 
@@ -2722,7 +2730,7 @@ static void evpn_show_route_rd_macip(struct vty *vty, struct bgp *bgp,
 
        /* Prefix and num paths displayed once per prefix. */
        route_vty_out_detail_header(vty, bgp, dest, bgp_dest_get_prefix(dest),
-                                   prd, afi, safi, json);
+                                   prd, afi, safi, json, false);
 
        if (json)
                json_paths = json_object_new_array();
@@ -2791,7 +2799,8 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
 
        if (json) {
                json_rd = json_object_new_object();
-               json_object_string_addf(json_rd, "rd", "%pRD", prd);
+               json_object_string_addf(json_rd, "rd",
+                                       BGP_RD_AS_FORMAT(bgp->asnotation), prd);
        }
 
        bgp_dest_unlock_node(rd_dest);
@@ -2830,7 +2839,7 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
                        /* Prefix and num paths displayed once per prefix. */
                        route_vty_out_detail_header(
                                vty, bgp, dest, bgp_dest_get_prefix(dest), prd,
-                               afi, safi, json_prefix);
+                               afi, safi, json_prefix, false);
 
                        prefix_cnt++;
                }
@@ -2874,7 +2883,9 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
 
        if (json) {
                if (add_rd_to_json)
-                       json_object_object_addf(json, json_rd, "%pRD", prd);
+                       json_object_object_addf(
+                               json, json_rd,
+                               BGP_RD_AS_FORMAT(bgp->asnotation), prd);
                else {
                        json_object_free(json_rd);
                        json_rd = NULL;
@@ -2929,7 +2940,7 @@ static void evpn_show_route_rd_all_macip(struct vty *vty, struct bgp *bgp,
                        continue;
 
                prefix_rd2str((struct prefix_rd *)rd_destp, rd_str,
-                             sizeof(rd_str));
+                             sizeof(rd_str), bgp->asnotation);
 
                /* Construct an RT-2 from the user-supplied mac(ip),
                 * then search the l2vpn evpn table for it.
@@ -2965,7 +2976,7 @@ static void evpn_show_route_rd_all_macip(struct vty *vty, struct bgp *bgp,
                        /* Prefix and num paths displayed once per prefix. */
                        route_vty_out_detail_header(
                                vty, bgp, dest, p, (struct prefix_rd *)rd_destp,
-                               AFI_L2VPN, SAFI_EVPN, json_prefix);
+                               AFI_L2VPN, SAFI_EVPN, json_prefix, false);
 
                /* For EVPN, the prefix is displayed for each path (to
                 * fit in with code that already exists).
@@ -3023,7 +3034,7 @@ static void evpn_show_route_rd_all_macip(struct vty *vty, struct bgp *bgp,
  * If 'type' is non-zero, only routes matching that type are shown.
  */
 static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
-                                json_object *json, int detail)
+                                json_object *json, int detail, bool self_orig)
 {
        struct bgp_dest *rd_dest;
        struct bgp_table *table;
@@ -3056,7 +3067,7 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
 
                tbl_ver = table->version;
                prefix_rd2str((struct prefix_rd *)rd_destp, rd_str,
-                             sizeof(rd_str));
+                             sizeof(rd_str), bgp->asnotation);
 
                if (json)
                        json_rd = json_object_new_object();
@@ -3081,6 +3092,9 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
 
                        pi = bgp_dest_get_bgp_path_info(dest);
                        if (pi) {
+                               if (self_orig && (pi->peer != bgp->peer_self))
+                                       continue;
+
                                /* Overall header/legend displayed once. */
                                if (header) {
                                        bgp_evpn_show_route_header(vty, bgp,
@@ -3119,7 +3133,7 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
                                        vty, bgp, dest,
                                        bgp_dest_get_prefix(dest),
                                        (struct prefix_rd *)rd_destp, AFI_L2VPN,
-                                       SAFI_EVPN, json_prefix);
+                                       SAFI_EVPN, json_prefix, false);
 
                        /* For EVPN, the prefix is displayed for each path (to
                         * fit in
@@ -3200,7 +3214,7 @@ int bgp_evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
        if (use_json)
                json = json_object_new_object();
 
-       evpn_show_all_routes(vty, bgp, type, json, detail);
+       evpn_show_all_routes(vty, bgp, type, json, detail, false);
 
        if (use_json)
                vty_json(vty, json);
@@ -3473,7 +3487,7 @@ static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
        if (is_vni_configured(vpn)) {
                vty_out(vty, "  vni %u\n", vpn->vni);
                if (is_rd_configured(vpn))
-                       vty_out(vty, "   rd %pRD\n", &vpn->prd);
+                       vty_out(vty, "   rd %s\n", vpn->prd_pretty);
 
                if (is_import_rt_configured(vpn)) {
                        for (ALL_LIST_ELEMENTS(vpn->import_rtl, node, nnode,
@@ -4773,7 +4787,7 @@ int bgp_evpn_cli_parse_type(int *type, struct cmd_token **argv, int argc)
  */
 DEFUN(show_bgp_l2vpn_evpn_route,
       show_bgp_l2vpn_evpn_route_cmd,
-      "show bgp l2vpn evpn route [detail] [type "EVPN_TYPE_ALL_LIST"] [json]",
+      "show bgp l2vpn evpn route [detail] [type "EVPN_TYPE_ALL_LIST"] ["BGP_SELF_ORIG_CMD_STR"] [json]",
       SHOW_STR
       BGP_STR
       L2VPN_HELP_STR
@@ -4782,12 +4796,15 @@ DEFUN(show_bgp_l2vpn_evpn_route,
       "Display Detailed Information\n"
       EVPN_TYPE_HELP_STR
       EVPN_TYPE_ALL_LIST_HELP_STR
+      BGP_SELF_ORIG_HELP_STR
       JSON_STR)
 {
        struct bgp *bgp;
        int detail = 0;
        int type = 0;
        bool uj = false;
+       int arg_idx = 0;
+       bool self_orig = false;
        json_object *json = NULL;
 
        uj = use_json(argc, argv);
@@ -4805,7 +4822,10 @@ DEFUN(show_bgp_l2vpn_evpn_route,
        if (argv_find(argv, argc, "detail", &detail))
                detail = 1;
 
-       evpn_show_all_routes(vty, bgp, type, json, detail);
+       if (argv_find(argv, argc, BGP_SELF_ORIG_CMD_STR, &arg_idx))
+               self_orig = true;
+
+       evpn_show_all_routes(vty, bgp, type, json, detail, self_orig);
 
        /*
         * This is an extremely expensive operation at scale
@@ -4871,7 +4891,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_rd,
                return CMD_WARNING;
 
        if (rd_all)
-               evpn_show_all_routes(vty, bgp, type, json, 1);
+               evpn_show_all_routes(vty, bgp, type, json, 1, false);
        else
                evpn_show_route_rd(vty, bgp, &prd, type, json);
 
@@ -6124,7 +6144,7 @@ DEFUN (bgp_evpn_vrf_rd,
                return CMD_SUCCESS;
 
        /* Configure or update the RD. */
-       evpn_configure_vrf_rd(bgp_vrf, &prd);
+       evpn_configure_vrf_rd(bgp_vrf, &prd, argv[1]->arg);
        return CMD_SUCCESS;
 }
 
@@ -6216,7 +6236,7 @@ DEFUN (bgp_evpn_vni_rd,
                return CMD_SUCCESS;
 
        /* Configure or update the RD. */
-       evpn_configure_rd(bgp, vpn, &prd);
+       evpn_configure_rd(bgp, vpn, &prd, argv[1]->arg);
        return CMD_SUCCESS;
 }
 
@@ -6401,7 +6421,9 @@ DEFUN (show_bgp_vrf_l3vni_info,
                for (ALL_LIST_ELEMENTS_RO(bgp->vrf_import_rtl, node, l3rt))
                        vty_out(vty, "%s  ", ecommunity_str(l3rt->ecom));
                vty_out(vty, "\n");
-               vty_out(vty, "  RD: %pRD\n", &bgp->vrf_prd);
+               vty_out(vty, "  RD: ");
+               vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation), &bgp->vrf_prd);
+               vty_out(vty, "\n");
        } else {
                json_object_string_add(json, "vrf", name);
                json_object_string_addf(json, "local-ip", "%pI4",
@@ -6437,7 +6459,9 @@ DEFUN (show_bgp_vrf_l3vni_info,
                                json_object_new_string(
                                        ecommunity_str(l3rt->ecom)));
                json_object_object_add(json, "import-rts", json_import_rts);
-               json_object_string_addf(json, "rd", "%pRD", &bgp->vrf_prd);
+               json_object_string_addf(json, "rd",
+                                       BGP_RD_AS_FORMAT(bgp->asnotation),
+                                       &bgp->vrf_prd);
        }
 
        if (uj)
@@ -6896,15 +6920,17 @@ DEFUN (bgp_evpn_vni_rt,
                return CMD_WARNING;
        }
 
-       ecomadd = ecommunity_str2com(argv[2]->arg, ECOMMUNITY_ROUTE_TARGET, 0);
-       if (!ecomadd) {
-               vty_out(vty, "%% Malformed Route Target list\n");
-               return CMD_WARNING;
-       }
-       ecommunity_str(ecomadd);
-
        /* Add/update the import route-target */
        if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT) {
+               /* Note that first of the two RTs is created for "both" type */
+               ecomadd = ecommunity_str2com(argv[2]->arg,
+                                            ECOMMUNITY_ROUTE_TARGET, 0);
+               if (!ecomadd) {
+                       vty_out(vty, "%% Malformed Route Target list\n");
+                       return CMD_WARNING;
+               }
+               ecommunity_str(ecomadd);
+
                /* Do nothing if we already have this import route-target */
                if (!bgp_evpn_rt_matches_existing(vpn->import_rtl, ecomadd))
                        evpn_configure_import_rt(bgp, vpn, ecomadd);
@@ -6912,6 +6938,15 @@ DEFUN (bgp_evpn_vni_rt,
 
        /* Add/update the export route-target */
        if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_EXPORT) {
+               /* Note that second of the two RTs is created for "both" type */
+               ecomadd = ecommunity_str2com(argv[2]->arg,
+                                            ECOMMUNITY_ROUTE_TARGET, 0);
+               if (!ecomadd) {
+                       vty_out(vty, "%% Malformed Route Target list\n");
+                       return CMD_WARNING;
+               }
+               ecommunity_str(ecomadd);
+
                /* Do nothing if we already have this export route-target */
                if (!bgp_evpn_rt_matches_existing(vpn->export_rtl, ecomadd))
                        evpn_configure_export_rt(bgp, vpn, ecomadd);
@@ -7253,7 +7288,7 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
                }
        }
        if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_RD_CFGD))
-               vty_out(vty, "  rd %pRD\n", &bgp->vrf_prd);
+               vty_out(vty, "  rd %s\n", bgp->vrf_prd_pretty);
 
        /* import route-target */
        if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_IMPORT_RT_CFGD)) {
index 8901644d73d99757699eafcca3caed5d814a54ae..83c41a5ade9bd72a94949eaee5635eb538329bce 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* EVPN VTY functions to EVPN
  * Copyright (C) 2017 6WIND
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_EVPN_VTY_H
index 89216229538c894dc689769469fe895c6b34be68..fbea6862b85cd4c689ae5df260f2910d7356f932 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS path filter list.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 66c83d97e9e26da8276ea62d79a996afccee1bee..a294ebc69eae1645128c4f1ed8037eb7a810d0a1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS path filter list.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_FILTER_H
index b07625c49e2395e17ceb32f34554eede598406ca..8d5ca5e77779516a573ba07c1ac840959dbc9bb7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP FlowSpec for packet handling
  * Portions:
  *     Copyright (C) 2017 ChinaTelecom SDN Group
  *     Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -193,9 +180,8 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
                                   ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
                                   NULL, 0, 0, NULL);
                else
-                       bgp_withdraw(peer, &p, 0, attr, afi, safi,
-                                    ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
-                                    NULL, 0, NULL);
+                       bgp_withdraw(peer, &p, 0, afi, safi, ZEBRA_ROUTE_BGP,
+                                    BGP_ROUTE_NORMAL, NULL, NULL, 0, NULL);
        }
        return BGP_NLRI_PARSE_OK;
 }
index d1a59a672d1211cb5f267842f964c41c30d1602f..58fc1775ab2be6e479b7c85fd5a491629cc38c0b 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Flowspec header for packet handling
  * Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_FLOWSPEC_H
index 757a8ae2e9081d903c03f8082e4fc36228dbade2..049cb6df770a1d575c43b6a8242171c816721414 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Flowspec header . private structs and defines
  * Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_FLOWSPEC_PRIVATE_H
index 9f3ea499ff2018b96fb034e256e699fe87f1a1ee..326d7f2efb2b18b5f71df090e7fa36cc46cfad83 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP FlowSpec Utilities
  * Portions:
  *     Copyright (C) 2017 ChinaTelecom SDN Group
  *     Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
@@ -231,7 +218,7 @@ int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type,
                        prefix_copy(prefix, &prefix_local);
                break;
        case BGP_FLOWSPEC_VALIDATE_ONLY:
-       default:
+       case BGP_FLOWSPEC_RETURN_JSON:
                break;
        }
        return offset;
@@ -326,7 +313,7 @@ int bgp_flowspec_op_decode(enum bgp_flowspec_util_nlri_t type,
                        mval++;
                        break;
                case BGP_FLOWSPEC_VALIDATE_ONLY:
-               default:
+               case BGP_FLOWSPEC_RETURN_JSON:
                        /* no action */
                        break;
                }
@@ -436,7 +423,7 @@ int bgp_flowspec_bitmask_decode(enum bgp_flowspec_util_nlri_t type,
                        mval++;
                        break;
                case BGP_FLOWSPEC_VALIDATE_ONLY:
-               default:
+               case BGP_FLOWSPEC_RETURN_JSON:
                        /* no action */
                        break;
                }
index 6cc4854d7fb7a326ffd3710ff67a580cdbdf9eec..de15660838732136d0fbf826f35959c997c0c19d 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Flowspec header for utilities
  * Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_FLOWSPEC_UTIL_H
index 626e9803469bd662d326ae244fa8c0d8db4fbd5a..7df1423e59eb4dd8e25c0bd075402dff653c997c 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP FlowSpec VTY
  * Copyright (C) 2018 6WIND
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9624adfbe25a8aa6fb0c8bb03bd42edfd4ffbdaf..59a8fcb92a07e0090dbc7c9a346061ab8761fefa 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP-4 Finite State Machine
  * From RFC1771 [A Border Gateway Protocol 4 (BGP-4)]
  * Copyright (C) 1996, 97, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -297,6 +282,15 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
                from_peer->domainname = NULL;
        }
 
+       if (peer->soft_version) {
+               XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
+               peer->soft_version = NULL;
+       }
+       if (from_peer->soft_version) {
+               peer->soft_version = from_peer->soft_version;
+               from_peer->soft_version = NULL;
+       }
+
        FOREACH_AFI_SAFI (afi, safi) {
                peer->af_sflags[afi][safi] = from_peer->af_sflags[afi][safi];
                peer->af_cap[afi][safi] = from_peer->af_cap[afi][safi];
@@ -2397,7 +2391,7 @@ void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops)
                        BGP_EVENT_ADD(peer, TCP_fatal_error);
        case Clearing:
        case Deleted:
-       default:
+       case BGP_STATUS_MAX:
                break;
        }
 }
index a6e90612af03a1c7983f8d3d76598c4868a08b23..bd1a6adfe8740a57a4f225e97480b2d169710e2a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP-4 Finite State Machine
  * From RFC1771 [A Border Gateway Protocol 4 (BGP-4)]
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_FSM_H
index f9dc64af4566937397f8aad94754f2b7c2e04462..530b77987d0c07cd96593f4d720e938caaf28c78 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP I/O.
  * Implements packet I/O in a pthread.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 /* clang-format off */
index 75d014f38e03fb347412c1db8301ecfff0247fd1..4c92373c2db4b808e05c9146fe29bd06ba267eb2 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP I/O.
  * Implements packet I/O in a pthread.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_IO_H
index fb1237c02245751f5441ebfcbf97a7ceaf84eb98..b9e4d7c4c2838600c28a54b834e81f881f66b699 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Keepalives.
  * Implements a producer thread to generate BGP keepalives for peers.
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2, or (at your option) any later
- * version.
- *
- * FRRouting is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* clang-format off */
index e8d0d3d401998a5100275751b87f305932210d5c..2b4389cac38104400a83439e019fbafcb558d2eb 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Keepalives.
  * Implements a producer thread to generate BGP keepalives for peers.
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2, or (at your option) any later
- * version.
- *
- * FRRouting is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_KEEPALIVES_H
index 38f34a8927027fb63e69c54313af4019e866113e..0cad119af101a121948de8fad893ad8d2c9540c1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP carrying label information
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -457,7 +442,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
                                   safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
                                   NULL, &label, 1, 0, NULL);
                } else {
-                       bgp_withdraw(peer, &p, addpath_id, attr, packet->afi,
+                       bgp_withdraw(peer, &p, addpath_id, packet->afi,
                                     SAFI_UNICAST, ZEBRA_ROUTE_BGP,
                                     BGP_ROUTE_NORMAL, NULL, &label, 1, NULL);
                }
index 4061e8719b042e9c5551cc43029b060e3d6e6335..ac7fbb27fbe964ef3ea8f9f05a3dd1a18ce478fa 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP carrying Label information
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _BGP_LABEL_H
index d60552011c753c1a48b1bf9ca3a601005fb80986..f0f207442ea6e1067593d1e4784c48fee0957cfb 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Label Pool - Manage label chunk allocations from zebra asynchronously
  *
  * Copyright (C) 2018 LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2f3ffe437fa6ca4e2ee298fa42e969945bafd372..955ab2d697c49c464ad02c598fdf6269b703d723 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Label Pool - Manage label chunk allocations from zebra asynchronously
  *
  * Copyright (C) 2018 LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_LABELPOOL_H
index e0cca50d897e9a065ccdd1c5a1b34efa2f45e1e9..2329bcb6c648684f0e4f07dfa091172a87be5d9f 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Large Communities Attribute
  *
  * Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b9b5fe35d56e789ada2b846f81b5e6f0e1e9787d..151b79fa63c48456df08669a81c59fe212c62210 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Large Communities Attribute.
  *
  * Copyright (C) 2016 Keyur Patel <keyur@arrcus.com>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_LCOMMUNITY_H
index 52ffb103341ded9c6cd7c6354383e4a61c607574..5d49175e4339d67f16862c5d34f02bfb3fbb8629 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGPd - Mac hash code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 4b94d80d1a36a8e7be135f9168729fd5312d70f7..d971561037678b25c9649e6bcd5aa74aa0c28673 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGPd - Mac hash header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __BGP_MAC_H__
 #define __BGP_MAC_H__
index 90ae580babe4866db1a40df29a05b6d0b9c8a28c..85e49043725e04e98426b9282cb0b6557cc94277 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Main routine of bgpd.
  * Copyright (C) 1996, 97, 98, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 850657d35ed0c730d57298c45ab712baf17ef711..d7b18de6769f382e3103faea44269c135406fd3a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* bgpd memory type definitions
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
@@ -139,3 +124,5 @@ DEFINE_MTYPE(BGPD, BGP_SRV6_FUNCTION, "BGP srv6 function");
 DEFINE_MTYPE(BGPD, EVPN_REMOTE_IP, "BGP EVPN Remote IP hash entry");
 
 DEFINE_MTYPE(BGPD, BGP_NOTIFICATION, "BGP Notification Message");
+
+DEFINE_MTYPE(BGPD, BGP_SOFT_VERSION, "Software Version");
index 510cfa21c9217913f0459c09d61c43cd80be8279..7b004977144ee3e83bf040b8a9fb688c6a5e2d09 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* bgpd memory type declarations
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_MEMORY_H
@@ -138,4 +123,6 @@ DECLARE_MTYPE(EVPN_REMOTE_IP);
 
 DECLARE_MTYPE(BGP_NOTIFICATION);
 
+DECLARE_MTYPE(BGP_SOFT_VERSION);
+
 #endif /* _QUAGGA_BGP_MEMORY_H */
index 32a5e14b1158580998b8820084e34c8be928fff3..e920d5753ead60b9fc3b7943f5098f481c78901c 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Multipath
  * Copyright (C) 2010 Google Inc.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4925f16dc16649f17a7266ec339eb2b964382674..129682d1dc19c3c796fa8fb5e45da1b35af3eef1 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Multipath
  * Copyright (C) 2010 Google Inc.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_MPATH_H
index 288115f21198a597f697f844abfe4bd887081098..551da692497cdd1bb895c6c0658e28b57f664228 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* MPLS-VPN
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -255,7 +240,7 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
                                   SAFI_MPLS_VPN, ZEBRA_ROUTE_BGP,
                                   BGP_ROUTE_NORMAL, &prd, &label, 1, 0, NULL);
                } else {
-                       bgp_withdraw(peer, &p, addpath_id, attr, packet->afi,
+                       bgp_withdraw(peer, &p, addpath_id, packet->afi,
                                     SAFI_MPLS_VPN, ZEBRA_ROUTE_BGP,
                                     BGP_ROUTE_NORMAL, &prd, &label, 1, NULL);
                }
@@ -1192,7 +1177,7 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn,
                        if (!ecommunity_cmp(
                                    bgp_attr_get_ecommunity(bpi->attr),
                                    bgp_attr_get_ecommunity(new_attr))) {
-                               vpn_leak_to_vrf_withdraw(to_bgp, bpi);
+                               vpn_leak_to_vrf_withdraw(bpi);
                                bgp_aggregate_decrement(to_bgp, p, bpi, afi,
                                                        safi);
                                bgp_path_info_delete(bn, bpi);
@@ -1722,7 +1707,7 @@ void vpn_leak_from_vrf_withdraw(struct bgp *to_bgp,               /* to */
 
        if (bpi) {
                /* withdraw from looped vrfs as well */
-               vpn_leak_to_vrf_withdraw(to_bgp, bpi);
+               vpn_leak_to_vrf_withdraw(bpi);
 
                bgp_aggregate_decrement(to_bgp, p, bpi, afi, safi);
                bgp_path_info_delete(bn, bpi);
@@ -1777,7 +1762,7 @@ void vpn_leak_from_vrf_withdraw_all(struct bgp *to_bgp, struct bgp *from_bgp,
                                                zlog_debug("%s: deleting it",
                                                           __func__);
                                        /* withdraw from leak-to vrfs as well */
-                                       vpn_leak_to_vrf_withdraw(to_bgp, bpi);
+                                       vpn_leak_to_vrf_withdraw(bpi);
                                        bgp_aggregate_decrement(
                                                to_bgp, bgp_dest_get_prefix(bn),
                                                bpi, afi, safi);
@@ -1868,12 +1853,15 @@ static bool vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp,   /* to */
        int origin_local = 0;
        struct bgp *src_vrf;
        struct interface *ifp;
-
+       char rd_buf[RD_ADDRSTRLEN];
        int debug = BGP_DEBUG(vpn, VPN_LEAK_TO_VRF);
 
        if (!vpn_leak_from_vpn_active(to_bgp, afi, &debugmsg)) {
                if (debug)
-                       zlog_debug("%s: skipping: %s", __func__, debugmsg);
+                       zlog_debug(
+                               "%s: from vpn (%s) to vrf (%s), skipping: %s",
+                               __func__, from_bgp->name_pretty,
+                               to_bgp->name_pretty, debugmsg);
                return false;
        }
 
@@ -1904,6 +1892,10 @@ static bool vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp,   /* to */
                return false;
        }
 
+       rd_buf[0] = '\0';
+       if (debug && prd)
+               prefix_rd2str(prd, rd_buf, sizeof(rd_buf), to_bgp->asnotation);
+
        /* A route MUST NOT ever be accepted back into its source VRF, even if
         * it carries one or more RTs that match that VRF.
         */
@@ -1912,15 +1904,14 @@ static bool vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp,   /* to */
                   ECOMMUNITY_SIZE) == 0) {
                if (debug)
                        zlog_debug(
-                               "%s: skipping import, match RD (%pRD) of src VRF (%s) and the prefix (%pFX)",
-                               __func__, prd, to_bgp->name_pretty, p);
-
+                               "%s: skipping import, match RD (%s) of src VRF (%s) and the prefix (%pFX)",
+                               __func__, rd_buf, to_bgp->name_pretty, p);
                return false;
        }
 
        if (debug)
-               zlog_debug("%s: updating RD %pRD, %pFX to %s", __func__, prd, p,
-                          to_bgp->name_pretty);
+               zlog_debug("%s: updating RD %s, %pFX to %s", __func__, rd_buf,
+                          p, to_bgp->name_pretty);
 
        /* shallow copy */
        static_attr = *path_vpn->attr;
@@ -2115,8 +2106,7 @@ bool vpn_leak_to_vrf_update(struct bgp *from_bgp,
        return leak_success;
 }
 
-void vpn_leak_to_vrf_withdraw(struct bgp *from_bgp,       /* from */
-                             struct bgp_path_info *path_vpn) /* route */
+void vpn_leak_to_vrf_withdraw(struct bgp_path_info *path_vpn)
 {
        const struct prefix *p;
        afi_t afi;
@@ -2159,7 +2149,8 @@ void vpn_leak_to_vrf_withdraw(struct bgp *from_bgp,          /* from */
        for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) {
                if (!vpn_leak_from_vpn_active(bgp, afi, &debugmsg)) {
                        if (debug)
-                               zlog_debug("%s: skipping: %s", __func__,
+                               zlog_debug("%s: from %s, skipping: %s",
+                                          __func__, bgp->name_pretty,
                                           debugmsg);
                        continue;
                }
@@ -2415,7 +2406,7 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw,
                                     &bgp->vrf_prd_auto);
                        bgp->vpn_policy[afi].tovpn_rd = bgp->vrf_prd_auto;
                        prefix_rd2str(&bgp->vpn_policy[afi].tovpn_rd, buf,
-                                     sizeof(buf));
+                                     sizeof(buf), bgp->asnotation);
 
                        /* free up pre-existing memory if any and allocate
                         *  the ecommunity attribute with new RD/RT
@@ -2550,8 +2541,8 @@ void vrf_import_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
                from_bgp->vpn_policy[afi].tovpn_rd = from_bgp->vrf_prd_auto;
                SET_FLAG(from_bgp->vpn_policy[afi].flags,
                         BGP_VPN_POLICY_TOVPN_RD_SET);
-               prefix_rd2str(&from_bgp->vpn_policy[afi].tovpn_rd,
-                             buf, sizeof(buf));
+               prefix_rd2str(&from_bgp->vpn_policy[afi].tovpn_rd, buf,
+                             sizeof(buf), from_bgp->asnotation);
                from_bgp->vpn_policy[afi].rtlist[edir] =
                        ecommunity_str2com(buf, ECOMMUNITY_ROUTE_TARGET, 0);
                SET_FLAG(from_bgp->af_flags[afi][safi],
index 7b57e4c75d1064cedeb2bb5a2ffa32d69d2bed10..c832b4abd444da426a2c101415637842f4f82873 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* MPLS-VPN
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
  *
  * This file is part of GxNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_MPLSVPN_H
@@ -75,8 +62,7 @@ extern bool vpn_leak_to_vrf_update(struct bgp *from_bgp,
                                   struct bgp_path_info *path_vpn,
                                   struct prefix_rd *prd);
 
-extern void vpn_leak_to_vrf_withdraw(struct bgp *from_bgp,
-                                    struct bgp_path_info *path_vpn);
+extern void vpn_leak_to_vrf_withdraw(struct bgp_path_info *path_vpn);
 
 extern void vpn_leak_zebra_vrf_label_update(struct bgp *bgp, afi_t afi);
 extern void vpn_leak_zebra_vrf_label_withdraw(struct bgp *bgp, afi_t afi);
index 8d5daa49c81f19a1153618821acff45fd8c162f2..9b2ab6680627d6642111238383159c1d64755f74 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* MPLS/BGP L3VPN MIB
  * Copyright (C) 2020 Volta Networks Inc
- *
- * This file is part of FRR.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -957,11 +942,13 @@ static uint8_t *mplsL3vpnVrfTable(struct variable *v, oid name[],
                if (CHECK_FLAG(l3vpn_bgp->vpn_policy[AFI_IP].flags,
                               BGP_VPN_POLICY_TOVPN_RD_SET))
                        prefix_rd2str(&l3vpn_bgp->vpn_policy[AFI_IP].tovpn_rd,
-                                     rd_buf, sizeof(rd_buf));
+                                     rd_buf, sizeof(rd_buf),
+                                     bgp_get_asnotation(l3vpn_bgp));
                else if (CHECK_FLAG(l3vpn_bgp->vpn_policy[AFI_IP6].flags,
                                    BGP_VPN_POLICY_TOVPN_RD_SET))
                        prefix_rd2str(&l3vpn_bgp->vpn_policy[AFI_IP6].tovpn_rd,
-                                     rd_buf, sizeof(rd_buf));
+                                     rd_buf, sizeof(rd_buf),
+                                     bgp_get_asnotation(l3vpn_bgp));
 
                *var_len = strnlen(rd_buf, RD_ADDRSTRLEN);
                return (uint8_t *)rd_buf;
@@ -1264,7 +1251,7 @@ bgp_lookup_route(struct bgp *l3vpn_bgp, struct bgp_dest **dest,
                            == 0)
                                return pi;
                        break;
-               default:
+               case IPADDR_NONE:
                        return pi;
                }
        }
@@ -1627,13 +1614,13 @@ static uint8_t *mplsL3vpnRteTable(struct variable *v, oid name[],
                                case BLACKHOLE_REJECT:
                                        return SNMP_INTEGER(
                                                MPLSL3VPNVRFRTECIDRTYPEREJECT);
-                               default:
+                               case BLACKHOLE_UNSPEC:
+                               case BLACKHOLE_NULL:
+                               case BLACKHOLE_ADMINPROHIB:
                                        return SNMP_INTEGER(
                                                MPLSL3VPNVRFRTECIDRTYPEBLACKHOLE);
                                }
-                       default:
-                               return SNMP_INTEGER(
-                                       MPLSL3VPNVRFRTECIDRTYPEOTHER);
+                               break;
                        }
                } else
                        return SNMP_INTEGER(MPLSL3VPNVRFRTECIDRTYPEOTHER);
index 781d5e98f6a8e07f91c8147ae48f9c308ac6f3cb..f7fa46c2093a1e5034cbd10a1dff9f61846997ab 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* MPLS/BGP L3VPN MIB
  * Copyright (C) 2020 Volta Networks Inc
- *
- * This file is part of FRR.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 void bgp_mpls_l3vpn_module_init(void);
index 7186a507110027de3dee3be75373ebce9279030d..df67e2a72c7fa69d7d2b29827f35f0cbc38ecdbb 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP network related fucntions
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -553,7 +538,7 @@ static void bgp_accept(struct thread *thread)
                                peer1->host);
 
        peer = peer_create(&su, peer1->conf_if, peer1->bgp, peer1->local_as,
-                          peer1->as, peer1->as_type, NULL, false);
+                          peer1->as, peer1->as_type, NULL, false, NULL);
 
        peer_xfer_config(peer, peer1);
        bgp_peer_gr_flags_update(peer);
index 7420397a9337f055a48791d63e06006bc3a5316a..f21b219e29715f25cc9b2f232b200e25f211245b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP network related header
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_NETWORK_H
index 77e26037c0eea0e918ba809435c0d214c86dcfdf..00a0bc84023e91abf8ee4ed0d4bcd1f0255c8516 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP nexthop scan
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -817,6 +802,7 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                safi = table->safi;
                bgp_path = table->bgp;
 
+
                if (json) {
                        json_path = json_object_new_object();
                        json_object_string_add(json_path, "afi", afi2str(afi));
@@ -826,7 +812,8 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                                                dest);
                        if (dest->pdest)
                                json_object_string_addf(
-                                       json_path, "rd", "%pRD",
+                                       json_path, "rd",
+                                       BGP_RD_AS_FORMAT(bgp->asnotation),
                                        (struct prefix_rd *)bgp_dest_get_prefix(
                                                dest->pdest));
                        json_object_string_add(
@@ -836,13 +823,14 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                        json_object_array_add(paths, json_path);
                        continue;
                }
-               if (dest->pdest)
-                       vty_out(vty, "    %d/%d %pBD RD %pRD %s flags 0x%x\n",
-                               afi, safi, dest,
+               if (dest->pdest) {
+                       vty_out(vty, "    %d/%d %pBD RD ", afi, safi, dest);
+                       vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation),
                                (struct prefix_rd *)bgp_dest_get_prefix(
-                                       dest->pdest),
-                               bgp_path->name_pretty, path->flags);
-               else
+                                       dest->pdest));
+                       vty_out(vty, " %s flags 0x%x\n", bgp_path->name_pretty,
+                               path->flags);
+               } else
                        vty_out(vty, "    %d/%d %pBD %s flags 0x%x\n",
                                afi, safi, dest, bgp_path->name_pretty, path->flags);
        }
index d765bdd2610842adde448bf426ef19b8b3d4ef61..95e2f9165b115c601b812df3d6369118b189c925 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP nexthop scan
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_NEXTHOP_H
index cf8ff524e963b2d79ef7988c55819fc4d3e8f507..25b458a8e5e56c83c4faaf3a9c22b1e3017882a4 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Nexthop tracking
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1205,14 +1190,20 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc)
                }
 
                if (BGP_DEBUG(nht, NHT)) {
-                       if (dest->pdest)
-                               zlog_debug(
-                                       "... eval path %d/%d %pBD RD %pRD %s flags 0x%x",
-                                       afi, safi, dest,
+
+                       if (dest->pdest) {
+                               char rd_buf[RD_ADDRSTRLEN];
+
+                               prefix_rd2str(
                                        (struct prefix_rd *)bgp_dest_get_prefix(
                                                dest->pdest),
+                                       rd_buf, sizeof(rd_buf),
+                                       bgp_get_asnotation(bnc->bgp));
+                               zlog_debug(
+                                       "... eval path %d/%d %pBD RD %s %s flags 0x%x",
+                                       afi, safi, dest, rd_buf,
                                        bgp_path->name_pretty, path->flags);
-                       else
+                       else
                                zlog_debug(
                                        "... eval path %d/%d %pBD %s flags 0x%x",
                                        afi, safi, dest, bgp_path->name_pretty,
index 43f0aa26cf24f0f681f4fca9d3afa1fd855f1297..0758a0cf08fc5ea84294b9a5b13cfd9a5654c60c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP Nexthop tracking
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _BGP_NHT_H
index 659e93bdfab9fb7c8f6d316a8ba9cf9706d72c33..032767820f5c864212e844dcffe33bc5169fa78c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP open message handling
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -59,6 +44,7 @@ static const struct message capcode_str[] = {
        {CAPABILITY_CODE_EXT_MESSAGE, "BGP Extended Message"},
        {CAPABILITY_CODE_LLGR, "Long-lived BGP Graceful Restart"},
        {CAPABILITY_CODE_ROLE, "Role"},
+       {CAPABILITY_CODE_SOFT_VERSION, "Software Version"},
        {0}};
 
 /* Minimum sizes for length field of each cap (so not inc. the header) */
@@ -79,6 +65,7 @@ static const size_t cap_minsizes[] = {
                [CAPABILITY_CODE_EXT_MESSAGE] = CAPABILITY_CODE_EXT_MESSAGE_LEN,
                [CAPABILITY_CODE_LLGR] = CAPABILITY_CODE_LLGR_LEN,
                [CAPABILITY_CODE_ROLE] = CAPABILITY_CODE_ROLE_LEN,
+               [CAPABILITY_CODE_SOFT_VERSION] = CAPABILITY_CODE_SOFT_VERSION_LEN,
 };
 
 /* value the capability must be a multiple of.
@@ -103,6 +90,7 @@ static const size_t cap_modsizes[] = {
                [CAPABILITY_CODE_EXT_MESSAGE] = 1,
                [CAPABILITY_CODE_LLGR] = 1,
                [CAPABILITY_CODE_ROLE] = 1,
+               [CAPABILITY_CODE_SOFT_VERSION] = 1,
 };
 
 /* BGP-4 Multiprotocol Extentions lead us to the complex world. We can
@@ -167,7 +155,8 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
                                                "capabilityErrorMultiProtocolAfi",
                                                "L2VPN");
                                        break;
-                               default:
+                               case AFI_UNSPEC:
+                               case AFI_MAX:
                                        json_object_int_add(
                                                json_cap,
                                                "capabilityErrorMultiProtocolAfiUnknown",
@@ -217,7 +206,8 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
                                                "capabilityErrorMultiProtocolSafi",
                                                "flowspec");
                                        break;
-                               default:
+                               case SAFI_UNSPEC:
+                               case SAFI_MAX:
                                        json_object_int_add(
                                                json_cap,
                                                "capabilityErrorMultiProtocolSafiUnknown",
@@ -237,7 +227,8 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
                                case AFI_L2VPN:
                                        vty_out(vty, "AFI L2VPN, ");
                                        break;
-                               default:
+                               case AFI_UNSPEC:
+                               case AFI_MAX:
                                        vty_out(vty, "AFI Unknown %d, ",
                                                ntohs(mpc.afi));
                                        break;
@@ -264,7 +255,8 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
                                case SAFI_EVPN:
                                        vty_out(vty, "SAFI EVPN");
                                        break;
-                               default:
+                               case SAFI_UNSPEC:
+                               case SAFI_MAX:
                                        vty_out(vty, "SAFI Unknown %d ",
                                                mpc.safi);
                                        break;
@@ -917,6 +909,41 @@ static int bgp_capability_role(struct peer *peer, struct capability_header *hdr)
        return 0;
 }
 
+static int bgp_capability_software_version(struct peer *peer,
+                                          struct capability_header *hdr)
+{
+       struct stream *s = BGP_INPUT(peer);
+       char str[BGP_MAX_SOFT_VERSION + 1];
+       size_t end = stream_get_getp(s) + hdr->length;
+       uint8_t len;
+
+       SET_FLAG(peer->cap, PEER_CAP_SOFT_VERSION_RCV);
+
+       len = stream_getc(s);
+       if (stream_get_getp(s) + len > end) {
+               flog_warn(
+                       EC_BGP_CAPABILITY_INVALID_DATA,
+                       "%s: Received malformed Software Version capability from peer %s",
+                       __func__, peer->host);
+               return -1;
+       }
+
+       if (len) {
+               stream_get(str, s, len);
+               str[len] = '\0';
+
+               XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
+
+               peer->soft_version = XSTRDUP(MTYPE_BGP_SOFT_VERSION, str);
+
+               if (bgp_debug_neighbor_events(peer))
+                       zlog_debug("%s sent Software Version: %s", peer->host,
+                                  peer->soft_version);
+       }
+
+       return 0;
+}
+
 /**
  * Parse given capability.
  * XXX: This is reading into a stream, but not using stream API
@@ -985,6 +1012,7 @@ static int bgp_capability_parse(struct peer *peer, size_t length,
                case CAPABILITY_CODE_ENHANCED_RR:
                case CAPABILITY_CODE_EXT_MESSAGE:
                case CAPABILITY_CODE_ROLE:
+               case CAPABILITY_CODE_SOFT_VERSION:
                        /* Check length. */
                        if (caphdr.length < cap_minsizes[caphdr.code]) {
                                zlog_info(
@@ -1085,6 +1113,9 @@ static int bgp_capability_parse(struct peer *peer, size_t length,
                case CAPABILITY_CODE_ROLE:
                        ret = bgp_capability_role(peer, &caphdr);
                        break;
+               case CAPABILITY_CODE_SOFT_VERSION:
+                       ret = bgp_capability_software_version(peer, &caphdr);
+                       break;
                default:
                        if (caphdr.code > 128) {
                                /* We don't send Notification for unknown vendor
@@ -1924,6 +1955,50 @@ uint16_t bgp_open_capability(struct stream *s, struct peer *peer,
        bgp_peer_send_gr_capability(s, peer, ext_opt_params);
        bgp_peer_send_llgr_capability(s, peer, ext_opt_params);
 
+       /* Software Version capability
+        * An implementation is REQUIRED Extended Optional Parameters
+        * Length for BGP OPEN Message support as defined in [RFC9072].
+        * The inclusion of the Software Version Capability is OPTIONAL.
+        * If an implementation supports the inclusion of the capability,
+        * the implementation MUST include a configuration switch to enable
+        * or disable its use, and that switch MUST be off by default.
+        */
+       if (peergroup_flag_check(peer, PEER_FLAG_CAPABILITY_SOFT_VERSION) ||
+           peer->sort == BGP_PEER_IBGP) {
+               SET_FLAG(peer->cap, PEER_CAP_SOFT_VERSION_ADV);
+               stream_putc(s, BGP_OPEN_OPT_CAP);
+               rcapp = stream_get_endp(s);
+               ext_opt_params ? stream_putw(s, 0)
+                              : stream_putc(s, 0); /* Capability Length */
+               stream_putc(s, CAPABILITY_CODE_SOFT_VERSION);
+               capp = stream_get_endp(s);
+               stream_putc(s, 0); /* dummy placeholder len */
+
+               /* The Capability Length SHOULD be no greater than 64.
+                * This is the limit to allow other capabilities as much
+                * space as they require.
+                */
+               len = strlen(cmd_software_version_get());
+               if (len > BGP_MAX_SOFT_VERSION)
+                       len = BGP_MAX_SOFT_VERSION;
+
+               stream_putc(s, len);
+               stream_put(s, cmd_software_version_get(), len);
+
+               /* Software Version capability Len. */
+               len = stream_get_endp(s) - rcapp - 1;
+               ext_opt_params ? stream_putw_at(s, rcapp, len - 1)
+                              : stream_putc_at(s, rcapp, len);
+
+               /* Total Capability Len. */
+               len = stream_get_endp(s) - capp - 1;
+               stream_putc_at(s, capp, len);
+
+               if (bgp_debug_neighbor_events(peer))
+                       zlog_debug("%s Sending Software Version cap, value: %s",
+                                  peer->host, cmd_software_version_get());
+       }
+
        /* Total Opt Parm Len. */
        len = stream_get_endp(s) - cp - 1;
 
index 6be94443c80f818ea0a1b0d102d2497469700f85..7e3d07876ddbd07defcb6c1bcde6c6ebd4401cb5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP open message handling
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_OPEN_H
@@ -52,6 +37,7 @@ struct graceful_restart_af {
 #define CAPABILITY_CODE_ENHANCED_RR    70 /* Enhanced Route Refresh capability */
 #define CAPABILITY_CODE_LLGR           71 /* Long-lived Graceful Restart */
 #define CAPABILITY_CODE_FQDN           73 /* Advertise hostname capability */
+#define CAPABILITY_CODE_SOFT_VERSION   75 /* Software Version capability */
 #define CAPABILITY_CODE_ENHE            5 /* Extended Next Hop Encoding */
 #define CAPABILITY_CODE_REFRESH_OLD   128 /* Route Refresh Capability(cisco) */
 #define CAPABILITY_CODE_ORF_OLD       130 /* Cooperative Route Filtering Capability(cisco) */
@@ -72,6 +58,7 @@ struct graceful_restart_af {
 #define CAPABILITY_CODE_ORF_LEN         5
 #define CAPABILITY_CODE_EXT_MESSAGE_LEN 0 /* Extended Message Support */
 #define CAPABILITY_CODE_ROLE_LEN        1
+#define CAPABILITY_CODE_SOFT_VERSION_LEN 1
 
 /* Cooperative Route Filtering Capability.  */
 
index 080cf0ae40405ac1c05a6b4ef24d134f23d32ad7..93672d29f13dea6c6bfb18887614c651ba90d77b 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP packet management routine.
  * Contains utility functions for constructing and consuming BGP messages.
  * Copyright (C) 2017 Cumulus Networks
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1685,6 +1670,13 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
                        peer->v_keepalive = peer->bgp->default_keepalive;
        }
 
+       /* If another side disabled sending Software Version capability,
+        * we MUST drop the previous from showing in the outputs to avoid
+        * stale information and due to security reasons.
+        */
+       if (peer->soft_version)
+               XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
+
        /* Open option part parse. */
        if (optlen != 0) {
                if (bgp_open_option_parse(peer, optlen, &mp_capability) < 0)
index 9f6d772bc0a625354f7ce4bc6c2efdf38d841e94..2eb5693ae23578b7f4f6bc938f85f50489bbb49c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP packet management header.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_PACKET_H
index 807c4cd5a4a190f4257c9949d5eac344a0e13da4..7bced6cd334f9b0c732e335ebfc966642a57855b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP pbr
  * Copyright (C) 6WIND
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index 379ac40672fc0116dfc6cedfd5463da4c31ea9b0..ed143d9af70785299df2497bf3e931b7509c2fcb 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP pbr
  * Copyright (C) 6WIND
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __BGP_PBR_H__
 #define __BGP_PBR_H__
index b4bcbdb8046627c4ddf153a55fc7cf724e9a0edd..bb9f76b8a306e2ff561381ba0314fba133b1d658 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP RD definitions for BGP-based VPNs (IP/EVPN)
  * -- brought over from bgpd/bgp_mplsvpn.c
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -99,12 +83,12 @@ void decode_rd_vnc_eth(const uint8_t *pnt, struct rd_vnc_eth *rd_vnc_eth)
 
 int str2prefix_rd(const char *str, struct prefix_rd *prd)
 {
-       int ret = 0;
-       char *p;
-       char *p2;
+       int ret = 0, type = RD_TYPE_UNDEFINED;
+       char *p, *p2;
        struct stream *s = NULL;
        char *half = NULL;
        struct in_addr addr;
+       as_t as_val;
 
        prd->family = AF_UNSPEC;
        prd->prefixlen = 64;
@@ -113,41 +97,55 @@ int str2prefix_rd(const char *str, struct prefix_rd *prd)
        if (!p)
                goto out;
 
+       /* a second ':' is accepted */
+       p2 = strchr(p + 1, ':');
+       if (p2) {
+               /* type is in first part */
+               half = XMALLOC(MTYPE_TMP, (p - str) + 1);
+               memcpy(half, str, (p - str));
+               half[p - str] = '\0';
+               type = atoi(half);
+               if (type != RD_TYPE_AS && type != RD_TYPE_IP &&
+                   type != RD_TYPE_AS4)
+                       goto out;
+               XFREE(MTYPE_TMP, half);
+               half = XMALLOC(MTYPE_TMP, (p2 - p));
+               memcpy(half, p + 1, (p2 - p - 1));
+               half[p2 - p - 1] = '\0';
+               p = p2 + 1;
+       } else {
+               half = XMALLOC(MTYPE_TMP, (p - str) + 1);
+               memcpy(half, str, (p - str));
+               half[p - str] = '\0';
+       }
        if (!all_digit(p + 1))
                goto out;
 
        s = stream_new(RD_BYTES);
 
-       half = XMALLOC(MTYPE_TMP, (p - str) + 1);
-       memcpy(half, str, (p - str));
-       half[p - str] = '\0';
-
-       p2 = strchr(str, '.');
-
-       if (!p2) {
-               unsigned long as_val;
-
-               if (!all_digit(half))
-                       goto out;
-
-               as_val = atol(half);
-               if (as_val > 0xffff) {
+       /* if it is an AS format or an IP */
+       if (asn_str2asn(half, &as_val)) {
+               if (as_val > UINT16_MAX) {
                        stream_putw(s, RD_TYPE_AS4);
                        stream_putl(s, as_val);
                        stream_putw(s, atol(p + 1));
+                       if (type != RD_TYPE_UNDEFINED && type != RD_TYPE_AS4)
+                               goto out;
                } else {
                        stream_putw(s, RD_TYPE_AS);
                        stream_putw(s, as_val);
                        stream_putl(s, atol(p + 1));
+                       if (type != RD_TYPE_UNDEFINED && type != RD_TYPE_AS)
+                               goto out;
                }
-       } else {
-               if (!inet_aton(half, &addr))
-                       goto out;
-
+       } else if (inet_aton(half, &addr)) {
                stream_putw(s, RD_TYPE_IP);
                stream_put_in_addr(s, &addr);
                stream_putw(s, atol(p + 1));
-       }
+               if (type != RD_TYPE_UNDEFINED && type != RD_TYPE_IP)
+                       goto out;
+       } else
+               goto out;
        memcpy(prd->val, s->data, 8);
        ret = 1;
 
@@ -158,12 +156,14 @@ out:
        return ret;
 }
 
-char *prefix_rd2str(const struct prefix_rd *prd, char *buf, size_t size)
+char *prefix_rd2str(const struct prefix_rd *prd, char *buf, size_t size,
+                   enum asnotation_mode asnotation)
 {
        const uint8_t *pnt;
        uint16_t type;
        struct rd_as rd_as;
        struct rd_ip rd_ip;
+       int len = 0;
 
        assert(size >= RD_ADDRSTRLEN);
 
@@ -173,11 +173,15 @@ char *prefix_rd2str(const struct prefix_rd *prd, char *buf, size_t size)
 
        if (type == RD_TYPE_AS) {
                decode_rd_as(pnt + 2, &rd_as);
-               snprintf(buf, size, "%u:%u", rd_as.as, rd_as.val);
+               len += snprintfrr(buf + len, size - len, ASN_FORMAT(asnotation),
+                                 &rd_as.as);
+               snprintfrr(buf + len, size - len, ":%u", rd_as.val);
                return buf;
        } else if (type == RD_TYPE_AS4) {
                decode_rd_as4(pnt + 2, &rd_as);
-               snprintf(buf, size, "%u:%u", rd_as.as, rd_as.val);
+               len += snprintfrr(buf + len, size - len, ASN_FORMAT(asnotation),
+                                 &rd_as.as);
+               snprintfrr(buf + len, size - len, ":%u", rd_as.val);
                return buf;
        } else if (type == RD_TYPE_IP) {
                decode_rd_ip(pnt + 2, &rd_ip);
@@ -212,16 +216,38 @@ void form_auto_rd(struct in_addr router_id,
        (void)str2prefix_rd(buf, prd);
 }
 
-printfrr_ext_autoreg_p("RD", printfrr_prd);
-static ssize_t printfrr_prd(struct fbuf *buf, struct printfrr_eargs *ea,
-                           const void *ptr)
+static ssize_t printfrr_prd_asnotation(struct fbuf *buf,
+                                      struct printfrr_eargs *ea,
+                                      const void *ptr,
+                                      enum asnotation_mode asnotation)
 {
        char rd_buf[RD_ADDRSTRLEN];
 
        if (!ptr)
                return bputs(buf, "(null)");
 
-       prefix_rd2str(ptr, rd_buf, sizeof(rd_buf));
+       prefix_rd2str(ptr, rd_buf, sizeof(rd_buf), asnotation);
 
        return bputs(buf, rd_buf);
 }
+
+printfrr_ext_autoreg_p("RDP", printfrr_prd);
+static ssize_t printfrr_prd(struct fbuf *buf, struct printfrr_eargs *ea,
+                           const void *ptr)
+{
+       return printfrr_prd_asnotation(buf, ea, ptr, ASNOTATION_PLAIN);
+}
+
+printfrr_ext_autoreg_p("RDD", printfrr_prd_dot);
+static ssize_t printfrr_prd_dot(struct fbuf *buf, struct printfrr_eargs *ea,
+                               const void *ptr)
+{
+       return printfrr_prd_asnotation(buf, ea, ptr, ASNOTATION_DOT);
+}
+
+printfrr_ext_autoreg_p("RDE", printfrr_prd_dotplus);
+static ssize_t printfrr_prd_dotplus(struct fbuf *buf, struct printfrr_eargs *ea,
+                                   const void *ptr)
+{
+       return printfrr_prd_asnotation(buf, ea, ptr, ASNOTATION_DOTPLUS);
+}
index 2aee44c7214a81180f49414acbc3c59c0eb2de3a..e38c2fad3baf4355642b0eef950a2ef3294389c7 100644 (file)
@@ -1,29 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP RD definitions for BGP-based VPNs (IP/EVPN)
  * -- brought over from bgpd/bgp_mplsvpn.h
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _QUAGGA_BGP_RD_H
 #define _QUAGGA_BGP_RD_H
 
+#include "asn.h"
+#include "prefix.h"
+
 /* RD types */
+#define RD_TYPE_UNDEFINED (-1)
 #define RD_TYPE_AS      0
 #define RD_TYPE_IP      1
 #define RD_TYPE_AS4     2
 #define RD_ADDRSTRLEN  28
 #define RD_BYTES  8
 
+#define BGP_RD_AS_FORMAT(mode)                                                 \
+       ((mode == ASNOTATION_DOT)                                              \
+                ? "%pRDD"                                                     \
+                : ((mode == ASNOTATION_DOTPLUS) ? "%pRDE" : "%pRDP"))
+
+#define BGP_RD_AS_FORMAT_SPACE(mode)                                           \
+       ((mode == ASNOTATION_DOT)                                              \
+                ? "%-21pRDD"                                                  \
+                : ((mode == ASNOTATION_DOTPLUS) ? "%-21pRDE" : "%-21pRDP"))
+
 struct rd_as {
        uint16_t type;
        as_t as;
@@ -67,7 +65,8 @@ extern void decode_rd_vnc_eth(const uint8_t *pnt,
 #endif
 
 extern int str2prefix_rd(const char *, struct prefix_rd *);
-extern char *prefix_rd2str(const struct prefix_rd *, char *, size_t);
+extern char *prefix_rd2str(const struct prefix_rd *prd, char *buf, size_t size,
+                          enum asnotation_mode asnotation);
 extern void form_auto_rd(struct in_addr router_id, uint16_t rd_id,
                         struct prefix_rd *prd);
 
index 606568402aa1a65b375791a7cef7eb28a5580e78..68137a557d0cd245129b9cbb8908107cdcc30d95 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS regular expression routine
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index e07b7f911b9e09c114942b52bfad3c7c7fa29f77..c2607bc3c914f86ce814de8941a3dc02aa33b031 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* AS regular expression routine
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_REGEX_H
index 4c98ffcf090f350b206770c6a6bf2baf78aee12f..0beef97a040641e1fdaa620c4385934fe5533665 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP routing information
  * Copyright (C) 1996, 97, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2016 Job Snijders <job@instituut.net>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1213,9 +1198,18 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
                /* If one path has a label but the other does not, do not treat
                 * them as equals for multipath
                 */
-               if ((new->extra &&bgp_is_valid_label(&new->extra->label[0]))
-                   != (exist->extra
-                       && bgp_is_valid_label(&exist->extra->label[0]))) {
+               int newl, existl;
+
+               newl = existl = 0;
+
+               if (new->extra)
+                       newl = new->extra->num_labels;
+               if (exist->extra)
+                       existl = exist->extra->num_labels;
+               if (((new->extra &&bgp_is_valid_label(&new->extra->label[0])) !=
+                    (exist->extra &&
+                     bgp_is_valid_label(&exist->extra->label[0]))) ||
+                   (newl != existl)) {
                        if (debug)
                                zlog_debug(
                                        "%s: %s and %s cannot be multipath, one has a label while the other does not",
@@ -2658,9 +2652,12 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
                                continue;
                        if (BGP_PATH_HOLDDOWN(pi1))
                                continue;
-                       if (pi1->peer != bgp->peer_self)
+                       if (pi1->peer != bgp->peer_self &&
+                           !CHECK_FLAG(pi1->peer->sflags,
+                                       PEER_STATUS_NSF_WAIT)) {
                                if (!peer_established(pi1->peer))
                                        continue;
+                       }
 
                        new_select = pi1;
                        if (pi1->next) {
@@ -4456,8 +4453,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                                                bgp_evpn_unimport_route(
                                                        bgp, afi, safi, p, pi);
                                        else /* SAFI_MPLS_VPN */
-                                               vpn_leak_to_vrf_withdraw(bgp,
-                                                                        pi);
+                                               vpn_leak_to_vrf_withdraw(pi);
                                }
                        }
                }
@@ -4877,7 +4873,7 @@ filtered:
                if ((SAFI_MPLS_VPN == safi)
                    && (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)) {
 
-                       vpn_leak_to_vrf_withdraw(bgp, pi);
+                       vpn_leak_to_vrf_withdraw(pi);
                }
 
                bgp_rib_remove(dest, pi, peer, afi, safi);
@@ -4901,10 +4897,9 @@ filtered:
 }
 
 void bgp_withdraw(struct peer *peer, const struct prefix *p,
-                 uint32_t addpath_id, struct attr *attr, afi_t afi,
-                 safi_t safi, int type, int sub_type, struct prefix_rd *prd,
-                 mpls_label_t *label, uint32_t num_labels,
-                 struct bgp_route_evpn *evpn)
+                 uint32_t addpath_id, afi_t afi, safi_t safi, int type,
+                 int sub_type, struct prefix_rd *prd, mpls_label_t *label,
+                 uint32_t num_labels, struct bgp_route_evpn *evpn)
 {
        struct bgp *bgp;
        char pfx_buf[BGP_PRD_PATH_STRLEN];
@@ -4979,7 +4974,7 @@ void bgp_withdraw(struct peer *peer, const struct prefix *p,
                if ((SAFI_MPLS_VPN == safi)
                    && (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)) {
 
-                       vpn_leak_to_vrf_withdraw(bgp, pi);
+                       vpn_leak_to_vrf_withdraw(pi);
                }
        } else if (bgp_debug_update(peer, p, NULL, 1)) {
                bgp_debug_rdpfxpath2str(afi, safi, prd, p, label, num_labels,
@@ -5419,7 +5414,7 @@ static wq_item_status bgp_clear_route_node(struct work_queue *wq, void *data)
                        }
                        if (SAFI_MPLS_VPN == safi &&
                            bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
-                               vpn_leak_to_vrf_withdraw(bgp, pi);
+                               vpn_leak_to_vrf_withdraw(pi);
                        }
 
                        bgp_rib_remove(dest, pi, peer, afi, safi);
@@ -5688,8 +5683,7 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi)
                                                    BGP_ROUTE_IMPORTED &&
                                            peer->bgp->inst_type ==
                                                    BGP_INSTANCE_TYPE_DEFAULT)
-                                               vpn_leak_to_vrf_withdraw(
-                                                       peer->bgp, pi);
+                                               vpn_leak_to_vrf_withdraw(pi);
 
                                        bgp_rib_remove(rm, pi, peer, afi, safi);
                                        break;
@@ -6051,7 +6045,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
                                   ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
                                   NULL, 0, 0, NULL);
                else
-                       bgp_withdraw(peer, &p, addpath_id, attr, afi, safi,
+                       bgp_withdraw(peer, &p, addpath_id, afi, safi,
                                     ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
                                     NULL, 0, NULL);
 
@@ -6083,6 +6077,8 @@ static void bgp_static_free(struct bgp_static *bgp_static)
        XFREE(MTYPE_ROUTE_MAP_NAME, bgp_static->rmap.name);
        route_map_counter_decrement(bgp_static->rmap.map);
 
+       if (bgp_static->prd_pretty)
+               XFREE(MTYPE_BGP, bgp_static->prd_pretty);
        XFREE(MTYPE_ATTR, bgp_static->eth_s_id);
        XFREE(MTYPE_BGP_STATIC, bgp_static);
 }
@@ -6384,7 +6380,7 @@ static void bgp_static_withdraw_safi(struct bgp *bgp, const struct prefix *p,
 #endif
                if (SAFI_MPLS_VPN == safi
                    && bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
-                       vpn_leak_to_vrf_withdraw(bgp, pi);
+                       vpn_leak_to_vrf_withdraw(pi);
                }
                bgp_aggregate_decrement(bgp, p, pi, afi, safi);
                bgp_path_info_delete(dest, pi);
@@ -6986,6 +6982,8 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
                bgp_static->label = label;
                bgp_static->prd = prd;
 
+               if (rd_str)
+                       bgp_static->prd_pretty = XSTRDUP(MTYPE_BGP, rd_str);
                if (rmap_str) {
                        XFREE(MTYPE_ROUTE_MAP_NAME, bgp_static->rmap.name);
                        route_map_counter_decrement(bgp_static->rmap.map);
@@ -7248,7 +7246,7 @@ static bool aggr_suppress_map_test(struct bgp *bgp,
                return false;
 
        /* Call route map matching and return result. */
-       attr.aspath = aspath_empty();
+       attr.aspath = aspath_empty(bgp->asnotation);
        rmap_path.peer = bgp->peer_self;
        rmap_path.attr = &attr;
 
@@ -7342,9 +7340,12 @@ static bool bgp_aggregate_info_same(struct bgp_path_info *pi, uint8_t origin,
                                    struct lcommunity *lcomm)
 {
        static struct aspath *ae = NULL;
+       enum asnotation_mode asnotation;
+
+       asnotation = bgp_get_asnotation(NULL);
 
        if (!ae)
-               ae = aspath_empty();
+               ae = aspath_empty(asnotation);
 
        if (!pi)
                return false;
@@ -10259,10 +10260,11 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
                if (dest && dest->pdest) {
                        pdest = dest->pdest;
                        if (is_pi_family_evpn(parent_ri)) {
-                               vty_out(vty,
-                                       "  Imported from %pRD:%pFX, VNI %s",
+                               vty_out(vty, "  Imported from ");
+                               vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation),
                                        (struct prefix_rd *)bgp_dest_get_prefix(
-                                               pdest),
+                                               pdest));
+                               vty_out(vty, ":%pFX, VNI %s",
                                        (struct prefix_evpn *)
                                                bgp_dest_get_prefix(dest),
                                        tag_buf);
@@ -10275,12 +10277,15 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
                                                        : "inactive");
                                vty_out(vty, "\n");
 
-                       } else
-                               vty_out(vty, "  Imported from %pRD:%pFX\n",
+                       } else {
+                               vty_out(vty, "  Imported from ");
+                               vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation),
                                        (struct prefix_rd *)bgp_dest_get_prefix(
-                                               pdest),
+                                               pdest));
+                               vty_out(vty, ":%pFX\n",
                                        (struct prefix_evpn *)
                                                bgp_dest_get_prefix(dest));
+                       }
                }
        }
 
@@ -11189,17 +11194,26 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                        vty_out(vty, "{\n");
                        *json_header_depth = 2;
                }
-
                vty_out(vty,
                        " \"vrfId\": %d,\n \"vrfName\": \"%s\",\n \"tableVersion\": %" PRId64
                        ",\n \"routerId\": \"%pI4\",\n \"defaultLocPrf\": %u,\n"
-                       " \"localAS\": %u,\n \"routes\": { ",
+                       " \"localAS\": ",
                        bgp->vrf_id == VRF_UNKNOWN ? -1 : (int)bgp->vrf_id,
                        bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT
                                ? VRF_DEFAULT_NAME
                                : bgp->name,
                        table->version, &bgp->router_id,
-                       bgp->default_local_pref, bgp->as);
+                       bgp->default_local_pref);
+               if ((bgp->asnotation == ASNOTATION_PLAIN) ||
+                   ((bgp->asnotation == ASNOTATION_DOT) &&
+                    (bgp->as < UINT16_MAX)))
+                       vty_out(vty, "%u", bgp->as);
+               else {
+                       vty_out(vty, "\"");
+                       vty_out(vty, ASN_FORMAT(bgp->asnotation), &bgp->as);
+                       vty_out(vty, "\"");
+               }
+               vty_out(vty, ",\n \"routes\": { ");
                if (rd) {
                        vty_out(vty, " \"routeDistinguishers\" : {");
                        ++*json_header_depth;
@@ -11221,7 +11235,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
        for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest)) {
                const struct prefix *dest_p = bgp_dest_get_prefix(dest);
                enum rpki_states rpki_curr_state = RPKI_NOT_BEING_USED;
-               bool json_detail = json_detail_header;
+               bool json_detail_header_used = false;
 
                pi = bgp_dest_get_bgp_path_info(dest);
                if (pi == NULL)
@@ -11460,6 +11474,10 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                    || CHECK_FLAG(pi->flags, BGP_PATH_HISTORY))
                                        continue;
                        }
+                       if (type == bgp_show_type_self_originated) {
+                               if (pi->peer != bgp->peer_self)
+                                       continue;
+                       }
 
                        if (!use_json && header) {
                                vty_out(vty,
@@ -11473,7 +11491,10 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                vty_out(vty, "\n");
                                vty_out(vty, "Default local pref %u, ",
                                        bgp->default_local_pref);
-                               vty_out(vty, "local AS %u\n", bgp->as);
+                               vty_out(vty, "local AS ");
+                               vty_out(vty, ASN_FORMAT(bgp->asnotation),
+                                       &bgp->as);
+                               vty_out(vty, "\n");
                                if (!detail_routes) {
                                        vty_out(vty, BGP_SHOW_SCODE_HEADER);
                                        vty_out(vty, BGP_SHOW_NCODE_HEADER);
@@ -11491,27 +11512,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                                           : BGP_SHOW_HEADER));
                                header = false;
 
-                       } else if (json_detail && json_paths != NULL) {
-                               const struct prefix_rd *prd;
-                               json_object *jtemp;
-
-                               /* Use common detail header, for most types;
-                                * need a json 'object'.
-                                */
-
-                               jtemp = json_object_new_object();
-                               prd = bgp_rd_from_dest(dest, safi);
-
-                               route_vty_out_detail_header(
-                                       vty, bgp, dest,
-                                       bgp_dest_get_prefix(dest), prd,
-                                       table->afi, safi, jtemp);
-
-                               json_object_array_add(json_paths, jtemp);
-
-                               json_detail = false;
                        }
-
                        if (rd != NULL && !display && !output_count) {
                                if (!use_json)
                                        vty_out(vty,
@@ -11542,7 +11543,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                                        bgp_dest_get_prefix(
                                                                dest),
                                                        prd, table->afi, safi,
-                                                       NULL);
+                                                       NULL, false);
 
                                        route_vty_out_detail(
                                                vty, bgp, dest, dest_p, pi,
@@ -11588,6 +11589,23 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                else
                                        vty_out(vty, ",\"%pFX\": ", dest_p);
                        }
+
+                       if (json_detail_header && json_paths != NULL) {
+                               const struct prefix_rd *prd;
+
+                               vty_out(vty, "{\n");
+
+                               prd = bgp_rd_from_dest(dest, safi);
+
+                               route_vty_out_detail_header(
+                                       vty, bgp, dest,
+                                       bgp_dest_get_prefix(dest), prd,
+                                       table->afi, safi, json_paths, true);
+
+                               vty_out(vty, "\"paths\": ");
+                               json_detail_header_used = true;
+                       }
+
                        /*
                         * We are using no_pretty here because under
                         * extremely high settings( say lots and lots of
@@ -11598,6 +11616,10 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                         * routers out there
                         */
                        vty_json_no_pretty(vty, json_paths);
+
+                       if (json_detail_header_used)
+                               vty_out(vty, "} ");
+
                        json_paths = NULL;
                        first = 0;
                } else
@@ -11669,7 +11691,7 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
                        char rd[RD_ADDRSTRLEN];
 
                        memcpy(&prd, dest_p, sizeof(struct prefix_rd));
-                       prefix_rd2str(&prd, rd, sizeof(rd));
+                       prefix_rd2str(&prd, rd, sizeof(rd), bgp->asnotation);
                        bgp_show_table(vty, bgp, safi, itable, type, output_arg,
                                       rd, next == NULL, &output_cum,
                                       &total_cum, &json_header_depth,
@@ -11782,7 +11804,8 @@ static void bgp_show_all_instances_routes_vty(struct vty *vty, afi_t afi,
 void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
                                 struct bgp_dest *dest, const struct prefix *p,
                                 const struct prefix_rd *prd, afi_t afi,
-                                safi_t safi, json_object *json)
+                                safi_t safi, json_object *json,
+                                bool incremental_print)
 {
        struct bgp_path_info *pi;
        struct peer *peer;
@@ -11819,13 +11842,16 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
        if (safi == SAFI_EVPN) {
                if (!json) {
                        vty_out(vty, "BGP routing table entry for %s%s%pFX\n",
-                               prd ? prefix_rd2str(prd, buf1, sizeof(buf1))
+                               prd ? prefix_rd2str(prd, buf1, sizeof(buf1),
+                                                   bgp->asnotation)
                                    : "",
                                prd ? ":" : "", (struct prefix_evpn *)p);
                } else {
-                       json_object_string_add(json, "rd",
-                               prd ? prefix_rd2str(prd, buf1, sizeof(buf1)) :
-                               "");
+                       json_object_string_add(
+                               json, "rd",
+                               prd ? prefix_rd2str(prd, buf1, sizeof(buf1),
+                                                   bgp->asnotation)
+                                   : "");
                        bgp_evpn_route2json((struct prefix_evpn *)p, json);
                }
        } else {
@@ -11835,22 +11861,34 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
                                "\n",
                                ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)
                                         ? prefix_rd2str(prd, buf1,
-                                                        sizeof(buf1))
+                                                        sizeof(buf1),
+                                                        bgp->asnotation)
                                         : ""),
                                safi == SAFI_MPLS_VPN ? ":" : "", p,
                                dest->version);
 
                } else {
-                       json_object_string_addf(json, "prefix", "%pFX", p);
-                       json_object_int_add(json, "version", dest->version);
-
+                       if (incremental_print) {
+                               vty_out(vty, "\"prefix\": \"%pFX\",\n", p);
+                               vty_out(vty, "\"version\": \"%" PRIu64 "\",\n",
+                                       dest->version);
+                       } else {
+                               json_object_string_addf(json, "prefix", "%pFX",
+                                                       p);
+                               json_object_int_add(json, "version",
+                                                   dest->version);
+                       }
                }
        }
 
        if (has_valid_label) {
-               if (json)
-                       json_object_int_add(json, "localLabel", label);
-               else
+               if (json) {
+                       if (incremental_print)
+                               vty_out(vty, "\"localLabel\": \"%u\",\n",
+                                       label);
+                       else
+                               json_object_int_add(json, "localLabel", label);
+               } else
                        vty_out(vty, "Local label: %d\n", label);
        }
 
@@ -11974,13 +12012,16 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
                        }
                }
 
-               if (json) {
-                       if (json_adv_to) {
+               if (json && json_adv_to) {
+                       if (incremental_print) {
+                               vty_out(vty, "\"advertisedTo\": ");
+                               vty_json(vty, json_adv_to);
+                               vty_out(vty, ",");
+                       } else
                                json_object_object_add(json, "advertisedTo",
                                                       json_adv_to);
-                       }
                } else {
-                       if (first)
+                       if (!json && first)
                                vty_out(vty, "  Not advertised to any peer");
                        vty_out(vty, "\n");
                }
@@ -12023,7 +12064,7 @@ static void bgp_show_path_info(const struct prefix_rd *pfx_rd,
                        route_vty_out_detail_header(
                                vty, bgp, bgp_node,
                                bgp_dest_get_prefix(bgp_node), pfx_rd, AFI_IP,
-                               safi, json_header);
+                               safi, json_header, false);
                        header = 0;
                }
                (*display)++;
@@ -12044,8 +12085,9 @@ static void bgp_show_path_info(const struct prefix_rd *pfx_rd,
                json_object_object_add(json_header, "paths", json_paths);
 
                if (pfx_rd)
-                       json_object_object_addf(json, json_header, "%pRD",
-                                               pfx_rd);
+                       json_object_object_addf(
+                               json, json_header,
+                               BGP_RD_AS_FORMAT(bgp->asnotation), pfx_rd);
        }
 }
 
@@ -12060,9 +12102,16 @@ const struct prefix_rd *bgp_rd_from_dest(const struct bgp_dest *dest,
        case SAFI_ENCAP:
        case SAFI_EVPN:
                return (struct prefix_rd *)(bgp_dest_get_prefix(dest));
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_UNICAST:
+       case SAFI_MULTICAST:
+       case SAFI_LABELED_UNICAST:
+       case SAFI_FLOWSPEC:
+       case SAFI_MAX:
                return NULL;
        }
+
+       assert(!"Reached end of function when we were not expecting it");
 }
 
 /* Display specified route of BGP table. */
@@ -12605,6 +12654,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
           |alias ALIAS_NAME\
           |A.B.C.D/M longer-prefixes\
           |X:X::X:X/M longer-prefixes\
+          |"BGP_SELF_ORIG_CMD_STR"\
           |detail-routes$detail_routes\
           ] [json$uj [detail$detail_json] | wide$wide]",
       SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
@@ -12654,6 +12704,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
       "Display route and more specific routes\n"
       "IPv6 prefix\n"
       "Display route and more specific routes\n"
+      BGP_SELF_ORIG_HELP_STR
       "Display detailed version of all routes\n"
       JSON_STR
       "Display detailed version of JSON output\n"
@@ -12848,6 +12899,10 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
                output_arg = &p;
        }
 
+       /* self originated only */
+       if (argv_find(argv, argc, BGP_SELF_ORIG_CMD_STR, &idx))
+               sh_type = bgp_show_type_self_originated;
+
        if (!all) {
                /* show bgp: AFI_IP6, show ip bgp: AFI_IP */
                if (community)
@@ -13287,7 +13342,8 @@ static void bgp_table_stats_walker(struct thread *t)
        case AFI_L2VPN:
                space = EVPN_ROUTE_PREFIXLEN;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_MAX:
                return;
        }
 
@@ -13542,7 +13598,8 @@ static int bgp_table_stats_single(struct vty *vty, struct bgp *bgp, afi_t afi,
        case AFI_L2VPN:
                bitlen = EVPN_ROUTE_PREFIXLEN;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_MAX:
                break;
        }
 
@@ -13969,16 +14026,17 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
               const char *rmap_name, json_object *json, json_object *json_ar,
               json_object *json_scode, json_object *json_ocode,
               uint16_t show_flags, int *header1, int *header2, char *rd_str,
-              unsigned long *output_count, unsigned long *filtered_count)
+              const struct prefix *match, unsigned long *output_count,
+              unsigned long *filtered_count)
 {
-       struct bgp_adj_in *ain;
-       struct bgp_adj_out *adj;
+       struct bgp_adj_in *ain = NULL;
+       struct bgp_adj_out *adj = NULL;
        struct bgp_dest *dest;
        struct bgp *bgp;
        struct attr attr;
        int ret;
        struct update_subgroup *subgrp;
-       struct peer_af *paf;
+       struct peer_af *paf = NULL;
        bool route_filtered;
        bool detail = CHECK_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
        bool use_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON);
@@ -13992,6 +14050,98 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
 
        bgp = peer->bgp;
 
+       /* If the user supplied a prefix, look for a matching route instead
+        * of walking the whole table.
+        */
+       if (match) {
+               dest = bgp_node_match(table, match);
+               if (!dest) {
+                       if (!use_json)
+                               vty_out(vty, "Network not in table\n");
+                       return;
+               }
+
+               const struct prefix *rn_p = bgp_dest_get_prefix(dest);
+
+               if (rn_p->prefixlen != match->prefixlen) {
+                       if (!use_json)
+                               vty_out(vty, "Network not in table\n");
+                       bgp_dest_unlock_node(dest);
+                       return;
+               }
+
+               if (type == bgp_show_adj_route_received ||
+                   type == bgp_show_adj_route_filtered) {
+                       for (ain = dest->adj_in; ain; ain = ain->next) {
+                               if (ain->peer == peer) {
+                                       attr = *ain->attr;
+                                       break;
+                               }
+                       }
+                       /* bail out if if adj_out is empty, or
+                        * if the prefix isn't in this peer's
+                        * adj_in
+                        */
+                       if (!ain || ain->peer != peer) {
+                               if (!use_json)
+                                       vty_out(vty, "Network not in table\n");
+                               bgp_dest_unlock_node(dest);
+                               return;
+                       }
+               } else if (type == bgp_show_adj_route_advertised) {
+                       bool peer_found = false;
+
+                       RB_FOREACH (adj, bgp_adj_out_rb, &dest->adj_out) {
+                               SUBGRP_FOREACH_PEER (adj->subgroup, paf) {
+                                       if (paf->peer == peer && adj->attr) {
+                                               attr = *adj->attr;
+                                               peer_found = true;
+                                               break;
+                                       }
+                               }
+                               if (peer_found)
+                                       break;
+                       }
+                       /* bail out if if adj_out is empty, or
+                        * if the prefix isn't in this peer's
+                        * adj_out
+                        */
+                       if (!paf || !peer_found) {
+                               if (!use_json)
+                                       vty_out(vty, "Network not in table\n");
+                               bgp_dest_unlock_node(dest);
+                               return;
+                       }
+               }
+
+               ret = bgp_output_modifier(peer, rn_p, &attr, afi, safi,
+                                         rmap_name);
+
+               if (ret != RMAP_DENY) {
+                       show_adj_route_header(vty, peer, table, header1,
+                                             header2, json, json_scode,
+                                             json_ocode, wide, detail);
+
+                       if (use_json)
+                               json_net = json_object_new_object();
+
+                       bgp_show_path_info(NULL /* prefix_rd */, dest, vty, bgp,
+                                          afi, safi, json_net,
+                                          BGP_PATH_SHOW_ALL, &display,
+                                          RPKI_NOT_BEING_USED);
+                       if (use_json)
+                               json_object_object_addf(json_ar, json_net,
+                                                       "%pFX", rn_p);
+                       (*output_count)++;
+               } else
+                       (*filtered_count)++;
+
+               bgp_attr_flush(&attr);
+               bgp_dest_unlock_node(dest);
+               return;
+       }
+
+
        subgrp = peer_subgroup(peer, afi, safi);
 
        if (type == bgp_show_adj_route_advertised && subgrp
@@ -14192,6 +14342,8 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
                                              header2, json, json_scode,
                                              json_ocode, wide, detail);
 
+                       const struct prefix *rn_p = bgp_dest_get_prefix(dest);
+
                        for (pi = bgp_dest_get_bgp_path_info(dest); pi;
                             pi = pi->next) {
                                if (pi->peer != peer)
@@ -14200,10 +14352,23 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
                                if (!CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
                                        continue;
 
-                               route_vty_out_tmp(vty, dest,
-                                                 bgp_dest_get_prefix(dest),
-                                                 pi->attr, safi, use_json,
-                                                 json_ar, wide);
+                               if (detail) {
+                                       if (use_json)
+                                               json_net =
+                                                       json_object_new_object();
+                                       bgp_show_path_info(
+                                               NULL /* prefix_rd */, dest, vty,
+                                               bgp, afi, safi, json_net,
+                                               BGP_PATH_SHOW_BESTPATH,
+                                               &display, RPKI_NOT_BEING_USED);
+                                       if (use_json)
+                                               json_object_object_addf(
+                                                       json_ar, json_net,
+                                                       "%pFX", rn_p);
+                               } else
+                                       route_vty_out_tmp(
+                                               vty, dest, rn_p, pi->attr, safi,
+                                               use_json, json_ar, wide);
                                (*output_count)++;
                        }
                }
@@ -14212,7 +14377,8 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
 
 static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi,
                           safi_t safi, enum bgp_show_adj_route_type type,
-                          const char *rmap_name, uint16_t show_flags)
+                          const char *rmap_name, const struct prefix *match,
+                          uint16_t show_flags)
 {
        struct bgp *bgp;
        struct bgp_table *table;
@@ -14336,13 +14502,14 @@ CPP_NOTICE("Drop `bgpOriginCodes` from JSON outputs")
                        prd = (const struct prefix_rd *)bgp_dest_get_prefix(
                                dest);
 
-                       prefix_rd2str(prd, rd_str, sizeof(rd_str));
+                       prefix_rd2str(prd, rd_str, sizeof(rd_str),
+                                     bgp->asnotation);
 
-                       show_adj_route(vty, peer, table, afi, safi, type,
-                                      rmap_name, json, json_routes, json_scode,
-                                      json_ocode, show_flags, &header1,
-                                      &header2, rd_str, &output_count_per_rd,
-                                      &filtered_count_per_rd);
+                       show_adj_route(
+                               vty, peer, table, afi, safi, type, rmap_name,
+                               json, json_routes, json_scode, json_ocode,
+                               show_flags, &header1, &header2, rd_str, match,
+                               &output_count_per_rd, &filtered_count_per_rd);
 
                        /* Don't include an empty RD in the output! */
                        if (json_routes && (output_count_per_rd > 0))
@@ -14355,7 +14522,7 @@ CPP_NOTICE("Drop `bgpOriginCodes` from JSON outputs")
        } else
                show_adj_route(vty, peer, table, afi, safi, type, rmap_name,
                               json, json_ar, json_scode, json_ocode,
-                              show_flags, &header1, &header2, rd_str,
+                              show_flags, &header1, &header2, rd_str, match,
                               &output_count, &filtered_count);
 
        if (use_json) {
@@ -14380,7 +14547,7 @@ CPP_NOTICE("Drop `bgpOriginCodes` from JSON outputs")
 
                vty_json(vty, json);
        } else if (output_count > 0) {
-               if (filtered_count > 0)
+               if (!match && filtered_count > 0)
                        vty_out(vty,
                                "\nTotal number of prefixes %ld (%ld filtered)\n",
                                output_count, filtered_count);
@@ -14394,7 +14561,7 @@ CPP_NOTICE("Drop `bgpOriginCodes` from JSON outputs")
 
 DEFPY (show_ip_bgp_instance_neighbor_bestpath_route,
        show_ip_bgp_instance_neighbor_bestpath_route_cmd,
-       "show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]] neighbors <A.B.C.D|X:X::X:X|WORD> bestpath-routes [json$uj | wide$wide]",
+       "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR " [" BGP_SAFI_WITH_LABEL_CMD_STR "]] neighbors <A.B.C.D|X:X::X:X|WORD> bestpath-routes [detail$detail] [json$uj | wide$wide]",
        SHOW_STR
        IP_STR
        BGP_STR
@@ -14406,6 +14573,7 @@ DEFPY (show_ip_bgp_instance_neighbor_bestpath_route,
        "Neighbor to display information about\n"
        "Neighbor on BGP configured interface\n"
        "Display the routes selected by best path\n"
+       "Display detailed version of routes\n"
        JSON_STR
        "Increase table width for longer prefixes\n")
 {
@@ -14419,6 +14587,9 @@ DEFPY (show_ip_bgp_instance_neighbor_bestpath_route,
        int idx = 0;
        uint16_t show_flags = 0;
 
+       if (detail)
+               SET_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
+
        if (uj)
                SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
 
@@ -14438,13 +14609,13 @@ DEFPY (show_ip_bgp_instance_neighbor_bestpath_route,
        if (!peer)
                return CMD_WARNING;
 
-       return peer_adj_routes(vty, peer, afi, safi, type, rmap_name,
+       return peer_adj_routes(vty, peer, afi, safi, type, rmap_name, NULL,
                               show_flags);
 }
 
 DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
       show_ip_bgp_instance_neighbor_advertised_route_cmd,
-      "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR " [" BGP_SAFI_WITH_LABEL_CMD_STR "]] [all$all] neighbors <A.B.C.D|X:X::X:X|WORD> <advertised-routes|received-routes|filtered-routes> [route-map RMAP_NAME$route_map] [detail$detail] [json$uj | wide$wide]",
+      "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR " [" BGP_SAFI_WITH_LABEL_CMD_STR "]] [all$all] neighbors <A.B.C.D|X:X::X:X|WORD> <advertised-routes|received-routes|filtered-routes> [route-map RMAP_NAME$route_map] [<A.B.C.D/M|X:X::X:X/M>$prefix | detail$detail] [json$uj | wide$wide]",
       SHOW_STR
       IP_STR
       BGP_STR
@@ -14461,6 +14632,8 @@ DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
       "Display the filtered routes received from neighbor\n"
       "Route-map to modify the attributes\n"
       "Name of the route map\n"
+      "IPv4 prefix\n"
+      "IPv6 prefix\n"
       "Display detailed version of routes\n"
       JSON_STR
       "Increase table width for longer prefixes\n")
@@ -14477,7 +14650,7 @@ DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
        struct listnode *node;
        struct bgp *abgp;
 
-       if (detail)
+       if (detail || prefix_str)
                SET_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
 
        if (uj) {
@@ -14519,7 +14692,7 @@ DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
 
        if (!all)
                return peer_adj_routes(vty, peer, afi, safi, type, route_map,
-                                      show_flags);
+                                      prefix_str ? prefix : NULL, show_flags);
        if (uj)
                vty_out(vty, "{\n");
 
@@ -14547,7 +14720,7 @@ DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
                                                                 false));
 
                                peer_adj_routes(vty, peer, afi, safi, type,
-                                               route_map, show_flags);
+                                               route_map, prefix, show_flags);
                        }
                }
        } else {
@@ -14571,7 +14744,7 @@ DEFPY(show_ip_bgp_instance_neighbor_advertised_route,
                                                                 false));
 
                                peer_adj_routes(vty, peer, afi, safi, type,
-                                               route_map, show_flags);
+                                               route_map, prefix, show_flags);
                        }
                }
        }
@@ -15459,7 +15632,6 @@ static void bgp_config_write_network_vpn(struct vty *vty, struct bgp *bgp,
        struct bgp_dest *dest;
        struct bgp_table *table;
        const struct prefix *p;
-       const struct prefix_rd *prd;
        struct bgp_static *bgp_static;
        mpls_label_t label;
 
@@ -15477,13 +15649,12 @@ static void bgp_config_write_network_vpn(struct vty *vty, struct bgp *bgp,
                                continue;
 
                        p = bgp_dest_get_prefix(dest);
-                       prd = (const struct prefix_rd *)bgp_dest_get_prefix(
-                               pdest);
 
                        /* "network" configuration display.  */
                        label = decode_label(&bgp_static->label);
 
-                       vty_out(vty, "  network %pFX rd %pRD", p, prd);
+                       vty_out(vty, "  network %pFX rd %s", p,
+                               bgp_static->prd_pretty);
                        if (safi == SAFI_MPLS_VPN)
                                vty_out(vty, " label %u", label);
 
@@ -15506,7 +15677,6 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp,
        struct bgp_dest *dest;
        struct bgp_table *table;
        const struct prefix *p;
-       const struct prefix_rd *prd;
        struct bgp_static *bgp_static;
        char buf[PREFIX_STRLEN * 2];
        char buf2[SU_ADDRSTRLEN];
@@ -15534,7 +15704,6 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp,
                                esi_to_str(bgp_static->eth_s_id,
                                                esi_buf, sizeof(esi_buf));
                        p = bgp_dest_get_prefix(dest);
-                       prd = (struct prefix_rd *)bgp_dest_get_prefix(pdest);
 
                        /* "network" configuration display.  */
                        if (p->u.prefix_evpn.route_type == 5) {
@@ -15561,8 +15730,9 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp,
                                          &bgp_static->gatewayIp.u.prefix, buf2,
                                          sizeof(buf2));
                        vty_out(vty,
-                               "  network %s rd %pRD ethtag %u label %u esi %s gwip %s routermac %s\n",
-                               buf, prd, p->u.prefix_evpn.prefix_addr.eth_tag,
+                               "  network %s rd %s ethtag %u label %u esi %s gwip %s routermac %s\n",
+                               buf, bgp_static->prd_pretty,
+                               p->u.prefix_evpn.prefix_addr.eth_tag,
                                decode_label(&bgp_static->label), esi_buf, buf2,
                                macrouter);
 
index 452282926fc9fe3ef3a4242068ce3fc63dcb2f0c..d0cf7e5d7731da3347fc6f6fc26f485bd8f83da5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP routing information base
  * Copyright (C) 1996, 97, 98, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ROUTE_H
@@ -61,6 +46,7 @@ enum bgp_show_type {
        bgp_show_type_detail,
        bgp_show_type_rpki,
        bgp_show_type_prefix_version,
+       bgp_show_type_self_originated,
 };
 
 enum bgp_show_adj_route_type {
@@ -370,6 +356,7 @@ struct bgp_static {
 
        /* Route Distinguisher */
        struct prefix_rd prd;
+       char *prd_pretty;
 
        /* MPLS label.  */
        mpls_label_t label;
@@ -757,10 +744,10 @@ extern void bgp_update(struct peer *peer, const struct prefix *p,
                       uint32_t num_labels, int soft_reconfig,
                       struct bgp_route_evpn *evpn);
 extern void bgp_withdraw(struct peer *peer, const struct prefix *p,
-                        uint32_t addpath_id, struct attr *attr, afi_t afi,
-                        safi_t safi, int type, int sub_type,
-                        struct prefix_rd *prd, mpls_label_t *label,
-                        uint32_t num_labels, struct bgp_route_evpn *evpn);
+                        uint32_t addpath_id, afi_t afi, safi_t safi, int type,
+                        int sub_type, struct prefix_rd *prd,
+                        mpls_label_t *label, uint32_t num_labels,
+                        struct bgp_route_evpn *evpn);
 
 /* for bgp_nexthop and bgp_damp */
 extern void bgp_process(struct bgp *, struct bgp_dest *, afi_t, safi_t);
@@ -857,7 +844,8 @@ extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
                                        struct bgp_dest *dest,
                                        const struct prefix *p,
                                        const struct prefix_rd *prd, afi_t afi,
-                                       safi_t safi, json_object *json);
+                                       safi_t safi, json_object *json,
+                                       bool incremental_print);
 extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
                                 struct bgp_dest *bn, const struct prefix *p,
                                 struct bgp_path_info *path, afi_t afi,
index d00bdd2571a2c835845596fe1b3f2fccbac0fce6..8fd46d00af771347c1648d61f29588c3d78d0a5d 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Route map function of bgpd.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -228,7 +213,7 @@ static void *route_aspath_compile(const char *arg)
 {
        struct aspath *aspath;
 
-       aspath = aspath_str2aspath(arg);
+       aspath = aspath_str2aspath(arg, bgp_get_asnotation(NULL));
        if (!aspath)
                return NULL;
        return aspath;
@@ -475,8 +460,13 @@ route_match_ip_address(void *rule, const struct prefix *prefix, void *object)
 
        if (prefix->family == AF_INET) {
                alist = access_list_lookup(AFI_IP, (char *)rule);
-               if (alist == NULL)
+               if (alist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
                        return RMAP_NOMATCH;
+               }
 
                return (access_list_apply(alist, prefix) == FILTER_DENY
                                ? RMAP_NOMATCH
@@ -489,6 +479,13 @@ route_match_ip_address(void *rule, const struct prefix *prefix, void *object)
    access-list name. */
 static void *route_match_ip_address_compile(const char *arg)
 {
+       struct access_list *alist;
+
+       alist = access_list_lookup(AFI_IP, arg);
+       if (!alist)
+               zlog_warn(
+                       "Access List specified %s does not exist yet, default will be NO_MATCH until it is created",
+                       arg);
        return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
@@ -506,7 +503,7 @@ static const struct route_map_rule_cmd route_match_ip_address_cmd = {
        route_match_ip_address_free
 };
 
-/* `match ip next-hop IP_ADDRESS' */
+/* `match ip next-hop <IP_ADDRESS_ACCESS_LIST_NAME>' */
 
 /* Match function return 1 if match is success else return zero. */
 static enum route_map_cmd_result_t
@@ -523,8 +520,14 @@ route_match_ip_next_hop(void *rule, const struct prefix *prefix, void *object)
                p.prefixlen = IPV4_MAX_BITLEN;
 
                alist = access_list_lookup(AFI_IP, (char *)rule);
-               if (alist == NULL)
+               if (alist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
+
                        return RMAP_NOMATCH;
+               }
 
                return (access_list_apply(alist, &p) == FILTER_DENY
                                ? RMAP_NOMATCH
@@ -577,8 +580,14 @@ route_match_ip_route_source(void *rule, const struct prefix *pfx, void *object)
                p.prefixlen = IPV4_MAX_BITLEN;
 
                alist = access_list_lookup(AFI_IP, (char *)rule);
-               if (alist == NULL)
+               if (alist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
+
                        return RMAP_NOMATCH;
+               }
 
                return (access_list_apply(alist, &p) == FILTER_DENY
                                ? RMAP_NOMATCH
@@ -666,8 +675,13 @@ route_match_address_prefix_list(void *rule, afi_t afi,
        struct prefix_list *plist;
 
        plist = prefix_list_lookup(afi, (char *)rule);
-       if (plist == NULL)
+       if (plist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        if (prefix->family == AF_FLOWSPEC)
                return route_match_prefix_list_flowspec(afi, plist,
@@ -722,8 +736,13 @@ route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix,
                p.prefixlen = IPV4_MAX_BITLEN;
 
                plist = prefix_list_lookup(AFI_IP, (char *)rule);
-               if (plist == NULL)
+               if (plist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
                        return RMAP_NOMATCH;
+               }
 
                return (prefix_list_apply(plist, &p) == PREFIX_DENY
                                ? RMAP_NOMATCH
@@ -766,8 +785,13 @@ route_match_ipv6_next_hop_prefix_list(void *rule, const struct prefix *prefix,
                p.prefixlen = IPV6_MAX_BITLEN;
 
                plist = prefix_list_lookup(AFI_IP6, (char *)rule);
-               if (!plist)
+               if (!plist) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
                        return RMAP_NOMATCH;
+               }
 
                if (prefix_list_apply(plist, &p) == PREFIX_PERMIT)
                        return RMAP_MATCH;
@@ -866,8 +890,13 @@ route_match_ip_route_source_prefix_list(void *rule, const struct prefix *prefix,
                p.prefixlen = IPV4_MAX_BITLEN;
 
                plist = prefix_list_lookup(AFI_IP, (char *)rule);
-               if (plist == NULL)
+               if (plist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
                        return RMAP_NOMATCH;
+               }
 
                return (prefix_list_apply(plist, &p) == PREFIX_DENY
                                ? RMAP_NOMATCH
@@ -926,11 +955,21 @@ route_match_mac_address(void *rule, const struct prefix *prefix, void *object)
        struct prefix p;
 
        alist = access_list_lookup(AFI_L2VPN, (char *)rule);
-       if (alist == NULL)
-               return RMAP_NOMATCH;
+       if (alist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
 
-       if (prefix->u.prefix_evpn.route_type != BGP_EVPN_MAC_IP_ROUTE)
                return RMAP_NOMATCH;
+       }
+       if (prefix->u.prefix_evpn.route_type != BGP_EVPN_MAC_IP_ROUTE) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix %pFX is not a EVPN MAC IP ROUTE defaulting to NO_MATCH",
+                               __func__, prefix);
+               return RMAP_NOMATCH;
+       }
 
        p.family = AF_ETHERNET;
        p.prefixlen = ETH_ALEN * 8;
@@ -1349,10 +1388,6 @@ static void *route_match_local_pref_compile(const char *arg)
        char *endptr = NULL;
        unsigned long tmpval;
 
-       /* Locpref value shoud be integer. */
-       if (!all_digit(arg))
-               return NULL;
-
        errno = 0;
        tmpval = strtoul(arg, &endptr, 10);
        if (*endptr != '\0' || errno || tmpval > UINT32_MAX)
@@ -2989,11 +3024,11 @@ static void *route_set_origin_compile(const char *arg)
        origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t));
 
        if (strcmp(arg, "igp") == 0)
-               *origin = 0;
+               *origin = BGP_ORIGIN_IGP;
        else if (strcmp(arg, "egp") == 0)
-               *origin = 1;
+               *origin = BGP_ORIGIN_EGP;
        else
-               *origin = 2;
+               *origin = BGP_ORIGIN_INCOMPLETE;
 
        return origin;
 }
@@ -3206,8 +3241,14 @@ route_match_ipv6_address(void *rule, const struct prefix *prefix, void *object)
 
        if (prefix->family == AF_INET6) {
                alist = access_list_lookup(AFI_IP6, (char *)rule);
-               if (alist == NULL)
+               if (alist == NULL) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
+
                        return RMAP_NOMATCH;
+               }
 
                return (access_list_apply(alist, prefix) == FILTER_DENY
                                ? RMAP_NOMATCH
@@ -3218,6 +3259,14 @@ route_match_ipv6_address(void *rule, const struct prefix *prefix, void *object)
 
 static void *route_match_ipv6_address_compile(const char *arg)
 {
+       struct access_list *alist;
+
+       alist = access_list_lookup(AFI_IP6, arg);
+       if (!alist)
+               zlog_warn(
+                       "Access List specified %s does not exist yet, default will be NO_MATCH until it is created",
+                       arg);
+
        return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
@@ -3249,8 +3298,14 @@ route_match_ipv6_next_hop(void *rule, const struct prefix *prefix, void *object)
                p.prefixlen = IPV6_MAX_BITLEN;
 
                alist = access_list_lookup(AFI_IP6, (char *)rule);
-               if (!alist)
+               if (!alist) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                               zlog_debug(
+                                       "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                                       __func__, (char *)rule);
+
                        return RMAP_NOMATCH;
+               }
 
                if (access_list_apply(alist, &p) == FILTER_PERMIT)
                        return RMAP_MATCH;
@@ -3332,7 +3387,7 @@ static const struct route_map_rule_cmd route_match_ipv6_next_hop_address_cmd = {
        route_match_ipv6_next_hop_address_free
 };
 
-/* `match ip next-hop IP_ADDRESS' */
+/* `match ip next-hop address IP_ADDRESS' */
 
 static enum route_map_cmd_result_t
 route_match_ipv4_next_hop(void *rule, const struct prefix *prefix, void *object)
@@ -3576,17 +3631,29 @@ route_set_ipv6_nexthop_local(void *rule, const struct prefix *p, void *object)
 {
        struct in6_addr *address;
        struct bgp_path_info *path;
+       struct bgp_dest *dest;
+       struct bgp_table *table = NULL;
 
        /* Fetch routemap's rule information. */
        address = rule;
        path = object;
+       dest = path->net;
+
+       if (!dest)
+               return RMAP_OKAY;
+
+       table = bgp_dest_table(dest);
+       if (!table)
+               return RMAP_OKAY;
 
        /* Set next hop value. */
        path->attr->mp_nexthop_local = *address;
 
        /* Set nexthop length. */
-       if (path->attr->mp_nexthop_len != BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL &&
-           path->attr->mp_nexthop_len != BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
+       if (table->safi == SAFI_MPLS_VPN || table->safi == SAFI_ENCAP ||
+           table->safi == SAFI_EVPN)
+               path->attr->mp_nexthop_len = BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL;
+       else
                path->attr->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL;
 
        SET_FLAG(path->attr->rmap_change_flags,
@@ -5608,15 +5675,16 @@ DEFUN_YANG (no_set_label_index,
 
 DEFUN_YANG (set_aspath_prepend_asn,
            set_aspath_prepend_asn_cmd,
-           "set as-path prepend (1-4294967295)...",
+           "set as-path prepend ASNUM...",
            SET_STR
            "Transform BGP AS_PATH attribute\n"
            "Prepend to the as-path\n"
-           "AS number\n")
+           AS_STR)
 {
        int idx_asn = 3;
        int ret;
        char *str;
+       struct aspath *aspath;
 
        str = argv_concat(argv, argc, idx_asn);
 
@@ -5624,6 +5692,12 @@ DEFUN_YANG (set_aspath_prepend_asn,
                "./set-action[action='frr-bgp-route-map:as-path-prepend']";
        char xpath_value[XPATH_MAXLEN];
 
+       aspath = route_aspath_compile(str);
+       if (!aspath) {
+               vty_out(vty, "%% Invalid AS path value %s\n", str);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+       route_aspath_free(aspath);
        nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
        snprintf(xpath_value, sizeof(xpath_value),
                 "%s/rmap-set-action/frr-bgp-route-map:prepend-as-path", xpath);
@@ -5658,16 +5732,22 @@ DEFUN_YANG (set_aspath_prepend_lastas,
 
 DEFPY_YANG (set_aspath_replace_asn,
            set_aspath_replace_asn_cmd,
-           "set as-path replace <any|(1-4294967295)>$replace",
+           "set as-path replace <any|ASNUM>$replace",
            SET_STR
            "Transform BGP AS_PATH attribute\n"
            "Replace AS number to local AS number\n"
            "Replace any AS number to local AS number\n"
-           "Replace a specific AS number to local AS number\n")
+           "Replace a specific AS number in plain or dotted format to local AS number\n")
 {
        const char *xpath =
                "./set-action[action='frr-bgp-route-map:as-path-replace']";
        char xpath_value[XPATH_MAXLEN];
+       as_t as_value;
+
+       if (!strmatch(replace, "any") && !asn_str2asn(replace, &as_value)) {
+               vty_out(vty, "%% Invalid AS value %s\n", replace);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
        snprintf(xpath_value, sizeof(xpath_value),
@@ -5678,13 +5758,13 @@ DEFPY_YANG (set_aspath_replace_asn,
 
 DEFPY_YANG (no_set_aspath_replace_asn,
            no_set_aspath_replace_asn_cmd,
-           "no set as-path replace [<any|(1-4294967295)>]",
+           "no set as-path replace [<any|ASNUM>]",
            NO_STR
            SET_STR
            "Transform BGP AS_PATH attribute\n"
            "Replace AS number to local AS number\n"
            "Replace any AS number to local AS number\n"
-           "Replace a specific AS number to local AS number\n")
+           "Replace a specific AS number in plain or dotted format to local AS number\n")
 {
        const char *xpath =
                "./set-action[action='frr-bgp-route-map:as-path-replace']";
@@ -5695,12 +5775,12 @@ DEFPY_YANG (no_set_aspath_replace_asn,
 
 DEFUN_YANG (no_set_aspath_prepend,
            no_set_aspath_prepend_cmd,
-           "no set as-path prepend [(1-4294967295)]",
+           "no set as-path prepend [ASNUM]",
            NO_STR
            SET_STR
            "Transform BGP AS_PATH attribute\n"
            "Prepend to the as-path\n"
-           "AS number\n")
+           AS_STR)
 {
        const char *xpath =
                "./set-action[action='frr-bgp-route-map:as-path-prepend']";
@@ -5728,15 +5808,16 @@ DEFUN_YANG (no_set_aspath_prepend_lastas,
 
 DEFUN_YANG (set_aspath_exclude,
            set_aspath_exclude_cmd,
-           "set as-path exclude (1-4294967295)...",
+           "set as-path exclude ASNUM...",
            SET_STR
            "Transform BGP AS-path attribute\n"
            "Exclude from the as-path\n"
-           "AS number\n")
+           AS_STR)
 {
        int idx_asn = 3;
        int ret;
        char *str;
+       struct aspath *aspath;
 
        str = argv_concat(argv, argc, idx_asn);
 
@@ -5744,6 +5825,12 @@ DEFUN_YANG (set_aspath_exclude,
                "./set-action[action='frr-bgp-route-map:as-path-exclude']";
        char xpath_value[XPATH_MAXLEN];
 
+       aspath = route_aspath_compile(str);
+       if (!aspath) {
+               vty_out(vty, "%% Invalid AS path value %s\n", str);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+       route_aspath_free(aspath);
        nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
        snprintf(xpath_value, sizeof(xpath_value),
                 "%s/rmap-set-action/frr-bgp-route-map:exclude-as-path", xpath);
@@ -5755,7 +5842,7 @@ DEFUN_YANG (set_aspath_exclude,
 
 DEFUN_YANG (no_set_aspath_exclude,
            no_set_aspath_exclude_cmd,
-           "no set as-path exclude (1-4294967295)...",
+           "no set as-path exclude ASNUM...",
            NO_STR
            SET_STR
            "Transform BGP AS_PATH attribute\n"
@@ -5815,9 +5902,14 @@ DEFUN_YANG (set_community,
                else
                        first = 1;
 
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
                if (strncmp(argv[i]->arg, "internet", strlen(argv[i]->arg))
                    == 0) {
                        buffer_putstr(b, "internet");
+                       vty_out(vty, "%% `internet` community is deprecated\n");
+                       zlog_warn("`internet` community is deprecated");
                        continue;
                }
                if (strncmp(argv[i]->arg, "local-AS", strlen(argv[i]->arg))
@@ -6441,11 +6533,11 @@ DEFPY_YANG (no_set_aigp_metric,
 
 DEFUN_YANG (set_aggregator_as,
            set_aggregator_as_cmd,
-           "set aggregator as (1-4294967295) A.B.C.D",
+           "set aggregator as ASNUM A.B.C.D",
            SET_STR
            "BGP aggregator attribute\n"
            "AS number of aggregator\n"
-           "AS number\n"
+           AS_STR
            "IP address of aggregator\n")
 {
        int idx_number = 3;
@@ -6454,6 +6546,12 @@ DEFUN_YANG (set_aggregator_as,
        char xpath_addr[XPATH_MAXLEN];
        const char *xpath =
                "./set-action[action='frr-bgp-route-map:aggregator']";
+       as_t as_value;
+
+       if (!asn_str2asn(argv[idx_number]->arg, &as_value)) {
+               vty_out(vty, "%% Invalid AS value %s\n", argv[idx_number]->arg);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
 
@@ -6476,12 +6574,12 @@ DEFUN_YANG (set_aggregator_as,
 
 DEFUN_YANG (no_set_aggregator_as,
            no_set_aggregator_as_cmd,
-           "no set aggregator as [(1-4294967295) A.B.C.D]",
+           "no set aggregator as [ASNUM A.B.C.D]",
            NO_STR
            SET_STR
            "BGP aggregator attribute\n"
            "AS number of aggregator\n"
-           "AS number\n"
+           AS_STR
            "IP address of aggregator\n")
 {
        const char *xpath =
index 35e470349275dff7ae122e253bb36cca759e79b8..9188a40cc94abd795c3d648b34a297ceaf375247 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 93320441585954a2eeaf6caa879f497d3c541a3a..07a1a6eb57fb3e7f88965844329af2c548e300a0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_ROUTEMAP_NB_H_
index 216bcc0b07de15d917a2cc8bc7b1d31b75ce5701..142bded6c536895664502969966d306f7f11a5a6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 73c6fe0c4757fa27549e850a7822dfe38eaf17e9..d7e1a6341bc0e78881a55a60ae1726c41f286315 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP RPKI
  * Copyright (C) 2013 Michael Mester (m.mester@fu-berlin.de), for FU Berlin
@@ -7,22 +8,6 @@
  * Hamburg
  * Copyright (C) 2017-2018 Marcel Röthke (marcel.roethke@haw-hamburg.de),
  * for HAW Hamburg
- *
- * This file is part of FRRouting.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* If rtrlib compiled with ssh support, don`t fail build */
@@ -96,6 +81,7 @@ struct rpki_for_each_record_arg {
        unsigned int *prefix_amount;
        as_t as;
        json_object *json;
+       enum asnotation_mode asnotation;
 };
 
 static int start(void);
@@ -120,7 +106,7 @@ static void rpki_delete_all_cache_nodes(void);
 static int add_tcp_cache(const char *host, const char *port,
                         const uint8_t preference, const char *bindaddr);
 static void print_record(const struct pfx_record *record, struct vty *vty,
-                        json_object *json);
+                        json_object *json, enum asnotation_mode asnotation);
 static bool is_synchronized(void);
 static bool is_running(void);
 static bool is_stopping(void);
@@ -285,7 +271,7 @@ static void rpki_delete_all_cache_nodes(void)
 }
 
 static void print_record(const struct pfx_record *record, struct vty *vty,
-                        json_object *json)
+                        json_object *json, enum asnotation_mode asnotation)
 {
        char ip[INET6_ADDRSTRLEN];
        json_object *json_record = NULL;
@@ -293,8 +279,10 @@ static void print_record(const struct pfx_record *record, struct vty *vty,
        lrtr_ip_addr_to_str(&record->prefix, ip, sizeof(ip));
 
        if (!json) {
-               vty_out(vty, "%-40s   %3u - %3u   %10u\n", ip, record->min_len,
-                       record->max_len, record->asn);
+               vty_out(vty, "%-40s   %3u - %3u   ", ip, record->min_len,
+                       record->max_len);
+               vty_out(vty, ASN_FORMAT(asnotation), &record->asn);
+               vty_out(vty, "\n");
        } else {
                json_record = json_object_new_object();
                json_object_string_add(json_record, "prefix", ip);
@@ -302,7 +290,7 @@ static void print_record(const struct pfx_record *record, struct vty *vty,
                                    record->min_len);
                json_object_int_add(json_record, "prefixLenMax",
                                    record->max_len);
-               json_object_int_add(json_record, "asn", record->asn);
+               asn_asn2json(json_record, "asn", record->asn, asnotation);
                json_object_array_add(json, json_record);
        }
 }
@@ -314,7 +302,7 @@ static void print_record_by_asn(const struct pfx_record *record, void *data)
 
        if (record->asn == arg->as) {
                (*arg->prefix_amount)++;
-               print_record(record, vty, arg->json);
+               print_record(record, vty, arg->json, arg->asnotation);
        }
 }
 
@@ -325,7 +313,7 @@ static void print_record_cb(const struct pfx_record *record, void *data)
 
        (*arg->prefix_amount)++;
 
-       print_record(record, vty, arg->json);
+       print_record(record, vty, arg->json, arg->asnotation);
 }
 
 static struct rtr_mgr_group *get_groups(void)
@@ -743,6 +731,7 @@ static void print_prefix_table_by_asn(struct vty *vty, as_t as,
        arg.vty = vty;
        arg.as = as;
        arg.json = NULL;
+       arg.asnotation = bgp_get_asnotation(bgp_lookup_by_vrf_id(VRF_DEFAULT));
 
        if (!group) {
                if (!json)
@@ -795,6 +784,7 @@ static void print_prefix_table(struct vty *vty, json_object *json)
 
        arg.vty = vty;
        arg.json = NULL;
+       arg.asnotation = bgp_get_asnotation(bgp_lookup_by_vrf_id(VRF_DEFAULT));
 
        if (!group) {
                if (!json)
@@ -1352,7 +1342,7 @@ DEFPY (show_rpki_prefix_table,
 
 DEFPY (show_rpki_as_number,
        show_rpki_as_number_cmd,
-       "show rpki as-number (1-4294967295)$by_asn [json$uj]",
+       "show rpki as-number ASNUM$by_asn [json$uj]",
        SHOW_STR
        RPKI_OUTPUT_STRING
        "Lookup by ASN in prefix table\n"
@@ -1360,23 +1350,28 @@ DEFPY (show_rpki_as_number,
        JSON_STR)
 {
        struct json_object *json = NULL;
+       as_t as;
 
        if (!is_synchronized()) {
                if (!uj)
                        vty_out(vty, "No Connection to RPKI cache server.\n");
                return CMD_WARNING;
        }
-
+       if (!asn_str2asn(by_asn, &as)) {
+               if (!uj)
+                       vty_out(vty, "Invalid AS value: %s.\n", by_asn);
+               return CMD_WARNING;
+       }
        if (uj)
                json = json_object_new_object();
 
-       print_prefix_table_by_asn(vty, by_asn, json);
+       print_prefix_table_by_asn(vty, as, json);
        return CMD_SUCCESS;
 }
 
 DEFPY (show_rpki_prefix,
        show_rpki_prefix_cmd,
-       "show rpki prefix <A.B.C.D/M|X:X::X:X/M> [(1-4294967295)$asn] [json$uj]",
+       "show rpki prefix <A.B.C.D/M|X:X::X:X/M> [ASNUM$asn] [json$uj]",
        SHOW_STR
        RPKI_OUTPUT_STRING
        "Lookup IP prefix and optionally ASN in prefix table\n"
@@ -1387,6 +1382,8 @@ DEFPY (show_rpki_prefix,
 {
        json_object *json = NULL;
        json_object *json_records = NULL;
+       as_t as;
+       enum asnotation_mode asnotation;
 
        if (!is_synchronized()) {
                if (!uj)
@@ -1407,13 +1404,19 @@ DEFPY (show_rpki_prefix,
                return CMD_WARNING;
        }
 
+       if (asn && !asn_str2asn(asn, &as)) {
+               if (!uj)
+                       vty_out(vty, "Invalid AS value: %s.\n", asn);
+               return CMD_WARNING;
+       }
+
        struct pfx_record *matches = NULL;
        unsigned int match_count = 0;
        enum pfxv_state result;
 
        if (pfx_table_validate_r(rtr_config->pfx_table, &matches, &match_count,
-                                asn, &addr, prefix->prefixlen, &result)
-           != PFX_SUCCESS) {
+                                as, &addr, prefix->prefixlen,
+                                &result) != PFX_SUCCESS) {
                if (!json)
                        vty_out(vty, "Prefix lookup failed\n");
                return CMD_WARNING;
@@ -1430,13 +1433,14 @@ DEFPY (show_rpki_prefix,
                json_object_object_add(json, "prefixes", json_records);
        }
 
+       asnotation = bgp_get_asnotation(bgp_lookup_by_vrf_id(VRF_DEFAULT));
        for (size_t i = 0; i < match_count; ++i) {
                const struct pfx_record *record = &matches[i];
 
-               if (record->max_len >= prefix->prefixlen
-                   && ((asn != 0 && (uint32_t)asn == record->asn)
-                       || asn == 0)) {
-                       print_record(&matches[i], vty, json_records);
+               if (record->max_len >= prefix->prefixlen &&
+                   ((as != 0 && (uint32_t)as == record->asn) || as == 0)) {
+                       print_record(&matches[i], vty, json_records,
+                                    asnotation);
                }
        }
 
index 4dd4b4a2b2614efc6a6991247e90ad398e885b42..de28715d1b16099b418bb9b1bee8bc6c7954440c 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * bgp_rpki code
  * Copyright (C) 2021 NVIDIA Corporation and Mellanox Technologies, LTD
  *                    All Rights Reserved
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __BGP_RPKI_H__
 #define __BGP_RPKI_H__
index bf3e612bfdb754f2feccd2486aed925342724475..f4ab23352434f624c082365f0354f2aaf3d7c489 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP scripting foo
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -163,7 +149,8 @@ void lua_decode_attr(lua_State *L, int idx, struct attr *attr)
        attr->nh_ifindex = lua_tointeger(L, -1);
        lua_pop(L, 1);
        lua_getfield(L, idx, "aspath");
-       attr->aspath = aspath_str2aspath(lua_tostring(L, -1));
+       attr->aspath = aspath_str2aspath(lua_tostring(L, -1),
+                                        bgp_get_asnotation(NULL));
        lua_pop(L, 1);
        lua_getfield(L, idx, "localpref");
        attr->local_pref = lua_tointeger(L, -1);
index f8178aa98385ed47a67ead573d8770af1743d4d8..f2f47e940d2b478f284120f9d62aa041c221aa02 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP scripting foo
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 #ifndef __BGP_SCRIPT__
 #define __BGP_SCRIPT__
index b202ec2e1749980332d7deda2fe5e60dc0fcd34e..5aa5e142889cdc3c36bd8f82c0ba8c876cd99df5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP4 SNMP support
  * Copyright (C) 1999, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a89e82b6c6ff0c3b6e8d0eeb6d75a89767640d91..d324782ae33bb713b37b38b61deea36000967410 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Common header file for BGP SNMP implementation.
  *
  * Copyright (C) 2022 Donatas Abraitis <donatas@opensourcerouting.org>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_SNMP_H_
index bb8b7f4b197c2cf205da81f3438ae8147b4745a2..186c9e28463aac39d61f29ef24a1bc807f4a4b7d 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP4 SNMP support
  * Copyright (C) 1999, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -32,7 +17,6 @@
 #include "filter.h"
 #include "hook.h"
 #include "libfrr.h"
-#include "lib/version.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
index ac511916605c26d0979713dec1a4a6d2e281ec34..dffbf5fecf2189722865881021f736bcefcfe5c6 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP4-MIB SNMP support
  *
  * Using: http://www.circitor.fr/Mibs/Html/B/BGP4-MIB.php
  *
  * Copyright (C) 2022 Donatas Abraitis <donatas@opensourcerouting.org>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_SNMP_BGP4_H_
index d8d8549960a26dfaa52ad4ff6301389e94ca485f..9c2599d5f4706be451c97b685403df53b4412bed 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP4V2-MIB SNMP support
  *
  * Copyright (C) 2022 Donatas Abraitis <donatas@opensourcerouting.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -33,7 +18,6 @@
 #include "filter.h"
 #include "hook.h"
 #include "libfrr.h"
-#include "lib/version.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
index 8b474c38879b8e49befc42c210ce11193e9d2f2c..67f45a6173f838af33a2cd3404587cd7416e036e 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP4V2-MIB SNMP support
  *
  * Using: http://www.circitor.fr/Mibs/Html/B/BGP4V2-MIB.php
  *
  * Copyright (C) 2022 Donatas Abraitis <donatas@opensourcerouting.org>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_SNMP_BGP4V2_H_
index 0ca78d0bb643a714bf76041f792beb4bc99602ba..cb658c03086679b6122bbc0b7256b9715891e69f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP routing table
  * Copyright (C) 1998, 2001 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 121afc481fe5cbd4272f24892a87a99b643d0ba7..997efee9f3368355d9c4e339316bad5d1b09459e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP routing table
  * Copyright (C) 1998, 2001 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_TABLE_H
index 7cc8f24e06be76229ed1c9133f32aa6b524e69a3..3213b29d99f81e3839b5b80b7718803231fb7622 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Tracing for BGP
  *
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #if !defined(_BGP_TRACE_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
index 9ca57f08daa55ffb2205a597c2f44aa7a67df4e2..a32cdb1ba42c1a212d1b928ece14083af1d525ce 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_updgrp.c: BGP update group structures
  *
@@ -6,22 +7,6 @@
  * @author Avneesh Sachdev <avneesh@sproute.net>
  * @author Rajesh Varadarajan <rajesh@sproute.net>
  * @author Pradosh Mohapatra <pradosh@sproute.net>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index e27c1e7b6708299e121d5e9220f0f427f49e8dd2..2b2fadcdf402257abc4e69e862ee09d352c106c1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_updgrp.c: BGP update group structures
  *
@@ -6,22 +7,6 @@
  * @author Avneesh Sachdev <avneesh@sproute.net>
  * @author Rajesh Varadarajan <rajesh@sproute.net>
  * @author Pradosh Mohapatra <pradosh@sproute.net>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_UPDGRP_H
index cbd5d05922f924feafb6085d5708e57ccebbd8da..9eefd2a63750680b388414afa26bde308fd6554a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_updgrp_adv.c: BGP update group advertisement and adjacency
  *                   maintenance
@@ -8,22 +9,6 @@
  * @author Avneesh Sachdev <avneesh@sproute.net>
  * @author Rajesh Varadarajan <rajesh@sproute.net>
  * @author Pradosh Mohapatra <pradosh@sproute.net>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -934,10 +919,14 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
                                        if (subgroup_announce_check(
                                                    dest, pi, subgrp,
                                                    bgp_dest_get_prefix(dest),
-                                                   &attr, NULL))
+                                                   &attr, NULL)) {
+                                               struct attr *default_attr =
+                                                       bgp_attr_intern(&attr);
+
                                                bgp_adj_out_set_subgroup(
-                                                       dest, subgrp, &attr,
-                                                       pi);
+                                                       dest, subgrp,
+                                                       default_attr, pi);
+                                       }
                        }
                        bgp_dest_unlock_node(dest);
                }
index 346a3e7806ca21068a5cba85218c929f2ff5480a..5106dcf354cc4068a707756cad5bd809e895f09a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bgp_updgrp_packet.c: BGP update group packet handling routines
  *
@@ -6,22 +7,6 @@
  * @author Avneesh Sachdev <avneesh@sproute.net>
  * @author Rajesh Varadarajan <rajesh@sproute.net>
  * @author Pradosh Mohapatra <pradosh@sproute.net>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 04847ce6c955974a99828a2cd1df20a0b74ea1f2..b08af9f185ea23864b7ef79d9b3abe1edc624ab3 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015-2016, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_VNC_TYPES_H
index 6308936aa8a4d5e9927467ce2af0836220bdc087..0ed1d04d83eab4f0f9ece783c838e11d1f8f3673 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* VPN Related functions
  * Copyright (C) 2017 6WIND
  *
  * This file is part of FRRouting
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a2e86476a2e51108a9a22d4ed2c4c13e267800d7..dedd0d66e1f3d68260aa71bfe68cf23c819d6d14 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* VPN common functions to MP-BGP
  * Copyright (C) 2017 6WIND
- *
- * This file is part of FRRouting.
- *
- * FRRouting is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRRouting is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_BGP_VPN_H
index d837601f3264dbabc80838a25de0853230cf7837..8ef18a34d035d3719cdffb8c7a01b035cd0347c3 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP VTY interface.
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -39,6 +24,7 @@
 #include "queue.h"
 #include "filter.h"
 #include "frrstr.h"
+#include "asn.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_attr_evpn.h"
@@ -178,10 +164,14 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
                        return BGP_VPNV4_NODE;
                case SAFI_FLOWSPEC:
                        return BGP_FLOWSPECV4_NODE;
-               default:
+               case SAFI_UNSPEC:
+               case SAFI_ENCAP:
+               case SAFI_EVPN:
+               case SAFI_MAX:
                        /* not expected */
                        return BGP_IPV4_NODE;
                }
+               break;
        case AFI_IP6:
                switch (safi) {
                case SAFI_UNICAST:
@@ -194,10 +184,14 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
                        return BGP_VPNV6_NODE;
                case SAFI_FLOWSPEC:
                        return BGP_FLOWSPECV6_NODE;
-               default:
-                       /* not expected */
+               case SAFI_UNSPEC:
+               case SAFI_ENCAP:
+               case SAFI_EVPN:
+               case SAFI_MAX:
+                       /* not expected and the return value seems wrong */
                        return BGP_IPV4_NODE;
                }
+               break;
        case AFI_L2VPN:
                return BGP_EVPN_NODE;
        case AFI_UNSPEC:
@@ -535,7 +529,9 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
                        return "ipv4-labeled-unicast";
                case SAFI_FLOWSPEC:
                        return "ipv4-flowspec";
-               default:
+               case SAFI_UNSPEC:
+               case SAFI_EVPN:
+               case SAFI_MAX:
                        return "unknown-afi/safi";
                }
                break;
@@ -553,7 +549,9 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
                        return "ipv6-labeled-unicast";
                case SAFI_FLOWSPEC:
                        return "ipv6-flowspec";
-               default:
+               case SAFI_UNSPEC:
+               case SAFI_EVPN:
+               case SAFI_MAX:
                        return "unknown-afi/safi";
                }
                break;
@@ -561,21 +559,31 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
                switch (safi) {
                case SAFI_EVPN:
                        return "l2vpn-evpn";
-               default:
+               case SAFI_UNICAST:
+               case SAFI_MULTICAST:
+               case SAFI_MPLS_VPN:
+               case SAFI_ENCAP:
+               case SAFI_LABELED_UNICAST:
+               case SAFI_FLOWSPEC:
+               case SAFI_UNSPEC:
+               case SAFI_MAX:
                        return "unknown-afi/safi";
                }
+               break;
        case AFI_UNSPEC:
        case AFI_MAX:
                return "unknown-afi/safi";
        }
        /* all AFIs are accounted for above, so this shouldn't happen */
-       return "unknown-afi/safi";
+
+       assert(!"Reached end of function where we did not expect to");
 }
 
 int bgp_get_vty(struct bgp **bgp, as_t *as, const char *name,
-               enum bgp_instance_type inst_type)
+               enum bgp_instance_type inst_type, const char *as_pretty,
+               enum asnotation_mode asnotation)
 {
-       int ret = bgp_get(bgp, as, name, inst_type);
+       int ret = bgp_get(bgp, as, name, inst_type, as_pretty, asnotation);
 
        if (ret == BGP_CREATED) {
                bgp_timers_set(*bgp, DFLT_BGP_KEEPALIVE, DFLT_BGP_HOLDTIME,
@@ -1216,7 +1224,12 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
 
        /* Clear all neighbors belonging to a specific AS. */
        if (sort == clear_as) {
-               as_t as = strtoul(arg, NULL, 10);
+               as_t as;
+
+               if (!asn_str2asn(arg, &as)) {
+                       vty_out(vty, "%% BGP: No such AS %s\n", arg);
+                       return CMD_WARNING;
+               }
 
                for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
                        if (peer->as != as)
@@ -1454,16 +1467,23 @@ DEFUN (no_auto_summary,
 /* "router bgp" commands. */
 DEFUN_NOSH (router_bgp,
        router_bgp_cmd,
-       "router bgp [(1-4294967295)$instasn [<view|vrf> VIEWVRFNAME]]",
+       "router bgp [ASNUM$instasn [<view|vrf> VIEWVRFNAME] [as-notation <dot|dot+|plain>]]",
        ROUTER_STR
        BGP_STR
        AS_STR
-       BGP_INSTANCE_HELP_STR)
+       BGP_INSTANCE_HELP_STR
+       "Force the AS notation output\n"
+       "use 'AA.BB' format for AS 4 byte values\n"
+       "use 'AA.BB' format for all AS values\n"
+       "use plain format for all AS values\n")
 {
        int idx_asn = 2;
        int idx_view_vrf = 3;
        int idx_vrf = 4;
        int is_new_bgp = 0;
+       int idx_asnotation = 3;
+       int idx_asnotation_kind = 4;
+       enum asnotation_mode asnotation = ASNOTATION_UNDEFINED;
        int ret;
        as_t as;
        struct bgp *bgp;
@@ -1488,39 +1508,62 @@ DEFUN_NOSH (router_bgp,
 
        // "router bgp X"
        else {
-               as = strtoul(argv[idx_asn]->arg, NULL, 10);
+               if (!asn_str2asn(argv[idx_asn]->arg, &as)) {
+                       vty_out(vty, "%% BGP: No such AS %s\n",
+                               argv[idx_asn]->arg);
+                       return CMD_WARNING_CONFIG_FAILED;
+               }
 
                if (as == BGP_PRIVATE_AS_MAX || as == BGP_AS4_MAX)
                        vty_out(vty, "Reserved AS used (%u|%u); AS is %u\n",
                                BGP_PRIVATE_AS_MAX, BGP_AS4_MAX, as);
 
                inst_type = BGP_INSTANCE_TYPE_DEFAULT;
-               if (argc > 3) {
-                       name = argv[idx_vrf]->arg;
 
-                       if (!strcmp(argv[idx_view_vrf]->text, "vrf")) {
-                               if (strmatch(name, VRF_DEFAULT_NAME))
-                                       name = NULL;
-                               else
-                                       inst_type = BGP_INSTANCE_TYPE_VRF;
-                       } else if (!strcmp(argv[idx_view_vrf]->text, "view"))
-                               inst_type = BGP_INSTANCE_TYPE_VIEW;
+               if (argv_find(argv, argc, "VIEWVRFNAME", &idx_vrf)) {
+                       idx_view_vrf = idx_vrf - 1;
+                       if (argv[idx_view_vrf]->text) {
+                               name = argv[idx_vrf]->arg;
+
+                               if (!strcmp(argv[idx_view_vrf]->text, "vrf")) {
+                                       if (strmatch(name, VRF_DEFAULT_NAME))
+                                               name = NULL;
+                                       else
+                                               inst_type =
+                                                       BGP_INSTANCE_TYPE_VRF;
+                               } else if (!strcmp(argv[idx_view_vrf]->text,
+                                                  "view"))
+                                       inst_type = BGP_INSTANCE_TYPE_VIEW;
+                       }
+               }
+               if (argv_find(argv, argc, "as-notation", &idx_asnotation)) {
+                       idx_asnotation_kind = idx_asnotation + 1;
+                       if (strmatch(argv[idx_asnotation_kind]->text, "dot+"))
+                               asnotation = ASNOTATION_DOTPLUS;
+                       else if (strmatch(argv[idx_asnotation_kind]->text,
+                                         "dot"))
+                               asnotation = ASNOTATION_DOT;
+                       else if (strmatch(argv[idx_asnotation_kind]->text,
+                                         "plain"))
+                               asnotation = ASNOTATION_PLAIN;
                }
 
                if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
                        is_new_bgp = (bgp_lookup(as, name) == NULL);
 
-               ret = bgp_get_vty(&bgp, &as, name, inst_type);
+               ret = bgp_get_vty(&bgp, &as, name, inst_type,
+                                 argv[idx_asn]->arg, asnotation);
                switch (ret) {
                case BGP_ERR_AS_MISMATCH:
-                       vty_out(vty, "BGP is already running; AS is %u\n", as);
+                       vty_out(vty, "BGP is already running; AS is %s\n",
+                               bgp->as_pretty);
                        return CMD_WARNING_CONFIG_FAILED;
                case BGP_ERR_INSTANCE_MISMATCH:
                        vty_out(vty,
                                "BGP instance name and AS number mismatch\n");
                        vty_out(vty,
-                               "BGP instance is already running; AS is %u\n",
-                               as);
+                               "BGP instance is already running; AS is %s\n",
+                               bgp->as_pretty);
                        return CMD_WARNING_CONFIG_FAILED;
                }
 
@@ -1536,6 +1579,19 @@ DEFUN_NOSH (router_bgp,
                        bgp_vpn_leak_export(bgp);
                /* Pending: handle when user tries to change a view to vrf n vv.
                 */
+               /* for pre-existing bgp instance,
+                * - update as_pretty
+                * - update asnotation if explicitly mentioned
+                */
+               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO)) {
+                       XFREE(MTYPE_BGP, bgp->as_pretty);
+                       bgp->as_pretty = XSTRDUP(MTYPE_BGP, argv[idx_asn]->arg);
+                       if (!CHECK_FLAG(bgp->config, BGP_CONFIG_ASNOTATION) &&
+                           asnotation != ASNOTATION_UNDEFINED) {
+                               SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);
+                               bgp->asnotation = asnotation;
+                       }
+               }
        }
 
        /* unset the auto created flag as the user config is now present */
@@ -1548,12 +1604,16 @@ DEFUN_NOSH (router_bgp,
 /* "no router bgp" commands. */
 DEFUN (no_router_bgp,
        no_router_bgp_cmd,
-       "no router bgp [(1-4294967295)$instasn [<view|vrf> VIEWVRFNAME]]",
+       "no router bgp [ASNUM$instasn [<view|vrf> VIEWVRFNAME] [as-notation <dot|dot+|plain>]]",
        NO_STR
        ROUTER_STR
        BGP_STR
        AS_STR
-       BGP_INSTANCE_HELP_STR)
+       BGP_INSTANCE_HELP_STR
+       "Force the AS notation output\n"
+       "use 'AA.BB' format for AS 4 byte values\n"
+       "use 'AA.BB' format for all AS values\n"
+       "use plain format for all AS values\n")
 {
        int idx_asn = 3;
        int idx_vrf = 5;
@@ -1582,8 +1642,11 @@ DEFUN (no_router_bgp,
                        return CMD_WARNING_CONFIG_FAILED;
                }
        } else {
-               as = strtoul(argv[idx_asn]->arg, NULL, 10);
-
+               if (!asn_str2asn(argv[idx_asn]->arg, &as)) {
+                       vty_out(vty, "%% BGP: No such AS %s\n",
+                               argv[idx_asn]->arg);
+                       return CMD_WARNING_CONFIG_FAILED;
+               }
                if (argc > 4) {
                        name = argv[idx_vrf]->arg;
                        if (strmatch(argv[idx_vrf - 1]->text, "vrf")
@@ -1815,7 +1878,6 @@ DEFPY (bgp_suppress_fib_pending,
        return CMD_SUCCESS;
 }
 
-
 /* BGP Cluster ID.  */
 DEFUN (bgp_cluster_id,
        bgp_cluster_id_cmd,
@@ -1911,30 +1973,33 @@ DEFPY (no_bgp_send_extra_data,
 
 DEFUN (bgp_confederation_identifier,
        bgp_confederation_identifier_cmd,
-       "bgp confederation identifier (1-4294967295)",
+       "bgp confederation identifier ASNUM",
        BGP_STR
        "AS confederation parameters\n"
-       "AS number\n"
+       AS_STR
        "Set routing domain confederation AS\n")
 {
        VTY_DECLVAR_CONTEXT(bgp, bgp);
        int idx_number = 3;
        as_t as;
 
-       as = strtoul(argv[idx_number]->arg, NULL, 10);
+       if (!asn_str2asn(argv[idx_number]->arg, &as)) {
+               vty_out(vty, "%% BGP: No such AS %s\n", argv[idx_number]->arg);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
-       bgp_confederation_id_set(bgp, as);
+       bgp_confederation_id_set(bgp, as, argv[idx_number]->arg);
 
        return CMD_SUCCESS;
 }
 
 DEFUN (no_bgp_confederation_identifier,
        no_bgp_confederation_identifier_cmd,
-       "no bgp confederation identifier [(1-4294967295)]",
+       "no bgp confederation identifier [ASNUM]",
        NO_STR
        BGP_STR
        "AS confederation parameters\n"
-       "AS number\n"
+       AS_STR
        "Set routing domain confederation AS\n")
 {
        VTY_DECLVAR_CONTEXT(bgp, bgp);
@@ -1945,7 +2010,7 @@ DEFUN (no_bgp_confederation_identifier,
 
 DEFUN (bgp_confederation_peers,
        bgp_confederation_peers_cmd,
-       "bgp confederation peers (1-4294967295)...",
+       "bgp confederation peers ASNUM...",
        BGP_STR
        "AS confederation parameters\n"
        "Peer ASs in BGP confederation\n"
@@ -1957,15 +2022,20 @@ DEFUN (bgp_confederation_peers,
        int i;
 
        for (i = idx_asn; i < argc; i++) {
-               as = strtoul(argv[i]->arg, NULL, 10);
-               bgp_confederation_peers_add(bgp, as);
+               if (!asn_str2asn(argv[i]->arg, &as)) {
+                       vty_out(vty, "%% Invalid confed peer AS value: %s\n",
+                               argv[i]->arg);
+                       continue;
+               }
+
+               bgp_confederation_peers_add(bgp, as, argv[i]->arg);
        }
        return CMD_SUCCESS;
 }
 
 DEFUN (no_bgp_confederation_peers,
        no_bgp_confederation_peers_cmd,
-       "no bgp confederation peers (1-4294967295)...",
+       "no bgp confederation peers ASNUM...",
        NO_STR
        BGP_STR
        "AS confederation parameters\n"
@@ -1978,8 +2048,11 @@ DEFUN (no_bgp_confederation_peers,
        int i;
 
        for (i = idx_asn; i < argc; i++) {
-               as = strtoul(argv[i]->arg, NULL, 10);
-
+               if (!asn_str2asn(argv[i]->arg, &as)) {
+                       vty_out(vty, "%% Invalid confed peer AS value: %s\n",
+                               argv[i]->arg);
+                       continue;
+               }
                bgp_confederation_peers_remove(bgp, as);
        }
        return CMD_SUCCESS;
@@ -4483,11 +4556,13 @@ static int peer_remote_as_vty(struct vty *vty, const char *peer_str,
        } else if (as_str[0] == 'e') {
                as = 0;
                as_type = AS_EXTERNAL;
-       } else {
-               /* Get AS number.  */
-               as = strtoul(as_str, NULL, 10);
-       }
+       } else if (!asn_str2asn(as_str, &as))
+               as_type = AS_UNSPECIFIED;
 
+       if (as_type == AS_UNSPECIFIED) {
+               vty_out(vty, "%% Invalid peer AS: %s\n", as_str);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
        /* If peer is peer group or interface peer, call proper function. */
        ret = str2sockunion(peer_str, &su);
        if (ret < 0) {
@@ -4496,11 +4571,12 @@ static int peer_remote_as_vty(struct vty *vty, const char *peer_str,
                /* Check if existing interface peer */
                peer = peer_lookup_by_conf_if(bgp, peer_str);
 
-               ret = peer_remote_as(bgp, NULL, peer_str, &as, as_type);
+               ret = peer_remote_as(bgp, NULL, peer_str, &as, as_type, as_str);
 
                /* if not interface peer, check peer-group settings */
                if (ret < 0 && !peer) {
-                       ret = peer_group_remote_as(bgp, peer_str, &as, as_type);
+                       ret = peer_group_remote_as(bgp, peer_str, &as, as_type,
+                                                  as_str);
                        if (ret < 0) {
                                vty_out(vty,
                                        "%% Create the peer-group or interface first\n");
@@ -4514,7 +4590,7 @@ static int peer_remote_as_vty(struct vty *vty, const char *peer_str,
                                "%% Can not configure the local system as neighbor\n");
                        return CMD_WARNING_CONFIG_FAILED;
                }
-               ret = peer_remote_as(bgp, &su, NULL, &as, as_type);
+               ret = peer_remote_as(bgp, &su, NULL, &as, as_type, as_str);
        }
 
        return bgp_vty_return(vty, ret);
@@ -4585,7 +4661,7 @@ ALIAS(no_bgp_shutdown, no_bgp_shutdown_msg_cmd,
 
 DEFUN (neighbor_remote_as,
        neighbor_remote_as_cmd,
-       "neighbor <A.B.C.D|X:X::X:X|WORD> remote-as <(1-4294967295)|internal|external>",
+       "neighbor <A.B.C.D|X:X::X:X|WORD> remote-as <ASNUM|internal|external>",
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Specify a BGP neighbor\n"
@@ -4665,18 +4741,19 @@ static int peer_conf_interface_get(struct vty *vty, const char *conf_if,
                        as_type = AS_EXTERNAL;
                } else {
                        /* Get AS number.  */
-                       as = strtoul(as_str, NULL, 10);
-                       as_type = AS_SPECIFIED;
+                       if (asn_str2asn(as_str, &as))
+                               as_type = AS_SPECIFIED;
                }
        }
 
        peer = peer_lookup_by_conf_if(bgp, conf_if);
        if (peer) {
                if (as_str)
-                       ret = peer_remote_as(bgp, NULL, conf_if, &as, as_type);
+                       ret = peer_remote_as(bgp, NULL, conf_if, &as, as_type,
+                                            as_str);
        } else {
                peer = peer_create(NULL, conf_if, bgp, bgp->as, as, as_type,
-                                  NULL, true);
+                                  NULL, true, as_str);
 
                if (!peer) {
                        vty_out(vty, "%% BGP failed to create peer\n");
@@ -4778,7 +4855,7 @@ DEFUN (neighbor_interface_config_v6only,
 
 DEFUN (neighbor_interface_config_remote_as,
        neighbor_interface_config_remote_as_cmd,
-       "neighbor WORD interface remote-as <(1-4294967295)|internal|external>",
+       "neighbor WORD interface remote-as <ASNUM|internal|external>",
        NEIGHBOR_STR
        "Interface name or neighbor tag\n"
        "Enable BGP on interface\n"
@@ -4795,7 +4872,7 @@ DEFUN (neighbor_interface_config_remote_as,
 
 DEFUN (neighbor_interface_v6only_config_remote_as,
        neighbor_interface_v6only_config_remote_as_cmd,
-       "neighbor WORD interface v6only remote-as <(1-4294967295)|internal|external>",
+       "neighbor WORD interface v6only remote-as <ASNUM|internal|external>",
        NEIGHBOR_STR
        "Interface name or neighbor tag\n"
        "Enable BGP with v6 link-local only\n"
@@ -4964,7 +5041,7 @@ DEFUN (no_neighbor_peer_group,
 
 DEFUN (no_neighbor_interface_peer_group_remote_as,
        no_neighbor_interface_peer_group_remote_as_cmd,
-       "no neighbor WORD remote-as <(1-4294967295)|internal|external>",
+       "no neighbor WORD remote-as <ASNUM|internal|external>",
        NO_STR
        NEIGHBOR_STR
        "Interface name or neighbor tag\n"
@@ -4981,7 +5058,7 @@ DEFUN (no_neighbor_interface_peer_group_remote_as,
        /* look up for neighbor by interface name config. */
        peer = peer_lookup_by_conf_if(bgp, argv[idx_word]->arg);
        if (peer) {
-               peer_as_change(peer, 0, AS_UNSPECIFIED);
+               peer_as_change(peer, 0, AS_UNSPECIFIED, NULL);
                return CMD_SUCCESS;
        }
 
@@ -4997,11 +5074,11 @@ DEFUN (no_neighbor_interface_peer_group_remote_as,
 
 DEFUN (neighbor_local_as,
        neighbor_local_as_cmd,
-       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295)",
+       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as ASNUM",
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Specify a local-as number\n"
-       "AS number used as local AS\n")
+       "AS number expressed in dotted or plain format used as local AS\n")
 {
        int idx_peer = 1;
        int idx_number = 3;
@@ -5013,18 +5090,23 @@ DEFUN (neighbor_local_as,
        if (!peer)
                return CMD_WARNING_CONFIG_FAILED;
 
-       as = strtoul(argv[idx_number]->arg, NULL, 10);
-       ret = peer_local_as_set(peer, as, 0, 0);
+       if (!asn_str2asn(argv[idx_number]->arg, &as)) {
+               vty_out(vty, "%% Invalid neighbor local-as value: %s\n",
+                       argv[idx_number]->arg);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       ret = peer_local_as_set(peer, as, 0, 0, argv[idx_number]->arg);
        return bgp_vty_return(vty, ret);
 }
 
 DEFUN (neighbor_local_as_no_prepend,
        neighbor_local_as_no_prepend_cmd,
-       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend",
+       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as ASNUM no-prepend",
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Specify a local-as number\n"
-       "AS number used as local AS\n"
+       "AS number expressed in dotted or plain format used as local AS\n"
        "Do not prepend local-as to updates from ebgp peers\n")
 {
        int idx_peer = 1;
@@ -5037,18 +5119,23 @@ DEFUN (neighbor_local_as_no_prepend,
        if (!peer)
                return CMD_WARNING_CONFIG_FAILED;
 
-       as = strtoul(argv[idx_number]->arg, NULL, 10);
-       ret = peer_local_as_set(peer, as, 1, 0);
+       if (!asn_str2asn(argv[idx_number]->arg, &as)) {
+               vty_out(vty, "%% Invalid neighbor local-as value: %s\n",
+                       argv[idx_number]->arg);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       ret = peer_local_as_set(peer, as, 1, 0, argv[idx_number]->arg);
        return bgp_vty_return(vty, ret);
 }
 
 DEFUN (neighbor_local_as_no_prepend_replace_as,
        neighbor_local_as_no_prepend_replace_as_cmd,
-       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend replace-as",
+       "neighbor <A.B.C.D|X:X::X:X|WORD> local-as ASNUM no-prepend replace-as",
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Specify a local-as number\n"
-       "AS number used as local AS\n"
+       "AS number expressed in dotted or plain format used as local AS\n"
        "Do not prepend local-as to updates from ebgp peers\n"
        "Do not prepend local-as to updates from ibgp peers\n")
 {
@@ -5062,19 +5149,24 @@ DEFUN (neighbor_local_as_no_prepend_replace_as,
        if (!peer)
                return CMD_WARNING_CONFIG_FAILED;
 
-       as = strtoul(argv[idx_number]->arg, NULL, 10);
-       ret = peer_local_as_set(peer, as, 1, 1);
+       if (!asn_str2asn(argv[idx_number]->arg, &as)) {
+               vty_out(vty, "%% Invalid neighbor local-as value: %s\n",
+                       argv[idx_number]->arg);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       ret = peer_local_as_set(peer, as, 1, 1, argv[idx_number]->arg);
        return bgp_vty_return(vty, ret);
 }
 
 DEFUN (no_neighbor_local_as,
        no_neighbor_local_as_cmd,
-       "no neighbor <A.B.C.D|X:X::X:X|WORD> local-as [(1-4294967295) [no-prepend [replace-as]]]",
+       "no neighbor <A.B.C.D|X:X::X:X|WORD> local-as [ASNUM [no-prepend [replace-as]]]",
        NO_STR
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Specify a local-as number\n"
-       "AS number used as local AS\n"
+       "AS number expressed in dotted or plain format used as local AS\n"
        "Do not prepend local-as to updates from ebgp peers\n"
        "Do not prepend local-as to updates from ibgp peers\n")
 {
@@ -5554,6 +5646,30 @@ DEFUN (no_neighbor_capability_enhe,
                                   PEER_FLAG_CAPABILITY_ENHE);
 }
 
+/* neighbor capability software-version */
+DEFPY(neighbor_capability_software_version,
+      neighbor_capability_software_version_cmd,
+      "[no$no] neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor capability software-version",
+      NO_STR
+      NEIGHBOR_STR
+      NEIGHBOR_ADDR_STR2
+      "Advertise capability to the peer\n"
+      "Advertise Software Version capability to the peer\n")
+{
+       struct peer *peer;
+
+       peer = peer_and_group_lookup_vty(vty, neighbor);
+       if (peer && peer->conf_if)
+               return CMD_SUCCESS;
+
+       if (no)
+               return peer_flag_unset_vty(vty, neighbor,
+                                          PEER_FLAG_CAPABILITY_SOFT_VERSION);
+       else
+               return peer_flag_set_vty(vty, neighbor,
+                                        PEER_FLAG_CAPABILITY_SOFT_VERSION);
+}
+
 static int peer_af_flag_modify_vty(struct vty *vty, const char *peer_str,
                                   afi_t afi, safi_t safi, uint32_t flag,
                                   int set)
@@ -8819,6 +8935,59 @@ DEFPY(no_neighbor_path_attribute_discard,
        return CMD_SUCCESS;
 }
 
+DEFPY(neighbor_path_attribute_treat_as_withdraw,
+      neighbor_path_attribute_treat_as_withdraw_cmd,
+      "neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor path-attribute treat-as-withdraw (1-255)...",
+      NEIGHBOR_STR
+      NEIGHBOR_ADDR_STR2
+      "Manipulate path attributes from incoming UPDATE messages\n"
+      "Treat-as-withdraw any incoming BGP UPDATE messages that contain the specified attribute\n"
+      "Attribute number\n")
+{
+       struct peer *peer;
+       int idx = 0;
+       const char *withdraw_attrs = NULL;
+
+       peer = peer_and_group_lookup_vty(vty, neighbor);
+       if (!peer)
+               return CMD_WARNING_CONFIG_FAILED;
+
+       argv_find(argv, argc, "(1-255)", &idx);
+       if (idx)
+               withdraw_attrs = argv_concat(argv, argc, idx);
+
+       bgp_path_attribute_withdraw_vty(vty, peer, withdraw_attrs, true);
+
+       return CMD_SUCCESS;
+}
+
+DEFPY(no_neighbor_path_attribute_treat_as_withdraw,
+      no_neighbor_path_attribute_treat_as_withdraw_cmd,
+      "no neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor path-attribute treat-as-withdraw (1-255)...",
+      NO_STR
+      NEIGHBOR_STR
+      NEIGHBOR_ADDR_STR2
+      "Manipulate path attributes from incoming UPDATE messages\n"
+      "Treat-as-withdraw any incoming BGP UPDATE messages that contain the specified attribute\n"
+      "Attribute number\n")
+{
+       struct peer *peer;
+       int idx = 0;
+       const char *withdraw_attrs = NULL;
+
+       peer = peer_and_group_lookup_vty(vty, neighbor);
+       if (!peer)
+               return CMD_WARNING_CONFIG_FAILED;
+
+       argv_find(argv, argc, "(1-255)", &idx);
+       if (idx)
+               withdraw_attrs = argv_concat(argv, argc, idx);
+
+       bgp_path_attribute_withdraw_vty(vty, peer, withdraw_attrs, false);
+
+       return CMD_SUCCESS;
+}
+
 static int set_ecom_list(struct vty *vty, int argc, struct cmd_token **argv,
                         struct ecommunity **list, bool is_rt6)
 {
@@ -8937,10 +9106,13 @@ DEFPY (af_rd_vpn_export,
                           bgp_get_default(), bgp);
 
        if (yes) {
+               bgp->vpn_policy[afi].tovpn_rd_pretty =
+                       XSTRDUP(MTYPE_BGP, rd_str);
                bgp->vpn_policy[afi].tovpn_rd = prd;
                SET_FLAG(bgp->vpn_policy[afi].flags,
                         BGP_VPN_POLICY_TOVPN_RD_SET);
        } else {
+               XFREE(MTYPE_BGP, bgp->vpn_policy[afi].tovpn_rd_pretty);
                UNSET_FLAG(bgp->vpn_policy[afi].flags,
                           BGP_VPN_POLICY_TOVPN_RD_SET);
        }
@@ -9465,7 +9637,8 @@ DEFPY(af_import_vrf_route_map, af_import_vrf_route_map_cmd,
 
                /* Auto-create assuming the same AS */
                ret = bgp_get_vty(&bgp_default, &as, NULL,
-                                 BGP_INSTANCE_TYPE_DEFAULT);
+                                 BGP_INSTANCE_TYPE_DEFAULT, NULL,
+                                 ASNOTATION_UNDEFINED);
 
                if (ret) {
                        vty_out(vty,
@@ -9577,7 +9750,8 @@ DEFPY(bgp_imexport_vrf, bgp_imexport_vrf_cmd,
        if (!bgp_default) {
                /* Auto-create assuming the same AS */
                ret = bgp_get_vty(&bgp_default, &as, NULL,
-                                 BGP_INSTANCE_TYPE_DEFAULT);
+                                 BGP_INSTANCE_TYPE_DEFAULT, NULL,
+                                 ASNOTATION_UNDEFINED);
 
                if (ret) {
                        vty_out(vty,
@@ -9592,8 +9766,8 @@ DEFPY(bgp_imexport_vrf, bgp_imexport_vrf_cmd,
                        vrf_bgp = bgp_default;
                else
                        /* Auto-create assuming the same AS */
-                       ret = bgp_get_vty(&vrf_bgp, &as, import_name, bgp_type);
-
+                       ret = bgp_get_vty(&vrf_bgp, &as, import_name, bgp_type,
+                                         NULL, ASNOTATION_UNDEFINED);
                if (ret) {
                        vty_out(vty,
                                "VRF %s is not configured as a bgp instance\n",
@@ -10061,7 +10235,7 @@ static int bgp_clear_prefix(struct vty *vty, const char *view_name,
 /* one clear bgp command to rule them all */
 DEFUN (clear_ip_bgp_all,
        clear_ip_bgp_all_cmd,
-       "clear [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6|l2vpn> [<unicast|multicast|vpn|labeled-unicast|flowspec|evpn>]] <*|A.B.C.D$neighbor|X:X::X:X$neighbor|WORD$neighbor|(1-4294967295)|external|peer-group PGNAME> [<soft [<in|out>]|in [prefix-filter]|out|message-stats>]",
+       "clear [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6|l2vpn> [<unicast|multicast|vpn|labeled-unicast|flowspec|evpn>]] <*|A.B.C.D$neighbor|X:X::X:X$neighbor|WORD$neighbor|ASNUM|external|peer-group PGNAME> [<soft [<in|out>]|in [prefix-filter]|out|message-stats>]",
        CLEAR_STR
        IP_STR
        BGP_STR
@@ -10074,7 +10248,7 @@ DEFUN (clear_ip_bgp_all,
        "BGP IPv4 neighbor to clear\n"
        "BGP IPv6 neighbor to clear\n"
        "BGP neighbor on interface to clear\n"
-       "Clear peers with the AS number\n"
+       "Clear peers with the AS number in plain or dotted format\n"
        "Clear all external peers\n"
        "Clear all members of peer-group\n"
        "BGP peer-group name\n"
@@ -10115,7 +10289,7 @@ DEFUN (clear_ip_bgp_all,
        if (argv_find_and_parse_afi(argv, argc, &idx, &afi))
                argv_find_and_parse_safi(argv, argc, &idx, &safi);
 
-       /* <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group PGNAME> */
+       /* <*|A.B.C.D|X:X::X:X|WORD|ASNUM|external|peer-group PGNAME> */
        if (argv_find(argv, argc, "*", &idx)) {
                clr_sort = clear_all;
        } else if (argv_find(argv, argc, "A.B.C.D", &idx)) {
@@ -10134,7 +10308,7 @@ DEFUN (clear_ip_bgp_all,
        } else if (argv_find(argv, argc, "WORD", &idx)) {
                clr_sort = clear_peer;
                clr_arg = argv[idx]->arg;
-       } else if (argv_find(argv, argc, "(1-4294967295)", &idx)) {
+       } else if (argv_find(argv, argc, "ASNUM", &idx)) {
                clr_sort = clear_as;
                clr_arg = argv[idx]->arg;
        } else if (argv_find(argv, argc, "external", &idx)) {
@@ -10272,8 +10446,8 @@ DEFUN (show_bgp_views,
                /* Skip VRFs. */
                if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF)
                        continue;
-               vty_out(vty, "\t%s (AS%u)\n", bgp->name ? bgp->name : "(null)",
-                       bgp->as);
+               vty_out(vty, "\t%s (AS%s)\n", bgp->name ? bgp->name : "(null)",
+                       bgp->as_pretty);
        }
 
        return CMD_SUCCESS;
@@ -10759,6 +10933,9 @@ static void bgp_show_peer_reset(struct vty * vty, struct peer *peer,
                                       peer_down_str[(int)peer->last_reset]);
                json_object_int_add(json_peer, "lastResetCode",
                                    peer->last_reset);
+               json_object_string_add(json_peer, "softwareVersion",
+                                      peer->soft_version ? peer->soft_version
+                                                         : "n/a");
        } else {
                if (peer->last_reset == PEER_DOWN_NOTIFY_SEND
                    || peer->last_reset == PEER_DOWN_NOTIFY_RECEIVED) {
@@ -10777,8 +10954,10 @@ static void bgp_show_peer_reset(struct vty * vty, struct peer *peer,
                                                  BGP_NOTIFY_CEASE_HARD_RESET)
                                        : "");
                } else {
-                       vty_out(vty, " %s\n",
-                               peer_down_str[(int)peer->last_reset]);
+                       vty_out(vty, "  %s (%s)\n",
+                               peer_down_str[(int)peer->last_reset],
+                               peer->soft_version ? peer->soft_version
+                                                  : "n/a");
                }
        }
 }
@@ -11054,7 +11233,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                json_object_string_addf(json, "routerId",
                                                        "%pI4",
                                                        &bgp->router_id);
-                               json_object_int_add(json, "as", bgp->as);
+                               asn_asn2json(json, "as", bgp->as,
+                                            bgp->asnotation);
                                json_object_int_add(json, "vrfId", vrf_id_ui);
                                json_object_string_add(
                                        json, "vrfName",
@@ -11064,8 +11244,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                : bgp->name);
                        } else {
                                vty_out(vty,
-                                       "BGP router identifier %pI4, local AS number %u vrf-id %d",
-                                       &bgp->router_id, bgp->as,
+                                       "BGP router identifier %pI4, local AS number %s vrf-id %d",
+                                       &bgp->router_id, bgp->as_pretty,
                                        bgp->vrf_id == VRF_UNKNOWN
                                                ? -1
                                                : (int)bgp->vrf_id);
@@ -11299,12 +11479,13 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                        json_object_string_add(json_peer, "domainname",
                                                               peer->domainname);
 
-                               json_object_int_add(json_peer, "remoteAs", peer->as);
-                               json_object_int_add(
-                                       json_peer, "localAs",
-                                       peer->change_local_as
-                                               ? peer->change_local_as
-                                               : peer->local_as);
+                               asn_asn2json(json_peer, "remoteAs", peer->as,
+                                            bgp->asnotation);
+                               asn_asn2json(json_peer, "localAs",
+                                            peer->change_local_as
+                                                    ? peer->change_local_as
+                                                    : peer->local_as,
+                                            bgp->asnotation);
                                json_object_int_add(json_peer, "version", 4);
                                json_object_int_add(json_peer, "msgRcvd",
                                                    PEER_TOTAL_RX(peer));
@@ -11484,14 +11665,19 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                        &peer->ibuf->count,
                                        memory_order_relaxed);
 
-                               if (show_wide)
+                               vty_out(vty, "4 ");
+                               vty_out(vty, ASN_FORMAT_SPACE(bgp->asnotation),
+                                       &peer->as);
+                               if (show_wide) {
                                        vty_out(vty,
-                                               "4 %10u %10u %9u %9u %8" PRIu64
-                                               " %4zu %4zu %8s",
-                                               peer->as,
+                                               ASN_FORMAT_SPACE(
+                                                       bgp->asnotation),
                                                peer->change_local_as
-                                                       ? peer->change_local_as
-                                                       : peer->local_as,
+                                                       ? &peer->change_local_as
+                                                       : &peer->local_as);
+                                       vty_out(vty,
+                                               " %9u %9u %8" PRIu64
+                                               " %4zu %4zu %8s",
                                                PEER_TOTAL_RX(peer),
                                                PEER_TOTAL_TX(peer),
                                                peer->version[afi][safi],
@@ -11500,10 +11686,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                            timebuf,
                                                            BGP_UPTIME_LEN, 0,
                                                            NULL));
-                               else
-                                       vty_out(vty, "4 %10u %9u %9u %8" PRIu64
-                                                    " %4zu %4zu %8s",
-                                               peer->as, PEER_TOTAL_RX(peer),
+                               } else {
+                                       vty_out(vty,
+                                               " %9u %9u %8" PRIu64
+                                               " %4zu %4zu %8s",
+                                               PEER_TOTAL_RX(peer),
                                                PEER_TOTAL_TX(peer),
                                                peer->version[afi][safi],
                                                inq_count, outq_count,
@@ -11511,7 +11698,7 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                            timebuf,
                                                            BGP_UPTIME_LEN, 0,
                                                            NULL));
-
+                               }
                                if (peer_established(peer)) {
                                        if (peer->afc_recv[afi][safi]) {
                                                if (CHECK_FLAG(
@@ -11804,7 +11991,7 @@ int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi,
 DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd,
       "show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
       " [" BGP_SAFI_WITH_LABEL_CMD_STR
-      "]] [all$all] summary [established|failed] [<neighbor <A.B.C.D|X:X::X:X|WORD>|remote-as <(1-4294967295)|internal|external>>] [terse] [wide] [json$uj]",
+      "]] [all$all] summary [established|failed] [<neighbor <A.B.C.D|X:X::X:X|WORD>|remote-as <ASNUM|internal|external>>] [terse] [wide] [json$uj]",
       SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
              BGP_SAFI_WITH_LABEL_HELP_STR
       "Display the entries for all address families\n"
@@ -11815,8 +12002,7 @@ DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd,
       "Neighbor to display information about\n"
       "Neighbor to display information about\n"
       "Neighbor on BGP configured interface\n"
-      "Show only the specified remote AS sessions\n"
-      "AS number\n"
+      "Show only the specified remote AS sessions\n" AS_STR
       "Internal (iBGP) AS sessions\n"
       "External (eBGP) AS sessions\n"
       "Shorten the information on BGP instances\n"
@@ -11858,8 +12044,12 @@ DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd,
                        as_type = AS_INTERNAL;
                else if (argv[idx + 1]->arg[0] == 'e')
                        as_type = AS_EXTERNAL;
-               else
-                       as = (as_t)atoi(argv[idx + 1]->arg);
+               else if (!asn_str2asn(argv[idx + 1]->arg, &as)) {
+                       vty_out(vty,
+                               "%% Invalid neighbor remote-as value: %s\n",
+                               argv[idx + 1]->arg);
+                       return CMD_SUCCESS;
+               }
        }
 
        if (argv_find(argv, argc, "terse", &idx))
@@ -12994,13 +13184,14 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                        json_object_string_addf(json_neigh, "bgpNeighborAddr",
                                                "%pSU", &p->su);
 
-               json_object_int_add(json_neigh, "remoteAs", p->as);
+               asn_asn2json(json_neigh, "remoteAs", p->as, bgp->asnotation);
 
                if (p->change_local_as)
-                       json_object_int_add(json_neigh, "localAs",
-                                           p->change_local_as);
+                       asn_asn2json(json_neigh, "localAs", p->change_local_as,
+                                    bgp->asnotation);
                else
-                       json_object_int_add(json_neigh, "localAs", p->local_as);
+                       asn_asn2json(json_neigh, "localAs", p->local_as,
+                                    bgp->asnotation);
 
                if (CHECK_FLAG(p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND))
                        json_object_boolean_true_add(json_neigh,
@@ -13010,13 +13201,19 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                        json_object_boolean_true_add(json_neigh,
                                                     "localAsReplaceAs");
        } else {
-               if ((p->as_type == AS_SPECIFIED) || (p->as_type == AS_EXTERNAL)
-                   || (p->as_type == AS_INTERNAL))
-                       vty_out(vty, "remote AS %u, ", p->as);
-               else
+               if ((p->as_type == AS_SPECIFIED) ||
+                   (p->as_type == AS_EXTERNAL) ||
+                   (p->as_type == AS_INTERNAL)) {
+                       vty_out(vty, "remote AS ");
+                       vty_out(vty, ASN_FORMAT(bgp->asnotation), &p->as);
+                       vty_out(vty, ", ");
+               } else
                        vty_out(vty, "remote AS Unspecified, ");
-               vty_out(vty, "local AS %u%s%s, ",
-                       p->change_local_as ? p->change_local_as : p->local_as,
+               vty_out(vty, "local AS ");
+               vty_out(vty, ASN_FORMAT(bgp->asnotation),
+                       p->change_local_as ? &p->change_local_as
+                                          : &p->local_as);
+               vty_out(vty, "%s%s, ",
                        CHECK_FLAG(p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND)
                                ? " no-prepend"
                                : "",
@@ -13778,6 +13975,27 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                        json_object_object_add(json_cap, "hostName",
                                               json_hname);
 
+                       /* Software Version capability */
+                       json_object *json_soft_version = NULL;
+
+                       json_soft_version = json_object_new_object();
+
+                       if (CHECK_FLAG(p->cap, PEER_CAP_SOFT_VERSION_ADV))
+                               json_object_string_add(
+                                       json_soft_version,
+                                       "advertisedSoftwareVersion",
+                                       cmd_software_version_get());
+
+                       if (CHECK_FLAG(p->cap, PEER_CAP_SOFT_VERSION_RCV))
+                               json_object_string_add(
+                                       json_soft_version,
+                                       "receivedSoftwareVersion",
+                                       p->soft_version ? p->soft_version
+                                                       : "n/a");
+
+                       json_object_object_add(json_cap, "softwareVersion",
+                                              json_soft_version);
+
                        /* Graceful Restart */
                        if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV) ||
                            CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV)) {
@@ -14153,6 +14371,25 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
 
                        vty_out(vty, "\n");
 
+                       /* Software Version capability */
+                       vty_out(vty, "    Version Capability:");
+
+                       if (CHECK_FLAG(p->cap, PEER_CAP_SOFT_VERSION_ADV)) {
+                               vty_out(vty,
+                                       " advertised software version (%s)",
+                                       cmd_software_version_get());
+                       } else
+                               vty_out(vty, " not advertised");
+
+                       if (CHECK_FLAG(p->cap, PEER_CAP_SOFT_VERSION_RCV)) {
+                               vty_out(vty, " received software version (%s)",
+                                       p->soft_version ? p->soft_version
+                                                       : "n/a");
+                       } else
+                               vty_out(vty, " not received");
+
+                       vty_out(vty, "\n");
+
                        /* Graceful Restart */
                        if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV) ||
                            CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV)) {
@@ -15449,10 +15686,9 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
                                                json_object_new_string(vname));
                        json_object_object_add(json, "exportToVrfs",
                                               json_export_vrfs);
-                       json_object_string_addf(json, "routeDistinguisher",
-                                               "%pRD",
-                                               &bgp->vpn_policy[afi].tovpn_rd);
-
+                       json_object_string_addf(
+                               json, "routeDistinguisher", "%s",
+                               bgp->vpn_policy[afi].tovpn_rd_pretty);
                        dir = BGP_VPN_POLICY_DIR_TOVPN;
                        if (bgp->vpn_policy[afi].rtlist[dir]) {
                                ecom_str = ecommunity_ecom2str(
@@ -15520,8 +15756,10 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
                                                node, vname))
                                vty_out(vty, "  %s\n", vname);
 
-                       vty_out(vty, "RD: %pRD\n",
+                       vty_out(vty, "RD: ");
+                       vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation),
                                &bgp->vpn_policy[afi].tovpn_rd);
+                       vty_out(vty, "\n");
 
                        dir = BGP_VPN_POLICY_DIR_TOVPN;
                        if (bgp->vpn_policy[afi].rtlist[dir]) {
@@ -15886,18 +16124,22 @@ static int bgp_show_one_peer_group(struct vty *vty, struct peer_group *group,
 
        if (conf->as_type == AS_SPECIFIED || conf->as_type == AS_EXTERNAL) {
                if (json)
-                       json_object_int_add(json_peer_group, "remoteAs",
-                                           conf->as);
-               else
-                       vty_out(vty, "\nBGP peer-group %s, remote AS %u\n",
-                               group->name, conf->as);
+                       asn_asn2json(json_peer_group, "remoteAs", conf->as,
+                                    bgp_get_asnotation(conf->bgp));
+               else {
+                       vty_out(vty, "\nBGP peer-group %s, remote AS ",
+                               group->name);
+                       vty_out(vty, ASN_FORMAT(bgp_get_asnotation(conf->bgp)),
+                               &conf->as);
+                       vty_out(vty, "\n");
+               }
        } else if (conf->as_type == AS_INTERNAL) {
                if (json)
-                       json_object_int_add(json_peer_group, "remoteAs",
-                                           group->bgp->as);
+                       asn_asn2json(json, "remoteAs", group->bgp->as,
+                                    group->bgp->asnotation);
                else
-                       vty_out(vty, "\nBGP peer-group %s, remote AS %u\n",
-                               group->name, group->bgp->as);
+                       vty_out(vty, "\nBGP peer-group %s, remote AS %s\n",
+                               group->name, group->bgp->as_pretty);
        } else {
                if (!json)
                        vty_out(vty, "\nBGP peer-group %s\n", group->name);
@@ -16893,7 +17135,7 @@ static void bgp_config_write_redistribute(struct vty *vty, struct bgp *bgp,
 
 /* peer-group helpers for config-write */
 
-static bool peergroup_flag_check(struct peer *peer, uint64_t flag)
+bool peergroup_flag_check(struct peer *peer, uint64_t flag)
 {
        if (!peer_group_active(peer)) {
                if (CHECK_FLAG(peer->flags_invert, flag))
@@ -17020,8 +17262,8 @@ static void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp,
        }
 
        if (CHECK_FLAG(bgp->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_RD_SET))
-               vty_out(vty, "%*srd vpn export %pRD\n", indent, "",
-                       &bgp->vpn_policy[afi].tovpn_rd);
+               vty_out(vty, "%*srd vpn export %s\n", indent, "",
+                       bgp->vpn_policy[afi].tovpn_rd_pretty);
 
        if (CHECK_FLAG(bgp->vpn_policy[afi].flags,
                       BGP_VPN_POLICY_TOVPN_NEXTHOP_SET)) {
@@ -17191,7 +17433,7 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
                        vty_out(vty, " peer-group %s", peer->group->name);
                        if_pg_printed = true;
                } else if (peer->as_type == AS_SPECIFIED) {
-                       vty_out(vty, " remote-as %u", peer->as);
+                       vty_out(vty, " remote-as %s", peer->as_pretty);
                        if_ras_printed = true;
                } else if (peer->as_type == AS_INTERNAL) {
                        vty_out(vty, " remote-as internal");
@@ -17211,8 +17453,8 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
 
                if (g_peer->as_type == AS_UNSPECIFIED && !if_ras_printed) {
                        if (peer->as_type == AS_SPECIFIED) {
-                               vty_out(vty, " neighbor %s remote-as %u\n",
-                                       addr, peer->as);
+                               vty_out(vty, " neighbor %s remote-as %s\n",
+                                       addr, peer->as_pretty);
                        } else if (peer->as_type == AS_INTERNAL) {
                                vty_out(vty,
                                        " neighbor %s remote-as internal\n",
@@ -17240,8 +17482,8 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
 
                if (!if_ras_printed) {
                        if (peer->as_type == AS_SPECIFIED) {
-                               vty_out(vty, " neighbor %s remote-as %u\n",
-                                       addr, peer->as);
+                               vty_out(vty, " neighbor %s remote-as %s\n",
+                                       addr, peer->as_pretty);
                        } else if (peer->as_type == AS_INTERNAL) {
                                vty_out(vty,
                                        " neighbor %s remote-as internal\n",
@@ -17256,8 +17498,8 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
 
        /* local-as */
        if (peergroup_flag_check(peer, PEER_FLAG_LOCAL_AS)) {
-               vty_out(vty, " neighbor %s local-as %u", addr,
-                       peer->change_local_as);
+               vty_out(vty, " neighbor %s local-as %s", addr,
+                       peer->change_local_as_pretty);
                if (peergroup_flag_check(peer, PEER_FLAG_LOCAL_AS_NO_PREPEND))
                        vty_out(vty, " no-prepend");
                if (peergroup_flag_check(peer, PEER_FLAG_LOCAL_AS_REPLACE_AS))
@@ -17433,6 +17675,11 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
                                addr);
        }
 
+       /* capability software-version */
+       if (peergroup_flag_check(peer, PEER_FLAG_CAPABILITY_SOFT_VERSION))
+               vty_out(vty, " neighbor %s capability software-version\n",
+                       addr);
+
        /* dont-capability-negotiation */
        if (peergroup_flag_check(peer, PEER_FLAG_DONT_CAPABILITY))
                vty_out(vty, " neighbor %s dont-capability-negotiate\n", addr);
@@ -17459,6 +17706,16 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
                vty_out(vty, " neighbor %s path-attribute discard %s\n", addr,
                        discard_attrs_str);
 
+       /* path-attribute treat-as-withdraw */
+       char withdraw_attrs_str[BUFSIZ] = {0};
+       bool withdraw_attrs = bgp_path_attribute_treat_as_withdraw(
+               peer, withdraw_attrs_str, sizeof(withdraw_attrs_str));
+
+       if (withdraw_attrs)
+               vty_out(vty,
+                       " neighbor %s path-attribute treat-as-withdraw %s\n",
+                       addr, withdraw_attrs_str);
+
        if (!CHECK_FLAG(peer->peer_gr_new_status_flag,
                        PEER_GRACEFUL_RESTART_NEW_STATE_INHERIT)) {
 
@@ -17923,12 +18180,16 @@ int bgp_config_write(struct vty *vty)
                        continue;
 
                /* Router bgp ASN */
-               vty_out(vty, "router bgp %u", bgp->as);
+               vty_out(vty, "router bgp %s", bgp->as_pretty);
 
                if (bgp->name)
                        vty_out(vty, " %s %s",
                                (bgp->inst_type  == BGP_INSTANCE_TYPE_VIEW)
                                ? "view" : "vrf", bgp->name);
+               if (CHECK_FLAG(bgp->config, BGP_CONFIG_ASNOTATION))
+                       vty_out(vty, " as-notation %s",
+                               asn_mode2str(bgp->asnotation));
+
                vty_out(vty, "\n");
 
                /* BGP fast-external-failover. */
@@ -18046,8 +18307,8 @@ int bgp_config_write(struct vty *vty)
 
                /* Confederation identifier*/
                if (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION))
-                       vty_out(vty, " bgp confederation identifier %u\n",
-                               bgp->confed_id);
+                       vty_out(vty, " bgp confederation identifier %s\n",
+                               bgp->confed_id_pretty);
 
                /* Confederation peer */
                if (bgp->confed_peers_cnt > 0) {
@@ -18056,7 +18317,8 @@ int bgp_config_write(struct vty *vty)
                        vty_out(vty, " bgp confederation peers");
 
                        for (i = 0; i < bgp->confed_peers_cnt; i++)
-                               vty_out(vty, " %u", bgp->confed_peers[i]);
+                               vty_out(vty, " %s",
+                                       bgp->confed_peers[i].as_pretty);
 
                        vty_out(vty, "\n");
                }
@@ -19570,6 +19832,12 @@ void bgp_vty_init(void)
        install_element(BGP_NODE, &neighbor_path_attribute_discard_cmd);
        install_element(BGP_NODE, &no_neighbor_path_attribute_discard_cmd);
 
+       /* "neighbor path-attribute treat-as-withdraw" commands. */
+       install_element(BGP_NODE,
+                       &neighbor_path_attribute_treat_as_withdraw_cmd);
+       install_element(BGP_NODE,
+                       &no_neighbor_path_attribute_treat_as_withdraw_cmd);
+
        /* "neighbor passive" commands. */
        install_element(BGP_NODE, &neighbor_passive_cmd);
        install_element(BGP_NODE, &no_neighbor_passive_cmd);
@@ -19587,6 +19855,9 @@ void bgp_vty_init(void)
        install_element(BGP_NODE, &neighbor_capability_enhe_cmd);
        install_element(BGP_NODE, &no_neighbor_capability_enhe_cmd);
 
+       /* "neighbor capability software-version" commands.*/
+       install_element(BGP_NODE, &neighbor_capability_software_version_cmd);
+
        /* "neighbor capability orf prefix-list" commands.*/
        install_element(BGP_NODE, &neighbor_capability_orf_prefix_hidden_cmd);
        install_element(BGP_NODE,
index 019789dff84a8e86a54efae7c3f487d6c99dece6..826723b92dd74a9a4e6cb6a7c04cf34fd746015e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP VTY interface.
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_VTY_H
@@ -43,6 +28,9 @@ struct bgp;
        BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR            \
                BGP_AF_MODIFIER_STR BGP_AF_MODIFIER_STR
 
+#define BGP_SELF_ORIG_CMD_STR       "self-originate"
+#define BGP_SELF_ORIG_HELP_STR      "Display only self-originated routes\n"
+
 #define SHOW_GR_HEADER \
        "Codes: GR - Graceful Restart," \
        " * -  Inheriting Global GR Config,\n" \
@@ -150,7 +138,8 @@ extern void bgp_vty_init(void);
 extern void community_alias_vty(void);
 extern const char *get_afi_safi_str(afi_t afi, safi_t safi, bool for_json);
 extern int bgp_get_vty(struct bgp **bgp, as_t *as, const char *name,
-                      enum bgp_instance_type inst_type);
+                      enum bgp_instance_type inst_type, const char *as_pretty,
+                      enum asnotation_mode asnotation);
 extern void bgp_config_write_update_delay(struct vty *vty, struct bgp *bgp);
 extern void bgp_config_write_wpkt_quanta(struct vty *vty, struct bgp *bgp);
 extern void bgp_config_write_rpkt_quanta(struct vty *vty, struct bgp *bgp);
@@ -181,5 +170,6 @@ int bgp_vty_find_and_parse_bgp(struct vty *vty, struct cmd_token **argv,
 extern int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi,
                                safi_t safi, const char *neighbor, int as_type,
                                as_t as, uint16_t show_flags);
+extern bool peergroup_flag_check(struct peer *peer, uint64_t flag);
 
 #endif /* _QUAGGA_BGP_VTY_H */
index 95e80ba1bb912611621dbaa8759694ea1a10e517..d05768da05145889941e4c7addb47899968ad44a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra client
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1310,8 +1295,10 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
        struct bgp_path_info local_info;
        struct bgp_path_info *mpinfo_cp = &local_info;
        route_tag_t tag;
-       mpls_label_t label;
        struct bgp_sid_info *sid_info;
+       mpls_label_t *labels;
+       uint32_t num_labels = 0;
+       mpls_label_t nh_label;
        int nh_othervrf = 0;
        bool nh_updated = false;
        bool do_wt_ecmp;
@@ -1402,8 +1389,11 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
        }
 
        for (; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) {
+               labels = NULL;
+               num_labels = 0;
                uint32_t nh_weight;
                bool is_evpn;
+               bool is_parent_evpn;
 
                if (valid_nh_count >= multipath_num)
                        break;
@@ -1469,13 +1459,13 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
 
                BGP_ORIGINAL_UPDATE(bgp_orig, mpinfo, bgp);
 
-               if (nh_family == AF_INET) {
-                       is_evpn = is_route_parent_evpn(mpinfo);
+               is_parent_evpn = is_route_parent_evpn(mpinfo);
 
+               if (nh_family == AF_INET) {
                        nh_updated = update_ipv4nh_for_route_install(
                                nh_othervrf, bgp_orig,
                                &mpinfo_cp->attr->nexthop, mpinfo_cp->attr,
-                               is_evpn, api_nh);
+                               is_parent_evpn, api_nh);
                } else {
                        ifindex_t ifindex = IFINDEX_INTERNAL;
                        struct in6_addr *nexthop;
@@ -1483,19 +1473,20 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                        nexthop = bgp_path_info_to_ipv6_nexthop(mpinfo_cp,
                                                                &ifindex);
 
-                       is_evpn = is_route_parent_evpn(mpinfo);
-
                        if (!nexthop)
                                nh_updated = update_ipv4nh_for_route_install(
                                        nh_othervrf, bgp_orig,
                                        &mpinfo_cp->attr->nexthop,
-                                       mpinfo_cp->attr, is_evpn, api_nh);
+                                       mpinfo_cp->attr, is_parent_evpn,
+                                       api_nh);
                        else
                                nh_updated = update_ipv6nh_for_route_install(
                                        nh_othervrf, bgp_orig, nexthop, ifindex,
-                                       mpinfo, info, is_evpn, api_nh);
+                                       mpinfo, info, is_parent_evpn, api_nh);
                }
 
+               is_evpn = !!CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN);
+
                /* Did we get proper nexthop info to update zebra? */
                if (!nh_updated)
                        continue;
@@ -1509,16 +1500,28 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                        || mpinfo->peer->sort == BGP_PEER_CONFED))
                        allow_recursion = true;
 
-               if (mpinfo->extra &&
-                   bgp_is_valid_label(&mpinfo->extra->label[0]) &&
-                   !CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) {
-                       mpls_lse_decode(mpinfo->extra->label[0], &label, &ttl,
-                                       &exp, &bos);
+               if (mpinfo->extra) {
+                       labels = mpinfo->extra->label;
+                       num_labels = mpinfo->extra->num_labels;
+               }
+
+               if (labels && (num_labels > 0) &&
+                   (is_evpn || bgp_is_valid_label(&labels[0]))) {
+                       enum lsp_types_t nh_label_type = ZEBRA_LSP_NONE;
 
-                       SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
+                       if (is_evpn) {
+                               nh_label = *bgp_evpn_path_info_labels_get_l3vni(
+                                       labels, num_labels);
+                               nh_label_type = ZEBRA_LSP_EVPN;
+                       } else {
+                               mpls_lse_decode(labels[0], &nh_label, &ttl,
+                                               &exp, &bos);
+                       }
 
+                       SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
                        api_nh->label_num = 1;
-                       api_nh->labels[0] = label;
+                       api_nh->label_type = nh_label_type;
+                       api_nh->labels[0] = nh_label;
                }
 
                if (is_evpn
@@ -1529,27 +1532,26 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
 
                api_nh->weight = nh_weight;
 
-               if (mpinfo->extra &&
-                   bgp_is_valid_label(&mpinfo->extra->label[0]) &&
-                   !sid_zero(&mpinfo->extra->sid[0].sid) &&
-                   !CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) {
+               if (mpinfo->extra && !is_evpn &&
+                   bgp_is_valid_label(&labels[0]) &&
+                   !sid_zero(&mpinfo->extra->sid[0].sid)) {
                        sid_info = &mpinfo->extra->sid[0];
 
                        memcpy(&api_nh->seg6_segs, &sid_info->sid,
                               sizeof(api_nh->seg6_segs));
 
                        if (sid_info->transposition_len != 0) {
-                               mpls_lse_decode(mpinfo->extra->label[0], &label,
-                                               &ttl, &exp, &bos);
+                               mpls_lse_decode(labels[0], &nh_label, &ttl,
+                                               &exp, &bos);
 
-                               if (label < MPLS_LABEL_UNRESERVED_MIN) {
+                               if (nh_label < MPLS_LABEL_UNRESERVED_MIN) {
                                        if (bgp_debug_zebra(&api.prefix))
                                                zlog_debug(
                                                        "skip invalid SRv6 routes: transposition scheme is used, but label is too small");
                                        continue;
                                }
 
-                               transpose_sid(&api_nh->seg6_segs, label,
+                               transpose_sid(&api_nh->seg6_segs, nh_label,
                                              sid_info->transposition_offset,
                                              sid_info->transposition_len);
                        }
index 0a4106941141bdeda4e600c8f13bba9d72accaa3..8a0203c32db1e3a103cfdaa38dc7cc0db2596b45 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra connection and redistribute fucntions.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_ZEBRA_H
index 39010e76f9d1bd164336aa29564af93b72fe9221..f2250f98c3a821c9b45e365cad17b8e97a5f5de3 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP-4, BGP-4+ daemon program
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -568,7 +553,7 @@ void bgp_tcp_keepalive_unset(struct bgp *bgp)
 }
 
 /* BGP confederation configuration.  */
-void bgp_confederation_id_set(struct bgp *bgp, as_t as)
+void bgp_confederation_id_set(struct bgp *bgp, as_t as, const char *as_str)
 {
        struct peer *peer;
        struct listnode *node, *nnode;
@@ -580,6 +565,9 @@ void bgp_confederation_id_set(struct bgp *bgp, as_t as)
        /* Remember - were we doing confederation before? */
        already_confed = bgp_config_check(bgp, BGP_CONFIG_CONFEDERATION);
        bgp->confed_id = as;
+       if (bgp->confed_id_pretty)
+               XFREE(MTYPE_BGP, bgp->confed_id_pretty);
+       bgp->confed_id_pretty = XSTRDUP(MTYPE_BGP, as_str);
        bgp_config_set(bgp, BGP_CONFIG_CONFEDERATION);
 
        /* If we were doing confederation already, this is just an external
@@ -632,6 +620,7 @@ void bgp_confederation_id_unset(struct bgp *bgp)
        struct listnode *node, *nnode;
 
        bgp->confed_id = 0;
+       XFREE(MTYPE_BGP, bgp->confed_id_pretty);
        bgp_config_unset(bgp, BGP_CONFIG_CONFEDERATION);
 
        for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
@@ -659,14 +648,14 @@ bool bgp_confederation_peers_check(struct bgp *bgp, as_t as)
                return false;
 
        for (i = 0; i < bgp->confed_peers_cnt; i++)
-               if (bgp->confed_peers[i] == as)
+               if (bgp->confed_peers[i].as == as)
                        return true;
 
        return false;
 }
 
 /* Add an AS to the confederation set.  */
-void bgp_confederation_peers_add(struct bgp *bgp, as_t as)
+void bgp_confederation_peers_add(struct bgp *bgp, as_t as, const char *as_str)
 {
        struct peer *peer;
        struct listnode *node, *nnode;
@@ -677,11 +666,13 @@ void bgp_confederation_peers_add(struct bgp *bgp, as_t as)
        if (bgp_confederation_peers_check(bgp, as))
                return;
 
-       bgp->confed_peers =
-               XREALLOC(MTYPE_BGP_CONFED_LIST, bgp->confed_peers,
-                        (bgp->confed_peers_cnt + 1) * sizeof(as_t));
+       bgp->confed_peers = XREALLOC(MTYPE_BGP_CONFED_LIST, bgp->confed_peers,
+                                    (bgp->confed_peers_cnt + 1) *
+                                            sizeof(struct as_confed));
 
-       bgp->confed_peers[bgp->confed_peers_cnt] = as;
+       bgp->confed_peers[bgp->confed_peers_cnt].as = as;
+       bgp->confed_peers[bgp->confed_peers_cnt].as_pretty =
+               XSTRDUP(MTYPE_BGP, as_str);
        bgp->confed_peers_cnt++;
 
        if (bgp_config_check(bgp, BGP_CONFIG_CONFEDERATION)) {
@@ -718,9 +709,15 @@ void bgp_confederation_peers_remove(struct bgp *bgp, as_t as)
                return;
 
        for (i = 0; i < bgp->confed_peers_cnt; i++)
-               if (bgp->confed_peers[i] == as)
-                       for (j = i + 1; j < bgp->confed_peers_cnt; j++)
-                               bgp->confed_peers[j - 1] = bgp->confed_peers[j];
+               if (bgp->confed_peers[i].as == as) {
+                       XFREE(MTYPE_BGP, bgp->confed_peers[i].as_pretty);
+                       for (j = i + 1; j < bgp->confed_peers_cnt; j++) {
+                               bgp->confed_peers[j - 1].as =
+                                       bgp->confed_peers[j].as;
+                               bgp->confed_peers[j - 1].as_pretty =
+                                       bgp->confed_peers[j].as_pretty;
+                       }
+               }
 
        bgp->confed_peers_cnt--;
 
@@ -729,9 +726,9 @@ void bgp_confederation_peers_remove(struct bgp *bgp, as_t as)
                        XFREE(MTYPE_BGP_CONFED_LIST, bgp->confed_peers);
                bgp->confed_peers = NULL;
        } else
-               bgp->confed_peers =
-                       XREALLOC(MTYPE_BGP_CONFED_LIST, bgp->confed_peers,
-                                bgp->confed_peers_cnt * sizeof(as_t));
+               bgp->confed_peers = XREALLOC(
+                       MTYPE_BGP_CONFED_LIST, bgp->confed_peers,
+                       bgp->confed_peers_cnt * sizeof(struct as_confed));
 
        /* Now reset any peer who's remote AS has just been removed from the
           CONFED */
@@ -1178,6 +1175,8 @@ static void peer_free(struct peer *peer)
 
        XFREE(MTYPE_PEER_CONF_IF, peer->conf_if);
 
+       XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
+
        /* Remove BFD configuration. */
        if (peer->bfd_config)
                bgp_peer_remove_bfd_config(peer);
@@ -1185,6 +1184,11 @@ static void peer_free(struct peer *peer)
        FOREACH_AFI_SAFI (afi, safi)
                bgp_addpath_set_peer_type(peer, afi, safi, BGP_ADDPATH_NONE);
 
+       if (peer->change_local_as_pretty)
+               XFREE(MTYPE_BGP, peer->change_local_as_pretty);
+       if (peer->as_pretty)
+               XFREE(MTYPE_BGP, peer->as_pretty);
+
        bgp_unlock(peer->bgp);
 
        memset(peer, 0, sizeof(struct peer));
@@ -1766,7 +1770,7 @@ void bgp_recalculate_all_bestpaths(struct bgp *bgp)
 struct peer *peer_create(union sockunion *su, const char *conf_if,
                         struct bgp *bgp, as_t local_as, as_t remote_as,
                         int as_type, struct peer_group *group,
-                        bool config_node)
+                        bool config_node, const char *as_str)
 {
        int active;
        struct peer *peer;
@@ -1791,6 +1795,9 @@ struct peer *peer_create(union sockunion *su, const char *conf_if,
        }
        peer->local_as = local_as;
        peer->as = remote_as;
+       /* internal and external values do not use as_pretty */
+       if (as_str && asn_str2asn(as_str, NULL))
+               peer->as_pretty = XSTRDUP(MTYPE_BGP, as_str);
        peer->as_type = as_type;
        peer->local_id = bgp->router_id;
        peer->v_holdtime = bgp->default_holdtime;
@@ -1894,7 +1901,8 @@ bool bgp_afi_safi_peer_exists(struct bgp *bgp, afi_t afi, safi_t safi)
 }
 
 /* Change peer's AS number.  */
-void peer_as_change(struct peer *peer, as_t as, int as_specified)
+void peer_as_change(struct peer *peer, as_t as, int as_specified,
+                   const char *as_str)
 {
        enum bgp_peer_sort origtype, newtype;
 
@@ -1909,6 +1917,12 @@ void peer_as_change(struct peer *peer, as_t as, int as_specified)
        }
        origtype = peer_sort_lookup(peer);
        peer->as = as;
+       if (as_specified == AS_SPECIFIED && as_str) {
+               if (peer->as_pretty)
+                       XFREE(MTYPE_BGP, peer->as_pretty);
+               peer->as_pretty = XSTRDUP(MTYPE_BGP, as_str);
+       } else if (peer->as_type == AS_UNSPECIFIED && peer->as_pretty)
+               XFREE(MTYPE_BGP, peer->as_pretty);
        peer->as_type = as_specified;
 
        if (bgp_config_check(peer->bgp, BGP_CONFIG_CONFEDERATION)
@@ -1966,7 +1980,7 @@ void peer_as_change(struct peer *peer, as_t as, int as_specified)
 /* If peer does not exist, create new one.  If peer already exists,
    set AS number to the peer.  */
 int peer_remote_as(struct bgp *bgp, union sockunion *su, const char *conf_if,
-                  as_t *as, int as_type)
+                  as_t *as, int as_type, const char *as_str)
 {
        struct peer *peer;
        as_t local_as;
@@ -2020,7 +2034,7 @@ int peer_remote_as(struct bgp *bgp, union sockunion *su, const char *conf_if,
                /* Existing peer's AS number change. */
                if (((peer->as_type == AS_SPECIFIED) && peer->as != *as)
                    || (peer->as_type != as_type))
-                       peer_as_change(peer, *as, as_type);
+                       peer_as_change(peer, *as, as_type, as_str);
        } else {
                if (conf_if)
                        return BGP_ERR_NO_INTERFACE_CONFIG;
@@ -2035,7 +2049,7 @@ int peer_remote_as(struct bgp *bgp, union sockunion *su, const char *conf_if,
                        local_as = bgp->as;
 
                peer_create(su, conf_if, bgp, local_as, *as, as_type, NULL,
-                           true);
+                           true, as_str);
        }
 
        return 0;
@@ -2060,6 +2074,13 @@ const char *bgp_get_name_by_role(uint8_t role)
        return "unknown";
 }
 
+enum asnotation_mode bgp_get_asnotation(struct bgp *bgp)
+{
+       if (!bgp)
+               return ASNOTATION_PLAIN;
+       return bgp->asnotation;
+}
+
 static void peer_group2peer_config_copy_af(struct peer_group *group,
                                           struct peer *peer, afi_t afi,
                                           safi_t safi)
@@ -2631,6 +2652,7 @@ int peer_delete(struct peer *peer)
 
        XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
        XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
+       XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
 
        peer_unlock(peer); /* initial reference */
 
@@ -2774,6 +2796,13 @@ static void peer_group2peer_config_copy(struct peer_group *group,
                if (CHECK_FLAG(conf->flags, PEER_FLAG_CAPABILITY_ENHE))
                        SET_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE);
 
+       /* capability software-version apply */
+       if (!CHECK_FLAG(peer->flags_override,
+                       PEER_FLAG_CAPABILITY_SOFT_VERSION))
+               if (CHECK_FLAG(conf->flags, PEER_FLAG_CAPABILITY_SOFT_VERSION))
+                       SET_FLAG(peer->flags,
+                                PEER_FLAG_CAPABILITY_SOFT_VERSION);
+
        /* password apply */
        if (!CHECK_FLAG(peer->flags_override, PEER_FLAG_PASSWORD))
                PEER_STR_ATTR_INHERIT(peer, group, password,
@@ -2809,7 +2838,7 @@ static void peer_group2peer_config_copy(struct peer_group *group,
 
 /* Peer group's remote AS configuration.  */
 int peer_group_remote_as(struct bgp *bgp, const char *group_name, as_t *as,
-                        int as_type)
+                        int as_type, const char *as_str)
 {
        struct peer_group *group;
        struct peer *peer;
@@ -2825,12 +2854,12 @@ int peer_group_remote_as(struct bgp *bgp, const char *group_name, as_t *as,
 
        /* When we setup peer-group AS number all peer group member's AS
           number must be updated to same number.  */
-       peer_as_change(group->conf, *as, as_type);
+       peer_as_change(group->conf, *as, as_type, as_str);
 
        for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) {
                if (((peer->as_type == AS_SPECIFIED) && peer->as != *as)
                    || (peer->as_type != as_type))
-                       peer_as_change(peer, *as, as_type);
+                       peer_as_change(peer, *as, as_type, as_str);
        }
 
        return 0;
@@ -3137,7 +3166,7 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
                }
 
                peer = peer_create(su, NULL, bgp, bgp->as, group->conf->as,
-                                  group->conf->as_type, group, true);
+                                  group->conf->as_type, group, true, NULL);
 
                peer = peer_lock(peer); /* group->peer list reference */
                listnode_add(group->peer, peer);
@@ -3189,23 +3218,37 @@ static void bgp_vrf_string_name_delete(void *data)
 
 /* BGP instance creation by `router bgp' commands. */
 static struct bgp *bgp_create(as_t *as, const char *name,
-                             enum bgp_instance_type inst_type)
+                             enum bgp_instance_type inst_type,
+                             const char *as_pretty,
+                             enum asnotation_mode asnotation)
 {
        struct bgp *bgp;
        afi_t afi;
        safi_t safi;
 
        bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
+       bgp->as = *as;
+       if (as_pretty)
+               bgp->as_pretty = XSTRDUP(MTYPE_BGP, as_pretty);
+       else
+               bgp->as_pretty = XSTRDUP(MTYPE_BGP, asn_asn2asplain(*as));
+
+       if (asnotation != ASNOTATION_UNDEFINED) {
+               bgp->asnotation = asnotation;
+               SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);
+       } else
+               asn_str2asn_notation(bgp->as_pretty, NULL, &bgp->asnotation);
 
        if (BGP_DEBUG(zebra, ZEBRA)) {
                if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
-                       zlog_debug("Creating Default VRF, AS %u", *as);
+                       zlog_debug("Creating Default VRF, AS %s",
+                                  bgp->as_pretty);
                else
-                       zlog_debug("Creating %s %s, AS %u",
+                       zlog_debug("Creating %s %s, AS %s",
                                   (inst_type == BGP_INSTANCE_TYPE_VRF)
                                           ? "VRF"
                                           : "VIEW",
-                                  name, *as);
+                                  name, bgp->as_pretty);
        }
 
        /* Default the EVPN VRF to the default one */
@@ -3282,7 +3325,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
        bgp->condition_check_period = DEFAULT_CONDITIONAL_ROUTES_POLL_TIME;
        bgp_addpath_init_bgp_data(&bgp->tx_addpath);
        bgp->fast_convergence = false;
-       bgp->as = *as;
        bgp->llgr_stale_time = BGP_DEFAULT_LLGR_STALE_TIME;
 
 #ifdef ENABLE_BGP_VNC
@@ -3519,7 +3561,8 @@ int bgp_lookup_by_as_name_type(struct bgp **bgp_val, as_t *as, const char *name,
 
 /* Called from VTY commands. */
 int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
-           enum bgp_instance_type inst_type)
+           enum bgp_instance_type inst_type, const char *as_pretty,
+           enum asnotation_mode asnotation)
 {
        struct bgp *bgp;
        struct vrf *vrf = NULL;
@@ -3529,7 +3572,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
        if (ret || *bgp_val)
                return ret;
 
-       bgp = bgp_create(as, name, inst_type);
+       bgp = bgp_create(as, name, inst_type, as_pretty, asnotation);
 
        /*
         * view instances will never work inside of a vrf
@@ -3923,8 +3966,13 @@ void bgp_free(struct bgp *bgp)
                dir = BGP_VPN_POLICY_DIR_TOVPN;
                if (bgp->vpn_policy[afi].rtlist[dir])
                        ecommunity_free(&bgp->vpn_policy[afi].rtlist[dir]);
+               if (bgp->vpn_policy[afi].tovpn_rd_pretty)
+                       XFREE(MTYPE_BGP, bgp->vpn_policy[afi].tovpn_rd_pretty);
        }
 
+       bgp_confederation_id_unset(bgp);
+
+       XFREE(MTYPE_BGP, bgp->as_pretty);
        XFREE(MTYPE_BGP, bgp->name);
        XFREE(MTYPE_BGP, bgp->name_pretty);
        XFREE(MTYPE_BGP, bgp->snmp_stats);
@@ -4029,7 +4077,7 @@ struct peer *peer_create_bind_dynamic_neighbor(struct bgp *bgp,
 
        /* Create peer first; we've already checked group config is valid. */
        peer = peer_create(su, NULL, bgp, bgp->as, group->conf->as,
-                          group->conf->as_type, group, true);
+                          group->conf->as_type, group, true, NULL);
        if (!peer)
                return NULL;
 
@@ -4213,6 +4261,26 @@ bool bgp_path_attribute_discard(struct peer *peer, char *buf, size_t size)
        return false;
 }
 
+bool bgp_path_attribute_treat_as_withdraw(struct peer *peer, char *buf,
+                                         size_t size)
+{
+       if (!buf)
+               return false;
+
+       buf[0] = '\0';
+
+       for (unsigned int i = 0; i < BGP_ATTR_MAX; i++) {
+               if (peer->withdraw_attrs[i])
+                       snprintf(buf + strlen(buf), size - strlen(buf), "%s%d",
+                                (strlen(buf) > 0) ? " " : "", i);
+       }
+
+       if (strlen(buf) > 0)
+               return true;
+
+       return false;
+}
+
 /* If peer is configured at least one address family return 1. */
 bool peer_active(struct peer *peer)
 {
@@ -4366,6 +4434,7 @@ static const struct peer_flag_action peer_flag_action_list[] = {
        {PEER_FLAG_PORT, 0, peer_change_reset},
        {PEER_FLAG_AIGP, 0, peer_change_none},
        {PEER_FLAG_GRACEFUL_SHUTDOWN, 0, peer_change_none},
+       {PEER_FLAG_CAPABILITY_SOFT_VERSION, 0, peer_change_reset},
        {0, 0, 0}};
 
 static const struct peer_flag_action peer_af_flag_action_list[] = {
@@ -4567,6 +4636,9 @@ void bgp_shutdown_enable(struct bgp *bgp, const char *msg)
 /* Disable global administrative shutdown of all peers of BGP instance */
 void bgp_shutdown_disable(struct bgp *bgp)
 {
+       const struct listnode *node;
+       struct peer *peer;
+
        /* do nothing if not shut down. */
        if (!CHECK_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN))
                return;
@@ -4577,6 +4649,9 @@ void bgp_shutdown_disable(struct bgp *bgp)
 
        /* clear the BGP instances shutdown flag */
        UNSET_FLAG(bgp->flags, BGP_FLAG_SHUTDOWN);
+
+       for (ALL_LIST_ELEMENTS_RO(bgp->peer, node, peer))
+               bgp_timer_set(peer);
 }
 
 /* Change specified peer flag. */
@@ -6212,7 +6287,7 @@ int peer_allowas_in_unset(struct peer *peer, afi_t afi, safi_t safi)
 }
 
 int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
-                     bool replace_as)
+                     bool replace_as, const char *as_str)
 {
        bool old_no_prepend, old_replace_as;
        struct bgp *bgp = peer->bgp;
@@ -6237,6 +6312,9 @@ int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
            && old_replace_as == replace_as)
                return 0;
        peer->change_local_as = as;
+       if (as_str)
+               peer->change_local_as_pretty = XSTRDUP(MTYPE_BGP, as_str);
+
        (void)peer_sort(peer);
 
        /* Check if handling a regular peer. */
@@ -6270,6 +6348,9 @@ int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
                COND_FLAG(member->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS,
                          replace_as);
                member->change_local_as = as;
+               if (as_str)
+                       member->change_local_as_pretty =
+                               XSTRDUP(MTYPE_BGP, as_str);
        }
 
        return 0;
@@ -6295,6 +6376,7 @@ int peer_local_as_unset(struct peer *peer)
                peer_flag_unset(peer, PEER_FLAG_LOCAL_AS_NO_PREPEND);
                peer_flag_unset(peer, PEER_FLAG_LOCAL_AS_REPLACE_AS);
                peer->change_local_as = 0;
+               XFREE(MTYPE_BGP, peer->change_local_as_pretty);
        }
 
        /* Check if handling a regular peer. */
@@ -6325,6 +6407,7 @@ int peer_local_as_unset(struct peer *peer)
                UNSET_FLAG(member->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND);
                UNSET_FLAG(member->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS);
                member->change_local_as = 0;
+               XFREE(MTYPE_BGP, member->change_local_as_pretty);
 
                /* Send notification or stop peer depending on state. */
                if (BGP_IS_VALID_STATE_FOR_NOTIF(member->status)) {
@@ -8008,7 +8091,7 @@ static void bgp_instasn_autocomplete(vector comps, struct cmd_token *token)
 {
        struct listnode *next, *next2;
        struct bgp *bgp, *bgp2;
-       char buf[11];
+       char buf[ASN_STRING_MAX_SIZE];
 
        for (ALL_LIST_ELEMENTS_RO(bm->bgp, next, bgp)) {
                /* deduplicate */
@@ -8021,7 +8104,7 @@ static void bgp_instasn_autocomplete(vector comps, struct cmd_token *token)
                if (bgp2 != bgp)
                        continue;
 
-               snprintf(buf, sizeof(buf), "%u", bgp->as);
+               snprintf(buf, sizeof(buf), "%s", bgp->as_pretty);
                vector_set(comps, XSTRDUP(MTYPE_COMPLETION, buf));
        }
 }
index 4c4c81f997a0e18a68f517499c7d70365bbcc78e..2a7c7a31437ec331c864fa83a48b69ac2332f55c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP message definition header.
  * Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGPD_H
@@ -31,6 +16,7 @@
 #include "vty.h"
 #include "srv6.h"
 #include "iana_afi.h"
+#include "asn.h"
 
 /* For union sockunion.  */
 #include "queue.h"
@@ -77,7 +63,6 @@ enum zebra_gr_mode {
 };
 
 /* Typedef BGP specific types.  */
-typedef uint32_t as_t;
 typedef uint16_t as16_t; /* we may still encounter 16 Bit asnums */
 typedef uint16_t bgp_size_t;
 
@@ -218,6 +203,7 @@ struct vpn_policy {
        /* should be mpls_label_t? */
        uint32_t tovpn_label; /* may be MPLS_LABEL_NONE */
        uint32_t tovpn_zebra_vrf_label_last_sent;
+       char *tovpn_rd_pretty;
        struct prefix_rd tovpn_rd;
        struct prefix tovpn_nexthop; /* unset => set to 0 */
        uint32_t flags;
@@ -339,10 +325,16 @@ struct bgp_srv6_function {
        char locator_name[SRV6_LOCNAME_SIZE];
 };
 
+struct as_confed {
+       as_t as;
+       char *as_pretty;
+};
+
 /* BGP instance structure.  */
 struct bgp {
        /* AS number of this BGP instance.  */
        as_t as;
+       char *as_pretty;
 
        /* Name of this BGP instance.  */
        char *name;
@@ -398,6 +390,7 @@ struct bgp {
        uint16_t config;
 #define BGP_CONFIG_CLUSTER_ID             (1 << 0)
 #define BGP_CONFIG_CONFEDERATION          (1 << 1)
+#define BGP_CONFIG_ASNOTATION             (1 << 2)
 
        /* BGP router identifier.  */
        struct in_addr router_id;
@@ -409,7 +402,8 @@ struct bgp {
 
        /* BGP confederation information.  */
        as_t confed_id;
-       as_t *confed_peers;
+       char *confed_id_pretty;
+       struct as_confed *confed_peers;
        int confed_peers_cnt;
 
        struct thread
@@ -743,6 +737,7 @@ struct bgp {
 
        /* RD for this VRF */
        struct prefix_rd vrf_prd;
+       char *vrf_prd_pretty;
 
        /* import rt list for the vrf instance */
        struct list *vrf_import_rtl;
@@ -797,6 +792,8 @@ struct bgp {
 
        bool allow_martian;
 
+       enum asnotation_mode asnotation;
+
        QOBJ_FIELDS;
 };
 DECLARE_QOBJ_TYPE(bgp);
@@ -1120,6 +1117,8 @@ struct peer {
        /* Peer's remote AS number. */
        int as_type;
        as_t as;
+       /* for vty as format */
+       char *as_pretty;
 
        /* Peer's local AS number. */
        as_t local_as;
@@ -1128,6 +1127,8 @@ struct peer {
 
        /* Peer's Change local AS number. */
        as_t change_local_as;
+       /* for vty as format */
+       char *change_local_as_pretty;
 
        /* Remote router ID. */
        struct in_addr remote_id;
@@ -1250,6 +1251,8 @@ struct peer {
 #define PEER_CAP_GRACEFUL_RESTART_N_BIT_RCV (1U << 24)
 #define PEER_CAP_ROLE_ADV                   (1U << 25) /* role advertised */
 #define PEER_CAP_ROLE_RCV                   (1U << 26) /* role received */
+#define PEER_CAP_SOFT_VERSION_ADV (1U << 27)
+#define PEER_CAP_SOFT_VERSION_RCV (1U << 28)
 
        /* Capability flags (reset in bgp_stop) */
        uint32_t af_cap[AFI_MAX][SAFI_MAX];
@@ -1283,7 +1286,7 @@ struct peer {
         * so if a flag is unset, the corresponding override flag is unset too.
         * However if a flag is set, the corresponding override flag is set.
         */
-       uint32_t flags_override;
+       uint64_t flags_override;
        /*
         * Parallel array to flags that indicates whether the default behavior
         * of *flags_override* should be inverted. If a flag is unset and the
@@ -1321,11 +1324,13 @@ struct peer {
         * inversion state of the flag differs between peer and peer-group, the
         * newly set value must equal to the inverted state of the peer-group.
         */
-       uint32_t flags_invert;
+       uint64_t flags_invert;
        /*
         * Effective array for storing the peer/peer-group flags. In case of a
         * peer-group, the peer-specific overrides (see flags_override and
         * flags_invert) must be respected.
+        * When changing the structure of flags/af_flags, do not forget to
+        * change flags_invert/flags_override too.
         */
        uint64_t flags;
 #define PEER_FLAG_PASSIVE                   (1ULL << 0) /* passive mode */
@@ -1376,6 +1381,7 @@ struct peer {
 #define PEER_FLAG_PORT (1ULL << 33)
 #define PEER_FLAG_AIGP (1ULL << 34)
 #define PEER_FLAG_GRACEFUL_SHUTDOWN (1ULL << 35)
+#define PEER_FLAG_CAPABILITY_SOFT_VERSION (1ULL << 36)
 
        /*
         *GR-Disabled mode means unset PEER_FLAG_GRACEFUL_RESTART
@@ -1768,6 +1774,13 @@ struct peer {
        /* Path attributes discard */
        bool discard_attrs[BGP_ATTR_MAX];
 
+       /* Path attributes treat-as-withdraw */
+       bool withdraw_attrs[BGP_ATTR_MAX];
+
+       /* BGP Software Version Capability */
+#define BGP_MAX_SOFT_VERSION 64
+       char *soft_version;
+
        QOBJ_FIELDS;
 };
 DECLARE_QOBJ_TYPE(peer);
@@ -2134,7 +2147,7 @@ extern void bgp_recalculate_all_bestpaths(struct bgp *bgp);
 extern struct peer *peer_create(union sockunion *su, const char *conf_if,
                                struct bgp *bgp, as_t local_as, as_t remote_as,
                                int as_type, struct peer_group *group,
-                               bool config_node);
+                               bool config_node, const char *as_str);
 extern struct peer *peer_create_accept(struct bgp *);
 extern void peer_xfer_config(struct peer *dst, struct peer *src);
 extern char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
@@ -2161,7 +2174,9 @@ extern void bgp_option_norib_set_runtime(void);
 /* unset the bgp no-rib option during runtime and reset all peers */
 extern void bgp_option_norib_unset_runtime(void);
 
-extern int bgp_get(struct bgp **, as_t *, const char *, enum bgp_instance_type);
+extern int bgp_get(struct bgp **bgp, as_t *as, const char *name,
+                  enum bgp_instance_type kind, const char *as_pretty,
+                  enum asnotation_mode asnotation);
 extern void bgp_instance_up(struct bgp *);
 extern void bgp_instance_down(struct bgp *);
 extern int bgp_delete(struct bgp *);
@@ -2177,11 +2192,13 @@ extern void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set);
 extern void bgp_cluster_id_set(struct bgp *bgp, struct in_addr *cluster_id);
 extern void bgp_cluster_id_unset(struct bgp *bgp);
 
-extern void bgp_confederation_id_set(struct bgp *bgp, as_t as);
+extern void bgp_confederation_id_set(struct bgp *bgp, as_t as,
+                                    const char *as_str);
 extern void bgp_confederation_id_unset(struct bgp *bgp);
 extern bool bgp_confederation_peers_check(struct bgp *, as_t);
 
-extern void bgp_confederation_peers_add(struct bgp *bgp, as_t as);
+extern void bgp_confederation_peers_add(struct bgp *bgp, as_t as,
+                                       const char *as_str);
 extern void bgp_confederation_peers_remove(struct bgp *bgp, as_t as);
 
 extern void bgp_timers_set(struct bgp *, uint32_t keepalive, uint32_t holdtime,
@@ -2202,10 +2219,13 @@ extern void bgp_listen_limit_unset(struct bgp *bgp);
 extern bool bgp_update_delay_active(struct bgp *);
 extern bool bgp_update_delay_configured(struct bgp *);
 extern bool bgp_afi_safi_peer_exists(struct bgp *bgp, afi_t afi, safi_t safi);
-extern void peer_as_change(struct peer *, as_t, int);
-extern int peer_remote_as(struct bgp *, union sockunion *, const char *, as_t *,
-                         int);
-extern int peer_group_remote_as(struct bgp *, const char *, as_t *, int);
+extern void peer_as_change(struct peer *peer, as_t as, int as_type,
+                          const char *as_str);
+extern int peer_remote_as(struct bgp *bgp, union sockunion *su,
+                         const char *conf_if, as_t *as, int as_type,
+                         const char *as_str);
+extern int peer_group_remote_as(struct bgp *bgp, const char *peer_str, as_t *as,
+                               int as_type, const char *as_str);
 extern int peer_delete(struct peer *peer);
 extern void peer_notify_unconfig(struct peer *peer);
 extern int peer_group_delete(struct peer_group *);
@@ -2284,8 +2304,8 @@ extern int peer_distribute_unset(struct peer *, afi_t, safi_t, int);
 extern int peer_allowas_in_set(struct peer *, afi_t, safi_t, int, int);
 extern int peer_allowas_in_unset(struct peer *, afi_t, safi_t);
 
-extern int peer_local_as_set(struct peer *, as_t, bool no_prepend,
-                            bool replace_as);
+extern int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
+                            bool replace_as, const char *as_str);
 extern int peer_local_as_unset(struct peer *);
 
 extern int peer_prefix_list_set(struct peer *, afi_t, safi_t, int,
@@ -2344,6 +2364,7 @@ extern void peer_tx_shutdown_message_unset(struct peer *);
 
 extern void bgp_route_map_update_timer(struct thread *thread);
 extern const char *bgp_get_name_by_role(uint8_t role);
+extern enum asnotation_mode bgp_get_asnotation(struct bgp *bgp);
 
 extern void bgp_route_map_terminate(void);
 
@@ -2421,7 +2442,9 @@ static inline int afindex(afi_t afi, safi_t safi)
                        return BGP_AF_IPV4_ENCAP;
                case SAFI_FLOWSPEC:
                        return BGP_AF_IPV4_FLOWSPEC;
-               default:
+               case SAFI_EVPN:
+               case SAFI_UNSPEC:
+               case SAFI_MAX:
                        return BGP_AF_MAX;
                }
                break;
@@ -2439,7 +2462,9 @@ static inline int afindex(afi_t afi, safi_t safi)
                        return BGP_AF_IPV6_ENCAP;
                case SAFI_FLOWSPEC:
                        return BGP_AF_IPV6_FLOWSPEC;
-               default:
+               case SAFI_EVPN:
+               case SAFI_UNSPEC:
+               case SAFI_MAX:
                        return BGP_AF_MAX;
                }
                break;
@@ -2447,12 +2472,23 @@ static inline int afindex(afi_t afi, safi_t safi)
                switch (safi) {
                case SAFI_EVPN:
                        return BGP_AF_L2VPN_EVPN;
-               default:
+               case SAFI_UNICAST:
+               case SAFI_MULTICAST:
+               case SAFI_LABELED_UNICAST:
+               case SAFI_MPLS_VPN:
+               case SAFI_ENCAP:
+               case SAFI_FLOWSPEC:
+               case SAFI_UNSPEC:
+               case SAFI_MAX:
                        return BGP_AF_MAX;
                }
-       default:
+               break;
+       case AFI_UNSPEC:
+       case AFI_MAX:
                return BGP_AF_MAX;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 /* If the peer is not a peer-group but is bound to a peer-group return 1 */
@@ -2620,6 +2656,8 @@ extern void peer_on_policy_change(struct peer *peer, afi_t afi, safi_t safi,
                                  int outbound);
 extern bool bgp_path_attribute_discard(struct peer *peer, char *buf,
                                       size_t size);
+extern bool bgp_path_attribute_treat_as_withdraw(struct peer *peer, char *buf,
+                                                size_t size);
 #ifdef _FRR_ATTRIBUTE_PRINTFRR
 /* clang-format off */
 #pragma FRR printfrr_ext "%pBP" (struct peer *)
index b65d90e1b38dd62d357c2bf5475eda2d02e774ed..5b6961d18af56640d0115344a600fe80a1d1f42d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "lib/zebra.h"
 
@@ -423,6 +410,7 @@ DEFUN (vnc_defaults_rd,
 
        } else {
 
+               /* TODO: save RD format */
                ret = str2prefix_rd(argv[1]->arg, &prd);
                if (!ret) {
                        vty_out(vty, "%% Malformed rd\n");
@@ -2887,6 +2875,7 @@ DEFUN (vnc_nve_group_rd,
 
        } else {
 
+               /* TODO: save RD format */
                ret = str2prefix_rd(argv[1]->arg, &prd);
                if (!ret) {
                        vty_out(vty, "%% Malformed rd\n");
@@ -3359,6 +3348,7 @@ DEFUN (vnc_vrf_policy_rd,
 
        } else {
 
+               /* TODO: save RD format */
                ret = str2prefix_rd(argv[1]->arg, &prd);
                if (!ret) {
                        vty_out(vty, "%% Malformed rd\n");
@@ -3937,7 +3927,7 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
                                                value);
 
                                } else
-                                       vty_out(vty, "  rd %pRD\n", &rfg->rd);
+                                       vty_out(vty, "  rd %pRDP\n", &rfg->rd);
                        }
 
                        if (rfg->rt_import_list && rfg->rt_export_list
@@ -4157,7 +4147,7 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
                                                value);
 
                                } else
-                                       vty_out(vty, "  rd %pRD\n",
+                                       vty_out(vty, "  rd %pRDP\n",
                                                &hc->default_rd);
                        }
                        if (hc->default_response_lifetime
@@ -4237,7 +4227,7 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
                                                        value);
 
                                        } else
-                                               vty_out(vty, "  rd %pRD\n",
+                                               vty_out(vty, "  rd %pRDP\n",
                                                        &rfg->rd);
                                }
                                if (rfg->flags & RFAPI_RFG_RESPONSE_LIFETIME) {
index ef97419c4d01bb8c52ed432d33e83572fbce3ba8..77549ad829a63ea689a9df4527fedd0be8e50653 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_RFAPI_CFG_H
index 80d0b3e269d4cd663f3f1034acc2459fea4b1a4c..8d6db9d7759d709763f53ec4a0d4b7c504d02b74 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
@@ -376,7 +363,7 @@ void del_vnc_route(struct rfapi_descriptor *rfd,
        bn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, prd);
 
        vnc_zlog_debug_verbose(
-               "%s: peer=%p, prefix=%pFX, prd=%pRD afi=%d, safi=%d bn=%p, bn->info=%p",
+               "%s: peer=%p, prefix=%pFX, prd=%pRDP afi=%d, safi=%d bn=%p, bn->info=%p",
                __func__, peer, p, prd, afi, safi, bn,
                (bn ? bgp_dest_get_bgp_path_info(bn) : NULL));
 
@@ -1066,7 +1053,7 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */
        bgp_process(bgp, bn, afi, safi);
 
        vnc_zlog_debug_any(
-               "%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%pRD)",
+               "%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%pRDP)",
                __func__, safi2str(safi), buf, bn, prd);
 
 done:
@@ -3725,7 +3712,7 @@ int rfapi_set_autord_from_vn(struct prefix_rd *rd, struct rfapi_ip_addr *vn)
                memcpy(rd->val + 2, &vn->addr.v6.s6_addr32[3],
                       4); /* low order 4 bytes */
        }
-       vnc_zlog_debug_verbose("%s: auto-RD is set to %pRD", __func__, rd);
+       vnc_zlog_debug_verbose("%s: auto-RD is set to %pRDP", __func__, rd);
        return 0;
 }
 
index b2079fb13e26495dc83f6c79e80e5a573a35b28b..44f7507d55a64db8935eb178a51c748c7f410119 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_RFAPI_H
index fcc6168cfaf9834a0f1162349274eb56ee170bb5..fe344a5654a544b35a4d4042585bbfad9f66c32b 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
index 56977bd2468d0521ae4bc19f7125e7939094cd1a..7698fbaed6581751004f99d6d7ba1f44092dc0a8 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _QUAGGA_BGP_RFAPI_AP_H
 #define _QUAGGA_BGP_RFAPI_AP_H
index 4d2ae0b02f731b33cb61820d6bed7bd7ca5a1399..3870c31fca54b3bf984193cd14488dfb7d9943f9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_RFAPI_BACKEND_H
index ce5acf002c20fa79932aac298a1946059cc45150..28326ab9ea38e8a03d43e5b392824e37e060a5cb 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
index dcc197961cf8b31fdfe0830e7a6f7bfe1d530f9e..9e65a70b19ec08211eb7297d0625b7d5122ba530 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index d4e875df2ad601b6b1ee4b7407add38a0454201e..37a7326151a57a846ef808d90144cad5c7aaa8c3 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015-2016, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
@@ -150,8 +137,8 @@ rfapi_tunneltype_option_to_tlv(struct bgp *bgp, struct rfapi_ip_addr *ea,
                bgp_encap_type_pbb_to_tlv(&tto->bgpinfo.pbb, attr);
                break;
 
-       default:
-               assert(0);
+       case BGP_ENCAP_TYPE_RESERVED:
+               assert(!"Cannot process BGP_ENCAP_TYPE_RESERVED");
        }
        return tto->type;
 }
@@ -737,7 +724,7 @@ void rfapi_print_tunneltype_option(void *stream, int column_offset,
                print_encap_type_pbb(stream, column_offset, &tto->bgpinfo.pbb);
                break;
 
-       default:
-               assert(0);
+       case BGP_ENCAP_TYPE_RESERVED:
+               assert(!"Cannot process BGP_ENCAP_TYPE_RESERVED");
        }
 }
index 57e1b5ef04763ce0d09fef498050dceafeb5e38d..56131d8b8dae33b88a8ab790d69921d75f546a45 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2015-2016, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_RFAPI_ENCAP_TLV_H
index 2aae0bc6167260596e3a08961fb3f40d9addbc4d..a50440536156882e2ea5de4c4b9e4930193c2d4a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
-*
-* Copyright 2009-2016, LabN Consulting, L.L.C.
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; see the file COPYING; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ * Copyright 2009-2016, LabN Consulting, L.L.C.
+ */
 
 /*
  * File:       rfapi_import.c
@@ -260,8 +245,14 @@ void rfapiCheckRefcount(struct agg_node *rn, safi_t safi, int lockoffset)
                        }
                        break;
 
-               default:
-                       assert(0);
+               case SAFI_UNSPEC:
+               case SAFI_UNICAST:
+               case SAFI_MULTICAST:
+               case SAFI_EVPN:
+               case SAFI_LABELED_UNICAST:
+               case SAFI_FLOWSPEC:
+               case SAFI_MAX:
+                       assert(!"Passed in safi should be impossible");
                }
        }
 
@@ -2091,7 +2082,7 @@ static void rfapiItBiIndexAdd(struct agg_node *rn, /* Import table VPN node */
        assert(bpi);
        assert(bpi->extra);
 
-       vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRD", __func__, bpi,
+       vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRDP", __func__, bpi,
                               bpi->peer, &bpi->extra->vnc.import.rd);
 
        sl = RFAPI_RDINDEX_W_ALLOC(rn);
@@ -2129,7 +2120,9 @@ static void rfapiItBiIndexDump(struct agg_node *rn)
                char buf[RD_ADDRSTRLEN];
                char buf_aux_pfx[PREFIX_STRLEN];
 
-               prefix_rd2str(&k->extra->vnc.import.rd, buf, sizeof(buf));
+               prefix_rd2str(
+                       &k->extra->vnc.import.rd, buf, sizeof(buf),
+                       bgp_get_asnotation(k->peer ? k->peer->bgp : NULL));
                if (k->extra->vnc.import.aux_prefix.family) {
                        prefix2str(&k->extra->vnc.import.aux_prefix,
                                   buf_aux_pfx, sizeof(buf_aux_pfx));
@@ -2167,7 +2160,7 @@ static struct bgp_path_info *rfapiItBiIndexSearch(
                        strlcpy(buf_aux_pfx, "(nil)", sizeof(buf_aux_pfx));
 
                vnc_zlog_debug_verbose(
-                       "%s want prd=%pRD, peer=%p, aux_prefix=%s", __func__,
+                       "%s want prd=%pRDP, peer=%p, aux_prefix=%s", __func__,
                        prd, peer, buf_aux_pfx);
                rfapiItBiIndexDump(rn);
        }
@@ -2183,7 +2176,7 @@ static struct bgp_path_info *rfapiItBiIndexSearch(
                     bpi_result = bpi_result->next) {
 #ifdef DEBUG_BI_SEARCH
                        vnc_zlog_debug_verbose(
-                               "%s: bpi has prd=%pRD, peer=%p", __func__,
+                               "%s: bpi has prd=%pRDP, peer=%p", __func__,
                                &bpi_result->extra->vnc.import.rd,
                                bpi_result->peer);
 #endif
@@ -2247,7 +2240,7 @@ static void rfapiItBiIndexDel(struct agg_node *rn, /* Import table VPN node */
        struct skiplist *sl;
        int rc;
 
-       vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRD", __func__, bpi,
+       vnc_zlog_debug_verbose("%s: bpi %p, peer %p, rd %pRDP", __func__, bpi,
                               bpi->peer, &bpi->extra->vnc.import.rd);
 
        sl = RFAPI_RDINDEX(rn);
@@ -2967,7 +2960,9 @@ static void rfapiBgpInfoFilteredImportEncap(
                rt = import_table->imported_encap[afi];
                break;
 
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
@@ -3416,7 +3411,8 @@ void rfapiBgpInfoFilteredImportVPN(
                rt = import_table->imported_vpn[afi];
                break;
 
-       default:
+       case AFI_UNSPEC:
+       case AFI_MAX:
                flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
@@ -3808,11 +3804,19 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi)
        case SAFI_ENCAP:
                return rfapiBgpInfoFilteredImportEncap;
 
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_UNICAST:
+       case SAFI_MULTICAST:
+       case SAFI_EVPN:
+       case SAFI_LABELED_UNICAST:
+       case SAFI_FLOWSPEC:
+       case SAFI_MAX:
                /* not expected */
                flog_err(EC_LIB_DEVELOPMENT, "%s: bad safi %d", __func__, safi);
                return rfapiBgpInfoFilteredImportBadSafi;
        }
+
+       assert(!"Reached end of function when we were not expecting to");
 }
 
 void rfapiProcessUpdate(struct peer *peer,
@@ -4028,8 +4032,8 @@ static void rfapiProcessPeerDownRt(struct peer *peer,
 {
        struct agg_node *rn;
        struct bgp_path_info *bpi;
-       struct agg_table *rt;
-       void (*timer_service_func)(struct thread *);
+       struct agg_table *rt = NULL;
+       void (*timer_service_func)(struct thread *) = NULL;
 
        assert(afi == AFI_IP || afi == AFI_IP6);
 
@@ -4044,14 +4048,19 @@ static void rfapiProcessPeerDownRt(struct peer *peer,
                rt = import_table->imported_encap[afi];
                timer_service_func = rfapiWithdrawTimerEncap;
                break;
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_UNICAST:
+       case SAFI_MULTICAST:
+       case SAFI_EVPN:
+       case SAFI_LABELED_UNICAST:
+       case SAFI_FLOWSPEC:
+       case SAFI_MAX:
                /* Suppress uninitialized variable warning */
                rt = NULL;
                timer_service_func = NULL;
                assert(0);
        }
 
-
        for (rn = agg_route_top(rt); rn; rn = agg_route_next(rn)) {
                for (bpi = rn->info; bpi; bpi = bpi->next) {
                        if (bpi->peer == peer) {
index 387e6c47c9f499116476b7499958ebb791ffd25a..3bec225f65ace0d61e139ab39fd90629bd983b86 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 0e71d5d7e196e0ed7aea994aceee2e5fcce31896..f169a7808c5bc03837c2b31449a18407bc218799 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -244,7 +231,13 @@ void rfapiMonitorExtraFlush(safi_t safi, struct agg_node *rn)
                }
                break;
 
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_UNICAST:
+       case SAFI_MULTICAST:
+       case SAFI_EVPN:
+       case SAFI_LABELED_UNICAST:
+       case SAFI_FLOWSPEC:
+       case SAFI_MAX:
                assert(0);
        }
        XFREE(MTYPE_RFAPI_IT_EXTRA, hie);
@@ -306,7 +299,13 @@ void rfapiMonitorExtraPrune(safi_t safi, struct agg_node *rn)
                }
                break;
 
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_UNICAST:
+       case SAFI_MULTICAST:
+       case SAFI_EVPN:
+       case SAFI_LABELED_UNICAST:
+       case SAFI_FLOWSPEC:
+       case SAFI_MAX:
                assert(0);
        }
        XFREE(MTYPE_RFAPI_IT_EXTRA, hie);
index 3a2248aa60b0a62a4aacca661ee9a65ed5844e19..68ba5a48d869c0b6b9a830ee3f60f9bd6c01360a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef QUAGGA_HGP_RFAPI_MONITOR_H
index b8193f14313dcbdf63054507e74491ed606cf2f3..eabec2fdde3b667e1ed03250c4a187bc42786134 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 7bcb3cab6984074c0e989422503e98b39d43666c..49e9fc5d67e6cf584c21a5524e15a6a963846913 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_RFAPI_NVE_ADDR_H
index 8c76e1dd0bec85ed34e5d452c5fe1d0d297dbfb3..2161d43ba36e7c804e48680ccf2966078f2b7a5d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 50a10c3b1d9e3f2fc3b60c271a0d9403c3216c56..f727f24f1d0013a9d0993d787ffb97ee566b1d6d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -1127,7 +1114,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd,
                                skiplist_insert(slRibPt, &ori->rk, ori);
 
                                vnc_zlog_debug_verbose(
-                                       "%s:   nomatch lPendCost item %p in slRibPt, added (rd=%pRD)",
+                                       "%s:   nomatch lPendCost item %p in slRibPt, added (rd=%pRDP)",
                                        __func__, ri, &ori->rk.rd);
                        }
 
@@ -1369,7 +1356,7 @@ callback:
                                        ri->last_sent_time = monotime(NULL);
 #if DEBUG_RIB_SL_RD
                                        vnc_zlog_debug_verbose(
-                                               "%s: move route to recently deleted list, rd=%pRD",
+                                               "%s: move route to recently deleted list, rd=%pRDP",
                                                __func__, &ri->rk.rd);
 #endif
 
@@ -2265,7 +2252,7 @@ static int print_rib_sl(int (*fp)(void *, const char *, ...), struct vty *vty,
                }
 #endif
 
-               fp(out, " %c %-20s %-15s %-15s %-4u %-8s %-8s %pRD\n",
+               fp(out, " %c %-20s %-15s %-15s %-4u %-8s %-8s %pRDP\n",
                   deleted ? 'r' : ' ', *printedprefix ? "" : str_pfx, str_vn,
                   str_un, ri->cost, str_lifetime, str_age, &ri->rk.rd);
 
index 3ad021b4f40ce973737fd6b8b8df170c945518a2..1b626bd2e18b895205421991a9e3aca97cd6f5c7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index d04d1ee7500f3ede7e87c5057812f384be1c2b02..2b768b8f8d788180a57fbf83f1da40b7542a13fb 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
@@ -1602,7 +1589,7 @@ void rfapiPrintDescriptor(struct vty *vty, struct rfapi_descriptor *rfd)
        vty_out(vty, " ");
        rfapiPrintRfapiIpAddr(vty, &rfd->vn_addr);
        vty_out(vty, " %p %p ", rfd->response_cb, rfd->cookie);
-       vty_out(vty, "%pRD", &rfd->rd);
+       vty_out(vty, "%pRDP", &rfd->rd);
        vty_out(vty, " %d", rfd->response_lifetime);
        vty_out(vty, " %s", (rfd->rfg ? rfd->rfg->name : "<orphaned>"));
        vty_out(vty, "%s", HVTYNL);
@@ -1863,7 +1850,7 @@ void rfapiPrintNhl(void *stream, struct rfapi_next_hop_entry *next_hops)
                                           vo->v.local_nexthop.cost, HVTYNL);
                                        break;
 
-                               default:
+                               case RFAPI_VN_OPTION_TYPE_INTERNAL_RD:
                                        fp(out,
                                           "%svn option type %d (unknown)%s",
                                           offset, vo->type, HVTYNL);
@@ -1881,7 +1868,7 @@ void rfapiPrintNhl(void *stream, struct rfapi_next_hop_entry *next_hops)
                                        rfapi_print_tunneltype_option(
                                                stream, 8, &uo->v.tunnel);
                                        break;
-                               default:
+                               case RFAPI_UN_OPTION_TYPE_PROVISIONAL:
                                        fp(out, "%sUN Option type %d%s", offset,
                                           uo->type, vty_newline);
                                        break;
@@ -4175,7 +4162,8 @@ static int rfapi_vty_show_nve_summary(struct vty *vty,
                case SHOW_NVE_SUMMARY_RESPONSES:
                        rfapiRibShowResponsesSummary(vty);
 
-               default:
+               case SHOW_NVE_SUMMARY_UNKNOWN_NVES:
+               case SHOW_NVE_SUMMARY_MAX:
                        break;
                }
                vty_out(vty, "\n");
@@ -4721,6 +4709,7 @@ static int vnc_add_vrf_prefix(struct vty *vty, const char *arg_vrf,
        if (arg_rd) {
                opt = &optary[cur_opt++];
                opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD;
+               /* TODO: save RD format */
                if (!str2prefix_rd(arg_rd, &opt->v.internal_rd)) {
                        vty_out(vty, "Malformed RD \"%s\"\n", arg_rd);
                        return CMD_WARNING_CONFIG_FAILED;
index c8b8613feb67c749badf72de6208e1a286536eb0..a5637019868245989bedd00a14cc681a417a4a75 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef RFAPI_VTY_H
index 5c627efbee1c4aa21ed3eeed65e15c24d74e4533..eb0d861904217dfc35844354cb2690f9a4fd14f6 100644 (file)
@@ -1,25 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2016, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/zebra.h"
 
-#include <lib/version.h>
 #include "lib/prefix.h"
 #include "lib/linklist.h"
 #include "lib/stream.h"
index c472b6366e4bbfedcdc1525c5fe540025160909d..c7751277c83b9eb9c82a67388372dd20df1dc862 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2016, LabN Consulting, L.L.C.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_BGP_VNC_DEBUG_H
index 05e45bc4c88e280183e988eae018ada841ac887b..5449220448590a771e8784e698849f68e0f951fe 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -399,7 +386,6 @@ void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct agg_node *rn,
         * withdraw the route
         */
        bgp_withdraw(bpi->peer, p, 0, /* addpath_id */
-                    NULL,            /* attr, ignored */
                     afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT,
                     BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */
                     NULL, 0, NULL); /* tag not used for unicast */
@@ -491,7 +477,6 @@ static void vnc_direct_bgp_vpn_disable_ce(struct bgp *bgp, afi_t afi)
                                bgp_withdraw(
                                        ri->peer, bgp_dest_get_prefix(dest),
                                        0,    /* addpath_id */
-                                       NULL, /* ignored */
                                        AFI_IP, SAFI_UNICAST,
                                        ZEBRA_ROUTE_VNC_DIRECT,
                                        BGP_ROUTE_REDISTRIBUTE,
@@ -876,7 +861,6 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp,
 
                        bgp_withdraw(irfd->peer, p, /* prefix */
                                     0,             /* addpath_id */
-                                    NULL,          /* attr, ignored */
                                     afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT,
                                     BGP_ROUTE_REDISTRIBUTE,
                                     NULL, /* RD not used for unicast */
@@ -906,7 +890,6 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp,
 
                        bgp_withdraw(irfd->peer, p, /* prefix */
                                     0,             /* addpath_id */
-                                    NULL,          /* attr, ignored */
                                     afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT,
                                     BGP_ROUTE_REDISTRIBUTE,
                                     NULL, /* RD not used for unicast */
@@ -1143,7 +1126,6 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd)
 
                                        bgp_withdraw(irfd->peer, p, /* prefix */
                                                     0,    /* addpath_id */
-                                                    NULL, /* attr, ignored */
                                                     afi, SAFI_UNICAST,
                                                     ZEBRA_ROUTE_VNC_DIRECT,
                                                     BGP_ROUTE_REDISTRIBUTE,
@@ -1375,7 +1357,6 @@ static void vnc_direct_del_rn_group_rd(struct bgp *bgp,
 
        bgp_withdraw(irfd->peer, agg_node_get_prefix(rn), /* prefix */
                     0,                                   /* addpath_id */
-                    NULL,                                /* attr, ignored */
                     afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT,
                     BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */
                     NULL, 0, NULL); /* tag not used for unicast */
@@ -1494,7 +1475,6 @@ static void vnc_direct_bgp_unexport_table(afi_t afi, struct agg_table *rt,
                                        bgp_withdraw(irfd->peer,
                                                     agg_node_get_prefix(rn),
                                                     0,    /* addpath_id */
-                                                    NULL, /* attr, ignored */
                                                     afi, SAFI_UNICAST,
                                                     ZEBRA_ROUTE_VNC_DIRECT,
                                                     BGP_ROUTE_REDISTRIBUTE,
@@ -1733,7 +1713,6 @@ static void vncExportWithdrawTimer(struct thread *t)
         * withdraw the route
         */
        bgp_withdraw(eti->peer, p, 0, /* addpath_id */
-                    NULL,            /* attr, ignored */
                     family2afi(p->family), SAFI_UNICAST, eti->type,
                     eti->subtype, NULL, /* RD not used for unicast */
                     NULL, 0,
@@ -2018,7 +1997,6 @@ void vnc_direct_bgp_rh_vpn_disable(struct bgp *bgp, afi_t afi)
 
                                bgp_withdraw(ri->peer, dest_p, /* prefix */
                                             0,                /* addpath_id */
-                                            NULL,             /* ignored */
                                             AFI_IP, SAFI_UNICAST,
                                             ZEBRA_ROUTE_VNC_DIRECT_RH,
                                             BGP_ROUTE_REDISTRIBUTE,
index a6f8c82c0d4c669c3590dceaadfe02af285f4e4a..9ea20b19517c3f9619561157aab5596fa800eb6f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_RFAPI_VNC_EXPORT_BGP_H_
index bf292abb0a8e41f75ce00103ad8a92d4bc067ee1..8f5b6137c64e6556d9371f7dfd1dd9bbd235bb47 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_RFAPI_VNC_EXPORT_BGP_P_H_
index 743576d2654ec8c466873c24ef5e99483cd1d7b0..4b6bacae9646eabdbc2763187163bc0f0c148a1f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 8a1fc9aaefd2c69d2677300c882e5d7a499d57dc..42c04f0c79564847074fef8381a96ccf4bda2964 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_VNC_VNC_EXPORT_TABLE_H_
index acbc413917e55492de701d413d985b293341c7b7..7c8e8f35c9e2c000a2662cff5719f998c7736a94 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index ab2ec1a7487ff64623d795cab25ed9e9ac800b2d..c8d4170c63503a9bdfb0f3f94025cac84bf3b188 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_RFAPI_VNC_IMPORT_BGP_H_
index c6627dfba46b60638f7959757fd0cd60fe526077..7019796c4c4e96020d5e25b62b888ceec82ebd4f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_RFAPI_VNC_IMPORT_BGP_P_H_
index fe818987b87aebeb7ec99a378d18aff30f1e2882..4dab0bc3330590b87b8d9e513174e6fc25eb4809 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index b8c1cb15c401f3a3f67a36c6b6adef712a437363..6d7e68905e5f51c7a2a955ee13c0eaf1959a2854 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2009-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index ecb0c799095fe63a250e47a7f0c1cf916d02e632..ae74fed8224f37434add5a270e6877dc349d9099 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Sample header file */
index 9a4ec7dbf38c4524b63f71df7a7efd20503d6b15..3a512902e0276425ebd65c09736399b5b4bca05e 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index f54f40dd1d3a9a707d703394a46b867d691dfe19..83b0b55c0550a4845225f62f72bcf86294b0259b 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Sample header file */
index 1036829b899ff68b80e55fe5af6de1fa990b7e90..e57f8b0882a54bd458054df3f9240376b12a8be0 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 1f0ccb8c4326735fae476fdbfd153728220216d4..66f70ae04e1283152a28fe5800799019e7fdb2b9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Sample header file */
index eeae82fc44535d6943b40f71be2be757a5c29122..7edc4a5ee1dd3c799762f9490d2e976514091d04 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+# SPDX-License-Identifier: NONE
 # written 2012-2013 by David Lamparter, placed in Public Domain.
 #
 # builds some git commit of FRR in some different configurations
index 48ac4873b86a88b9733e990f8caa45bb5af370c1..495c89c0d6104ae21ca8b9f32379468d1a283eae 100644 (file)
@@ -7,7 +7,7 @@
 ##
 AC_PREREQ([2.69])
 
-AC_INIT([frr], [8.5-dev], [https://github.com/frrouting/frr/issues])
+AC_INIT([frr], [9.0-dev], [https://github.com/frrouting/frr/issues])
 PACKAGE_URL="https://frrouting.org/"
 AC_SUBST([PACKAGE_URL])
 PACKAGE_FULLNAME="FRRouting"
@@ -351,6 +351,7 @@ AC_C_FLAG([-Wall])
 AC_C_FLAG([-Wextra])
 AC_C_FLAG([-Wformat-nonliteral])
 AC_C_FLAG([-Wformat-security])
+AC_C_FLAG([-Wswitch-enum])
 AC_C_FLAG([-Wstrict-prototypes])
 AC_C_FLAG([-Wmissing-prototypes])
 AC_C_FLAG([-Wmissing-declarations])
index fae7924c168a865a94afc5286180f549c6894c56..008a97c7d5e88342c68a6b62c87f7f545310895c 100644 (file)
@@ -1,8 +1,14 @@
-frr (8.5~dev-1) UNRELEASED; urgency=medium
+frr (9.0~dev-1) UNRELEASED; urgency=medium
 
-  * FRR Dev 8.5
+  * FRR Dev 9.0
 
- -- Donatas Abraitis <donatas@opensourcerouting.org>  Tue, 04 Oct 2022 16:00:00 +0500
+ -- Donatas Abraitis <donatas@opensourcerouting.org>  Tue, 07 Feb 2023 16:00:00 +0500
+
+frr (8.5-1) UNRELEASED; urgency=medium
+
+  * New upstream release FRR 8.5
+
+ -- Donatas Abraitis <donatas@opensourcerouting.org>  Tue, 07 Feb 2023 16:00:00 +0500
 
 frr (8.4.2-1) unstable; urgency=medium
 
index 5d1dda06dfcea1a9f5546910991ee250d884ba58..2a08531bd742c3ea3499056f5df600cc8e37d748 100644 (file)
@@ -151,6 +151,7 @@ by the parser.
                          : RANGE
                          : MAC
                          : MAC_PREFIX
+                         : ASNUM
    selector: "<" `selector_seq_seq` ">" `varname_token`
            : "{" `selector_seq_seq` "}" `varname_token`
            : "[" `selector_seq_seq` "]" `varname_token`
@@ -176,27 +177,29 @@ parser, but this is merely a dumb copy job.
 
 Here is a brief summary of the various token types along with examples.
 
-+-----------------+-------------------+-------------------------------------------------------------+
-| Token type      | Syntax            | Description                                                 |
-+=================+===================+=============================================================+
-| ``WORD``        | ``show ip bgp``   | Matches itself. In the given example every token is a WORD. |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``IPV4``        | ``A.B.C.D``       | Matches an IPv4 address.                                    |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``IPV6``        | ``X:X::X:X``      | Matches an IPv6 address.                                    |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``IPV4_PREFIX`` | ``A.B.C.D/M``     | Matches an IPv4 prefix in CIDR notation.                    |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``IPV6_PREFIX`` | ``X:X::X:X/M``    | Matches an IPv6 prefix in CIDR notation.                    |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``MAC``         | ``X:X:X:X:X:X``   | Matches a 48-bit mac address.                               |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``MAC_PREFIX``  | ``X:X:X:X:X:X/M`` | Matches a 48-bit mac address with a mask.                   |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``VARIABLE``    | ``FOOBAR``        | Matches anything.                                           |
-+-----------------+-------------------+-------------------------------------------------------------+
-| ``RANGE``       | ``(X-Y)``         | Matches numbers in the range X..Y inclusive.                |
-+-----------------+-------------------+-------------------------------------------------------------+
++-----------------+-------------------------+-------------------------------------------------------+
+| Token type      | Syntax                  | Description                                           |
++=================+=========================+=======================================================+
+| ``WORD``        | ``show ip bgp``         | Matches itself. In the example every token is a WORD. |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``IPV4``        | ``A.B.C.D``             | Matches an IPv4 address.                              |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``IPV6``        | ``X:X::X:X``            | Matches an IPv6 address.                              |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``IPV4_PREFIX`` | ``A.B.C.D/M``           | Matches an IPv4 prefix in CIDR notation.              |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``IPV6_PREFIX`` | ``X:X::X:X/M``          | Matches an IPv6 prefix in CIDR notation.              |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``MAC``         | ``X:X:X:X:X:X``         | Matches a 48-bit mac address.                         |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``MAC_PREFIX``  | ``X:X:X:X:X:X/M``       | Matches a 48-bit mac address with a mask.             |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``VARIABLE``    | ``FOOBAR``              | Matches anything.                                     |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``RANGE``       | ``(X-Y)``               | Matches numbers in the range X..Y inclusive.          |
++-----------------+-------------------------+-------------------------------------------------------+
+| ``ASNUM``       | ``<A.B|(1-4294967295>`` | Matches an AS in plain or dot format.                 |
++-----------------+-------------------------+-------------------------------------------------------+
 
 When presented with user input, the parser will search over all defined
 commands in the current context to find a match. It is aware of the various
index 06a2ccbc0aae9a7df69372d92f5267bfad8ad06d..320824ec1db591cd940295d6a6082d4a9ebe32bf 100644 (file)
@@ -342,6 +342,46 @@ summary of the included patches.  The description should provide
 additional details that will help the reviewer to understand the context
 of the included patches.
 
+Squash commits
+--------------
+
+Before merging make sure a PR has squashed the following kinds of commits:
+
+- Fixes/review feedback
+- Typos
+- Merges and rebases
+- Work in progress
+
+This helps to automatically generate human-readable changelog messages.
+
+Commit Guidelines
+-----------------
+
+There is a built-in commit linter. Basic rules:
+
+- Commit messages must be prefixed with the name of the changed subsystem, followed
+  by a colon and a space and start with an imperative verb.
+
+   `Check <https://github.com/FRRouting/frr/tree/master/.github/commitlint.config.js>`_ all
+   the supported subsystems.
+
+- Commit messages must start with a capital letter
+- Commit messages must not end with a period ``.``
+
+Why was my pull request closed?
+-------------------------------
+
+Pull requests older than 180 days will be closed. Exceptions can be made for
+pull requests that have active review comments, or that are awaiting other
+dependent pull requests. Closed pull requests are easy to recreate, and little
+work is lost by closing a pull request that subsequently needs to be reopened.
+
+We want to limit the total number of pull requests in flight to:
+
+- Maintain a clean project
+- Remove old pull requests that would be difficult to rebase as the underlying code has changed over time
+- Encourage code velocity
+
 .. _license-for-contributions:
 
 License for Contributions
@@ -631,33 +671,36 @@ above) added to the file. The header should be:
 
 .. code-block:: c
 
+    // SPDX-License-Identifier: GPL-2.0-or-later
     /*
      * Title/Function of file
      * Copyright (C) YEAR  Author’s Name
-     *
-     * This program is free software; you can redistribute it and/or modify it
-     * under the terms of the GNU General Public License as published by the Free
-     * Software Foundation; either version 2 of the License, or (at your option)
-     * any later version.
-     *
-     * This program is distributed in the hope that it will be useful, but WITHOUT
-     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-     * more details.
-     *
-     * You should have received a copy of the GNU General Public License along
-     * with this program; see the file COPYING; if not, write to the Free Software
-     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
      */
 
     #include <zebra.h>
 
-Please copy-paste this header verbatim. In particular:
+A ``SPDX-License-Identifier`` header is required in all source files, i.e.
+``.c``, ``.h``, ``.cpp`` and ``.py`` files.  The license boilerplate should be
+removed in these files.  Some existing files are missing this header, this is
+slowly being fixed.
+
+A ``SPDX-License-Identifier`` header *and* the full license boilerplate is
+required in schema definition files, i.e. ``.yang`` and ``.proto``.  The
+rationale for this is that these files are likely to be individually copied to
+places outside FRR, and having only the SPDX header would become a "dangling
+pointer".
+
+.. warning::
+
+   **DO NOT REMOVE A "Copyright" LINE OR AUTHOR NAME, EVER.**
+
+   **DO NOT APPLY AN SPDX HEADER WHEN THE LICENSE IS UNCLEAR, UNLESS YOU HAVE
+   CHECKED WITH *ALL* SIGNIFICANT AUTHORS.**
+
+Please to keep ``#include <zebra.h>``.  The absolute first header included in
+any C file **must** be either ``zebra.h`` or ``config.h`` (with HAVE_CONFIG_H
+guard.)
 
-- Do not replace "This program" with "FRR"
-- Do not change the address of the FSF
-- keep ``#include <zebra.h>``.  The absolute first header included in any C
-  file **must** be either ``zebra.h`` or ``config.h`` (with HAVE_CONFIG_H guard)
 
 Adding Copyright Claims to Existing Files
 -----------------------------------------
index e177c3983f72a85e391a72ff36b4da75d9be51ac..39ce5e620d2e24a10b0950973261170f1e188719 100644 (file)
@@ -1,17 +1,6 @@
 # -*- coding: utf-8 -*-
+# SPDX-License-Identifier: ISC
 # Copyright (c) 2017 Vincent Bernat <bernat@luffy.cx>
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 from pygments.lexer import RegexLexer, bygroups
 from pygments.token import Text, Comment, Keyword
diff --git a/doc/licenses/BSD-2-Clause b/doc/licenses/BSD-2-Clause
new file mode 100644 (file)
index 0000000..d11142d
--- /dev/null
@@ -0,0 +1,19 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/doc/licenses/BSD-3-Clause b/doc/licenses/BSD-3-Clause
new file mode 100644 (file)
index 0000000..46b46ec
--- /dev/null
@@ -0,0 +1,23 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/doc/licenses/GPL-2.0 b/doc/licenses/GPL-2.0
new file mode 100644 (file)
index 0000000..d159169
--- /dev/null
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/doc/licenses/GPL-3.0 b/doc/licenses/GPL-3.0
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/doc/licenses/ISC b/doc/licenses/ISC
new file mode 100644 (file)
index 0000000..02add5e
--- /dev/null
@@ -0,0 +1,11 @@
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/doc/licenses/LGPL-2.1 b/doc/licenses/LGPL-2.1
new file mode 100644 (file)
index 0000000..4362b49
--- /dev/null
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/doc/licenses/LicenseRef-Skiplist-BSD-0-Clause b/doc/licenses/LicenseRef-Skiplist-BSD-0-Clause
new file mode 100644 (file)
index 0000000..764f7cc
--- /dev/null
@@ -0,0 +1,15 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/doc/licenses/MIT b/doc/licenses/MIT
new file mode 100644 (file)
index 0000000..73e41b1
--- /dev/null
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/doc/licenses/Unlicense b/doc/licenses/Unlicense
new file mode 100644 (file)
index 0000000..efb9808
--- /dev/null
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <https://unlicense.org/>
diff --git a/doc/user/affinitymap.rst b/doc/user/affinitymap.rst
new file mode 100644 (file)
index 0000000..b7dcb14
--- /dev/null
@@ -0,0 +1,32 @@
+.. _affinity-map:
+
+*************
+Affinity Maps
+*************
+
+Affinity maps provide a means of configuring Standard Admininistrative-Group
+(RFC3630, RFC5305 and RFC5329) and Extended Admininistrative-Group (RFC7308).
+An affinity-map maps a specific bit position to a human readable-name.
+
+An affinity refers to a color or a ressource class in the Traffic Engineering
+terminology. The bit position means the position of the bit set starting from
+the least significant bit. For example, if the affinity 'blue' has bit position
+0 the extended Admin-Group value will be 0x01. If the affinity 'red' bit
+position 2 was added to a link in combination with the 'blue' affinity, the
+Admin-Group value would be 0x05.
+
+Command
+-------
+
+.. clicmd:: affinity-map NAME bit-position (0-1023)
+
+   Map the affinity name NAME to the bit-position. The bit-position is the key
+   so that only one name can be mapped to particular bit-position.
+
+.. clicmd:: no affinity-map NAME
+
+   Remove the affinity-map mapping.
+
+Affinity-maps with a bit-position value higher than 31 are not compatible with
+Standard Admininistrative-Group. The CLI disallow the usage of such
+affinity-maps when Standard Admininistrative-Groups are required.
\ No newline at end of file
index 4a64d8f949ed48aada9902a597d7033f8b609b3e..254dad8303b17dd620096a28b63539930688b6f2 100644 (file)
@@ -294,6 +294,12 @@ Basic Config Commands
       log files to quickly balloon in size.  Remember to disable backtraces
       when they're no longer needed.
 
+.. clicmd:: debug routemap [detail]
+
+   This command turns on debugging of routemaps.  When detail is specified
+   more data is provided to the operator about the reasoning about what
+   is going on in the routemap code.
+
 .. clicmd:: service password-encryption
 
    Encrypt password.
index 9c69848258008253a37003f31da9ed5139595256..1798f1ad2a07fe5870d3feecfe09697c9dd0e005 100644 (file)
@@ -254,8 +254,9 @@ ASN and Router ID
 -----------------
 
 First of all you must configure BGP router with the :clicmd:`router bgp ASN`
-command. The AS number is an identifier for the autonomous system. The BGP
-protocol uses the AS number for detecting whether the BGP connection is
+command. The AS number is an identifier for the autonomous system. The AS
+identifier can either be a number or two numbers separated by a period. The
+BGP protocol uses the AS identifier for detecting whether the BGP connection is
 internal or external.
 
 .. clicmd:: router bgp ASN
@@ -1711,6 +1712,11 @@ Configuring Peers
    If you do not want specific attributes, you can drop them using this command, and
    let the BGP proceed by ignoring those attributes.
 
+.. clicmd:: neighbor <A.B.C.D|X:X::X:X|WORD> path-attribute treat-as-withdraw (1-255)...
+
+   Received BGP UPDATES that contain specified path attributes are treat-as-withdraw. If
+   there is an existing prefix in the BGP routing table, it will be removed.
+
 .. clicmd:: neighbor <A.B.C.D|X:X::X:X|WORD> graceful-shutdown
 
    Mark all routes from this neighbor as less preferred by setting ``graceful-shutdown``
@@ -1837,11 +1843,21 @@ Configuring Peers
 Displaying Information about Peers
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. clicmd:: show bgp <afi> <safi> neighbors WORD bestpath-routes [json] [wide]
+.. clicmd:: show bgp <afi> <safi> neighbors WORD bestpath-routes [detail] [json] [wide]
 
    For the given neighbor, WORD, that is specified list the routes selected
    by BGP as having the best path.
 
+   If ``detail`` option is specified, the detailed version of all routes
+   will be displayed. The same format as ``show [ip] bgp [afi] [safi] PREFIX``
+   will be used, but for the whole table of received, advertised or filtered
+   prefixes.
+
+   If ``json`` option is specified, output is displayed in JSON format.
+
+   If ``wide`` option is specified, then the prefix table's width is increased
+   to fully display the prefix and the nexthop.
+
 .. _bgp-peer-filtering:
 
 Peer Filtering
@@ -2005,10 +2021,17 @@ Capability Negotiation
 
 .. clicmd:: neighbor PEER override-capability
 
-
    Override the result of Capability Negotiation with local configuration.
    Ignore remote peer's capability value.
 
+.. clicmd:: neighbor PEER capability software-version
+
+   Send the software version in the BGP OPEN message to the neighbor. This is
+   very useful in environments with a large amount of peers with different
+   versions of FRR or any other vendor.
+
+   Disabled by default.
+
 .. _bgp-as-path-access-lists:
 
 AS Path Access Lists
@@ -2091,9 +2114,6 @@ is 4 octet long. The following format is used to define the community value.
    ``7675:80`` can be used when AS 7675 wants to pass local policy value 80 to
    neighboring peer.
 
-``internet``
-   ``internet`` represents well-known communities value 0.
-
 ``graceful-shutdown``
    ``graceful-shutdown`` represents well-known communities value
    ``GRACEFUL_SHUTDOWN`` ``0xFFFF0000`` ``65535:0``. :rfc:`8326` implements
@@ -2464,17 +2484,6 @@ community-list.
     match community FILTER
 
 
-The communities value keyword ``internet`` has special meanings in standard
-community lists. In the below example ``internet`` matches all BGP routes even
-if the route does not have communities attribute at all. So community list
-``INTERNET`` is the same as ``FILTER`` in the previous example.
-
-.. code-block:: frr
-
-   bgp community-list standard INTERNET deny 1:1
-   bgp community-list standard INTERNET permit internet
-
-
 The following configuration is an example of communities value deletion.  With
 this configuration the community values ``100:1`` and ``100:2`` are removed
 from BGP updates. For communities value deletion, only ``permit``
@@ -2544,9 +2553,6 @@ Extended Community Lists
    there is no matched entry, deny will be returned. When `extcommunity` is
    empty it matches to any routes.
 
-   A special handling for ``internet`` community is applied. It matches
-   any community.
-
 .. clicmd:: bgp extcommunity-list expanded NAME permit|deny LINE
 
    This command defines a new expanded extcommunity-list. `line` is a string
@@ -3877,6 +3883,10 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
 
    EVPN prefixes can also be filtered by EVPN route type.
 
+.. clicmd:: show bgp l2vpn evpn route [detail] [type <ead|1|macip|2|multicast|3|es|4|prefix|5>] self-originate [json]
+
+   Display self-originated EVPN prefixes which can also be filtered by EVPN route type.
+
 .. clicmd:: show bgp vni <all|VNI> [vtep VTEP] [type <ead|1|macip|2|multicast|3>] [<detail|json>]
 
    Display per-VNI EVPN routing table in bgp. Filter route-type, vtep, or VNI.
@@ -3916,7 +3926,7 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
    The ``terse`` option can be used in combination with the remote-as, neighbor,
    failed and established filters, and with the ``wide`` option as well.
 
-.. clicmd:: show bgp [afi] [safi] [neighbor [PEER] [routes|advertised-routes|received-routes] [detail] [json]
+.. clicmd:: show bgp [afi] [safi] [neighbor [PEER] [routes|advertised-routes|received-routes] [<A.B.C.D/M|X:X::X:X/M> | detail] [json]
 
    This command shows information on a specific BGP peer of the relevant
    afi and safi selected.
@@ -3931,6 +3941,9 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
    The ``received-routes`` keyword displays all routes belonging to this
    address-family (prior to inbound policy) that were received by this peer.
 
+   If a specific prefix is specified, the detailed version of that prefix will
+   be displayed.
+
    If ``detail`` option is specified, the detailed version of all routes
    will be displayed. The same format as ``show [ip] bgp [afi] [safi] PREFIX``
    will be used, but for the whole table of received, advertised or filtered
@@ -4030,7 +4043,16 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
 
    If the ``json`` option is specified, output is displayed in JSON format.
 
-.. clicmd:: show [ip] bgp [afi] [safi] [all] neighbors A.B.C.D [advertised-routes|received-routes|filtered-routes] [detail] [json|wide]
+.. clicmd:: show [ip] bgp [afi] [safi] [all] self-originate [wide|json]
+
+   Display self-originated routes.
+
+   If ``wide`` option is specified, then the prefix table's width is increased
+   to fully display the prefix and the nexthop.
+
+   If the ``json`` option is specified, output is displayed in JSON format.
+
+.. clicmd:: show [ip] bgp [afi] [safi] [all] neighbors A.B.C.D [advertised-routes|received-routes|filtered-routes] [<A.B.C.D/M|X:X::X:X/M> | detail] [json|wide]
 
    Display the routes advertised to a BGP neighbor or received routes
    from neighbor or filtered routes received from neighbor based on the
@@ -4047,6 +4069,9 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
    if afi is specified, with ``all`` option, routes will be displayed for
    each SAFI in the selcted AFI
 
+   If a specific prefix is specified, the detailed version of that prefix will
+   be displayed.
+
    If ``detail`` option is specified, the detailed version of all routes
    will be displayed. The same format as ``show [ip] bgp [afi] [safi] PREFIX``
    will be used, but for the whole table of received, advertised or filtered
@@ -4273,6 +4298,26 @@ Segment-Routing IPv6
      vpn_policy[AFI_IP].tovpn_sid: none
      vpn_policy[AFI_IP6].tovpn_sid: 2001:db8:1:1::200
 
+AS-notation support
+-------------------
+
+By default, the ASN value output follows how the BGP ASN instance is
+expressed in the configuration. Three as-notation outputs are available:
+
+- plain output: both AS4B and AS2B use a single number.
+  ` router bgp 65536`.
+
+- dot output: AS4B values are using two numbers separated by a period.
+  `router bgp 1.1` means that the AS number is 65536.
+
+- dot+ output: AS2B and AS4B values are using two numbers separated by a
+  period. `router bgp 0.5` means that the AS number is 5.
+
+The below option permits forcing the as-notation output:
+
+.. clicmd:: router bgp ASN as-notation dot|dot+|plain
+
+   The chosen as-notation format will override the BGP ASN output.
 
 .. _bgp-route-reflector:
 
index 3650792a3e83937d6bf0af84d721380ab1ef63f7..fa157c4659007e54d246bd2db411637f4e23960c 100644 (file)
@@ -41,8 +41,9 @@ running EIGRP is:
 
 Please note that *zebra* must be invoked before *eigrpd*.
 
-To stop *eigrpd*, please use ::
-   kill `cat /var/run/eigrpd.pid`
+To stop *eigrpd*, please use::
+
+   kill `cat /var/run/frr/eigrpd.pid`
 
 Certain signals have special meanings to *eigrpd*.
 
index 5d849c7b8a17c953393386e3aa2681de0b8c4600..72471d7af0e23ac11270ebf1e29a3258c03f37ca 100644 (file)
@@ -40,7 +40,7 @@ Please note that *zebra* must be invoked before *pimd*.
 
 To stop *pimd* please use::
 
-   kill `cat /var/run/pimd.pid`
+   kill `cat /var/run/frr/pimd.pid`
 
 Certain signals have special meanings to *pimd*.
 
index 7fd285600192f8c3f72a751ca246d8010a200a78..856939038ff0fec1a5ed6aca432a9ed4f42fc003 100644 (file)
@@ -32,7 +32,7 @@ Please note that *zebra* must be invoked before *pim6d*.
 
 To stop *pim6d* please use::
 
-   kill `cat /var/run/pim6d.pid`
+   kill `cat /var/run/frr/pim6d.pid`
 
 Certain signals have special meanings to *pim6d*.
 
index 66bdd26f1a785a041d4404b2ed114f522d70407d..67323e61f32db250ebca6ab17d8610cb73779f4b 100644 (file)
@@ -40,7 +40,8 @@ sequence for running RIP is like below:
 Please note that *zebra* must be invoked before *ripd*.
 
 To stop *ripd*. Please use::
-   kill `cat /var/run/ripd.pid`
+
+   kill `cat /var/run/frr/ripd.pid`
 
 Certain signals have special meanings to *ripd*.
 
@@ -87,15 +88,12 @@ multipath routing.
 RIP Configuration
 =================
 
-.. clicmd:: router rip
+.. clicmd:: router rip [vrf NAME]
 
    The `router rip` command is necessary to enable RIP. To disable RIP, use the
    `no router rip` command. RIP must be enabled before carrying out any of the
    RIP commands.
 
-
-   Disable RIP.
-
 .. clicmd:: network NETWORK
 
 
@@ -151,13 +149,16 @@ RIP Configuration
 
    The default is to be passive on all interfaces.
 
-.. clicmd:: ip split-horizon
+.. clicmd:: ip split-horizon [poisoned-reverse]
 
 
    Control split-horizon on the interface. Default is `ip split-horizon`. If
    you don't perform split-horizon on the interface, please specify `no ip
    split-horizon`.
 
+   If `poisoned-reverse` is also set, the router sends the poisoned routes
+   with highest metric back to the sending router.
+
 .. _rip-version-control:
 
 RIP Version Control
@@ -176,8 +177,8 @@ discussion on the security implications of RIPv1 see :ref:`rip-authentication`.
 
 .. clicmd:: version VERSION
 
-   Set RIP version to accept for reads and send. ``VERSION`` can be either 1 or
-   1.
+   Set RIP version to accept for reads and send. VERSION can be either
+   ``1`` or ``2``.
 
    Disabling RIPv1 by specifying version 2 is STRONGLY encouraged,
    :ref:`rip-authentication`. This may become the default in a future release.
@@ -474,7 +475,7 @@ Show RIP Information
 
 To display RIP routes.
 
-.. clicmd:: show ip rip
+.. clicmd:: show ip rip [vrf NAME]
 
    Show RIP routes.
 
@@ -483,7 +484,7 @@ through RIP, this command will display the time the packet was sent and
 the tag information. This command will also display this information
 for routes redistributed into RIP.
 
-.. clicmd:: show ip rip status
+.. clicmd:: show ip rip [vrf NAME] status
 
    The command displays current RIP status. It includes RIP timer,
    filtering, version, RIP enabled interface and RIP peer information.
index c7ca22bf9568f12d2f04a71e99d2091c5b304d3a..df7a0e249ec7a2e9219179ede992d86eb8cad061 100644 (file)
@@ -22,14 +22,10 @@ ripngd Configuration
 
 Currently ripngd supports the following commands:
 
-.. clicmd:: router ripng
+.. clicmd:: router ripng [vrf NAME]
 
    Enable RIPng.
 
-.. clicmd:: flush_timer TIME
-
-   Set flush timer.
-
 .. clicmd:: network NETWORK
 
    Set RIPng enabled interface by NETWORK.
@@ -48,7 +44,7 @@ Currently ripngd supports the following commands:
 ripngd Terminal Mode Commands
 =============================
 
-.. clicmd:: show ip ripng
+.. clicmd:: show ipv6 ripng [vrf NAME] status
 
 .. clicmd:: show debugging ripng
 
index 706e1ea44917162bc4fabf3f8b0241e1235a4f78..b8c5c70d9c12aa1faf8461392a16ae55c301e66d 100644 (file)
@@ -3,6 +3,7 @@
 #
 
 user_RSTFILES = \
+       doc/user/affinitymap.rst \
        doc/user/babeld.rst \
        doc/user/ldpd.rst \
        doc/user/basic.rst \
index c05a29af4e34a33cf3a35ed2f3bb6cacca0b6dfc..d7e768b710298241ec7e52a97d2b6da93dbddadf 100644 (file)
@@ -222,8 +222,6 @@ Link Parameters Commands
 
 .. clicmd:: unrsv-bw (0-7) BANDWIDTH
 
-.. clicmd:: admin-grp BANDWIDTH
-
    These commands specifies the Traffic Engineering parameters of the interface
    in conformity to RFC3630 (OSPF) or RFC5305 (ISIS).  There are respectively
    the TE Metric (different from the OSPF or ISIS metric), Maximum Bandwidth
@@ -234,6 +232,36 @@ Link Parameters Commands
    Note that BANDWIDTH is specified in IEEE floating point format and express
    in Bytes/second.
 
+.. clicmd:: admin-grp 0x(0-FFFFFFFF)
+
+   This commands configures the Traffic Engineering Admin-Group of the interface
+   as specified in RFC3630 (OSPF) or RFC5305 (ISIS). Admin-group is also known
+   as Resource Class/Color in the OSPF protocol.
+
+.. clicmd:: [no] affinity AFFINITY-MAP-NAME
+
+   This commands configures the Traffic Engineering Admin-Group of the
+   interface using the affinity-map definitions (:ref:`affinity-map`).
+   Multiple AFFINITY-MAP-NAME can be specified at the same time. Affinity-map
+   names are added or removed if ``no`` is present. It means that specifying one
+   value does not override the full list.
+
+   ``admin-grp`` and ``affinity`` commands provide two ways of setting
+   admin-groups. They cannot be both set on the same interface.
+
+.. clicmd:: [no] affinity-mode [extended|standard|both]
+
+   This commands configures which admin-group format is set by the affinity
+   command. ``extended`` Admin-Group is the default and uses the RFC7308 format.
+   ``standard`` mode uses the standard admin-group format that is defined by
+   RFC3630, RFC5305 and RFC5329. When the ``standard`` mode is set,
+   affinity-maps with bit-positions higher than 31 cannot be applied to the
+   interface. The ``both`` mode allows setting standard and extended admin-group
+   on the link at the same time. In   this case, the bit-positions 0 to 31 are
+   the same on standard and extended admin-groups.
+
+   Note that extended admin-groups are only supported by IS-IS for the moment.
+
 .. clicmd:: delay (0-16777215) [min (0-16777215) | max (0-16777215)]
 
 .. clicmd:: delay-variation (0-16777215)
@@ -590,6 +618,48 @@ nexthops are chosen to forward packets on.  Currently the Linux kernel
 has a ``fib_multipath_hash_policy`` sysctl which dictates how the hashing
 algorithm is used to forward packets.
 
+.. _zebra-svd:
+
+Single Vxlan Device Support
+===========================
+
+FRR supports configuring VLAN-to-VNI mappings for EVPN-VXLAN,
+when working with the Linux kernel. In this new way, the mapping of a VLAN
+to a VNI is configured against a container VXLAN interface which is referred
+to as a ‘Single VXLAN device (SVD)’. Multiple VLAN to VNI mappings can be
+configured against the same SVD. This allows for a significant scaling of
+the number of VNIs since a separate VXLAN interface is no longer required
+for each VNI. Sample configuration of SVD with VLAN to VNI mappings is shown
+below.
+
+If you are using the Linux kernel as a Data Plane, this can be configured
+via `ip link`, `bridge link` and `bridge vlan` commands:
+
+.. code-block:: shell
+
+   # linux shell
+   ip link add dev bridge type bridge
+   ip link set dev bridge type bridge vlan_filtering 1
+   ip link add dev vxlan0 type vxlan external
+   ip link set dev vxlan0 master bridge
+   bridge link set dev vxlan0 vlan_tunnel on
+   bridge vlan add dev vxlan0 vid 100
+   bridge vlan add dev vxlan0 vid 100 tunnel_info id 100
+   bridge vlan tunnelshow
+    port    vlan ids        tunnel id
+    bridge  None
+    vxlan0   100     100
+
+.. clicmd:: show evpn access-vlan [IFNAME VLAN-ID | detail] [json]
+
+   Show information for EVPN Access VLANs.
+
+   ::
+
+      VLAN         SVI             L2-VNI   VXLAN-IF        # Members
+      bridge.20    vlan20          20       vxlan0          0
+      bridge.10    vlan10          0        vxlan0          0
+
 .. _zebra-mpls:
 
 MPLS Commands
@@ -904,7 +974,7 @@ unicast topology!
    Unreachable routes do not receive special treatment and do not cause
    fallback to a second lookup.
 
-.. clicmd:: show ip rpf ADDR
+.. clicmd:: show [ip|ipv6] rpf ADDR
 
    Performs a Multicast RPF lookup, as configured with ``ip multicast
    rpf-lookup-mode MODE``. ADDR specifies the multicast source address to look
@@ -914,7 +984,6 @@ unicast topology!
 
       > show ip rpf 192.0.2.1
       Routing entry for 192.0.2.0/24 using Unicast RIB
-
       Known via "kernel", distance 0, metric 0, best
       * 198.51.100.1, via eth0
 
@@ -922,7 +991,7 @@ unicast topology!
    Indicates that a multicast source lookup for 192.0.2.1 would use an
    Unicast RIB entry for 192.0.2.0/24 with a gateway of 198.51.100.1.
 
-.. clicmd:: show ip rpf
+.. clicmd:: show [ip|ipv6] rpf
 
    Prints the entire Multicast RIB. Note that this is independent of the
    configured RPF lookup mode, the Multicast RIB may be printed yet not
index 2afd9d5eaaf6242766d3f18722a28dcd72195c75..213834afc8f74178b39c042120aed3a45a4df958 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP daemon CLI implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 8b16dea39aaedf80e49935fb331296428580cf44..ed7b27477b804040fe92179886dff5c8e1ff38ac 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP CLI Functions.
  * Copyright (C) 2019
  * Authors:
  *   Donnie Savage
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _EIGRP_CLI_H_
index 149cf00efca772c4a0187f44c56904128c98a5d9..607719d4f136d08a623aa56cd5a5e8a8d698f0eb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Definition of Constants.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_CONST_H_
index b0d34f55e619ccf2c917edef02a16df6ac0aa706..489b3bd1c537bfc2bf3fcb2786db9fe364e05833 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Dump Functions and Debugging.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0d512fc63fdd1b1fd7b9acfcb979adc8b7592f08..7a952f09938db76f7d11eb17bdfc5c8a988e0fc0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Dump Functions and Debbuging.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRPD_DUMP_H_
index 75cf9535572841ffc5d13dc536f6908738e4cce6..9991fd57b8aba5afd47fc8f097edd12676741771 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3270e65138bdef16cf4589387894d419ecf40c7c..885702bd0f4af74ae7affcd8999365c98b5a8064 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __EIGRP_ERRORS_H__
index 8d50ed689e5dc77972e20f0a69a22066471a849b..09ae6be6dc7d83b42475bb335621fab35e45fff1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Filter Functions.
  * Copyright (C) 2013-2015
  *   Martin Kontsek
  *   Lukas Koribsky
  *
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4dbfe276d2d51f903d759319b83cc7100a411ecf..493ba08f7d7e3d51378ad4aa0914004df170c618 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Filter Functions.
  * Copyright (C) 2013-2016
  *   Martin Kontsek
  *   Lukas Koribsky
  *
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef EIGRPD_EIGRP_FILTER_H_
index d2d435bf2d5d8cba6e128fab48e21683bf1b8773..d065af0cb91998fc9ed18c0b41cb171e1ddf9721 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRPd Finite State Machine (DUAL).
  * Copyright (C) 2013-2014
@@ -8,22 +9,6 @@
  *   Peter Orsag
  *   Peter Paluch
  *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * This file contains functions for executing logic of finite state machine
  *
  *                                +------------ +
index 8fad9d1f5118bdd134a33b2cb0e10d4a81c077a7..e9c5223a7df6ebbefb023b95335e1365a2a9b9b9 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Finite State Machine (DUAL).
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_FSM_H
index 717d8c095495f941dd29cbfa04c66af499bd0f64..f62f54b680671f7e65bc9f8e900d6097a241b4e1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP Hello Packets.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 891d282307482eb48c7a436e4c4c516140d00d46..8d98dcf5a18f5d851fbaaed3db5c5d228c2513f1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Interface Functions.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 68ab5125e3e587d18b7808c7331ca2cfb1efb522..76f9c1bcb61361aaf1f8b4cc4187042ae27d5104 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Interface Functions.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_INTERFACE_H_
index b30e19a867bc7115621253ad3aa2394e0cd01ef4..b7cd22fee1df8b5033b6c6f3f03f668c72139520 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Macros Definition.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_MACROS_H_
index a8936dfc31a4172cfb8781db029f03c537b8605e..3c1e5da3400427a63564f59f9f220ad5e2902aef 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Main Routine.
  * Copyright (C) 2013-2015
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 7ccafd4fa8cd897f6d2227eb4203e841f5bfa179..1662f48c8fa458616a9987566ac1062aef00ec2c 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Metric Math Functions.
  * Copyright (C) 2013-2016
  * Authors:
  *   Donnie Savage
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8e9cd667475aafb135c9ad42a2be72159d7811f5..d4a8d09e581a61b3356716c62e7e9d73426dab64 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Metric Math Functions.
  * Copyright (C) 2013-2016
  * Authors:
  *   Donnie Savage
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_METRIC_H_
index 0ed8927d47390da1766b6a4efbfd26b66e6f9c21..9288b0f1cd7c80bd9bb2afdb8a12124587f907c0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Neighbor Handling.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 693d780f0fb75d5ccfeb10e285a61bdeb12c4819..5c9e44e2b96df3b64ef5698a9ccc9498854cd327 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Neighbor Handling.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_NEIGHBOR_H
index 13db38ce91e2d4501e87359b09b1f4e8dba1a7e4..68edd0898a3a0cb73f41d47a4b07be6c167aa78a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Network Related Functions.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 912a9248cff2f8feb819b0b0b0563a0d56f5c4c6..33d91c2fbf7d1e5ded0c1ea3dff9152ba7b8589d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Network Related Functions.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_NETWORK_H
index a0f8452c9416cc03eb1a91f5c2157d717e06d5c4..74a4dcb858541d85ee4df325e00e08238014c3c8 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP daemon northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 1ea6f9813b11c51c7f349fc2f672153ffccd98bf..e00d62fb0869fe3b27c68732789577d905bdfb5c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP General Sending and Receiving of EIGRP Packets.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f659176667d262eb400951bcb9ef34ac273455ed..4c1cfd48289baf8312da339b2b8f5bf79b70fa0c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP General Sending and Receiving of EIGRP Packets.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_PACKET_H
index c8769fb11f784066e1813c22b07194e2f47e4540..56498ed674793ffe65f9a20efb6270decfb9ef9a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP Query Packets.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 015daa768f4961f8024aff89f0711ea886ca27d3..a1413fe9c71285ec6949d32b4be434927a8049a8 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Eigrp Sending and Receiving EIGRP Reply Packets.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 218cea7fa3cbbab8cb4a1777dedd3ab1526f48d9..84f27d01677eaf33de045337bcfb92172061a80f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Filter Functions.
  * Copyright (C) 2013-2015
  * in distribute command in EIGRP is matching destination IP (with both
  * access and prefix list).
  *
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9c2a8c9d849f624af9f315509d34a0bce9192ccb..1c2ec3731f8c1bc1ac12317534e7468f64080337 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP SIA-Query Packets.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2d298c20bfe985293db6ae4c3cdd3cc4b7d9e98c..37cca67373e2da43ffcbb1639ec3e1642b0384ae 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP SIA-Reply Packets.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 5a930424c004785eb76020513f6dee9e272e7b76..f159415ccb8994c4a1cce74853856a73598adab2 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP SNMP Support.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 55114e60555e3ac10c1566963692326e793bc514..3930b5c6bf846751027b633c2ae6354fcb2452f4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP SNMP Support.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index eb4a91cb64e4d1993a155533cb3841295bd65388..9c88e34f6cab4fe8f7210e208ba85fb19c1e6a2e 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Definition of Data Structures.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_STRUCTS_H_
index 846e21162237614a8e1cf8cd9f6bb02831a29dd0..f17be8f4b7db8e89717c353f1aee55308b8e080f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Topology Table.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d7f79057aba468c12e332d094a11c21d80caf95c..426c290d9d15ad39280c5ec1bf4292cd8158a334 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Topology Table.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_TOPOLOGY_H
index bd6510733b94feb7a414f214cde153b60e13c90f..f3ff99d952ae6776a296208cd347e7bce1345168 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Definition of Data Types
  * Copyright (C) 2018
  * Authors:
  *   Donnie Savage
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_TYPES_H_
index 5848632d8b74a2c1f7e810548a025f63bfbec392..49acf3069566f535c210de528d5b1ac9cce495fd 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Sending and Receiving EIGRP Update Packets.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index acf3e6978df4190d8a2ad02935e06e879c83a89c..645233edeea313ceca26816e1af43c191d0de259 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * eigrp - vrf code
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 423a4be55182e30015998ad0bebe99875e1588c1..146d864fe4e164d768cd290c1888a8ffa9857f40 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * eigrp - vrf code
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __EIGRP_VRF_H__
 
index 137f9b028c59e14ee238cbb2281ab18469793127..33f728ec4b923a71378b0014bb4f8018e9b47c93 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP VTY Interface.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ebbf503857deba628c272dd63342a0bcd4b2af60..fa07a785d0c849b6722139fee47578cee3c156d2 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP VTY Interface.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   Martin Kontsek
  *   Lukas Koribsky
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_EIGRP_VTY_H
index a95e5310fb243bf59fb1084a03e69a18efff4378..b59f5f9feded60c1167969b3757c5ee0e5af1983 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP YANG Functions.
  * Copyright (C) 2019
  * Authors:
  *   Donnie Savage
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _EIGRP_YANG_H_
index 89dd5be2729e186a5690cbd9e47f5a91e80fdc6a..179c2d0f2aa88bdc9e58c4464e8c1610a6692081 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for EIGRP.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 112f2584ceb6a717b8f1f758ef5a4838aa3b80b5..927d562ab2cdce0d818b9e5f39dba47746f4c705 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for EIGRP.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRP_ZEBRA_H_
index 0ec957481351cb4571f4fc96164af16350bdf861..a382862e3dc53bae2dd954b6fc3afb8e0d708e4d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Daemon Program.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 949fe682c70d5327136400c2b27735e028b6f0f5..6e5d5d13dcb81e2d0880d98e229cf59ca5d9116a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP main header.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   Matej Perina
  *   Peter Orsag
  *   Peter Paluch
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_EIGRPD_H
index 0da8a5a8bef43cf8f82926dac3a7b36215eed031..b08310f675be46fb12be919121e77cd9d2539e0c 100644 (file)
--- a/fpm/fpm.h
+++ b/fpm/fpm.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC OR GPL-2.0-or-later
 /*
  * Public definitions pertaining to the Forwarding Plane Manager component.
  *
 
 /*
  * License Option 1: GPL
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-/*
  * License Option 2: ISC License
- *
- * Permission to use, copy, modify, and/or distribute this software
- * for any purpose with or without fee is hereby granted, provided
- * that the above copyright notice and this permission notice appear
- * in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FPM_H
index 4597c7f8ebdf78a7a7093b3412338fd1ce9319c7..9f0917feae53b0bd96b4588bdf5f4399fa347825 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 //
 // fpm.proto
 //
index 5cd03a4d59a1369f7172894c4cf62c5918dcaf5f..e4c9395a84a6e0665c8a82e8de47dfc5d91f4513 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * fpm_pb.c
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 659b5a64ac233a3fd0eb9464f223a06a1435c67e..7e39054d19257dff7c57d356f2dc6f145168e3ca 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * fpm_pb.h
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 32544ba694e4303b8b74e9137f4eaf8561965669..b3b1dc465b92f8eedf0b2ae9dd88fef242d5b317 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 //
 // Copyright 2019 FRRouting
 //
index fb79481cb2a627d3d9e326385846a08517db2025..02198fc1d785332bb814a7e2f9a008f17104143d 100644 (file)
@@ -120,6 +120,8 @@ enum {
        IFLA_BRIDGE_MODE,
        IFLA_BRIDGE_VLAN_INFO,
        IFLA_BRIDGE_VLAN_TUNNEL_INFO,
+       IFLA_BRIDGE_MRP,
+       IFLA_BRIDGE_CFM,
        __IFLA_BRIDGE_MAX,
 };
 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
@@ -130,6 +132,7 @@ enum {
 #define BRIDGE_VLAN_INFO_RANGE_BEGIN   (1<<3) /* VLAN is start of vlan range */
 #define BRIDGE_VLAN_INFO_RANGE_END     (1<<4) /* VLAN is end of vlan range */
 #define BRIDGE_VLAN_INFO_BRENTRY       (1<<5) /* Global bridge VLAN entry */
+#define BRIDGE_VLAN_INFO_ONLY_OPTS     (1<<6) /* Skip create/delete/flags */
 
 struct bridge_vlan_info {
        __u16 flags;
@@ -156,6 +159,390 @@ struct bridge_vlan_xstats {
        __u32 pad2;
 };
 
+enum {
+       IFLA_BRIDGE_MRP_UNSPEC,
+       IFLA_BRIDGE_MRP_INSTANCE,
+       IFLA_BRIDGE_MRP_PORT_STATE,
+       IFLA_BRIDGE_MRP_PORT_ROLE,
+       IFLA_BRIDGE_MRP_RING_STATE,
+       IFLA_BRIDGE_MRP_RING_ROLE,
+       IFLA_BRIDGE_MRP_START_TEST,
+       IFLA_BRIDGE_MRP_INFO,
+       IFLA_BRIDGE_MRP_IN_ROLE,
+       IFLA_BRIDGE_MRP_IN_STATE,
+       IFLA_BRIDGE_MRP_START_IN_TEST,
+       __IFLA_BRIDGE_MRP_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
+       IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
+       IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
+       IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
+       IFLA_BRIDGE_MRP_INSTANCE_PRIO,
+       __IFLA_BRIDGE_MRP_INSTANCE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
+       IFLA_BRIDGE_MRP_PORT_STATE_STATE,
+       __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
+       IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
+       __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
+       IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
+       IFLA_BRIDGE_MRP_RING_STATE_STATE,
+       __IFLA_BRIDGE_MRP_RING_STATE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
+       IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
+       IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
+       __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
+       IFLA_BRIDGE_MRP_START_TEST_RING_ID,
+       IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
+       IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
+       IFLA_BRIDGE_MRP_START_TEST_PERIOD,
+       IFLA_BRIDGE_MRP_START_TEST_MONITOR,
+       __IFLA_BRIDGE_MRP_START_TEST_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_INFO_UNSPEC,
+       IFLA_BRIDGE_MRP_INFO_RING_ID,
+       IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
+       IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
+       IFLA_BRIDGE_MRP_INFO_PRIO,
+       IFLA_BRIDGE_MRP_INFO_RING_STATE,
+       IFLA_BRIDGE_MRP_INFO_RING_ROLE,
+       IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
+       IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
+       IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
+       IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
+       IFLA_BRIDGE_MRP_INFO_IN_STATE,
+       IFLA_BRIDGE_MRP_INFO_IN_ROLE,
+       IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
+       IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
+       __IFLA_BRIDGE_MRP_INFO_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
+       IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
+       IFLA_BRIDGE_MRP_IN_STATE_STATE,
+       __IFLA_BRIDGE_MRP_IN_STATE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
+       IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
+       IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
+       IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
+       IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
+       __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
+       IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
+       IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
+       IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
+       IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
+       __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
+};
+
+#define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
+
+struct br_mrp_instance {
+       __u32 ring_id;
+       __u32 p_ifindex;
+       __u32 s_ifindex;
+       __u16 prio;
+};
+
+struct br_mrp_ring_state {
+       __u32 ring_id;
+       __u32 ring_state;
+};
+
+struct br_mrp_ring_role {
+       __u32 ring_id;
+       __u32 ring_role;
+};
+
+struct br_mrp_start_test {
+       __u32 ring_id;
+       __u32 interval;
+       __u32 max_miss;
+       __u32 period;
+       __u32 monitor;
+};
+
+struct br_mrp_in_state {
+       __u32 in_state;
+       __u16 in_id;
+};
+
+struct br_mrp_in_role {
+       __u32 ring_id;
+       __u32 in_role;
+       __u32 i_ifindex;
+       __u16 in_id;
+};
+
+struct br_mrp_start_in_test {
+       __u32 interval;
+       __u32 max_miss;
+       __u32 period;
+       __u16 in_id;
+};
+
+enum {
+       IFLA_BRIDGE_CFM_UNSPEC,
+       IFLA_BRIDGE_CFM_MEP_CREATE,
+       IFLA_BRIDGE_CFM_MEP_DELETE,
+       IFLA_BRIDGE_CFM_MEP_CONFIG,
+       IFLA_BRIDGE_CFM_CC_CONFIG,
+       IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
+       IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
+       IFLA_BRIDGE_CFM_CC_RDI,
+       IFLA_BRIDGE_CFM_CC_CCM_TX,
+       IFLA_BRIDGE_CFM_MEP_CREATE_INFO,
+       IFLA_BRIDGE_CFM_MEP_CONFIG_INFO,
+       IFLA_BRIDGE_CFM_CC_CONFIG_INFO,
+       IFLA_BRIDGE_CFM_CC_RDI_INFO,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_INFO,
+       IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO,
+       IFLA_BRIDGE_CFM_MEP_STATUS_INFO,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO,
+       __IFLA_BRIDGE_CFM_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
+       IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
+       IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
+       IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
+       IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
+       __IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
+       IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
+       __IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
+       IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
+       IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
+       IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
+       IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
+       __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
+       IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
+       IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
+       IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
+       IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
+       __IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
+       IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
+       IFLA_BRIDGE_CFM_CC_PEER_MEPID,
+       __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
+       IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
+       IFLA_BRIDGE_CFM_CC_RDI_RDI,
+       __IFLA_BRIDGE_CFM_CC_RDI_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
+       IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
+       __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC,
+       IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
+       IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
+       IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
+       IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
+       __IFLA_BRIDGE_CFM_MEP_STATUS_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1)
+
+enum {
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN,
+       IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN,
+       __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX,
+};
+
+#define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
+
+struct bridge_stp_xstats {
+       __u64 transition_blk;
+       __u64 transition_fwd;
+       __u64 rx_bpdu;
+       __u64 tx_bpdu;
+       __u64 rx_tcn;
+       __u64 tx_tcn;
+};
+
+#ifndef BRVLAN_RTA
+#define BRVLAN_RTA(r)                                                          \
+       ((struct rtattr *)(((char *)(r))                                       \
+                          + NLMSG_ALIGN(sizeof(struct br_vlan_msg))))
+#endif
+/* Bridge vlan RTM header */
+struct br_vlan_msg {
+       __u8 family;
+       __u8 reserved1;
+       __u16 reserved2;
+       __u32 ifindex;
+};
+
+enum {
+       BRIDGE_VLANDB_DUMP_UNSPEC,
+       BRIDGE_VLANDB_DUMP_FLAGS,
+       __BRIDGE_VLANDB_DUMP_MAX,
+};
+#define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
+
+/* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
+#define BRIDGE_VLANDB_DUMPF_STATS      (1 << 0) /* Include stats in the dump */
+
+/* Bridge vlan RTM attributes
+ * [BRIDGE_VLANDB_ENTRY] = {
+ *     [BRIDGE_VLANDB_ENTRY_INFO]
+ *     ...
+ * }
+ */
+enum {
+       BRIDGE_VLANDB_UNSPEC,
+       BRIDGE_VLANDB_ENTRY,
+       __BRIDGE_VLANDB_MAX,
+};
+#define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
+
+enum {
+       BRIDGE_VLANDB_ENTRY_UNSPEC,
+       BRIDGE_VLANDB_ENTRY_INFO,
+       BRIDGE_VLANDB_ENTRY_RANGE,
+       BRIDGE_VLANDB_ENTRY_STATE,
+       BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
+       BRIDGE_VLANDB_ENTRY_STATS,
+       __BRIDGE_VLANDB_ENTRY_MAX,
+};
+#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
+
+/* [BRIDGE_VLANDB_ENTRY] = {
+ *     [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
+ *         [BRIDGE_VLANDB_TINFO_ID]
+ *         ...
+ *     }
+ * }
+ */
+enum {
+       BRIDGE_VLANDB_TINFO_UNSPEC,
+       BRIDGE_VLANDB_TINFO_ID,
+       BRIDGE_VLANDB_TINFO_CMD,
+       __BRIDGE_VLANDB_TINFO_MAX,
+};
+#define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
+
+/* [BRIDGE_VLANDB_ENTRY] = {
+ *     [BRIDGE_VLANDB_ENTRY_STATS] = {
+ *         [BRIDGE_VLANDB_STATS_RX_BYTES]
+ *         ...
+ *     }
+ *     ...
+ * }
+ */
+enum {
+       BRIDGE_VLANDB_STATS_UNSPEC,
+       BRIDGE_VLANDB_STATS_RX_BYTES,
+       BRIDGE_VLANDB_STATS_RX_PACKETS,
+       BRIDGE_VLANDB_STATS_TX_BYTES,
+       BRIDGE_VLANDB_STATS_TX_PACKETS,
+       BRIDGE_VLANDB_STATS_PAD,
+       __BRIDGE_VLANDB_STATS_MAX,
+};
+#define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
+
 /* Bridge multicast database attributes
  * [MDBA_MDB] = {
  *     [MDBA_MDB_ENTRY] = {
@@ -198,10 +585,33 @@ enum {
 enum {
        MDBA_MDB_EATTR_UNSPEC,
        MDBA_MDB_EATTR_TIMER,
+       MDBA_MDB_EATTR_SRC_LIST,
+       MDBA_MDB_EATTR_GROUP_MODE,
+       MDBA_MDB_EATTR_SOURCE,
+       MDBA_MDB_EATTR_RTPROT,
        __MDBA_MDB_EATTR_MAX
 };
 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
 
+/* per mdb entry source */
+enum {
+       MDBA_MDB_SRCLIST_UNSPEC,
+       MDBA_MDB_SRCLIST_ENTRY,
+       __MDBA_MDB_SRCLIST_MAX
+};
+#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
+
+/* per mdb entry per source attributes
+ * these are embedded in MDBA_MDB_SRCLIST_ENTRY
+ */
+enum {
+       MDBA_MDB_SRCATTR_UNSPEC,
+       MDBA_MDB_SRCATTR_ADDRESS,
+       MDBA_MDB_SRCATTR_TIMER,
+       __MDBA_MDB_SRCATTR_MAX
+};
+#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
+
 /* multicast router types */
 enum {
        MDB_RTR_TYPE_DISABLED,
@@ -238,12 +648,15 @@ struct br_mdb_entry {
        __u8 state;
 #define MDB_FLAGS_OFFLOAD      (1 << 0)
 #define MDB_FLAGS_FAST_LEAVE   (1 << 1)
+#define MDB_FLAGS_STAR_EXCL    (1 << 2)
+#define MDB_FLAGS_BLOCKED      (1 << 3)
        __u8 flags;
        __u16 vid;
        struct {
                union {
                        __be32  ip4;
                        struct in6_addr ip6;
+                       unsigned char mac_addr[ETH_ALEN];
                } u;
                __be16          proto;
        } addr;
@@ -252,16 +665,30 @@ struct br_mdb_entry {
 enum {
        MDBA_SET_ENTRY_UNSPEC,
        MDBA_SET_ENTRY,
+       MDBA_SET_ENTRY_ATTRS,
        __MDBA_SET_ENTRY_MAX,
 };
 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
 
+/* [MDBA_SET_ENTRY_ATTRS] = {
+ *    [MDBE_ATTR_xxx]
+ *    ...
+ * }
+ */
+enum {
+       MDBE_ATTR_UNSPEC,
+       MDBE_ATTR_SOURCE,
+       __MDBE_ATTR_MAX,
+};
+#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
+
 /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
 enum {
        BRIDGE_XSTATS_UNSPEC,
        BRIDGE_XSTATS_VLAN,
        BRIDGE_XSTATS_MCAST,
        BRIDGE_XSTATS_PAD,
+       BRIDGE_XSTATS_STP,
        __BRIDGE_XSTATS_MAX
 };
 #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
@@ -293,4 +720,25 @@ struct br_mcast_stats {
        __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
        __u64 mcast_packets[BR_MCAST_DIR_SIZE];
 };
+
+/* bridge boolean options
+ * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
+ *
+ * IMPORTANT: if adding a new option do not forget to handle
+ *            it in br_boolopt_toggle/get and bridge sysfs
+ */
+enum br_boolopt_id {
+       BR_BOOLOPT_NO_LL_LEARN,
+       BR_BOOLOPT_MAX
+};
+
+/* struct br_boolopt_multi - change multiple bridge boolean options
+ *
+ * @optval: new option values (bit per option)
+ * @optmask: options to change (bit per option)
+ */
+struct br_boolopt_multi {
+       __u32 optval;
+       __u32 optmask;
+};
 #endif /* _UAPI_LINUX_IF_BRIDGE_H */
index ab724498aa94f3d29b601ed0e2b7b4dad651cfee..6788b58799e30e5ff72bb145a9a623cd52c6592d 100644 (file)
@@ -1,14 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *  SR-IPv6 implementation
  *
  *  Author:
  *  David Lebrun <david.lebrun@uclouvain.be>
- *
- *
- *  This program is free software; you can redistribute it and/or
- *      modify it under the terms of the GNU General Public License
- *      as published by the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
  */
 
 #ifndef _LINUX_SEG6_LOCAL_H
index be035b623d6330702bba6bfc2bb3757230f32bd1..64734f8628efb5fb0f172b09e648dd8a29493168 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - OpenFabric extensions
  *
  * Copyright (C) 2018 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "isisd/fabricd.h"
index 9455cdb0f053f59049ee78431bd42969119a6ae9..c1df0ad28ef88d04973a9cd617cfa39132c646c4 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - OpenFabric extensions
  *
  * Copyright (C) 2018 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef FABRICD_H
 #define FABRICD_H
index 0957c897e6caa64b7a687010fe3a5fb66f6ebdfd..cb2cf8f61190344397d8f5c1ba6e4b0d0e05ff36 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_adjacency.c
  *                             handling of IS-IS adjacencies
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -484,9 +471,11 @@ const char *isis_adj_yang_state(enum isis_adj_state state)
                return "up";
        case ISIS_ADJ_INITIALIZING:
                return "init";
-       default:
+       case ISIS_ADJ_UNKNOWN:
                return "failed";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 void isis_adj_expire(struct thread *thread)
@@ -954,8 +943,9 @@ int isis_adj_usage2levels(enum isis_adj_usage usage)
                return IS_LEVEL_2;
        case ISIS_ADJ_LEVEL1AND2:
                return IS_LEVEL_1 | IS_LEVEL_2;
-       default:
-               break;
+       case ISIS_ADJ_NONE:
+               return 0;
        }
-       return 0;
+
+       assert(!"Reached end of function where we are not expecting to");
 }
index 49adc89ae599e6eaff06c6187c9b277799e8559d..c260ce78de0ff5871ab8e8e08cf9cb2114f2d57d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_adjacency.h
  *                             IS-IS adjacency handling
@@ -6,20 +7,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_ADJACENCY_H
index 1877c831fd1459f8e093c7d11577616a2d3589cc..b973dd493d1bb965170b0e5c4b09d026a5b17a96 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - BFD support
  * Copyright (C) 2018 Christian Franke
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 1dec7ae20fa0ce3c848f14089598fc55fc640bb4..30248ccececea11a746f46075f182d1b45269613 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - BFD support
  * Copyright (C) 2018 Christian Franke
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_BFD_H
 #define ISIS_BFD_H
index 11f43279ec2784f1df930eab4403afad3c884e92..96d629124de21256c0f897eaf62548946f9c9600 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_bpf.c
  *
  * Copyright (C) 2001,2002    Sampo Saaristo
  *                            Tampere University of Technology
  *                            Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fa0f2c998f2f63ecd62e9c6962044ebd9eea9d50..dd5f921bef38a40fe51a9ed1aeab410c8c1ac5f4 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_circuit.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #ifdef GNU_LINUX
index b3ad3f7ffe492229d2ec3e5c4bc25378c631fb25..494e96b6978cef90d8a0e320fadc877610f353ac 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_circuit.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISIS_CIRCUIT_H
index cb607deb23424162865cab9e11e8ab33c3d50638..26ae2024b9d205cf6d1d8ddbf5ad3d15e12f7270 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 809a3980df75f10f6d97710a1dfd7ff18b03061b..c908dc2e24632c3d0af7d05c48ed709c8115b966 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_common.h
  *                             some common data structures
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISIS_COMMON_H
index 3d6a20ee6614cdf62085e66cd12262518d2157e7..b2be28229f8b8e8ea0dcf538a1a35d73a8cf7a53 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_constants.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISIS_CONSTANTS_H
index 0a29dcd09a97f5f294de21436ca275c68002099f..95bbc077a32c8170b53d2a5c8ff144c6931ff6f5 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_csm.c
  *                             IS-IS circuit state machine
  * Copyright (C) 2001,2002    Sampo Saaristo
  *                            Tampere University of Technology
  *                            Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ad72ff5113fe04d4e74811b9f328f3a7151cb1a4..80e02b82e271b64b2af71ccb6a9b5ecd348fa251 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_csm.h
  *                             IS-IS circuit state machine
@@ -6,20 +7,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISIS_CSM_H
 #define _ZEBRA_ISIS_CSM_H
index f6ea0aea60d2a82cd1683b5156fa7ff384757615..1f091524b6611a4bec274e4c292282f6f37dfcc4 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_dlpi.c
  *
  * Copyright (C) 2001,2002    Sampo Saaristo
  *                            Tampere University of Technology
  *                            Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 400982f2fc16025f2e1a75389bd8184fe918426f..b1a42158130b350581389d927b73bed7ab56a594 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_dr.c
  *                             IS-IS designated router related routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index f01a03f37487446d7805348ddf7a3f5fb44353b4..2b9bf60ffa797d10fc8e979b090f97dda953475b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_dr.h
  *                             IS-IS designated router related routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_DR_H
index 5d6b7bc60a27676a26f61434ea23938dbcaed8a7..ef21de327eb6aaed359c822e4097cf581206132e 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_dynhn.c
  *                             Dynamic hostname cache
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index afb8b51b1fbf66a4b825a1fd47e59323f6a19891..d4deb5572aa0f821c5245217432daa146a56f014 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_dynhn.h
  *                             Dynamic hostname cache
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISIS_DYNHN_H
 #define _ZEBRA_ISIS_DYNHN_H
index 1d277ac5f1c429628097ff0ddec3efe72926ce9f..0bdff19817c7669bbe582ccd007b269addf565c2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ISIS-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6f3e5f85cfa1c55d9272d08765c1f47d8c8c3b7b..9a21c79f46b8f1b2f77a6ae365bd6987cac609e6 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ISIS-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __ISIS_ERRORS_H__
index 42823cf2b3d8e4cc5f79a9fbcd907cc20b5e7deb..d7b3969114084e1999a204d863e5aa6260e71c5b 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_events.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index e6d9af58be1e01ecb1e4ce40b08793f6cd6ca7cb..e827f75a832f065d535c7230ce624b9c5bce94ae 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_events.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISIS_EVENTS_H
 #define _ZEBRA_ISIS_EVENTS_H
index b1ece94e8ebc3051a0ed851152e1773f4231d436..a621b4b5ed28aa860e9012b5f8d8059f792c9f7c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_flags.c
  *                             Routines for manipulation of SSN and SRM flags
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b3449e1e5961d19a2354500a7a20f1511aa93ab7..47a135659a3acc1efeab28ec1a00a901a32d3c53 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_flags.h
  *                             Routines for manipulation of SSN and SRM flags
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_FLAGS_H
index 3568543b4a5b5524fa2e2d727e5978db151aeb3f..817e2a2015213e9893463a2229f2d7d2f6a99a75 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * isis_ldp_sync.c: ISIS LDP-IGP Sync  handling routines
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 69a180000775e99bd5b447a79daf27e7bc2c33c0..d593ed355b1cb67e1ad8c0e0c9f092b532f95f99 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * isis_ldp_sync.h: ISIS LDP-IGP Sync  handling routines
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_LDP_SYNC_H
index 2ec6dafd3f0af86d2ccd1b7eb56011f32c873f55..599dca12987ec2de8c25e5e4df3e00c747501b9c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9db03a3a19c4a140c5003afc60b45518cc5a1e10..0ba1c1cef5d5efdee86fc1ee8a4ec169be31eac1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_ISIS_LFA_H
index 63b4edb1e191a167139e4232280bf327d1f469a5..8c347ef813343befc4148d2bfe920af8d7a94f7c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_lsp.c
  *                             LSP processing
@@ -6,20 +7,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2013-2015   Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d7762324d982e5fd740b271c7b5fdbfbb9c0d7d2..5bb2b949c7a9a7c98278d01525fe4129c8015969 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_lsp.h
  *                             LSP processing
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_LSP_H
index fb4237f00253e9cefafa1c5c74906e5a96188ae8..9b2bebb420ef97dc8dbf964a6896e4860f088bf1 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_main.c
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -40,6 +27,7 @@
 #include "qobj.h"
 #include "libfrr.h"
 #include "routemap.h"
+#include "affinitymap.h"
 
 #include "isisd/isis_constants.h"
 #include "isisd/isis_common.h"
@@ -167,6 +155,7 @@ struct frr_signal_t isisd_signals[] = {
 };
 
 
+/* clang-format off */
 static const struct frr_yang_module_info *const isisd_yang_modules[] = {
        &frr_filter_info,
        &frr_interface_info,
@@ -174,8 +163,10 @@ static const struct frr_yang_module_info *const isisd_yang_modules[] = {
        &frr_isisd_info,
 #endif /* ifndef FABRICD */
        &frr_route_map_info,
+       &frr_affinity_map_info,
        &frr_vrf_info,
 };
+/* clang-format on */
 
 #ifdef FABRICD
 FRR_DAEMON_INFO(fabricd, OPEN_FABRIC, .vty_port = FABRICD_VTY_PORT,
@@ -264,6 +255,8 @@ int main(int argc, char **argv, char **envp)
        lsp_init();
        mt_init();
 
+       affinity_map_init();
+
        isis_zebra_init(master, instance);
        isis_bfd_init(master);
        isis_ldp_sync_init();
index d49ad8485ec7bb2bc80ad3ebd1c4e1577bc2447d..4a490ab5ac21974fa359740c89ba60ef978c8d50 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_misc.h
  *                             Miscellanous routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5cdbbfb0581513af01c1d340526440cd56f3ee4e..b8b4ebd280971cde8d9d1339bdabe37d74061590 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_misc.h
  *                             Miscellanous routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_MISC_H
index 6bbb01c30764ee72feff1aaf4cf015666f09b58c..fcc0f53815edd8d07a80ac708ac060c7e1d6875d 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - Multi Topology Support
  *
  * Copyright (C) 2017 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "isisd/isisd.h"
index 13e508451b65e830772c136ee71e40163e48a694..9b0df9bb7843ead0405265c9e6bd46ddb6068543 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - Multi Topology Support
  *
  * Copyright (C) 2017 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_MT_H
 #define ISIS_MT_H
index c5653d034806f5971b510a3eedd87fd746ea39a9..bcda5bd6aa8d0acfe8acb45bfff1ae8c0d4a5a8b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 380ce4f2519cd5345714a342a736003a38fa59f5..1a2bd2deb8cb6747dbb1fbe1939f9bf76f811b5d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISISD_ISIS_NB_H_
index 1b7663fcfd8857afebbd2bd9b0fc18b16ea6aca5..a7c4e4f369b50dc7d45ab67e791c8147a9a20c74 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fd7b1b3159ac9fea620411b5d665dc6f4f34105a..94b1c47d3efe15dce277d6f184c3d25e4300ee43 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5b1fc6e1d2ebe18345b2bbc93503157928a03980..13fdddf555c92f1f9dff2439a51b8f8da739057f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Volta Networks
  *                           Emanuele Di Pascale
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cc8605d2e93e13dbfb5cca4cd11a9aa23e9fb27c..31cad32a5658ad32bd838f3d0a70c5a4a1465033 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_network.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 47093fdd6bffd32fd5b9028810d310ef768ed29a..70ec2426d3aee2214752bd77858c43631f566574 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_pdu.c
  *                             PDU processing
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b4018995d5a82806e714ec89b3797e2f6565a38b..512439400069ae6fadd5595c13e64e6cf6a3cb44 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_pdu.h
  *                             PDU processing
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_PDU_H
index ec2a0c207613bc70879a512cdf19b167b96f39c8..9d07b5e5989d3017296a93b38a59ae357f6683b0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Routing protocol - isis_pdu_counter.c
  * Copyright (C) 2018 Christian Franke, for NetDEF Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -77,9 +64,11 @@ static const char *pdu_counter_index_to_name(enum pdu_counter_index index)
                return "L1 PSNP";
        case L2_PARTIAL_SEQ_NUM_INDEX:
                return "L2 PSNP";
-       default:
+       case PDU_COUNTER_SIZE:
                return "???????";
        }
+
+       assert(!"Reached end of function where we were not expecting to");
 }
 
 void pdu_counter_count(pdu_counter_t counter, uint8_t pdu_type)
index 7f07adf5cd9260ee0106ea2d4d0701dc7fbd1367..c53c47368f46af0224ec346df9331e7e40474612 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Routing protocol - isis_pdu_counter.c
  * Copyright (C) 2018 Christian Franke, for NetDEF Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_PDU_COUNTER_H
 #define ISIS_PDU_COUNTER_H
index 84278f3f71e3c541acf440ea3d56ca5fae2853f0..4f8ea4a5e70bff1a8fa923b269064562303c343f 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_pfpacket.c
  *
  * Copyright (C) 2001,2002    Sampo Saaristo
  *                            Tampere University of Technology
  *                            Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dd82c5057bbf266f7be9ed2e3d98d595c9388e37..6a822f02fea0de9ed4fb16be3b44a4a7ca314c1c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_redist.c
  *
  * Copyright (C) 2013-2015 Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 10dccbc5187735547615fdd706815705e2a7d317..ae5ec2b3b3fe2f12948bee5ececa94e5e7663293 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_redist.h
  *
  * Copyright (C) 2013-2015 Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISIS_REDIST_H
index c7dc9b7c440111183a111bf0add0e6fe00805adc..711d5cbed9f481e03149579aaf7077e30ac2c84a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol               - isis_route.c
  * Copyright (C) 2001,2002   Sampo Saaristo
@@ -6,20 +7,6 @@
  *
  *                                         based on ../ospf6d/ospf6_route.[ch]
  *                                         by Yasuhiro Ohara
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a0e0500aecbb9bc30c75869e1b6ee8cdff426492..40e7462898d4da027b98ac1d1dd10cbc6aecec63 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol               - isis_route.h
  *
@@ -7,20 +8,6 @@
  *
  *                                         based on ../ospf6d/ospf6_route.[ch]
  *                                         by Yasuhiro Ohara
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISIS_ROUTE_H
 #define _ZEBRA_ISIS_ROUTE_H
index 626e399e1591f5d6ed931b7a24a9d06b2cb5881b..632b4ff95ec7835705c68145d9e0d0b65c409d65 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_routemap.c
  *
  * Copyright (C) 2013-2015 Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f1577666b02ebd332eeb9199ee2d049f1ad4c326..758043f81dcb53fd725f39ef9f27f089d7b4283c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_routemap.h
  *
  * Copyright (C) 2013-2015 Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_ROUTEMAP_H
 #define ISIS_ROUTEMAP_H
index a184b5b30a9490ab6a8e76ad7e59bfadabe00436..ae570a0864d1b058aa112fe9fa9e7a1493dc9c99 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ISIS SNMP support
  * Copyright (C) 2020 Volta Networks, Inc.
  *                    Aleksey Romanov
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index a6eef75e7e50c1c2c380e2cadf66fe83630b06c5..e1aec683d83c44ef6c31e78eec83efc0be75c9a0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol                  - isis_spf.c
  *                                              The SPT algorithm
@@ -6,20 +7,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2017        Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1587,8 +1574,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                vertex->N.ip.priority = priority;
                if (vertex->depth == 1 || listcount(vertex->Adj_N) > 0) {
                        struct isis_spftree *pre_spftree;
-                       struct route_table *route_table;
-                       bool allow_ecmp;
+                       struct route_table *route_table = NULL;
+                       bool allow_ecmp = false;
 
                        switch (spftree->type) {
                        case SPF_TYPE_RLFA:
@@ -1606,7 +1593,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                                        return;
                                }
                                break;
-                       default:
+                       case SPF_TYPE_FORWARD:
+                       case SPF_TYPE_REVERSE:
                                break;
                        }
 
@@ -1624,7 +1612,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                                pre_spftree->lfa.protection_counters
                                        .tilfa[vertex->N.ip.priority] += 1;
                                break;
-                       default:
+                       case SPF_TYPE_FORWARD:
+                       case SPF_TYPE_REVERSE:
                                route_table = spftree->route_table;
                                allow_ecmp = true;
 
@@ -1699,7 +1688,14 @@ static void isis_spf_loop(struct isis_spftree *spftree,
                                             VTYPE_IPREACH_TE))
                                continue;
                        break;
-               default:
+               case VTYPE_PSEUDO_IS:
+               case VTYPE_PSEUDO_TE_IS:
+               case VTYPE_NONPSEUDO_IS:
+               case VTYPE_NONPSEUDO_TE_IS:
+               case VTYPE_ES:
+               case VTYPE_IPREACH_TE:
+               case VTYPE_IP6REACH_INTERNAL:
+               case VTYPE_IP6REACH_EXTERNAL:
                        break;
                }
 
@@ -2276,7 +2272,8 @@ static void isis_print_route(struct ttable *tt, const struct prefix *prefix,
 
                                        label2str(
                                                nexthop->label_stack->label[i],
-                                               buf_label, sizeof(buf_label));
+                                               0, buf_label,
+                                               sizeof(buf_label));
                                        if (i != 0)
                                                strlcat(buf_labels, "/",
                                                        sizeof(buf_labels));
@@ -2284,7 +2281,7 @@ static void isis_print_route(struct ttable *tt, const struct prefix *prefix,
                                                sizeof(buf_labels));
                                }
                        } else if (nexthop->sr.present)
-                               label2str(nexthop->sr.label, buf_labels,
+                               label2str(nexthop->sr.label, 0, buf_labels,
                                          sizeof(buf_labels));
                        else
                                strlcpy(buf_labels, "-", sizeof(buf_labels));
index 3fa5182bafdd0dddb74489ac9ae9ec6d3fc9cc50..7f4ab707e7672b7cd2bb322ad95fe5bd6c20becd 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_spf.h
  *                             IS-IS Shortest Path First algorithm
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_SPF_H
index 07d4ff5a0ec3fa50833e13d8c958753f59e956f6..d8293727020908ed3c1fa5b304da4f1dfa98e4ce 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol                  - isis_spf_private.h
  *
@@ -5,20 +6,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2017        Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_SPF_PRIVATE_H
 #define ISIS_SPF_PRIVATE_H
index 707bd162f5ec18f48018f304d3b8c733971a0e41..429399165487213acdf1bdb7cd33a71a61acee3a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of Segment Routing for IS-IS as per RFC 8667
  *
@@ -5,20 +6,6 @@
  *
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  * Contributor: Renato Westphal <renato@opensourcerouting.org> for NetDEF
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a933f366eb729053f42270ba7f237092f31ed5a2..627f1fb748845d1ba899981393f9a6e6eb0ed247 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of Segment Routing for IS-IS as per RFC 8667
  *
@@ -5,20 +6,6 @@
  *
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  * Contributor: Renato Westphal <renato@opensourcerouting.org> for NetDEF
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_ISIS_SR_H
index 155d1e6fed5a1d60923b369211dc5a1d68215b6e..3659f4e07c676f77a0b80761a3f123d3c31fce05 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_te.c
  *
@@ -6,22 +7,6 @@
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  *
  * Copyright (C) 2014 - 2019 Orange Labs http://www.orange.com
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -218,6 +203,13 @@ void isis_link_params_update(struct isis_circuit *circuit,
                } else
                        UNSET_SUBTLV(ext, EXT_ADM_GRP);
 
+               if (IS_PARAM_SET(ifp->link_params, LP_EXTEND_ADM_GRP)) {
+                       admin_group_copy(&ext->ext_admin_group,
+                                        &ifp->link_params->ext_admin_grp);
+                       SET_SUBTLV(ext, EXT_EXTEND_ADM_GRP);
+               } else
+                       UNSET_SUBTLV(ext, EXT_EXTEND_ADM_GRP);
+
                /* If known, register local IPv4 addr from ip_addr list */
                if (listcount(circuit->ip_addrs) != 0) {
                        addr = (struct prefix_ipv4 *)listgetdata(
@@ -758,6 +750,11 @@ static struct ls_attributes *get_attributes(struct ls_node_id adv,
                attr->standard.admin_group = tlvs->adm_group;
                SET_FLAG(attr->flags, LS_ATTR_ADM_GRP);
        }
+       if (CHECK_FLAG(tlvs->status, EXT_EXTEND_ADM_GRP)) {
+               admin_group_copy(&attr->ext_admin_group,
+                                &tlvs->ext_admin_group);
+               SET_FLAG(attr->flags, LS_ATTR_EXT_ADM_GRP);
+       }
        if (CHECK_FLAG(tlvs->status, EXT_LLRI)) {
                attr->standard.local_id = tlvs->local_llri;
                attr->standard.remote_id = tlvs->remote_llri;
@@ -1344,7 +1341,8 @@ void isis_te_lsp_event(struct isis_lsp *lsp, enum lsp_event event)
        case LSP_DEL:
                isis_te_delete_lsp(area->mta, lsp0);
                break;
-       default:
+       case LSP_UNKNOWN:
+       case LSP_TICK:
                break;
        }
 }
@@ -1540,7 +1538,7 @@ static void show_ext_sub(struct vty *vty, char *name,
                sbuf_push(&buf, 4,
                          "%s Average Link Delay: %u (micro-sec)\n",
                          IS_ANORMAL(ext->delay) ? "Anomalous" : "Normal",
-                         ext->delay);
+                         ext->delay & TE_EXT_MASK);
        if (IS_SUBTLV(ext, EXT_MM_DELAY)) {
                sbuf_push(&buf, 4, "%s Min/Max Link Delay: %u / %u (micro-sec)\n",
                          IS_ANORMAL(ext->min_delay) ? "Anomalous" : "Normal",
index 03525962f52a7a56f6d5c1dac2c297cfd56c768f..5087cdac43cf06482c5540152f5aee2d699c8481 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_te.c
  *
@@ -6,22 +7,6 @@
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  *
  * Copyright (C) 2014 - 2019 Orange Labs http://www.orange.com
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ISIS_MPLS_TE_H
index 8907fa256b288b7a3686e64a9090913dede978ce..b52a38be7f878398158d446fdf10ea003cbfb829 100644 (file)
@@ -1,26 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS TLV Serializer/Deserializer
  *
  * Copyright (C) 2015,2017 Christian Franke
  *
  * Copyright (C) 2019 Olivier Dugeon - Orange Labs (for TE and SR)
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -136,6 +120,8 @@ struct isis_ext_subtlvs *isis_alloc_ext_subtlvs(void)
        init_item_list(&ext->adj_sid);
        init_item_list(&ext->lan_sid);
 
+       admin_group_init(&ext->ext_admin_group);
+
        return ext;
 }
 
@@ -155,6 +141,9 @@ void isis_del_ext_subtlvs(struct isis_ext_subtlvs *ext)
                next_item = item->next;
                XFREE(MTYPE_ISIS_SUBTLV, item);
        }
+
+       admin_group_term(&ext->ext_admin_group);
+
        XFREE(MTYPE_ISIS_SUBTLV, ext);
 }
 
@@ -233,6 +222,9 @@ copy_item_ext_subtlvs(struct isis_ext_subtlvs *exts, uint16_t mtid)
                SET_SUBTLV(rv, EXT_LAN_ADJ_SID);
        }
 
+       rv->ext_admin_group.bitmap.data = NULL;
+       admin_group_copy(&rv->ext_admin_group, &exts->ext_admin_group);
+
        return rv;
 }
 
@@ -241,6 +233,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
                                    struct sbuf *buf, struct json_object *json,
                                    int indent, uint16_t mtid)
 {
+       char admin_group_buf[ADMIN_GROUP_PRINT_MAX_SIZE];
        char aux_buf[255];
        char cnt_buf[255];
 
@@ -250,9 +243,37 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
                        snprintfrr(aux_buf, sizeof(aux_buf), "0x%x",
                                   exts->adm_group);
                        json_object_string_add(json, "adm-group", aux_buf);
-               } else
+               } else {
                        sbuf_push(buf, indent, "Administrative Group: 0x%x\n",
                                  exts->adm_group);
+                       sbuf_push(buf, indent + 2, "Bit positions: %s\n",
+                                 admin_group_standard_print(
+                                         admin_group_buf,
+                                         indent + strlen("Admin Group: "),
+                                         exts->adm_group));
+               }
+       }
+
+       if (IS_SUBTLV(exts, EXT_EXTEND_ADM_GRP) &&
+           admin_group_nb_words(&exts->ext_admin_group) != 0) {
+               if (!json) {
+                       /* TODO json after fix show database detail json */
+                       sbuf_push(buf, indent, "Ext Admin Group: %s\n",
+                                 admin_group_string(
+                                         admin_group_buf,
+                                         ADMIN_GROUP_PRINT_MAX_SIZE,
+                                         indent + strlen("Ext Admin Group: "),
+                                         &exts->ext_admin_group));
+                       admin_group_print(admin_group_buf,
+                                         indent + strlen("Ext Admin Group: "),
+                                         &exts->ext_admin_group);
+                       if (admin_group_buf[0] != '\0' &&
+                           (buf->pos + strlen(admin_group_buf) +
+                            SBUF_DEFAULT_SIZE / 2) < buf->size)
+                               sbuf_push(buf, indent + 2,
+                                         "Bit positions: %s\n",
+                                         admin_group_buf);
+               }
        }
        if (IS_SUBTLV(exts, EXT_LLRI)) {
                if (json) {
@@ -401,7 +422,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
                                  "%s Average Link Delay: %u (micro-sec)\n",
                                  IS_ANORMAL(exts->delay) ? "Anomalous"
                                                          : "Normal",
-                                 exts->delay);
+                                 exts->delay & TE_EXT_MASK);
        }
        if (IS_SUBTLV(exts, EXT_MM_DELAY)) {
                if (json) {
@@ -685,6 +706,24 @@ static int pack_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
                stream_putc(s, ISIS_SUBTLV_DEF_SIZE);
                stream_putl(s, exts->adm_group);
        }
+       if (IS_SUBTLV(exts, EXT_EXTEND_ADM_GRP) &&
+           admin_group_nb_words(&exts->ext_admin_group) != 0) {
+               /* Extended Administrative Group */
+               size_t ag_length;
+               size_t ag_length_pos;
+               struct admin_group *ag;
+
+               stream_putc(s, ISIS_SUBTLV_EXT_ADMIN_GRP);
+               ag_length_pos = stream_get_endp(s);
+               stream_putc(s, 0); /* length will be filled later*/
+
+               ag = &exts->ext_admin_group;
+               for (size_t i = 0; i < admin_group_nb_words(ag); i++)
+                       stream_putl(s, ag->bitmap.data[i]);
+
+               ag_length = stream_get_endp(s) - ag_length_pos - 1;
+               stream_putc_at(s, ag_length_pos, ag_length);
+       }
        if (IS_SUBTLV(exts, EXT_LLRI)) {
                stream_putc(s, ISIS_SUBTLV_LLRI);
                stream_putc(s, ISIS_SUBTLV_LLRI_SIZE);
@@ -828,6 +867,8 @@ static int unpack_item_ext_subtlvs(uint16_t mtid, uint8_t len, struct stream *s,
        uint8_t sum = 0;
        uint8_t subtlv_type;
        uint8_t subtlv_len;
+       size_t nb_groups;
+       uint32_t val;
 
        struct isis_extended_reach *rv = dest;
        struct isis_ext_subtlvs *exts = isis_alloc_ext_subtlvs();
@@ -863,6 +904,15 @@ static int unpack_item_ext_subtlvs(uint16_t mtid, uint8_t len, struct stream *s,
                                SET_SUBTLV(exts, EXT_ADM_GRP);
                        }
                        break;
+               case ISIS_SUBTLV_EXT_ADMIN_GRP:
+                       nb_groups = subtlv_len / sizeof(uint32_t);
+                       for (size_t i = 0; i < nb_groups; i++) {
+                               val = stream_getl(s);
+                               admin_group_bulk_set(&exts->ext_admin_group,
+                                                    val, i);
+                       }
+                       SET_SUBTLV(exts, EXT_EXTEND_ADM_GRP);
+                       break;
                case ISIS_SUBTLV_LLRI:
                        if (subtlv_len != ISIS_SUBTLV_LLRI_SIZE) {
                                sbuf_push(log, indent,
index 905032bda1aff3912d97b66067df0b69973231de..51058f1af1f40554e3972c11f16ca85d653bcfd8 100644 (file)
@@ -1,26 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS TLV Serializer/Deserializer
  *
  * Copyright (C) 2015,2017 Christian Franke
 
  * Copyright (C) 2019 Olivier Dugeon - Orange Labs (for TE and SR)
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef ISIS_TLVS_H
 #define ISIS_TLVS_H
@@ -441,6 +425,9 @@ enum ext_subtlv_size {
        ISIS_SUBTLV_HDR_SIZE = 2,
        ISIS_SUBTLV_DEF_SIZE = 4,
 
+       /* RFC 7308 */
+       ISIS_SUBTLV_EXT_ADMIN_GRP = 14,
+
        ISIS_SUBTLV_MAX_SIZE = 180
 };
 
@@ -471,6 +458,7 @@ enum ext_subtlv_size {
 #define EXT_RES_BW             0x040000
 #define EXT_AVA_BW             0x080000
 #define EXT_USE_BW             0x100000
+#define EXT_EXTEND_ADM_GRP 0x200000
 
 /*
  * This structure groups all Extended IS Reachability subTLVs.
@@ -484,13 +472,14 @@ enum ext_subtlv_size {
  * For Delay and packet Loss, upper bit (A) indicates if the value is
  * normal (0) or anomalous (1).
  */
-#define IS_ANORMAL(v) (v & 0x80000000)
+#define IS_ANORMAL(v) (v & TE_EXT_ANORMAL)
 
 struct isis_ext_subtlvs {
 
        uint32_t status;
 
        uint32_t adm_group; /* Resource Class/Color - RFC 5305 */
+       struct admin_group ext_admin_group; /* Res. Class/Color - RFC 7308 */
        /* Link Local/Remote Identifiers - RFC 5307 */
        uint32_t local_llri;
        uint32_t remote_llri;
index 06369c6d70758db519a30b0630b3e4c2235ac7fb..ad91059766df0479ec1c1ac9b9b4cddf54871fef 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - LSP TX Queuing logic
  *
  * Copyright (C) 2018 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index f0f1184d588c22156dcca35be70c72c5de4f6c65..c3e36d04adc9ff24e97144a7e70cf50498373f31 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - LSP TX Queuing logic
  *
  * Copyright (C) 2018 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef ISIS_TX_QUEUE_H
 #define ISIS_TX_QUEUE_H
index 2c1b6e932fed8feebf70cd42b2cd8a773afc6a5c..0d25f661093457bba582b19180b2fcf1c3f5cfc1 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_vty_fabricd.c
  *
  * This file contains the CLI that is specific to OpenFabric
  *
  * Copyright (C) 2018        Christian Franke, for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 52a5cdd64f17b78a48cd5802be235012132a08bc..7e85576c7a3d658da5c7311bc0775a12d5db5421 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_zebra.c
  *
@@ -5,20 +6,6 @@
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
  * Copyright (C) 2013-2015   Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 84dc58ec6c017ff227856b9d9e7f0a4304be65cd..f34088f98ece1bfff4d75b2968330ab0fec853ef 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isis_zebra.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISIS_ZEBRA_H
 #define _ZEBRA_ISIS_ZEBRA_H
index cd085254716efcf3c46d68d6604fe9ac816169d5..d9f8a262cb0a8e77d0fb8ee9a5078063678324e1 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isisd.c
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -2340,9 +2327,11 @@ static const char *pdu_counter_index_to_name_json(enum pdu_counter_index index)
                return "l1-psnp";
        case L2_PARTIAL_SEQ_NUM_INDEX:
                return "l2-psnp";
-       default:
+       case PDU_COUNTER_SIZE:
                return "???????";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 static void common_isis_summary_json(struct json_object *json,
index 38f20b21135bfda3cc4ab1169b1330ef9ec20735..2052e8e3d967c961baa343c1a839b0d65c1b9c9e 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - isisd.h
  *
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ISISD_H
index 0da6d5fc8c67755c11cef20256a724d4cd7cc0e4..f12c19577bd72f8e3e0190a2e87df90a0319b935 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - iso_checksum.c
  *                             ISO checksum related routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 357c75fa556391bb8dc85971a2820ba79775e763..9dcb039bf11afd47901f5c639e3c804777fd4e03 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - iso_checksum.c
  *                             ISO checksum related routines
@@ -5,20 +6,6 @@
  * Copyright (C) 2001,2002   Sampo Saaristo
  *                           Tampere University of Technology
  *                           Institute of Communications Engineering
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_ISO_CSUM_H
 #define _ZEBRA_ISO_CSUM_H
index 1a04c563c1922761bafec405255c17cc84a6b462..170c079b52cc758889ee4391722c8fbddb1c5843 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2012 Claudio Jeker <claudio@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 8047d531bc98a0a42106397a262115cd1e7a431d..107eb5d78096c28ac93fdbed3e93388cfd44ef27 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 8caa3c4e2414306b0cbf23e71f76d8098d858b4c..97e4c2ef019d0930f929431c0973dc88ddec6cdb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 09e91217ae3cae18057de16d1d2cd8de6f456021..b1260feb68a47906cbd89944825911fb20296bcb 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 23edb5f24d9360772166ff9e92365fa592e69d06..f45c97e8bbd1eec8fb80f1639f44a5a268ff6248 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _CONTROL_H_
index 629fe46e70731b5480004995fbe52096d399a780..83c0b2f8ca00c981a571a090bf5f45df18d617ee 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 0ee64c16fa745958cfab9a6a1686e4d818de76ae..15d653b747c0dc336f94f48f1b27b8ce0c0c1752 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 392e25470fbd4fb7c8fe18b9f51a12cd1c2b56ac..5d1859298ea91202d4f20fc69f0c53ad03b62faa 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index b03127109f4867aa1ebd35a421f02708856b9cef..7a71989d069f97a5c10b950c26cc528584fcc10b 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 2c68f3edbd1c2b0bef43864a4443fef4ae555d76..4664b1f894a81a7d0dc4c7443930b6a299ea573d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 13d3243124cfeaf0613a48275f14fc15d5a97273..dcaf1cc10b3709bcde7b5a056af67821ae01366a 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2014, 2015 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 4ab3b5aa2fd28c34dc2415bb437b2cfaf9083eb8..325b33d057c5055e636ad6ab85cd6fb0d3330985 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
@@ -744,7 +733,7 @@ lde_update_label(struct fec_node *fn)
                    fn->fec.u.ipv6.prefixlen) != FILTER_PERMIT)
                        return (NO_LABEL);
                break;
-       default:
+       case FEC_TYPE_PWID:
                break;
        }
 
@@ -776,7 +765,7 @@ lde_update_label(struct fec_node *fn)
                            fn->fec.u.ipv6.prefixlen) != FILTER_PERMIT)
                                return (MPLS_LABEL_IMPLICIT_NULL);
                        return MPLS_LABEL_IPV6_EXPLICIT_NULL;
-               default:
+               case FEC_TYPE_PWID:
                        break;
                }
        }
@@ -911,7 +900,7 @@ lde_fec2prefix(const struct fec *fec, struct prefix *prefix)
                prefix->u.prefix6 = fec->u.ipv6.prefix;
                prefix->prefixlen = fec->u.ipv6.prefixlen;
                break;
-       default:
+       case FEC_TYPE_PWID:
                prefix->family = AF_UNSPEC;
                break;
        }
@@ -1302,7 +1291,7 @@ lde_send_labelrequest(struct lde_nbr *ln, struct fec_node *fn,
                        if (!ln->v6_enabled)
                                return;
                        break;
-               default:
+               case FEC_TYPE_PWID:
                        fatalx("lde_send_labelrequest: unknown af");
                }
        } else
@@ -1581,7 +1570,7 @@ lde_nbr_addr_update(struct lde_nbr *ln, struct lde_addr *lde_addr, int removed)
                        if (lde_addr->af != AF_INET6)
                                continue;
                        break;
-               default:
+               case FEC_TYPE_PWID:
                        continue;
                }
 
index bcb1e1ccaa797beb6ed50554da764d676b718406..3a64f0d3b9dced63e1d5b58541b0e0f0857e69e3 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _LDE_H_
index 43665605469c2b095856c5dfcc6020bae85ae379..d737e9f4166a2fd1aa9f2b4fcd90763b75b90a60 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
@@ -178,7 +167,7 @@ rt_dump(pid_t pid)
                        rtctl.prefix.v6 = fn->fec.u.ipv6.prefix;
                        rtctl.prefixlen = fn->fec.u.ipv6.prefixlen;
                        break;
-               default:
+               case FEC_TYPE_PWID:
                        continue;
                }
 
@@ -505,7 +494,7 @@ lde_check_mapping(struct map *map, struct lde_nbr *ln, int rcvd_label_mapping)
                    fec.u.ipv6.prefixlen) != FILTER_PERMIT)
                        return;
                break;
-       default:
+       case FEC_TYPE_PWID:
                break;
        }
 
@@ -665,7 +654,7 @@ lde_check_request(struct map *map, struct lde_nbr *ln)
                        lde_send_notification(ln, S_LOOP_DETECTED, map->msg_id,
                            htons(MSG_TYPE_LABELREQUEST));
                        return;
-               default:
+               case FEC_TYPE_PWID:
                        break;
                }
        }
index 4bad3afc3c87c12db767450f32b8d15e81bbc556..33cf93cb266f8ceca7be0b41a6ae5a5df580c059 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* LDP protocol definitions */
index a8d9833ddea40c2d013a8bc48f9256f432060925..d2aeaba8b314f5affca95e0a32f6cf540acf7e84 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 977734bddfdff3bcdd5feeadc069d4370e4fd23f..09fa711699f28f3cf494bd30d81940279f0ceaf4 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef _LDP_DEBUG_H_
index dfc7d145fedffe391de2fa24344d2cc983447ef9..9a26a8d17be6d9ff9524a48bbd81fbd380043eee 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * LDP SNMP support
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index d788fa0687a28ee1c88951469d2ff78555503b31..5c83d1c56cf1bc7aa0c02047a2cfacdcecee0683 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef _LDP_VTY_H_
index 33e6b297cbfab48cf38f65d4c4d86d3f37faf17a..e046ae996b467a659b143483030a1a6bd0b8c2dc 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fbd718bb099d86eed46e9f5fc4d4b9ffdda0e3e9..ffff67683d082779a6551fdafdd5a65e2adce909 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a8cffd6d91fe5b4fc852d000385e9027e8988fd4..b181e33a5bbb07268cd6fc323999f99906cf778e 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 059115915aa689a98b58c16f6c3029841c18dd80..6f0f990e491941625628de967d12f2e84ac8ad93 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -597,7 +583,7 @@ ldp_zebra_read_route(ZAPI_CALLBACK_ARGS)
                        if (!(kr.flags & F_CONNECTED))
                                continue;
                        break;
-               default:
+               case NEXTHOP_TYPE_BLACKHOLE:
                        continue;
                }
 
index 20819765472cf257b2029426d6f757ce2eaf19f7..2026a7857c6c165ce83fbe3bb515d303c789a40b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2008 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 02eaf10eb7739a9d3dd47d742bea26035923c228..dc993e3d7cc645571873c9e3c1b9f143adbc791f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _LDPD_H_
index 35d2bf21c97de6295a589bbf9bf246549598a5b8..f53dc72540651cadcb213b0778d396f295540164 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2008 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index ddb0e0d97072e8faece37fec94da2c6a71b781ed..e799538b628290bcb464da49c83257ef43de4089 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _LDPE_H_
index 88ce03095ac0f6170d6afaaa8c499aaa85e08319..a9898a64f09f9bfe17aaecfece2edf6efb72f1ab 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 8c236ff5fe3f3bd3b0e95626fdeb89fac29d1b11..641ad8ac5edb6aca28e362e593bcaca2ce6bd623 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef LOG_H
index e16006b8922bb2777ca8ebd787abad1a2b36e489..4f1d950bb3da07190414dd7fe250043dedae8eff 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 6d6c7d00cdb1f3311eae876732eb9b098cfe94a5..831f2a6aba89b087fda97cb1bb4fb4e9882bedf4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 3ecf5d4ba5919af7fc7dc80292d0bb504950f332..af5bb267d7a8e30fbc2e246b7f974ed827a8cf95 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 2cca52461f46a8f2c58297dfc70811a5838ce5c8..a253ef4660873f4f9ef9e26caf1f4ba3a091f99b 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index a719d0cbb7067e5b5af614655b24bc6e21288be0..4bea2e1904376104786b485902673587948ae0d5 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
  * Copyright (c) 2003, 2004 Markus Friedl <markus@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -421,35 +410,33 @@ pfkey_md5sig_remove(struct nbr *nbr)
 int
 pfkey_establish(struct nbr *nbr, struct nbr_params *nbrp)
 {
-       if (nbrp->auth.method == AUTH_NONE)
-               return (0);
-
        switch (nbr->auth.method) {
        case AUTH_MD5SIG:
                strlcpy(nbr->auth.md5key, nbrp->auth.md5key,
                    sizeof(nbr->auth.md5key));
-               return (pfkey_md5sig_establish(nbr, nbrp));
-       default:
-               break;
+               return pfkey_md5sig_establish(nbr, nbrp);
+       case AUTH_NONE:
+               return 0;
        }
 
-       return (0);
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 int
 pfkey_remove(struct nbr *nbr)
 {
-       if (nbr->auth.method == AUTH_NONE || !nbr->auth.established)
-               return (0);
+       if (!nbr->auth.established)
+               return 0;
 
        switch (nbr->auth.method) {
        case AUTH_MD5SIG:
-               return (pfkey_md5sig_remove(nbr));
-       default:
+               return pfkey_md5sig_remove(nbr);
+       case AUTH_NONE:
+               return 0;
                break;
        }
 
-       return (0);
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 int
index 697ec08af86102b202b1470e4c342104cf5fe182..d898a13084736fdb77cc4044bd7a2c49881d6276 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fe67917e8a897892948fa837c524525943c33dce..408374277c53ea986b08cd8af6c247b34181a692 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LDPD_RLFA_H_
index e865707d444834ae8cc244afa8673fb1088f5ffd..ec6d8be3d5d6569da050ccbc5db0f0f3e1cee9e9 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 019d846ada441d0191d3523b85b7024f39525762..85ba25c7707b5a9def847050368f295ba8ffb94b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2012 Alexander Bluhm <bluhm@openbsd.org>
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
diff --git a/lib/admin_group.c b/lib/admin_group.c
new file mode 100644 (file)
index 0000000..9c2c2c0
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ * Administrative-group library (RFC3630, RFC5305, RFC5329, RFC7308)
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "admin_group.h"
+#include "bitfield.h"
+
+char *admin_group_string(char *out, size_t sz, int indent,
+                        const struct admin_group *ag)
+{
+       bool printed = false;
+       size_t index = 2;
+       int nb_print = 0;
+
+       if (sz < index)
+               return out;
+
+       if (admin_group_explicit_zero(ag)) {
+               snprintf(out, sz, "0x00000000");
+               return out;
+       }
+
+       if (admin_group_zero(ag)) {
+               snprintf(out, sz, "not-set");
+               return out;
+       }
+
+       snprintf(out, sz, "0x");
+       for (ssize_t i = ag->bitmap.m - 1; i >= 0; i--) {
+               if (sz - index <= 0)
+                       break;
+               if (ag->bitmap.data[i] == 0 && !printed)
+                       continue;
+               if (nb_print != 0 && (nb_print % 4) == 0) {
+                       snprintf(&out[index], sz - index, "\n%*s", indent, "");
+                       index += indent + 1;
+                       snprintf(&out[index], sz - index, "0x%08x ",
+                                ag->bitmap.data[i]);
+                       index += 2;
+               } else
+                       snprintf(&out[index], sz - index, "%08x ",
+                                ag->bitmap.data[i]);
+               index += 9;
+               nb_print++;
+               printed = true;
+       }
+       return out;
+}
+
+char *admin_group_standard_print(char *out, int indent, uint32_t bitmap)
+{
+       bool first = true;
+       int bit, i;
+       size_t ret, line_sz = 0, line_max_sz;
+
+       out[0] = '\0';
+
+       if (bitmap == 0) {
+               snprintf(out, ADMIN_GROUP_PRINT_MAX_SIZE, "not-set");
+               return out;
+       }
+
+       line_max_sz = strlen("0xffffffff ffffffff ffffffff ffffffff");
+
+       for (i = 0; i < 32; i++) {
+               bit = bitmap >> i & 1;
+               if (bit == 0)
+                       continue;
+               if (!first) {
+                       ret = snprintf(&out[strlen(out)],
+                                      ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out),
+                                      ", ");
+                       line_sz += ret;
+               }
+               if (line_sz >= line_max_sz) {
+                       snprintf(&out[strlen(out)],
+                                ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out),
+                                "\n%*s", indent, "");
+
+                       line_sz = 0;
+               }
+               ret = snprintf(&out[strlen(out)],
+                              ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out), "%d",
+                              i);
+               line_sz += ret;
+               first = false;
+       }
+
+       return out;
+}
+
+char *admin_group_print(char *out, int indent, const struct admin_group *ag)
+{
+       bool first = true;
+       uint32_t i;
+       size_t ret, line_sz = 0, line_max_sz;
+
+       out[0] = '\0';
+
+       if (admin_group_size(ag) == 0) {
+               snprintf(out, ADMIN_GROUP_PRINT_MAX_SIZE, "not-set");
+               return out;
+       }
+
+       line_max_sz = strlen("0xffffffff ffffffff ffffffff ffffffff");
+
+       for (i = 0; i < (admin_group_size(ag) * WORD_SIZE); i++) {
+               if (!admin_group_get(ag, i))
+                       continue;
+               if (!first) {
+                       ret = snprintf(&out[strlen(out)],
+                                      ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out),
+                                      ", ");
+                       line_sz += ret;
+               }
+               if (line_sz >= line_max_sz) {
+                       snprintf(&out[strlen(out)],
+                                ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out),
+                                "\n%*s", indent, "");
+
+                       line_sz = 0;
+               }
+               ret = snprintf(&out[strlen(out)],
+                              ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out), "%d",
+                              i);
+               line_sz += ret;
+               if (ret >= (ADMIN_GROUP_PRINT_MAX_SIZE - strlen(out))) {
+                       out[0] = '\0';
+                       return out;
+               }
+               first = false;
+       }
+
+       return out;
+}
+
+bool admin_group_cmp(const struct admin_group *ag1,
+                    const struct admin_group *ag2)
+{
+       size_t i;
+
+       for (i = 0; i < ag1->bitmap.m || i < ag2->bitmap.m; i++) {
+               if (i >= ag1->bitmap.m) {
+                       if (ag2->bitmap.data[i] != 0)
+                               return false;
+               } else if (i >= ag2->bitmap.m) {
+                       if (ag1->bitmap.data[i] != 0)
+                               return false;
+               } else if (memcmp(&ag1->bitmap.data[i], &ag2->bitmap.data[i],
+                                 sizeof(word_t)) != 0)
+                       return false;
+       }
+
+       return true;
+}
+
+void admin_group_copy(struct admin_group *dst, const struct admin_group *src)
+{
+       assert(bf_is_inited(src->bitmap));
+       if (bf_is_inited(dst->bitmap))
+               bf_free(dst->bitmap);
+       dst->bitmap = bf_copy(src->bitmap);
+}
+
+void admin_group_init(struct admin_group *ag)
+{
+       assert(!bf_is_inited(ag->bitmap));
+       bf_init(ag->bitmap, WORD_SIZE);
+}
+
+void admin_group_term(struct admin_group *ag)
+{
+       assert(bf_is_inited(ag->bitmap));
+       bf_free(ag->bitmap);
+}
+
+word_t admin_group_get_offset(const struct admin_group *ag, size_t oct_offset)
+{
+       assert(bf_is_inited(ag->bitmap));
+       if (ag->bitmap.m < oct_offset)
+               return 0;
+       return ag->bitmap.data[oct_offset];
+}
+
+static void admin_group_extend(struct admin_group *ag, size_t idx)
+{
+       size_t old_m, m;
+
+       old_m = ag->bitmap.m;
+       m = idx + 1;
+       ag->bitmap.m = m;
+       ag->bitmap.data =
+               XREALLOC(MTYPE_BITFIELD, ag->bitmap.data, m * sizeof(word_t));
+       memset(&ag->bitmap.data[old_m], 0, (m - old_m) * sizeof(word_t));
+}
+
+void admin_group_set(struct admin_group *ag, size_t pos)
+{
+       size_t idx = bf_index(pos);
+
+       if (idx >= ag->bitmap.m)
+               admin_group_extend(ag, idx);
+
+       ag->bitmap.data[idx] |= 1 << (bf_offset(pos));
+
+       if (idx >= ag->bitmap.n)
+               ag->bitmap.n = idx + 1;
+}
+
+void admin_group_unset(struct admin_group *ag, size_t pos)
+{
+       if (bf_index(pos) > (ag->bitmap.m - 1))
+               return;
+       bf_release_index(ag->bitmap, pos);
+       ag->bitmap.n = admin_group_size(ag);
+}
+
+int admin_group_get(const struct admin_group *ag, size_t pos)
+{
+       size_t admin_group_length = admin_group_size(ag);
+       uint32_t oct_offset;
+       size_t idx;
+
+       if (admin_group_length == 0)
+               return 0;
+
+       idx = bf_index(pos);
+
+       if (idx >= admin_group_length)
+               return 0;
+
+       oct_offset = admin_group_get_offset(ag, idx);
+       return oct_offset >> pos & 1;
+}
+
+void admin_group_bulk_set(struct admin_group *ag, uint32_t bitmap,
+                         size_t oct_offset)
+{
+
+       if (bitmap == 0 && oct_offset == 0) {
+               admin_group_allow_explicit_zero(ag);
+               return;
+       }
+
+       if (oct_offset >= ag->bitmap.m)
+               admin_group_extend(ag, oct_offset);
+
+       ag->bitmap.data[oct_offset] = bitmap;
+
+       if (oct_offset >= ag->bitmap.n)
+               ag->bitmap.n = oct_offset + 1;
+}
+
+size_t admin_group_size(const struct admin_group *ag)
+{
+       size_t size = 0;
+
+       for (size_t i = 0; i < ag->bitmap.m; i++)
+               if (ag->bitmap.data[i] != 0)
+                       size = i + 1;
+       return size;
+}
+
+size_t admin_group_nb_words(const struct admin_group *ag)
+{
+       return ag->bitmap.n;
+}
+
+void admin_group_clear(struct admin_group *ag)
+{
+       for (size_t i = 0; i < ag->bitmap.m; i++)
+               ag->bitmap.data[i] = 0;
+       ag->bitmap.n = 0;
+}
+
+bool admin_group_zero(const struct admin_group *ag)
+{
+       for (size_t i = 0; i < ag->bitmap.m; i++)
+               if (ag->bitmap.data[i] != 0)
+                       return false;
+       return true;
+}
+
+
+bool admin_group_explicit_zero(const struct admin_group *ag)
+{
+       return ag->bitmap.n == 1 && ag->bitmap.data[0] == 0;
+}
+
+void admin_group_allow_explicit_zero(struct admin_group *ag)
+{
+       if (admin_group_zero(ag))
+               ag->bitmap.n = 1;
+}
+
+void admin_group_disallow_explicit_zero(struct admin_group *ag)
+{
+       if (admin_group_zero(ag))
+               ag->bitmap.n = 0;
+}
+
+/* link_std_ag: admin-group in the RFC5305 section 3.1 format
+ * link_ext_ag: admin-group in the RFC7308 format
+ * RFC7308 specifies in section 2.3.1 that:
+ * "If both an AG and EAG are present, a receiving node MUST use the AG
+ * as the first 32 bits (0-31) of administrative color and use the EAG
+ * for bits 32 and higher, if present."
+ */
+bool admin_group_match_any(const struct admin_group *fad_ag,
+                          const uint32_t *link_std_ag,
+                          const struct admin_group *link_ext_ag)
+{
+       size_t fad_ag_sz, link_ag_sz, i;
+       uint32_t link_ag_bitmap, fad_ag_bitmap;
+
+       assert(fad_ag);
+
+       /* get the size of admin-groups: i.e. number of used words */
+       fad_ag_sz = admin_group_size(fad_ag);
+       if (link_std_ag && link_ext_ag) {
+               link_ag_sz = admin_group_size(link_ext_ag);
+               if (link_ag_sz == 0)
+                       link_ag_sz = 1;
+       } else if (link_std_ag && !link_ext_ag)
+               link_ag_sz = 1;
+       else if (!link_std_ag && link_ext_ag)
+               link_ag_sz = admin_group_size(link_ext_ag);
+       else
+               link_ag_sz = 0;
+
+       for (i = 0; i < fad_ag_sz && i < link_ag_sz; i++) {
+               fad_ag_bitmap = fad_ag->bitmap.data[i];
+               if (i == 0 && link_std_ag)
+                       link_ag_bitmap = *link_std_ag;
+               else
+                       link_ag_bitmap = link_ext_ag->bitmap.data[i];
+
+               if (fad_ag_bitmap & link_ag_bitmap)
+                       return true;
+       }
+       return false;
+}
+
+/* same comments as admin_group_match_any() */
+bool admin_group_match_all(const struct admin_group *fad_ag,
+                          const uint32_t *link_std_ag,
+                          const struct admin_group *link_ext_ag)
+{
+       size_t fad_ag_sz, link_ag_sz, i;
+       uint32_t link_ag_bitmap, fad_ag_bitmap;
+
+       assert(fad_ag);
+
+       /* get the size of admin-groups: i.e. number of used words */
+       fad_ag_sz = admin_group_size(fad_ag);
+       if (link_std_ag && link_ext_ag) {
+               link_ag_sz = admin_group_size(link_ext_ag);
+               if (link_ag_sz == 0)
+                       link_ag_sz = 1;
+       } else if (link_std_ag && !link_ext_ag)
+               link_ag_sz = 1;
+       else if (!link_std_ag && link_ext_ag)
+               link_ag_sz = admin_group_size(link_ext_ag);
+       else
+               link_ag_sz = 0;
+
+       if (fad_ag_sz > link_ag_sz)
+               return false;
+
+       for (i = 0; i < fad_ag_sz; i++) {
+               fad_ag_bitmap = fad_ag->bitmap.data[i];
+               if (fad_ag_bitmap == 0)
+                       continue;
+
+               if (i == 0 && link_std_ag)
+                       link_ag_bitmap = *link_std_ag;
+               else
+                       link_ag_bitmap = link_ext_ag->bitmap.data[i];
+
+               if ((fad_ag_bitmap & link_ag_bitmap) != fad_ag_bitmap)
+                       return false;
+       }
+       return true;
+}
diff --git a/lib/admin_group.h b/lib/admin_group.h
new file mode 100644 (file)
index 0000000..60f4a05
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Administrative-group library (RFC3630, RFC5305, RFC5329, RFC7308)
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _FRR_ADMIN_GROUP_H
+#define _FRR_ADMIN_GROUP_H
+
+#include "zebra.h"
+#include "memory.h"
+#include "bitfield.h"
+
+#define ADMIN_GROUP_PRINT_MAX_SIZE 2048
+#define EXT_ADMIN_GROUP_MAX_POSITIONS 1024
+
+struct admin_group {
+       bitfield_t bitmap;
+};
+
+char *admin_group_string(char *out, size_t sz, int indent,
+                        const struct admin_group *ag);
+char *admin_group_standard_print(char *out, int indent, uint32_t bitmap);
+char *admin_group_print(char *out, int indent, const struct admin_group *ag);
+bool admin_group_cmp(const struct admin_group *ag1,
+                    const struct admin_group *ag2);
+void admin_group_copy(struct admin_group *dst, const struct admin_group *src);
+void admin_group_init(struct admin_group *ag);
+void admin_group_term(struct admin_group *ag);
+uint32_t admin_group_get_offset(const struct admin_group *ag,
+                               size_t oct_offset);
+void admin_group_set(struct admin_group *ag, size_t pos);
+void admin_group_unset(struct admin_group *ag, size_t pos);
+int admin_group_get(const struct admin_group *ag, size_t pos);
+void admin_group_bulk_set(struct admin_group *ag, uint32_t bitmap,
+                         size_t oct_offset);
+size_t admin_group_size(const struct admin_group *ag);
+size_t admin_group_nb_words(const struct admin_group *ag);
+void admin_group_clear(struct admin_group *ag);
+bool admin_group_zero(const struct admin_group *ag);
+bool admin_group_explicit_zero(const struct admin_group *ag);
+void admin_group_allow_explicit_zero(struct admin_group *ag);
+void admin_group_disallow_explicit_zero(struct admin_group *ag);
+
+bool admin_group_match_any(const struct admin_group *fad_ag,
+                          const uint32_t *link_std_ag,
+                          const struct admin_group *link_ag);
+bool admin_group_match_all(const struct admin_group *fad_ag,
+                          const uint32_t *link_std_ag,
+                          const struct admin_group *link_ag);
+
+#endif /* _FRR_ADMIN_GROUP_H */
diff --git a/lib/affinitymap.c b/lib/affinitymap.c
new file mode 100644 (file)
index 0000000..17e1b2c
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * Affinity map function.
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "linklist.h"
+#include "memory.h"
+#include "command.h"
+#include "vector.h"
+#include "prefix.h"
+#include "vty.h"
+#include "affinitymap.h"
+#include "command.h"
+#include "log.h"
+#include "hash.h"
+#include "libfrr.h"
+#include "lib_errors.h"
+#include "table.h"
+#include "json.h"
+#include "jhash.h"
+
+DEFINE_MTYPE_STATIC(LIB, AFFINITY_MAP, "Affinity map");
+DEFINE_MTYPE(LIB, AFFINITY_MAP_NAME, "Affinity map name");
+DEFINE_MTYPE_STATIC(LIB, AFFINITY_MAP_INDEX, "Affinity map index");
+
+DEFINE_QOBJ_TYPE(affinity_maps);
+DEFINE_QOBJ_TYPE(affinity_map);
+
+struct affinity_maps affinity_map_master = {NULL, NULL, NULL, NULL};
+
+static void affinity_map_free(struct affinity_map *map)
+{
+       XFREE(MTYPE_AFFINITY_MAP, map);
+}
+
+void affinity_map_set(const char *name, int pos)
+{
+       struct listnode *node;
+       struct affinity_map *map;
+
+       if (!affinity_map_master.maps)
+               affinity_map_master.maps = list_new();
+
+       for (ALL_LIST_ELEMENTS_RO(affinity_map_master.maps, node, map)) {
+               if (strncmp(name, map->name, AFFINITY_NAME_SIZE) != 0)
+                       continue;
+               map->bit_position = pos;
+               return;
+       }
+
+       map = XCALLOC(MTYPE_AFFINITY_MAP, sizeof(*map));
+       map->bit_position = pos;
+       snprintf(map->name, sizeof(map->name), "%s", name);
+       listnode_add(affinity_map_master.maps, map);
+}
+
+void affinity_map_unset(const char *name)
+{
+       struct listnode *node, *nnode;
+       struct affinity_map *map;
+
+       if (!affinity_map_master.maps)
+               return;
+
+       for (ALL_LIST_ELEMENTS(affinity_map_master.maps, node, nnode, map)) {
+               if (strncmp(name, map->name, AFFINITY_NAME_SIZE) != 0)
+                       continue;
+               listnode_delete(affinity_map_master.maps, map);
+               affinity_map_free(map);
+               return;
+       }
+}
+
+struct affinity_map *affinity_map_get(const char *name)
+{
+       struct listnode *node;
+       struct affinity_map *map;
+
+       if (!affinity_map_master.maps)
+               return NULL;
+
+       for (ALL_LIST_ELEMENTS_RO(affinity_map_master.maps, node, map))
+               if (strncmp(name, map->name, AFFINITY_NAME_SIZE) == 0)
+                       return map;
+       return NULL;
+}
+
+
+char *affinity_map_name_get(int pos)
+{
+       struct listnode *node;
+       struct affinity_map *map;
+
+       if (!affinity_map_master.maps)
+               return NULL;
+
+       for (ALL_LIST_ELEMENTS_RO(affinity_map_master.maps, node, map))
+               if (map->bit_position == pos)
+                       return map->name;
+       return NULL;
+}
+
+bool affinity_map_check_use_hook(const char *affmap_name)
+{
+       if (affinity_map_master.check_use_hook)
+               return (*affinity_map_master.check_use_hook)(affmap_name);
+       return false;
+}
+
+bool affinity_map_check_update_hook(const char *affmap_name, uint16_t new_pos)
+{
+       if (affinity_map_master.check_update_hook)
+               return (*affinity_map_master.check_update_hook)(affmap_name,
+                                                               new_pos);
+       return true;
+}
+
+void affinity_map_update_hook(const char *affmap_name, uint16_t new_pos)
+{
+       struct affinity_map *map;
+
+       if (!affinity_map_master.update_hook)
+               return;
+
+       map = affinity_map_get(affmap_name);
+
+       if (!map)
+               /* Affinity-map creation */
+               return;
+
+       (*affinity_map_master.update_hook)(affmap_name, map->bit_position,
+                                          new_pos);
+}
+
+
+void affinity_map_set_check_use_hook(bool (*func)(const char *affmap_name))
+{
+       affinity_map_master.check_use_hook = func;
+}
+
+void affinity_map_set_check_update_hook(bool (*func)(const char *affmap_name,
+                                                    uint16_t new_pos))
+{
+       affinity_map_master.check_update_hook = func;
+}
+
+void affinity_map_set_update_hook(void (*func)(const char *affmap_name,
+                                              uint16_t old_pos,
+                                              uint16_t new_pos))
+{
+       affinity_map_master.update_hook = func;
+}
diff --git a/lib/affinitymap.h b/lib/affinitymap.h
new file mode 100644 (file)
index 0000000..19edf5a
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Affinity-map function.
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ZEBRA_AFFINITYMAP_H
+#define _ZEBRA_AFFINITYMAP_H
+
+#include "typesafe.h"
+#include "prefix.h"
+#include "memory.h"
+#include "qobj.h"
+#include "vty.h"
+#include "lib/plist.h"
+#include "lib/plist_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AFFINITY_NAME_SIZE 32
+
+struct affinity_map {
+       char name[AFFINITY_NAME_SIZE];
+       uint16_t bit_position;
+
+       QOBJ_FIELDS;
+};
+DECLARE_QOBJ_TYPE(affinity_map);
+
+struct affinity_maps {
+       struct list *maps;
+
+       bool (*check_use_hook)(const char *affmap_name);
+       bool (*check_update_hook)(const char *affmap_name, uint16_t new_pos);
+       void (*update_hook)(const char *affmap_name, uint16_t old_pos,
+                           uint16_t new_pos);
+
+       QOBJ_FIELDS;
+};
+DECLARE_QOBJ_TYPE(affinity_maps);
+
+extern const struct frr_yang_module_info frr_affinity_map_info;
+
+void affinity_map_set(const char *name, int pos);
+void affinity_map_unset(const char *name);
+struct affinity_map *affinity_map_get(const char *name);
+char *affinity_map_name_get(const int pos);
+
+bool affinity_map_check_use_hook(const char *affmap_name);
+bool affinity_map_check_update_hook(const char *affmap_name, uint16_t new_pos);
+void affinity_map_update_hook(const char *affmap_name, uint16_t new_pos);
+
+void affinity_map_set_check_use_hook(bool (*func)(const char *affmap_name));
+void affinity_map_set_check_update_hook(bool (*func)(const char *affmap_name,
+                                                    uint16_t new_pos));
+void affinity_map_set_update_hook(void (*func)(const char *affmap_name,
+                                              uint16_t old_pos,
+                                              uint16_t new_pos));
+
+void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode,
+                          bool show_defaults);
+
+void affinity_map_init(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZEBRA_AFFINITYMAP_H */
diff --git a/lib/affinitymap_cli.c b/lib/affinitymap_cli.c
new file mode 100644 (file)
index 0000000..a2d5e8e
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Affinity map northbound CLI implementation.
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "lib/command.h"
+#include "lib/northbound_cli.h"
+#include "lib/affinitymap.h"
+#include "lib/affinitymap_cli_clippy.c"
+
+/* Route map node structure. */
+static int affinity_map_config_write(struct vty *vty);
+static struct cmd_node affinitymap_node = {
+       .name = "affinity-map",
+       .node = AFFMAP_NODE,
+       .prompt = "",
+       .config_write = affinity_map_config_write,
+};
+
+/* max value is EXT_ADMIN_GROUP_MAX_POSITIONS - 1 */
+DEFPY_YANG_NOSH(affinity_map, affinity_map_cmd,
+               "affinity-map NAME$name bit-position (0-1023)$position",
+               "Affinity map configuration\n"
+               "Affinity attribute name\n"
+               "Bit position for affinity attribute value\n"
+               "Bit position\n")
+{
+       char xpathr[XPATH_MAXLEN];
+
+       snprintf(
+               xpathr, sizeof(xpathr),
+               "/frr-affinity-map:lib/affinity-maps/affinity-map[name='%s']/value",
+               name);
+       nb_cli_enqueue_change(vty, xpathr, NB_OP_MODIFY, position_str);
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+/* max value is EXT_ADMIN_GROUP_MAX_POSITIONS - 1 */
+DEFPY_YANG_NOSH(no_affinity_map, no_affinity_map_cmd,
+               "no affinity-map NAME$name [bit-position (0-1023)$position]",
+               NO_STR
+               "Affinity map configuration\n"
+               "Affinity attribute name\n"
+               "Bit position for affinity attribute value\n"
+               "Bit position\n")
+{
+       char xpathr[XPATH_MAXLEN];
+
+       snprintf(xpathr, sizeof(xpathr),
+                "/frr-affinity-map:lib/affinity-maps/affinity-map[name='%s']",
+                name);
+       nb_cli_enqueue_change(vty, xpathr, NB_OP_DESTROY, NULL);
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+static int affinity_map_config_write(struct vty *vty)
+{
+       const struct lyd_node *dnode;
+       int written = 0;
+
+       dnode = yang_dnode_get(running_config->dnode, "/frr-affinity-map:lib");
+       if (dnode) {
+               nb_cli_show_dnode_cmds(vty, dnode, false);
+               written = 1;
+       }
+
+       return written;
+}
+
+void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode,
+                          bool show_defaults __attribute__((__unused__)))
+{
+       vty_out(vty, "affinity-map %s bit-position %u\n",
+               yang_dnode_get_string(dnode, "./name"),
+               yang_dnode_get_uint16(dnode, "./value"));
+}
+
+/* Initialization of affinity map vector. */
+void affinity_map_init(void)
+{
+       /* CLI commands. */
+       install_node(&affinitymap_node);
+       install_element(CONFIG_NODE, &affinity_map_cmd);
+       install_element(CONFIG_NODE, &no_affinity_map_cmd);
+}
diff --git a/lib/affinitymap_northbound.c b/lib/affinitymap_northbound.c
new file mode 100644 (file)
index 0000000..331075f
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * affinity map northbound implementation.
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "lib/command.h"
+#include "lib/log.h"
+#include "lib/northbound.h"
+#include "lib/affinitymap.h"
+
+/*
+ * XPath: /frr-affinity-map:lib/affinity-maps/affinity-map
+ */
+
+static int lib_affinity_map_create(struct nb_cb_create_args *args)
+{
+       return NB_OK;
+}
+
+static int lib_affinity_map_destroy(struct nb_cb_destroy_args *args)
+{
+       const char *name;
+
+       name = yang_dnode_get_string((const struct lyd_node *)args->dnode,
+                                    "./name");
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+               if (!affinity_map_check_use_hook(name))
+                       break;
+               snprintf(args->errmsg, args->errmsg_len,
+                        "affinity-map %s is used", name);
+               return NB_ERR_VALIDATION;
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               affinity_map_unset(name);
+               break;
+       }
+       return NB_OK;
+}
+
+/*
+ * XPath: /frr-affinity-map:lib/affinity-maps/affinity-map/value
+ */
+static int lib_affinity_map_value_modify(struct nb_cb_modify_args *args)
+{
+       const char *name;
+       char *map_name;
+       uint16_t pos;
+
+       name = yang_dnode_get_string(
+               (const struct lyd_node *)args->dnode->parent, "./name");
+
+       pos = yang_dnode_get_uint16(
+               (const struct lyd_node *)args->dnode->parent, "./value");
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+               map_name = affinity_map_name_get(pos);
+               if (map_name &&
+                   strncmp(map_name, name, AFFINITY_NAME_SIZE) != 0) {
+                       snprintf(args->errmsg, args->errmsg_len,
+                                "bit-position is used by %s.", map_name);
+                       return NB_ERR_VALIDATION;
+               }
+               if (!affinity_map_check_update_hook(name, pos)) {
+                       snprintf(
+                               args->errmsg, args->errmsg_len,
+                               "affinity-map new bit-position > 31 but is used with standard admin-groups");
+                       return NB_ERR_VALIDATION;
+               }
+               break;
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               affinity_map_update_hook(name, pos);
+               affinity_map_set(name, pos);
+               break;
+       }
+
+       return NB_OK;
+}
+
+static int lib_affinity_map_value_destroy(struct nb_cb_destroy_args *args)
+{
+       return NB_OK;
+}
+
+/* clang-format off */
+const struct frr_yang_module_info frr_affinity_map_info = {
+       .name = "frr-affinity-map",
+       .nodes = {
+               {
+                       .xpath = "/frr-affinity-map:lib/affinity-maps/affinity-map",
+                       .cbs = {
+                               .create = lib_affinity_map_create,
+                               .destroy = lib_affinity_map_destroy,
+                               .cli_show = cli_show_affinity_map,
+                       }
+               },
+               {
+                       .xpath = "/frr-affinity-map:lib/affinity-maps/affinity-map/value",
+                       .cbs = {
+                               .modify = lib_affinity_map_value_modify,
+                               .destroy = lib_affinity_map_value_destroy,
+                       }
+               },
+               {
+                       .xpath = NULL,
+               },
+       }
+};
index 5f62459805e4503f1e39e46d724ff7cee5e75b6a..2f45ae83326e6b02e8d79d5c365ba14bb1770248 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* SNMP support
  * Copyright (C) 2012 Vincent Bernat <bernat@luffy.cx>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 22b981e28433be7aaff9250225514e0b0526bb3f..9cf277fcfa029502660445902b020b93dc6d7d4d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Aggregate Route
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "zebra.h"
 
index e0c06449eee22efd97c989b95b11fe1fec86797a..af1e6b6af1cc0d8b66427643350d076a52a16ce7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * agg_table - Aggregate Table Header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __AGG_TABLE_H__
 #define __AGG_TABLE_H__
diff --git a/lib/asn.c b/lib/asn.c
new file mode 100644 (file)
index 0000000..c646663
--- /dev/null
+++ b/lib/asn.c
@@ -0,0 +1,260 @@
+/*
+ * ASN functions
+ *
+ * Copyright 2022 6WIND
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <zebra.h>
+#include "log.h"
+#include "asn.h"
+
+static bool relax_as_zero;
+
+static const struct message asnotation_mode_msg[] = {
+       {ASNOTATION_PLAIN, "plain"},
+       {ASNOTATION_DOT, "dot"},
+       {ASNOTATION_DOTPLUS, "dot+"},
+       {ASNOTATION_UNDEFINED, "undefined"},
+       {0}
+};
+
+/* converts a string into an Autonomous system number
+ * "1.1" => 65536
+ * "65500" => 65500
+ */
+static bool asn_str2asn_internal(const char *asstring, as_t *asn,
+                                const char **next, bool *partial,
+                                enum asnotation_mode *mode)
+{
+       uint32_t high = 0, low = 0;
+       uint64_t temp_val;
+       const char *p = asstring;
+       bool ret = false;
+       uint32_t digit;
+       enum asnotation_mode val = ASNOTATION_PLAIN;
+
+       if (!asstring)
+               goto end;
+
+       if  (!isdigit((unsigned char)*p))
+               goto end;
+
+       temp_val = 0;
+       while (isdigit((unsigned char)*p)) {
+               digit = (*p) - '0';
+               temp_val *= 10;
+               temp_val += digit;
+               if (temp_val > UINT32_MAX)
+                       /* overflow */
+                       goto end;
+               p++;
+       }
+       high = (uint32_t)temp_val;
+       if (*p == '.') { /* dot format */
+               p++;
+               temp_val = 0;
+               if (*p == '\0' && partial) {
+                       *partial = true;
+                       goto end;
+               }
+               while (isdigit((unsigned char)*p)) {
+                       digit = (*p) - '0';
+                       temp_val *= 10;
+                       temp_val += digit;
+                       if (temp_val > UINT16_MAX)
+                               /* overflow */
+                               goto end;
+                       p++;
+               }
+               low = (uint32_t)temp_val;
+
+               if (!next && *p != '\0' && !isdigit((unsigned char)*p))
+                       goto end;
+               /* AS <AS4B>.<AS4B> is forbidden */
+               if (high > UINT16_MAX)
+                       goto end;
+               /* AS 0.0 is authorised for some case only */
+               if (!relax_as_zero && high == 0 && low == 0) {
+                       if (partial)
+                               *partial = true;
+                       goto end;
+               }
+               if (asn)
+                       *asn = (high << 16) + low;
+               ret = true;
+               if (high == 0)
+                       val = ASNOTATION_DOTPLUS;
+               else
+                       val = ASNOTATION_DOT;
+               goto end;
+       }
+       /* AS 0 is forbidden */
+       if (!relax_as_zero && high == 0)
+               goto end;
+       if (!asn) {
+               ret = true;
+               goto end;
+       }
+       *asn = high;
+       ret = true;
+ end:
+       if (next)
+               *next = p;
+       if (mode)
+               *mode = val;
+       return ret;
+}
+
+static void asn_asn2asdot(as_t asn, char *asstring, size_t len)
+{
+       uint16_t low, high;
+
+       high = (asn >> 16) & 0xffff;
+       low = asn & 0xffff;
+       snprintf(asstring, len, "%hu.%hu", high, low);
+}
+
+bool asn_str2asn(const char *asstring, as_t *asn)
+{
+       return asn_str2asn_internal(asstring, asn, NULL, NULL, NULL);
+}
+
+const char *asn_asn2asplain(as_t asn)
+{
+       static char buf[ASN_STRING_MAX_SIZE];
+
+       snprintf(buf, sizeof(buf), "%u", asn);
+       return buf;
+}
+
+const char *asn_str2asn_parse(const char *asstring, as_t *asn, bool *found_ptr)
+{
+       const char *p = NULL;
+       const char **next = &p;
+       bool found;
+
+       found = asn_str2asn_internal(asstring, asn, next, NULL, NULL);
+       if (found_ptr)
+               *found_ptr = found;
+       return *next;
+}
+
+void asn_relax_as_zero(bool relax)
+{
+       relax_as_zero = relax;
+}
+
+enum match_type asn_str2asn_match(const char *str)
+{
+       bool found, partial = false;
+
+       found = asn_str2asn_internal(str, NULL, NULL, &partial, NULL);
+       if (found && !partial)
+               return exact_match;
+
+       if (partial)
+               return partly_match;
+
+       return no_match;
+}
+
+bool asn_str2asn_notation(const char *asstring, as_t *asn,
+                         enum asnotation_mode *asnotation)
+{
+       return asn_str2asn_internal(asstring, asn, NULL, NULL, asnotation);
+}
+
+const char *asn_mode2str(enum asnotation_mode asnotation)
+{
+       return lookup_msg(asnotation_mode_msg, asnotation,
+                         "Unrecognized AS notation mode");
+}
+
+void asn_asn2json(json_object *json, const char *attr,
+                 as_t asn, enum asnotation_mode asnotation)
+{
+       static char as_str[ASN_STRING_MAX_SIZE];
+
+       if ((asnotation == ASNOTATION_PLAIN) ||
+           ((asnotation == ASNOTATION_DOT) && asn < UINT16_MAX))
+               json_object_int_add(json, attr, asn);
+       else {
+               asn_asn2asdot(asn, as_str, sizeof(as_str));
+               json_object_string_add(json, attr, as_str);
+       }
+}
+
+void asn_asn2json_array(json_object *jseg_list, as_t asn,
+                       enum asnotation_mode asnotation)
+{
+       static char as_str[ASN_STRING_MAX_SIZE];
+
+       if ((asnotation == ASNOTATION_PLAIN) ||
+           ((asnotation == ASNOTATION_DOT) && asn < UINT16_MAX))
+               json_object_array_add(jseg_list,
+                                     json_object_new_int64(asn));
+       else {
+               asn_asn2asdot(asn, as_str, sizeof(as_str));
+               json_array_string_add(jseg_list, as_str);
+       }
+}
+
+char *asn_asn2string(const as_t *asn, char *buf, size_t len,
+                    enum asnotation_mode asnotation)
+{
+       if ((asnotation == ASNOTATION_PLAIN) ||
+           ((asnotation == ASNOTATION_DOT) && *asn < UINT16_MAX))
+               snprintf(buf, len, "%u", *asn);
+       else
+               asn_asn2asdot(*asn, buf, len);
+       return buf;
+}
+
+static ssize_t printfrr_asnotation(struct fbuf *buf, struct printfrr_eargs *ea,
+                                  const void *ptr,
+                                  enum asnotation_mode asnotation)
+{
+       /* for alignemnt up to 33 chars - %33pASD for instance - */
+       char as_str[ASN_STRING_MAX_SIZE*3];
+       const as_t *asn;
+
+       if (!ptr)
+               return bputs(buf, "(null)");
+       asn = ptr;
+       asn_asn2string(asn, as_str, sizeof(as_str), asnotation);
+       return bputs(buf, as_str);
+}
+
+printfrr_ext_autoreg_p("ASP", printfrr_asplain);
+static ssize_t printfrr_asplain(struct fbuf *buf, struct printfrr_eargs *ea,
+                               const void *ptr)
+{
+       return printfrr_asnotation(buf, ea, ptr, ASNOTATION_PLAIN);
+}
+
+printfrr_ext_autoreg_p("ASD", printfrr_asdot);
+static ssize_t printfrr_asdot(struct fbuf *buf, struct printfrr_eargs *ea,
+                               const void *ptr)
+{
+       return printfrr_asnotation(buf, ea, ptr, ASNOTATION_DOT);
+}
+
+printfrr_ext_autoreg_p("ASE", printfrr_asdotplus);
+static ssize_t printfrr_asdotplus(struct fbuf *buf, struct printfrr_eargs *ea,
+                                 const void *ptr)
+{
+       return printfrr_asnotation(buf, ea, ptr, ASNOTATION_DOTPLUS);
+}
diff --git a/lib/asn.h b/lib/asn.h
new file mode 100644 (file)
index 0000000..81a42c6
--- /dev/null
+++ b/lib/asn.h
@@ -0,0 +1,81 @@
+/*
+ * AS number structure
+ * Copyright 2022 6WIND
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _FRR_ASN_H
+#define _FRR_ASN_H
+
+#include "zebra.h"
+#include "command_match.h"
+#include "json.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ASN_STRING_MAX_SIZE    12
+
+enum asnotation_mode {
+       ASNOTATION_PLAIN = 0,
+       ASNOTATION_DOT,
+       ASNOTATION_DOTPLUS,
+       ASNOTATION_UNDEFINED,
+};
+
+typedef uint32_t as_t;
+
+extern bool asn_str2asn(const char *asstring, as_t *asn);
+extern const char *asn_asn2asplain(as_t asn);
+extern const char *asn_str2asn_parse(const char *asstring, as_t *asn,
+                                    bool *found_ptr);
+extern enum match_type asn_str2asn_match(const char *str);
+extern bool asn_str2asn_notation(const char *asstring, as_t *asn,
+                                enum asnotation_mode *asnotation);
+extern const char *asn_mode2str(enum asnotation_mode asnotation);
+void asn_asn2json_array(json_object *jseg_list, as_t asn,
+                       enum asnotation_mode asnotation);
+void asn_asn2json(json_object *jseg_list, const char *attr,
+                 as_t asn, enum asnotation_mode asnotation);
+extern char *asn_asn2string(const as_t *as, char *buf, size_t len,
+                           enum asnotation_mode asnotation);
+/* display AS in appropriate format */
+#ifdef _FRR_ATTRIBUTE_PRINTFRR
+#pragma FRR printfrr_ext "%pASP"  (as_t *)
+#pragma FRR printfrr_ext "%pASD"  (as_t *)
+#pragma FRR printfrr_ext "%pASE"  (as_t *)
+#endif
+
+#define ASN_FORMAT(mode)  \
+       ((mode == ASNOTATION_DOT) ? "%pASD" :       \
+        ((mode == ASNOTATION_DOTPLUS) ? "%pASE" :      \
+         "%pASP"))
+#define ASN_FORMAT_SPACE(mode)             \
+       ((mode == ASNOTATION_DOT) ? "%10pASD" :     \
+        ((mode == ASNOTATION_DOTPLUS) ? "%10pASE" :    \
+         "%10pASP"))
+
+/* for test */
+extern void asn_relax_as_zero(bool relax);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FRR_ASN_H */
index fbdbd52ce85093cfdf8ff9187ed769eba53fad91..97c746007921efdf5b374f931e7d75aa322483ed 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2021  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* WARNING: this file is "special" in that it overrides the system-provided
index 2631d4fa78c97f1fe068cb5787eed96793348eb0..5c361d3dacb8527af0ae2dab52f0697d4090f8d6 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016-2018  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index b0c4da4baa82706912f3771769e0e4c453c82916..2b6a3a176f94ee2741e01b2599164bcf51e8ecb3 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016-2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_ATOMLIST_H
index 6f0be039f1dae08a5f9aa47dd0da23d41d9e5881..1507b0252b4e7761de87f140b5dd078a0ec1db73 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: NONE
 /*
  * This is part of the libb64 project, and has been placed in the public domain.
  * For details, see http://sourceforge.net/projects/libb64
index 3dc1559aa48c64fe19fa737c5a0f23a6052acc24..839f92aa7cf8690040609d3aa3841dd5dd5b6e90 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: NONE
 /*
  * This is part of the libb64 project, and has been placed in the public domain.
  * For details, see http://sourceforge.net/projects/libb64
index 9078e3559f54f92562ddcf6d8d396cc1d1b85e5f..0d77c5c822de8ba620d86ec6565ce0932398443b 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bfd.c: BFD handling routines
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 51e831785a0efb28ae08da2712150b12a7b1d9ff..66c08cde749d22659cdc1bb572319dff20e3bf79 100644 (file)
--- a/lib/bfd.h
+++ b/lib/bfd.h
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * bfd.h: BFD definitions and structures
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_BFD_H
index 9af4053dafb987c7e0f7fb0e8859df46b7b6a201..c4e2cbe4e1f0ed072c74adc7987b03a0b6269a41 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Bitfields
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 /**
  * A simple bit array implementation to allocate and free IDs. An example
@@ -72,7 +57,8 @@ DECLARE_MTYPE(BITFIELD);
        do {                                                                   \
                (v).n = 0;                                                     \
                (v).m = ((N) / WORD_SIZE + 1);                                 \
-               (v).data = XCALLOC(MTYPE_BITFIELD, ((v).m * sizeof(word_t)));  \
+               (v).data = (word_t *)XCALLOC(MTYPE_BITFIELD,                   \
+                                            ((v).m * sizeof(word_t)));        \
        } while (0)
 
 /**
@@ -268,6 +254,19 @@ static inline unsigned int bf_find_next_set_bit(bitfield_t v,
                (v).data = NULL;                                               \
        } while (0)
 
+static inline bitfield_t bf_copy(bitfield_t src)
+{
+       bitfield_t dst;
+
+       assert(bf_is_inited(src));
+       bf_init(dst, WORD_SIZE * (src.m - 1));
+       for (size_t i = 0; i < src.m; i++)
+               dst.data[i] = src.data[i];
+       dst.n = src.n;
+       return dst;
+}
+
+
 #ifdef __cplusplus
 }
 #endif
index e976fecc1f13a971d5d5e484dab2cce7604b89f1..63df56a6d23d6dba715bc600ecc7dda006c4e738 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Buffering of output and input.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8b5a89825fe74ca79bf7312530e125be9de5f8b9..5d98c31dbc4c24baae3229ffe819550907f9013e 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Buffering to output and input.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_BUFFER_H
index 1c27f857ba74289dcb456a8dedcef53b0b5b5106..c3c9f5c4016d97dc08b2d3e846d8523cbe081b20 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * clippy (CLI preparator in python) main executable
  * Copyright (C) 2016-2017  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "config.h"
index 95af274106c33a9927917f8f4716b7e666a1f1ac..d6aa642e80460943e0cae8eae41a638c9bce2674 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * clippy (CLI preparator in python)
  * Copyright (C) 2016-2017  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_CLIPPY_H
index 6d023142ab681ad5dae236f599c71d651dee3873..ee5a3889e8c0ca7e631a79c6108d9c080b7544c4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * CLI backend interface.
  *
@@ -6,22 +7,6 @@
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2013 by Open Source Routing.
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -71,6 +56,7 @@ const struct message tokennames[] = {
        item(IPV6_PREFIX_TKN),
        item(MAC_TKN),
        item(MAC_PREFIX_TKN),
+       item(ASNUM_TKN),
        item(FORK_TKN),
        item(JOIN_TKN),
        item(START_TKN),
@@ -127,6 +113,11 @@ bool cmd_allow_reserved_ranges_get(void)
        return host.allow_reserved_ranges;
 }
 
+const char *cmd_software_version_get(void)
+{
+       return FRR_FULL_NAME "/" FRR_VERSION;
+}
+
 static int root_on_exit(struct vty *vty);
 
 /* Standard command node structures. */
@@ -949,7 +940,8 @@ static int cmd_execute_command_real(vector vline, enum cmd_filter_type filter,
                        return CMD_ERR_INCOMPLETE;
                case MATCHER_AMBIGUOUS:
                        return CMD_ERR_AMBIGUOUS;
-               default:
+               case MATCHER_NO_MATCH:
+               case MATCHER_OK:
                        return CMD_ERR_NO_MATCH;
                }
        }
index 8f5d96053cb10fdf1df07222516d8071225d8292..6538e565880923d89efb6200a535c1077a2d55d4 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra configuration command interface routine
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_COMMAND_H
@@ -90,6 +75,7 @@ struct host {
 };
 
 /* List of CLI nodes. Please remember to update the name array in command.c. */
+/* clang-format off */
 enum node_type {
        AUTH_NODE,               /* Authentication mode of vty interface. */
        VIEW_NODE,               /* View node. Default mode of vty interface. */
@@ -106,6 +92,7 @@ enum node_type {
        EXTLOG_NODE,             /* RFC5424 & co. extended syslog */
        KEYCHAIN_NODE,           /* Key-chain node. */
        KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
+       AFFMAP_NODE,             /* Affinity map node. */
        IP_NODE,                 /* Static ip route node. */
        VRF_NODE,                /* VRF mode node. */
        INTERFACE_NODE,          /* Interface mode node. */
@@ -186,6 +173,7 @@ enum node_type {
        BMP_NODE,               /* BMP config under router bgp */
        NODE_TYPE_MAX, /* maximum */
 };
+/* clang-format on */
 
 extern vector cmdvec;
 extern const struct message tokennames[];
@@ -403,7 +391,8 @@ struct cmd_node {
 #define DEBUG_STR "Debugging functions\n"
 #define UNDEBUG_STR "Disable debugging functions (see also 'debug')\n"
 #define ROUTER_STR "Enable a routing process\n"
-#define AS_STR "AS number\n"
+#define AS_STR                                                                 \
+       "AS number in plain  <1-4294967295> or dotted <0-65535>.<0-65535> format\n"
 #define MAC_STR "MAC address\n"
 #define MBGP_STR "MBGP information\n"
 #define MATCH_STR "Match values from routing table\n"
@@ -603,6 +592,7 @@ extern const char *cmd_domainname_get(void);
 extern const char *cmd_system_get(void);
 extern const char *cmd_release_get(void);
 extern const char *cmd_version_get(void);
+extern const char *cmd_software_version_get(void);
 extern bool cmd_allow_reserved_ranges_get(void);
 
 /* NOT safe for general use; call this only if DEV_BUILD! */
index e940685250fad5343f9a670646913dfcaa963ca8..ff3c11db69b531416ad1bbafc78d91bdd0bc3850 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * CLI graph handling
  *
@@ -6,20 +7,6 @@
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2013 by Open Source Routing.
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -267,9 +254,23 @@ static bool cmd_nodes_equal(struct graph_node *ga, struct graph_node *gb)
                        return false;
                return cmd_subgraph_equal(ga, gb, a->forkjoin);
 
-       default:
+       case VARIABLE_TKN:
+       case IPV4_TKN:
+       case IPV4_PREFIX_TKN:
+       case IPV6_PREFIX_TKN:
+       case IPV6_TKN:
+       case MAC_TKN:
+       case MAC_PREFIX_TKN:
+       case JOIN_TKN:
+       case START_TKN:
+       case END_TKN:
+       case NEG_ONLY_TKN:
+       case WORD_TKN:
+       case ASNUM_TKN:
                return true;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static void cmd_fork_bump_attr(struct graph_node *gn, struct graph_node *join,
@@ -477,7 +478,7 @@ void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf)
 
        char nbuf[512];
        struct cmd_token *tok = gn->data;
-       const char *color;
+       const char *color = NULL;
 
        if (wasend) {
                wasend = false;
@@ -526,10 +527,24 @@ void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf)
        case WORD_TKN:
                color = "#ffffff";
                break;
-       default:
+       case RANGE_TKN:
+       case IPV4_TKN:
+       case IPV4_PREFIX_TKN:
+       case IPV6_TKN:
+       case IPV6_PREFIX_TKN:
+       case MAC_TKN:
+       case MAC_PREFIX_TKN:
+       case END_TKN:
+       case VARIABLE_TKN:
+       case ASNUM_TKN:
                color = "#ffffff";
                break;
        }
+
+       /*
+        * Some compilers have the mistaken belief that we can
+        * get here without initializing color.
+        */
        snprintf(nbuf, sizeof(nbuf),
                 ">, style = filled, fillcolor = \"%s\" ];\n", color);
        buffer_putstr(buf, nbuf);
index b8c7a9c72cc7f260f392f7ac863417940afb420d..25aa47db7b650d9d052099c5e58c73ff1f129b6d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * CLI graph handling
  *
@@ -6,20 +7,6 @@
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2013 by Open Source Routing.
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_COMMAND_GRAPH_H
@@ -58,6 +45,7 @@ enum cmd_token_type {
        IPV6_PREFIX_TKN, // IPV6 network prefixes
        MAC_TKN,         // Ethernet address
        MAC_PREFIX_TKN,  // Ethernet address w/ CIDR mask
+       ASNUM_TKN,       // AS dot format
 
        /* plumbing types */
        FORK_TKN,  // marks subgraph beginning
index ec366ce7e178919eb91441144f078323b89e4ab6..dc89191c13464c536d64099860a33cfdec70d5d7 100644 (file)
@@ -1,25 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Command format string lexer for CLI backend.
  *
  * --
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 %top{
@@ -54,6 +38,7 @@ VARIABLE        [A-Z][-_A-Z:0-9]+
 WORD            (\-|\+)?[a-zA-Z0-9\*][-+_a-zA-Z0-9\*]*
 NUMBER          (\-|\+)?[0-9]{1,20}
 RANGE           \({NUMBER}[ ]?\-[ ]?{NUMBER}\)
+ASNUM           ASNUM
 
 /* yytext shall be a pointer */
 %pointer
@@ -73,6 +58,7 @@ RANGE           \({NUMBER}[ ]?\-[ ]?{NUMBER}\)
 %}
 
 [ \t]+          LOC_STEP /* ignore whitespace */;
+{ASNUM}         {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return ASNUM;}
 {IPV4}          {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV4;}
 {IPV4_PREFIX}   {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV4_PREFIX;}
 {IPV6}          {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV6;}
index ce2dbc9528997ad5997146baaaebd77ee429896b..ff3c48fc310108ca62a6b92f7ef70acf95c46f7d 100644 (file)
@@ -1,30 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Input matching routines for CLI backend.
  *
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
 
 #include "command_match.h"
 #include "memory.h"
+#include "asn.h"
 
 DEFINE_MTYPE_STATIC(LIB, CMD_MATCHSTACK, "Command Match Stack");
 
@@ -437,7 +423,7 @@ enum matcher_rv command_complete(struct graph *graph, vector vline,
                                        add_nexthops(next, gstack[0], gstack,
                                                     idx + 1, neg);
                                break;
-                       default:
+                       case no_match:
                                trace_matcher("no_match\n");
                                break;
                        }
@@ -544,9 +530,23 @@ static enum match_type min_match_level(enum cmd_token_type type)
        // allowing words to partly match enables command abbreviation
        case WORD_TKN:
                return partly_match;
-       default:
+       case RANGE_TKN:
+       case IPV4_TKN:
+       case IPV4_PREFIX_TKN:
+       case IPV6_TKN:
+       case IPV6_PREFIX_TKN:
+       case MAC_TKN:
+       case MAC_PREFIX_TKN:
+       case FORK_TKN:
+       case JOIN_TKN:
+       case END_TKN:
+       case NEG_ONLY_TKN:
+       case VARIABLE_TKN:
+       case ASNUM_TKN:
                return exact_match;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 /**
@@ -566,15 +566,22 @@ static int score_precedence(enum cmd_token_type type)
        case IPV6_PREFIX_TKN:
        case MAC_TKN:
        case MAC_PREFIX_TKN:
+       case ASNUM_TKN:
        case RANGE_TKN:
                return 2;
        case WORD_TKN:
                return 3;
        case VARIABLE_TKN:
                return 4;
-       default:
+       case JOIN_TKN:
+       case START_TKN:
+       case END_TKN:
+       case NEG_ONLY_TKN:
+       case SPECIAL_TKN:
                return 10;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 /**
@@ -694,10 +701,17 @@ static enum match_type match_token(struct cmd_token *token, char *input_token)
                return match_mac(input_token, false);
        case MAC_PREFIX_TKN:
                return match_mac(input_token, true);
+       case ASNUM_TKN:
+               return asn_str2asn_match(input_token);
        case END_TKN:
-       default:
+       case FORK_TKN:
+       case JOIN_TKN:
+       case START_TKN:
+       case NEG_ONLY_TKN:
                return no_match;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 #define IPV4_ADDR_STR   "0123456789."
@@ -831,7 +845,6 @@ static enum match_type match_ipv4_prefix(const char *str)
        return exact_match;
 }
 
-
 #define IPV6_ADDR_STR   "0123456789abcdefABCDEF:."
 #define IPV6_PREFIX_STR "0123456789abcdefABCDEF:./"
 #define STATE_START     1
index 0488cc1a1fe6508e048bf8590931f14e70211e25..db2a8535e00706e36c042e4cbb87f99c583230c8 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Input matching routines for CLI backend.
  *
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_COMMAND_MATCH_H
index 35c119691bbbb2afd02af04c71bd4afd64d0f846..8867e98ccc79069a62795d1e56563b5c8254dde6 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Command format string parser for CLI backend.
  *
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 %{
 %token <string> RANGE
 %token <string> MAC
 %token <string> MAC_PREFIX
+%token <string> ASNUM
 
 /* special syntax, value is irrelevant */
 %token <string> EXCL_BRACKET
@@ -293,6 +278,11 @@ placeholder_token_real:
   $$ = new_token_node (ctx, MAC_PREFIX_TKN, $1, doc_next(ctx));
   XFREE (MTYPE_LEX, $1);
 }
+| ASNUM
+{
+  $$ = new_token_node (ctx, ASNUM_TKN, $1, doc_next(ctx));
+  XFREE (MTYPE_LEX, $1);
+}
 
 placeholder_token:
   placeholder_token_real varname_token
index cce9542e303cce766ac5d589fd4c8889df8360a3..f8abcf8ef4013bcb507bdb39aae54b4faf1ab291 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * clippy (CLI preparator in python) wrapper for FRR command_graph
  * Copyright (C) 2016-2017  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* note: this wrapper is intended to be used as build-time helper.  while
@@ -214,6 +201,7 @@ static PyObject *graph_to_pyobj(struct wrap_graph *wgraph,
                        item(IPV6_PREFIX_TKN); // IPV6 network prefixes
                        item(MAC_TKN);         // MAC address
                        item(MAC_PREFIX_TKN);  // MAC address with mask
+                       item(ASNUM_TKN);       // ASNUM
 
                        /* plumbing types */
                        item(FORK_TKN);
index 514f0cee6ebd54799abde4911a84a8ae82ecc076..d12e2828326f1d914ad93b61697919591d047097 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-2017  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_COMPILER_H
index ef3e7c2fa1a94bf79019f6a42dba0bf83b378461..b92c9cb395de42e350e721cf50d514a94b887225 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Constraints Shortest Path First algorithms - cspf.c
  *
@@ -6,20 +7,6 @@
  * Copyright (C) 2022 Orange http://www.orange.com
  *
  * This file is part of Free Range Routing (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6466ddb25a69f4ca57198d1523c877faaf1990b1..3eceaa04af05302a9dffe6f6daa22dd298f0518c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Constraints Shortest Path First algorithms definition - cspf.h
  *
@@ -6,20 +7,6 @@
  * Copyright (C) 2022 Orange http://www.orange.com
  *
  * This file is part of Free Range Routing (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_CSPF_H_
index 05b9dbe39ee283b736ea050db9da3594cfe0caaa..fdd89a0c7a99d6d99d91e1312db8e2f55c5e6881 100644 (file)
--- a/lib/csv.c
+++ b/lib/csv.c
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* CSV
  * Copyright (C) 2013,2020  Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index fe3599d5db11d534cc12159994c6cfb82b164001..c780ab652f809cf7e9d85829a56ec151cca9f319 100644 (file)
--- a/lib/csv.h
+++ b/lib/csv.h
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* CSV
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __CSV_H__
index b4286b8d2cbfd1b7fb7d4333754908ad6425aead..55f29adfb535522384ed0881a9ffa7d778aedcb8 100644 (file)
--- a/lib/db.c
+++ b/lib/db.c
@@ -1,35 +1,10 @@
+// SPDX-License-Identifier: ISC AND GPL-2.0-or-later
 /*
  * Copyright (c) 2018 Rafael Zalamena <rzalamena@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * Copyright (c) 2016 Rafael Zalamena <rzalamena@gmail.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index c8ce7fe57d0dd92686a44ba336814eed19e7a069..887af0e1b6208f6caf1622fb6e7b972627465db1 100644 (file)
--- a/lib/db.h
+++ b/lib/db.h
@@ -1,35 +1,10 @@
+// SPDX-License-Identifier: ISC AND GPL-2.0-or-later
 /*
  * Copyright (c) 2018 Rafael Zalamena <rzalamena@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * Copyright (c) 2016 Rafael Zalamena <rzalamena@gmail.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_DB_H_
index e2ba4cd4ef118fb9e47f2016788b254da509f0b7..757a47ab99b37e3aa3f168ca050362bdf9c5acc0 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Debugging utilities.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "typesafe.h"
index a72657bdafaf78d020a72f0c817a3aa9a0178f34..e9d8a31abd2b7d8d1fd708b17ed01a07609f1668 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Debugging utilities.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _FRRDEBUG_H
 #define _FRRDEBUG_H
index fe099b6469e87e6fd5d3c69631afc1066f171f8a..04b5fd36f350b494e3ab8e3ecba24b654fb0f422 100644 (file)
@@ -1,18 +1,7 @@
+// SPDX-License-Identifier: ISC
 /*
  * FRR switchable defaults.
  * Copyright (c) 2017-2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 55250f0f81ac2b69e0e011d332d1c23d3ddfd85c..afb3223db3544759760d1366dc40eb27bb186eec 100644 (file)
@@ -1,18 +1,7 @@
+// SPDX-License-Identifier: ISC
 /*
  * FRR switchable defaults.
  * Copyright (C) 2017-2019  David Lamparter for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_DEFAULTS_H
index af506f13d6ec3b84a981a67a3f26cf24f56b13fc..505ea59b0b6183b9333559244e380d429fde77a3 100644 (file)
@@ -1,20 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * clippy (CLI preparator in python) C pseudo-lexer
  * Copyright (C) 2016-2017  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This is just enough of a lexer to make rough sense of a C source file.
index 0f503d2ab98e767041674e262eed4a6e6d7d731f..4cfdcc7840e0dd6c15f4b3aa11cc0d14159707e6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Distribute list functions
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6b3226e8b4b3a95b14afb52b2c9b37ae51a0032b..75783712a19993fee010210b385b57e1c259f7fd 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Distribute list functions header
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_DISTRIBUTE_H
index 7c503cfb9db39e30b2e006700622364d24ebd64a..05f5aef766fb4080fbc52d7e61d37103d49e824b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * fast ELF file accessor
  * Copyright (C) 2018-2020  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Note: this wrapper is intended to be used as build-time helper.  While
index 4e415262113f6ad19f0bff70c5ca21a50ea704f1..5998befec2e25d8e51d76d5a32dc6885b3c2e557 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 9accde1697aab60c189407480b201fcb1519b844..f0191dffbaa1d579fb9705b22fdea1f11fa598f0 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_FERR_H
index fc4b578e77986c55feaea2e4f6212a8537deeff0..f86adab5d606575eecdc67d9923a45d1e26feea0 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Route filtering function.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b378288c58bbba4b79c8d477ce026bd75d0c6ca4..e092f0771acc99939b50149505a0c61aa12819c3 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Route filtering function.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_FILTER_H
index 5accea3f02378fbd55f0106b71df02c8f0ad4873..7ef0d47f67bc016e104784d8e021b5c63a80550f 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR filter CLI implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include "zebra.h"
index cfe3105380ed41a125e2a679d28c741f732cb361..a14f232339db7719af12ebe9334d847898932068 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR filter northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include "zebra.h"
index 793cfff8d3d1b7b9121ede47708a88e10f35f1a2..d53df9c77b6e485b1d10f60eac64308260f8bd69 100644 (file)
@@ -1,31 +1,8 @@
+// SPDX-License-Identifier: BSD-3-Clause
 /*-
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  *     @(#)queue.h     8.5 (Berkeley) 8/20/94
  * $FreeBSD$
  */
index dd675bbb858b6fc3a5d49729aea9a9c6c6200a6e..0c617238fa1fa71d29297f95761f5651d46cf130 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Utilities and interfaces for managing POSIX threads within FRR.
  * Copyright (C) 2017  Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 89519abae0165402010a2a9a54d8ed006be746dc..b1d08717fbed236a73ca5bece52b143942642de7 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Utilities and interfaces for managing POSIX threads within FRR.
  * Copyright (C) 2017  Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PTHREAD_H
index db5c4c91a256b71fcfc2d2e42ffa14c250fc075a..2673d576052eeb2982edfa42f03bceef3a487d67 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libzebra ZeroMQ bindings
  * Copyright (C) 2015  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index b3be78cbea7c3129db11b742515025874b9fb961..f12291d60210f1030f63b2d2e6c98cec36922bf6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libzebra ZeroMQ bindings
  * Copyright (C) 2015  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRRZMQ_H
index bafc6445e5c6795d94c6efa4940e57094024785f..3a8905223bdd45a07ba04b4d32d07c77f3a7e88a 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRRATOMIC_H
index 0e717a98a5d98ad588f19b29e7c635368c758a75..c7cc655e09ceb9339cc5493e973234d2985de209 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* implementation notes:  this is an epoch-based RCU implementation.  rcu_seq
index ae840926b559c6064e4457c3f7c5d84db31bc5ae..e7a54dcbe5d441c2122f9c13106fd5624909cd47 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRRCU_H
index 535649eff2c35ff7656427697b4a4256fee99055..5b49d32a9cf47b70d7dbe6bdafb75380b671ab95 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This file defines the lua interface into
  * FRRouting.
  *
  * Copyright (C) 2016-2019 Cumulus Networks, Inc.
  * Donald Sharp, Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a82009a77985421583d6050abfb6895ead9b7456..bf6eb5fd913bb926f1334a90bc272d459d4be9c9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016-2019 Cumulus Networks, Inc.
  * Donald Sharp, Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __FRRLUA_H__
 #define __FRRLUA_H__
index 2e56932613261fe69e7245965f34ecf950978557..4248a45002926130020f5cb912357ac9dc6e0b7e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Scripting foo
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index afaab66f1b16d1ef2a68eb491269e5257c979144..7ba4f0cbdb03507ffb91483451e70fd0dcc0392c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Scripting foo
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __FRRSCRIPT_H__
 #define __FRRSCRIPT_H__
index d66c6f8c16f71ba049f7e074397b478e1cf4724e..e5440c509374abddef5c548bbfd79e23efaf4134 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR string processing utilities.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index f0066d0fc5e8564f77e68874d4d058d955226b96..19ba09e213190e874122327c63c0d6b1719d11a2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR string processing utilities.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRRSTR_H_
index a33d196015b43d820ad482018479783dff4c01fc..9d0a3113109788c3f018141f0bd8b7c6be0b4b30 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Getopt for GNU.
  * NOTE: getopt is now part of the C library, so if you don't know what
  * "Keep this file name-space clean" means, talk to drepper@gnu.org
@@ -8,20 +9,6 @@
  *
  * NOTE: The canonical source of this file is maintained with the GNU C Library.
  * Bugs can be reported to bug-glibc@gnu.org.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
index 63e12e947ee8317175b4bf2778a7fd28c3e4f88e..7863bdb66ae7dd415f4e6c51a84226f93a7031e7 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Declarations for getopt.
  * Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
  *
  * NOTE: The canonical source of this file is maintained with the GNU C Library.
  * Bugs can be reported to bug-glibc@gnu.org.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _GETOPT_H
index a7fe25307d997d4296302a22f06ee4f0086b368f..cf21c3aab473d66285512a5ef40c55c89017b66d 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* getopt_long and getopt_long_only entry points for GNU getopt.
  * Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
  * Free Software Foundation, Inc.
  *
  * NOTE: The canonical source of this file is maintained with the GNU C Library.
  * Bugs can be reported to bug-glibc@gnu.org.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8fa47c053bcfaaa7d82ea9590b59c2291c9bf5fd..fc7ebebbe55728f3d1811e7cb8bb1cfe3e6b296f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Testing shim and API examples for the new CLI backend.
  *
@@ -5,22 +6,6 @@
  * be used to test and interact with the new engine.
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
@@ -195,7 +180,7 @@ DEFUN (grammar_test_match,
                case MATCHER_AMBIGUOUS:
                        vty_out(vty, "%% Ambiguous command\n");
                        break;
-               default:
+               case MATCHER_OK:
                        vty_out(vty, "%% Unknown error\n");
                        break;
                }
index a7d6c51376adf9756f049385e278216a13357d82..cdb1c3adb449152e07c843e75064d6c3977d1a34 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Testing shim and API examples for the new CLI backend.
  *
@@ -6,21 +7,6 @@
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Copyright (C) 2017 David Lamparter for NetDEF, Inc.
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index ba7314fb25b11684553145fae07d51e6a31f0b9e..e6c2386d7537ed51356b66a2e38ea8f01edf2fb2 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Graph data structure.
  *
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "graph.h"
index 8e126e6be4ee1fab1350aa6bb58acb7abbabd391..bfdfe141e1e0cef38bebdd75cc49a3a1b6766e75 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Graph data structure.
  *
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_COMMAND_GRAPH_H
index 4b371b43abe40b35ffdc1bc3687e2f0863717f70..97a77a2b9a10789869ebb804a65323066098666b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Hash routine.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 91770d181348bbc39dfcaffa4d6638b4314768ad..f32309d8047677217297d1d765df842f4907abfa 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Hash routine.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_HASH_H
index 895243aad7265239815b17b619160dd79e97e5cd..1457df8158d7f7e1e5e399a80aad4802e85c53cb 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index d75e623edc37f913b436e5d2946dba81d224795d..19e0f1fbfce784b7162f814556da268af6aafd82 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_HOOK_H
index 56e8a24b86f119c26cb6d27dbb436fe6dc4a224b..b9c19cc3d5496700e72c81776812fd5a00d03e7e 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * iana_afi and safi definitions.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __IANA_AFI_H__
 
@@ -61,9 +48,11 @@ static inline afi_t afi_iana2int(iana_afi_t afi)
                return AFI_IP6;
        case IANA_AFI_L2VPN:
                return AFI_L2VPN;
-       default:
+       case IANA_AFI_RESERVED:
                return AFI_MAX;
        }
+
+       return AFI_MAX;
 }
 
 static inline iana_afi_t afi_int2iana(afi_t afi)
@@ -75,9 +64,12 @@ static inline iana_afi_t afi_int2iana(afi_t afi)
                return IANA_AFI_IPV6;
        case AFI_L2VPN:
                return IANA_AFI_L2VPN;
-       default:
+       case AFI_UNSPEC:
+       case AFI_MAX:
                return IANA_AFI_RESERVED;
        }
+
+       return IANA_AFI_RESERVED;
 }
 
 static inline const char *iana_afi2str(iana_afi_t afi)
@@ -102,9 +94,11 @@ static inline safi_t safi_iana2int(iana_safi_t safi)
                return SAFI_LABELED_UNICAST;
        case IANA_SAFI_FLOWSPEC:
                return SAFI_FLOWSPEC;
-       default:
+       case IANA_SAFI_RESERVED:
                return SAFI_MAX;
        }
+
+       return SAFI_MAX;
 }
 
 static inline iana_safi_t safi_int2iana(safi_t safi)
@@ -124,9 +118,12 @@ static inline iana_safi_t safi_int2iana(safi_t safi)
                return IANA_SAFI_LABELED_UNICAST;
        case SAFI_FLOWSPEC:
                return IANA_SAFI_FLOWSPEC;
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_MAX:
                return IANA_SAFI_RESERVED;
        }
+
+       return IANA_SAFI_RESERVED;
 }
 
 static inline const char *iana_safi2str(iana_safi_t safi)
index 9179dc4299428da8e0173a01e800d44b54b3f04b..477f6e351b53214f29957ec7103dbceec1a4c537 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR ID Number Allocator
  * Copyright (C) 2018  Amazon.com, Inc. or its affiliates
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 8705ffb37df68a67271151fb6f0d314a357b6ab3..8a1255ffd46efdefdb5c0b1332451fb46244b3e1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR ID Number Allocator
  * Copyright (C) 2018  Amazon.com, Inc. or its affiliates
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ID_ALLOC_H
index b75c2a4dbe5578e795396ccb921765244edf15bc..08d89187427319b7ac525f36a43c0e5ee7916f92 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface functions.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -35,6 +20,7 @@
 #include "buffer.h"
 #include "log.h"
 #include "northbound_cli.h"
+#include "admin_group.h"
 #include "lib/if_clippy.c"
 
 DEFINE_MTYPE_STATIC(LIB, IF, "Interface");
@@ -1106,6 +1092,45 @@ const char *if_link_type_str(enum zebra_link_type llt)
        return NULL;
 }
 
+bool if_link_params_cmp(struct if_link_params *iflp1,
+                       struct if_link_params *iflp2)
+{
+       struct if_link_params iflp1_copy, iflp2_copy;
+
+       /* Extended admin-groups in if_link_params contain pointers.
+        * They cannot be compared with memcpy.
+        * Make copies of if_link_params without ext. admin-groups
+        * and compare separately the ext. admin-groups.
+        */
+       memcpy(&iflp1_copy, iflp1, sizeof(struct if_link_params));
+       memset(&iflp1_copy.ext_admin_grp, 0, sizeof(struct admin_group));
+
+       memcpy(&iflp2_copy, iflp2, sizeof(struct if_link_params));
+       memset(&iflp2_copy.ext_admin_grp, 0, sizeof(struct admin_group));
+
+       if (memcmp(&iflp1_copy, &iflp2_copy, sizeof(struct if_link_params)))
+               return false;
+
+       if (!admin_group_cmp(&iflp1->ext_admin_grp, &iflp2->ext_admin_grp))
+               return false;
+
+       return true;
+}
+
+void if_link_params_copy(struct if_link_params *dst, struct if_link_params *src)
+{
+       struct admin_group dst_ag;
+
+       /* backup the admin_group structure that contains a pointer */
+       memcpy(&dst_ag, &dst->ext_admin_grp, sizeof(struct admin_group));
+       /* copy the if_link_params structure */
+       memcpy(dst, src, sizeof(struct if_link_params));
+       /* restore the admin_group structure */
+       memcpy(&dst->ext_admin_grp, &dst_ag, sizeof(struct admin_group));
+       /* copy src->ext_admin_grp data to dst->ext_admin_grp data memory */
+       admin_group_copy(&dst->ext_admin_grp, &src->ext_admin_grp);
+}
+
 struct if_link_params *if_link_params_get(struct interface *ifp)
 {
        return ifp->link_params;
@@ -1153,6 +1178,8 @@ struct if_link_params *if_link_params_init(struct interface *ifp)
 
        iflp = XCALLOC(MTYPE_IF_LINK_PARAMS, sizeof(struct if_link_params));
 
+       admin_group_init(&iflp->ext_admin_grp);
+
        ifp->link_params = iflp;
 
        return iflp;
@@ -1160,6 +1187,10 @@ struct if_link_params *if_link_params_init(struct interface *ifp)
 
 void if_link_params_free(struct interface *ifp)
 {
+       if (!ifp->link_params)
+               return;
+
+       admin_group_term(&ifp->link_params->ext_admin_grp);
        XFREE(MTYPE_IF_LINK_PARAMS, ifp->link_params);
 }
 
index a653246ccb2ee61d1df3202c6eb5e2e40061ce76..c6b4fd216a371252c9391c0bccab48d17c9d7373 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Interface related header.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_IF_H
@@ -26,6 +11,7 @@
 #include "memory.h"
 #include "qobj.h"
 #include "hook.h"
+#include "admin_group.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -140,7 +126,7 @@ struct if_stats {
 #endif /* HAVE_PROC_NET_DEV */
 
 /* Here are "non-official" architectural constants. */
-#define TE_EXT_MASK             0x0FFFFFFF
+#define TE_EXT_MASK             0x00FFFFFF
 #define TE_EXT_ANORMAL          0x80000000
 #define LOSS_PRECISION          0.000003
 /* TE_MEGA_BIT and TE_BYTE are utilized to convert TE bandwidth */
@@ -153,6 +139,15 @@ struct if_stats {
 #define MAX_CLASS_TYPE          8
 #define MAX_PKT_LOSS            50.331642
 
+enum affinity_mode {
+       /* RFC7308 Extended Administrative group */
+       AFFINITY_MODE_EXTENDED = 0,
+       /* RFC3630/RFC5305/RFC5329 Administrative group */
+       AFFINITY_MODE_STANDARD = 1,
+       /* Standard and Extended Administrative group */
+       AFFINITY_MODE_BOTH = 2,
+};
+
 /*
  * Link Parameters Status:
  *  equal to 0: unset
@@ -172,6 +167,7 @@ struct if_stats {
 #define LP_RES_BW               0x0400
 #define LP_AVA_BW               0x0800
 #define LP_USE_BW               0x1000
+#define LP_EXTEND_ADM_GRP 0x2000
 
 #define IS_PARAM_UNSET(lp, st) !(lp->lp_status & st)
 #define IS_PARAM_SET(lp, st) (lp->lp_status & st)
@@ -181,7 +177,10 @@ struct if_stats {
 #define UNSET_PARAM(lp, st) (lp->lp_status) &= ~(st)
 #define RESET_LINK_PARAM(lp) (lp->lp_status = LP_UNSET)
 
-/* Link Parameters for Traffic Engineering */
+/* Link Parameters for Traffic Engineering
+ * Do not forget to update if_link_params_copy()
+ * and if_link_params_cmp() when updating the structure
+ */
 struct if_link_params {
        uint32_t lp_status; /* Status of Link Parameters: */
        uint32_t te_metric; /* Traffic Engineering metric */
@@ -190,7 +189,8 @@ struct if_link_params {
        float max_rsv_bw;               /* Maximum Reservable Bandwidth */
        float unrsv_bw[MAX_CLASS_TYPE]; /* Unreserved Bandwidth per Class Type
                                           (8) */
-       uint32_t admin_grp;             /* Administrative group */
+       uint32_t admin_grp; /* RFC5305/RFC5329 Administrative group */
+       struct admin_group ext_admin_grp; /* RFC7308 Extended Admin group */
        uint32_t rmt_as;                /* Remote AS number */
        struct in_addr rmt_ip;          /* Remote IP address */
        uint32_t av_delay;              /* Link Average Delay */
@@ -592,6 +592,10 @@ struct nbr_connected *nbr_connected_check(struct interface *, struct prefix *);
 struct connected *connected_get_linklocal(struct interface *ifp);
 
 /* link parameters */
+bool if_link_params_cmp(struct if_link_params *iflp1,
+                       struct if_link_params *iflp2);
+void if_link_params_copy(struct if_link_params *dst,
+                        struct if_link_params *src);
 struct if_link_params *if_link_params_get(struct interface *);
 struct if_link_params *if_link_params_enable(struct interface *ifp);
 struct if_link_params *if_link_params_init(struct interface *ifp);
index 8282e476dfac191bd5d0dd0ef10518f5d18d54a2..fa8899e9f87ef1ba319289af15b81bfd7e673f1a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* route-map for interface.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dfc7298823a90fb9fce10fd6ef5021d829d64692..3bdbc2a3b2cd1b7282ec93c2fbd005f96de7a7d1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* route-map for interface.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_IF_RMAP_H
index 4d41702707cdba56cd07dd5650d719d5ed84396a..4f041ff66ef09712218af4e9447fe719511df61d 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$       */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index b46d5cbc24586f6ffc7763dc4bf8e844f4f49ffe..057e4b3c346f6b729d751ecb77fdf0b5a16b0a69 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$       */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 3f81b76bea084e2c05aac7d972471e3bdcdf3156..4651eeea96e3c13ebc4327160e425f18591b1022 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$       */
 
 /*
  * Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
  * Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _IMSG_H_
index 43b3028200c7e9c71d0a81497833b2cac61a7d61..e3ad14d7dbff8e7f3ebe4b99f26fdfa3cf81c2de 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP address structure (for generic IPv4 or IPv6 address)
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef __IPADDR_H__
@@ -70,9 +54,11 @@ static inline int ipaddr_family(const struct ipaddr *ip)
                return AF_INET;
        case IPADDR_V6:
                return AF_INET6;
-       default:
+       case IPADDR_NONE:
                return AF_UNSPEC;
        }
+
+       assert(!"Reached end of function where we should never hit");
 }
 
 static inline int str2ipaddr(const char *str, struct ipaddr *ip)
@@ -158,9 +144,11 @@ static inline int ipaddr_cmp(const struct ipaddr *a, const struct ipaddr *b)
        case IPADDR_V6:
                return memcmp((void *)&a->ipaddr_v6, (void *)&b->ipaddr_v6,
                              sizeof(a->ipaddr_v6));
-       default:
+       case IPADDR_NONE:
                return 0;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static inline bool ipaddr_is_zero(const struct ipaddr *ip)
index d85a21215c4c96679d1a375f5f9dfdafd3ad4acd..66312dbc8ddcb4e230c5532a96f13b416859332e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* json-c wrapper
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 78c38365151b4baf4716a8404d1913758753a619..4763803acd2461f6d3d0640eb3b290b9f86cb73d 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* json-c wrapper
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_JSON_H
index 5dcb572a3c4ae35dd4de21e8f72659714ec2bff8..640746bb419487b24ee9f00d13e36ff516c7948f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* key-chain for authentication.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "config.h"
index 71319d97227cc27a141288e5335acb352f40b6ef..be93275a5d23797786fd53c26df29c688e9bbd8b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* key-chain for authentication.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_KEYCHAIN_H
index 8912d15589f2c330b4fc8fb0beddc7934e70c5e9..b01cf87287d26b8bfb80562c05d5c691a47c2404 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ldp_sync.c: LDP-SYNC handling routines
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0429e17d5c49307c5db3850054bf0559dddada72..5b6ebbf887a6b839d53887b7aca49b130d379f83 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Defines and structures common to LDP-Sync for OSPFv2 and OSPFv3 and ISIS
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LIBLDPSYNC_H
index a658e4c29514308ea8c034cb41c6ca56c564f0d9..a96fac9cd46194a5d96a5f4dd146a098bd915b9d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Library-specific error messages.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 91f206f74a4e21d02177b1834f7b953ad0ecb959..8cdfb166c70699efe6f066c02fe8a07883a093f9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Library-specific error messages.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __LIB_ERRORS_H__
index 46a0a681031ee1b83db17c1a4e58151d97ed96ca..2c8f2e90473d3ac83039a91aa74d21a75dfdae78 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Assorted library VTY commands
  *
  * Copyright (C) 1998 Kunihiro Ishiguro
  * Copyright (C) 2016-2017  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 48e409ec52d7b6010f453fec9194957414351d90..47673322a4471cde2450f845fe99e117378fc460 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Memory management routine
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_LIB_VTY_H
index 2cab6d9824d14cf7186802ee1a6cef06b8420a32..0467dc1d7e211fbe8c9f97d96ce70586d4c0db63 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libfrr overall management functions
  *
  * Copyright (C) 2016  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 69054e4264d20d2b1555366368c48256830602ff..97e9b93c101e45f776111432a237235a542967a2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libfrr overall management functions
  *
  * Copyright (C) 2016  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_FRR_H
index 7215007ffb712590762a240bf9c7550c60022caa..92c469706a5c15396b206a52c7c1731448b0296e 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Tracing
  *
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #if !defined(_LIBFRR_TRACE_H_) || defined(TRACEPOINT_HEADER_MULTI_READ)
index 161c7635d8816b2e3cbb8bd4352910906487ce2d..3262534de59ea5e4e644fa5472a089507596cb38 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Defines and structures common to OSPFv2 and OSPFv3
  * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LIBOSPFD_H
index 1b79c792164ebc6de2bd9185158d0aa9946e46ed..589c0ae704c4c38147a171a0db5e850b04919790 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Link State Database - link_state.c
  *
@@ -6,20 +7,6 @@
  * Copyright (C) 2020 Orange http://www.orange.com
  *
  * This file is part of Free Range Routing (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -192,6 +179,8 @@ struct ls_attributes *ls_attributes_new(struct ls_node_id adv,
                return NULL;
        }
 
+       admin_group_init(&new->ext_admin_group);
+
        return new;
 }
 
@@ -215,6 +204,8 @@ void ls_attributes_del(struct ls_attributes *attr)
 
        ls_attributes_srlg_del(attr);
 
+       admin_group_term(&attr->ext_admin_group);
+
        XFREE(MTYPE_LS_DB, attr);
 }
 
@@ -246,6 +237,9 @@ int ls_attributes_same(struct ls_attributes *l1, struct ls_attributes *l2)
        if (CHECK_FLAG(l1->flags, LS_ATTR_ADM_GRP)
            && (l1->standard.admin_group != l2->standard.admin_group))
                return 0;
+       if (CHECK_FLAG(l1->flags, LS_ATTR_EXT_ADM_GRP) &&
+           !admin_group_cmp(&l1->ext_admin_group, &l2->ext_admin_group))
+               return 0;
        if (CHECK_FLAG(l1->flags, LS_ATTR_LOCAL_ADDR)
            && !IPV4_ADDR_SAME(&l1->standard.local, &l2->standard.local))
                return 0;
@@ -443,7 +437,7 @@ struct ls_vertex *ls_vertex_add(struct ls_ted *ted, struct ls_node *node)
        case ISIS_L2:
                key = sysid_to_key(node->adv.id.iso.sys_id);
                break;
-       default:
+       case UNKNOWN:
                key = 0;
                break;
        }
@@ -565,7 +559,7 @@ struct ls_vertex *ls_find_vertex_by_id(struct ls_ted *ted,
        case ISIS_L2:
                vertex.key = sysid_to_key(nid.id.iso.sys_id);
                break;
-       default:
+       case UNKNOWN:
                return NULL;
        }
 
@@ -1206,9 +1200,12 @@ stream_failure:
 static struct ls_attributes *ls_parse_attributes(struct stream *s)
 {
        struct ls_attributes *attr;
+       uint8_t nb_ext_adm_grp;
+       uint32_t bitmap_data;
        size_t len;
 
        attr = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_attributes));
+       admin_group_init(&attr->ext_admin_group);
        attr->srlgs = NULL;
 
        STREAM_GET(&attr->adv, s, sizeof(struct ls_node_id));
@@ -1223,6 +1220,15 @@ static struct ls_attributes *ls_parse_attributes(struct stream *s)
                STREAM_GETL(s, attr->standard.te_metric);
        if (CHECK_FLAG(attr->flags, LS_ATTR_ADM_GRP))
                STREAM_GETL(s, attr->standard.admin_group);
+       if (CHECK_FLAG(attr->flags, LS_ATTR_EXT_ADM_GRP)) {
+               /* Extended Administrative Group */
+               STREAM_GETC(s, nb_ext_adm_grp);
+               for (size_t i = 0; i < nb_ext_adm_grp; i++) {
+                       STREAM_GETL(s, bitmap_data);
+                       admin_group_bulk_set(&attr->ext_admin_group,
+                                            bitmap_data, i);
+               }
+       }
        if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR))
                attr->standard.local.s_addr = stream_get_ipv4(s);
        if (CHECK_FLAG(attr->flags, LS_ATTR_NEIGH_ADDR))
@@ -1430,7 +1436,7 @@ static int ls_format_node(struct stream *s, struct ls_node *node)
 
 static int ls_format_attributes(struct stream *s, struct ls_attributes *attr)
 {
-       size_t len;
+       size_t len, nb_ext_adm_grp;
 
        /* Push Advertise node information first */
        stream_put(s, &attr->adv, sizeof(struct ls_node_id));
@@ -1449,6 +1455,14 @@ static int ls_format_attributes(struct stream *s, struct ls_attributes *attr)
                stream_putl(s, attr->standard.te_metric);
        if (CHECK_FLAG(attr->flags, LS_ATTR_ADM_GRP))
                stream_putl(s, attr->standard.admin_group);
+       if (CHECK_FLAG(attr->flags, LS_ATTR_EXT_ADM_GRP)) {
+               /* Extended Administrative Group */
+               nb_ext_adm_grp = admin_group_nb_words(&attr->ext_admin_group);
+               stream_putc(s, nb_ext_adm_grp);
+               for (size_t i = 0; i < nb_ext_adm_grp; i++)
+                       stream_putl(s, admin_group_get_offset(
+                                              &attr->ext_admin_group, i));
+       }
        if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR))
                stream_put_ipv4(s, attr->standard.local.s_addr);
        if (CHECK_FLAG(attr->flags, LS_ATTR_NEIGH_ADDR))
@@ -1649,7 +1663,8 @@ struct ls_message *ls_vertex2msg(struct ls_message *msg,
        case SYNC:
                msg->event = LS_MSG_EVENT_SYNC;
                break;
-       default:
+       case UNSET:
+       case ORPHAN:
                msg->event = LS_MSG_EVENT_UNDEF;
                break;
        }
@@ -1681,7 +1696,8 @@ struct ls_message *ls_edge2msg(struct ls_message *msg, struct ls_edge *edge)
        case SYNC:
                msg->event = LS_MSG_EVENT_SYNC;
                break;
-       default:
+       case UNSET:
+       case ORPHAN:
                msg->event = LS_MSG_EVENT_UNDEF;
                break;
        }
@@ -1717,7 +1733,8 @@ struct ls_message *ls_subnet2msg(struct ls_message *msg,
        case SYNC:
                msg->event = LS_MSG_EVENT_SYNC;
                break;
-       default:
+       case UNSET:
+       case ORPHAN:
                msg->event = LS_MSG_EVENT_UNDEF;
                break;
        }
@@ -2163,9 +2180,11 @@ void ls_show_vertices(struct ls_ted *ted, struct vty *vty,
 static void ls_show_edge_vty(struct ls_edge *edge, struct vty *vty,
                             bool verbose)
 {
+       char admin_group_buf[ADMIN_GROUP_PRINT_MAX_SIZE];
        struct ls_attributes *attr;
        struct sbuf sbuf;
        char buf[INET6_BUFSIZ];
+       int indent;
 
        attr = edge->attributes;
        sbuf_init(&sbuf, NULL, 0);
@@ -2195,6 +2214,20 @@ static void ls_show_edge_vty(struct ls_edge *edge, struct vty *vty,
        if (CHECK_FLAG(attr->flags, LS_ATTR_ADM_GRP))
                sbuf_push(&sbuf, 4, "Admin Group: 0x%x\n",
                          attr->standard.admin_group);
+       if (CHECK_FLAG(attr->flags, LS_ATTR_EXT_ADM_GRP) &&
+           admin_group_nb_words(&attr->ext_admin_group) != 0) {
+               indent = 4;
+               sbuf_push(&sbuf, indent, "Ext Admin Group: %s\n",
+                         admin_group_string(
+                                 admin_group_buf, ADMIN_GROUP_PRINT_MAX_SIZE,
+                                 indent + strlen("Ext Admin Group: "),
+                                 &attr->ext_admin_group));
+               if (admin_group_buf[0] != '\0' &&
+                   (sbuf.pos + strlen(admin_group_buf) +
+                    SBUF_DEFAULT_SIZE / 2) < sbuf.size)
+                       sbuf_push(&sbuf, indent + 2, "Bit positions: %s\n",
+                                 admin_group_buf);
+       }
        if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR))
                sbuf_push(&sbuf, 4, "Local IPv4 address: %pI4\n",
                          &attr->standard.local);
@@ -2305,8 +2338,13 @@ end:
 static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
 {
        struct ls_attributes *attr;
-       struct json_object *jte, *jbw, *jobj, *jsr = NULL, *jsrlg;
+       struct json_object *jte, *jbw, *jobj, *jsr = NULL, *jsrlg, *js_ext_ag,
+                                             *js_ext_ag_arr_word,
+                                             *js_ext_ag_arr_bit;
        char buf[INET6_BUFSIZ];
+       char buf_ag[strlen("0xffffffff") + 1];
+       uint32_t bitmap;
+       size_t i;
 
        attr = edge->attributes;
 
@@ -2330,6 +2368,30 @@ static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
        if (CHECK_FLAG(attr->flags, LS_ATTR_ADM_GRP))
                json_object_int_add(jte, "admin-group",
                                    attr->standard.admin_group);
+       if (CHECK_FLAG(attr->flags, LS_ATTR_EXT_ADM_GRP)) {
+               js_ext_ag = json_object_new_object();
+               json_object_object_add(jte, "extAdminGroup", js_ext_ag);
+               js_ext_ag_arr_word = json_object_new_array();
+               json_object_object_add(js_ext_ag, "words", js_ext_ag_arr_word);
+               js_ext_ag_arr_bit = json_object_new_array();
+               json_object_object_add(js_ext_ag, "bitPositions",
+                                      js_ext_ag_arr_bit);
+               for (i = 0; i < admin_group_nb_words(&attr->ext_admin_group);
+                    i++) {
+                       bitmap = admin_group_get_offset(&attr->ext_admin_group,
+                                                       i);
+                       snprintf(buf_ag, sizeof(buf_ag), "0x%08x", bitmap);
+                       json_object_array_add(js_ext_ag_arr_word,
+                                             json_object_new_string(buf_ag));
+               }
+               for (i = 0;
+                    i < (admin_group_size(&attr->ext_admin_group) * WORD_SIZE);
+                    i++) {
+                       if (admin_group_get(&attr->ext_admin_group, i))
+                               json_object_array_add(js_ext_ag_arr_bit,
+                                                     json_object_new_int(i));
+               }
+       }
        if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR)) {
                snprintfrr(buf, INET6_BUFSIZ, "%pI4", &attr->standard.local);
                json_object_string_add(jte, "local-address", buf);
index ed315452da6d9193365259488b26e383ca65e1ac..e6a6388ba41334b8f38afade0f19259750a6d603 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Link State Database definition - ted.h
  *
@@ -6,25 +7,12 @@
  * Copyright (C) 2020 Orange http://www.orange.com
  *
  * This file is part of Free Range Routing (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_LINK_STATE_H_
 #define _FRR_LINK_STATE_H_
 
+#include "admin_group.h"
 #include "typesafe.h"
 
 #ifdef __cplusplus
@@ -169,6 +157,7 @@ struct ls_node {
 #define LS_ATTR_ADJ_SID6       0x04000000
 #define LS_ATTR_BCK_ADJ_SID6   0x08000000
 #define LS_ATTR_SRLG           0x10000000
+#define LS_ATTR_EXT_ADM_GRP 0x20000000
 
 /* Link State Attributes */
 struct ls_attributes {
@@ -202,6 +191,7 @@ struct ls_attributes {
                float rsv_bw;           /* Reserved Bandwidth */
                float used_bw;          /* Utilized Bandwidth */
        } extended;
+       struct admin_group ext_admin_group; /* Extended Admin. Group */
 #define ADJ_PRI_IPV4   0
 #define ADJ_BCK_IPV4   1
 #define ADJ_PRI_IPV6   2
index d2a29b7ed1bc9e783a4cd0fdf1956e8392749d1d..28dd777b82022d6add7cf85aa8e815c031586833 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Generic linked list routine.
  * Copyright (C) 1997, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index e7594728f149c94420ed40daaa182f451c29dd9d..fd953d0769b846d75ddcc140d990d5f1e6cc0b1d 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Generic linked list
  * Copyright (C) 1997, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_LINKLIST_H
index 156982635dbf810520f81b96f0a8d112c477c569..b1a06bfb26bb0cf29570be065279663774fa5e13 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Logging of zebra
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define FRR_DEFINE_DESC_TABLE
index 3011fa9a994187db7ef797ee9247bd5bfc449dd3..b8452ac215a8cb449e96ff9d9459faac683fb7bc 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra logging funcions.
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_LOG_H
@@ -129,6 +114,21 @@ extern int proto_redistnum(int afi, const char *s);
 
 extern const char *zserv_command_string(unsigned int command);
 
+#define OSPF_LOG(level, cond, fmt, ...)                                        \
+       do {                                                                   \
+               if (cond)                                                      \
+                       zlog_##level(fmt, ##__VA_ARGS__);                      \
+       } while (0)
+
+#define OSPF_LOG_ERR(fmt, ...) OSPF_LOG(err, true, fmt, ##__VA_ARGS__)
+
+#define OSPF_LOG_WARN(fmt, ...) OSPF_LOG(warn, true, fmt, ##__VA_ARGS__)
+
+#define OSPF_LOG_INFO(fmt, ...) OSPF_LOG(info, true, fmt, ##__VA_ARGS__)
+
+#define OSPF_LOG_DEBUG(cond, fmt, ...) OSPF_LOG(debug, cond, fmt, ##__VA_ARGS__)
+
+#define OSPF_LOG_NOTICE(fmt, ...) OSPF_LOG(notice, true, fmt, ##__VA_ARGS__)
 
 /* structure useful for avoiding repeated rendering of the same timestamp */
 struct timestamp_control {
index df74a8c9badcb1d87891a72c0c778a2f69411c5e..e8d99d79254d67f0a551a6a306fd0efe8f0662e7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Logging - Filtered file log target
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Stephen Worley
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4091c92c7322dbd65d90e44478cc875dbc450daa..fc28ffc6faf4c695806d1ceff315b555d3dc1bb2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Logging - VTY code
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Stephen Worley
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index db46b3cb5b22b0bf48e75c260ce7f11bdf15d1af..8450cd0ef2c89322a6c63722ac545f31f1a6a541 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Logging - VTY library
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Stephen Worley
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __LOG_VTY_H__
index 20da6488c465415de8d8b593c2a87f60d3be5e30..a62d937a3e02f9a1511b42814448849e404e85eb 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-3-Clause
 /*
  * Copyright (C) 2004 6WIND
  *                          <Vincent.Jardin@6WIND.com>
@@ -9,30 +10,6 @@
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
  */
 
 #include <zebra.h>
index 691a294333599bd45cc79e462e41a2e7d4010dbb..b22da4735f51468ea909d1a787ab89b2660edfb0 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-3-Clause
 /*
  * Copyright (C) 2004 6WIND
  *                          <Vincent.Jardin@6WIND.com>
@@ -9,30 +10,6 @@
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
  */
 
 #ifndef _LIBZEBRA_MD5_H_
index 18811777ae40b4aa8fd05b3b836b9ff4c95eadcf..8fbe5c4093660aa50add589b1de92bd20f3e4c8d 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index c95602f4853842888afdd45a74a631f5d42b21d7..ba437ebd0ed92ffe422ae278cb1fc4539e9a87db 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _QUAGGA_MEMORY_H
index 653fbe8fe91a1de95ab84b23f84f5683fc8348b8..a370bf8924a2f0676b9703e292b0e588302afbfb 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* mlag generic code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
@@ -73,7 +57,10 @@ char *mlag_lib_msgid_to_str(enum mlag_msg_type msg_type, char *buf, size_t size)
        case MLAG_PEER_FRR_STATUS:
                snprintf(buf, size, "Mlag Peer FRR Status");
                break;
-       default:
+       case MLAG_PIM_CFG_DUMP:
+               snprintf(buf, size, "Mlag Pim Configuration Dump");
+               break;
+       case MLAG_MSG_NONE:
                snprintf(buf, size, "Unknown %d", msg_type);
                break;
        }
index 37bb3aa6db2b13552aa4796c9ca55909d0d034eb..3aef0d77a8f47ab7d9200cef2f95b5d6d10a14aa 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* mlag header.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __MLAG_H__
 #define __MLAG_H__
index 4037bfbeb0202edc6d1661dadc5d03aee1c2b13a..af7d20c3da392cbd85413ce66a0448fbb8669096 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include "config.h"
index ae1ca2f7579fb30eceb56ea3a208232ad06fd278..cd2be474e7f437ca7ca5def05095efda187a4503 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_MODULE_H
index 89616c54278e35655cbf7fb95d21712671ec1ac1..f7ae1bbbe1a95a92cf0b07e0e1799e6925ee039c 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_MONOTIME_H
index ac5792a6864c8b1852be5c79596c81b4decf4148..8c656f78fffb29d2d95803697c848f888acce9d4 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * mpls functions
  *
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <mpls.h>
@@ -80,7 +67,7 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels,
  * Label to string conversion, labels in string separated by '/'.
  */
 char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf,
-                    int len, int pretty)
+                    int len, enum lsp_types_t type, int pretty)
 {
        char label_buf[BUFSIZ];
        int i;
@@ -90,9 +77,14 @@ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf,
                if (i != 0)
                        strlcat(buf, "/", len);
                if (pretty)
-                       label2str(labels[i], label_buf, sizeof(label_buf));
+                       label2str(labels[i], type, label_buf,
+                                 sizeof(label_buf));
                else
-                       snprintf(label_buf, sizeof(label_buf), "%u", labels[i]);
+                       snprintf(label_buf, sizeof(label_buf), "%u",
+                                ((type == ZEBRA_LSP_EVPN)
+                                         ? label2vni(&labels[i])
+                                         : labels[i]));
+
                strlcat(buf, label_buf, len);
        }
 
index 74bd7aae3e159a3e8e6182548e84247b35da8e03..dc7f912c289311106ee00113ee1eca58695994a5 100644 (file)
@@ -1,28 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * MPLS definitions
  * Copyright 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_MPLS_H
 #define _QUAGGA_MPLS_H
 
 #include <zebra.h>
+#include <vxlan.h>
 #include <arpa/inet.h>
 
 #ifdef __cplusplus
@@ -129,10 +115,36 @@ enum lsp_types_t {
        ZEBRA_LSP_ISIS_SR = 5,/* IS-IS Segment Routing LSP. */
        ZEBRA_LSP_SHARP = 6,  /* Identifier for test protocol */
        ZEBRA_LSP_SRTE = 7,   /* SR-TE LSP */
+       ZEBRA_LSP_EVPN = 8,  /* EVPN VNI Label */
 };
 
 /* Functions for basic label operations. */
 
+static inline void vni2label(vni_t vni, mpls_label_t *label)
+{
+       uint8_t *tag = (uint8_t *)label;
+
+       assert(tag);
+
+       tag[0] = (vni >> 16) & 0xFF;
+       tag[1] = (vni >> 8) & 0xFF;
+       tag[2] = vni & 0xFF;
+}
+
+static inline vni_t label2vni(const mpls_label_t *label)
+{
+       uint8_t *tag = (uint8_t *)label;
+       vni_t vni;
+
+       assert(tag);
+
+       vni = ((uint32_t)*tag++ << 16);
+       vni |= (uint32_t)*tag++ << 8;
+       vni |= (uint32_t)(*tag & 0xFF);
+
+       return vni;
+}
+
 /* Encode a label stack entry from fields; convert to network byte-order as
  * the Netlink interface expects MPLS labels to be in this format.
  */
@@ -168,8 +180,14 @@ static inline void mpls_lse_decode(mpls_lse_t lse, mpls_label_t *label,
 #define MPLS_INVALID_LABEL_INDEX   0xFFFFFFFF
 
 /* Printable string for labels (with consideration for reserved values). */
-static inline char *label2str(mpls_label_t label, char *buf, size_t len)
+static inline char *label2str(mpls_label_t label, enum lsp_types_t type,
+                             char *buf, size_t len)
 {
+       if (type == ZEBRA_LSP_EVPN) {
+               snprintf(buf, len, "%u", label2vni(&label));
+               return (buf);
+       }
+
        switch (label) {
        case MPLS_LABEL_IPV4_EXPLICIT_NULL:
                strlcpy(buf, "IPv4 Explicit Null", len);
@@ -200,7 +218,7 @@ static inline char *label2str(mpls_label_t label, char *buf, size_t len)
                        snprintf(buf, len, "Reserved (%u)", label);
                else
                        snprintf(buf, len, "%u", label);
-               return (buf);
+               return buf;
        }
 }
 
@@ -217,7 +235,7 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels,
  * Label to string conversion, labels in string separated by '/'.
  */
 char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf,
-                    int len, int pretty);
+                    int len, enum lsp_types_t type, int pretty);
 
 #ifdef __cplusplus
 }
index 43c0d8c3595e2c45b4d05379183e4aa4d6e9d8a6..297e2c5952dfd1124720778d52d1d9b4423597bc 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * NS functions.
  * Copyright (C) 2014 6WIND S.A.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b6570d3b9e58627576d254f8b7f3941f6298634f..30218409dd8bc047e1f6c625d5595a3d4d09ef82 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * NetNS backend for non Linux systems
  * Copyright (C) 2018 6WIND S.A.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index cd62b8b5930b35fe80397428a11b8cfbb09dba66..af1c7db443e90cf5cb179e2a4ee461e409d8da7b 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Network library.
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c163eab8f76e0f3b32142976212b95e070c6a499..3a0e8718b66f3b13363dff0042d64fd5b8670b01 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Network library header.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_NETWORK_H
index 248acd270078d1594ae615864c6786f9fb6f99f0..b04c95c05e114d34b5f0ce09574c1c05f5bba4d6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* A generic nexthop structure
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index f1309aa525beeb69470570ac697b48601c41fd2b..1d95a3eee9b869c24548501291fa1fc35ef9bf6f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop structure definition.
  * Copyright (C) 1997, 98, 99, 2001 Kunihiro Ishiguro
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LIB_NEXTHOP_H
index 41fe64606bfd217d93dabc3ebf4394d855e3bdea..0613fc6736ade0d0b43e8d99fd171c1c79653f4f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop Group structure definition.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -41,6 +28,7 @@ struct nexthop_hold {
        char *intf;
        bool onlink;
        char *labels;
+       vni_t vni;
        uint32_t weight;
        char *backup_str;
 };
@@ -131,6 +119,18 @@ nexthop_group_active_nexthop_num_no_recurse(const struct nexthop_group *nhg)
        return num;
 }
 
+bool nexthop_group_has_label(const struct nexthop_group *nhg)
+{
+       struct nexthop *nhop;
+
+       for (ALL_NEXTHOPS_PTR(nhg, nhop)) {
+               if (nhop->nh_label)
+                       return true;
+       }
+
+       return false;
+}
+
 struct nexthop *nexthop_exists(const struct nexthop_group *nhg,
                               const struct nexthop *nh)
 {
@@ -791,12 +791,13 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop,
                                        const union sockunion *addr,
                                        const char *intf, bool onlink,
                                        const char *name, const char *labels,
-                                       int *lbl_ret, uint32_t weight,
-                                       const char *backup_str)
+                                       vni_t vni, int *lbl_ret,
+                                       uint32_t weight, const char *backup_str)
 {
        int ret = 0;
        struct vrf *vrf;
        int num;
+       uint8_t labelnum = 0;
 
        memset(nhop, 0, sizeof(*nhop));
 
@@ -837,10 +838,9 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop,
                nhop->type = NEXTHOP_TYPE_IFINDEX;
 
        if (labels) {
-               uint8_t num = 0;
                mpls_label_t larray[MPLS_MAX_LABELS];
 
-               ret = mpls_str2label(labels, &num, larray);
+               ret = mpls_str2label(labels, &labelnum, larray);
 
                /* Return label parse result */
                if (lbl_ret)
@@ -848,9 +848,14 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop,
 
                if (ret < 0)
                        return false;
-               else if (num > 0)
-                       nexthop_add_labels(nhop, ZEBRA_LSP_NONE,
-                                          num, larray);
+               else if (labelnum > 0)
+                       nexthop_add_labels(nhop, ZEBRA_LSP_NONE, labelnum,
+                                          larray);
+       } else if (vni) {
+               mpls_label_t label = MPLS_INVALID_LABEL;
+
+               vni2label(vni, &label);
+               nexthop_add_labels(nhop, ZEBRA_LSP_EVPN, 1, &label);
        }
 
        nhop->weight = weight;
@@ -877,7 +882,7 @@ static bool nexthop_group_parse_nhh(struct nexthop *nhop,
 {
        return (nexthop_group_parse_nexthop(
                nhop, nhh->addr, nhh->intf, nhh->onlink, nhh->nhvrf_name,
-               nhh->labels, NULL, nhh->weight, nhh->backup_str));
+               nhh->labels, nhh->vni, NULL, nhh->weight, nhh->backup_str));
 }
 
 DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
@@ -889,6 +894,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
        [{ \
           nexthop-vrf NAME$vrf_name \
           |label WORD \
+          |vni (1-16777215) \
            |weight (1-255) \
            |backup-idx WORD \
        }]",
@@ -903,6 +909,8 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
       "The nexthop-vrf Name\n"
       "Specify label(s) for this nexthop\n"
       "One or more labels in the range (16-1048575) separated by '/'\n"
+      "Specify VNI(s) for this nexthop\n"
+      "VNI in the range (1-16777215)\n"
       "Weight to be used by the nexthop for purposes of ECMP\n"
       "Weight value to be used\n"
       "Specify backup nexthop indexes in another group\n"
@@ -927,8 +935,8 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
        }
 
        legal = nexthop_group_parse_nexthop(&nhop, addr, intf, !!onlink,
-                                           vrf_name, label, &lbl_ret, weight,
-                                           backup_idx);
+                                           vrf_name, label, vni, &lbl_ret,
+                                           weight, backup_idx);
 
        if (nhop.type == NEXTHOP_TYPE_IPV6
            && IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6)) {
@@ -1058,9 +1066,8 @@ void nexthop_group_write_nexthop(struct vty *vty, const struct nexthop *nh)
        if (nh->nh_label && nh->nh_label->num_labels > 0) {
                char buf[200];
 
-               mpls_label2str(nh->nh_label->num_labels,
-                              nh->nh_label->label,
-                              buf, sizeof(buf), 0);
+               mpls_label2str(nh->nh_label->num_labels, nh->nh_label->label,
+                              buf, sizeof(buf), nh->nh_label_type, 0);
                vty_out(vty, " label %s", buf);
        }
 
@@ -1117,7 +1124,7 @@ void nexthop_group_json_nexthop(json_object *j, const struct nexthop *nh)
                char buf[200];
 
                mpls_label2str(nh->nh_label->num_labels, nh->nh_label->label,
-                              buf, sizeof(buf), 0);
+                              buf, sizeof(buf), nh->nh_label_type, 0);
                json_object_string_add(j, "label", buf);
        }
 
@@ -1155,6 +1162,9 @@ static void nexthop_group_write_nexthop_internal(struct vty *vty,
        if (nh->labels)
                vty_out(vty, " label %s", nh->labels);
 
+       if (nh->vni)
+               vty_out(vty, " vni %u", nh->vni);
+
        if (nh->weight)
                vty_out(vty, " weight %u", nh->weight);
 
index 0ea0b7c18526b2acbf7802cccf357900ba2faea1..78237e464fd99abab05315c972581a96bc6f8706 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop Group structure definition.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __NEXTHOP_GROUP__
@@ -170,6 +157,8 @@ nexthop_group_active_nexthop_num(const struct nexthop_group *nhg);
 extern uint8_t
 nexthop_group_active_nexthop_num_no_recurse(const struct nexthop_group *nhg);
 
+extern bool nexthop_group_has_label(const struct nexthop_group *nhg);
+
 #ifdef __cplusplus
 }
 #endif
index 4abda624ae717d0de83603a88b2b82a951f6b8bc..b05718677873e8b6b75d6c6e179f85f7c1eb0707 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop Group Private Functions.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Stephen Worley
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
index ccfc3840ecc4d8a00d5bf7dc07d4878c5077f20e..b755264be19526087fc730fe1d1ff7ffb623d1e0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -731,7 +718,13 @@ int nb_candidate_edit(struct nb_config *candidate,
        case NB_OP_MOVE:
                /* TODO: update configuration. */
                break;
-       default:
+       case NB_OP_PRE_VALIDATE:
+       case NB_OP_APPLY_FINISH:
+       case NB_OP_GET_ELEM:
+       case NB_OP_GET_NEXT:
+       case NB_OP_GET_KEYS:
+       case NB_OP_LOOKUP_ENTRY:
+       case NB_OP_RPC:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown operation (%u) [xpath %s]", __func__,
                          operation, xpath_edit);
@@ -1360,7 +1353,13 @@ static int nb_callback_configuration(struct nb_context *context,
                ret = nb_callback_move(context, nb_node, event, dnode, errmsg,
                                       errmsg_len);
                break;
-       default:
+       case NB_OP_PRE_VALIDATE:
+       case NB_OP_APPLY_FINISH:
+       case NB_OP_GET_ELEM:
+       case NB_OP_GET_NEXT:
+       case NB_OP_GET_KEYS:
+       case NB_OP_LOOKUP_ENTRY:
+       case NB_OP_RPC:
                yang_dnode_get_path(dnode, xpath, sizeof(xpath));
                flog_err(EC_LIB_DEVELOPMENT,
                         "%s: unknown operation (%u) [xpath %s]", __func__,
@@ -1489,7 +1488,7 @@ static int nb_transaction_process(enum nb_event event,
                         * 'prepare' phase.
                         */
                        break;
-               default:
+               case NB_EV_VALIDATE:
                        break;
                }
        }
@@ -2319,9 +2318,9 @@ const char *nb_event_name(enum nb_event event)
                return "abort";
        case NB_EV_APPLY:
                return "apply";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_operation_name(enum nb_operation operation)
@@ -2349,9 +2348,9 @@ const char *nb_operation_name(enum nb_operation operation)
                return "lookup_entry";
        case NB_OP_RPC:
                return "rpc";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_err_name(enum nb_error error)
@@ -2373,9 +2372,9 @@ const char *nb_err_name(enum nb_error error)
                return "failed to allocate resource";
        case NB_ERR_INCONSISTENCY:
                return "internal inconsistency";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_client_name(enum nb_client client)
@@ -2389,9 +2388,13 @@ const char *nb_client_name(enum nb_client client)
                return "Sysrepo";
        case NB_CLIENT_GRPC:
                return "gRPC";
-       default:
-               return "unknown";
+       case NB_CLIENT_PCEP:
+               return "Pcep";
+       case NB_CLIENT_NONE:
+               return "None";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static void nb_load_callbacks(const struct frr_yang_module_info *module)
index a330bd1a30b0601ff4da5a7439e3a1eeb162bd7e..c132daebdb3834a9f1b5ecc356c02c584a79b4e1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_NORTHBOUND_H_
index e0dcdb490fcf2c12f732663fa50d2a49e8dfc959..0dfa66b37e5dd030232264554a9bd34ab01723c4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d848507e01ddd98997c59f81ce016131444ea5ab..ef2ef44eb01e5eef2e41ba19a887b294a1e98e11 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_NORTHBOUND_CLI_H_
index 27eaefd0714f99449a5f648a4fe0a87fdb6cc418..81ba313e810afe96660d68ca1019d83da7aa9141 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dce9b2ec24f9eb0eb980ab6a2f7196332107e8ef..cefcfbcf1f99d68ba90d3b8b998705b8083dab37 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 14df09caa37b8a9c65c731c57c741d74c53a8d2e..07a27836ced4c44f91d59e6356201b9110e9234c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_NORTHBOUND_DB_H_
index 95721ffc7745444c0cd1505cdffe134b3750169f..f5d59d92d6cd63f858523ab4a15bb03cc26a7b6e 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 //
 // Copyright (c) 2021-2022, LabN Consulting, L.L.C
 // Copyright (C) 2019  NetDEF, Inc.
 //                     Renato Westphal
 //
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 2 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; see the file COPYING; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
 
 #include <zebra.h>
 #include <grpcpp/grpcpp.h>
index f035ac861180ca80cc08471c7795b2db39ef8d84..824d81a51e651ad73189bf1f17dc2f69446b4cff 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 93a3781c154f6e0460a439423571aea87f596f0d..46c0dd786eebafcd9de2b12b4b51740d49a8332e 100644 (file)
--- a/lib/ns.h
+++ b/lib/ns.h
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * NS related header.
  * Copyright (C) 2014 6WIND S.A.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_NS_H
index 1b2dd7a6d12da7be9afbc9e79cb494ea3ab1cdee..49e1b152c9317a1d925efcfd5bd8fdbe0ba81e52 100644 (file)
@@ -1,19 +1,8 @@
+// SPDX-License-Identifier: ISC
 /*
  * optimized ntop, about 10x faster than libc versions [as of 2019]
  *
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index d4c08a3be8c8cc0a1447c73431eff56a96714dd8..df3bbd720fe1fd6e613f2d1322f598738a6e8186 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-3-Clause
 /*     $OpenBSD: queue.h,v 1.43 2015/12/28 19:38:40 millert Exp $      */
 /*     $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $       */
 
@@ -5,30 +6,6 @@
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  *     @(#)queue.h     8.5 (Berkeley) 8/20/94
  */
 
index 98d2e155e38af38dceabd690aa673c550fdd63bb..c09ac2fd40557728c8361001f0ac52c7e76a6d4a 100644 (file)
@@ -1,44 +1,12 @@
+// SPDX-License-Identifier: ISC AND BSD-2-Clause
 /*     $OpenBSD: subr_tree.c,v 1.9 2017/06/08 03:30:52 dlg Exp $ */
 
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 832a10141eb56516737a7ebf422a071b96b86572..4f3985bbca04c4449a578e25671788091df82228 100644 (file)
@@ -1,27 +1,7 @@
+// SPDX-License-Identifier: ISC AND BSD-2-Clause
 /*     $OpenBSD: tree.h,v 1.14 2015/05/25 03:07:49 deraadt Exp $       */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef _SYS_TREE_H_
@@ -318,18 +298,6 @@ extern "C" {
 
 /*
  * Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #define RB_BLACK       0
index b14ba07503bbb41d0e33449bc792821a69751f10..e8563afb3b405ddca8701ded5c9184d4037b199d 100644 (file)
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Policy Based Routing (PBR) main header
  * Copyright (C) 2018 6WIND
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _PBR_H
index b82dde82585d9ed813679ca5fbe62548d30fd1f1..064a7bb47fbb6071dee4e1a43d80e3b8af037663 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Process id output.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 17e692d13954d38b7a3e0229a85863dd565c7289..e286a32f9212ba1b699fba7a5a9eaf4df8f0ac0b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Prefix list functions.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c9507df57c88235a0448402265d67a36a32fef12..f31d8e8792701b11c4e800b2ade168a4645db171 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Prefix list functions.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_PLIST_H
index 397557b37f21cbd329721b041bb7c0d276d446f9..d33ac0f73b186d6a4c28de5961e09954b72dc5e0 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Prefix list internal definitions.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_PLIST_INT_H
index 1d098f78c5e563b3eb84a9da51c13778c9341df0..b3d81aa241dfc8e8f79db2fef82a0c947b30869f 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Prefix related functions.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -148,11 +133,11 @@ const char *afi2str(afi_t afi)
        case AFI_L2VPN:
                return "l2vpn";
        case AFI_MAX:
+       case AFI_UNSPEC:
                return "bad-value";
-       default:
-               break;
        }
-       return NULL;
+
+       assert(!"Reached end of function we should never reach");
 }
 
 const char *safi2str(safi_t safi)
@@ -172,9 +157,12 @@ const char *safi2str(safi_t safi)
                return "labeled-unicast";
        case SAFI_FLOWSPEC:
                return "flowspec";
-       default:
+       case SAFI_UNSPEC:
+       case SAFI_MAX:
                return "unknown";
        }
+
+       assert(!"Reached end of function we should never reach");
 }
 
 /* If n includes p prefix then return 1 else return 0. */
@@ -1443,9 +1431,11 @@ int evpn_prefix2prefix(const struct prefix *evpn, struct prefix *to)
        switch (addr->route_type) {
        case BGP_EVPN_MAC_IP_ROUTE:
                if (IS_IPADDR_V4(&addr->macip_addr.ip))
-                       ipaddr2prefix(&addr->macip_addr.ip, 32, to);
+                       ipaddr2prefix(&addr->macip_addr.ip, IPV4_MAX_BITLEN,
+                                     to);
                else if (IS_IPADDR_V6(&addr->macip_addr.ip))
-                       ipaddr2prefix(&addr->macip_addr.ip, 128, to);
+                       ipaddr2prefix(&addr->macip_addr.ip, IPV6_MAX_BITLEN,
+                                     to);
                else
                        return -1; /* mac only? */
 
@@ -1507,7 +1497,7 @@ static ssize_t printfrr_ia(struct fbuf *buf, struct printfrr_eargs *ea,
                                return bputch(buf, '*');
                        break;
 
-               default:
+               case IPADDR_NONE:
                        break;
                }
        }
index 7de8d7903ea6b389df6258266b71c8f9247246fc..a6435be1b4f3d2d78e93fa893c5475ee174225e7 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Prefix structure.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_PREFIX_H
@@ -659,7 +644,10 @@ static inline bool ipv4_mcast_ssm(const struct in_addr *addr)
 #pragma FRR printfrr_ext "%pFX"  (struct prefix_eth *)
 #pragma FRR printfrr_ext "%pFX"  (struct prefix_evpn *)
 #pragma FRR printfrr_ext "%pFX"  (struct prefix_fs *)
-#pragma FRR printfrr_ext "%pRD"  (struct prefix_rd *)
+#pragma FRR printfrr_ext "%pRDP"  (struct prefix_rd *)
+/* RD with AS4B with dot and dot+ format */
+#pragma FRR printfrr_ext "%pRDD"  (struct prefix_rd *)
+#pragma FRR printfrr_ext "%pRDE"  (struct prefix_rd *)
 
 #pragma FRR printfrr_ext "%pPSG4" (struct prefix_sg *)
 #endif
index 3ac6e2c0ae0678117d4f1802150c998e14458f0f..25e2ff37a3cb3ece130bb8838020c6d8f3f8abad 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index a2d113ba1e9a12d9b4a9d78cefe7fef1d8fd64e7..b8bef562d25c6fc1c775f45e1800634470023b66 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_PRINTFRR_H
index 08461d8d503cc36ff22bfcc81fe77d4531351302..accd9895ffec5fea65a93745429836a05639f94c 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra privileges.
  *
  * Copyright (C) 2003 Paul Jakma.
  * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "log.h"
index bc0786178b9738826e60d089719bbaf072363329..d4a9609b5dbd745101d96045c3f11ac949ee5953 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra privileges header.
  *
  * Copyright (C) 2003 Paul Jakma.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_PRIVS_H
index e00dd54290571b05f77b0192de2ff44fe1cb6189..ac800be0a5ef90fbffc2718fd09634ebcf0e6190 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PTM Library
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index c2170407c036d7345783089032b1accedacf218c..1f17f767f604bc581c156ddcb1f4120656bd85a8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PTM Library
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PTM_LIB_H__
 #define __PTM_LIB_H__
index 5e836984b28d5170812bf6287091665f8284ef20..5bc566c285d9cec92fca14770591273e50086c5c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Pull-driven write event handler
  * Copyright (C) 2019  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index a0e89e0c30ad10e451a6967e41f5e5ba0be68189..77ecf855b404d7ecdd9c5b4eff7262ac6756a562 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Pull-driven write event handler
  * Copyright (C) 2019  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _WRITEPOLL_H
index 2fc4a61f967929c1426176cdde746d0172cef8ea..17f7bdac071d6a17d6ac9bb97df4060f792e2070 100644 (file)
--- a/lib/pw.h
+++ b/lib/pw.h
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Pseudowire definitions
  * Copyright (C) 2016 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef _FRR_PW_H
index c6cb36c058b3b052d46938303947069a4eb4cfb2..09b156ba390d0976665f040f527a02083d8fc44a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5012c98d7482eb04826138678caf4db42f6d360a..a3883fdad6da420c704467c46b903ddad99a4a6c 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-16  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _QOBJ_H
index dab43e3c54ff6cc4d6a9551446caeb093f539014..26a5d4d7e6c14b381fc6062940176fe90bb63a08 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * lists and queues implementations
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_QUEUE_H
old mode 100755 (executable)
new mode 100644 (file)
index 0d64ad8..2918576
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* C-Ares integration to Quagga mainloop
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 988449693c37c4dd5e448750616878fea1570c62..d3f38f742de9806e8f06e50060c29344402817ec 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* C-Ares integration to Quagga mainloop
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef _FRR_RESOLVER_H
index 6efa8077c25feecd525c1a4d4e12361111a54127..3cd7b4987220c94d097d021797cf4600143a48d7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Circular buffer implementation.
  * Copyright (C) 2017 Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index b8f4d9798dc97f2391c6358271111bf30758328e..2bef6d3a308fb851b9a7b18b92e377c86ff0e8a2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Circular buffer implementation.
  * Copyright (C) 2017 Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _FRR_RINGBUF_H_
 #define _FRR_RINGBUF_H_
index bf6081c0547c1b9c1d8a06f1f37e67dfa134793c..82ff21ce9cc8118b6f1b631bcb4a79c212ff030f 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Opaque data for Zebra from other daemons.
  *
  * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef FRR_ROUTE_OPAQUE_H
index 8c216e13bd84fd90b0400e2b5a299f0036d3ac79..c75a86696471477f54f6180b3bec6b7d26d7fc15 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/perl
+# SPDX-License-Identifier: GPL-2.0-or-later
 ##
 ## Scan a file of route-type definitions (see eg route_types.txt) and
 ## generate a corresponding header file with:
 ##
 ##
 ## Copyright (C) 2009 David Lamparter.
-## This file is part of GNU Zebra.
-##
-## GNU Zebra is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2, or (at your option) any
-## later version.
-##
-## GNU Zebra is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Zebra; see the file COPYING.  If not, write to the Free
-## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-## 02111-1307, USA.
 ##
 
 use strict;
index 44d7185567a6d549f8c68ec07c5afba5a7bda296..ccf733e8b82bb315602e18aeb228c6bc0a2b3ca4 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Route map function.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -36,6 +21,8 @@
 #include "json.h"
 #include "jhash.h"
 
+#include "lib/routemap_clippy.c"
+
 DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP, "Route map");
 DEFINE_MTYPE(LIB, ROUTE_MAP_NAME, "Route map name");
 DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP_INDEX, "Route map index");
@@ -613,7 +600,8 @@ static unsigned int route_map_dep_hash_make_key(const void *p);
 static void route_map_clear_all_references(char *rmap_name);
 static void route_map_rule_delete(struct route_map_rule_list *,
                                  struct route_map_rule *);
-static bool rmap_debug;
+
+uint32_t rmap_debug;
 
 /* New route map allocation. Please note route map's name must be
    specified. */
@@ -681,7 +669,7 @@ static struct route_map *route_map_add(const char *name)
        if (!map->ipv6_prefix_table)
                map->ipv6_prefix_table = route_table_init();
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Add route-map %s", name);
        return map;
 }
@@ -701,7 +689,7 @@ static void route_map_free_map(struct route_map *map)
        while ((index = map->head) != NULL)
                route_map_index_delete(index, 0);
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Deleting route-map %s", map->name);
 
        list = &route_map_master;
@@ -1132,7 +1120,7 @@ void route_map_index_delete(struct route_map_index *index, int notify)
 
        QOBJ_UNREG(index);
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Deleting route-map %s sequence %d",
                           index->map->name, index->pref);
 
@@ -1243,7 +1231,7 @@ route_map_index_add(struct route_map *map, enum route_map_type type, int pref)
                route_map_notify_dependencies(map->name, RMAP_EVENT_CALL_ADDED);
        }
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Route-map %s add sequence %d, type: %s",
                           map->name, pref, route_map_type_str(type));
 
@@ -1754,7 +1742,8 @@ route_map_apply_match(struct route_map_rule_list *match_list,
                                        ret = RMAP_MATCH;
                                break;
 
-                       default:
+                       case RMAP_OKAY:
+                       case RMAP_ERROR:
                                break;
                        }
 
@@ -1815,26 +1804,24 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix,
        struct route_map_index *index = NULL, *best_index = NULL;
        struct route_map_index *head_index = NULL;
        struct route_table *table = NULL;
-       struct prefix conv;
-       unsigned char family;
 
-       /*
-        * Handling for matching evpn_routes in the prefix table.
-        *
-        * We convert type2/5 prefix to ipv4/6 prefix to do longest
-        * prefix matching on.
+       /* Route-map optimization relies on LPM lookups of the prefix to reduce
+        * the amount of route-map clauses a given prefix needs to be processed
+        * against. These LPM trees are IPv4/IPv6-specific and prefix->family
+        * must be AF_INET or AF_INET6 in order for the lookup to succeed. So if
+        * the AF doesn't line up with the LPM trees, skip the optimization.
         */
-       if (prefix->family == AF_EVPN) {
-               if (evpn_prefix2prefix(prefix, &conv) != 0)
-                       return NULL;
-
-               prefix = &conv;
+       if (map->optimization_disabled ||
+           (prefix->family == AF_INET && !map->ipv4_prefix_table) ||
+           (prefix->family == AF_INET6 && !map->ipv6_prefix_table)) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "Skipping route-map optimization for route-map: %s, pfx: %pFX, family: %d",
+                               map->name, prefix, prefix->family);
+               return map->head;
        }
 
-
-       family = prefix->family;
-
-       if (family == AF_INET)
+       if (prefix->family == AF_INET)
                table = map->ipv4_prefix_table;
        else
                table = map->ipv6_prefix_table;
@@ -2556,6 +2543,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
        struct route_map_index *index = NULL;
        struct route_map_rule *set = NULL;
        bool skip_match_clause = false;
+       struct prefix conv;
 
        if (recursion > RMAP_RECURSION_LIMIT) {
                flog_warn(
@@ -2573,37 +2561,51 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
 
        map->applied++;
 
-       if ((!map->optimization_disabled)
-           && (map->ipv4_prefix_table || map->ipv6_prefix_table)) {
-               index = route_map_get_index(map, prefix, match_object,
-                                           &match_ret);
-               if (index) {
-                       index->applied++;
-                       if (rmap_debug)
-                               zlog_debug(
-                                       "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s",
-                                       map->name, index->pref, prefix,
-                                       route_map_cmd_result_str(match_ret));
+       /*
+        * Handling for matching evpn_routes in the prefix table.
+        *
+        * We convert type2/5 prefix to ipv4/6 prefix to do longest
+        * prefix matching on.
+        */
+       if (prefix->family == AF_EVPN) {
+               if (evpn_prefix2prefix(prefix, &conv) != 0) {
+                       zlog_debug(
+                               "Unable to convert EVPN prefix %pFX into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup",
+                               prefix);
                } else {
-                       if (rmap_debug)
-                               zlog_debug(
-                                       "No best match sequence for pfx: %pFX in route-map: %s, result: %s",
-                                       prefix, map->name,
-                                       route_map_cmd_result_str(match_ret));
-                       /*
-                        * No index matches this prefix. Return deny unless,
-                        * match_ret = RMAP_NOOP.
-                        */
-                       if (match_ret == RMAP_NOOP)
-                               ret = RMAP_PERMITMATCH;
-                       else
-                               ret = RMAP_DENYMATCH;
-                       goto route_map_apply_end;
+                       zlog_debug(
+                               "Converted EVPN prefix %pFX into %pFX for optimized route-map lookup",
+                               prefix, &conv);
+
+                       prefix = &conv;
                }
-               skip_match_clause = true;
+       }
+
+       index = route_map_get_index(map, prefix, match_object, &match_ret);
+       if (index) {
+               index->applied++;
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
+                       zlog_debug(
+                               "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s",
+                               map->name, index->pref, prefix,
+                               route_map_cmd_result_str(match_ret));
        } else {
-               index = map->head;
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
+                       zlog_debug(
+                               "No best match sequence for pfx: %pFX in route-map: %s, result: %s",
+                               prefix, map->name,
+                               route_map_cmd_result_str(match_ret));
+               /*
+                * No index matches this prefix. Return deny unless,
+                * match_ret = RMAP_NOOP.
+                */
+               if (match_ret == RMAP_NOOP)
+                       ret = RMAP_PERMITMATCH;
+               else
+                       ret = RMAP_DENYMATCH;
+               goto route_map_apply_end;
        }
+       skip_match_clause = true;
 
        for (; index; index = index->next) {
                if (!skip_match_clause) {
@@ -2611,7 +2613,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
                        /* Apply this index. */
                        match_ret = route_map_apply_match(&index->match_list,
                                                          prefix, match_object);
-                       if (rmap_debug) {
+                       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) {
                                zlog_debug(
                                        "Route-map: %s, sequence: %d, prefix: %pFX, result: %s",
                                        map->name, index->pref, prefix,
@@ -2724,7 +2726,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map,
        }
 
 route_map_apply_end:
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Route-map: %s, prefix: %pFX, result: %s",
                           (map ? map->name : "null"), prefix,
                           route_map_result_str(ret));
@@ -2779,7 +2781,7 @@ static void route_map_clear_reference(struct hash_bucket *bucket, void *arg)
        tmp_dep_data.rname = arg;
        dep_data = hash_release(dep->dep_rmap_hash, &tmp_dep_data);
        if (dep_data) {
-               if (rmap_debug)
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                        zlog_debug("Clearing reference for %s to %s count: %d",
                                   dep->dep_name, tmp_dep_data.rname,
                                   dep_data->refcnt);
@@ -2799,7 +2801,7 @@ static void route_map_clear_all_references(char *rmap_name)
 {
        int i;
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Clearing references for %s", rmap_name);
 
        for (i = 1; i < ROUTE_MAP_DEP_MAX; i++) {
@@ -2875,7 +2877,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
        case RMAP_EVENT_LLIST_ADDED:
        case RMAP_EVENT_CALL_ADDED:
        case RMAP_EVENT_FILTER_ADDED:
-               if (rmap_debug)
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                        zlog_debug("Adding dependency for filter %s in route-map %s",
                                   dep_name, rmap_name);
                dep = (struct route_map_dep *)hash_get(
@@ -2904,7 +2906,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
        case RMAP_EVENT_LLIST_DELETED:
        case RMAP_EVENT_CALL_DELETED:
        case RMAP_EVENT_FILTER_DELETED:
-               if (rmap_debug)
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                        zlog_debug("Deleting dependency for filter %s in route-map %s",
                                   dep_name, rmap_name);
                dep = (struct route_map_dep *)hash_get(dephash, dname, NULL);
@@ -2958,7 +2960,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
        }
 
        if (dep) {
-               if (rmap_debug)
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                        hash_iterate(dep->dep_rmap_hash,
                                     route_map_print_dependency, dname);
        }
@@ -3030,7 +3032,7 @@ static void route_map_process_dependency(struct hash_bucket *bucket, void *data)
        dep_data = bucket->data;
        rmap_name = dep_data->rname;
 
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                zlog_debug("Notifying %s of dependency", rmap_name);
        if (route_map_master.event_hook)
                (*route_map_master.event_hook)(rmap_name);
@@ -3078,7 +3080,7 @@ void route_map_notify_dependencies(const char *affected_name,
                if (!dep->this_hash)
                        dep->this_hash = upd8_hash;
 
-               if (rmap_debug)
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                        zlog_debug("Filter %s updated", dep->dep_name);
                hash_iterate(dep->dep_rmap_hash, route_map_process_dependency,
                             (void *)event);
@@ -3156,24 +3158,34 @@ DEFUN (rmap_show_unused,
        return vty_show_unused_route_map(vty);
 }
 
-DEFUN (debug_rmap,
+DEFPY (debug_rmap,
        debug_rmap_cmd,
-       "debug route-map",
+       "debug route-map [detail]$detail",
        DEBUG_STR
-       "Debug option set for route-maps\n")
+       "Debug option set for route-maps\n"
+       "Detailed output\n")
 {
-       rmap_debug = true;
+       if (!detail)
+               SET_FLAG(rmap_debug, DEBUG_ROUTEMAP);
+       else
+               SET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL);
+
        return CMD_SUCCESS;
 }
 
-DEFUN (no_debug_rmap,
+DEFPY (no_debug_rmap,
        no_debug_rmap_cmd,
-       "no debug route-map",
+       "no debug route-map [detail]$detail",
        NO_STR
        DEBUG_STR
-       "Debug option set for route-maps\n")
+       "Debug option set for route-maps\n"
+       "Detailed output\n")
 {
-       rmap_debug = false;
+       if (!detail)
+               UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP);
+       else
+               UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL);
+
        return CMD_SUCCESS;
 }
 
@@ -3188,7 +3200,7 @@ static struct cmd_node rmap_debug_node = {
 
 void route_map_show_debug(struct vty *vty)
 {
-       if (rmap_debug)
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP))
                vty_out(vty, "debug route-map\n");
 }
 
@@ -3197,7 +3209,7 @@ static int rmap_config_write_debug(struct vty *vty)
 {
        int write = 0;
 
-       if (rmap_debug) {
+       if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) {
                vty_out(vty, "debug route-map\n");
                write++;
        }
@@ -3399,7 +3411,7 @@ void route_map_init(void)
                        8, route_map_dep_hash_make_key, route_map_dep_hash_cmp,
                        "Route Map Dep Hash");
 
-       rmap_debug = false;
+       UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP);
 
        route_map_cli_init();
 
index 9c78e1573577e562adc697f9d48c03afe2f9d93f..2197a49e76c9ebdcbd1949a86a9a0f20e814e307 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Route map function.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ROUTEMAP_H
@@ -37,6 +22,10 @@ DECLARE_MTYPE(ROUTE_MAP_NAME);
 DECLARE_MTYPE(ROUTE_MAP_RULE);
 DECLARE_MTYPE(ROUTE_MAP_COMPILED);
 
+#define DEBUG_ROUTEMAP 0x01
+#define DEBUG_ROUTEMAP_DETAIL 0x02
+extern uint32_t rmap_debug;
+
 /* Route map's type. */
 enum route_map_type { RMAP_PERMIT, RMAP_DENY, RMAP_ANY };
 
index cedee83d822b14a5df809993c15c7e5cedb8e50e..4345b74bc0c1227d8b777cbbabee71fde76dbe1a 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Route map northbound CLI implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 0ccfe98af031f01a0fb62aceca6427c2db2b98f8..ab127dd0fcbf4e718136d0aa0e9c7bd1868f56aa 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Route map northbound implementation.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 6238fb055d5e96c96b25252347420c947938faf3..3d837bcc11491ce1f072157614a6c01848309a31 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Vmware
  *                           Vishal Dhingra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 594ad6c9e816069274d70cc0f78f93bf91653282..f4fe48f5b3711731d1c46b70b88a33d957ce7701 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Vmware
  *                           Vishal Dhingra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c04af153b19c01f365219cf89b81420bddbb2055..2762e449938b0c5c6c5ef337ba5dd32b54a2d990 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Simple string buffer
  *
  * Copyright (C) 2017 Christian Franke
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
@@ -33,8 +17,8 @@ void sbuf_init(struct sbuf *dest, char *buf, size_t size)
                dest->buf = buf;
                dest->size = size;
        } else {
-               dest->buf = XMALLOC(MTYPE_TMP, 4096);
-               dest->size = 4096;
+               dest->buf = XMALLOC(MTYPE_TMP, SBUF_DEFAULT_SIZE);
+               dest->size = SBUF_DEFAULT_SIZE;
        }
 
        dest->pos = 0;
index aaa2db0edb8dad893ce46e6054131f5bfa7aa55f..a73875a7d7e0e23fcf18fc23bc8e920fce27e680 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Simple string buffer
  *
  * Copyright (C) 2017 Christian Franke
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef SBUF_H
 #define SBUF_H
@@ -64,6 +48,8 @@ extern "C" {
  * the string returned in parser_log.
  */
 
+#define SBUF_DEFAULT_SIZE 8192
+
 struct sbuf {
        bool fixed;
        char *buf;
index 77673146ea565309e8689628951f6b6907b62d31..62ce316920dd29d9112106b78c31afb5494696d7 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * "Sequence" lock primitive
  *
  * Copyright (C) 2015  David Lamparter <equinox@diac24.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA  02110-1301  USA
  */
 
 #define _GNU_SOURCE
index bfbf97890ecfca05c2d79eeaf9f65238afd6ca3a..01735814fbf957ded8a6fd6b4695957254b4f803 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * "Sequence" lock primitive
  *
  * Copyright (C) 2015  David Lamparter <equinox@diac24.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA  02110-1301  USA
  */
 
 #ifndef _SEQLOCK_H
index f1727b6323273ebb814817e04fd4920a1b9a731c..ccf260fa7b31b1ffc498181f676e9ae139476c77 100644 (file)
@@ -1,27 +1,7 @@
+// SPDX-License-Identifier: BSD-2-Clause
 /*-
  * Copyright 2005,2007,2009 Colin Percival
  * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
  */
 
 #include <zebra.h>
index c93d25305184abf7a3ce04202928cc423f961b35..dbadf4efd1f8c4fc27d4bcaca9bd517d4d281e09 100644 (file)
@@ -1,28 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
 /*-
  * Copyright 2005,2007,2009 Colin Percival
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  * $FreeBSD: src/lib/libmd/sha256.h,v 1.2 2006/01/17 15:35:56 phk Exp $
  */
 
index 985bedeb925e3133edacf2155c3a9e4e9871e18b..3ed34894e5059c242c706f03d1abeaeda89500af 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Quagga signal handling functions.
  * Copyright (C) 2004 Paul Jakma,
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dd1ee99587b510f009d44bbfc2a1864b9d298010..e58b9a70c02b8fa359e316ac9015fbe20ee378a0 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Quagga Signal handling header.
  *
  * Copyright (C) 2004 Paul Jakma.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_SIGNAL_H
index 81407826f2eac07f5cedcd916b24e23ffb59a26b..fb8cb72e8d082d6591afde33cea9534d6c64b9db 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: LicenseRef-Skiplist-BSD-0-Clause
 /*
  * Copyright 1990 William Pugh
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  * Permission to include in quagga provide on March 31, 2016
  */
 
index 165607820aac5b1299ca68e81a65aa16e74c1d34..39bfa39d3a69142617a26f3d42e52091e538fc60 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: LicenseRef-Skiplist-BSD-0-Clause
 /*
  * Copyright 1990 William Pugh
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
  * Permission to include in quagga provide on March 31, 2016
  */
 
index 1d73406a28a1171322be04cfb854b15dd0ed51ed..28a303cf729c3a78dc19aaf34e9b6704d98f9b98 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* SNMP support
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SNMP_H
index 8d8b3c950c07ca86889ce7186f7c45d837a9b77c..d28e6494b0261962e3e0b8bddd83774eac9ebc1e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* SNMP support
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index de11a9eab36bfb43ea6c4414857f74e734dc43d6..0c4adb0b7c22305dd76ceebb949908f37e8d3791 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* setsockopt functions
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 694edf7638aad6b39500dd57af8bb6680f005968..ce7d665fab5f2686456e418dc0cc65248d04ebd7 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Router advertisement
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SOCKOPT_H
index 36ae21fdd181d40cc4a3a650fa09d2a558cbc822..c37ab1d6dd5316f6a73ffa802c238062e4e4ddbf 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Socket union related function.
  * Copyright (c) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8ace3e47812cc78e366056261aabff07159c0cd1..e5072559999df5dbd2f017c434eb849925a95066 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Socket union header.
  * Copyright (c) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SOCKUNION_H
index 117b7d3e88721853cdab2b35f64efc3b0e0977f1..1e80b5ec2debdd785f057e44d411670b0a367a52 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of the IETF SPF delay algorithm
  * as explained in draft-ietf-rtgwg-backoff-algo-04
@@ -8,20 +9,6 @@
  * Copyright (C) 2017 by Christian Franke, Open Source Routing / NetDEF Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2617195d799e5bd2a9664a8f9d8201788d4ce9a2..87aa4a0825d1307350d4b67a07d2bb9e4053ee80 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of the IETF SPF delay algorithm
  * as explained in draft-ietf-rtgwg-backoff-algo-04
@@ -8,20 +9,6 @@
  * Copyright (C) 2017 by Christian Franke, Open Source Routing / NetDEF Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _ZEBRA_SPF_BACKOFF_H
 #define _ZEBRA_SPF_BACKOFF_H
index 828cf2cce07e634712b54ddb1f93958a817968a2..3247a0372cb57f2470f3432ac6b5d65720de1bbf 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SRC-DEST Routing Table
  *
@@ -5,20 +6,6 @@
  *                       Open Source Routing / NetDEF Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 79afef9bb088fccd9b59bb164949f92c73958c06..ff97f9b735248874d3932ae174f5660861796154 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SRC-DEST Routing Table
  *
@@ -5,20 +6,6 @@
  *                       Open Source Routing / NetDEF Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SRC_DEST_TABLE_H
index d468c1cac9b81cc6bd09b03fb0623699f899ebec..69c3dbcd87db1dbe2c15b9896043b43f0209d62e 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SR-TE definitions
  * Copyright 2020 NetDef Inc.
  *                Sascha Kattelmann
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_SRTE_H
index f4077a86d228c3b0c3a0637b6e5fb5c834260578..09835f3ea8b47606b0631d04a0da565cbaa92bff 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SRv6 definitions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index acfb0631cc0ef2d3722423c71dc7318072ed29c0..0d3ee7d2ffa81df185537e65f0cbbb0813debe21 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SRv6 definitions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_SRV6_H
index 2de3abdf45fc654dc4151e8172de2f22375c10e6..c6de3aefa17a592678bd00bd11197af7c65d6ca9 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Packet interface
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -635,7 +620,7 @@ uint32_t stream_get_ipv4(struct stream *s)
 
 bool stream_get_ipaddr(struct stream *s, struct ipaddr *ip)
 {
-       uint16_t ipa_len;
+       uint16_t ipa_len = 0;
 
        STREAM_VERIFY_SANE(s);
 
@@ -654,7 +639,7 @@ bool stream_get_ipaddr(struct stream *s, struct ipaddr *ip)
        case IPADDR_V6:
                ipa_len = IPV6_MAX_BYTELEN;
                break;
-       default:
+       case IPADDR_NONE:
                flog_err(EC_LIB_DEVELOPMENT,
                         "%s: unknown ip address-family: %u", __func__,
                         ip->ipa_type);
@@ -947,7 +932,7 @@ bool stream_put_ipaddr(struct stream *s, struct ipaddr *ip)
        case IPADDR_V6:
                stream_write(s, (uint8_t *)&ip->ipaddr_v6, 16);
                break;
-       default:
+       case IPADDR_NONE:
                flog_err(EC_LIB_DEVELOPMENT,
                         "%s: unknown ip address-family: %u", __func__,
                         ip->ipa_type);
index a3c148c9c9362945067fc1ba3bb63bf0f745d7c1..85eebb47bef2f0ab24d3b8674adeba655a847796 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Packet interface
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_STREAM_H
index d941a7f04ea5a6b69812c9233778a05f6336bd2e..87d1715d262c9948bcf51bb124ca07f81678f8fa 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index a046822a94389b5f9f003a18054a9edd94c10858..e3e29a72f33d3e61eb39177e9ebeed33c4dce665 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /* Append a null-terminated string to another string, with length checking.
  * Copyright (C) 2016 Free Software Foundation, Inc.
  * This file is part of the GNU C Library.
- *
- * The GNU C Library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * The GNU C Library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the GNU C Library; if not, see
- * <http://www.gnu.org/licenses/>.
  */
 
 /* adapted for Quagga from glibc patch submission originally from
index 71ee9f1a5452740f3f585df1d81048b04d8a72b1..74ea9cbc9ccf1749ce79b5dac89e450c6d8e2d46 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /* Copy a null-terminated string to a fixed-size buffer, with length checking.
  * Copyright (C) 2016 Free Software Foundation, Inc.
  * This file is part of the GNU C Library.
- *
- * The GNU C Library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * The GNU C Library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the GNU C Library; if not, see
- * <http://www.gnu.org/licenses/>.
  */
 
 /* adapted for Quagga from glibc patch submission originally from
index 18e9825a7a302fa5cc6a59977c6747504f6e79f1..beef8675aaba28b5dc1755b0a9e0164f3fe3e549 100644 (file)
@@ -7,8 +7,13 @@ lib_libfrr_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0 -Xlinker -e_libfrr_ve
 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBCRYPT) $(LIBDL) $(LIBM)
 
 lib_libfrr_la_SOURCES = \
+       lib/admin_group.c \
+       lib/affinitymap.c \
+       lib/affinitymap_cli.c \
+       lib/affinitymap_northbound.c \
        lib/agg_table.c \
        lib/atomlist.c \
+       lib/asn.c \
        lib/base64.c \
        lib/bfd.c \
        lib/buffer.c \
@@ -127,6 +132,7 @@ lib_libfrr_la_SOURCES = \
        # end
 
 nodist_lib_libfrr_la_SOURCES = \
+       yang/frr-affinity-map.yang.c \
        yang/frr-filter.yang.c \
        yang/frr-interface.yang.c \
        yang/frr-route-map.yang.c \
@@ -146,12 +152,14 @@ lib_libfrr_la_SOURCES += lib/db.c
 endif
 
 clippy_scan += \
+       lib/affinitymap_cli.c \
        lib/if.c \
        lib/filter_cli.c \
        lib/log_vty.c \
        lib/nexthop_group.c \
        lib/northbound_cli.c \
        lib/plist.c \
+       lib/routemap.c \
        lib/routemap_cli.c \
        lib/thread.c \
        lib/vty.c \
@@ -159,7 +167,10 @@ clippy_scan += \
        # end
 
 pkginclude_HEADERS += \
+       lib/admin_group.h \
+       lib/affinitymap.h \
        lib/agg_table.h \
+       lib/asn.h \
        lib/atomlist.h \
        lib/base64.h \
        lib/bfd.h \
index 1c9a6f122e1652e4ea174b0f1f5a20ce4309591a..0106e88b93c082cef7a5a6e5c8e5ad8e3b129048 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* lib/systemd Code
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b9290930d727859a2fcb80ba5e62aa281899b332..09f27a70baad10d6e9c90bffc9ef89fbd1d21b47 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* lib/systemd Code
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef __cplusplus
index 6c4c6c7d3689d76a45f0f843b5a0eb0d1c8099c2..380852b54dd0f06e9cd4c718bdfbf9cecbdbbd77 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Routing Table functions.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define FRR_COMPILING_TABLE_C
index 5dec69ee7ea67b29ab00f16f70cfd456959be720..acfc87615429421b582273e34d721176cab576fb 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Routing Table
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_TABLE_H
index 1bc01ed3f6c2a7d48d7e9606ec85e6f42067c1db..2e45add843d06ea9b43eb86ae4af90b6bef9ffc1 100644 (file)
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Traffic Control (TC) main library
  * Copyright (C) 2022  Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "tc.h"
index ec68e1f4cdf0a1db09420cfd45520bf8b8822158..c4d23d63309f076059d176d7254f7d64d5c59a6b 100644 (file)
--- a/lib/tc.h
+++ b/lib/tc.h
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Traffic Control (TC) main header
  * Copyright (C) 2022  Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _TC_H
index 14362e1443ad80b904ce1395fa415859b05d4096..30f1ab74c6dd755ac08c15b9f195eca7d3879f35 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ASCII table generator.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <stdio.h>
index e61c7fa30298c121bed3ce87a4c58bc9e6b9b148..3aa8caee89bd726888b09a735957c95a30818832 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ASCII table generator.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _TERMTABLE_H_
 #define _TERMTABLE_H_
index 4078634f75fef55b3e41a07c7fae64ef792aff57..8324783a7b51afd36bd757d41a999668f65c2d62 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Thread management routine
  * Copyright (C) 1998, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* #define DEBUG */
index acdcec51def29f72b21426c3266865ae1c9cef11..128d11b6ebbddcb2dfb7a0b2b6b3a0d28dbb64ba 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Thread management routine header.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_THREAD_H
index 73fc10a556df45b9911c5e5e3a92b84c33766a52..a30f53cacda00d8ff01eae18c15d051e39a534a3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Tracing macros
  *
  * Wraps tracepoint macros for different tracing systems to allow switching
  *
  * Copyright (C) 2020  NVIDIA Corporation
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _TRACE_H_
index fe142ff354f0f846ddd342b9e5f1213fe35b9bff..af04307ca6ffd20d36ec05c0b6db4f7f712a126a 100644 (file)
@@ -1,44 +1,12 @@
+// SPDX-License-Identifier: ISC AND BSD-2-Clause
 /* RB-tree */
 
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 8ac18217425a722b4dfc40f2500b2c13431defd6..b020a665f6240024c02b2d7a02cfef4294264d20 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: ISC
 /*
  * The following Red-Black tree implementation is based off code with
  * original copyright:
  *
  * Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_TYPERB_H
index 3b65a2d02a4c50839317eb4f068cf6d0b3efa6cf..0da35d0f8c185ef5c94f0ed3826505996a817b93 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 8aeabb34e61399d67ff5f690fb6ccbf03120c1f7..1e3f932565622b00906e31a7df17e6849ad6d7b4 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016-2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_TYPESAFE_H
index 5497c242803bd9a535d06c5e447059b4de681926..bbea67c12f22e850e1f99fffffb06dd6f2973efb 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Generic vector interface routine
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 71c497a1b796b3a1dd437dae413c33a1adbd496d..fcbc13257a174c014a9b3038d7f574352ba6bdaa 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Generic vector interface header.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_VECTOR_H
index 5078f3ad6ef9ad90b8e736473ca587a468d59bb2..7c313790410ea0a75fce8e90a82f87b0acde4251 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* @configure_input@
  *
  * Quagga version
  * Copyright (C) 1997, 1999 Kunihiro Ishiguro
- * 
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
  */
 
 #ifndef _ZEBRA_VERSION_H
index eea2633d4eea2a11956e89dcfbc270cb166736ab..a601046820e4291a29035de66a3e3f09dc5eb8b6 100644 (file)
@@ -1,22 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* VLAN (802.1q) common header.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef __VLAN_H__
index 7d2ca6f1e1e7f6a4d87eb0e330af50f31c742f48..a60f532f41c3c70db1361e540bbb14e5bedf28e6 100644 (file)
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRF functions.
  * Copyright (C) 2014 6WIND S.A.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -610,7 +595,7 @@ int vrf_configure_backend(enum vrf_backend_type backend)
        case VRF_BACKEND_NETNS:
        case VRF_BACKEND_VRF_LITE:
                break;
-       default:
+       case VRF_BACKEND_MAX:
                return -1;
        }
 
index 734176db904631ba2b14fc091bfd7b84851e6df4..956730bac6ad250e043253ff4162ae8ebd5d4668 100644 (file)
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRF related header.
  * Copyright (C) 2014 6WIND S.A.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_VRF_H
index 8dc078e4f3c1ab755ee3b7b548c5f3c44e0dce19..bd40433d72989b9d8bc616f93f8a65f95894902d 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRF Internal Header
  * Copyright (C) 2017 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __LIB_VRF_PRIVATE_H__
 #define __LIB_VRF_PRIVATE_H__
index 2a0bb9446ad521c8023677fe9ca8559fc550a927..76dfe9734e684edbd011417e07dc4c999d61692b 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Virtual terminal [aka TeletYpe] interface routine.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -293,7 +278,7 @@ static int vty_json_helper(struct vty *vty, struct json_object *json,
                return CMD_SUCCESS;
 
        text = json_object_to_json_string_ext(
-               json, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_NOSLASHESCAPE);
+               json, options);
        vty_out(vty, "%s\n", text);
        json_object_free(json);
 
@@ -2727,7 +2712,11 @@ static void vty_event_serv(enum vty_event event, struct vty_serv *vty_serv)
                                vty_serv->sock, &vty_serv->t_accept);
                break;
 #endif /* VTYSH */
-       default:
+       case VTY_READ:
+       case VTY_WRITE:
+       case VTY_TIMEOUT_RESET:
+       case VTYSH_READ:
+       case VTYSH_WRITE:
                assert(!"vty_event_serv() called incorrectly");
        }
 }
@@ -2766,7 +2755,8 @@ static void vty_event(enum vty_event event, struct vty *vty)
                        thread_add_timer(vty_master, vty_timeout, vty,
                                         vty->v_timeout, &vty->t_timeout);
                break;
-       default:
+       case VTY_SERV:
+       case VTYSH_SERV:
                assert(!"vty_event() called incorrectly");
        }
 }
index 45349d91af3741513cbc8faa6556191bcc7e5f57..b8c677e35465af4b2055bc3f29aa961ad3335f8f 100644 (file)
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Virtual terminal [aka TeletYpe] interface routine
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_VTY_H
index 220fd8d2323a5b1a0b97c4220555e86b888e6d40..65ff08e503b2d14303d8b61df1bad12ac405f9ae 100644 (file)
@@ -1,22 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* VxLAN common header.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef __VXLAN_H__
index f2776d6091a3806a478660eda4b9848c207df47a..4aca23481beea650f1a32fd62a9191e48a4707fc 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Timer Wheel
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "zebra.h"
 #include "linklist.h"
index 1e5a31b9a6ce83da451910aaa4167905ae780084..9aa808cdfdb74a98b27abbfa5a87fd1502923faa 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Timer Wheel
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __WHEEL_H__
 #define __WHEEL_H__
index a5338ba78bd639559c2c301d83877bd114174446..5477aadd6525de5f6505cd96e3e72d1f5f176cd2 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Quagga Work Queue Support.
  *
  * Copyright (C) 2005 Sun Microsystems, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 7866032fc00e2678220055bf8a60f1b85495d82e..c7ed14b0563eba133b5e46925bd2855d46c26f74 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Quagga Work Queues.
  *
  * Copyright (C) 2005 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_WORK_QUEUE_H
index 0d3549d0620d5c9d3d2d156234ee3ca91ddbba84..fc0ba6298f545e335ae26d736c0887a01c6f9ec0 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-20  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 37242bd79e8265b4eeb6e91f579b5d28422da0b7..b49c9eb2f247b3ff63061265c75456d82d9f0be9 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-20  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_XREF_H
index ef1cf898aaf4fec6347430e0a1f520a8fece8c65..78738f7d4d5d404172df4c78d7248d3ceb650487 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -88,6 +75,7 @@ static const char *const frr_native_modules[] = {
        "frr-interface",
        "frr-vrf",
        "frr-routing",
+       "frr-affinity-map",
        "frr-route-map",
        "frr-nexthop",
        "frr-ripd",
index 8b49df5e9119f879b30ad95ba8107d9df77bb90d..91cd641ce84ac40cf0a6a412fa70e2822d1da2ea 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_YANG_H_
index 67b7f9aa700e40473c2ac3cb50d60c095c0742f3..de668230abe63edd868f564d40a541d719bdf811 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -127,10 +114,15 @@ static void yang_mapping_add(struct yang_translator *translator, int dir,
        }
 }
 
+static void yang_tmodule_delete(struct yang_tmodule *tmodule)
+{
+       XFREE(MTYPE_YANG_TRANSLATOR_MODULE, tmodule);
+}
+
 struct yang_translator *yang_translator_load(const char *path)
 {
        struct yang_translator *translator;
-       struct yang_tmodule *tmodule;
+       struct yang_tmodule *tmodule = NULL;
        const char *family;
        struct lyd_node *dnode;
        struct ly_set *set;
@@ -160,6 +152,7 @@ struct yang_translator *yang_translator_load(const char *path)
                flog_warn(EC_LIB_YANG_TRANSLATOR_LOAD,
                          "%s: module translator \"%s\" is loaded already",
                          __func__, family);
+               yang_dnode_free(dnode);
                return NULL;
        }
 
@@ -282,15 +275,11 @@ struct yang_translator *yang_translator_load(const char *path)
 error:
        yang_dnode_free(dnode);
        yang_translator_unload(translator);
+       yang_tmodule_delete(tmodule);
 
        return NULL;
 }
 
-static void yang_tmodule_delete(struct yang_tmodule *tmodule)
-{
-       XFREE(MTYPE_YANG_TRANSLATOR_MODULE, tmodule);
-}
-
 void yang_translator_unload(struct yang_translator *translator)
 {
        for (size_t i = 0; i < YANG_TRANSLATE_MAX; i++)
index 55f396a434a589215eb8897d1a41b458f591eeac..16d55eb663bc4ca68cd9e342a2c8af0e7c5b605e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_YANG_TRANSLATOR_H_
index d22379dd237e5f68b19f83b25b1d965f44552a31..509c4dd8560cbfa41dcd9cc603fdbc13f612935e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c27e1e53721f5c097196f6bd3fa9bb38aa6d8e51..06e05872e30dda980c98732ee9e0a2a0f4ea0b5e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_NORTHBOUND_WRAPPERS_H_
index 07c7e5aea8953bfe8855e2c489fdb8a6e0c1b4c9..0e49d655280d3e3a7c9d9fd41f499dc70eba2b74 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra's client library.
  * Copyright (C) 1999 Kunihiro Ishiguro
  * Copyright (C) 2005 Andrew J. Schorr
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1035,6 +1020,7 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
         */
        if (api_nh->label_num > 0) {
                stream_putc(s, api_nh->label_num);
+               stream_putc(s, api_nh->label_type);
                stream_put(s, &api_nh->labels[0],
                           api_nh->label_num * sizeof(mpls_label_t));
        }
@@ -1397,6 +1383,7 @@ int zapi_nexthop_decode(struct stream *s, struct zapi_nexthop *api_nh,
        /* MPLS labels for BGP-LU or Segment Routing */
        if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL)) {
                STREAM_GETC(s, api_nh->label_num);
+               STREAM_GETC(s, api_nh->label_type);
                if (api_nh->label_num > MPLS_MAX_LABELS) {
                        flog_err(
                                EC_LIB_ZAPI_ENCODE,
@@ -1682,7 +1669,8 @@ int zapi_tc_class_encode(uint8_t cmd, struct stream *s, struct tc_class *class)
                stream_putq(s, class->u.htb.rate);
                stream_putq(s, class->u.htb.ceil);
                break;
-       default:
+       case TC_QDISC_UNSPEC:
+       case TC_QDISC_NOQUEUE:
                /* not implemented */
                break;
        }
@@ -1730,7 +1718,10 @@ int zapi_tc_filter_encode(uint8_t cmd, struct stream *s,
                }
                stream_putl(s, filter->u.flower.classid);
                break;
-       default:
+       case TC_FILTER_UNSPEC:
+       case TC_FILTER_BPF:
+       case TC_FILTER_FLOW:
+       case TC_FILTER_U32:
                /* not implemented */
                break;
        }
@@ -1944,6 +1935,7 @@ int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh,
                        znh->labels[i] = nh->nh_label->label[i];
 
                znh->label_num = i;
+               znh->label_type = nh->nh_label_type;
                SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
        }
 
@@ -2398,9 +2390,9 @@ static int zclient_handle_error(ZAPI_CALLBACK_ARGS)
 
 static int link_params_set_value(struct stream *s, struct interface *ifp)
 {
-       uint8_t link_params_enabled;
+       uint8_t link_params_enabled, nb_ext_adm_grp;
        struct if_link_params *iflp;
-       uint32_t bwclassnum;
+       uint32_t bwclassnum, bitmap_data;
 
        iflp = if_link_params_get(ifp);
 
@@ -2429,6 +2421,15 @@ static int link_params_set_value(struct stream *s, struct interface *ifp)
                                __func__, bwclassnum, MAX_CLASS_TYPE);
        }
        STREAM_GETL(s, iflp->admin_grp);
+
+       /* Extended Administrative Group */
+       admin_group_clear(&iflp->ext_admin_grp);
+       STREAM_GETC(s, nb_ext_adm_grp);
+       for (size_t i = 0; i < nb_ext_adm_grp; i++) {
+               STREAM_GETL(s, bitmap_data);
+               admin_group_bulk_set(&iflp->ext_admin_grp, bitmap_data, i);
+       }
+
        STREAM_GETL(s, iflp->rmt_as);
        iflp->rmt_ip.s_addr = stream_get_ipv4(s);
 
@@ -2452,9 +2453,9 @@ struct interface *zebra_interface_link_params_read(struct stream *s,
                                                   bool *changed)
 {
        struct if_link_params *iflp;
-       struct if_link_params iflp_prev;
+       struct if_link_params iflp_prev = {0};
        ifindex_t ifindex;
-       bool iflp_prev_set;
+       bool iflp_prev_set = false;
 
        STREAM_GETL(s, ifindex);
 
@@ -2467,11 +2468,13 @@ struct interface *zebra_interface_link_params_read(struct stream *s,
                return NULL;
        }
 
-       if (if_link_params_get(ifp)) {
+       iflp = if_link_params_get(ifp);
+
+       if (iflp) {
                iflp_prev_set = true;
-               memcpy(&iflp_prev, ifp->link_params, sizeof(iflp_prev));
-       } else
-               iflp_prev_set = false;
+               admin_group_init(&iflp_prev.ext_admin_grp);
+               if_link_params_copy(&iflp_prev, iflp);
+       }
 
        /* read the link_params from stream
         * Free ifp->link_params if the stream has no params
@@ -2480,24 +2483,28 @@ struct interface *zebra_interface_link_params_read(struct stream *s,
        if (link_params_set_value(s, ifp) != 0)
                goto stream_failure;
 
-       if (changed == NULL)
-               return ifp;
-
-       iflp = if_link_params_get(ifp);
+       if (changed != NULL) {
+               iflp = if_link_params_get(ifp);
 
-       if (iflp_prev_set && iflp) {
-               if (memcmp(&iflp_prev, iflp, sizeof(iflp_prev)))
-                       *changed = true;
-               else
+               if (iflp_prev_set && iflp) {
+                       if (if_link_params_cmp(&iflp_prev, iflp))
+                               *changed = false;
+                       else
+                               *changed = true;
+               } else if (!iflp_prev_set && !iflp)
                        *changed = false;
-       } else if (!iflp_prev_set && !iflp)
-               *changed = false;
-       else
-               *changed = true;
+               else
+                       *changed = true;
+       }
+
+       if (iflp_prev_set)
+               admin_group_term(&iflp_prev.ext_admin_grp);
 
        return ifp;
 
 stream_failure:
+       if (iflp_prev_set)
+               admin_group_term(&iflp_prev.ext_admin_grp);
        return NULL;
 }
 
@@ -2546,10 +2553,11 @@ stream_failure:
 size_t zebra_interface_link_params_write(struct stream *s,
                                         struct interface *ifp)
 {
-       size_t w;
+       size_t w, nb_ext_adm_grp;
        struct if_link_params *iflp;
        int i;
 
+
        if (s == NULL || ifp == NULL)
                return 0;
 
@@ -2575,6 +2583,13 @@ size_t zebra_interface_link_params_write(struct stream *s,
                w += stream_putf(s, iflp->unrsv_bw[i]);
 
        w += stream_putl(s, iflp->admin_grp);
+
+       /* Extended Administrative Group */
+       nb_ext_adm_grp = admin_group_nb_words(&iflp->ext_admin_grp);
+       w += stream_putc(s, nb_ext_adm_grp);
+       for (size_t i = 0; i < nb_ext_adm_grp; i++)
+               stream_putl(s, admin_group_get_offset(&iflp->ext_admin_grp, i));
+
        w += stream_putl(s, iflp->rmt_as);
        w += stream_put_in_addr(s, &iflp->rmt_ip);
 
index 8c4ce1b7779b60547ba5dc6ea8faa99ffa67be9c..53c7038c8874dd68e7c4d6560f6d498fba667032 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra's client header.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ZCLIENT_H
@@ -427,6 +412,7 @@ struct zapi_nexthop {
 
        /* MPLS labels for BGP-LU or Segment Routing */
        uint8_t label_num;
+       enum lsp_types_t label_type;
        mpls_label_t labels[MPLS_MAX_LABELS];
 
        struct ethaddr rmac;
index b2f5e5a848cc9a5bbde37ecd912407930a378eee..ecc87f58f10fab7214721c3c366f13794a41c91a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra common header.
  * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_H
 #include <endian.h>
 #endif
 
-/* machine dependent includes */
-#ifdef HAVE_LINUX_VERSION_H
-#include <linux/version.h>
-#endif /* HAVE_LINUX_VERSION_H */
-
-#ifdef HAVE_ASM_TYPES_H
-#include <asm/types.h>
-#endif /* HAVE_ASM_TYPES_H */
-
 /* misc include group */
 #include <stdarg.h>
 
@@ -338,6 +314,14 @@ struct in_pktinfo {
 
 #define strmatch(a,b) (!strcmp((a), (b)))
 
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define htonll(x) (((uint64_t)htonl((x)&0xFFFFFFFF) << 32) | htonl((x) >> 32))
+#define ntohll(x) (((uint64_t)ntohl((x)&0xFFFFFFFF) << 32) | ntohl((x) >> 32))
+#else
+#define htonll(x) (x)
+#define ntohll(x) (x)
+#endif
+
 #ifndef INADDR_LOOPBACK
 #define        INADDR_LOOPBACK 0x7f000001      /* Internet address 127.0.0.1.  */
 #endif
@@ -375,17 +359,25 @@ typedef enum {
                for (safi = SAFI_UNICAST; safi <= SAFI_MPLS_VPN; safi++)
 
 /* Default Administrative Distance of each protocol. */
-#define ZEBRA_KERNEL_DISTANCE_DEFAULT      0
-#define ZEBRA_CONNECT_DISTANCE_DEFAULT     0
-#define ZEBRA_STATIC_DISTANCE_DEFAULT      1
-#define ZEBRA_RIP_DISTANCE_DEFAULT       120
-#define ZEBRA_RIPNG_DISTANCE_DEFAULT     120
-#define ZEBRA_OSPF_DISTANCE_DEFAULT      110
-#define ZEBRA_OSPF6_DISTANCE_DEFAULT     110
-#define ZEBRA_ISIS_DISTANCE_DEFAULT      115
-#define ZEBRA_IBGP_DISTANCE_DEFAULT      200
-#define ZEBRA_EBGP_DISTANCE_DEFAULT       20
-#define ZEBRA_TABLE_DISTANCE_DEFAULT      15
+#define ZEBRA_KERNEL_DISTANCE_DEFAULT       0
+#define ZEBRA_CONNECT_DISTANCE_DEFAULT      0
+#define ZEBRA_STATIC_DISTANCE_DEFAULT       1
+#define ZEBRA_RIP_DISTANCE_DEFAULT        120
+#define ZEBRA_RIPNG_DISTANCE_DEFAULT      120
+#define ZEBRA_OSPF_DISTANCE_DEFAULT       110
+#define ZEBRA_OSPF6_DISTANCE_DEFAULT      110
+#define ZEBRA_ISIS_DISTANCE_DEFAULT       115
+#define ZEBRA_IBGP_DISTANCE_DEFAULT       200
+#define ZEBRA_EBGP_DISTANCE_DEFAULT        20
+#define ZEBRA_TABLE_DISTANCE_DEFAULT       15
+#define ZEBRA_EIGRP_DISTANCE_DEFAULT       90
+#define ZEBRA_NHRP_DISTANCE_DEFAULT        10
+#define ZEBRA_LDP_DISTANCE_DEFAULT        150
+#define ZEBRA_BABEL_DISTANCE_DEFAULT      100
+#define ZEBRA_SHARP_DISTANCE_DEFAULT      150
+#define ZEBRA_PBR_DISTANCE_DEFAULT        200
+#define ZEBRA_OPENFABRIC_DISTANCE_DEFAULT 115
+#define ZEBRA_MAX_DISTANCE_DEFAULT        255
 
 /* Flag manipulation macros. */
 #define CHECK_FLAG(V,F)      ((V) & (F))
@@ -411,9 +403,6 @@ typedef uint32_t route_tag_t;
 #define ROUTE_TAG_MAX UINT32_MAX
 #define ROUTE_TAG_PRI PRIu32
 
-/* Name of hook calls */
-#define ZEBRA_ON_RIB_PROCESS_HOOK_CALL "on_rib_process_dplane_results"
-
 #ifdef __cplusplus
 }
 #endif
index e08d22b2b93451ca6325b8ed3ecd2ddb5a548cdc..e05720fd9e7a8d87ddbf83a2b2b296f840e99515 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include "zebra.h"
index 6316a2ad400d95250d7d38dadbe5bd4e69fde32b..a207b29a3b6daa40b773ec73362f31c6e31601e3 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_ZLOG_H
index 60feca7fcb206f4ee5706a10e96a709b7dd635a8..5264dda0f8f02e827370790140180ca26b5a5268 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-21  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* when you work on this code, please install a fuzzer (e.g. AFL) and run
index b4a12ccbffcd23ef5ece1c99f7585d5c47e1c588..377e7be2207d39736100b515aa23a0a2e40c6ff2 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2021  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_ZLOG_5424_H
index 5eebda9debc4a4b50737746cdffc6a30a415857c..7f070afbc5759c7435bf6432826d1494e2bce1a1 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2021  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
@@ -877,7 +864,8 @@ static int log_5424_show(struct vty *vty)
                        }
                        break;
 
-               default:
+               case ZLOG_FMT_3164:
+               case ZLOG_FMT_LOCAL:
                        vty_out(vty,
                                "  structured data is not supported by the selected format\n");
                        break;
index 931aa3461d563a1fae0ccaf1c55339b003d29c7f..4d3c3508bffd6c229e70a4ff630d1745f7334e66 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019-22  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include "zebra.h"
index 55e60ae674b3534478cdcb13646cbcfb9ffb4238..17245fe198ebbfce766f543a73540b91fc123845 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019-22  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_ZLOG_LIVE_H
index f7ea48bf9d21ab1023f6c72ef5555c1f04d6896e..b0f757149256a8cb95516d4a2b4d86fe5b228e25 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include "zebra.h"
index 6faf722ffd21a33ae353ae36a9e4dc5ce5e92413..d70834e7a13856d47a58a779984174308ebbd092 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2015-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifndef _FRR_ZLOG_TARGETS_H
index 75e9f37a6803eb8c889ed1c78dd98c50287428a6..eb98166872c650658a2e0515735bec994a864fef 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP daemon Linux specific glue
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zebra.h"
index f1143a2b5ebbddbb71d74dcebf299f1241b0ea4e..7a3029b6c13376760ce12a245fcd5e341138a537 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP netlink/neighbor table API
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include <zebra.h>
index cd7fb7aed496120f215718232fe225b5611f141d..877659b4c00f9ae5b2f157c54e484f39edd867e9 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP netlink/neighbor table arpd code
  * Copyright (c) 2014-2016 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 81d9bb255f7a522e8083a38b34c4bb4134134101..31b370cbf83927921c5a918b271aa5cd1b988c7d 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP cache
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zebra.h"
@@ -330,7 +326,14 @@ static void nhrp_cache_update_timers(struct nhrp_cache *c)
                        thread_add_timer_msec(master, nhrp_cache_do_free, c, 10,
                                              &c->t_timeout);
                break;
-       default:
+       case NHRP_CACHE_INCOMPLETE:
+       case NHRP_CACHE_NEGATIVE:
+       case NHRP_CACHE_CACHED:
+       case NHRP_CACHE_DYNAMIC:
+       case NHRP_CACHE_NHS:
+       case NHRP_CACHE_STATIC:
+       case NHRP_CACHE_LOCAL:
+       case NHRP_CACHE_NUM_TYPES:
                if (c->cur.expires)
                        thread_add_timer(master, nhrp_cache_do_timeout, c,
                                         c->cur.expires - monotime(NULL),
index 741e64d8b3c02e064c5bd14bf764c3675a9c8a61..12ad7c6b68bd3c8a98941e8c65ed9e6a31e3adba 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * NHRP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d4958358febf8b088b35419ef9e96396b9e9b6f1..d7867a47852e7bcc8f25034d03470f26330ea24f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * NHRP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __NHRP_ERRORS_H__
index e46a6d17cb8a4ad6251671e90d7cc5be05828471..9c11890831527478cdab60bc4e1d40319fa5841a 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP event manager
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 4ac30a7d75ed076aacfda2ad475b70b1b895381a..d396f510ed8177f20a70f86e9cc92060dc01ac86 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP interface
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -184,16 +180,17 @@ void nhrp_interface_update_nbma(struct interface *ifp,
        struct nhrp_interface *nifp = ifp->info, *nbmanifp = NULL;
        struct interface *nbmaifp = NULL;
        union sockunion nbma;
+       struct in_addr saddr = {0};
 
        sockunion_family(&nbma) = AF_UNSPEC;
 
        if (nifp->source)
                nbmaifp = if_lookup_by_name(nifp->source, nifp->link_vrf_id);
 
-       switch (ifp->ll_type) {
-       case ZEBRA_LLT_IPGRE: {
-               struct in_addr saddr = {0};
-
+       if (ifp->ll_type != ZEBRA_LLT_IPGRE)
+               debugf(NHRP_DEBUG_IF, "%s: Ignoring non GRE interface type %u",
+                      __func__, ifp->ll_type);
+       else {
                if (!gre_info) {
                        nhrp_send_zebra_gre_request(ifp);
                        return;
@@ -214,9 +211,6 @@ void nhrp_interface_update_nbma(struct interface *ifp,
                        nbmaifp =
                                if_lookup_by_index(nifp->link_idx,
                                                   nifp->link_vrf_id);
-       } break;
-       default:
-               break;
        }
 
        if (nbmaifp)
index bece89ca79b4359bd21e8b0abe26167d7e209039..10d3c8f82fc84b4051e6ffcfc7ddcdad79e5b37a 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP daemon main functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 89be13b60d20083807cefdeb7ce6482563e2babc..cdd79e25f4a3ee7c6024fd12020a1d17b73ebc25 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP Multicast Support
  * Copyright (c) 2020-2021 4RF Limited
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 03b4b533bbac914366521ba2f887d29740fb4af1..49f881df1f6a136810b727deffdccc7a5168d349 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP NHC nexthop server functions (registration)
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zebra.h"
index 2407a8d36608b238eea18d84aae10be52e7c7a0e..ecf8aa0b132242458a1bdfc7646dd108695ec871 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP packet handling functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index e7f2eaf5a7e165a2c572804b170c31f24ae60ea9..0c9d5ade3765a703814e210da86327e1f94f6feb 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP peer functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 3b94c814d61cd8e3cee28bc17416fb44aaaa69c1..8cf1ebbcd60efa9f9e6df1a0b6bee6e7fa265c8f 100644 (file)
@@ -1,9 +1,7 @@
+// SPDX-License-Identifier: MIT
 /* nhrp_protocol.h - NHRP protocol definitions
  *
  * Copyright (c) 2007-2012 Timo Teräs <timo.teras@iki.fi>
- *
- * This software is licensed under the MIT License.
- * See MIT-LICENSE.txt for additional details.
  */
 
 #ifndef NHRP_PROTOCOL_H
index 698c6d0cdf87b94aab542044123866db0aeb4821..bf7ba5f650bb8d93f3e0cb2b1010af436e5c2030 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP routing functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -139,7 +135,17 @@ void nhrp_route_announce(int add, enum nhrp_cache_type type,
                /* Regular route, so these are announced
                 * to other routing daemons */
                break;
-       default:
+       case NHRP_CACHE_INVALID:
+       case NHRP_CACHE_INCOMPLETE:
+               /*
+                * I cannot believe that we want to set a FIB_OVERRIDE
+                * for invalid state or incomplete.  But this matches
+                * the original code.  Someone will probably notice
+                * the problem eventually
+                */
+       case NHRP_CACHE_CACHED:
+       case NHRP_CACHE_LOCAL:
+       case NHRP_CACHE_NUM_TYPES:
                SET_FLAG(api.flags, ZEBRA_FLAG_FIB_OVERRIDE);
                break;
        }
index 4975aca00672afed7e87790ca77bb5f25d6c6476..90fb1d67c285532e7afcdb8583323ee5957ff840 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP shortcut related functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index 4b45389dadd08dce35bd6fd8330a46806a478110..bffb2f6e948ddca22f176763dc998aa2aa16de9f 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP virtual connection
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zebra.h"
index 53ba9eb12f3b0d449edd47291f6db72873c38d52..40d38c44d272d1a89a47b61974ce5e77d5c081f8 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP vty handling
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zebra.h"
index 753c6e9b22b52a9636b045a787ea37bcda5526b4..c01296bee5f1cf01eadc5a407ca0453bff9f8b82 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP daemon internal structures and function prototypes
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef NHRPD_H
index 6ba2399e05562530649f0db44a3ae373c84a8f57..1dbb4e4f5eb2f3cfa1bcfab39e0cf2bf64ddbcd4 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* strongSwan VICI protocol implementation for NHRP
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -135,11 +131,6 @@ static void vici_parse_message(struct vici_conn *vici, struct zbuf *msg,
                case VICI_LIST_END:
                        debugf(NHRP_DEBUG_VICI, "VICI: List end");
                        break;
-               default:
-                       debugf(NHRP_DEBUG_VICI,
-                              "VICI: Unsupported message component type %d",
-                              *type);
-                       return;
                }
        }
 }
@@ -207,7 +198,12 @@ static void parse_sa_message(struct vici_message_ctx *ctx,
                        }
                }
                break;
-       default:
+       case VICI_START:
+       case VICI_KEY_VALUE:
+       case VICI_LIST_START:
+       case VICI_LIST_ITEM:
+       case VICI_LIST_END:
+       case VICI_END:
                if (!key || !key->ptr)
                        break;
 
@@ -286,7 +282,13 @@ static void parse_cmd_response(struct vici_message_ctx *ctx,
                    && blob2buf(val, buf, sizeof(buf)))
                        flog_err(EC_NHRP_SWAN, "VICI: strongSwan: %s", buf);
                break;
-       default:
+       case VICI_START:
+       case VICI_SECTION_START:
+       case VICI_SECTION_END:
+       case VICI_LIST_START:
+       case VICI_LIST_ITEM:
+       case VICI_LIST_END:
+       case VICI_END:
                break;
        }
 }
index 3d54f4ed50213edcd2efb520fc1fe8ea069b865e..0eb8198b84b9e0129afe12ae0a781010481de03e 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Stream/packet buffer API implementation
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index d036b104608dc08a314f413fb5ada797f873966f..23492b43c9ee5a5399972501ee4508d1d7a0194f 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Stream/packet buffer API
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef ZBUF_H
index 6030987a1bdf25bb802d7068440628228a9482dd..a65282fac3c93a9ace66eda9a671f881e70ec7bf 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Netlink helpers for zbuf
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
index fd31daaf43d10b972e3d37a93a60102295d6b22d..95dfae83f4c2ff57e5535bdb5348c4e0382326a8 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Netlink helpers for zbuf
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include "zbuf.h"
index e007709f995d90821bfe772d2ef4f89286a69d0c..0575f5abe1c68aef17abf889d265719849226753 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Area Border Router function.
  * Copyright (C) 2004 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a4dc4ddc843e32708ef82de6c7b9e681e5e3d029..7bb1619133c286df2d9ddfaa2443b10a94cbe08a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2004 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_ABR_H
index 6a4236e7174e0769d8649052174e67996b6591e7..5795690a781e6e7696223c6342952e78f3d2c1f5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1c8c5dfd3e9d2435315d294863cbb5c96c91c4c2..62b32d3762260c02226b2fd50be1c3a0b81b0158 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF_AREA_H
index 0fd6e15ed6045fa596ef72c131ab345626ac8013..05275c52eaa94bbf0992d2fd137f564c77787913 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0d2a98aebae84dd804200e9152515524b1749177..15982ca64c9e4994d62831a15557963186f95655 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2001 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_ASBR_H
index e54f6784e81395d5ef3165519222757f06776466..68817b5d085afe858c534a0be1205676bff900dc 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2021 Abhinay Ramesh
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index dea4a6e168145b23ebfc38648e54c61c7a56881e..924b89503fa189017a18369070a53d536c06b90a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2021 Abhinay Ramesh
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __OSPF6_AUTH_TRAILER_H__
index c124f17e343724f06f02273b41de9205d3e3e47c..6cc9c3013b2450a195f86a0565c7c153921173d5 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * ospf6_bfd.c: IPv6 OSPF BFD handling routines
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 651ce2a6e3ae45b95701590e55a41a2d9547b3ce..e532cccf081ab5d9ccb83625f4a0c56c73134134 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * ospf6_bfd.h: OSPF6 BFD definitions and structures
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "lib/json.h"
 #ifndef OSPF6_BFD_H
index bc9e2c340547a04f3038fcda5cb3184c55babd5e..2d2069566c60ec45689522a9b9d131333e785c4c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 75f3c065bbcbb88d8dd28939fac914bd71c4dd28..33c2c757b7c4f902f98cb828f413673447c7eaab 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_FLOOD_H
index 1f7fefa048ab92f15048fb6e22f16b2a89badf3e..c182e48f2e7a6f613127545bf0acb8a75ea705d3 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC 5187 Graceful Restart.
  *
  * Copyright 2021 NetDEF (c), All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 28798d8717dd5a753ea90e97dc4751d701ccde4a..2c7e8b341c0c1edc2a658df372491d4d42574ef4 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF6 Graceful Retsart helper functions.
  *
  * Copyright (C) 2021-22 Vmware, Inc.
  * Rajesh Kumar Girada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_GR_H
index 661d37e6371a35fc10d07623b51986f582b98172..65ce078fcbc58221526ef54963c6153da71c4fe6 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF6 Graceful Restart helper functions.
  *
  * Copyright (C) 2021-22 Vmware, Inc.
  * Rajesh Kumar Girada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d3dd5501a43c9e2778083a45a93201ec5f13880d..7a22fdf0641f96cd41524ba3a33f1fee567d3793 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9a57a7f4dec605fa73c049a17753e098a594a1ee..e04842a7c8a8b655570e97f0f880238fe57cba11 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_INTERFACE_H
index 52bb745d74cfe6f1649fef8236065bd2dd86f289..e7ce2f5f723e1769c07f6f394990f01823c9fe3a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 73cc77a56d93830e78ba91cfdc41ed95103e630e..79b5eb0ed9b0e859ee422db0add583ed27b271b8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_INTRA_H
index cd918d7475e3b5cc2a01659f5af45e66fe969413..fe085b4cb4ed8b34459e328db4bcf06ba9cce3e5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fea9aba2702d1d5d526cae019f2af8b5b9e65504..acb24d791d215166450df4cb5e49f6ecdd4ccbab 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_LSA_H
index 7a4c49a158b9bc081f3dbcba0656d142b1194e1a..0221102b59f5ce20e78355e6189435e526c676e0 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a3a4d5bb9f3a35d0feb42103fb79cc4030e75b6e..7e20b05447d6b97bca430b721d2b149eaabad319 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_LSDB_H
index 120f307adc73c82d4659df148d1e2874251af472..abc460249d684a7ed2dca8dd0c407cc178b7eb60 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1999 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3d29a65d1b15c9383bfc322ef485009c536f68bb..b7f261fcf9954de0ee8897a7a417665aea120117 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index daab98640efea2b8f178109324629cdb5062a815..1f6a7e86e037a87b0e466197f25ddf7edfd0a9bb 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1999-2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_MESSAGE_H
index a4ba1fb5696bf72fc927e9b1da97bbabfb986b2c..85002962ca9e5aa62ddffc0dcc6eeec96a7d0670 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ea4d4241528ff39142d6b800bf13e77884f3c9d0..d9abd1ff94f2f7ccab87d2c93cdd3c61dd7ef90b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_NEIGHBOR_H
index 9a549e2fc7e5b499aa649a1a23fa42bb0f588217..eddf8778e5ca577d5c733d564b2a2f231a8c481d 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3886a0d263261b6a45b3a2c44edb7c4caf8b257b..c5627212f8c0df1bea274c3a54b9637529f1bab8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_NETWORK_H
index 29210468378224d473c107bb29ce87e0d426238b..d62a3a63223df608c3bf15ef4887da6486a773fe 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFv3 Not So Stubby Area implementation.
  *
  * Copyright (C) 2021 Kaushik Nath
  * Copyright (C) 2021 Soman K.S
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <zebra.h>
index 3cc45d900dfb38e31df1e28317313ae528fa4ef3..a6bafe5abc16cbf74576b4d1b464d101fee74a52 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFv3 Not So Stubby Area implementation.
  *
  * Copyright (C) 2021 Kaushik Nath
  * Copyright (C) 2021 Soman K.S
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #ifndef OSPF6_NSSA_H
index 4d0c4ee59ec2d7c6e1357e7529537b10bb9ba409..09b7b2128826f9386a22b3ab30e942fe18121c32 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ea476b3a8d97441817c55aa4d6efbda2ca96818e..4307ee3c6ee5696b7e052d2165fee2e577be432c 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Common protocol data and data structures.
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_PROTO_H
index 9603c91a9ad78fd17cdd0e7a8c57adec6760a256..72dfa240afded489202d3804700cb89dcc442e01 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 71a84a5c5dc890b3a027af9817bfe3953892016e..2d4fcc930ece401d3959ca84f9c11044f96c03d3 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_ROUTE_H
index faa992e026567be5ef9624a2bf44536c26b6971c..4ccec4fb38e928812f30cf1ce28d75e17bd639f6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 181e71a8c5d67737ccc61c36b2a258f3ee6887e1..74c1827709ac52fd23d766abe2e4e5fd193589db 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_OSPF6_ROUTEMAP_NB_H_
index cd0a3260d549f88b8ce2b234332eb01616b4ef10..ad2d5710854cf825a3ab5e2da7d49325cea60dc8 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1070474d0f59636b9f2485834de4f539f0e5370c..46fa27dd9e931e031030fce8f60d3d42086dbdf6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPFv3 SNMP support
  * Copyright (C) 2004 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index aac371ebbbafe805ecec46b1b0b04bca980c14ee..112934bf1eb25021e9349f01c3b1dbc8fdc22b85 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Shortest Path First calculation for OSPFv3 */
index cc52d168614e8086dda7c53a3c5ababe01101b37..55ca3ec4fe9ea5a37b647be05a2fb02b418b6ce2 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_SPF_H
index 785a48a0a10218ec0e0eb725d5206332b6f39d04..bd5aedb45efde32ede8e610da041305127ae87f6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9dddd465fe2c6c78b592a61fe6326b1a20d272f0..08595a69d0c2f9b661fcd425473f29c5e00aab8c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_TOP_H
index f1a4209a8eaa0fe728805caa7761bd5af67afd3c..6fe0a24926738c190d54040ef7f732d0c343b9c1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 572bed9f599753e31b364f5ee8517f1f1b268c93..eb6d919b37273b9c6fbdb501aa58aa1e27060017 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6_ZEBRA_H
index fe742b912fb0ebb6386416e72c85270010e0a713..257a0f2b0eaf6b0de6ca0db61848a083a55cc83c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 43549de741c0e57821c91e1db10c5eb8d9388d08..234a0e881d9f89dbcebda659827442b927571af4 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef OSPF6D_H
diff --git a/ospfclient/COPYING b/ospfclient/COPYING
deleted file mode 100644 (file)
index b8cf3a1..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-
-       Appendix: How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) 19yy name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
index 4982cd885e6ac8c910cedb12317cbb5c65cd59c0..c5bbc01501595abcaf13e722bed76830b0755941 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Client side of OSPF API.
  * Copyright (C) 2001, 2002, 2003 Ralph Keller
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b904937c2ab0da2e0c521b4dc0bdae09c69dae65..c90b1fb7c15b2fcbc37cf514a8c4d4e70e107138 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Client side of OSPF API.
  * Copyright (C) 2001, 2002, 2003 Ralph Keller
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _OSPF_APICLIENT_H
index edf814184ac2b9ca581faccb8f2259549de2b865..cbc53ad3533fed42a517e5d346886d6d23bb3536 100644 (file)
@@ -1,18 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 8e3c68445f018c13db619ca875e8d4e7bdd0df72..7477ef819109c7626852b4e6a276d08581224105 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # December 22 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright 2021-2022, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 
 import argparse
 import asyncio
@@ -255,6 +242,16 @@ def nsm_name(state):
     return names.get(state, str(state))
 
 
+class WithNothing:
+    "An object that does nothing when used with `with` statement."
+
+    async def __aenter__(self):
+        return
+
+    async def __aexit__(self, *args, **kwargs):
+        return
+
+
 # --------------
 # Client Classes
 # --------------
@@ -560,15 +557,17 @@ class OspfOpaqueClient(OspfApiClient):
 
     Args:
         server: hostname or IP address of server default is "localhost"
+        wait_ready: if True then wait for OSPF to signal ready, in newer versions
+            FRR ospfd is always ready so this overhead can be skipped.
+            default is False.
 
     Raises:
         Will raise exceptions for failures with various `socket` modules
         functions such as `socket.socket`, `socket.setsockopt`, `socket.bind`.
     """
 
-    def __init__(self, server="localhost"):
+    def __init__(self, server="localhost", wait_ready=False):
         handlers = {
-            MSG_READY_NOTIFY: self._ready_msg,
             MSG_LSA_UPDATE_NOTIFY: self._lsa_change_msg,
             MSG_LSA_DELETE_NOTIFY: self._lsa_change_msg,
             MSG_NEW_IF: self._if_msg,
@@ -578,9 +577,13 @@ class OspfOpaqueClient(OspfApiClient):
             MSG_REACHABLE_CHANGE: self._reachable_msg,
             MSG_ROUTER_ID_CHANGE: self._router_id_msg,
         }
+        if wait_ready:
+            handlers[MSG_READY_NOTIFY] = self._ready_msg
+
         super().__init__(server, handlers)
 
-        self.ready_lock = Lock()
+        self.wait_ready = wait_ready
+        self.ready_lock = Lock() if wait_ready else WithNothing()
         self.ready_cond = {
             LSA_TYPE_OPAQUE_LINK: {},
             LSA_TYPE_OPAQUE_AREA: {},
@@ -617,13 +620,9 @@ class OspfOpaqueClient(OspfApiClient):
             mp = struct.pack(msg_fmt[mt], lsa_type, otype)
             await self.msg_send_raises(mt, mp)
 
-    async def _assure_opaque_ready(self, lsa_type, otype):
-        async with self.ready_lock:
-            if self.ready_cond[lsa_type].get(otype) is True:
-                return
-
-        await self._register_opaque_data(lsa_type, otype)
-        await self.wait_opaque_ready(lsa_type, otype)
+            # If we are not waiting, mark ready for register check
+            if not self.wait_ready:
+                self.ready_cond[lsa_type][otype] = True
 
     async def _handle_msg_loop(self):
         try:
@@ -656,6 +655,8 @@ class OspfOpaqueClient(OspfApiClient):
         return lsa
 
     async def _ready_msg(self, mt, msg, extra, lsa_type, otype, addr):
+        assert self.wait_ready
+
         if lsa_type == LSA_TYPE_OPAQUE_LINK:
             e = "ifaddr {}".format(ip(addr))
         elif lsa_type == LSA_TYPE_OPAQUE_AREA:
@@ -825,6 +826,7 @@ class OspfOpaqueClient(OspfApiClient):
         Raises:
             See `msg_send_raises`
         """
+        assert self.ready_cond.get(lsa_type, {}).get(otype) is True, "Not Registered!"
 
         if lsa_type == LSA_TYPE_OPAQUE_LINK:
             ifaddr, aid = int(addr), 0
@@ -842,7 +844,6 @@ class OspfOpaqueClient(OspfApiClient):
             *OspfOpaqueClient._opaque_args(lsa_type, otype, oid, data),
         )
         msg += data
-        await self._assure_opaque_ready(lsa_type, otype)
         await self.msg_send_raises(mt, msg)
 
     async def delete_opaque_data(self, addr, lsa_type, otype, oid, flags=0):
@@ -854,21 +855,31 @@ class OspfOpaqueClient(OspfApiClient):
         Args:
             addr: depends on lsa_type, LINK => ifaddr, AREA => area ID, AS => ignored
             lsa_type: LSA_TYPE_OPAQUE_{LINK,AREA,AS}
-            otype: (octet) opaque type. Note: the type will be registered if the user
-                has not explicity done that yet with `register_opaque_data`.
+            otype: (octet) opaque type.
             oid: (3 octets) ID of this opaque data
             flags: (octet) optional flags (e.g., OSPF_API_DEL_ZERO_LEN_LSA, defaults to no flags)
         Raises:
             See `msg_send_raises`
         """
-        if (lsa_type, otype) in self.opaque_change_cb:
-            del self.opaque_change_cb[(lsa_type, otype)]
+        assert self.ready_cond.get(lsa_type, {}).get(otype) is True, "Not Registered!"
 
         mt = MSG_DELETE_REQUEST
-        await self._assure_opaque_ready(lsa_type, otype)
         mp = struct.pack(msg_fmt[mt], int(addr), lsa_type, otype, flags, oid)
         await self.msg_send_raises(mt, mp)
 
+    async def is_registered(self, lsa_type, otype):
+        """Determine if an (lsa_type, otype) tuple has been registered with FRR
+
+        This determines if the type has been registered, but not necessarily if it is
+        ready, if that is required use the `wait_opaque_ready` metheod.
+
+        Args:
+            lsa_type: LSA_TYPE_OPAQUE_{LINK,AREA,AS}
+            otype: (octet) opaque type.
+        """
+        async with self.ready_lock:
+            return self.ready_cond.get(lsa_type, {}).get(otype) is not None
+
     async def register_opaque_data(self, lsa_type, otype, callback=None):
         """Register intent to advertise opaque data.
 
@@ -878,8 +889,7 @@ class OspfOpaqueClient(OspfApiClient):
 
         Args:
             lsa_type: LSA_TYPE_OPAQUE_{LINK,AREA,AS}
-            otype: (octet) opaque type. Note: the type will be registered if the user
-                has not explicity done that yet with `register_opaque_data`.
+            otype: (octet) opaque type.
             callback: if given, callback will be called when changes are received for
                 LSA of the given (lsa_type, otype). The callbacks signature is:
 
@@ -895,6 +905,10 @@ class OspfOpaqueClient(OspfApiClient):
         Raises:
             See `msg_send_raises`
         """
+        assert not await self.is_registered(
+            lsa_type, otype
+        ), "Registering registered type"
+
         if callback:
             self.opaque_change_cb[(lsa_type, otype)] = callback
         elif (lsa_type, otype) in self.opaque_change_cb:
@@ -913,6 +927,8 @@ class OspfOpaqueClient(OspfApiClient):
             if cond is True:
                 return
 
+            assert self.wait_ready
+
             logging.debug(
                 "waiting for ready %s opaque-type %s", lsa_typename(lsa_type), otype
             )
@@ -933,8 +949,7 @@ class OspfOpaqueClient(OspfApiClient):
 
         Args:
             lsa_type: LSA_TYPE_OPAQUE_{LINK,AREA,AS}
-            otype: (octet) opaque type. Note: the type will be registered if the user
-                has not explicity done that yet with `register_opaque_data`.
+            otype: (octet) opaque type.
             callback: if given, callback will be called when changes are received for
                 LSA of the given (lsa_type, otype). The callbacks signature is:
 
@@ -951,17 +966,8 @@ class OspfOpaqueClient(OspfApiClient):
 
             See `msg_send_raises`
         """
-        if callback:
-            self.opaque_change_cb[(lsa_type, otype)] = callback
-        elif (lsa_type, otype) in self.opaque_change_cb:
-            logging.warning(
-                "OSPFCLIENT: register: removing callback for %s opaque-type %s",
-                lsa_typename(lsa_type),
-                otype,
-            )
-            del self.opaque_change_cb[(lsa_type, otype)]
-
-        return await self._assure_opaque_ready(lsa_type, otype)
+        await self.register_opaque_data(lsa_type, otype, callback)
+        await self.wait_opaque_ready(lsa_type, otype)
 
     async def unregister_opaque_data(self, lsa_type, otype):
         """Unregister intent to advertise opaque data.
@@ -971,11 +977,13 @@ class OspfOpaqueClient(OspfApiClient):
 
         Args:
             lsa_type: LSA_TYPE_OPAQUE_{LINK,AREA,AS}
-            otype: (octet) opaque type. Note: the type will be registered if the user
-                has not explicity done that yet with `register_opaque_data`.
+            otype: (octet) opaque type.
         Raises:
             See `msg_send_raises`
         """
+        assert await self.is_registered(
+            lsa_type, otype
+        ), "Unregistering unregistered type"
 
         if (lsa_type, otype) in self.opaque_change_cb:
             del self.opaque_change_cb[(lsa_type, otype)]
@@ -1081,6 +1089,17 @@ class OspfOpaqueClient(OspfApiClient):
 # ================
 # CLI/Script Usage
 # ================
+def next_action(action_list=None):
+    "Get next action from list or STDIN"
+    if action_list:
+        for action in action_list:
+            yield action
+    else:
+        while True:
+            action = input("")
+            if not action:
+                break
+            yield action.strip()
 
 
 async def async_main(args):
@@ -1099,50 +1118,53 @@ async def async_main(args):
         await c.req_ism_states()
         await c.req_nsm_states()
 
-        if args.actions:
-            for action in args.actions:
-                _s = action.split(",")
-                what = _s.pop(False)
-                if what.casefold() == "wait":
-                    stime = int(_s.pop(False))
-                    logging.info("waiting %s seconds", stime)
-                    await asyncio.sleep(stime)
-                    logging.info("wait complete: %s seconds", stime)
-                    continue
-                ltype = int(_s.pop(False))
-                if ltype == 11:
-                    addr = ip(0)
-                else:
-                    aval = _s.pop(False)
-                    try:
-                        addr = ip(int(aval))
-                    except ValueError:
-                        addr = ip(aval)
-                oargs = [addr, ltype, int(_s.pop(False)), int(_s.pop(False))]
-                if what.casefold() == "add":
+        for action in next_action(args.actions):
+            _s = action.split(",")
+            what = _s.pop(False)
+            if what.casefold() == "wait":
+                stime = int(_s.pop(False))
+                logging.info("waiting %s seconds", stime)
+                await asyncio.sleep(stime)
+                logging.info("wait complete: %s seconds", stime)
+                continue
+            ltype = int(_s.pop(False))
+            if ltype == 11:
+                addr = ip(0)
+            else:
+                aval = _s.pop(False)
+                try:
+                    addr = ip(int(aval))
+                except ValueError:
+                    addr = ip(aval)
+            oargs = [addr, ltype, int(_s.pop(False)), int(_s.pop(False))]
+
+            if not await c.is_registered(oargs[1], oargs[2]):
+                await c.register_opaque_data_wait(oargs[1], oargs[2])
+
+            if what.casefold() == "add":
+                try:
+                    b = bytes.fromhex(_s.pop(False))
+                except IndexError:
+                    b = b""
+                logging.info("opaque data is %s octets", len(b))
+                # Needs to be multiple of 4 in length
+                mod = len(b) % 4
+                if mod:
+                    b += b"\x00" * (4 - mod)
+                    logging.info("opaque padding to %s octets", len(b))
+
+                await c.add_opaque_data(*oargs, b)
+            else:
+                assert what.casefold().startswith("del")
+                f = 0
+                if len(_s) >= 1:
                     try:
-                        b = bytes.fromhex(_s.pop(False))
+                        f = int(_s.pop(False))
                     except IndexError:
-                        b = b""
-                    logging.info("opaque data is %s octets", len(b))
-                    # Needs to be multiple of 4 in length
-                    mod = len(b) % 4
-                    if mod:
-                        b += b"\x00" * (4 - mod)
-                        logging.info("opaque padding to %s octets", len(b))
-
-                    await c.add_opaque_data(*oargs, b)
-                else:
-                    assert what.casefold().startswith("del")
-                    f = 0
-                    if len(_s) >= 1:
-                        try:
-                            f = int(_s.pop(False))
-                        except IndexError:
-                            f = 0
-                    await c.delete_opaque_data(*oargs, f)
-            if args.exit:
-                return 0
+                        f = 0
+                await c.delete_opaque_data(*oargs, f)
+        if not args.actions or args.exit:
+            return 0
     except Exception as error:
         logging.error("async_main: unexpected error: %s", error, exc_info=True)
         return 2
@@ -1158,19 +1180,23 @@ async def async_main(args):
 
 def main(*args):
     ap = argparse.ArgumentParser(args)
+    ap.add_argument("--logtag", default="CLIENT", help="tag to identify log messages")
     ap.add_argument("--exit", action="store_true", help="Exit after commands")
     ap.add_argument("--server", default="localhost", help="OSPF API server")
     ap.add_argument("-v", "--verbose", action="store_true", help="be verbose")
     ap.add_argument(
         "actions",
         nargs="*",
-        help="(ADD|DEL),LSATYPE,[ADDR,],OTYPE,OID,[HEXDATA|DEL_FLAG]",
+        help="WAIT,SEC|(ADD|DEL),LSATYPE,[ADDR,],OTYPE,OID,[HEXDATA|DEL_FLAG]",
     )
     args = ap.parse_args()
 
     level = logging.DEBUG if args.verbose else logging.INFO
     logging.basicConfig(
-        level=level, format="%(asctime)s %(levelname)s: CLIENT: %(name)s %(message)s"
+        level=level,
+        format="%(asctime)s %(levelname)s: {}: %(name)s %(message)s".format(
+            args.logtag
+        ),
     )
 
     logging.info("ospfclient: starting")
index 4746b2fc66a74030fed0a2a582eec4df9c0dd1c3..8f177cbce168129111ba95b2fdb0604b4c966525 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF ABR functions.
  * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
@@ -1574,6 +1559,254 @@ static void ospf_abr_announce_stub_defaults(struct ospf *ospf)
                zlog_debug("%s: Stop", __func__);
 }
 
+/** @brief Function to check and generate indication
+ *        LSA for area on which we received
+ *        indication LSA flush.
+ *  @param Ospf instance.
+ *  @param Area on which indication lsa flush is to be generated.
+ *  @return Void.
+ */
+void ospf_generate_indication_lsa(struct ospf *ospf, struct ospf_area *area)
+{
+       bool area_fr_not_supp = false;
+
+       /* Check if you have any area which doesn't support
+        * flood reduction.
+        */
+
+       area_fr_not_supp = ospf_check_fr_enabled_all(ospf) ? false : true;
+
+       /* If any one of the area doestn't support FR, generate
+        * indication LSA on behalf of that area.
+        */
+
+       if (area_fr_not_supp && !area->fr_info.area_ind_lsa_recvd &&
+           !area->fr_info.indication_lsa_self &&
+           !area->fr_info.area_dc_clear) {
+
+               struct prefix_ipv4 p;
+               struct ospf_lsa *new;
+
+               p.family = AF_INET;
+               p.prefix = ospf->router_id;
+               p.prefixlen = IPV4_MAX_BITLEN;
+
+               new = ospf_summary_asbr_lsa_originate(&p, OSPF_LS_INFINITY,
+                                                     area);
+               if (!new) {
+                       zlog_debug("%s: Indication lsa originate failed",
+                                  __func__);
+                       return;
+               }
+               /* save the indication lsa for that area */
+               area->fr_info.indication_lsa_self = new;
+       }
+}
+
+/** @brief Function to receive and process indication LSA
+ *        flush from area.
+ *  @param lsa being flushed.
+ *  @return Void.
+ */
+void ospf_recv_indication_lsa_flush(struct ospf_lsa *lsa)
+{
+       if (!IS_LSA_SELF(lsa) && IS_LSA_MAXAGE(lsa) &&
+           ospf_check_indication_lsa(lsa)) {
+               lsa->area->fr_info.area_ind_lsa_recvd = false;
+
+               OSPF_LOG_INFO("%s: Received an ind lsa: %pI4 area %pI4",
+                             __func__, &lsa->data->id, &lsa->area->area_id);
+
+               if (!IS_OSPF_ABR(lsa->area->ospf))
+                       return;
+
+               /* If the LSA received is a indication LSA with maxage on
+                * the network, then check and regenerate indication
+                * LSA if any of our areas don't support flood reduction.
+                */
+               ospf_generate_indication_lsa(lsa->area->ospf, lsa->area);
+       }
+}
+
+/** @brief Function to generate indication LSAs.
+ *  @param Ospf instance.
+ *  @param Area on behalf of which indication
+ *        LSA is generated LSA.
+ *  @return Void.
+ */
+void ospf_abr_generate_indication_lsa(struct ospf *ospf,
+                                     const struct ospf_area *area)
+{
+       struct ospf_lsa *new;
+       struct listnode *node;
+       struct ospf_area *o_area;
+
+       for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, o_area)) {
+               if (o_area == area)
+                       continue;
+
+               if (o_area->fr_info.indication_lsa_self ||
+                   o_area->fr_info.area_ind_lsa_recvd ||
+                   o_area->fr_info.area_dc_clear) {
+                       /* if the area has already received an
+                        * indication LSA or if area already has
+                        * LSAs with DC bit 0 other than
+                        * indication LSA then don't generate
+                        * indication LSA in those areas.
+                        */
+                       OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                                      "Area %pI4 has LSAs with dc bit clear",
+                                      &o_area->area_id);
+                       continue;
+
+               } else {
+
+                       struct prefix_ipv4 p;
+
+                       p.family = AF_INET;
+                       p.prefix = ospf->router_id;
+                       p.prefixlen = IPV4_MAX_BITLEN;
+
+                       new = ospf_summary_asbr_lsa_originate(
+                               &p, OSPF_LS_INFINITY, o_area);
+                       if (!new) {
+                               zlog_debug(
+                                       "%s: Indication lsa originate Failed",
+                                       __func__);
+                               return;
+                       }
+                       /* save the indication lsa for that area */
+                       o_area->fr_info.indication_lsa_self = new;
+               }
+       }
+}
+
+/** @brief Flush the indication LSA from all the areas
+ *        of ospf instance.
+ *  @param Ospf instance.
+ *  @return Void.
+ */
+void ospf_flush_indication_lsas(struct ospf *ospf)
+{
+       struct ospf_area *area;
+       struct listnode *node;
+
+       for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
+               if (area->fr_info.indication_lsa_self) {
+                       OSPF_LOG_INFO(
+                               "Flushing ind lsa: %pI4 area %pI4",
+                               &area->fr_info.indication_lsa_self->data->id,
+                               &area->area_id);
+                       ospf_schedule_lsa_flush_area(
+                               area, area->fr_info.indication_lsa_self);
+                       area->fr_info.indication_lsa_self = NULL;
+               }
+       }
+}
+
+/** @brief Check if flood reduction is enabled on
+ *        all the areas.
+ *  @param Ospf instance.
+ *  @return Void.
+ */
+bool ospf_check_fr_enabled_all(struct ospf *ospf)
+{
+       const struct ospf_area *area;
+       struct listnode *node;
+
+       for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area))
+               if (!ospf_check_area_fr_enabled(area))
+                       return false;
+
+       return true;
+}
+
+/** @brief Abr function to check conditions for generation
+ *        of indication. LSAs/announcing non-DNA routers
+ *        in the area.
+ *  @param thread
+ *  @return 0.
+ */
+static void ospf_abr_announce_non_dna_routers(struct thread *thread)
+{
+       struct ospf_area *area;
+       struct listnode *node;
+       struct ospf *ospf = THREAD_ARG(thread);
+
+       THREAD_OFF(ospf->t_abr_fr);
+
+       if (!IS_OSPF_ABR(ospf))
+               return;
+
+       OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT, "%s(): Start", __func__);
+
+       for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                              "%s: Area %pI4 FR enabled: %d", __func__,
+                              &area->area_id, area->fr_info.enabled);
+               OSPF_LOG_DEBUG(
+                       IS_DEBUG_OSPF_EVENT,
+                       "LSA with DC bit clear: %d Recived indication LSA: %d",
+                       area->fr_info.area_dc_clear,
+                       area->fr_info.area_ind_lsa_recvd);
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT, "FR state change: %d",
+                              area->fr_info.state_changed);
+               if (!OSPF_IS_AREA_BACKBONE(area) &&
+                   area->fr_info.area_dc_clear) {
+                       /* rfc4136 rfc1793: Suppose if the abr is connected to
+                        * a regular non-backbone OSPF area, Furthermore if
+                        * the area has LSAs with the DC-bit clear, other
+                        * than indication-LSAs. Then originate indication-LSAs
+                        * into all other directly-connected "regular" areas,
+                        * including the backbone area.
+                        */
+                       ospf_abr_generate_indication_lsa(ospf, area);
+               }
+
+               if (OSPF_IS_AREA_BACKBONE(area) &&
+                   (area->fr_info.area_dc_clear ||
+                    area->fr_info.area_ind_lsa_recvd)) {
+                       /* rfc4136 rfc1793: Suppose if the abr is connected to
+                        * backbone OSPF area. Furthermore, if backbone has
+                        * LSAs with the DC-bit clear that are either
+                        * a) not indication-LSAs or indication-LSAs or
+                        * b) indication-LSAs that have been originated by
+                        *    other routers,
+                        * then originate indication-LSAs into all other
+                        * directly-connected "regular" non-backbone areas.
+                        */
+                       ospf_abr_generate_indication_lsa(ospf, area);
+               }
+
+               if (area->fr_info.enabled && area->fr_info.state_changed &&
+                   area->fr_info.indication_lsa_self) {
+                       /* Ospf area flood reduction state changed
+                        * area now supports flood reduction.
+                        * check if all other areas support flood reduction
+                        * if yes then flush indication LSAs generated in
+                        * all the areas.
+                        */
+                       if (ospf_check_fr_enabled_all(ospf))
+                               ospf_flush_indication_lsas(ospf);
+
+                       area->fr_info.state_changed = false;
+               }
+
+               /* If previously we had generated indication lsa
+                * but now area has lsas with dc bit set to 0
+                * apart from indication lsa, we'll clear indication lsa
+                */
+               if (area->fr_info.area_dc_clear &&
+                   area->fr_info.indication_lsa_self) {
+                       ospf_schedule_lsa_flush_area(
+                               area, area->fr_info.indication_lsa_self);
+                       area->fr_info.indication_lsa_self = NULL;
+               }
+       }
+
+       OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT, "%s(): Stop", __func__);
+}
+
 static int ospf_abr_remove_unapproved_translates_apply(struct ospf *ospf,
                                                       struct ospf_lsa *lsa)
 {
@@ -1628,9 +1861,13 @@ static void ospf_abr_remove_unapproved_summaries(struct ospf *ospf)
                                        ospf_lsa_flush_area(lsa, area);
 
                LSDB_LOOP (ASBR_SUMMARY_LSDB(area), rn, lsa)
-                       if (ospf_lsa_is_self_originated(ospf, lsa))
-                               if (!CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED))
-                                       ospf_lsa_flush_area(lsa, area);
+                       if (ospf_lsa_is_self_originated(ospf, lsa) &&
+                           !CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED) &&
+                           /* Do not remove indication LSAs while
+                            * flushing unapproved summaries.
+                            */
+                           !ospf_check_indication_lsa(lsa))
+                               ospf_lsa_flush_area(lsa, area);
        }
 
        if (IS_DEBUG_OSPF_EVENT)
@@ -1793,6 +2030,20 @@ void ospf_abr_task(struct ospf *ospf)
                if (IS_DEBUG_OSPF_EVENT)
                        zlog_debug("%s: announce stub defaults", __func__);
                ospf_abr_announce_stub_defaults(ospf);
+
+               if (ospf->fr_configured) {
+                       OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                                      "%s(): announce non-DNArouters",
+                                      __func__);
+                       /*
+                        * Schedule indication lsa generation timer,
+                        * giving time for route synchronization in
+                        * all the routers.
+                        */
+                       thread_add_timer(
+                               master, ospf_abr_announce_non_dna_routers, ospf,
+                               OSPF_ABR_DNA_TIMER, &ospf->t_abr_fr);
+               }
        }
 
        if (IS_DEBUG_OSPF_EVENT)
index c523638fb3cac217db4c1c15b7051dd3ce62c71d..19d444b125cf06aa2321b10faa10c4c2731f8675 100644 (file)
@@ -1,28 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF ABR functions.
  * Copyright (C) 1999 Alex Zinin
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ABR_H
 #define _ZEBRA_OSPF_ABR_H
 
 #define OSPF_ABR_TASK_DELAY    5
+#define OSPF_ABR_DNA_TIMER 10
+/* Delay in announceing Non-DNA routers
+ * so that LSAs are completely synced
+ * before generating indication LSAs.
+ */
 
 #define OSPF_AREA_RANGE_ADVERTISE      (1 << 0)
 #define OSPF_AREA_RANGE_SUBSTITUTE     (1 << 1)
@@ -84,4 +74,20 @@ extern void ospf_schedule_abr_task(struct ospf *);
 extern void ospf_abr_announce_network_to_area(struct prefix_ipv4 *, uint32_t,
                                              struct ospf_area *);
 extern void ospf_abr_nssa_check_status(struct ospf *ospf);
+extern void ospf_abr_generate_indication_lsa(struct ospf *ospf,
+                                            const struct ospf_area *area);
+extern void ospf_flush_indication_lsas(struct ospf *ospf);
+extern void ospf_generate_indication_lsa(struct ospf *ospf,
+                                        struct ospf_area *area);
+extern bool ospf_check_fr_enabled_all(struct ospf *ospf);
+extern void ospf_recv_indication_lsa_flush(struct ospf_lsa *lsa);
+
+/** @brief Static inline functions.
+ *  @param Area pointer.
+ *  @return area Flood Reduction status.
+ */
+static inline bool ospf_check_area_fr_enabled(const struct ospf_area *area)
+{
+       return area->fr_info.enabled ? true : false;
+}
 #endif /* _ZEBRA_OSPF_ABR_H */
index 9a134d033c339ddbead85c6c6f950a14a86fce81..3cb1287be5d04cd8f12130540d2bdf8421c4a045 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * API message handling module for OSPF daemon and client.
  * Copyright (C) 2001, 2002 Ralph Keller
  * Copyright (c) 2022, LabN Consulting, L.L.C.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fd741c3c484c3edcab13f61b33d28b0972c7ff42..6c8bed3d8fc5181174accfb96d5e01fae31df378 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * API message handling module for OSPF daemon and client.
  * Copyright (C) 2001, 2002 Ralph Keller
  * Copyright (c) 2022, LabN Consulting, L.L.C.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 6fd1c82c2447ab2ea406df295fb2231d271e8520..5e4fc30a2880417d9be8a0faf3114ae2df06b871 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Server side of OSPF API.
  * Copyright (C) 2001, 2002 Ralph Keller
  * Copyright (c) 2022, LabN Consulting, L.L.C.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -2593,9 +2578,12 @@ static inline int cmp_route_nodes(struct route_node *orn,
                return 1;
        else if (!nrn)
                return -1;
-       else if (orn->p.u.prefix4.s_addr < nrn->p.u.prefix4.s_addr)
+
+       uint32_t opn = ntohl(orn->p.u.prefix4.s_addr);
+       uint32_t npn = ntohl(nrn->p.u.prefix4.s_addr);
+       if (opn < npn)
                return -1;
-       else if (orn->p.u.prefix4.s_addr > nrn->p.u.prefix4.s_addr)
+       else if (opn > npn)
                return 1;
        else
                return 0;
index 0a6b7319a04428f102aba1b2f4a861800314b461..a90d18573b8ad0650df3138ab7f0eba065ce85db 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Server side of OSPF API.
  * Copyright (C) 2001, 2002 Ralph Keller
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _OSPF_APISERVER_H
index 2d746946a5c2f59e07c750713ec5c5611d68d55f..5b5367811be1f5ef20d48a02ff9c91908bf3235b 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF AS Boundary Router functions.
  * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f7dbca75878d1138b56b103d7245d328a62ec1ed..6b427c5fd20e84afa50b0cc9c0c49bebc05e6b38 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF AS Boundary Router functions.
  * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ASBR_H
index 706a22e9bfae2be35112196b3cb3b02a560361ef..b43f0cb378c2186fdcc2e72746054a3c136de9e6 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF AS external route calculation.
  * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 195d658c024bc7698cc641fc60972835f856d9b9..d59a470ceb50d31294f152ac369876081a4e1ce4 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF AS External route calculation.
  * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ASE_H
index fb117ecfc21b0a21926b01856555ebb811983925..0b0016745d421e64ffd8f1fe2d84a104a56f36f5 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * ospf_bfd.c: OSPF BFD handling routines
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9393c839f501c69698f37e955c43c81095302f54..3c4e1e6c5f43c44a693b59eecb6d952b17a6ca0f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * ospf_bfd.h: OSPF BFD definitions and structures
  *
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_BFD_H
index c1f4b2306958be92e1f7459e6472f2bf1a5825d5..de51500b0a06c63d92be3af561ab12f63221d0ce 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd dump routine.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 251be7c8d177f65f0ae83735f3a4995b01772371..596d49256f478b2464f7a1112ef13043b613156a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd dump routine.
  * Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_DUMP_H
index 4b68b006e2b1241b39770e9279cbd285afff598c..8400310ca1b6451e3fa5ea423013c9db7bfadb13 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd dump routine (parts used by ospfclient).
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 98fef34b15cc9008cd82fe89da63ef6ea03a9a47..34da1137468d2b0fc0f4de2ccbdb0661039913c3 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd dump routine (parts used by ospfclient).
  * Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of FRRouting (FRR).
- *
- * FRR is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2, or (at your option) any later version.
- *
- * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_DUMP_API_H
index 2de77a43f6bc04d8d2918162d3959b3cc70ee8b2..16aa3ab5267f9e378b1e5f527e01fce715910a66 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *             Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index df5bdaa491240f3dfe9eca39b355c796aa61b77e..dcf9a65ce939b08545280a32448f1ec4c3335c4c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *             Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __OSPF_ERRORS_H__
index 1288686a1028e5bfe3f26699030280054d16cd97..5faaed076b4019380652de2533953cbd57cd37ed 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC7684 OSPFv2 Prefix/Link Attribute
  * Advertisement
@@ -8,20 +9,6 @@
  * Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
  *
  * Copyright (C) 2016 - 2018 Orange Labs http://www.orange.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b1e4feb6df0b5b7aa0ef4c1ffa81ab70407a114f..535e548b83f464dc721ffd6913279c745df59987 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC7684 OSPFv2 Prefix/Link Attribute
  * Advertisement
@@ -8,20 +9,6 @@
  * Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
  *
  * Copyright (C) 2016 - 2018 Orange Labs http://www.orange.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_OSPF_EXT_PREF_H_
index 4bbeee2d74d587aaa7e0eacc8f9ab5f93da597ee..d0453bbc4ad580e3cef5bc6b762562f9b64b1f83 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Flooding -- RFC2328 Section 13.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
 
 extern struct zclient *zclient;
 
+/** @brief Function to refresh type-5 and type-7 DNA
+ *        LSAs when we receive an indication LSA.
+ *  @param Ospf instance.
+ *  @return Void.
+ */
+void ospf_refresh_dna_type5_and_type7_lsas(struct ospf *ospf)
+{
+       struct route_node *rn;
+       struct ospf_lsa *lsa = NULL;
+
+       LSDB_LOOP (EXTERNAL_LSDB(ospf), rn, lsa)
+               if (IS_LSA_SELF(lsa) &&
+                   CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE))
+                       ospf_lsa_refresh(ospf, lsa);
+
+       LSDB_LOOP (NSSA_LSDB(ospf), rn, lsa)
+               if (IS_LSA_SELF(lsa) &&
+                   CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE))
+                       ospf_lsa_refresh(ospf, lsa);
+}
+
+/** @brief Function to update area flood reduction states.
+ *  @param area pointer.
+ *  @return Void.
+ */
+void ospf_area_update_fr_state(struct ospf_area *area)
+{
+       unsigned int count_router_lsas = 0;
+
+       if (area == NULL)
+               return;
+
+       count_router_lsas =
+               (unsigned int)(ospf_lsdb_count(area->lsdb, OSPF_ROUTER_LSA) -
+                              ospf_lsdb_count_self(area->lsdb,
+                                                   OSPF_ROUTER_LSA));
+
+       if (count_router_lsas >
+           (unsigned int)area->fr_info.router_lsas_recv_dc_bit) {
+               area->fr_info.enabled = false;
+               area->fr_info.area_dc_clear = true;
+               return;
+       } else if (count_router_lsas <
+                  (unsigned int)area->fr_info.router_lsas_recv_dc_bit) {
+               /* This can never happen, total number of router lsas received
+                * can never be less than router lsas received with dc bit set
+                */
+               OSPF_LOG_ERR("%s: Counter mismatch for area %pI4", __func__,
+                            &area->area_id);
+               OSPF_LOG_ERR(
+                       "%s: router LSAs in lsdb %d router LSAs recvd with dc bit set %d",
+                       __func__, count_router_lsas,
+                       area->fr_info.router_lsas_recv_dc_bit);
+               return;
+       }
+
+       area->fr_info.area_dc_clear = false;
+
+       if (OSPF_FR_CONFIG(area->ospf, area)) {
+               if (!area->fr_info.enabled) {
+                       area->fr_info.enabled = true;
+                       area->fr_info.state_changed = true;
+               }
+       } else {
+               area->fr_info.enabled = false;
+               area->fr_info.area_dc_clear = true;
+       }
+}
+
 /* Do the LSA acking specified in table 19, Section 13.5, row 2
  * This get called from ospf_flood_out_interface. Declared inline
  * for speed. */
@@ -428,6 +482,55 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr,
        if (!(new = ospf_lsa_install(ospf, oi, new)))
                return -1; /* unknown LSA type or any other error condition */
 
+       /* check if the installed LSA is an indication LSA */
+       if (ospf_check_indication_lsa(new) && !IS_LSA_SELF(new) &&
+           !IS_LSA_MAXAGE(new)) {
+               new->area->fr_info.area_ind_lsa_recvd = true;
+               /* check if there are already type 5 LSAs originated
+                * with DNA bit set, if yes reoriginate those LSAs.
+                */
+               ospf_refresh_dna_type5_and_type7_lsas(ospf);
+       }
+
+       /* Check if we recived an indication LSA flush on backbone
+        * network.
+        */
+       ospf_recv_indication_lsa_flush(new);
+
+       if (new->area && OSPF_FR_CONFIG(ospf, new->area)) {
+               struct lsa_header const *lsah = new->data;
+
+               if (!CHECK_FLAG(lsah->options, OSPF_OPTION_DC) &&
+                   !ospf_check_indication_lsa(new)) {
+
+                       new->area->fr_info.area_dc_clear = true;
+                       /* check of previously area supported flood reduction */
+                       if (new->area->fr_info.enabled) {
+                               new->area->fr_info.enabled = false;
+                               OSPF_LOG_DEBUG(
+                                       IS_DEBUG_OSPF_EVENT,
+                                       "Flood Reduction STATE on -> off by %s LSA",
+                                       dump_lsa_key(new));
+                               /* if yes update all the lsa to the area the
+                                * new LSAs will have DNA bit set to 0.
+                                */
+                               ospf_refresh_area_self_lsas(new->area);
+                       }
+               } else if (!new->area->fr_info.enabled) {
+                       /* check again after installing new LSA that area
+                        * supports flood reduction.
+                        */
+                       ospf_area_update_fr_state(new->area);
+                       if (new->area->fr_info.enabled) {
+                               OSPF_LOG_DEBUG(
+                                       IS_DEBUG_OSPF_EVENT,
+                                       "Flood Reduction STATE off -> on by %s LSA",
+                                       dump_lsa_key(new));
+                               ospf_refresh_area_self_lsas(new->area);
+                       }
+               }
+       }
+
        /* Acknowledge the receipt of the LSA by sending a Link State
           Acknowledgment packet back out the receiving interface. */
        if (lsa_ack_flag)
@@ -465,6 +568,25 @@ int ospf_flood_through_interface(struct ospf_interface *oi,
        if (!ospf_if_is_enable(oi))
                return 0;
 
+       /* If flood reduction is configured, set the DC bit on the lsa. */
+       if (IS_LSA_SELF(lsa)) {
+               if (OSPF_FR_CONFIG(oi->area->ospf, oi->area)) {
+                       if (!ospf_check_indication_lsa(lsa)) {
+                               SET_FLAG(lsa->data->options, OSPF_OPTION_DC);
+                               ospf_lsa_checksum(lsa->data);
+                       }
+               } else if (CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC)) {
+                       UNSET_FLAG(lsa->data->options, OSPF_OPTION_DC);
+                       ospf_lsa_checksum(lsa->data);
+               }
+
+               /* If flood reduction is enabled then set DNA bit on the
+                * self lsas.
+                */
+               if (oi->area->fr_info.enabled)
+                       SET_FLAG(lsa->data->ls_age, DO_NOT_AGE);
+       }
+
        /* Remember if new LSA is added to a retransmit list. */
        retx_flag = 0;
 
index 95a5b358c98370f6783ee0ad8995d546ade1fa5f..3757400d0cec18fb124e45d82c44c479632b64a0 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Flooding -- RFC2328 Section 13.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_FLOOD_H
@@ -68,5 +53,7 @@ extern struct external_info *ospf_external_info_check(struct ospf *,
                                                      struct ospf_lsa *);
 
 extern void ospf_lsdb_init(struct ospf_lsdb *);
+extern void ospf_area_update_fr_state(struct ospf_area *area);
+extern void ospf_refresh_dna_type5_and_type7_lsas(struct ospf *ospf);
 
 #endif /* _ZEBRA_OSPF_FLOOD_H */
index 6678d8c1f362331597e75d99e3ab9c41ee9cc4df..e83ff1dccf20ef040d941cd4d84e2b0cd52188a3 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC 3623 Graceful OSPF Restart.
  *
  * Copyright 2021 NetDEF (c), All rights reserved.
  * Copyright 2020 6WIND (c), All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 496ba3c59711eb6b84c2dd1a0556495037a5324b..65aa91d4213f20f68d29c14361b0a6f55a02da81 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Graceful Restart helper functions.
  *
  * Copyright (C) 2020-21 Vmware, Inc.
  * Rajesh Kumar Girada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_GR_H
index 624133ad6bd23480aec27270d215bdc12f1beeed..0263df48c5c7394e40a64c585a7a8a6533ba8dc3 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Graceful Restart helper functions.
  *
  * Copyright (C) 2020-21 Vmware, Inc.
  * Rajesh Kumar Girada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f9869a673354bbea226712a218a7f1af77d96e14..d3c9626d9ae8ad317797ba104ea14ff48dd2fb3b 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF inter-area routing.
  * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 05ad13c06eb65c2595141a8e5dc501050c628537..1005f2b86e5efef1a0b8d2fed5c4b861eb0eb4b8 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF inter-area routing.
  * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_IA_H
index 831906b908afc5e1d2f3b9ac19ecad8f89e5cff1..4ea367ecad36bf5eac3fc4618ea043c322728dac 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Interface functions.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 51fc1bf3c3108c10f4fc426de984c485db4c533f..0ee0cd4a3c6f0b9868d8b7a44e316facd1b1c615 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Interface functions.
  * Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_INTERFACE_H
index d4565b6651601fe2c935e1fcf934538f75dd652a..173ebdf20731817d08591fa51aaa1ec6a4462664 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF version 2  Interface State Machine
  *   From RFC2328 [OSPF Version 2]
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 92329bc55ee529c3111f311aea26cfb618707a2f..d0516f61a139e7bb60f68f10edffc2b4a3bce3b0 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF version 2  Interface State Machine.
  *   From RFC2328 [OSPF Version 2]
  * Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ISM_H
index 51cd2a127b3f839242b0bfb00b422c2ad7745957..d3da5003aa9321cf030d63be682d3bd591ee68f9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ospf_ldp_sync.c: OSPF LDP-IGP Sync  handling routines
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 63f370724d40e289aa73810732be8799d8dd2425..88fdcbaf4d4283f9a000dde1acbe08c11e475de0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ospf_ldp_sync.h: OSPF LDP-IGP Sync  handling routines
  * Copyright (C) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_LDP_SYNC_H
index 3e8b7b283d0df48e5c61e4b59f2677c611605bb3..49e342d72b563fd663ac88632637f40924da9ee3 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Link State Advertisement
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -85,6 +70,16 @@ uint32_t get_metric(uint8_t *metric)
        return m;
 }
 
+/** @brief The Function checks self generated DoNotAge.
+ *  @param lsa pointer.
+ *  @return true or false.
+ */
+bool ospf_check_dna_lsa(const struct ospf_lsa *lsa)
+{
+       return ((IS_LSA_SELF(lsa) && CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE))
+                       ? true
+                       : false);
+}
 
 struct timeval int2tv(int a)
 {
@@ -136,6 +131,16 @@ int get_age(struct ospf_lsa *lsa)
 {
        struct timeval rel;
 
+       /* As per rfc4136, the self-originated LSAs in their
+        * own database keep aging, however rfc doesn't tell
+        * till how long the LSA should be aged, as of now
+        * we are capping it for OSPF_LSA_MAXAGE.
+        */
+
+       /* If LSA is marked as donotage */
+       if (CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE) && !IS_LSA_SELF(lsa))
+               return ntohs(lsa->data->ls_age);
+
        monotime_since(&lsa->tv_recv, &rel);
        return ntohs(lsa->data->ls_age) + rel.tv_sec;
 }
@@ -1134,6 +1139,10 @@ static struct ospf_lsa *ospf_network_lsa_refresh(struct ospf_lsa *lsa)
                }
                return NULL;
        }
+
+       if (oi->state != ISM_DR)
+               return NULL;
+
        /* Delete LSA from neighbor retransmit-list. */
        ospf_ls_retransmit_delete_nbr_area(area, lsa);
 
@@ -1533,10 +1542,15 @@ static struct ospf_lsa *ospf_summary_asbr_lsa_refresh(struct ospf *ospf,
        struct ospf_lsa *new;
        struct summary_lsa *sl;
        struct prefix p;
+       bool ind_lsa = false;
 
        /* Sanity check. */
        assert(lsa->data);
 
+       if (lsa->area->fr_info.indication_lsa_self &&
+           (lsa->area->fr_info.indication_lsa_self == lsa))
+               ind_lsa = true;
+
        sl = (struct summary_lsa *)lsa->data;
        p.prefixlen = ip_masklen(sl->mask);
        new = ospf_summary_asbr_lsa_new(lsa->area, &p, GET_METRIC(sl->metric),
@@ -1551,6 +1565,9 @@ static struct ospf_lsa *ospf_summary_asbr_lsa_refresh(struct ospf *ospf,
        /* Flood LSA through area. */
        ospf_flood_through_area(new->area, NULL, new);
 
+       if (ind_lsa)
+               new->area->fr_info.indication_lsa_self = new;
+
        if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) {
                zlog_debug("LSA[Type%d:%pI4]: summary-ASBR-LSA refresh",
                           new->data->type, &new->data->id);
@@ -3641,6 +3658,49 @@ void ospf_flush_self_originated_lsas_now(struct ospf *ospf)
        return;
 }
 
+/** @brief Function to refresh all the self originated
+ *        LSAs for area, when FR state change happens.
+ *  @param area pointer.
+ *  @return Void.
+ */
+void ospf_refresh_area_self_lsas(struct ospf_area *area)
+{
+       struct listnode *node2;
+       struct listnode *nnode2;
+       struct ospf_interface *oi;
+       struct route_node *rn;
+       struct ospf_lsa *lsa;
+
+       if (!area)
+               return;
+
+       if (area->router_lsa_self)
+               ospf_lsa_refresh(area->ospf, area->router_lsa_self);
+
+       for (ALL_LIST_ELEMENTS(area->oiflist, node2, nnode2, oi))
+               if (oi->network_lsa_self)
+                       ospf_lsa_refresh(oi->ospf, oi->network_lsa_self);
+
+       LSDB_LOOP (SUMMARY_LSDB(area), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+       LSDB_LOOP (ASBR_SUMMARY_LSDB(area), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+       LSDB_LOOP (OPAQUE_LINK_LSDB(area), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+       LSDB_LOOP (OPAQUE_AREA_LSDB(area), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+       LSDB_LOOP (EXTERNAL_LSDB(area->ospf), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+       LSDB_LOOP (OPAQUE_AS_LSDB(area->ospf), rn, lsa)
+               if (IS_LSA_SELF(lsa))
+                       ospf_lsa_refresh(area->ospf, lsa);
+}
+
 /* If there is self-originated LSA, then return 1, otherwise return 0. */
 /* An interface-independent version of ospf_lsa_is_self_originated */
 int ospf_lsa_is_self_originated(struct ospf *ospf, struct ospf_lsa *lsa)
@@ -3976,6 +4036,7 @@ void ospf_lsa_refresh_walker(struct thread *t)
        struct ospf_lsa *lsa;
        int i;
        struct list *lsa_to_refresh = list_new();
+       bool dna_lsa;
 
        if (IS_DEBUG_OSPF(lsa, LSA_REFRESH))
                zlog_debug("LSA[Refresh]: %s: start", __func__);
@@ -4034,10 +4095,14 @@ void ospf_lsa_refresh_walker(struct thread *t)
        ospf->lsa_refresher_started = monotime(NULL);
 
        for (ALL_LIST_ELEMENTS(lsa_to_refresh, node, nnode, lsa)) {
-               ospf_lsa_refresh(ospf, lsa);
-               assert(lsa->lock > 0);
-               ospf_lsa_unlock(
-                       &lsa); /* lsa_refresh_queue & temp for lsa_to_refresh*/
+               dna_lsa = ospf_check_dna_lsa(lsa);
+               if (!dna_lsa) { /* refresh only non-DNA LSAs */
+                       ospf_lsa_refresh(ospf, lsa);
+                       assert(lsa->lock > 0);
+                       ospf_lsa_unlock(&lsa); /* lsa_refresh_queue & temp for
+                                               * lsa_to_refresh.
+                                               */
+               }
        }
 
        list_delete(&lsa_to_refresh);
index 1caf8047e41e5a64c9b5487fe22c521c102981ba..3c7ea3fda50f59f39257a70e60bfa3372e0ff52c 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Link State Advertisement
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_LSA_H
@@ -60,6 +45,7 @@
 /* OSPF LSA header. */
 struct lsa_header {
        uint16_t ls_age;
+#define DO_NOT_AGE 0x8000
        uint8_t options;
        uint8_t type;
        struct in_addr id;
@@ -233,6 +219,9 @@ enum lsid_status { LSID_AVAILABLE = 0, LSID_CHANGE, LSID_NOT_AVAILABLE };
         || (type == OSPF_SUMMARY_LSA) || (type == OSPF_ASBR_SUMMARY_LSA)      \
         || (type == OSPF_AS_EXTERNAL_LSA) || (type == OSPF_AS_NSSA_LSA))
 
+#define OSPF_FR_CONFIG(o, a)                                                   \
+       (o->fr_configured || ((a != NULL) ? a->fr_info.configured : 0))
+
 /* Prototypes. */
 /* XXX: Eek, time functions, similar are in lib/thread.c */
 extern struct timeval int2tv(int);
@@ -358,4 +347,24 @@ extern void ospf_check_and_gen_init_seq_lsa(struct ospf_interface *oi,
 extern void ospf_flush_lsa_from_area(struct ospf *ospf, struct in_addr area_id,
                                     int type);
 extern void ospf_maxage_lsa_remover(struct thread *thread);
+extern bool ospf_check_dna_lsa(const struct ospf_lsa *lsa);
+extern void ospf_refresh_area_self_lsas(struct ospf_area *area);
+
+/** @brief Check if the LSA is an indication LSA.
+ *  @param lsa pointer.
+ *  @return true or false based on lsa info.
+ */
+static inline bool ospf_check_indication_lsa(struct ospf_lsa *lsa)
+{
+       struct summary_lsa *sl = NULL;
+
+       if (lsa->data->type == OSPF_ASBR_SUMMARY_LSA) {
+               sl = (struct summary_lsa *)lsa->data;
+               if ((GET_METRIC(sl->metric) == OSPF_LS_INFINITY) &&
+                   !CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC))
+                       return true;
+       }
+
+       return false;
+}
 #endif /* _ZEBRA_OSPF_LSA_H */
index f4fb858a5f4b2fbb0ca2e7dae7e3e9a26ccea75e..0111c4924ec2bd7aa01c6c52965ea8621a62bc0c 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF LSDB support.
  * Copyright (C) 1999, 2000 Alex Zinin, Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -92,6 +77,21 @@ static void ospf_lsdb_delete_entry(struct ospf_lsdb *lsdb,
        lsdb->type[lsa->data->type].count--;
        lsdb->type[lsa->data->type].checksum -= ntohs(lsa->data->checksum);
        lsdb->total--;
+
+       /* Decrement number of router LSAs received with DC bit set */
+       if (lsa->area && (lsa->area->lsdb == lsdb) && !IS_LSA_SELF(lsa) &&
+           (lsa->data->type == OSPF_ROUTER_LSA) &&
+           CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC))
+               lsa->area->fr_info.router_lsas_recv_dc_bit--;
+
+       /*
+        * If the LSA being deleted is indication LSA, then set the
+        * pointer to NULL.
+        */
+       if (lsa->area && lsa->area->fr_info.indication_lsa_self &&
+           (lsa->area->fr_info.indication_lsa_self == lsa))
+               lsa->area->fr_info.indication_lsa_self = NULL;
+
        rn->info = NULL;
        route_unlock_node(rn);
 #ifdef MONITOR_LSDB_CHANGE
@@ -128,6 +128,12 @@ void ospf_lsdb_add(struct ospf_lsdb *lsdb, struct ospf_lsa *lsa)
        lsdb->type[lsa->data->type].count++;
        lsdb->total++;
 
+       /* Increment number of router LSAs received with DC bit set */
+       if (lsa->area && (lsa->area->lsdb == lsdb) && !IS_LSA_SELF(lsa) &&
+           (lsa->data->type == OSPF_ROUTER_LSA) &&
+           CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC))
+               lsa->area->fr_info.router_lsas_recv_dc_bit++;
+
 #ifdef MONITOR_LSDB_CHANGE
        if (lsdb->new_lsa_hook != NULL)
                (*lsdb->new_lsa_hook)(lsa);
index 5cf5d05449eaf884e633642efa3fcbd712e5c894..bf295ca8306a853de588058532a13311b9920eeb 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF LSDB support.
  * Copyright (C) 1999, 2000 Alex Zinin, Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_LSDB_H
index 2f9787bca5661b840dcf7a822c9e02ecf82d36ce..05fc5c95d1ec47b0baf8278f6456a67e9880c7dc 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd main routine.
  *   Copyright (C) 1998, 99 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 28384438923f46de2a8de24d39e34f545bf07949..9854c8cae80b750559594d5626855da34942fbf8 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* ospfd memory type definitions
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 9bd0a844af8159990834658bc3512f23cc2c725b..d11b69abb01b3119897dd38c8edd09388b4eb161 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* ospfd memory type declarations
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_OSPF_MEMORY_H
index 02c44dcdc19ca4c0f3de9d8391d161bda807ccc2..8338c430772f2bec8ea248afd8501799faa7b621 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Neighbor functions.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 433b13615320f4601da725c02d212b0ef0b73183..7bd5b1209d31bb1cf38280f440c6426690b45a76 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Neighbor functions.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_NEIGHBOR_H
index a8c9493ec8e4d910933c534242f5ca6df50b0d44..e89ad020b18d6b4cdb8369d66ea9f6a0f69536a2 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF network related functions
  *   Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cbaf1323277cb18cfcf9036f0e31e5309efe14db..33fd8980bff20366716be1a3fd495f5358977574 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF network related functions.
  *   Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_NETWORK_H
index a27550853b0004f7ea1b556cc7e1c75df95cebc6..65c7720481ba86abf25d56f4c7c3ed3841647fc3 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF version 2  Neighbor State Machine
  * From RFC2328 [OSPF Version 2]
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c526c4c3edd72edc8c47457175e0c86906c2d2ef..b53a05914fe5afbcf2c2af8d5dfa718a473e4478 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF version 2  Neighbor State Machine
  *   From RFC2328 [OSPF Version 2]
  *   Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_NSM_H
index ab647625fe93e0fdc38ffe23868618d22c5a57bb..2e8e48bb5a6337008526ff6c88a212ab3ad0a91d 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of rfc2370.
  * Copyright (C) 2001 KDD R&D Laboratories, Inc.
  * http://www.kddlabs.co.jp/
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -34,6 +19,7 @@
 #include "thread.h"
 #include "hash.h"
 #include "sockunion.h" /* for inet_aton() */
+#include "printfrr.h"
 
 #include "ospfd/ospfd.h"
 #include "ospfd/ospf_interface.h"
@@ -1162,11 +1148,13 @@ void ospf_opaque_config_write_debug(struct vty *vty)
 void show_opaque_info_detail(struct vty *vty, struct ospf_lsa *lsa,
                             json_object *json)
 {
+       char buf[128], *bp;
        struct lsa_header *lsah = lsa->data;
        uint32_t lsid = ntohl(lsah->id.s_addr);
        uint8_t opaque_type = GET_OPAQUE_TYPE(lsid);
        uint32_t opaque_id = GET_OPAQUE_ID(lsid);
        struct ospf_opaque_functab *functab;
+       int len, lenValid;
 
        /* Switch output functionality by vty address. */
        if (vty != NULL) {
@@ -1185,11 +1173,19 @@ void show_opaque_info_detail(struct vty *vty, struct ospf_lsa *lsa,
                                json, "opaqueType",
                                ospf_opaque_type_name(opaque_type));
                        json_object_int_add(json, "opaqueId", opaque_id);
-                       json_object_int_add(json, "opaqueDataLength",
-                                           ntohs(lsah->length)
-                                                   - OSPF_LSA_HEADER_SIZE);
+                       len = ntohs(lsah->length) - OSPF_LSA_HEADER_SIZE;
+                       json_object_int_add(json, "opaqueDataLength", len);
+                       lenValid = VALID_OPAQUE_INFO_LEN(lsah);
                        json_object_boolean_add(json, "opaqueDataLengthValid",
-                                               VALID_OPAQUE_INFO_LEN(lsah));
+                                               lenValid);
+                       if (lenValid) {
+                               bp = asnprintfrr(MTYPE_TMP, buf, sizeof(buf),
+                                                "%*pHXn", (int)len,
+                                                (lsah + 1));
+                               json_object_string_add(json, "opaqueData", buf);
+                               if (bp != buf)
+                                       XFREE(MTYPE_TMP, bp);
+                       }
                }
        } else {
                zlog_debug("    Opaque-Type %u (%s)", opaque_type,
index 05fe6deac09a49ada2dbf8c46cac36314d9b67b4..e0c78cd6dc95834d5b6216ab94ef4419bf41481c 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of rfc2370.
  * Copyright (C) 2001 KDD R&D Laboratories, Inc.
  * http://www.kddlabs.co.jp/
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_OPAQUE_H
index b22fe5d99b7fe12be260742ae9d18525f8512482..5268c9896b470ca604214805fd882e5b7fa0d4dc 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Sending and Receiving OSPF Packets.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -43,6 +28,7 @@
 #include "ospfd/ospf_network.h"
 #include "ospfd/ospf_interface.h"
 #include "ospfd/ospf_ism.h"
+#include "ospfd/ospf_abr.h"
 #include "ospfd/ospf_asbr.h"
 #include "ospfd/ospf_lsa.h"
 #include "ospfd/ospf_lsdb.h"
@@ -3332,6 +3318,14 @@ static int ospf_make_hello(struct ospf_interface *oi, struct stream *s)
        else
                stream_putw(s, 0); /* hello-interval of 0 for fast-hellos */
 
+       /* Check if flood-reduction is enabled,
+        * if yes set the DC bit in the options.
+        */
+       if (OSPF_FR_CONFIG(oi->ospf, oi->area))
+               SET_FLAG(OPTIONS(oi), OSPF_OPTION_DC);
+       else if (CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_DC))
+               UNSET_FLAG(OPTIONS(oi), OSPF_OPTION_DC);
+
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("%s: options: %x, int: %s", __func__, OPTIONS(oi),
                           IF_NAME(oi));
@@ -3420,6 +3414,8 @@ static int ospf_make_db_desc(struct ospf_interface *oi,
        options = OPTIONS(oi);
        if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE))
                SET_FLAG(options, OSPF_OPTION_O);
+       if (OSPF_FR_CONFIG(oi->ospf, oi->area))
+               SET_FLAG(options, OSPF_OPTION_DC);
        stream_putc(s, options);
 
        /* DD flags */
index cefc9c21b696e9873765ddd443c210c33475c6a3..e8b279b9d8952c03836bd8d2dcf9823857b3846b 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Sending and Receiving OSPF Packets.
  * Copyright (C) 1999 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_PACKET_H
index e227a3151fe5f50240bed3a0deba6bedaa608142..a808ddc9f62aae4825fbae28906a51d8010324e1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC4970 Router Information
  * with support of RFC5088 PCE Capabilites announcement
@@ -5,22 +6,6 @@
  * Module name: Router Information
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  * Copyright (C) 2012 - 2017 Orange Labs http://www.orange.com/
- *
- * This file is part of GNU Quagga.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index bbad896280d39cb35a267a2422b8b48f52c97d68..0870938cf11a828acad374ad709c178a254109a7 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC4970 Router Information
  * with support of RFC5088 PCE Capabilites announcement
@@ -8,22 +9,6 @@
  * Module name: Router Information
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  * Copyright (C) 2012 - 2017 Orange Labs http://www.orange.com/
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ROUTER_INFO_H
index 6360d8ec601d8fc033cb93464b0c8449ece4bf9e..5f18bff1cf79996de3b9523a3e982fc669cc0e5d 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF routing table.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -363,44 +348,49 @@ void ospf_route_install(struct ospf *ospf, struct route_table *rt)
 
 /* RFC2328 16.1. (4). For "router". */
 void ospf_intra_add_router(struct route_table *rt, struct vertex *v,
-                          struct ospf_area *area, bool add_all)
+                          struct ospf_area *area, bool add_only)
 {
        struct route_node *rn;
        struct ospf_route * or ;
        struct prefix_ipv4 p;
        struct router_lsa *lsa;
 
-       if (IS_DEBUG_OSPF_EVENT)
-               zlog_debug("%s: Start", __func__);
-
+       if (IS_DEBUG_OSPF_EVENT) {
+               if (!add_only)
+                       zlog_debug("%s: Start", __func__);
+               else
+                       zlog_debug("%s: REACHRUN: Start", __func__);
+       }
        lsa = (struct router_lsa *)v->lsa;
 
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("%s: LS ID: %pI4", __func__, &lsa->header.id);
 
-       if (!OSPF_IS_AREA_BACKBONE(area))
-               ospf_vl_up_check(area, lsa->header.id, v);
+       if (!add_only) {
+               if (!OSPF_IS_AREA_BACKBONE(area))
+                       ospf_vl_up_check(area, lsa->header.id, v);
 
-       if (!CHECK_FLAG(lsa->flags, ROUTER_LSA_SHORTCUT))
-               area->shortcut_capability = 0;
+               if (!CHECK_FLAG(lsa->flags, ROUTER_LSA_SHORTCUT))
+                       area->shortcut_capability = 0;
 
-       /* If the newly added vertex is an area border router or AS boundary
-          router, a routing table entry is added whose destination type is
-          "router". */
-       if (!add_all && !IS_ROUTER_LSA_BORDER(lsa) &&
-           !IS_ROUTER_LSA_EXTERNAL(lsa)) {
-               if (IS_DEBUG_OSPF_EVENT)
-                       zlog_debug(
-                               "%s: this router is neither ASBR nor ABR, skipping it",
-                               __func__);
-               return;
-       }
+               /* If the newly added vertex is an area border router or AS
+                  boundary router, a routing table entry is added whose
+                  destination type is "router". */
+               if (!IS_ROUTER_LSA_BORDER(lsa) &&
+                   !IS_ROUTER_LSA_EXTERNAL(lsa)) {
+                       if (IS_DEBUG_OSPF_EVENT)
+                               zlog_debug(
+                                       "%s: this router is neither ASBR nor ABR, skipping it",
+                                       __func__);
+                       return;
+               }
 
-       /* Update ABR and ASBR count in this area. */
-       if (IS_ROUTER_LSA_BORDER(lsa))
-               area->abr_count++;
-       if (IS_ROUTER_LSA_EXTERNAL(lsa))
-               area->asbr_count++;
+               /* Update ABR and ASBR count in this area. */
+               if (IS_ROUTER_LSA_BORDER(lsa))
+                       area->abr_count++;
+               if (IS_ROUTER_LSA_EXTERNAL(lsa))
+                       area->asbr_count++;
+       }
 
        /* The Options field found in the associated router-LSA is copied
           into the routing table entry's Optional capabilities field. Call
@@ -448,8 +438,12 @@ void ospf_intra_add_router(struct route_table *rt, struct vertex *v,
 
        listnode_add(rn->info, or);
 
-       if (IS_DEBUG_OSPF_EVENT)
-               zlog_debug("%s: Stop", __func__);
+       if (IS_DEBUG_OSPF_EVENT) {
+               if (!add_only)
+                       zlog_debug("%s: Stop", __func__);
+               else
+                       zlog_debug("%s: REACHRUN: Stop", __func__);
+       }
 }
 
 /* RFC2328 16.1. (4).  For transit network. */
@@ -986,6 +980,16 @@ void ospf_prune_unreachable_routers(struct route_table *rtrs)
                                                &or->u.std.area_id);
                                }
 
+                               /* Unset the DNA flag on lsa, if the router
+                                * which generated this lsa is no longer
+                                * reachabele.
+                                */
+                               (CHECK_FLAG(or->u.std.origin->ls_age,
+                                           DO_NOT_AGE))
+                                       ? UNSET_FLAG(or->u.std.origin->ls_age,
+                                                    DO_NOT_AGE)
+                                       : 0;
+
                                listnode_delete(paths, or);
                                ospf_route_free(or);
                        }
index fa9478fcedb2bd4136c7f06d244ffca31b7e6e08..2582067aece7af3f28cad144257da447464268df 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF routing table.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ROUTE_H
index b1216626c4d2aa50e9da71125654a34bc9230444..3087008819275c7a97fa0040d083fc9c56a7dc4f 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Route map function of ospfd.
  * Copyright (C) 2000 IP Infusion Inc.
  *
  * Written by Toshiaki Takada.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -134,8 +119,13 @@ route_match_ip_nexthop(void *rule, const struct prefix *prefix, void *object)
        p.prefixlen = IPV4_MAX_BITLEN;
 
        alist = access_list_lookup(AFI_IP, (char *)rule);
-       if (alist == NULL)
+       if (alist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (access_list_apply(alist, &p) == FILTER_DENY ? RMAP_NOMATCH
                                                            : RMAP_MATCH);
@@ -177,8 +167,13 @@ route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix,
        p.prefixlen = IPV4_MAX_BITLEN;
 
        plist = prefix_list_lookup(AFI_IP, (char *)rule);
-       if (plist == NULL)
+       if (plist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (prefix_list_apply(plist, &p) == PREFIX_DENY ? RMAP_NOMATCH
                                                            : RMAP_MATCH);
@@ -249,8 +244,13 @@ route_match_ip_address(void *rule, const struct prefix *prefix, void *object)
        /* struct prefix_ipv4 match; */
 
        alist = access_list_lookup(AFI_IP, (char *)rule);
-       if (alist == NULL)
+       if (alist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (access_list_apply(alist, prefix) == FILTER_DENY ? RMAP_NOMATCH
                                                                : RMAP_MATCH);
@@ -285,8 +285,14 @@ route_match_ip_address_prefix_list(void *rule, const struct prefix *prefix,
        struct prefix_list *plist;
 
        plist = prefix_list_lookup(AFI_IP, (char *)rule);
-       if (plist == NULL)
+       if (plist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
+
                return RMAP_NOMATCH;
+       }
 
        return (prefix_list_apply(plist, prefix) == PREFIX_DENY ? RMAP_NOMATCH
                                                                : RMAP_MATCH);
index e53d009a55be81b31e8848b5740bf132d9827660..8ccd0e56ac80e271feb3ef4fa7d50190a744b870 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 17bcb4f5c34670227b275f4c834b09452b564af5..5bba784eb1f0d01decd11fb12929aa941a99f558 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_OSPF_ROUTEMAP_NB_H_
index 9026795425d8a923925f631dc78ff3d116596256..a35a1ef6f1168c987b5b17adab8bbc8ab4277a51 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f1b876cfbe338c3da7d96ca071778bb9d7c8233e..fb9f36349a1283261139e4fca12d710ea91541b9 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPFv2 SNMP support
  * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
  * Copyright (C) 2000 IP Infusion Inc.
  *
  * Written by Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 48499938cae7083a6f07b4d917ebbb3e5d56ca9d..7c1f9f17ac3c994a3508cb23a12b2e815297927e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPF SPF calculation.
  * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -539,7 +524,7 @@ void ospf_spf_remove_resource(struct vertex *vertex, struct list *vertex_list,
                                               vertex_list);
 
                break;
-       default:
+       case OSPF_TI_LFA_UNDEFINED_PROTECTION:
                /* do nothing */
                break;
        }
index 834bfd0bb02eccb01e14c4db603d04e719ffc4b7..0837748d0b144fa984bbe44a5422f3303666908d 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF calculation.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_OSPF_SPF_H
index 3a71e55710823d87079ec374b1066617976a8572..adb14ec6b1478ce9173e58dfe118c938fa77bcb5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of Segment Routing
  * as per RFC 8665 - OSPF Extensions for Segment Routing
@@ -9,20 +10,6 @@
  * Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
  *
  * Copyright (C) 2016 - 2020 Orange Labs http://www.orange.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index b153a220f50ced8aa7b8dd97c0b1e0b34db1bc92..2c189083be0b906c26134613e7f3d56dc26f1a31 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of Segment Routing
  * as per RFC 8665 - OSPF Extensions for Segment Routing
@@ -9,20 +10,6 @@
  * Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
  *
  * Copyright (C) 2016 - 2020 Orange Labs http://www.orange.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_OSPF_SR_H
index 75f4e0c9f094db62bb6f491cb19ca666e2db1c0d..e3869abe59104721156fdf47a196eba22cd078d0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC3630
  * Copyright (C) 2001 KDD R&D Laboratories, Inc.
@@ -5,22 +6,6 @@
  *
  * Copyright (C) 2012 Orange Labs
  * http://www.orange.com
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Add support of RFC7471 */
index fc9ca207800a0de2e645660790a31135a32f13ea..49906ef713aacc9a9dcc534868adf0b70d30c4bc 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC3630, RFC5392 & RFC6827
  * Copyright (C) 2001 KDD R&D Laboratories, Inc.
@@ -5,22 +6,6 @@
  *
  * Copyright (C) 2012 Orange Labs
  * http://www.orange.com
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* Add support of RFC7471 */
index 28d24bcbe6b4b0af76dcc57d9f53af22205f57cf..b14200868ee1b6b3f69b9e7b6a98c221a76df2ef 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF TI-LFA
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Sascha Kattelmann
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -723,7 +708,7 @@ static void ospf_ti_lfa_generate_q_spaces(struct ospf_area *area,
        if (q_space->label_stack) {
                mpls_label2str(q_space->label_stack->num_labels,
                               q_space->label_stack->label, label_buf,
-                              MPLS_LABEL_STRLEN, true);
+                              MPLS_LABEL_STRLEN, 0, true);
                zlog_info(
                        "%s: Generated label stack %s for root %pI4 and destination %pI4 for %s",
                        __func__, label_buf, &p_space->root->id,
@@ -1050,7 +1035,7 @@ void ospf_ti_lfa_insert_backup_paths(struct ospf_area *area,
                                        path->srni.backup_label_stack
                                                ->num_labels,
                                        path->srni.backup_label_stack->label,
-                                       label_buf, MPLS_LABEL_STRLEN, true);
+                                       label_buf, MPLS_LABEL_STRLEN, 0, true);
                                if (IS_DEBUG_OSPF_TI_LFA)
                                        zlog_debug(
                                                "%s: inserted backup path %s for prefix %pFX, router id %pI4 and nexthop %pI4.",
index bc8f19b98f5d9c3d2e921f58508a95a0f9d6ce1a..ea37da6a3f738df20c0236e929ed3bd2e805d7c8 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF calculation.
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Sascha Kattelmann
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _OSPF_TI_LFA_H
index 469e9955e91b296a10b33359f0e6d529495a0c9f..29bddb1190325c962b7c16d897452024459b9356 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPF VTY interface.
  * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
  * Copyright (C) 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -3053,6 +3038,43 @@ static void show_ip_ospf_area(struct vty *vty, struct ospf_area *area,
                        ospf_lsdb_checksum(area->lsdb, OSPF_OPAQUE_AREA_LSA));
        }
 
+       if (area->fr_info.configured) {
+               if (use_json)
+                       json_object_string_add(json_area, "areaFloodReduction",
+                                              "configured");
+               else
+                       vty_out(vty, "   Flood Reduction is configured.\n");
+       }
+
+       if (area->fr_info.enabled) {
+               if (use_json) {
+                       json_object_boolean_true_add(
+                               json_area, "areaFloodReductionEnabled");
+                       if (area->fr_info.router_lsas_recv_dc_bit)
+                               json_object_boolean_true_add(
+                                       json_area, "lsasRecvDCbitSet");
+                       if (area->fr_info.area_ind_lsa_recvd)
+                               json_object_string_add(json_area,
+                                                      "areaIndicationLsaRecv",
+                                                      "received");
+                       if (area->fr_info.indication_lsa_self)
+                               json_object_string_addf(
+                                       json_area, "areaIndicationLsa", "%pI4",
+                                       &area->fr_info.indication_lsa_self->data
+                                                ->id);
+               } else {
+                       vty_out(vty, "   Flood Reduction is enabled.\n");
+                       vty_out(vty, "   No of LSAs rcv'd with DC bit set %d\n",
+                               area->fr_info.router_lsas_recv_dc_bit);
+                       if (area->fr_info.area_ind_lsa_recvd)
+                               vty_out(vty, "   Ind LSA by other abr.\n");
+                       if (area->fr_info.indication_lsa_self)
+                               vty_out(vty, "   Ind LSA generated %pI4\n",
+                                       &area->fr_info.indication_lsa_self->data
+                                                ->id);
+               }
+       }
+
        if (use_json)
                json_object_object_add(json_areas,
                                       inet_ntop(AF_INET, &area->area_id,
@@ -3288,6 +3310,14 @@ static int show_ip_ospf_common(struct vty *vty, struct ospf *ospf,
                                           : ZEBRA_OSPF_DISTANCE_DEFAULT);
        }
 
+       if (ospf->fr_configured) {
+               if (json)
+                       json_object_string_add(json_vrf, "floodReduction",
+                                              "configured");
+               else
+                       vty_out(vty, " Flood Reduction is configured.\n");
+       }
+
        /* Show ABR/ASBR flags. */
        if (CHECK_FLAG(ospf->flags, OSPF_FLAG_ABR)) {
                if (json)
@@ -5964,118 +5994,109 @@ static int show_lsa_summary(struct vty *vty, struct ospf_lsa *lsa, int self,
        struct as_external_lsa *asel;
        struct prefix_ipv4 p;
 
-       if (lsa != NULL) {
-               /* If self option is set, check LSA self flag. */
-               if (self == 0 || IS_LSA_SELF(lsa)) {
+       if (lsa == NULL)
+               return 0;
 
-                       if (!json_lsa) {
-                               /* LSA common part show. */
-                               vty_out(vty, "%-15pI4",
-                                       &lsa->data->id);
-                               vty_out(vty, "%-15pI4 %4d 0x%08lx 0x%04x",
-                                       &lsa->data->adv_router, LS_AGE(lsa),
-                                       (unsigned long)ntohl(
-                                               lsa->data->ls_seqnum),
-                                       ntohs(lsa->data->checksum));
-                       } else {
-                               char seqnum[10];
-                               char checksum[10];
-
-                               snprintf(seqnum, sizeof(seqnum), "%x",
-                                        ntohl(lsa->data->ls_seqnum));
-                               snprintf(checksum, sizeof(checksum), "%x",
-                                        ntohs(lsa->data->checksum));
-                               json_object_string_addf(json_lsa, "lsId",
-                                                       "%pI4", &lsa->data->id);
-                               json_object_string_addf(
-                                       json_lsa, "advertisedRouter", "%pI4",
-                                       &lsa->data->adv_router);
-                               json_object_int_add(json_lsa, "lsaAge",
-                                                   LS_AGE(lsa));
-                               json_object_string_add(
-                                       json_lsa, "sequenceNumber", seqnum);
-                               json_object_string_add(json_lsa, "checksum",
-                                                      checksum);
-                       }
+       /* If self option is set, check LSA self flag. */
+       if (self == 0 || IS_LSA_SELF(lsa)) {
 
-                       /* LSA specific part show. */
-                       switch (lsa->data->type) {
-                       case OSPF_ROUTER_LSA:
-                               rl = (struct router_lsa *)lsa->data;
+               if (!json_lsa) {
+                       /* LSA common part show. */
+                       vty_out(vty, "%-15pI4", &lsa->data->id);
+                       vty_out(vty, "%-15pI4 %4d 0x%08lx 0x%04x",
+                               &lsa->data->adv_router, LS_AGE(lsa),
+                               (unsigned long)ntohl(lsa->data->ls_seqnum),
+                               ntohs(lsa->data->checksum));
+               } else {
+                       char seqnum[10];
+                       char checksum[10];
+
+                       snprintf(seqnum, sizeof(seqnum), "%x",
+                                ntohl(lsa->data->ls_seqnum));
+                       snprintf(checksum, sizeof(checksum), "%x",
+                                ntohs(lsa->data->checksum));
+                       json_object_string_addf(json_lsa, "lsId", "%pI4",
+                                               &lsa->data->id);
+                       json_object_string_addf(json_lsa, "advertisedRouter",
+                                               "%pI4", &lsa->data->adv_router);
+                       json_object_int_add(json_lsa, "lsaAge", LS_AGE(lsa));
+                       json_object_string_add(json_lsa, "sequenceNumber",
+                                              seqnum);
+                       json_object_string_add(json_lsa, "checksum", checksum);
+               }
+
+               /* LSA specific part show. */
+               switch (lsa->data->type) {
+               case OSPF_ROUTER_LSA:
+                       rl = (struct router_lsa *)lsa->data;
 
-                               if (!json_lsa)
-                                       vty_out(vty, " %-d", ntohs(rl->links));
-                               else
-                                       json_object_int_add(json_lsa,
-                                                           "numOfRouterLinks",
-                                                           ntohs(rl->links));
-                               break;
-                       case OSPF_SUMMARY_LSA:
-                               sl = (struct summary_lsa *)lsa->data;
+                       if (!json_lsa)
+                               vty_out(vty, " %-d", ntohs(rl->links));
+                       else
+                               json_object_int_add(json_lsa,
+                                                   "numOfRouterLinks",
+                                                   ntohs(rl->links));
+                       break;
+               case OSPF_SUMMARY_LSA:
+                       sl = (struct summary_lsa *)lsa->data;
 
-                               p.family = AF_INET;
-                               p.prefix = sl->header.id;
-                               p.prefixlen = ip_masklen(sl->mask);
-                               apply_mask_ipv4(&p);
+                       p.family = AF_INET;
+                       p.prefix = sl->header.id;
+                       p.prefixlen = ip_masklen(sl->mask);
+                       apply_mask_ipv4(&p);
 
-                               if (!json_lsa)
-                                       vty_out(vty, " %pFX", &p);
-                               else {
-                                       json_object_string_addf(
-                                               json_lsa, "summaryAddress",
-                                               "%pFX", &p);
-                               }
-                               break;
-                       case OSPF_AS_EXTERNAL_LSA:
-                       case OSPF_AS_NSSA_LSA:
-                               asel = (struct as_external_lsa *)lsa->data;
-
-                               p.family = AF_INET;
-                               p.prefix = asel->header.id;
-                               p.prefixlen = ip_masklen(asel->mask);
-                               apply_mask_ipv4(&p);
-
-                               if (!json_lsa)
-                                       vty_out(vty, " %s %pFX [0x%lx]",
-                                               IS_EXTERNAL_METRIC(
-                                                       asel->e[0].tos)
-                                                       ? "E2"
-                                                       : "E1",
-                                               &p,
-                                               (unsigned long)ntohl(
-                                                       asel->e[0].route_tag));
-                               else {
-                                       json_object_string_add(
-                                               json_lsa, "metricType",
-                                               IS_EXTERNAL_METRIC(
-                                                       asel->e[0].tos)
-                                                       ? "E2"
-                                                       : "E1");
-                                       json_object_string_addf(
-                                               json_lsa, "route", "%pFX", &p);
-                                       json_object_int_add(
-                                               json_lsa, "tag",
-                                               (unsigned long)ntohl(
-                                                       asel->e[0].route_tag));
-                               }
-                               break;
-                       case OSPF_NETWORK_LSA:
-                       case OSPF_ASBR_SUMMARY_LSA:
-                       case OSPF_OPAQUE_LINK_LSA:
-                       case OSPF_OPAQUE_AREA_LSA:
-                       case OSPF_OPAQUE_AS_LSA:
-                       default:
-                               break;
+                       if (!json_lsa)
+                               vty_out(vty, " %pFX", &p);
+                       else {
+                               json_object_string_addf(
+                                       json_lsa, "summaryAddress", "%pFX", &p);
                        }
+                       break;
+               case OSPF_AS_EXTERNAL_LSA:
+               case OSPF_AS_NSSA_LSA:
+                       asel = (struct as_external_lsa *)lsa->data;
+
+                       p.family = AF_INET;
+                       p.prefix = asel->header.id;
+                       p.prefixlen = ip_masklen(asel->mask);
+                       apply_mask_ipv4(&p);
 
                        if (!json_lsa)
-                               vty_out(vty, "\n");
+                               vty_out(vty, " %s %pFX [0x%lx]",
+                                       IS_EXTERNAL_METRIC(asel->e[0].tos)
+                                               ? "E2"
+                                               : "E1",
+                                       &p,
+                                       (unsigned long)ntohl(
+                                               asel->e[0].route_tag));
+                       else {
+                               json_object_string_add(
+                                       json_lsa, "metricType",
+                                       IS_EXTERNAL_METRIC(asel->e[0].tos)
+                                               ? "E2"
+                                               : "E1");
+                               json_object_string_addf(json_lsa, "route",
+                                                       "%pFX", &p);
+                               json_object_int_add(
+                                       json_lsa, "tag",
+                                       (unsigned long)ntohl(
+                                               asel->e[0].route_tag));
+                       }
+                       break;
+               case OSPF_NETWORK_LSA:
+               case OSPF_ASBR_SUMMARY_LSA:
+               case OSPF_OPAQUE_LINK_LSA:
+               case OSPF_OPAQUE_AREA_LSA:
+               case OSPF_OPAQUE_AS_LSA:
+               default:
+                       break;
                }
 
-               return 1;
+               if (!json_lsa)
+                       vty_out(vty, "\n");
        }
 
-       return 0;
+       return 1;
 }
 
 static const char *const show_database_desc[] = {
@@ -6144,7 +6165,16 @@ static void show_ip_ospf_database_header(struct vty *vty, struct ospf_lsa *lsa,
        struct router_lsa *rlsa = (struct router_lsa *)lsa->data;
 
        if (!json) {
-               vty_out(vty, "  LS age: %d\n", LS_AGE(lsa));
+               if (IS_LSA_SELF(lsa))
+                       vty_out(vty, "  LS age: %d%s\n", LS_AGE(lsa),
+                               CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE)
+                                       ? "(S-DNA)"
+                                       : "");
+               else
+                       vty_out(vty, "  LS age: %d%s\n", LS_AGE(lsa),
+                               CHECK_FLAG(lsa->data->ls_age, DO_NOT_AGE)
+                                       ? "(DNA)"
+                                       : "");
                vty_out(vty, "  Options: 0x%-2x : %s\n", lsa->data->options,
                        ospf_options_dump(lsa->data->options));
                vty_out(vty, "  LS Flags: 0x%-2x %s\n", lsa->flags,
@@ -12203,6 +12233,9 @@ static int config_write_ospf_area(struct vty *vty, struct ospf *ospf)
                if (PREFIX_NAME_OUT(area))
                        vty_out(vty, " area %s filter-list prefix %s out\n",
                                buf, PREFIX_NAME_OUT(area));
+
+               if (area->fr_info.configured)
+                       vty_out(vty, " area %s flood-reduction\n", buf);
        }
 
        return 0;
@@ -12580,6 +12613,9 @@ static int ospf_config_write_one(struct vty *vty, struct ospf *ospf)
        if (ospf->lsa_refresh_interval != OSPF_LSA_REFRESH_INTERVAL_DEFAULT)
                vty_out(vty, " refresh timer %d\n", ospf->lsa_refresh_interval);
 
+       if (ospf->fr_configured)
+               vty_out(vty, " flood-reduction\n");
+
        /* Redistribute information print. */
        config_write_ospf_redistribute(vty, ospf);
 
@@ -12962,6 +12998,143 @@ DEFPY_HIDDEN(ospf_maxage_delay_timer, ospf_maxage_delay_timer_cmd,
        return CMD_SUCCESS;
 }
 
+/*
+ * ------------------------------------------------------------------------*
+ * Following is (vty) configuration functions for flood-reduction handling.
+ * ------------------------------------------------------------------------
+ */
+
+DEFPY(flood_reduction, flood_reduction_cmd, "flood-reduction",
+      "flood reduction feature\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf)
+       struct ospf_area *area;
+       struct listnode *node;
+
+       /* Turn on the Flood Reduction feature for the router. */
+       if (!ospf->fr_configured) {
+               ospf->fr_configured = true;
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                              "Flood Reduction: OFF -> ON");
+               for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
+                       if (area) {
+                               ospf_area_update_fr_state(area);
+                               ospf_refresh_area_self_lsas(area);
+                       }
+               }
+       }
+
+       return CMD_SUCCESS;
+}
+
+DEFPY(flood_reduction_area, flood_reduction_area_cmd,
+      "area <A.B.C.D|(0-4294967295)> flood-reduction",
+      "OSPF area parameters\n"
+      "OSPF area ID in IP address format\n"
+      "OSPF area ID as a decimal value\n"
+      "Enable flood reduction for area\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf)
+       struct ospf_area *oa;
+       int idx = 1;
+       int format;
+       int ret;
+       const char *areaid;
+       struct in_addr area_id;
+
+       areaid = argv[idx]->arg;
+
+       ret = str2area_id(areaid, &area_id, &format);
+       if (ret < 0) {
+               vty_out(vty, "Please specify area by A.B.C.D|<0-4294967295>\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       oa = ospf_area_lookup_by_area_id(ospf, area_id);
+       if (!oa) {
+               vty_out(vty, "OSPF area ID not present\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       /* Turn on the Flood Reduction feature for the area. */
+       if (!oa->fr_info.configured) {
+               oa->fr_info.configured = true;
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                              "Flood Reduction area %pI4 : OFF -> ON",
+                              &oa->area_id);
+               ospf_area_update_fr_state(oa);
+               ospf_refresh_area_self_lsas(oa);
+       }
+
+       return CMD_SUCCESS;
+}
+
+DEFPY(no_flood_reduction, no_flood_reduction_cmd, "no flood-reduction",
+      NO_STR "flood reduction feature\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf)
+       struct listnode *node;
+       struct ospf_area *area;
+
+       /* Turn off the Flood Reduction feature for the router. */
+       if (ospf->fr_configured) {
+               ospf->fr_configured = false;
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                              "Flood Reduction: ON -> OFF");
+               for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
+                       if (area) {
+                               ospf_area_update_fr_state(area);
+                               ospf_refresh_area_self_lsas(area);
+                       }
+               }
+       }
+
+       return CMD_SUCCESS;
+}
+
+DEFPY(no_flood_reduction_area, no_flood_reduction_area_cmd,
+      "no area <A.B.C.D|(0-4294967295)> flood-reduction",
+      NO_STR
+      "OSPF area parameters\n"
+      "OSPF area ID in IP address format\n"
+      "OSPF area ID as a decimal value\n"
+      "Disable flood reduction for area\n")
+{
+       VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf)
+       struct ospf_area *oa;
+       int idx = 2;
+       int format;
+       int ret;
+       const char *areaid;
+       struct in_addr area_id;
+
+       areaid = argv[idx]->arg;
+
+       ret = str2area_id(areaid, &area_id, &format);
+       if (ret < 0) {
+               vty_out(vty, "Please specify area by A.B.C.D|<0-4294967295>\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       oa = ospf_area_lookup_by_area_id(ospf, area_id);
+       if (!oa) {
+               vty_out(vty, "OSPF area ID not present\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       /* Turn off the Flood Reduction feature for the area. */
+       if (oa->fr_info.configured) {
+               oa->fr_info.configured = false;
+               OSPF_LOG_DEBUG(IS_DEBUG_OSPF_EVENT,
+                              "Flood Reduction area %pI4 : ON -> OFF",
+                              &oa->area_id);
+               ospf_area_update_fr_state(oa);
+               ospf_refresh_area_self_lsas(oa);
+       }
+
+       return CMD_SUCCESS;
+}
+
 void ospf_vty_clear_init(void)
 {
        install_element(ENABLE_NODE, &clear_ip_ospf_interface_cmd);
@@ -13122,6 +13295,12 @@ void ospf_vty_init(void)
        install_element(OSPF_NODE, &ospf_lsa_refresh_timer_cmd);
        install_element(OSPF_NODE, &ospf_maxage_delay_timer_cmd);
 
+       /* Flood Reduction commands */
+       install_element(OSPF_NODE, &flood_reduction_cmd);
+       install_element(OSPF_NODE, &no_flood_reduction_cmd);
+       install_element(OSPF_NODE, &flood_reduction_area_cmd);
+       install_element(OSPF_NODE, &no_flood_reduction_area_cmd);
+
        /* Init interface related vty commands. */
        ospf_vty_if_init();
 
index bf9c971710204b59b46e1e46361b2119cd594010..e9402469ec1ce04817df9afac29d0a8c06b52e48 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPF VTY interface.
  * Copyright (C) 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_OSPF_VTY_H
index 1754512b5b158a831dca4cb7c325a5b67209d5e0..46fb653f3adf1a66b0707727f2bcd853f2f4cd26 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for OSPFd
  * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3bd8a7680c782e852dfbd845a7b3d1753bff44f5..adc338fb1ae49b1144d37f97a5f9f1efad4fcb3a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for OSPFd
  * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPF_ZEBRA_H
index 023dc32a7b4fc028cb8d3d5545d1209c749c9508..0296d9d9f58dddb84d51fc467ec83a6e45952cf6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPF version 2 daemon program.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -467,6 +452,8 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
         */
        ospf_gr_nvm_read(new);
 
+       new->fr_configured = false;
+
        return new;
 }
 
@@ -817,6 +804,7 @@ static void ospf_finish_final(struct ospf *ospf)
        THREAD_OFF(ospf->t_maxage);
        THREAD_OFF(ospf->t_maxage_walker);
        THREAD_OFF(ospf->t_abr_task);
+       THREAD_OFF(ospf->t_abr_fr);
        THREAD_OFF(ospf->t_asbr_check);
        THREAD_OFF(ospf->t_asbr_nssa_redist_update);
        THREAD_OFF(ospf->t_distribute_update);
@@ -962,6 +950,15 @@ struct ospf_area *ospf_area_new(struct ospf *ospf, struct in_addr area_id)
        /* Self-originated LSAs initialize. */
        new->router_lsa_self = NULL;
 
+       /* Initialize FR field */
+       new->fr_info.enabled = false;
+       new->fr_info.configured = false;
+       new->fr_info.state_changed = false;
+       new->fr_info.router_lsas_recv_dc_bit = 0;
+       new->fr_info.indication_lsa_self = NULL;
+       new->fr_info.area_ind_lsa_recvd = false;
+       new->fr_info.area_dc_clear = false;
+
        ospf_opaque_type10_lsa_init(new);
 
        new->oiflist = list_new();
index 3a43010f85f6faff7721114fcb2de3670a77b50a..4df65ea759d65889cd3ca943ab9bbf7e8b39f4d3 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPFd main header.
  * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_OSPFD_H
@@ -116,7 +101,25 @@ struct ospf_redist {
                struct route_map *map;
        } route_map; /* +1 is for default-information */
 #define ROUTEMAP_NAME(R)   (R->route_map.name)
-#define ROUTEMAP(R)        (R->route_map.map)
+#define ROUTEMAP(R) (R->route_map.map)
+};
+
+/* OSPF area flood reduction info */
+struct ospf_area_fr_info {
+       bool enabled;       /* Area support for Flood Reduction */
+       bool configured;    /* Flood Reduction configured per area knob */
+       bool state_changed; /* flood reduction state change info */
+       int router_lsas_recv_dc_bit; /* Number of unique router lsas
+                                     * received with DC bit set.
+                                     * (excluding self)
+                                     */
+       bool area_ind_lsa_recvd;     /* Indication lsa received in this area */
+       bool area_dc_clear;       /* Area has atleast one lsa with dc bit 0(
+                                     * excluding indication lsa)
+                                     */
+       struct ospf_lsa *indication_lsa_self; /* Indication LSA generated
+                                              * in the area.
+                                              */
 };
 
 /* ospf->config */
@@ -255,6 +258,7 @@ struct ospf {
 
        /* Threads. */
        struct thread *t_abr_task;        /* ABR task timer. */
+       struct thread *t_abr_fr;          /* ABR FR timer. */
        struct thread *t_asbr_check;    /* ASBR check timer. */
        struct thread *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
                                                     update timer. */
@@ -406,6 +410,9 @@ struct ospf {
        bool ti_lfa_enabled;
        enum protection_type ti_lfa_protection_type;
 
+       /* Flood Reduction configuration state */
+       bool fr_configured;
+
        QOBJ_FIELDS;
 };
 DECLARE_QOBJ_TYPE(ospf);
@@ -591,6 +598,8 @@ struct ospf_area {
        uint32_t act_ints;  /* Active interfaces. */
        uint32_t full_nbrs; /* Fully adjacent neighbors. */
        uint32_t full_vls;  /* Fully adjacent virtual neighbors. */
+
+       struct ospf_area_fr_info fr_info; /* Flood reduction info. */
 };
 
 /* OSPF config network structure. */
index b88453c68f899697eaa2dd0bcedc38afe87ab7f9..45f4ac7ab8da50d856ad1276fb71f1b9b2e64a44 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1079,9 +1066,11 @@ static const char *objfun_type_name(enum objfun_type type)
                return "mss";
        case OBJFUN_MSN:
                return "msn";
-       default:
+       case OBJFUN_UNDEFINED:
                return NULL;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 DEFPY_NOSH(show_debugging_pathd, show_debugging_pathd_cmd,
index eec57073963f147ab4fdce99aa987f373d5cedf4..cae212d9ca571312bf9c44acf7289f8ac0c7c09c 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d9cfcb6ba2c1e7175e53aa59d9bfb9425f465ded..12a21cbb02b440ad19159b4667321433daaf6d03 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_DEBUG_H_
index 68372c29b6e01d71dd2a4ee1af00f66b5a63d4ca..53187fde2d0a31c9b735f0ba1e3a0da03a4fbc17 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pathd-specific error messages.
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5d05b6650b644d2b4155d9666a2a0c868ae06a34..69dd023d010fb0fdac9f6739e2a68a40f6beea01 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __PATH_ERRORS_H__
index 0a71c80ef05b8ae6e44693bc41ebb10b8cfbc6f7..3d35b9f9b30ad579167ebc2b0c598973f0547808 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 137e64d12ca6ff65b5f47c733620ca9a69b36b74..9e919571dd127308412de9dfef346074cc4bd6a9 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dacc5eb0d84ac87d713c37e154f42fecd2042f1c..21876d788303c2816136e3dbe7e1abab952b4279 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PATH_NB_H_
index e1fbb37f55c723bdfa298f7fab2bf7a409cb907d..ad24f23dd9f9730e70b45b40d87a66952b4477ab 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -239,7 +226,10 @@ void pathd_srte_segment_list_segment_nai_apply_finish(
                        args->dnode, "./local-prefix-len");
                local_prefix_len = atoi(local_prefix_len_buf);
                break;
-       default:
+       case SRTE_SEGMENT_NAI_TYPE_NONE:
+       case SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY_LINK_LOCAL_ADDRESSES:
+       case SRTE_SEGMENT_NAI_TYPE_IPV6_LOCAL_IFACE:
+       case SRTE_SEGMENT_NAI_TYPE_IPV6_ALGORITHM:
                break;
        }
 
index 60f04f45c15b6ef22432422fdb5f82b9ec2c2d96..35b9e37c7370d58e0613c12a964d1e53cbead981 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ce631eb7b040933484c13e0c0bfe4f0dfe3a88f3..0c5e495044d12f36054d9c7b47a867cb0a2d1f2e 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -210,7 +197,7 @@ int pcep_main_event_handler(enum pcep_main_event_type type, int pcc_id,
                ret = pcep_main_event_remove_candidate_segments(
                        (const char *)payload, true);
                break;
-       default:
+       case PCEP_MAIN_EVENT_UNDEFINED:
                flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR,
                          "Unexpected event received in the main thread: %u",
                          type);
index 597a4b6c83f9609c8629492f10ef4405570c8945..6f92d763622659fa6230128b8de63bdf211dc10e 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_H_
index 0f259f1dc717bc5849a3bf1f8a01e9bfa0858895..6c660a3d085cbe053acb2ee21b20e7371de313f7 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Volta Networks, Inc
  *                     Brady Johnson
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0b101ab2153cee3152e908d5e0aa79f0877a99ed..a6fd858e826b48461eb6d026bb41077f2c2ca23a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Volta Networks, Inc
  *                     Brady Johnson
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_CLI_H_
index 873b0ccd373a768627d671167af9cab5c704b958..21d127bcfe919fabd811263faaa1571480043abc 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -270,7 +257,8 @@ path_pcep_config_list_path_hops(struct srte_segment_list *segment_list)
                               sizeof(struct ipaddr));
                        hop->nai.remote_iface = segment->nai_remote_iface;
                        break;
-               default:
+               case SRTE_SEGMENT_NAI_TYPE_NONE:
+               case SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY_LINK_LOCAL_ADDRESSES:
                        break;
                }
                last_hop = hop;
@@ -489,9 +477,12 @@ status_int_to_ext(enum srte_policy_status status)
                return PCEP_LSP_OPERATIONAL_GOING_UP;
        case SRTE_POLICY_STATUS_GOING_DOWN:
                return PCEP_LSP_OPERATIONAL_GOING_DOWN;
-       default:
+       case SRTE_POLICY_STATUS_DOWN:
+       case SRTE_POLICY_STATUS_UNKNOWN:
                return PCEP_LSP_OPERATIONAL_DOWN;
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 enum pcep_sr_subobj_nai pcep_nai_type(enum srte_segment_nai_type type)
@@ -539,7 +530,10 @@ enum srte_segment_nai_type srte_nai_type(enum pcep_sr_subobj_nai type)
                return SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY;
        case PCEP_SR_SUBOBJ_NAI_UNNUMBERED_IPV4_ADJACENCY:
                return SRTE_SEGMENT_NAI_TYPE_IPV4_UNNUMBERED_ADJACENCY;
-       default:
+       case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
+       case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                return SRTE_SEGMENT_NAI_TYPE_NONE;
        }
+
+       assert(!"Reached end of function where we were not expecting to");
 }
index e56d497aa0259046bf76b35762eeca15597e9df3..e933728c7be01357c51903ba97615a50d2ed9de5 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_CONFIG_H_
index b9f2ba3c6380a088aa0386931547baed3846864e..405749b50ff4f837ded39d53f389a4c165e52697 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -22,7 +9,6 @@
 #include "command.h"
 #include "libfrr.h"
 #include "printfrr.h"
-#include "lib/version.h"
 #include "northbound.h"
 #include "frr_pthread.h"
 #include "jhash.h"
@@ -603,7 +589,9 @@ void pcep_thread_timer_handler(struct thread *thread)
                pcep_thread_remove_candidate_path_segments(ctrl_state,
                                                           pcc_state);
                break;
-       default:
+       case TM_PCEPLIB_TIMER:
+       case TM_UNDEFINED:
+       case TM_MAX:
                flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR,
                          "Unknown controller timer triggered: %u", timer_type);
                break;
@@ -823,7 +811,7 @@ void pcep_thread_event_handler(struct thread *thread)
                pcep_pcc_send_error(ctrl_state, pcc_state, error,
                                    (bool)sub_type);
                break;
-       default:
+       case EV_PCEPLIB_EVENT:
                flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR,
                          "Unexpected event received in controller thread: %u",
                          type);
@@ -1074,10 +1062,16 @@ const char *timer_type_name(enum pcep_ctrl_timer_type type)
                return "PCEPLIB_TIMER";
        case TM_TIMEOUT:
                return "TIMEOUT";
-       default:
+       case TM_CALCULATE_BEST_PCE:
+               return "BEST_PCE";
+       case TM_SESSION_TIMEOUT_PCC:
+               return "TIMEOUT_PCC";
+       case TM_MAX:
                return "UNKNOWN";
        }
-};
+
+       assert(!"Reached end of function where we did not expect to");
+}
 
 const char *timeout_type_name(enum pcep_ctrl_timeout_type type)
 {
@@ -1086,7 +1080,9 @@ const char *timeout_type_name(enum pcep_ctrl_timeout_type type)
                return "UNDEFINED";
        case TO_COMPUTATION_REQUEST:
                return "COMPUTATION_REQUEST";
-       default:
+       case TO_MAX:
                return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we did not expect to");
 }
index bc7ed4910acd3735d7d0c68113d1f4bfc274453c..c2359beb23c38035118b0b20fe395ef6b0183993 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_CONTROLLER_H_
index b0802ae6c3ecb0c19bb37675396a6f4477aea2db..7d04587b8d760c2ebb9cbb548c5299eb443d0667 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -90,9 +77,9 @@ const char *pcc_status_name(enum pcc_status status)
                return "SYNCHRONIZING";
        case PCEP_PCC_OPERATING:
                return "OPERATING";
-       default:
-               return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 const char *pcep_event_type_name(pcep_event_type event_type)
@@ -118,9 +105,13 @@ const char *pcep_event_type_name(pcep_event_type event_type)
                return "PCC_RCVD_MAX_INVALID_MSGS";
        case PCC_RCVD_MAX_UNKOWN_MSGS:
                return "PCC_RCVD_MAX_UNKOWN_MSGS";
-       default:
-               return "UNKNOWN";
+       case PCC_CONNECTION_FAILURE:
+               return "PCC_CONNECTION_FAILURE";
+       case PCC_SENT_INVALID_OPEN:
+               return "PCC_SENT_INVALID_OPEN";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 const char *pcep_error_type_name(enum pcep_error_type error_type)
@@ -640,9 +631,11 @@ const char *pcep_message_type_name(enum pcep_message_types pcep_message_type)
                return "INITIATE";
        case PCEP_TYPE_START_TLS:
                return "START_TLS";
-       default:
+       case PCEP_TYPE_MAX:
                return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 const char *pcep_object_class_name(enum pcep_object_classes obj_class)
@@ -694,9 +687,11 @@ const char *pcep_object_class_name(enum pcep_object_classes obj_class)
                return "SERVER_IND";
        case PCEP_OBJ_CLASS_ASSOCIATION:
                return "ASSOCIATION";
-       default:
+       case PCEP_OBJ_CLASS_MAX:
                return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 const char *pcep_object_type_name(enum pcep_object_classes obj_class,
@@ -769,9 +764,9 @@ const char *pcep_lsp_status_name(enum pcep_lsp_operational_status status)
                return "GOING_DOWN";
        case PCEP_LSP_OPERATIONAL_GOING_UP:
                return "GOING_UP";
-       default:
-               return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 
@@ -818,9 +813,11 @@ const char *pcep_tlv_type_name(enum pcep_object_tlv_types tlv_type)
                return "UNKNOWN";
        case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                return "ARBITRARY";
-       default:
-               return "UNKNOWN";
+       case PCEP_OBJ_TYPE_CISCO_BSID:
+               return "CISCO_BSID";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 const char *pcep_ro_type_name(enum pcep_ro_subobj_types ro_type)
@@ -839,9 +836,11 @@ const char *pcep_ro_type_name(enum pcep_ro_subobj_types ro_type)
                return "ASN";
        case RO_SUBOBJ_TYPE_SR:
                return "SR";
-       default:
+       case RO_SUBOBJ_UNKNOWN:
                return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 const char *pcep_nai_type_name(enum pcep_sr_subobj_nai nai_type)
@@ -861,9 +860,11 @@ const char *pcep_nai_type_name(enum pcep_sr_subobj_nai nai_type)
                return "UNNUMBERED_IPV4_ADJACENCY";
        case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
                return "LINK_LOCAL_IPV6_ADJACENCY";
-       default:
+       case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                return "UNKNOWN";
        }
+
+       assert(!"Reached end of function where we do not expect to");
 }
 
 const char *pcep_metric_type_name(enum pcep_metric_types type)
@@ -1115,7 +1116,7 @@ void _format_path(int ps, struct path *path)
                        PATHD_FORMAT("%*sendpoint: %pI6\n", ps3, "",
                                     &path->nbkey.endpoint.ipaddr_v6);
                        break;
-               default:
+               case IPADDR_NONE:
                        PATHD_FORMAT("%*sendpoint: NONE\n", ps3, "");
                        break;
                }
@@ -1300,7 +1301,9 @@ void _format_path_hop(int ps, struct path_hop *hop)
                                     &hop->nai.remote_addr.ipaddr_v6,
                                     hop->nai.remote_iface);
                        break;
-               default:
+               case PCEP_SR_SUBOBJ_NAI_ABSENT:
+               case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
+               case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                        PATHD_FORMAT("%*sNAI: UNSUPPORTED\n", ps, "");
                        break;
                }
@@ -1580,7 +1583,11 @@ void _format_pcep_object_ro_details(int ps, struct pcep_object_ro_subobj *ro)
        case RO_SUBOBJ_TYPE_SR:
                _format_pcep_object_ro_sr(ps, (struct pcep_ro_subobj_sr *)ro);
                break;
-       default:
+       case RO_SUBOBJ_TYPE_IPV6:
+       case RO_SUBOBJ_TYPE_LABEL:
+       case RO_SUBOBJ_TYPE_UNNUM:
+       case RO_SUBOBJ_TYPE_ASN:
+       case RO_SUBOBJ_UNKNOWN:
                PATHD_FORMAT("%*s...\n", ps, "");
                break;
        }
@@ -1668,7 +1675,9 @@ void _format_pcep_object_ro_sr(int ps, struct pcep_ro_subobj_sr *obj)
                        PATHD_FORMAT("%*sNAI: %pI4(%u)/%pI4(%u)\n", ps, "",
                                     laddr4, *liface, raddr4, *riface);
                        break;
-               default:
+               case PCEP_SR_SUBOBJ_NAI_ABSENT:
+               case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
+               case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                        PATHD_FORMAT("%*sNAI: UNSUPPORTED\n", ps, "");
                        break;
                }
@@ -1731,7 +1740,23 @@ void _format_pcep_object_tlv_details(int ps,
                        ps,
                        (struct pcep_object_tlv_path_setup_type *)tlv_header);
                break;
-       default:
+       case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+       case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+       case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+       case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+       case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+       case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+       case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+       case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+       case PCEP_OBJ_TLV_TYPE_SPEAKER_ENTITY_ID:
+       case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE_CAPABILITY:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+       case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+       case PCEP_OBJ_TYPE_CISCO_BSID:
+       case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                PATHD_FORMAT("%*s...\n", ps, "");
                break;
        }
index bc78c21d4a88c0600c54bf3c25bfb5a47fcecd82..cc63ca0f93719dee9cd77756232cd0e65062b688 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_DEBUG_H_
index 6b247b705f0b450b6e07a7ff81478f507e1a45d0..502f2336c75264ee3904451449a67975755c42fc 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -767,7 +754,9 @@ double_linked_list *pcep_lib_format_path(struct pcep_caps *caps,
                                                        .s_addr,
                                                hop->nai.remote_iface);
                                break;
-                       default:
+                       case PCEP_SR_SUBOBJ_NAI_ABSENT:
+                       case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
+                       case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                                break;
                        }
                }
@@ -854,7 +843,24 @@ void pcep_lib_parse_open(struct pcep_caps *caps, struct pcep_object_open *open)
                case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
                        pcep_lib_parse_open_objfun_list(caps, tlv_header);
                        break;
-               default:
+               case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+               case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+               case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+               case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+               case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+               case PCEP_OBJ_TLV_TYPE_SPEAKER_ENTITY_ID:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+               case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+               case PCEP_OBJ_TLV_TYPE_ARBITRARY:
+               case PCEP_OBJ_TLV_TYPE_SYMBOLIC_PATH_NAME:
+               case PCEP_OBJ_TYPE_CISCO_BSID:
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_TLV,
                                  "Unexpected OPEN's TLV %s (%u)",
                                  pcep_tlv_type_name(tlv_header->type),
@@ -915,7 +921,26 @@ void pcep_lib_parse_rp(struct path *path, struct pcep_object_rp *rp)
                case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
                        // TODO: enforce the path setup type is SR_TE_PST
                        break;
-               default:
+               case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+               case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+               case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+               case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+               case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+               case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+               case PCEP_OBJ_TLV_TYPE_SPEAKER_ENTITY_ID:
+               case PCEP_OBJ_TLV_TYPE_SR_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+               case PCEP_OBJ_TLV_TYPE_STATEFUL_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+               case PCEP_OBJ_TLV_TYPE_ARBITRARY:
+               case PCEP_OBJ_TLV_TYPE_SYMBOLIC_PATH_NAME:
+               case PCEP_OBJ_TYPE_CISCO_BSID:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE_CAPABILITY:
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_TLV,
                                  "Unexpected RP's TLV %s (%u)",
                                  pcep_tlv_type_name(tlv->type), tlv->type);
@@ -945,7 +970,26 @@ void pcep_lib_parse_srp(struct path *path, struct pcep_object_srp *srp)
                case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
                        // TODO: enforce the path setup type is SR_TE_PST
                        break;
-               default:
+               case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+               case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+               case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+               case PCEP_OBJ_TLV_TYPE_STATEFUL_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_SYMBOLIC_PATH_NAME:
+               case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+               case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+               case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+               case PCEP_OBJ_TLV_TYPE_SPEAKER_ENTITY_ID:
+               case PCEP_OBJ_TLV_TYPE_SR_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+               case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+               case PCEP_OBJ_TYPE_CISCO_BSID:
+               case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_TLV,
                                  "Unexpected SRP's TLV %s (%u)",
                                  pcep_tlv_type_name(tlv->type), tlv->type);
@@ -991,7 +1035,25 @@ void pcep_lib_parse_lsp(struct path *path, struct pcep_object_lsp *lsp)
                        path->binding_sid = ntohl(path->binding_sid);
                        path->binding_sid = (path->binding_sid >> 12);
                        break;
-               default:
+               case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+               case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+               case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+               case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+               case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+               case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+               case PCEP_OBJ_TLV_TYPE_SPEAKER_ENTITY_ID:
+               case PCEP_OBJ_TLV_TYPE_SR_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+               case PCEP_OBJ_TLV_TYPE_STATEFUL_PCE_CAPABILITY:
+               case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+               case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_TLV,
                                  "Unexpected LSP TLV %s (%u)",
                                  pcep_tlv_type_name(tlv->type), tlv->type);
@@ -1082,7 +1144,12 @@ void pcep_lib_parse_ero(struct path *path, struct pcep_object_ro *ero)
                        hop = pcep_lib_parse_ero_sr(
                                hop, (struct pcep_ro_subobj_sr *)obj);
                        break;
-               default:
+               case RO_SUBOBJ_TYPE_IPV4:
+               case RO_SUBOBJ_TYPE_IPV6:
+               case RO_SUBOBJ_TYPE_LABEL:
+               case RO_SUBOBJ_TYPE_UNNUM:
+               case RO_SUBOBJ_TYPE_ASN:
+               case RO_SUBOBJ_UNKNOWN:
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_ERO_SUBOBJ,
                                  "Unexpected ERO sub-object %s (%u)",
                                  pcep_ro_type_name(obj->ro_subobj_type),
@@ -1181,7 +1248,9 @@ struct path_hop *pcep_lib_parse_ero_sr(struct path_hop *next,
                        assert(n->data != NULL);
                        hop->nai.remote_iface = *(uint32_t *)n->data;
                        break;
-               default:
+               case PCEP_SR_SUBOBJ_NAI_ABSENT:
+               case PCEP_SR_SUBOBJ_NAI_LINK_LOCAL_IPV6_ADJACENCY:
+               case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                        hop->has_nai = false;
                        flog_warn(EC_PATH_PCEP_UNEXPECTED_SR_NAI,
                                  "Unexpected SR segment NAI type %s (%u)",
index 524f385d140da3a652d3455dce60e42f843de29d..6bba344ba5bb1b54cb24f7d1b4ea264e57ff9ba5 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_LIB_H_
index a1c56f93ad5a8288f0df465fc665bfd1c038d01b..0ff0b4403a226cefa9c74223b6612eb4b48048bf 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* TODOS AND KNOWN ISSUES:
@@ -33,7 +20,6 @@
 #include "command.h"
 #include "libfrr.h"
 #include "printfrr.h"
-#include "lib/version.h"
 #include "northbound.h"
 #include "frr_pthread.h"
 #include "jhash.h"
@@ -450,9 +436,11 @@ int pcep_pcc_disable(struct ctrl_state *ctrl_state, struct pcc_state *pcc_state)
                pcc_state->sess = NULL;
                pcc_state->status = PCEP_PCC_DISCONNECTED;
                return 0;
-       default:
+       case PCEP_PCC_INITIALIZED:
                return 1;
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 void pcep_pcc_sync_path(struct ctrl_state *ctrl_state,
@@ -614,7 +602,8 @@ void pcep_pcc_timeout_handler(struct ctrl_state *ctrl_state,
                        free_req_entry(req);
                }
                break;
-       default:
+       case TO_UNDEFINED:
+       case TO_MAX:
                break;
        }
 }
@@ -674,7 +663,7 @@ void pcep_pcc_pathd_event_handler(struct ctrl_state *ctrl_state,
                if (pcc_state->caps.is_stateful)
                        send_report(pcc_state, path);
                return;
-       default:
+       case PCEP_PATH_UNDEFINED:
                flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR,
                          "Unexpected pathd event received by pcc %s: %u",
                          pcc_state->tag, type);
@@ -748,7 +737,7 @@ void pcep_pcc_pcep_event_handler(struct ctrl_state *ctrl_state,
                       || pcc_state->status == PCEP_PCC_OPERATING);
                handle_pcep_message(ctrl_state, pcc_state, event->message);
                break;
-       default:
+       case PCC_CONNECTION_FAILURE:
                flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEPLIB_EVENT,
                          "Unexpected event from pceplib: %s",
                          format_pcep_event(event));
@@ -1179,7 +1168,15 @@ void handle_pcep_message(struct ctrl_state *ctrl_state,
        case PCEP_TYPE_PCREP:
                handle_pcep_comp_reply(ctrl_state, pcc_state, msg);
                break;
-       default:
+       case PCEP_TYPE_OPEN:
+       case PCEP_TYPE_KEEPALIVE:
+       case PCEP_TYPE_PCREQ:
+       case PCEP_TYPE_PCNOTF:
+       case PCEP_TYPE_ERROR:
+       case PCEP_TYPE_CLOSE:
+       case PCEP_TYPE_REPORT:
+       case PCEP_TYPE_START_TLS:
+       case PCEP_TYPE_MAX:
                flog_warn(EC_PATH_PCEP_UNEXPECTED_PCEP_MESSAGE,
                          "Unexpected pcep message from pceplib: %s",
                          format_pcep_message(msg));
@@ -1953,9 +1950,11 @@ static uint32_t hash_nbkey(const struct lsp_nb_key *nbkey)
        case IPADDR_V6:
                return jhash(&nbkey->endpoint.ipaddr_v6,
                             sizeof(nbkey->endpoint.ipaddr_v6), hash);
-       default:
+       case IPADDR_NONE:
                return hash;
        }
+
+       assert(!"Reached end of function where we were not expecting to");
 }
 
 static int cmp_nbkey(const struct lsp_nb_key *a, const struct lsp_nb_key *b)
index 9e712baf16a5ad94b163a9fc02dc468729eaeea9..039d67d2e25ef44238ed2c402db5b249a79591eb 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PATH_PCEP_PCC_H_
index 5fc8a1f03252d765247edd4d10057ca8398cdb26..bc0da969e3b0268a15474d985a5aa6b5a6bead76 100644 (file)
@@ -1,16 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Volta Networks, Inc
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
@@ -527,7 +518,7 @@ uint32_t path_ted_config_write(struct vty *vty)
                case IMPORT_OSPFv3:
                        vty_out(vty, "  mpls-te import ospfv3\n");
                        break;
-               default:
+               case IMPORT_UNKNOWN:
                        break;
                }
        }
index 5a0c8eecd337363b2b3f0f9c8cb61e261ccffc6b..10cdd545f12bfe9eae752c69e0f4c001ecaa95ba 100644 (file)
@@ -1,16 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Volta Networks, Inc
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
index a98532cc399e9d8694a9545f954469c7598d76b7..efc016f750288c5d5ddabb0913f54290960c440e 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 683fcf10f7676d77469c3ad92b63ebef4f39c7fc..0d435bb519b5460ebf1833526f5ad78a0e37cb6a 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PATH_MPLS_H_
index 167c88aeab1eaba4c4cbb989211ed292eee0d24a..86501f7ad83e0a5489ff7ac360d4880fe9f76c3d 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -281,7 +268,8 @@ int srte_segment_entry_set_nai(struct srte_segment_entry *segment,
                segment->nai_local_iface = local_iface;
                status = srte_ted_do_query_type_e(segment, &pre, local_iface);
                break;
-       default:
+       case SRTE_SEGMENT_NAI_TYPE_NONE:
+       case SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY_LINK_LOCAL_ADDRESSES:
                segment->nai_local_addr.ipa_type = IPADDR_NONE;
                segment->nai_local_iface = 0;
                segment->nai_remote_addr.ipa_type = IPADDR_NONE;
@@ -472,7 +460,11 @@ int srte_policy_update_ted_sid(void)
                                                s_entry, &prefix_cli,
                                                s_entry->nai_algorithm);
                                break;
-                       default:
+                       case SRTE_SEGMENT_NAI_TYPE_NONE:
+                       case SRTE_SEGMENT_NAI_TYPE_IPV4_NODE:
+                       case SRTE_SEGMENT_NAI_TYPE_IPV6_NODE:
+                       case SRTE_SEGMENT_NAI_TYPE_IPV4_UNNUMBERED_ADJACENCY:
+                       case SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY_LINK_LOCAL_ADDRESSES:
                                break;
                        }
                }
@@ -1025,9 +1017,11 @@ static uint32_t filter_type_to_flag(enum affinity_filter_type type)
                return F_CANDIDATE_HAS_INCLUDE_ANY;
        case AFFINITY_FILTER_INCLUDE_ALL:
                return F_CANDIDATE_HAS_INCLUDE_ALL;
-       default:
+       case AFFINITY_FILTER_UNDEFINED:
                return 0;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static const char *filter_type_name(enum affinity_filter_type type)
@@ -1039,9 +1033,11 @@ static const char *filter_type_name(enum affinity_filter_type type)
                return "include-any";
        case AFFINITY_FILTER_INCLUDE_ALL:
                return "include-all";
-       default:
+       case AFFINITY_FILTER_UNDEFINED:
                return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 /**
@@ -1155,7 +1151,9 @@ void srte_candidate_status_update(struct srte_candidate *candidate, int status)
                case SRTE_POLICY_STATUS_GOING_UP:
                case SRTE_POLICY_STATUS_DOWN:
                        return;
-               default:
+               case SRTE_POLICY_STATUS_UNKNOWN:
+               case SRTE_POLICY_STATUS_UP:
+               case SRTE_POLICY_STATUS_GOING_DOWN:
                        policy->status = SRTE_POLICY_STATUS_DOWN;
                        srte_policy_status_log(policy);
                        break;
@@ -1165,7 +1163,10 @@ void srte_candidate_status_update(struct srte_candidate *candidate, int status)
                switch (policy->status) {
                case SRTE_POLICY_STATUS_UP:
                        return;
-               default:
+               case SRTE_POLICY_STATUS_UNKNOWN:
+               case SRTE_POLICY_STATUS_DOWN:
+               case SRTE_POLICY_STATUS_GOING_DOWN:
+               case SRTE_POLICY_STATUS_GOING_UP:
                        policy->status = SRTE_POLICY_STATUS_UP;
                        srte_policy_status_log(policy);
                        break;
@@ -1263,9 +1264,11 @@ const char *srte_origin2str(enum srte_protocol_origin origin)
                return "BGP";
        case SRTE_ORIGIN_LOCAL:
                return "Local";
-       default:
+       case SRTE_ORIGIN_UNDEFINED:
                return "Unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 void path_policy_show_debugging(struct vty *vty)
index bb2e63c04ba725dfa44721974e059eb248dd50f4..f1a59b1167d97676d26ff0ea78c062dd6daf27ea 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PATHD_H_
index 99489777eb471ff94dd32990368c3f70a6ee0d5a..b30b54b7f0a4fbd6252cda4bb506c357219b4aad 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR - debugging
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index e72fb88bebcc613e3a4015226ce976d78bf1016b..09109971d2ab0c556ffef4cf967ffa552f1e392f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR - debugging
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_DEBUG_H__
 #define __PBR_DEBUG_H__
index 28a7b62d10638f5186f92e44b1b3b011078fe54f..9b34815c4db3a39ee7d5ef3a283ca478ae280049 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR - main code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 5daac55debf42877a6b79907bfa6dcbb27142dfd..0e18f1198dfd78fd3ab1df17dda902cee65c5947 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR-map Code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 3527523fc16243dfd6eb2c4c210999d44f4283db..c9da431b38cd88d014572d369704b5b78af2099a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR-map Header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_MAP_H__
 #define __PBR_MAP_H__
index 5531d41935f9b422bb8105eb28e750e17ae51a22..0e93eccf46c32b62f069f81a39f1bf1d8c78e42a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR memory code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index eb13d5d9d1d57eab36ebe6e460096ad57106ca4c..29a09db9601ab45b5a718f89221ef8d9e7d721c2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pbr memory code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_MEMORY_H__
 
index 298c9615198791dfc66ded835c919751db50dca7..405a2d6588605853e85a9719abbb4c798c96f6cd 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR-nht Code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -547,7 +534,8 @@ void pbr_nht_set_seq_nhg_data(struct pbr_map_sequence *pbrms,
        case NEXTHOP_TYPE_IPV4:
        case NEXTHOP_TYPE_IPV4_IFINDEX:
                pbrms->family = AF_INET;
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 }
index 900b7627f257d7737f914bf8b3be903b9133be5c..9b67492fbc2708e642e172b72da022efdc5c63eb 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR-nht Header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_NHT_H__
 #define __PBR_NHT_H__
index 277269a986b037c6bb3dc687827b14908bbb7bdc..ef4a4c2c6310d6f5b3f7b731f294a01065e54032 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR - vrf code
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *               Stephen Worley
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index e37bcd42baa9ba54a253d36fd136bf19f0118420..c8c7c5763d7a4d21a0a575785446026c1da8ef48 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRF library for PBR
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *               Stephen Worley
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_VRF_H__
 #define __PBR_VRF_H__
index e8e5981ec55e09ef06fd7bc1f78e8c7d0d3f4962..bb09a10b982924df0cc8d4101400cfcad838ec02 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PBR - vty code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -933,12 +920,12 @@ static void vty_show_pbrms(struct vty *vty,
 
                if (detail)
                        vty_out(vty,
-                               "          Installed: %u(%d) Tableid: %d\n",
+                               "          Installed: %u(%d) Tableid: %u\n",
                                pbrms->nhs_installed,
                                pbr_nht_get_installed(pbrms->nhgrp_name),
                                pbr_nht_get_table(pbrms->nhgrp_name));
                else
-                       vty_out(vty, "          Installed: %s Tableid: %d\n",
+                       vty_out(vty, "          Installed: %s Tableid: %u\n",
                                pbr_nht_get_installed(pbrms->nhgrp_name) ? "yes"
                                                                         : "no",
                                pbr_nht_get_table(pbrms->nhgrp_name));
@@ -948,12 +935,12 @@ static void vty_show_pbrms(struct vty *vty,
                pbrms_nexthop_group_write_individual_nexthop(vty, pbrms);
                if (detail)
                        vty_out(vty,
-                               "          Installed: %u(%d) Tableid: %d\n",
+                               "          Installed: %u(%d) Tableid: %u\n",
                                pbrms->nhs_installed,
                                pbr_nht_get_installed(pbrms->internal_nhg_name),
                                pbr_nht_get_table(pbrms->internal_nhg_name));
                else
-                       vty_out(vty, "          Installed: %s Tableid: %d\n",
+                       vty_out(vty, "          Installed: %s Tableid: %u\n",
                                pbr_nht_get_installed(pbrms->internal_nhg_name)
                                        ? "yes"
                                        : "no",
index 6e345fd7e21ca7e8a75844b9f5d3fb15f82ff15e..9158d8d5b731e93a1ac30310293906d786f7a937 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VTY library for PBR
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_VTY_H__
 #define __PBR_VTY_H__
index 4506dc1af16bc04f7af51130145a2b16e5dad42a..1b18853d2b87feb19342f58bb3cdec24e66db748 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index d0f9ff910ca4fefd604ab187d60b80595bd39b89..850e5f06d13b1dd9a78096f7d5cb2222480cf770 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for PBR
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PBR_ZEBRA_H__
 #define __PBR_ZEBRA_H__
index b5d02c7e628265b3c895b62223e694f7ef65ed08..cb7019dac6e21fb7c34f9f21d46f1e717024b91f 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index d835b87f942932d9e4886c2a6d709415c76faf3d..9a1a66062fadd99c25de4ed740b0653a8b81a85d 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 5a244098d43081de5c253bb58cd0592f395723e7..eb0f679a17f7ec3df80f81cde0c25f876141d987 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 8542ea10e77401dabbc1210abbac84af8456fb64..8876e0d750b2becc06d71fb27cad92bf467e3450 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index 2d27e404072f018e7379160f9fbc01ceca6fcacc..1b9f1c468c9362e3ab037de95288d5d05b1c20d6 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index c72dfd7061157a797920fdbc235aaa62cc525934..f42eaa4cbbdcb72fc835616be64144ccaf83357c 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index d62cc7e2779008a27c73b1ca3590ca5a39d7c5e5..68e8b1a8f038d854889437dde7d7ac0ed0c56e65 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index ce41ee953f4f4231810ba11e017785f587f8e68b..e7af6b3bcb531c600e5da2832b555bcc730af155 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 6d7d3be7e6107979b20fdfba4f71e2655a207a41..42a8bbf7b95d056fc0ef4892c0b07d9cec091b0a 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index 75eb112e2e30824581945831ef5e1ac7706a1485..2747678f8d94cb218d9aa2d909c0bbc64e21a3dc 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
@@ -923,12 +911,13 @@ uint16_t pcep_encode_obj_ro(struct pcep_object_header *hdr,
                                index += LENGTH_10WORDS;
                                break;
 
-                       default:
+                       case PCEP_SR_SUBOBJ_NAI_ABSENT:
+                       case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                                break;
                        }
                } break;
 
-               default:
+               case RO_SUBOBJ_UNKNOWN:
                        break;
                }
        }
@@ -1712,7 +1701,7 @@ struct pcep_object_header *pcep_decode_obj_ro(struct pcep_object_header *hdr,
                        } break;
 
                        case PCEP_SR_SUBOBJ_NAI_ABSENT:
-                       default:
+                       case PCEP_SR_SUBOBJ_NAI_UNKNOWN:
                                break;
                        }
                } break;
index 6298ed4b8db791ab247b4696648003f58b3aeab2..86a7db6dd89ac2f6e615453169081a2182fc7d3a 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 6dd2b5655268c7be2ece34756c16a9ddc6ae52fb..61f446f03530871c5bc57ea74de948b313fc958c 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index b5a65d457b4c853298248335ca5231e4d0a30570..08a4302c243cfc8f37e9de0f136cd26e6e551bc0 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index f7c25f447b27057b9a91d68e11de2ba3b336ceae..fe161f070b29ec7098063617e1bb1ca278959ad0 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
@@ -313,7 +301,25 @@ void pcep_obj_free_tlv(struct pcep_object_tlv_header *tlv)
                }
                break;
 
-       default:
+       case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+       case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+       case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+       case PCEP_OBJ_TLV_TYPE_STATEFUL_PCE_CAPABILITY:
+       case PCEP_OBJ_TLV_TYPE_SYMBOLIC_PATH_NAME:
+       case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+       case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+       case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+       case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+       case PCEP_OBJ_TLV_TYPE_LSP_DB_VERSION:
+       case PCEP_OBJ_TLV_TYPE_SR_PCE_CAPABILITY:
+       case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+       case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+       case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+       case PCEP_OBJ_TYPE_CISCO_BSID:
+       case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                break;
        }
 
@@ -387,7 +393,25 @@ void pcep_obj_free_object(struct pcep_object_header *obj)
                }
                break;
 
-       default:
+       case PCEP_OBJ_CLASS_OPEN:
+       case PCEP_OBJ_CLASS_RP:
+       case PCEP_OBJ_CLASS_NOPATH:
+       case PCEP_OBJ_CLASS_ENDPOINTS:
+       case PCEP_OBJ_CLASS_BANDWIDTH:
+       case PCEP_OBJ_CLASS_METRIC:
+       case PCEP_OBJ_CLASS_LSPA:
+       case PCEP_OBJ_CLASS_NOTF:
+       case PCEP_OBJ_CLASS_ERROR:
+       case PCEP_OBJ_CLASS_CLOSE:
+       case PCEP_OBJ_CLASS_OF:
+       case PCEP_OBJ_CLASS_LSP:
+       case PCEP_OBJ_CLASS_SRP:
+       case PCEP_OBJ_CLASS_VENDOR_INFO:
+       case PCEP_OBJ_CLASS_INTER_LAYER:
+       case PCEP_OBJ_CLASS_REQ_ADAP_CAP:
+       case PCEP_OBJ_CLASS_SERVER_IND:
+       case PCEP_OBJ_CLASS_ASSOCIATION:
+       case PCEP_OBJ_CLASS_MAX:
                break;
        }
 
index b62bdde1cfd85ba88f4d82e503701a1c4e0b47bc..e756b461b0bdb1f8be1e375811e788323c3de2aa 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  */
 
index 47e357729ceb583076d62ba4a7f1bc8d8aa3610d..92a968ef78249a6074f9109285494ed34b36bcec 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 75c2b59b66d21935eef97b0ba4dc69acc507e225..a8076423be03e802be9dbc5f08978c87d957ceb9 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 5756e23efcf767ffa4f9f179731867150f9b67a2..f29de68fb678476cc8fbfe8112c2a4fc2cb96423 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 02cf3bffbd74b44feb783fc51cfed282e01df81f..f71c93a73b445d2fd3ecffe88b701743106b1558 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 9cdec5250f037319af779ec9371ec8f0011bf58a..d7ef7c355ffdfc4368ec6ac47e7e98312629731a 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index fceb15af76f1e95b3988095538ce8d7186253cb6..6f6f2a0df46532acdc880eb492b3f6420752a900 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 004459b918c96369ab3a5af2ab9a687274baf743..9c29c17b323d8e17fcfa7ca7a92a9e28ec13f4d4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 77392fb6a95800b6806758e9ed1525bc3644a477..6717f4676d0f9aa6d1c87d7f1c1cc002fd970db4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 3e9c701a629f2f3756d26f29481636853138d89c..269145216efe4eb66119949f50d827677f0a58df 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
@@ -242,7 +230,22 @@ bool verify_pcep_open_object(pcep_session *session,
                case PCEP_OBJ_TLV_TYPE_SR_PCE_CAPABILITY:
                        break;
 
-               default:
+               case PCEP_OBJ_TLV_TYPE_NO_PATH_VECTOR:
+               case PCEP_OBJ_TLV_TYPE_OBJECTIVE_FUNCTION_LIST:
+               case PCEP_OBJ_TLV_TYPE_VENDOR_INFO:
+               case PCEP_OBJ_TLV_TYPE_SYMBOLIC_PATH_NAME:
+               case PCEP_OBJ_TLV_TYPE_IPV4_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_IPV6_LSP_IDENTIFIERS:
+               case PCEP_OBJ_TLV_TYPE_LSP_ERROR_CODE:
+               case PCEP_OBJ_TLV_TYPE_RSVP_ERROR_SPEC:
+               case PCEP_OBJ_TLV_TYPE_PATH_SETUP_TYPE:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_POL_NAME:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_ID:
+               case PCEP_OBJ_TLV_TYPE_SRPOLICY_CPATH_PREFERENCE:
+               case PCEP_OBJ_TLV_TYPE_UNKNOWN:
+               case PCEP_OBJ_TYPE_CISCO_BSID:
+               case PCEP_OBJ_TLV_TYPE_ARBITRARY:
                        /* TODO how to handle unrecognized TLV ?? */
                        pcep_log(
                                LOG_INFO,
@@ -895,7 +898,7 @@ void handle_timer_event(pcep_session_event *event)
 
        case SESSION_STATE_INITIALIZED:
        case SESSION_STATE_PCEP_CONNECTED:
-       default:
+       case SESSION_STATE_UNKNOWN:
                pcep_log(
                        LOG_INFO,
                        "%s: handle_timer_event unrecognized state transition, timer_id [%d] state [%d] session [%d]",
@@ -1120,7 +1123,8 @@ void handle_socket_comm_event(pcep_session_event *event)
                        message_enqueued = true;
                        break;
 
-               default:
+               case PCEP_TYPE_START_TLS:
+               case PCEP_TYPE_MAX:
                        pcep_log(LOG_INFO, "%s: \t UnSupported message",
                                 __func__);
                        send_pcep_error(session,
index 4a97c848918604a488a5640cdcdf7ac33d9b140a..30fbc8270ba02b5123920b01d94b21d5f611dce5 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 89d249291432abe18ff557bdba21dd0567e7195b..30edee410a217d1d8d3ff6c52028e5c88b914709 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 4445a14facadd3107860190d8711c53dbb2cee19..f5648477c657d84662a0c5fcbac729927e12e7b5 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index ed8037d074e10c87153ca3771f532d697d32642c..87c45d939f8b54d5a8acbf0307cd96a7701085d4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 3ca2c037fabd400c3dd5c6e71503dfaf2b837486..3c68efcefc4079455b556a15aa88a00759a9fd94 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 7a9511e315523af90c3881abde5e273338c02480..24755efee9405049a9051646b64adbfd9612b5e4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index ca0e38b803e854bed728b8194ee3679b2fad8414..1290b8b7b7e544f39ea8780046739cf097abc4c4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 8221c78baa531a8bebd44969537c8a3e9a6371c4..a10243c0f4b41c9a987d5209b122c32862fb07dd 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 61fda163637e9721444025fab98fb81998eef0e0..79ae563f140b5b4e58cafde7c17e3fac47c41364 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index b2cc6ec546c607791c55cc187f08f84bb2bd97cf..bbd21bdda2535d68b50e9fde09b383131ba5cbcb 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 8984496717a7b605fa9fa1fbf1e71ed4b464f8d1..ce75dde900b5b54f77fbb28298262fded8094609 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index c4a7264da3079c9183411bc25b87abeb7165a9e0..88d8d14539bb7e47d3e02a5f88e9fef32c168ba0 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index d8078f683f29d4777b6f84add8ca44e78b0a9be6..badef9351a759d61edd1b61c9b1d79a05d462cc0 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index b10ced7d656c87256c298bf5a6648d097e1241e4..755c94eb0cd46ac175f7ffd048ce847246e935c9 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 7f90df40f24d1aa2102fbcdbd035b5606a43b3da..2eeffb25032b7cef7b12604aa0f8fde822ecf66e 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 4fe01726ad7cf2083fbed585773065d0470fb849..4eab428fe91808fa3ea28cc07ef6a2d0a458f24f 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 7afe55f125e43d077e6379b3582a7bbe3897f42f..926b662b32e60e3f36d4a01ca877e875b94b1fcb 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 24ea495bd8631672ef007b85bf641614c9c28c60..2336114bc050806aee9893ea1019ca859a9ef433 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 10856cac2a6dfd2c5d60ce521601ee3d5433e4f6..c3a2ab90cdfc32887952c5db694cf405efcbded5 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 4624a91a1c8f243aa287b5c94ae0f4286bd9a4d6..a969143d768b0aa00aaa6f784d6089c46ad571ef 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 81eb614494738c042362dc8575a4e3a675127554..43b4863b41f10bd78326f7c8fba03fedf90dca9d 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index ec132dc16467fd913b9b6b9630d3bfe4347ffe9b..2d4e5c2a330aa4019b4cf699c4f0886ace9df9d5 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 22e417111ffce0f5b0ae3c8bff8a706ae1d92f5f..27a64b775357171bc34503a49ce5cb1e85a7f095 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 838067640e0895333a253f942a2554cae919962b..d3f8c20ca65f3e4e00cafdb138ed4737138d8840 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index e3a74f92d1a169810e8ebdfda77952549d1d538b..c4eaeaab2449c7bcc106bcc74ef4aefe00d26fdd 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index a3295c74eb42e4da4b50d1ddecaf3f342c1a5b4d..b9cfa93e71f2d0f6cf601223acf0802591ef8525 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index f24a797f776acbec177d62233fad145bfede5b4f..8e8e7cdefc2574c4921527d485652b50651c177d 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index b1463751d6d0b1e864b0d6cd7647a45d97ba061c..3237fecb1f932abd4d8449b1290c86465ba0725e 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 863517d1e375dd9c02d7af9f08f8af3adf75bfec..e395520e5090b9e4bd85663e8a12190327bcd91b 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index a92bbe48964ddef55469119714b2adb6def67b65..1315fe3f34c2c8fae9572728390848387f04d7af 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 0f08193a59debc01a17fb7aa43fff2db33e54caa..3a3577be716e63ceb216896f70349ae3fda23447 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 888925fdbf0e153f7bf8258940a7bc51dec6b285..3ead269a6f6f2212d093602d73a15c2ed98a7540 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index a961d7e47392da44799eeb844144612a601665b7..78ef5acb68e21d9be7a0a646494a19b9d5b0ea5a 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index ffbe802d34519eddfeb7626a128fcee84aee10d3..858650ec8f2dc15a48d6c402e025437675d995bc 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index dc66390801aae24010cf6720a3b7b7de127dede9..3d740d3bf88238e7b940298d6228d95d82252990 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 9106671873e8c211a3beae44fe169a12480007e0..904308fdfd3ad9f4be63eb79a289c8be2a8279e7 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index d3db96e0ce65a92f9aedf7ba2f992c87d058c663..493301018fc1e444668bef641200e6a7e781e1dc 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 5d9e92c1d38d7405bc78647bf85cf9250c28f483..d0cfa683b300352bd815239d76fe9c00a4043f13 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 7a4271528365dfb41f0f0725ae7a4bb59732d941..0f74cff31ec234906680e9660220ac003abf94af 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index ae3c3e37537ef18daa8de88f7e9665870caf4c5f..f2ad822251d52bfd43341af207187d426138fdb7 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 17ddae669f0cebe053e1f7126e1f0bfb37e2aa1f..695d59d7ae7366f3c9d98bc9f7e18c3bb2efc26b 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index e42b501ed983593d689e2288c321e3390f39de14..3d8dcc030dff28e922b8f77d6b1786618425a95b 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 8339a7a28052b6c8f0a32ce8feec788f21ff3a6c..c5b2bb3e2675912f14bf6faafa351ea72e72347f 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 6cc19632503283d2dd00f490f0ad90d2be35e844..325b8079cd06288eec2eab5c3aa6260938ca4ae2 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 9a15390c1b0914c42a7163a7f9d7ff2c47281528..eac574e650ff0d6a33c8810908fdba53c55b69d6 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 748cf433e60882c863ef673ceb56fdaad0a3d44d..3b51635d9f15d1516915cfde5cf9faa6d65a54f3 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index d2e3f21ee13a4750fd7ed7e56013a80333dd4e2e..36220a9ddeaf74bfccd334c4135cd909e47d9c11 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 116531f12d0d29d97c6c958f782ba9627d6c28c6..c0b73c3dbc1e7d9b29c99b10f260418426f98f97 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index f857af087aaa334df979bb9b07964e5281cac478..a4d1dd4fd098a60b7a70afe610ef83cd5f1cba3c 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 6a5839d3d0970a1295ddf9f8cd62670510c43b81..2f39a9d135184fe937f87a0aa02fe1883f086851 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 79ed84bfeb9ee1371567d95da00e8dfba72d6a4a..6ab2bf7d51589a741bc942d921af9a37ef644b06 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 19fd264858fdf55a002ebf8cd87c800803d9bfe5..cc49908be4603ec7e80dfe673ac2e0f12b3bc6ab 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index e5be90a8ed3c5cb2ecfb8500e81635b61bee9f0e..c782d797759e9ef259af74e3cd81308bc80f1d4a 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 6ac9a90e49e7313b0f67e81c9ecbe28ebb3c2808..b37bb6b1ec956179d4ca664e6d9a0014cd7d97fe 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index f3aa8307a7bec30bbba6538d2a8cba5c6fc5bbc3..7043bd497c58426b490d92d4807ea63a2f5e1a73 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index b31715f7aca98198798ca0592d8fcbb2b23320a8..2cad9a64438f21a905e32a10343f2ada7f6fcc31 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 07236dcb536e1bcba3bb5327925a66cc298467e6..2d4c801485689981207dec7703ba7e2f91b2ae2b 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 181cbeca37f45dd628c181687b8d757909a1bc82..378c9497638f627db1a8a574acc4e07052b92f07 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index ddb6467cb6adf60dc6c3f9e2c062dfd5f7606fae..f04d456c2c1a143cfa78e49221f41d53f05c10a4 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 0958626a0cf09b01f8951125880cca2fd405f459..a7d25216f638f737e81fc194b2dec37b5372f1f1 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 4e0c3fadf1ce07702d7349702aba10178332a8b1..8516548431e172d46426f7d3e56dda8153d1e51e 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 12ac456e234aedf9bfeaae72554addadff0488a8..8b236cc6de1419ea0d607ca62944b86cc70fb07e 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 3686848b69c15b364d7cc9f824c66831fa01a8f9..550ac50c95219e621516b1efd7944777dd98c642 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index 6e62c75636f1a20e015efc104963135733dc6709..545ad499e50b8f5835c0e41f97c23872dba55f22 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
index 16236d0d9d42341067500c05025d4d99e6502100..bfe3f652755a4d47d648e780a2a0f6127746b441 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Javier Garcia <javier.garcia@voltanet.io>
  *
  */
index ad9f76933a7c243a0ef3a7b4b1bf4aa1fcdb5430..343c80098270807adbc4ff05734ec2dbe1a293e6 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
 /*
  * This file is part of the PCEPlib, a PCEP protocol library.
  *
  * Copyright (C) 2020 Volta Networks https://voltanet.io/
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
  * Author : Brady Johnson <brady@voltanet.io>
  *
  */
diff --git a/pimd/COPYING b/pimd/COPYING
deleted file mode 100644 (file)
index 3912109..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
index 3b69964960f93608a25015cec74df14011f55fe3..9c3f1a7a9af5a3abe1efed19a0683f95529d39fb 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Multicast Traceroute for FRRouting
  * Copyright (C) 2018  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9bdf9490076ecf871d2ee6f3bb48a6333de22456..16873ed3e7cfff8f7b4e8bf62f19f5e7ae6daaa3 100644 (file)
@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libnetlink.c        RTnetlink service routines.
  *
- *             This program is free software; you can redistribute it and/or
- *             modify it under the terms of the GNU General Public License
- *             as published by the Free Software Foundation; either version
- *             2 of the License, or (at your option) any later version.
- *
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
  */
index 46e176e72618144c4670241b92fbbf0148c8cd6f..1f22927d4af33a4d62420aada7608162eadb80e8 100644 (file)
@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * libnetlink.c        RTnetlink service routines.
  *
- *             This program is free software; you can redistribute it and/or
- *             modify it under the terms of the GNU General Public License
- *             as published by the Free Software Foundation; either version
- *             2 of the License, or (at your option) any later version.
- *
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
  */
index 8d974403ac631e8e100a5fba4c989f992bd6854a..20618fa388b7ce6080f0dd54651dd1eb342361a5 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Multicast Traceroute for FRRouting
  * Copyright (C) 2018  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 18ecf6ebfa689932797a2397710e268ef8dbe0c7..cf97723dafe015bab4de4c20296477aa9877585f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Multicast Traceroute for FRRouting
  * Copyright (C) 2018  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef __linux__
index bd6d229476f6feee153e43d573b54e9dd24b0180..eb29a57e2008fbef063249a815427c20d0faa7a5 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for IPv6 FRR
  * Copyright (C) 2022  Vmware, Inc.
  *                    Mobashshera Rasool <mrasool@vmware.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d9ff2ca70b5a010461c0b6e7275f2e154d0a3bfb..201d8d6bcd343e8b47a9286fb59b26dce0da656c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for IPv6 FRR
  * Copyright (C) 2022  Vmware, Inc.
  *                    Mobashshera Rasool <mrasool@vmware.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM6_CMD_H
 #define PIM6_CMD_H
index 7ac22fd02524bcf5f9b125a43b5ae9e3c72180bb..1af4a17e5bd51bed1f4f41292ed382c3c0cc7d4d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIMv6 main()
  * Copyright (C) 2021  David Lamparter for NetDEF, Inc.
  * Copyright (C) 2008  Everton da Silva Marques (pim_main.c)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dc5e67e2c5d9a5842ea22f242c830577bf13e3bf..75d8098821457bd693399404f85c02aa5e6b1897 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIMv6 MLD querier
  * Copyright (C) 2021-2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -2737,7 +2724,7 @@ static void gm_show_joins_one(struct vty *vty, struct gm_if *gm_ifp,
                }
 
                js_src = json_object_new_object();
-               json_object_object_addf(js_group, js_src, "%pPA",
+               json_object_object_addf(js_group, js_src, "%pPAs",
                                        &sg->sgaddr.src);
 
                json_object_string_add(js_src, "state", gm_states[sg->state]);
@@ -2800,6 +2787,7 @@ static void gm_show_joins_vrf(struct vty *vty, struct vrf *vrf,
 
        if (js) {
                js_vrf = json_object_new_object();
+               json_object_string_add(js_vrf, "vrf", vrf->name);
                json_object_object_add(js, vrf->name, js_vrf);
        }
 
index 540d2e1899df118d95f44cf6fab4c244f506854b..2af1c77c24532daf899870873c2206e4929b2885 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIMv6 MLD querier
  * Copyright (C) 2021-2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM6_MLD_H
index 8e602d3396fd45f96ea0c0895646ba8e6ab56371..08d7871986f50776ed4691bc15a0a09f6e5eae8a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * MLD protocol definitions
  * Copyright (C) 2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PIM6_MLD_PROTOCOL_H
index 6ba0947c2fd06038e711ce6f27187fc65f69cd9e..91a0bb85c1fb760ed0f0d6c579103149c32275a2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM address generalizations
  * Copyright (C) 2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d15e978855560f147c6c862c58ff012fcb5b1a90..cc473d1f809bdc14977c047531537cd92c3993e3 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM address generalizations
  * Copyright (C) 2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _PIMD_PIM_ADDR_H
index 2cc98f73298b04dac3ee2dd9d41a158e429b2239..e46fa2cfacd82b7f582e850f1bc2ec9cda3af5a1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -529,7 +516,7 @@ static void on_assert_timer(struct thread *t)
        case PIM_IFASSERT_I_AM_LOSER:
                assert_action_a5(ch);
                break;
-       default: {
+       case PIM_IFASSERT_NOINFO: {
                if (PIM_DEBUG_PIM_EVENTS)
                        zlog_warn(
                                "%s: (S,G)=%s invalid assert state %d on interface %s",
index 22bab67c590ed4e3446e32e0fa47493ee9b78315..41f32ea4d6ed248db9d4cfb34e17dd8d1083b597 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_ASSERT_H
index c1f8220db6a4c5e88018262f8ad05e80c2b7a226..43d9f08997aeb8d40c5b1fd2e34f387080885399 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pim_bfd.c: PIM BFD handling routines
  *
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3bfbb7486ee078e1660ed97cb63daa1cb001e708..3d8e29a99712b2a2901d2ad15a7348b9a3cf0295 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pim_bfd.h: PIM BFD definitions and structures
  *
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef PIM_BFD_H
index 1f7dd2f3f92be2e13c46d7ae75c696eca9af98e9..c249f323df5a1fb19bd73888a91209f831e0f205 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pim_bsm.c: PIM BSM handling routines
  *
  * Copyright (C) 2018-19 Vmware, Inc.
  * Saravanan K
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 90bd2f087705b2bed9a053335849ae376d0a6066..5e40adb8060c56a689fb4ce0ea14ae3757e41b99 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * pim_bsm.h: PIM BSM handling related
  *
  * Copyright (C) 2018-19 Vmware, Inc.
  * Saravanan K
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef __PIM_BSM_H__
index d73ec2990d8bbb6f753bfa76938b672907b7c197..8c75b0a5b59def844a3eeb07a9185c7bd95e312a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8022eeea0ecfe474bac74bcf61f585b849474631..fb6693491ba5dc7acb6ee520d01c86ccbb94f986 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_CMD_H
index 9b571415fd4912094490432d7bdfefb52bc23b9e..c7b501ee149e893e1d979729d562519bf77db3c9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for IPv6 FRR
  * Copyright (C) 2022  Vmware, Inc.
  *                    Mobashshera Rasool <mrasool@vmware.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d34a4af9e1ce0fec3563be79b05e0d1c7bd8e1d3..e30203fad75b3554a8aa05d14e7da230679cef20 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for IPv6 FRR
  * Copyright (C) 2022  Vmware, Inc.
  *                    Mobashshera Rasool <mrasool@vmware.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_CMD_COMMON_H
 #define PIM_CMD_COMMON_H
index 0674a4e99477f2b3fd2cb6cd3d34481afb5886f1..1f98cec78842b9f6a325b684b1a7f33f57af62b9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d73caa3f8f71fa8baef2b27be8be6de8ba385b6e..7de35f0ad47fc9c67b44b28950c2ecbb07be00e7 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __PIM_ERRORS_H__
index 03ce8687e5f279e49182291e2a6ee6159bb6d03c..8d1924741586ea396c92248bee0684b577084b8e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 56084e06d22bc8f9299c74fbf7677df90e24a3d2..0e57c8f7acb4be0e16aac57c28fe6e16297f8d20 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_HELLO_H
index db9156b04b55d2517ee0b760b430b55e8131408d..0ba7b5a65e3b82c6c7e605bd132bdf53c0d16797 100644 (file)
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0f1600d486a553a4cda4f7844929d3222c257890..83079020b8b62006c78df61a6315a9e60badd82b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IFACE_H
index 082862709d795463bd52f6e1d2b67b8818312a97..136498beb713a5d9d5dd513da34f3cccd05275b6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0c5b6780d1bccb3b36f61249bde8d6d33c241d23..7ab491e99bd8852df21a5ce853cf99f813007655 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IFCHANNEL_H
index 308cba0697f1624e19ac14088666acae6d217998..bff0c0683ea83e088e7243c225c089e70bc900a2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9ce3a2a17fa8679444016d7cee84c04463a87475..e275b5b39849ff814a86b97fabd16fbd541be8ea 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMP_H
index 8027b8b94b721f04f3e587d5e521af42e6860377..d6d22be3e4c73565dcc11f1dfb3ec98751cd0970 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMP_JOIN_H
index 259c34c819c8535eeb770b1c113af0e22f06289d..4d3f6022a1d6418b4417c0a9b7c8e8dac740c4bf 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Multicast traceroute for FRRouting
  * Copyright (C) 2017  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* based on draft-ietf-idmr-traceroute-ipm-07 */
index 760b2e417b961d7d80b5920e23fd09e3d31a2d48..bba9c10fb08a75fb0578e219135f066902e6ad85 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Multicast traceroute for FRRouting
  * Copyright (C) 2017  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMP_MTRACE_H
index 1d511046871dec6b52f60b14c37640f1e2828d68..8ad3fb527aa7b4447010917d711b584f6a8e0274 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRRouting
  * Copyright (C) 2018  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 8c66986e0350730453b930639485d24cf4046949..a3ce486a69e2c31ae1a079f6838f39f9b1260cc6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRRouting
  * Copyright (C) 2018  Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMP_STATS_H
index 188c1bfe4cd8cd3d53e3cc95223087f5792bb3be..944dffdc338942fe2303526fde385ac3c9e49e9b 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Daniel Walton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index 4e6dc6995cd84e1ba21cab7aff9e75d7a94dc602..e968d8362f19b0ccc7df5226c1aeb1203df5bd22 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Daniel Walton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMPV2_H
index 8961c93263d12ac8e3cac8055084fc9686605a44..f10bcaf04b42e71fee25f074c86a2f698d70db7b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5041e54cb495e912b22faeda0e57ea668247d7fc..43c7df4738eac93374e7936add9cdab6f2743dfe 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_IGMPV3_H
index 4b85d45751a5207fb337a824a5eef5d5a37edc23..b50d9954f7e30a4ee387d7b2d1bdf5f39d97dee5 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRR - PIM Instance
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 57bc74efb4c1ee049a1059837ce07077cbe8bca0..fa90e38a16057b4aeabbccb6745bd6fe3193f497 100644 (file)
@@ -1,22 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRR - PIM Instance
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 #ifndef __PIM_INSTANCE_H__
 #define __PIM_INSTANCE_H__
index 377839906352669cce638ea54db6b5a304280383..6c98a8019bb7ea2c91c47916ca092405af7df15e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 54623ed218ba7297d7c94d5120c0d94a3c4df6d5..9e386726b5245c8b103c0366b80751a08b982cf9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_INT_H
index e028b6aa77a0b7c1bccb9743149289d163f686bd..20821d58b8f3ad508cb0b52349b3eb7b3ead976d 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 
 
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b359f2e5b73c50578ed8d448e1101c6e5476c758..a28d805a8d2844b6f9b8f1e4f1259f84d622e41c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_JOIN_H
index 44ebbb4dead27a7acf3372dc29cf2e2cb9b674f9..40332ed8b5eb21a5bdf2a7fbb14b2ef413b017b1 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRR - J/P Aggregation
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index ee1ca6ac70f7f1d7e6aa7b37897a1dbbe827da38..926d21157fc6b9860e1b0ab03af7412713cdd275 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for FRR - J/P Aggregation
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PIM_JP_AGG_H__
 #define __PIM_JP_AGG_H__
index e4d463b70ac4433162622202aaab785bf9c7f0b9..2690fcadb0b06498c164cf147e05f8ead8e959b4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b88a84e2d276b4543c989f2603542159f367330e..39fa5358ff0cd5d276b375652c9d3a113363f18f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_MACRO_H
index c168c0b0986abadd6a032cc1bfc8ef06e9c1b03a..ce4326c61697efa9f3017530067e042411456399 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -32,7 +19,6 @@
 #include "filter.h"
 #include "vty.h"
 #include "sigevent.h"
-#include "lib/version.h"
 #include "prefix.h"
 #include "plist.h"
 #include "vrf.h"
index 1780b60a658f0219a9342821cd753c9c7020dba0..85780f013b321f08d70c02c8e3f8c34ea36adaf5 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* pimd memory type definitions
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 385c81052eac90d6f6a94fe0edc4a57f8faf54f2..41730e752284eb961f34416d024f25ed956eda84 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* pimd memory type declarations
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_PIM_MEMORY_H
index 9763a79a8da5ba7d6dfb0d28bdb4dfd1934c980e..61cf2860fdf72ddaa229256c0bbeb8d47e289c45 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of PIM MLAG Functionality
  *
@@ -6,20 +7,6 @@
  * Author: sathesh Kumar karra <sathk@cumulusnetworks.com>
  *
  * Copyright (C) 2019 Cumulus Networks http://www.cumulusnetworks.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -871,7 +858,11 @@ int pim_zebra_mlag_handle_msg(int cmd, struct zclient *zclient,
                        pim_mlag_process_mroute_del(msg);
                }
        } break;
-       default:
+       case MLAG_MSG_NONE:
+       case MLAG_REGISTER:
+       case MLAG_DEREGISTER:
+       case MLAG_DUMP:
+       case MLAG_PIM_CFG_DUMP:
                break;
        }
        return 0;
index 0555c7d3ff38c6a55a35e053af95b51e7f0f7018..9cabd32ae8fc3cee25e607f97a999dda5b177233 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of PIM MLAG Functionality
  *
@@ -6,20 +7,6 @@
  * Author: sathesh Kumar karra <sathk@cumulusnetworks.com>
  *
  * Copyright (C) 2019 Cumulus Networks http://www.cumulusnetworks.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __PIM_MLAG_H__
 #define __PIM_MLAG_H__
index f1fd2ef73506cbbb9940a6761095aebdcc853103..af510ce29e0e0e1ef49d0f754c980e92442c279b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c409b9ed0afa755990c69f85ccec4065a4853763..8706f42206bd23d52ec88373d15d3b737ca88e34 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_MROUTE_H
index 0711a63f6324a882bf633129dfdd61ea51321daa..dfa5ffeeec64b81bbd6f7450216129f8b6e8b1e9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4e1114aff2870d064dbca5183203e84ee6760cea..f0a03f076b84d6c322a7e3cf442ded2e4bd70f99 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_MSDP_H
 #define PIM_MSDP_H
index 5230f6a332001a59ef3d11eed3c79937742e2ffc..a6f318e61e60b2f4371b23018ad17a7a5fa46c86 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP packet helper
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -281,7 +268,12 @@ void pim_msdp_write(struct thread *thread)
                case PIM_MSDP_V4_SOURCE_ACTIVE:
                        mp->sa_tx_cnt++;
                        break;
-               default:;
+               case PIM_MSDP_V4_SOURCE_ACTIVE_REQUEST:
+               case PIM_MSDP_V4_SOURCE_ACTIVE_RESPONSE:
+               case PIM_MSDP_RESERVED:
+               case PIM_MSDP_TRACEROUTE_PROGRESS:
+               case PIM_MSDP_TRACEROUTE_REPLY:
+                       break;
                }
                if (PIM_DEBUG_MSDP_PACKETS) {
                        pim_msdp_pkt_dump(mp, type, len, false /*rx*/, s);
@@ -626,8 +618,13 @@ static void pim_msdp_pkt_rx(struct pim_msdp_peer *mp)
                mp->sa_rx_cnt++;
                pim_msdp_pkt_sa_rx(mp, len);
                break;
-       default:
+       case PIM_MSDP_V4_SOURCE_ACTIVE_REQUEST:
+       case PIM_MSDP_V4_SOURCE_ACTIVE_RESPONSE:
+       case PIM_MSDP_RESERVED:
+       case PIM_MSDP_TRACEROUTE_PROGRESS:
+       case PIM_MSDP_TRACEROUTE_REPLY:
                mp->unk_rx_cnt++;
+               break;
        }
 }
 
index 00324a291379086e7b0504f87146024659958698..efb14cdf72f8fc27ed45307450ec0041eeebf061 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP packet helpers
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_MSDP_PACKET_H
 #define PIM_MSDP_PACKET_H
index 819a747122acdc9cd64e7455e76a13233dac9cd2..a6b5ee11b61ab83513ad2cb32cc3e0ed8b6f5e28 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP socket management
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8f46683dff94948c7b8bd7f54cc3c34ca1912f8d..ae31664f9ce6191c158b289f376403a6497015e2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP MSDP socket management for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_MSDP_SOCKET_H
 #define PIM_MSDP_SOCKET_H
index 7e57b405f2d2d2f72f8f463a80ba21b0b117f123..5d1f08314b17f6c57a2333a7a7b97ee01f530fc8 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 733210af3ae5ca31392dba726b63211eaf392b56..56923b7ec18ff2d55e3902fba947f1040fe03eef 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_MSG_H
index 94696bb4c76ffa38ac021f497e3a69fc553bf421..339935f81a57b4c757743aa9a3f9cf1c63669ed1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 VmWare
  *                    Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index be3cab66ce5a5ddb3ce5fb28e000af5c7d805403..0321d076f0da95f32d0d9dd65f500114eee57123 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 VmWare
  *                    Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PIM_NB_H_
index c4ff912cde99862c9c300e3cfb6aca85bd1d58b5..36e90a96970bab945d9a5c9bd69fc9e2bf3c23f6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 VmWare
  *                    Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 7726ac00b0a85047a000e5d712902d7dcc81d62b..9edc3c1af2224c1fe8eb8ecff91ab2513624fdac 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a2a2df9e04d35b56ed7ba6e3f081e24b3ce889ba..e00f99fe26c6cddd9e3bf196cc32fb562ad6d154 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_NEIGHBOR_H
index a33da645689ed36ed0b51f530f59e28aad122be4..d73f366d4384f032e069a2a5abe8b9fb8d136734 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include "network.h"
@@ -354,6 +341,9 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
                case NEXTHOP_TYPE_IPV4_IFINDEX:
                        nhaddr = nh->gate.ipv4;
                        break;
+               case NEXTHOP_TYPE_IPV6:
+               case NEXTHOP_TYPE_IPV6_IFINDEX:
+                       continue;
 #else
                case NEXTHOP_TYPE_IPV6:
                        if (nh->ifindex == IFINDEX_INTERNAL)
@@ -363,12 +353,15 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,
                case NEXTHOP_TYPE_IPV6_IFINDEX:
                        nhaddr = nh->gate.ipv6;
                        break;
+               case NEXTHOP_TYPE_IPV4:
+               case NEXTHOP_TYPE_IPV4_IFINDEX:
+                       continue;
 #endif
                case NEXTHOP_TYPE_IFINDEX:
                        nhaddr = bsr_addr;
                        break;
 
-               default:
+               case NEXTHOP_TYPE_BLACKHOLE:
                        continue;
                }
 
index f487a21ba4c9683c28271b7eb831ff1a9fda1815..5a54e1c67ad395f8f0f6d2712c7025e4e967ab0c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2017 Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_NHT_H
 #define PIM_NHT_H
index dff1b4fed4c36292277cebb6d68682e5d1211116..63ddb85d001bc0682311368bcfa1bac4bb5abf69 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5a2647b93f33e19234e32adcfe78152b74dc5003..45b337cc720fa075589f5644ece7283d88bdd51a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_OIL_H
index 1dd99d7ecdc4942b90687a16777ff41bc4661754..a7a8b0575392ce5736767a919a09f95068d48fa4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index e2555eab8c216fd2453a22026f106fef4f5dc076..35e693013ac11dcc01b27479a404460518115682 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_PIM_H
index b62c646c3d45e05da6c8799a154157d312dd3ff2..5144fe67b8e6e7fcedf51e9f6f6b78b2b0d24d48 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2015 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ddb34921ae06c99cc5913864577ec8ed63ed7bb5..d1240d7b9a956610c13d01c4d2514ae85e0f8a20 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2015 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_REGISTER_H
 #define PIM_REGISTER_H
index 2de94e9031ebd4f783b4caff129bd955d1d2e217..bd1a24eed50d9c5860266a5835a26b2a3d255398 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PIM Route-map Code
  * Copyright (C) 2016 Cumulus Networks <sharpd@cumulusnetworks.com>
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index c3e6a303fcb75057b3561edc3c16e1e425bf68b1..d59124cebde8cfb4b03f60df512c315170b13031 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2015 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index e1bc71a3dc385ed69fbfd6f7405369a449c0feff..9416a9a8a87e76824b8a514640182630d2a51fa2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2015 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_RP_H
 #define PIM_RP_H
index d237a73126308a8724c04d693ef606f7850d41e0..06765d93df37c4b6aa67ed09f2cd6919feaa69fd 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2ddb9832f602cc70a9555fbb9b1a68eb369bdd30..7dae53f8fc810b8773e5ceb553f2932ab79af472 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_RPF_H
index 47220ccac70f3a2b81179d57365719a1fc729849..146a4e9e98875458820c8023580758d826b5a3df 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ebc5b8eb21ace95a6e6e26bdc42b0a6cbbd728ba..a3ee604cd76509969ba63ca88f26c8b2ab2d7820 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_SIGNALS_H
index 4b91bf07d9a78745a0c49e52cc7e8bbf281b8b4c..6c65c5d3e967ae4f9b04d265d5498d18e4c585b5 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4dcb9e6466cdf687e5f794ac2b1de4f9df486cb4..04ab8647441321a9876729742a9ed7e738c37edb 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_SOCK_H
index 62246cc239e8639bc39f661ff7138d1dd8f0c256..7b7503aeba0509a29746ed5fd5577e8342dde00a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP SSM ranges for FRR
  * Copyright (C) 2017 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index adc0cfdea09143c0445e2c67dcaf162648d986e8..24a037e09bc7f892ae712edbf1c466cb69f00a7a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IP SSM ranges for FRR
  * Copyright (C) 2017 Cumulus Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef PIM_SSM_H
 #define PIM_SSM_H
index c8d40371e77d6ad0e8f71d8be662caf395e7bfa6..2fc30b4915355adbe56c6057eb14613d053777f9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c4376bd0e4c6ca947bac0af68a445cb3b0cb7bfb..fe15839793338fd3175aeea9406babfae9b0ea22 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_SSMPINGD_H
index f5449d28242094d2ba955b813bb206feb2318e66..f4320f0c62a9a1e340afc775d21cc626f210e934 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga: add the ability to configure multicast static routes
  * Copyright (C) 2014  Nathan Bahr, ATCorp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dcbc790d7aeb13de789060ce83c78f20f3b0d2b4..c868d02870acaa1f2ff971be47ca534b02211f6b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga: add the ability to configure multicast static routes
  * Copyright (C) 2014  Nathan Bahr, ATCorp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_STATIC_H_
index 8744d62d145beeb830d6068a9ef68035dedb1b27..a0453769e920b90c23e1fefc890ddb268140b36d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 44817760977c81d1740c68be831ff8df73c29081..cc27d23c0e6eb356965af1480e21c436b1275cc6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_STR_H
index 3455e30064d4b32e0d88a15867897c38a6f5412e..6ffea868d80490c76a1a8f24ebc13e19e17776f1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * TIB (Tree Information Base) - just PIM <> IGMP/MLD glue for now
  * Copyright (C) 2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b320f4cde0aa9b85f1e9853cbe21c7ebef94e898..081ad908b5c0285804fca9dc6ad725cdb0b4b85d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * TIB (Tree Information Base) - just PIM <> IGMP/MLD glue for now
  * Copyright (C) 2022  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_PIM_GLUE_H
index 93aaffb6a4d084d4619a58051ccbc65581fc241c..c9555f5310cd361bd606b4e27bf7cae996633d1e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5d02d6efc4c96a9dbc8468a17306c542636db9e1..fd1e79e2bbd21b77bfd7605f865c4f16f9d7a64f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_TIME_H
index c9caf0016ee7aaf77ba82be6a9750b4f3c530039..80d60b862833f3f45319400ccda79dc00d7f6507 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 63bd2c41f69f5e31b6083408141f89e902e859c2..ea2af6457dde5de7aa5a8b750ed7d9582ade78e3 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_TLV_H
index 4ef0bfaa489feebf8b9f50e6ddadd971ed84626f..d63d530f93966d799e49876a8e9c7c78cb2c80cc 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3841d1af7b7b227b0f1d975dda82b609bd7e6bab..890ba7d169bf816b95ae5f481dde57c29d42eff6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_UPSTREAM_H
index 273c332c95c1f22efd442c40477761eb0f951c74..948b615f71a3d6184d637dfdac28d14ae277269c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6af79ddf6c77313235721f7215b0195e2fbe6ae4..c882fe4878a343fd2c857cb96a02620df94c78c7 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_UTIL_H
index 553c1314d2659e4b188843bbf961d90420921081..91628930f4f64be17375bf5fef7526a22467549e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0f11d6ec4ab86b8ef1fcbc5227b02b910332d6f0..84155af19e391ba5954d99fc684e534bfc26a719 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_VTY_H
index 5b63d0493694ef738eecc925d09122c2170f44f8..4c317a25464aedd082667e6dbe26f87764508bf2 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PIM support for VxLAN BUM flooding
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include <zebra.h>
index 1a7e9dcf1bd48eda54360f840d772d126ffe53a8..6e1e066f07bc5c2a296d1591d904ab9e4e0d006e 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PIM support for VxLAN BUM flooding
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef PIM_VXLAN_H
index 5b35bcbeaa51cd627413eecd7fe078424e073f69..65a5955851f632a2cabc63ecb32d3c72e9734c16 100644 (file)
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* PIM support for VxLAN BUM flooding
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
  */
 
 #ifndef PIM_VXLAN_INSTANCE_H
index 2c76fd6868f0ae0285368187dfb9569e0cc998bf..e39eca7a2ccf464e6903c21d2df3984c5bf26e30 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6710f19995f2a9b8dfe80d2553d458aa06142222..0ef63f237f41f421dcc7585584fc8cf8c014eda4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_ZEBRA_H
index 0481c3a769d790170a361c9c648b8e53754e952b..08807d0dcc993e8788acfb625bb113668a3bf7e8 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -263,6 +250,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
                                &nh_ip4, nh_ifi, &addr);
 #endif
                        break;
+               case NEXTHOP_TYPE_IPV6:
                case NEXTHOP_TYPE_IPV6_IFINDEX:
                        stream_get(&nh_ip6, s, sizeof(nh_ip6));
                        nh_ifi = stream_getl(s);
@@ -307,7 +295,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
                        ++num_ifindex;
 #endif
                        break;
-               default:
+               case NEXTHOP_TYPE_BLACKHOLE:
                        /* do nothing */
                        zlog_warn(
                                "%s: found non-ifindex nexthop type=%d for address %pPAs(%s)",
index 85d18d1d68c1b7c461a04db9f1bb02b35604cb12..ee2dd20113a0ecc2f0e560bb6bb09baf5ea60ac4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_ZLOOKUP_H
index e6fb3b3a17274ea2d027cd061c481d4a9081806b..bc515f27ed06b468899cbb595ac5d67987777ca2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -35,12 +22,9 @@ int32_t mlag_bulk_cnt;
 static void pim_mlag_zebra_fill_header(enum mlag_msg_type msg_type)
 {
        uint32_t fill_msg_type = msg_type;
-       uint16_t data_len;
+       uint16_t data_len = 0;
        uint16_t msg_cnt = 1;
 
-       if (msg_type == MLAG_MSG_NONE)
-               return;
-
        switch (msg_type) {
        case MLAG_REGISTER:
        case MLAG_DEREGISTER:
@@ -54,7 +38,15 @@ static void pim_mlag_zebra_fill_header(enum mlag_msg_type msg_type)
                data_len = sizeof(struct mlag_mroute_del);
                fill_msg_type = MLAG_MROUTE_DEL_BULK;
                break;
-       default:
+       case MLAG_MSG_NONE:
+               return;
+       case MLAG_STATUS_UPDATE:
+       case MLAG_DUMP:
+       case MLAG_MROUTE_ADD_BULK:
+       case MLAG_MROUTE_DEL_BULK:
+       case MLAG_PIM_CFG_DUMP:
+       case MLAG_VXLAN_UPDATE:
+       case MLAG_PEER_FRR_STATUS:
                data_len = 0;
                break;
        }
index a3be3f66e104e067c76b348a443210a0cba85a92..db619748000ee3ddb95f2bff2402e859ae87ec77 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3a80c24f7c75daf82c946be312465350f03d5548..9ec84fc0a685dddedb7d4ac4c57f9dc0b3913328 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIMD_H
index 3c26517e8880db35251d2566971566891fc08cf0..07070900d2fe8db93d6608fcf33bf41ede5b3f8d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 7d9825bd10866add7b84de582bf0ef1b3e6825d2..4e58b1938b3e5810eaaaea56496674c9da75b9fa 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # callgraph json to graphviz generator for FRR
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import re
 import sys
index 101c9a5ae376d0aea64c3ad196f7e19ff1de417e..244a8205bf2d407123b2c292b8421118f126ff8b 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR CLI preprocessor (DEFPY)
 #
 # Copyright (C) 2017  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import clippy, traceback, sys, os
 from collections import OrderedDict
@@ -64,6 +51,12 @@ _fail = (_end == argv[_i]->arg) || (*_end != '\\0');"""
     )
 
 
+class AsDotHandler(RenderHandler):
+    argtype = "as_t"
+    decl = Template("as_t $varname = 0;")
+    code = Template("_fail = !asn_str2asn(argv[_i]->arg, &$varname);")
+
+
 # A.B.C.D/M (prefix_ipv4) and
 # X:X::X:X/M (prefix_ipv6) are "compatible" and can merge into a
 # struct prefix:
@@ -165,6 +158,7 @@ handlers = {
     "IPV6_PREFIX_TKN": Prefix6Handler,
     "MAC_TKN": PrefixEthHandler,
     "MAC_PREFIX_TKN": PrefixEthHandler,
+    "ASNUM_TKN": AsDotHandler,
 }
 
 # core template invoked for each occurence of DEFPY.
index 7c73598e5d5f285966c2647b6f1620d12b48040d..60119fbac097117ac3221866b0446940ed79eac0 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR CLI preprocessor
 #
 # Copyright (C) 2017  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import os, stat
 
index d4d1f4cb8be7762878431fcbf520ec36ff500493..cc442eeda9aa0a64b1c00195cc96319e1e48d8a5 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR libelf wrapper
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 """
 Wrapping layer and additional utility around _clippy.ELFFile.
index 0fd886221a6061885e0992e1020d1b3286f4785b..73570b20d999f650b3756d6e9649a00a7c4ce377 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # xref unique ID hash calculation
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import struct
 from hashlib import sha256
index 892e9da8d650ffb7b3d97fdf17162e044686f5a7..06e28958452e32aa547ca9f31947bc7e86522482 100644 (file)
@@ -1,21 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # check that the first header included in C files is either
 # zebra.h or config.h
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import sys
 import os
index 3379959dc134d60bd25d74ddb4f8e76cb1c307a2..c851bb042874b9f62100ecd7eb801fa1904dd0b7 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # some basic tests for xrelfo & the python ELF machinery
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import sys
 import os
index b19c756738eec80b0fb304491fea1967d0ebb467..da20801ca12ef3245e929955b0bce5d470970c2a 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR DWARF structure definition extractor
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import sys
 import os
index f18aa20c923e84f687d76539aadfc1d3a5149bf8..a4f8560bb07fb7a94d250dadf652ebb6c223acbc 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR xref vtysh command extraction
 #
 # Copyright (C) 2022  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 """
 Generate vtysh_cmd.c from frr .xref file(s).
index c75b4cb9561092519bd3f0b6c29aae000ad6c994..4c956ca6ac6735646f15f5e0144498b5d23b5f5f 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # FRR ELF xref extractor
 #
 # Copyright (C) 2020  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import sys
 import os
index 40393a9a96844b63afa745ba1b8612fb02de43c8..352d3ea50e5d9f2337cf3be9060520672c2c1cd1 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * linear_allocator.h
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 8e130f5f5b3ca9306703ea33c56f42d377c1f665..63454f115666dd432d452cb91b5daf3fe35ba5fe 100644 (file)
--- a/qpb/qpb.c
+++ b/qpb/qpb.c
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * qpb.c
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 45690fb4acb5bc8dcf9cbf309e4010d5a8283835..d52528f41b83e31769be011ff307253af8a7981d 100644 (file)
--- a/qpb/qpb.h
+++ b/qpb/qpb.h
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * qpb.h
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -77,7 +62,7 @@ static inline int qpb__address_family__get(Qpb__AddressFamily pb_family,
 
        case QPB__ADDRESS_FAMILY__UNKNOWN_AF:
                return 0;
-       default: /* protobuf "magic value" _QPB__ADDRESS_FAMILY_IS_INT_SIZE */
+       case _QPB__ADDRESS_FAMILY_IS_INT_SIZE:
                return 0;
        }
 
index c06debb954d08c9cde9daa622498dbf826eecc47..b09536832c1069e00508ac12251a0be99bc00f6b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*
  * qpb.proto
  *
index aca611ba1952cef41179e371eccbfff443045bda..e2749d6c8ae11022e7d3e584798628cd3e455e7a 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * qpb_allocator.c
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index fd55592f88976396568325a8849fc1590094b2d4..ff0e466dc68bace3fbec3842e04b13de2dfb7eb4 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * qpb_allocator.h
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index a3f5f6b0cdb10dc72339dc1fb3fb2723e2cd1862..14973ba890e48e94487c03bb88f8a50b49173e2d 100644 (file)
@@ -793,7 +793,9 @@ sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons
 
 %changelog
 
-* Tue Nov 01 2022 Martin Winter <mwinter@opensourcerouting.org> - %{version}
+* Tue Feb 07 2023 Martin Winter <mwinter@opensourcerouting.org> - %{version}
+
+* Tue Feb 07 2023 Donatas Abraitis <donatas@opensourcerouting.org> - 8.5
 
 * Tue Nov 01 2022 Jafar Al-Gharaibeh <jafar@atcorp.com> - 8.4
 - New BGP command (neighbor PEER soo) to configure SoO to prevent routing loops and suboptimal routing on dual-homed sites.
index 34ea2167264c95e4a78f09ec722b7a87f2d72c56..cac29c00d458e80cd9fb41b165156a8c37bda650 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index ded62812a756764ab8253d877dd357d987ab9d6a..e91d79196b0ed577c997669a405910624ddb3cd6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP debug routines
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3d819ccd0ba325ae5fa0d458f2df026e5def3f64..ca9188f2a82d2fcb3eee72fdf5d3b009ce65cf8f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP debug routines
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIP_DEBUG_H
index b6fc43ee7c805c4d774b1c01655dc7c86e534789..483ea77af158d265b499983600aa3d2fd8bd5d11 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index feadf430efa4ced9a641b9b9e838ea2bd3e2d059..93b44749ebaf21a4c42e5c2e456fe4ad831e5295 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIP-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __RIP_ERRORS_H__
index 02da56e4f3ba454d7fd5554f39a893858c5c41d3..3e62321725d0b760ffd5e96d369ccb5ece10b590 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Interface related function for RIP.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fe26a78bdc047848d3fa55d92ee1ede6cff8c5f4..eee654b49714147101bb9b530d703ea3436cf6c9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP interface routines
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_RIP_INTERFACE_H
index 6fb5ca95a918c2019deac9d8d19ad523ad37a8a3..e26424adeb63b0c275ebeb7339f569af9432e5f2 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPd main routine.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4716041ad621c5a954e6e6e7c50b8c679892ffe5..9947c01af56b2b060544b446223e00ff11f5b8e1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1e29f3b77132cd7fae6596acb0b6b7ac21015206..99114c99288ad6ceb7445e2c3e3fa8cb5c3d52ff 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_RIP_NB_H_
index 5b1917e17af5e59d94310ba252e57af6c10cdcbf..2277ddc2045755c55a8e6cc2f663e6c51db091ca 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 28d3517dfd16e7a4900253111699db23f58de755..80da39b5f01c9d0dc7dff0b4a60bd2a4845cedcf 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 25641f2f798e984bb402ead73cfede39035a1cb4..be55284819308314ce7e4f27345476cb2cb17d02 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 184c7609984d26456ecb034c7a3920b47719352e..0e2931b464ff9a025a451e61ebfdcdde5cc99b1e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -236,9 +223,14 @@ struct yang_data *ripd_instance_state_routes_route_next_hop_get_elem(
        case NEXTHOP_TYPE_IPV4:
        case NEXTHOP_TYPE_IPV4_IFINDEX:
                return yang_data_new_ipv4(args->xpath, &rinfo->nh.gate.ipv4);
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return NULL;
        }
+
+       assert(!"Reached end of function where we do not expect to reach");
 }
 
 /*
@@ -257,9 +249,14 @@ struct yang_data *ripd_instance_state_routes_route_interface_get_elem(
                return yang_data_new_string(
                        args->xpath,
                        ifindex2ifname(rinfo->nh.ifindex, rip->vrf->vrf_id));
-       default:
+       case NEXTHOP_TYPE_IPV4:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return NULL;
        }
+
+       assert(!"Reached end of function where we do not expect to reach");
 }
 
 /*
index d49922934096aa01499122561c416ca0ce997bbb..4c93f712f7d36b8253cc5e3ef8898e82c8262076 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP offset-list
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a52914bcf9f908cb0913c8ba6c8d78ad3c555f92..a3cba598d2fffc7a79519ca06122013a00c21aef 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP peer support
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4da5f945fe760b5263365975127a39851f83bbe2..2ae8857e3f12697e818feb86911d3a0728b11201 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPv2 routemap.
  * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0ce3804069ee009c6242884675f1b08d8ad3d3bb..ab80dd1b8a2d98694b4c3fc45a497d27f0db1fcf 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP SNMP support
  * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1f15668635ae5d61aa658ec412d7ee354e998d3f..4a58d1225e99e6439513ad7b2c757ae8fcdc40fc 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPd and zebra interface.
  * Copyright (C) 1997, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8e02f1a6c18589a7d9387770de6c0d52cfcffcb0..bde7e858f1255f9de42957959d56fbd08d7da62e 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP version 1 and 2.
  * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d26592dac24de1f13f212a772d61829287e4fa9b..4894cb863269430e2829c6e684a25545cbd8a972 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP related values and structures.
  * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIP_H
index 049a392ddbe686b0cb7ad608bc5a35c00cd6e786..5e59dfd2c409eba23c8b3ac0afbe4de4282e18cd 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1998 Kunihiro Ishiguro
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d36327cb7680f567dc01248606677019445ece58..5ddd7acf3b9be3c407930159e9f4c9042740fedf 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPng debug output routines
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 81cb0f9c7ef78124d6d10216fa67b05901e38937..7af9206617801fde9d15372cb688acad1249d90f 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPng debug output routines
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIPNG_DEBUG_H
index 3068d04b739c99606291c61c51b8a600acc7554a..1fc6f2553e358cd26da13df3add9ea47b3c53870 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface related function for RIPng.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index bc169785a923e2ea568d232a9fe1ff848f0e6546..14e69834ca0ef78a0cc40f5bd93c3178363773eb 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPngd main routine.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a02a72112f9cc3d288dc45f9534b7284da842f8e..63144d866b26bb1eefcf78e5e7761662917860b4 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cf042424808af3264dee13aa751ce0621f55ad41..675cef7c92b2dcad6932949242c71d24c672fe4e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_RIPNG_NB_H_
index 25bf65f7aa0f11017b86c0b2f79daa27309649ad..006bf79ce8d56cb87d8e9a77e30f6f3a13b721a2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1998 Kunihiro Ishiguro
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 57a5f266884f78888310417e6d7a2ebff99c1de5..381ff717c1c696cd893815917350c812b61db75c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 02a00ac429b9842e6fc012052ebd6b35b23eef9c..3f37df305edd0cdf423ed0857990812e489ac552 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 50972feffc9d5157ef69f22053df9a85de8b6a35..38e7ce2519f0ecf6df2b3da4aa7591aced3ad712 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPngd Zebra
  * Copyright (C) 2002 6WIND <vincent.jardin@6wind.com>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This file is required in order to support properly the RIPng nexthop
index 92ab7e0cdb7c62a372284659bb3ce3c98a9f0d74..2d2993958fd5621197ebbd8bf891ad628d4458f6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng nexthop support
  * Copyright (C) 6WIND Vincent Jardin <vincent.jardin@6wind.com>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIPNG_RIPNG_NEXTHOP_H
index 38c69f1b750b8a6622d2e27dd65c79acaeeaa48f..ba3ba558afda91a986556b63b4005c574b1c3bd6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng offset-list
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* RIPng support by Vincent Jardin <vincent.jardin@6wind.com>
index 37cfe9833fb722d9e274e197ab1526dbc46aedb4..75a9ed77fee1be7e774d3807b8a11f80f909ce94 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng peer support
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* RIPng support added by Vincent Jardin <vincent.jardin@6wind.com>
index 1eb1d0f31d52c4f72814b5ef383230c53a8b27b0..80041fbebed8ce6edcf402304867c5559e72f9b9 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPng routes function.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index afc1d1cbc533714be9e4d52816b34a0ba430b9c7..fb3d71ca68202f83d2c259e82769835ac9d43485 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPng daemon
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIPNG_ROUTE_H
index 4f2f9e2101c5baa2f6139218680f229ee3eb52c4..3e6880b4df6fc20eb1e32885f625ba3928b3163f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng routemap.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4108aa506e206b06a2f510f2c215b864263345a2..b126a15b5bf177abfc3181c743237d09bf758b87 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPngd and zebra interface.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 755debd0a4ec7a0a00e0366b9732bd56a45ff876..f01371f41ebb4a5b6df82600436b79abc6098bd8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng daemon
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1933,7 +1918,8 @@ void ripng_event(struct ripng *ripng, enum ripng_event event, int sock)
                        thread_add_event(master, ripng_triggered_update, ripng,
                                         0, &ripng->t_triggered_update);
                break;
-       default:
+       case RIPNG_ZEBRA:
+       case RIPNG_REQUEST_EVENT:
                break;
        }
 }
index ac2edc5b2c81879b91d21cf405def69a1a5a4740..59b948b8f1f63f70b47709aa20dbdc014f486ea1 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPng related value and structure.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIPNG_RIPNGD_H
index 46096f4aa7fd8cce2c18f322de9ccf86d0875970..76b043b2615c15fbd508cd932bb14445331110a4 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SHARP - code to track globals
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __SHARP_GLOBAL_H__
 #define __SHARP_GLOBAL_H__
index ad1051f2246e1e7773ca1ef4af7769880964e70c..cadd818953b3c2b35d22daf75a75e50f165bf05c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * testing log message generator
  * Copyright (C) 2019-2020  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d7783b6fc783cb09dddde6f05a6ce326a0d603f3..9d33fc89a7e081ed64870e863263da0dd05447b7 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SHARP - main code
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index b032da6a1d0cb479b2abab5a69f234e843ff8242..fa7880572d9df308d1fadb1b90fb01408ab9cd5f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SHARP - code to track nexthops
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index da33502878363933a358b188962b9a845455c9da..5523f28079758831747bb7b660a980659aa8e78d 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SHARP - code to track nexthops
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __SHARP_NHT_H__
 #define __SHARP_NHT_H__
index 0cedd2bafc2ade4b77b43e496ddcbb601c9c9536..77b562d6a61ef69023152b8e865e2ef54ad8737e 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SHARP - vty code
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 0d1327259c6511ce122e85ae7edbbfe443c98dcd..460e4f5186a1ced7b563ca21bf07d51441c10d70 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VTY library for SHARP
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __SHARP_VTY_H__
 #define __SHARP_VTY_H__
index bf5b98544ee210586f277a76405efeb9ae7326ea..df06f5537e780e8b5f87c530c3e92220a6069e09 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect code.
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -271,6 +256,11 @@ static bool route_add(const struct prefix *p, vrf_id_t vrf_id, uint8_t instance,
                api.nhgid = nhgid;
        } else {
                for (ALL_NEXTHOPS_PTR(nhg, nh)) {
+                       /* Check if we set a VNI label */
+                       if (nh->nh_label &&
+                           (nh->nh_label_type == ZEBRA_LSP_EVPN))
+                               SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
+
                        api_nh = &api.nexthops[i];
 
                        zapi_nexthop_from_nexthop(api_nh, nh);
index 8de14ce5afe288f5d23e69248ec1017cf50dc56d..cf8689799aa518b125f15330b853e768682f923a 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for SHARP
  * Copyright (C) Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __SHARP_ZEBRA_H__
 #define __SHARP_ZEBRA_H__
index fc8b518e11df941e37b66b93b70f1ab09e37865a..ccf7d206f2a57c09607bc60ab9660829cf4b2f76 100644 (file)
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Static daemon BFD integration.
  *
  * Copyright (C) 2020-2022 Network Device Education Foundation, Inc. ("NetDEF")
  *                         Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
  */
 
 #include <zebra.h>
index 847e7d61a4a9319e2e6c4b90e72bee287f3f0d46..a65752c9584f4d1d52fa7874cfe89d92d1b38f6c 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Staticd debug related functions
  * Copyright (C) 2019 Volta Networks Inc.
  * Mark Stapp
- *
- * This file is part of FRRouting (FRR).
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 129c09668819f0c9b1437cd7ecb8aa48abae0ac0..c9100680f7144009babdca0b4a2630cd5f0626d2 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Staticd debug related functions
  * Copyright (C) 2019 Volta Networks Inc.
  * Mark Stapp
- *
- * This file is part of FRRouting (FRR).
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _STATIC_DEBUG_H
index 79686158cf75775d7dfbe2e988930381cbfa4965..bc501b3d6947c38888b6eee1d39c160896a25742 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - main code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 68d9ba97b46cd94384d2c8c37f5b085542828cb9..d8b5b167cf226b3cf47efbbd6b55f41f3413aa66 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Vmware
  *                           Vishal Dhingra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 96c9f8d9b7098ea6404f0ad1b1d1c477b4abc970..ce3644076c01f8fdedcb5de832873b2b31216e7f 100644 (file)
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Vmware
  *                           Vishal Dhingra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _FRR_STATIC_NB_H_
 #define _FRR_STATIC_NB_H_
index cbb5b8234fc27ed01972f6b8dc7c38d215301512..01cd281d9c6b07c6746c9bc0efc39954ebddedac 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018        Vmware
  *                           Vishal Dhingra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 1d87a83c9169240dc6f124e5cf1acb08be6647d3..ebc5ea16ccc0d98e0333017fc890ce22babf528e 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Static NHT code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index c29acc32ef421d14cdfc19027ac515354ef0cf5d..74f4401e49ebba23c313627bafaa40955a72c33b 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Static NHT header.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __STATIC_NHT_H__
 #define __STATIC_NHT_H__
index ccbb98bd117c32ac2e1504882de7357335b73055..3399686a90d05d3d01b021158bb2c4cd148180a5 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - route code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -209,7 +196,8 @@ bool static_add_nexthop_validate(const char *nh_vrf_name,
                                        vrf->vrf_id))
                        return false;
                break;
-       default:
+       case STATIC_IFNAME:
+       case STATIC_BLACKHOLE:
                break;
        }
 
@@ -302,7 +290,8 @@ struct static_nexthop *static_add_nexthop(struct static_path *pn,
        case STATIC_IPV6_GATEWAY_IFNAME:
                nh->addr.ipv6 = ipaddr->ipaddr_v6;
                break;
-       default:
+       case STATIC_IFNAME:
+       case STATIC_BLACKHOLE:
                break;
        }
        /*
index 2332cfd2bf819fb3209ab7cf0967d29ab3e30960..eb7953db2cfb79dab27c097b0cc2b541a7eaa4f9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - static routes header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __STATIC_ROUTES_H__
 #define __STATIC_ROUTES_H__
index 37cd199c4f8772d1b7735d90890d74f820669e3a..a67dce200fcf63e1df6755d89219f36dc46b0397 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - vrf code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 885246bfaadf09bc646d4610e2fb3e33ab902b58..8f55775d3eec43b72163f0c47ea99161cd28e8f6 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - vrf header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __STATIC_VRF_H__
 #define __STATIC_VRF_H__
index c5bea755ec19c1437c52ea297e2a64d88f57d1ad..d87ca16c6198de10e8b1bb669b71a048dfaa90fd 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - vty code
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -135,7 +122,9 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)
                if (args->source)
                        assert(!!str2prefix(args->source, &src));
                break;
-       default:
+       case AFI_L2VPN:
+       case AFI_UNSPEC:
+       case AFI_MAX:
                break;
        }
 
index 84a359593f344d6318f3eff71870d92590c89e1e..77e52b5bdf8621395167dcffeaa6e2fed8e67817 100644 (file)
@@ -1,20 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * STATICd - vty header
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __STATIC_VTY_H__
 #define __STATIC_VTY_H__
index 85e4b1c033fa468ec0c2a4a95b78c0cc9400954b..f220b476fbbddbfae03a824813a03e48da188655 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 1cf13dcbbb32747ba3fba960fc51d6cf0f4aba4e..5f21d6c3868e5b5fa4b1ef7afc9a8f8eb2092b41 100644 (file)
@@ -1,20 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for staticd
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
  */
 #ifndef __STATIC_ZEBRA_H__
 #define __STATIC_ZEBRA_H__
index ef1fcf5cec1bd9c4a69ca4a5f73b7dfef002a8ab..926097f5711e969e3d8192a065c2ca1da0c4f39a 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2005 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -70,6 +55,7 @@ static struct test_segment {
        const uint8_t asdata[1024];
        int len;
        struct test_spec sp;
+       enum asnotation_mode asnotation;
 } test_segments[] = {
        {
                /* 0 */
@@ -79,6 +65,7 @@ static struct test_segment {
                10,
                {"8466 3 52737 4096", "8466 3 52737 4096", 4, 0,
                 NOT_ALL_PRIVATE, 4096, 4, 8466},
+               0,
        },
        {
                /* 1 */
@@ -87,8 +74,16 @@ static struct test_segment {
                {0x2, 0x1, 0x22, 0x12, 0x2, 0x1, 0x00, 0x04},
                8,
                {
-                       "8722 4", "8722 4", 2, 0, NOT_ALL_PRIVATE, 4, 5, 8722,
+                       "8722 4",
+                       "8722 4",
+                       2,
+                       0,
+                       NOT_ALL_PRIVATE,
+                       4,
+                       5,
+                       8722,
                },
+               0,
        },
        {
                /* 2 */
@@ -99,6 +94,7 @@ static struct test_segment {
                14,
                {"8466 3 52737 4096 8722 4", "8466 3 52737 4096 8722 4", 6, 0,
                 NOT_ALL_PRIVATE, 3, 5, 8466},
+               0,
        },
        {
                /* 3 */
@@ -108,6 +104,7 @@ static struct test_segment {
                10,
                {"8482 51457 {5204}", "8482 51457 {5204}", 3, 0,
                 NOT_ALL_PRIVATE, 5204, 51456, 8482},
+               0,
        },
        {
                /* 4 */
@@ -119,6 +116,7 @@ static struct test_segment {
                {"8467 59649 {4196,48658} {17322,30745}",
                 "8467 59649 {4196,48658} {17322,30745}", 4, 0, NOT_ALL_PRIVATE,
                 48658, 1, 8467},
+               0,
        },
        {
                /* 5 */
@@ -131,6 +129,7 @@ static struct test_segment {
                {"6435 59408 21665 {2457,4369,61697} 1842 41590 51793",
                 "6435 59408 21665 {2457,4369,61697} 1842 41590 51793", 7, 0,
                 NOT_ALL_PRIVATE, 51793, 1, 6435},
+               0,
        },
        {
                /* 6 */
@@ -139,6 +138,7 @@ static struct test_segment {
                {0x3, 0x3, 0x00, 0x7b, 0x01, 0xc8, 0x03, 0x15},
                8,
                {"(123 456 789)", "", 0, 3, NOT_ALL_PRIVATE, 789, 1, NULL_ASN},
+               0,
        },
        {
                /* 7 */
@@ -149,6 +149,7 @@ static struct test_segment {
                14,
                {"(123 456 789) (111 222)", "", 0, 5, NOT_ALL_PRIVATE, 111, 1,
                 NULL_ASN},
+               0,
        },
        {
                /* 8 */
@@ -157,6 +158,7 @@ static struct test_segment {
                {0x4, 0x3, 0x01, 0xc8, 0x00, 0x7b, 0x03, 0x15},
                8,
                {"[123,456,789]", "", 0, 1, NOT_ALL_PRIVATE, 123, 1, NULL_ASN},
+               0,
        },
        {
                /* 9 */
@@ -168,6 +170,7 @@ static struct test_segment {
                24,
                {"(123 456 789) [111,222] 8722 {4196,48658}",
                 "8722 {4196,48658}", 2, 4, NOT_ALL_PRIVATE, 123, 1, NULL_ASN},
+               0,
        },
        {
                /* 10 */
@@ -178,6 +181,7 @@ static struct test_segment {
                14,
                {"8466 2 52737 4096 8722 4", "8466 2 52737 4096 8722 4", 6, 0,
                 NOT_ALL_PRIVATE, 4096, 1, 8466},
+               0,
        },
        {
                /* 11 */
@@ -189,6 +193,7 @@ static struct test_segment {
                {"8466 2 52737 4096 8722 4 8722",
                 "8466 2 52737 4096 8722 4 8722", 7, 0, NOT_ALL_PRIVATE, 4096,
                 1, 8466},
+               0,
        },
        {
                /* 12 */
@@ -198,6 +203,7 @@ static struct test_segment {
                10,
                {"8466 64512 52737 65535", "8466 64512 52737 65535", 4, 0,
                 NOT_ALL_PRIVATE, 65535, 4, 8466},
+               0,
        },
        {
                /* 13 */
@@ -207,6 +213,7 @@ static struct test_segment {
                10,
                {"65534 64512 64513 65535", "65534 64512 64513 65535", 4, 0,
                 ALL_PRIVATE, 65534, 4, 65534},
+               0,
        },
        {
                /* 14 */
@@ -275,6 +282,7 @@ static struct test_segment {
 
                 "8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285 8466 3 52737 4096 34285",
                 250, 0, NOT_ALL_PRIVATE, 4096, 4, 8466},
+               0,
        },
        {
                /* 15 */
@@ -285,6 +293,7 @@ static struct test_segment {
                12,
                {"8466 3 52737 4096 3456", "8466 3 52737 4096 3456", 5, 0,
                 NOT_ALL_PRIVATE, 4096, 4, 8466},
+               0,
        },
        {
                /* 16 */
@@ -293,6 +302,7 @@ static struct test_segment {
                {},
                0,
                {"", "", 0, 0, 0, 0, 0, 0},
+               0,
        },
        {
                /* 17 */
@@ -308,6 +318,7 @@ static struct test_segment {
                 "8466 3 52737 4096 3456 {7099,8153}",
                 "8466 3 52737 4096 3456 {7099,8153}", 6, 0, NOT_ALL_PRIVATE,
                 4096, 4, 8466},
+               0,
        },
        {
                /* 18 */
@@ -320,6 +331,7 @@ static struct test_segment {
                {"6435 59408 21665 {23456} 23456 23456 23456",
                 "6435 59408 21665 {23456} 23456 23456 23456", 7, 0,
                 NOT_ALL_PRIVATE, 23456, 1, 6435},
+               0,
        },
        {
                /* 19 */
@@ -331,6 +343,7 @@ static struct test_segment {
                {"{2457,4369,61697} 1842 41591 51793",
                 "{2457,4369,61697} 1842 41591 51793", 4, 0, NOT_ALL_PRIVATE,
                 51793, 1, 2457},
+               0,
        },
        {
                /* 20 */
@@ -344,44 +357,88 @@ static struct test_segment {
                {"(123 456 789) [124,456,788] 6435 59408 21665 {23456} 23456 23456 23456",
                 "6435 59408 21665 {23456} 23456 23456 23456", 7, 4,
                 NOT_ALL_PRIVATE, 23456, 1, 6435},
+               0,
        },
        {
                /* 21 */
                "reconcile_start_trans",
                "seq(23456,23456,23456) seq(6435,59408,21665)",
                {
-                       0x2, 0x3, 0x5b, 0xa0, 0x5b, 0xa0, 0x5b, 0xa0, 0x2, 0x3,
-                       0x19, 0x23, 0xe8, 0x10, 0x54, 0xa1,
+                       0x2,
+                       0x3,
+                       0x5b,
+                       0xa0,
+                       0x5b,
+                       0xa0,
+                       0x5b,
+                       0xa0,
+                       0x2,
+                       0x3,
+                       0x19,
+                       0x23,
+                       0xe8,
+                       0x10,
+                       0x54,
+                       0xa1,
                },
                16,
                {"23456 23456 23456 6435 59408 21665",
                 "23456 23456 23456 6435 59408 21665", 6, 0, NOT_ALL_PRIVATE,
                 21665, 1, 23456},
+               0,
        },
        {
                /* 22 */
                "reconcile_start_trans4",
                "seq(1842,41591,51793) seq(6435,59408,21665)",
                {
-                       0x2, 0x3, 0x07, 0x32, 0xa2, 0x77, 0xca, 0x51, 0x2, 0x3,
-                       0x19, 0x23, 0xe8, 0x10, 0x54, 0xa1,
+                       0x2,
+                       0x3,
+                       0x07,
+                       0x32,
+                       0xa2,
+                       0x77,
+                       0xca,
+                       0x51,
+                       0x2,
+                       0x3,
+                       0x19,
+                       0x23,
+                       0xe8,
+                       0x10,
+                       0x54,
+                       0xa1,
                },
                16,
                {"1842 41591 51793 6435 59408 21665",
                 "1842 41591 51793 6435 59408 21665", 6, 0, NOT_ALL_PRIVATE,
                 41591, 1, 1842},
+               0,
        },
        {
                /* 23 */
                "reconcile_start_trans_error",
                "seq(23456,23456,23456) seq(6435,59408)",
                {
-                       0x2, 0x3, 0x5b, 0xa0, 0x5b, 0xa0, 0x5b, 0xa0, 0x2, 0x2,
-                       0x19, 0x23, 0xe8, 0x10,
+                       0x2,
+                       0x3,
+                       0x5b,
+                       0xa0,
+                       0x5b,
+                       0xa0,
+                       0x5b,
+                       0xa0,
+                       0x2,
+                       0x2,
+                       0x19,
+                       0x23,
+                       0xe8,
+                       0x10,
                },
                14,
                {"23456 23456 23456 6435 59408", "23456 23456 23456 6435 59408",
                 5, 0, NOT_ALL_PRIVATE, 59408, 1, 23456},
+               0,
        },
        {
                /* 24 */
@@ -397,6 +454,7 @@ static struct test_segment {
                 "8466 3 52737 4096 3456 {7099,8153}",
                 "8466 3 52737 4096 3456 {7099,8153}", 6, 0, NOT_ALL_PRIVATE,
                 4096, 4, 8466},
+               0,
        },
        {
                /* 25 */
@@ -406,6 +464,7 @@ static struct test_segment {
                 0x80},
                12,
                {NULL, NULL, 0, 0, 0, 0, 0, 0},
+               0,
        },
        {
                /* 26  */
@@ -415,6 +474,7 @@ static struct test_segment {
                 0x00, 0x0d, 0x80},
                14,
                {NULL, NULL, 0, 0, 0, 0, 0, 0},
+               0,
        },
        {
                /* 27  */
@@ -423,20 +483,66 @@ static struct test_segment {
                {0x8, 0x2, 0x10, 0x00, 0x0d, 0x80},
                14,
                {NULL, NULL, 0, 0, 0, 0, 0, 0},
+               0,
        },
        {
                /* 28 */
                "BGP_AS_ZERO",
                "seq(8466,3,52737,0,4096)",
-               {0x2, 0x5,
-               0x21, 0x12,
-               0x00, 0x03,
-               0xce, 0x01,
-               0x00, 0x00,
-               0x10, 0x00},
+               {0x2, 0x5, 0x21, 0x12, 0x00, 0x03, 0xce, 0x01, 0x00, 0x00, 0x10,
+                0x00},
                12,
                {"8466 3 52737 0 4096", "8466 3 52737 0 4096", 5, 0,
                 NOT_ALL_PRIVATE, 4096, 4, 8466},
+               0,
+       },
+       {
+               /* 29 */
+               "seq3_asdot+",
+               "seq(0.8466,0.3,0.52737,0.4096,0.8722,0.4)",
+               {0x2, 0x6, 0x21, 0x12, 0x00, 0x03, 0xce, 0x01, 0x10, 0x00, 0x22,
+                0x12, 0x00, 0x04},
+               14,
+               {"0.8466 0.3 0.52737 0.4096 0.8722 0.4",
+                "0.8466 0.3 0.52737 0.4096 0.8722 0.4", 6, 0, NOT_ALL_PRIVATE,
+                3, 5, 8466},
+               ASNOTATION_DOTPLUS,
+       },
+       {
+               /* 30 */
+               "confmulti_asdot+",
+               "confseq(0.123,0.456,0.789) confset(0.222,0.111) seq(0.8722) set(0.4196,0.48658)",
+               {0x3,  0x3,  0x00, 0x7b, 0x01, 0xc8, 0x03, 0x15,
+                0x4,  0x2,  0x00, 0xde, 0x00, 0x6f, 0x2,  0x1,
+                0x22, 0x12, 0x1,  0x2,  0x10, 0x64, 0xbe, 0x12},
+               24,
+               {"(0.123 0.456 0.789) [0.111,0.222] 0.8722 {0.4196,0.48658}",
+                "0.8722 {0.4196,0.48658}", 2, 4, NOT_ALL_PRIVATE, 123, 1,
+                NULL_ASN},
+               ASNOTATION_DOTPLUS,
+       },
+       {
+               /* 31 */
+               "someprivate asdot+",
+               "seq(0.8466,0.64512,0.52737,0.65535)",
+               {0x2, 0x4, 0x21, 0x12, 0xfc, 0x00, 0xce, 0x01, 0xff, 0xff},
+               10,
+               {"0.8466 0.64512 0.52737 0.65535",
+                "0.8466 0.64512 0.52737 0.65535", 4, 0, NOT_ALL_PRIVATE, 65535,
+                4, 8466},
+               ASNOTATION_DOTPLUS,
+       },
+       {
+               /* 32 */
+               "BGP_AS_ZERO asdot+",
+               "seq(0.8466,0.3,0.52737,0.0,0.4096)",
+               {0x2, 0x5, 0x21, 0x12, 0x00, 0x03, 0xce, 0x01, 0x00, 0x00, 0x10,
+                0x00},
+               12,
+               {"0.8466 0.3 0.52737 0.0 0.4096",
+                "0.8466 0.3 0.52737 0.0 0.4096", 5, 0, NOT_ALL_PRIVATE, 4096,
+                4, 8466},
+               ASNOTATION_DOTPLUS,
        },
        {NULL, NULL, {0}, 0, {NULL, 0, 0}}};
 
@@ -871,16 +977,16 @@ struct compare_tests {
 };
 
 /* make an aspath from a data stream */
-static struct aspath *make_aspath(const uint8_t *data, size_t len, int use32bit)
+static struct aspath *make_aspath(const uint8_t *data, size_t len, int use32bit,
+                                 enum asnotation_mode asnotation)
 {
        struct stream *s = NULL;
        struct aspath *as;
-
        if (len) {
                s = stream_new(len);
                stream_put(s, data, len);
        }
-       as = aspath_parse(s, len, use32bit);
+       as = aspath_parse(s, len, use32bit, asnotation);
 
        if (s)
                stream_free(s);
@@ -916,15 +1022,16 @@ static int validate(struct aspath *as, const struct test_spec *sp)
        }
 
        out = aspath_snmp_pathseg(as, &bytes);
-       asinout = make_aspath(out, bytes, 0);
-
+       asinout = make_aspath(out, bytes, 0, as->asnotation);
        /* Excercise AS4 parsing a bit, with a dogfood test */
        if (!s)
                s = stream_new(BGP_MAX_PACKET_SIZE);
        bytes4 = aspath_put(s, as, 1);
-       as4 = make_aspath(STREAM_DATA(s), bytes4, 1);
+       as4 = make_aspath(STREAM_DATA(s), bytes4, 1, as->asnotation);
 
-       asstr = aspath_str2aspath(sp->shouldbe);
+       asn_relax_as_zero(true);
+       asstr = aspath_str2aspath(sp->shouldbe, as->asnotation);
+       asn_relax_as_zero(false);
 
        asconfeddel = aspath_delete_confed_seq(aspath_dup(asinout));
 
@@ -1051,7 +1158,7 @@ static void parse_test(struct test_segment *t)
 
        printf("%s: %s\n", t->name, t->desc);
 
-       asp = make_aspath(t->asdata, t->len, 0);
+       asp = make_aspath(t->asdata, t->len, 0, t->asnotation);
 
        printf("aspath: %s\nvalidating...:\n", aspath_print(asp));
 
@@ -1073,8 +1180,10 @@ static void prepend_test(struct tests *t)
        printf("prepend %s: %s\n", t->test1->name, t->test1->desc);
        printf("to %s: %s\n", t->test2->name, t->test2->desc);
 
-       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0);
-       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0);
+       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0,
+                          ASNOTATION_PLAIN);
+       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0,
+                          ASNOTATION_PLAIN);
 
        ascratch = aspath_dup(asp2);
        aspath_unintern(&asp2);
@@ -1100,8 +1209,8 @@ static void empty_prepend_test(struct test_segment *t)
 
        printf("empty prepend %s: %s\n", t->name, t->desc);
 
-       asp1 = make_aspath(t->asdata, t->len, 0);
-       asp2 = aspath_empty();
+       asp1 = make_aspath(t->asdata, t->len, 0, t->asnotation);
+       asp2 = aspath_empty(t->asnotation);
 
        ascratch = aspath_dup(asp2);
        aspath_unintern(&asp2);
@@ -1128,8 +1237,10 @@ static void as4_reconcile_test(struct tests *t)
        printf("reconciling %s:\n  %s\n", t->test1->name, t->test1->desc);
        printf("with %s:\n  %s\n", t->test2->name, t->test2->desc);
 
-       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0);
-       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0);
+       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0,
+                          ASNOTATION_PLAIN);
+       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0,
+                          ASNOTATION_PLAIN);
 
        ascratch = aspath_reconcile_as4(asp1, asp2);
 
@@ -1153,8 +1264,10 @@ static void aggregate_test(struct tests *t)
        printf("aggregate %s: %s\n", t->test1->name, t->test1->desc);
        printf("with %s: %s\n", t->test2->name, t->test2->desc);
 
-       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0);
-       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0);
+       asp1 = make_aspath(t->test1->asdata, t->test1->len, 0,
+                          ASNOTATION_PLAIN);
+       asp2 = make_aspath(t->test2->asdata, t->test2->len, 0,
+                          ASNOTATION_PLAIN);
 
        ascratch = aspath_aggregate(asp1, asp2);
 
@@ -1186,8 +1299,8 @@ static void cmp_test(void)
                printf("left cmp %s: %s\n", t1->name, t1->desc);
                printf("and %s: %s\n", t2->name, t2->desc);
 
-               asp1 = make_aspath(t1->asdata, t1->len, 0);
-               asp2 = make_aspath(t2->asdata, t2->len, 0);
+               asp1 = make_aspath(t1->asdata, t1->len, 0, ASNOTATION_PLAIN);
+               asp2 = make_aspath(t2->asdata, t2->len, 0, ASNOTATION_PLAIN);
 
                if (aspath_cmp_left(asp1, asp2) != left_compare[i].shouldbe_cmp
                    || aspath_cmp_left(asp2, asp1)
@@ -1225,7 +1338,9 @@ static int handle_attr_test(struct aspath_tests *t)
        struct aspath *asp;
        size_t datalen;
 
-       asp = make_aspath(t->segment->asdata, t->segment->len, 0);
+       asp = make_aspath(t->segment->asdata, t->segment->len, 0,
+                         t->segment->asnotation);
+       bgp.asnotation = t->segment->asnotation;
 
        peer.curr = stream_new(BGP_MAX_PACKET_SIZE);
        peer.obuf = stream_fifo_new();
@@ -1301,8 +1416,8 @@ int main(void)
                parse_test(&test_segments[i]);
                empty_prepend_test(&test_segments[i++]);
        }
-
        i = 0;
+
        while (prepend_tests[i].test1) {
                printf("prepend test %u\n", i);
                prepend_test(&prepend_tests[i++]);
index e899e5b359e166eeedaa398f5ae36db0af1fd343..bed86f5ac0667141b5fde20c91ecc9666e9e8a52 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Routing table range lookup test
  * Copyright (C) 2012 OSR.
@@ -5,20 +6,6 @@
  * Hamburg
  *
  * This file is part of FRRouting
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 51792825da94d4bce8a268d201aab5af04798c27..8ef57486717c408d3fb557b3dbe48305a6400200 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2007 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -952,7 +937,8 @@ int main(void)
        if (fileno(stdout) >= 0)
                tty = isatty(fileno(stdout));
 
-       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT) < 0)
+       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT, NULL,
+                   ASNOTATION_PLAIN) < 0)
                return -1;
 
        peer = peer_create_accept(bgp);
index 7147e3faf3aea08d03d0e6d905f30591c1e3c5b1..bb360722c8c112d4e9851ca982681d36468fdbe8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2007 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index c5ce5d3cd2c01872392c79ee859eacf16f4b1269..b1f3314f1f16cc71bb28671383c16580c21179e6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2008 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1094,7 +1079,8 @@ int main(void)
        if (fileno(stdout) >= 0)
                tty = isatty(fileno(stdout));
 
-       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT) < 0)
+       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT, NULL,
+                   ASNOTATION_PLAIN) < 0)
                return -1;
 
        peer = peer_create_accept(bgp);
index c20403f670e6b6770c2b1ac1c796bc1bdf4b6f6d..3662805971ae30d2ea3322943dd2ba856f7972fe 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Multipath Unit Test
  * Copyright (C) 2010 Google Inc.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2ce8b561bbb14b88255dc55ca85918f5d2f2e34a..aeebbd9a353a3885326ca7a13a7fae8c6bb6db5d 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2017 Cumulus Networks Inc.
  *                    Donald Sharp
  *
  * This file is part of FRR
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -63,7 +50,8 @@ int main(int argc, char *argv[])
        vrf_init(NULL, NULL, NULL, NULL);
        bgp_option_set(BGP_OPT_NO_LISTEN);
 
-       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT) < 0)
+       if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT, NULL,
+                   ASNOTATION_PLAIN) < 0)
                return -1;
 
        peer = peer_create_accept(bgp);
index cc4f71e688bfede481c2e4fead8b005d30be3e5c..652aaa25d44c169defef2d50daeb299e39c12356 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * BGP Peer Attribute Unit Tests
  * Copyright (C) 2018  Pascal Mathis
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -176,9 +163,9 @@ struct test_peer_attr {
 
        enum test_peer_attr_type type;
        union {
-               uint32_t flag;
+               uint64_t flag;
                struct {
-                       uint32_t flag;
+                       uint64_t flag;
                        size_t direct;
                } filter;
        } u;
@@ -281,6 +268,18 @@ static struct test_peer_attr test_peer_attrs[] = {
                .o.invert_peer = true,
                .o.use_iface_peer = true,
        },
+       {
+               .cmd = "capability software-version",
+               .u.flag = PEER_FLAG_CAPABILITY_SOFT_VERSION,
+               .type = PEER_AT_GLOBAL_FLAG,
+       },
+       {
+               .cmd = "capability software-version",
+               .u.flag = PEER_FLAG_CAPABILITY_SOFT_VERSION,
+               .type = PEER_AT_GLOBAL_FLAG,
+               .o.invert_peer = true,
+               .o.use_iface_peer = true,
+       },
        {
                .cmd = "description",
                .peer_cmd = "description FRR Peer",
@@ -651,21 +650,14 @@ static const char *str_from_afi(afi_t afi)
                return "ipv4";
        case AFI_IP6:
                return "ipv6";
-       default:
-               return "<unknown AFI>";
+       case AFI_L2VPN:
+               return "l2vpn";
+       case AFI_MAX:
+       case AFI_UNSPEC:
+               return "bad-value";
        }
-}
 
-static const char *str_from_safi(safi_t safi)
-{
-       switch (safi) {
-       case SAFI_UNICAST:
-               return "unicast";
-       case SAFI_MULTICAST:
-               return "multicast";
-       default:
-               return "<unknown SAFI>";
-       }
+       assert(!"Reached end of function we should never reach");
 }
 
 static const char *str_from_attr_type(enum test_peer_attr_type at)
@@ -1151,7 +1143,7 @@ static void test_peer_attr(struct test *test, struct test_peer_attr *pa)
                test_log(test, "prepare: switch address-family to [%s]",
                         get_afi_safi_str(pa->afi, pa->safi, false));
                test_execute(test, "address-family %s %s",
-                            str_from_afi(pa->afi), str_from_safi(pa->safi));
+                            str_from_afi(pa->afi), safi2str(pa->safi));
                test_execute(test, "neighbor %s activate", g->name);
                test_execute(test, "neighbor %s activate", p->host);
        }
@@ -1218,7 +1210,7 @@ static void test_peer_attr(struct test *test, struct test_peer_attr *pa)
                test_log(test, "prepare: switch address-family to [%s]",
                         get_afi_safi_str(pa->afi, pa->safi, false));
                test_execute(test, "address-family %s %s",
-                            str_from_afi(pa->afi), str_from_safi(pa->safi));
+                            str_from_afi(pa->afi), safi2str(pa->safi));
                test_execute(test, "neighbor %s activate", g->name);
                test_execute(test, "neighbor %s activate", p->host);
        }
@@ -1266,7 +1258,7 @@ static void test_peer_attr(struct test *test, struct test_peer_attr *pa)
                test_log(test, "prepare: switch address-family to [%s]",
                         get_afi_safi_str(pa->afi, pa->safi, false));
                test_execute(test, "address-family %s %s",
-                            str_from_afi(pa->afi), str_from_safi(pa->safi));
+                            str_from_afi(pa->afi), safi2str(pa->safi));
                test_execute(test, "neighbor %s activate", g->name);
                test_execute(test, "neighbor %s activate", p->host);
        }
@@ -1465,7 +1457,7 @@ int main(void)
                if (pa->afi && pa->safi)
                        desc = asprintfrr(MTYPE_TMP, "peer\\%s-%s\\%s",
                                          str_from_afi(pa->afi),
-                                         str_from_safi(pa->safi), pa->cmd);
+                                         safi2str(pa->safi), pa->cmd);
                else
                        desc = asprintfrr(MTYPE_TMP, "peer\\%s", pa->cmd);
 
index ca6b18ecda4cff5ed5457a7f2f630b77ea05cbf1..bb8acd2c44183aee09f5f8f536abea7a1b3d75ae 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index e2173d45159e71b7de21f7e921316cb3732648be..612c433443083ba29b3b742bbd341a792cc47d1e 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Very simple prng to allow for randomized tests with reproducable
  * results.
@@ -7,20 +8,6 @@
  * Copyright (C) 2017 Christian Franke
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 23f702b07f17e30dd3dfcfd32a5e9757e5a7cec7..6b10bde60f3b113eb2443091002fbe30aa41d29a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Very simple prng to allow for randomized tests with reproducable
  * results.
@@ -6,20 +7,6 @@
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef _PRNG_H
 #define _PRNG_H
index 53e9c7844b66ce2c3fa24e24e451d5b0d1029f14..40f17ccc954547de02d8b58b35d896fb736de041 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test wrappers common header file
  *
@@ -5,20 +6,6 @@
  *                    for Open Source Routing./ NetDEF, Inc.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _QUAGGA_TESTS_H
index df737d92ef521dfe620219c6326daed791153142..8af96476138d32625812cc9005bf8c5493f4ddc4 100644 (file)
@@ -1,24 +1,7 @@
+# SPDX-License-Identifier: MIT
 #
 # Copyright (c) 2010-2017 Benjamin Peterson
 #
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 
 #
 # This code is taken from the six python2 to python3 compatibility module
index 584fa90374a778c1795a0a49616a879e7314a94d..3faa2a6f13b4651322de03040289a5de7a58ae1b 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Test helpers for FRR
 #
@@ -6,21 +7,6 @@
 #
 # This file is part of FRRouting (FRR)
 #
-# FRR is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any
-# later version.
-#
-# FRR is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with FRR; see the file COPYING.  If not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
 
 import subprocess
 import sys
index ade3573535617a40b709282b9118ab4eb35c338e..0f37752ce26588f55ff31c7a2b5bf06c4c6d717c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 3359a893acf3e9be6b019fad27c9913f535d74b1..9b83b30ba71a08b23a57bbbe27b85f14ffbf1978 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _COMMON_ISIS_H
index 971aba4c46f54961b2aeac3a512a7d5c4aa70b7b..0cccf05678ef25b471a46d5117a334dd06a92411 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index b3e500a33c45dd806d5fa5990a81bcca914ac10f..a0ac7689680d459cc8ce710f7ca0b039e4eece17 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 7c9febe2cab91b988fa44c80e5641cac8b2a8881..29dad7d80f61600459962fccd1961edbbda7e6b6 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * generic CLI test helper functions
  *
  * Copyright (C) 2015 by David Lamparter,
  *                   for Open Source Routing / NetDEF, Inc.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6660b27ef7b7f1f787073dce01b0515cd11f8101..7ef4d860bd96032f4e0b82ad75ba4700f90ca22d 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * generic CLI test helper functions
  *
  * Copyright (C) 2015 by David Lamparter,
  *                   for Open Source Routing / NetDEF, Inc.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _COMMON_CLI_H
index f8d74018ddfd218532d8e4c19c426284468744f0..031473515f48c33c83cfba098a154c8647781eca 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * CLI/command dummy handling tester
  *
  * Copyright (C) 2015 by David Lamparter,
  *                   for Open Source Routing / NetDEF, Inc.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a00f80073c99f634c716a0e9a48a7e95c1666049..54db7957571158bb7a7396fbcc11ef2429a3f5f3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test code for lib/command.c
  *
  *
  * The output is currently not validated but only logged. It can
  * be diffed to find regressions between versions.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define REALLY_NEED_PLAIN_GETOPT 1
index 2589fca6141b92c05886db739a3c5f496feb43a9..7aab88eeb98c639373705137c46ca8be412f3eb0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * C++ compatibility compile-time smoketest
  * Copyright (C) 2019  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define test__cplusplus
index 14c857118b728949fe21abbe504ee644a398a880..ad9677a718df1fe4a928146513da646394535ab0 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * zlog fuzzer target.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 74f3286c5fe21f57f064b4b8b3e1fc6f1326f233..ec3f8ae0a3de9205711609a9760d81599586ea52 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
 # zlog fuzz-tester input generator
 #
 # Copyright (C) 2021  David Lamparter for NetDEF, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 from itertools import chain
 import struct
index 08eb0d527cbe3428eeb64688ed6e84992a3efd0f..3abda75f40fb829a0bb14203e2fd1eb4941c370f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a4535651d4b862c3da8a5ea4963c0d348ceb4b3a..d68ee8a8191a2336fafe6e69e5b8b303172c7255 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Quick test for assert()
  * Copyright (C) 2021  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 83dd9f2c590457023b43b84c8adc398bbe4dc868..b50216cf929224a59e8fbcc9345001df0941c269 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016-2018  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index 7fb9a769d3e18088f5c39f3cbbb8d092a10d96c1..9f501f4e35ecb362b7569d88a45b2c5222cef30c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2004 Paul Jakma
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9a7f2b147298bc5e3ca32430eb858c2a6763818b..fcb79ee28d0d208db01c382141f145aa33da17c5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2008 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index fb6b77c0f89a46d5c7617de5f772653665b8ea97..4f492db5bf1d88148ad8544de513feead86776cb 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frrlua unit tests
  * Copyright (C) 2021  Donald Lee
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4c5d8d29289e6df47720ae1f4284e0d1df63fe4f..7d4746cf3ea29d5a211690bf85e807efd7e4acdb 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frrscript unit tests
  * Copyright (C) 2021  Donald Lee
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2801c48bc53bacb7d38f48e33712763dc2bc37aa..86af02a4e9e28a9e13937e96502c08a27be54869 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test graph data structure.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <graph.h>
index 88372f45a5e48412786b2f894fee280284bd6cca..282161c3df8afe5955947c12362beb9b5d39b277 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * May 16 2021, Christian Hopps <chopps@labn.net>
  *
  * Copyright (c) 2021, LabN Consulting, L.L.C
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <time.h>
index afc7a08e662554bd85e83b66c2d1840d3b7a0342..2d54fe6c68a564e619c03454fc6f34e908791832 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This programme shows the effects of 'heavy' long-running functions
index 466f9a7d976772b41fc6eb2a61f2712551649360..afbd20545183d506f960be0f480fa8e607cc4a51 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This programme shows the effects of 'heavy' long-running functions
index be47ef4bbce90e0543a065895945c293aea03cc7..9b2cfa5730d1d9f6e101bd2703608bb232e1ffa9 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* This programme shows the effects of 'heavy' long-running functions
index 9f04304a2bd2e4a3b5a51acf715dedc5185db900..e4423b0b5b4cea471b295a021a63f9148ea4cd1d 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 7cf687dffe094811693819abba6532cbad2901a2..84732d6afda273cc9117a0d11437c90f47b53cfb 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop module test.
  *
  * Copyright (C) 2021 by Volta Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a6995d13e80bc97a73e2cb0d7d3d203960f25261..2bb0b1233cb1b24c548cdc4ed51183542cae4f32 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Recursive Nexthop Iterator test.
  * This tests the ALL_NEXTHOPS macro.
@@ -6,20 +7,6 @@
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0a55ecddb8fbcb8816b9e2ebd60ce4d14a53c6d4..d3570479a5dec34d5c2a30be9a1ae32a360741d2 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frr_inet_ntop() unit test
  * Copyright (C) 2019  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index ee7a9ebf30267ffdb0a44af852933a738759ec7f..bfad766c7c599d5bb0adf27d23652e1e61e89b15 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Simple prefix list querying tool
  *
  * Copyright (C) 2021 by David Lamparter,
  *                   for Open Source Routing / NetDEF, Inc.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cbfc20a79720d8f8946ba70628c51b4f345f718f..9d837eede72cf64c500213b52b6ec1dd9800b92b 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * prefix2str() unit test
  * Copyright (C) 2019  David Lamparter
  * Portions:
  *     Copyright (C) 2019  Cumulus Networks, Inc
  *     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 59d08ae82b0407dddabeeb091acba4c08e4a5ae3..0ab40b2ecd8b7b6aafa5c478f20653dbac712631 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * printfrr() unit test
  * Copyright (C) 2019  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
@@ -25,6 +12,7 @@
 #include "lib/memory.h"
 #include "lib/prefix.h"
 #include "lib/nexthop.h"
+#include "lib/asn.h"
 
 static int errors;
 
@@ -158,6 +146,7 @@ int main(int argc, char **argv)
        struct in_addr ip;
        char *p;
        char buf[256];
+       as_t asn;
 
        printcmp("%d %u %d %u", 123, 123, -456, -456);
        printcmp("%lld %llu %lld %llu", 123LL, 123LL, -456LL, -456LL);
@@ -405,6 +394,13 @@ int main(int argc, char **argv)
        printchk("-00:09", "%pTSIm", &ts);
        printchk("--:--", "%pTVImx", &tv);
        printchk("--:--", "%pTTImx", &tt);
+       /* ASN checks */
+       asn = 65536;
+       printchk("1.0", "%pASD", &asn);
+       asn = 65400;
+       printchk("65400", "%pASP", &asn);
+       printchk("0.65400", "%pASE", &asn);
+       printchk("65400", "%pASD", &asn);
 
        return !!errors;
 }
index c06ebbeb38e86d35fdb4ff8c73f4860f1a67c282..d7bc0b3153f4204b39969b8516c4aa0bbddbf5b7 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6a582cceaff90bf62ab57f9e903aa0ceb6eaf2f5..b4d8992b954cea340fb19950d6f939b291b5e67b 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * FRR c-ares integration test
  * Copyright (C) 2021  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* this test is not run automatically since tests MUST NOT rely on any outside
index 4ac62940b872a09ea4ce852a1acb2604e7322431..0d7fed75e85b8b8a9f5c0ed9af20c04970fa040a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Circular buffer tests.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <memory.h>
index 92c9f7a2ea772f542034e77532dd8fcf075dacd3..8532da7c2d9c1342e4870cbd74dcfa099963a798 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * SEGV / backtrace handling test.
  *
@@ -7,20 +8,6 @@
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 768307d56dbf7e09b029a6d5ef7dde7b55068c04..288d4a8c255459c640e6bf081ab253802fd6da27 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * basic test for seqlock
  *
  * Copyright (C) 2015  David Lamparter
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #ifdef HAVE_CONFIG_H
index 9165f1850f77a70a37578080921e5929895998cf..897e004b4009df5271cdf5fd6e55f77ca5ab8b28 100644 (file)
@@ -1,19 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2f9ca5eaea9542857918b1d8945edc22e30f94d0..6af7ac5293af6c8cd8a89ec27d97e29ce507baff 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2021, LabN Consulting, L.L.C
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2d8f024d16e6b0af66606fe1d7b68570dfc1570f..de0482d694f3681422042a738dcb088b193d4e7a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test srcdest table for correctness.
  *
@@ -5,20 +6,6 @@
  *                       Open Source Routing / NetDEF Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a45c2b4d54ef6300d6418221f8bf40978b134025..015dc41db1edf3fd49be2f335a7ca90bd8966ca2 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Simple stream test.
  *
  * Copyright (C) 2006 Sun Microsystems, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cef93ad0c5730a02c6644fe4cfa91e54d3cafe56..41d700395672aa0646b2561ca0fc7a24e5ddab7a 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Routing table test
  * Copyright (C) 2012 OSR.
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 475fabd2d719e80a87c063f3b98ecbdba4378ab7..37eb4939a1f78020460346b92f467455b2a4490f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test program to verify that scheduled timers are executed in the
  * correct order.
@@ -6,20 +7,6 @@
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c1dd07b899f54d63ff32519764ca70275dfb4091..21976e8d3100c55c38a7ace2abb66de419787b5a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Test program which measures the time it takes to schedule and
  * remove timers.
@@ -6,20 +7,6 @@
  * Copyright (C) 2013 by Internet Systems Consortium, Inc. ("ISC")
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 43b8adcb97316c5ba87ea9ffb4279045a00b7cde..562ddf9d66e31c5834ce3470e5147cb5ecfe5b1a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ASCII table generator.
  * Copyright (C) 2017  Cumulus Networks
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <termtable.h>
index 6e696584908c6063ff9a6407d84427408892b411..070a30433573f6d65f7cb50170f9cae952e71be2 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2016-2018  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #ifdef HAVE_CONFIG_H
index feb42909a8cc8705f694c66e991fe3a7e3b6c407..91528139b5d70ebe74cd3f9700394149b7d55a8f 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* C++ called, they want their templates back */
index bb819e36f543b68f9c1fd8ea255e2d2b805dbb47..84ae06e4dcb9876e7a085f5c7fe4d974a65b1007 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frr_version_cmp() tests
  * Copyright (C) 2018  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <defaults.h>
index aa179141af0e7dbf105d4d5563959df9e6916f5b..fca0d47f388e7d288d3816ed4cd300ab81b01832 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * xref tests
  * Copyright (C) 2020  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 48fa7bce9482b6e9f8046ec0feab11f19c587507..95d90569f03f01d89ae6e2ba5568a64faf71f37d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zlog tests.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <memory.h>
index c411de7252540e55a2e2c94081aa320ff1358b88..59a596e1c895a08911fa369da36b927096a1491c 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ZeroMQ event test
  * Copyright (C) 2017  David Lamparter, for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index c5bdcd3d1342bc3cc0ed36ac75beeb546bde1b22..4bc6e869b6417e4112b240a41dbc7605d6966d36 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * CLI/command dummy handling tester
  *
  * Copyright (C) 2015 by David Lamparter,
  *                   for Open Source Routing / NetDEF, Inc.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index eb30c4016e2aba633bdcda91d8a17a244cdb1499..ef5e3ed1775c042e4e3690882b71cde337d36ee3 100644 (file)
@@ -74,7 +74,8 @@ void print_route_table(struct vty *vty, struct route_table *rt)
                                label_stack = path->srni.backup_label_stack;
                                mpls_label2str(label_stack->num_labels,
                                               label_stack->label, buf,
-                                              MPLS_LABEL_STRLEN, true);
+                                              MPLS_LABEL_STRLEN,
+                                              ZEBRA_LSP_NONE, true);
                                vty_out(vty, " and backup path %s", buf);
                        }
                        vty_out(vty, "\n");
index 73f2e29834e8f2f452eeb6c79e00ec5059f1bebc..b8a2aef69e122d80bcaea87b41f176fca5a54f34 100644 (file)
@@ -107,7 +107,7 @@ static void test_run_spf(struct vty *vty, struct ospf *ospf,
                                                        ->num_labels,
                                                q_space->label_stack->label,
                                                label_buf, MPLS_LABEL_STRLEN,
-                                               true);
+                                               ZEBRA_LSP_NONE, true);
                                        vty_out(vty, "\nLabel stack: %s\n",
                                                label_buf);
                                } else {
index 2d3e2a7594f12f47ee93353f3c5568d2d6180b0d..fe84d496ac0bcb347e090f936b8b5125f74be2fe 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_all_protocol_startup.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_all_protocol_startup.py: Test of all protocols at same time
index 108bd1b49adfc9d26aab216439752c3388506638..360c9cf1e9e165c7bc94bb771e549ee69826fa89 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # July 9 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 import argparse
 import glob
 import logging
index 12f81042e65efef35bbfd72625c3fe63333ca7e4..6a0297a7ee129b31c4e976b95736eff061a58666 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_babel_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_babel_topo1.py: Testing BABEL
index 92432669c815463667c4ec0a0de650fb703513ef..475c4b1aa1c6661faf23993a25bce44e7e6792e1 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_bgp_cbit_topo3.py
 #
 # Copyright (c) 2019 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_bgp_cbit_topo3.py: Test the FRR BFD daemon with multihop and BGP
index 27a44193298bc3f20eec40659a9b47cbb4c09f06..09e69144f6cf89107dd7edd412ed3f80b3ab927a 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_isis_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_isis_topo1.py:
index 93a2339299c361bb7bb09a7c9e389213fa0730b5..b9e8b73c1d028d13e517ecc1d357b677c322a146 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_ospf_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_ospf_topo1.py:
index 169f90abf063fa6625dddd9cf417596dadd5e956..78841b34e7313d3ec481630e609f966a943cb480 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_profiles_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_profiles_topo1.py: Test the FRR BFD profile protocol integration.
index 955d54f30c1dcf64da406d5d7241cae4adfd48a8..1b774931b29083d2a9189f4940182ec2dee1fa0e 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2018 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_topo1.py: Test the FRR BFD daemon.
index a9b9358ef07708e275cdee08eae972c76c57cf31..b720218e9bc8a196fabcfc468790a5f677a10d2f 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_topo2.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_topo2.py: Test the FRR BFD daemon with multihop and BGP
index ea9f981d9b65256f97821100ad4585af7ae39fb3..c0dc052a38d9f232f9f1e681aa401afc50076a40 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_topo3.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_topo3.py: Test the FRR BFD daemon multi hop.
index acb86ea7f290dcdde58d2d87cc4b0455ad1a4a9d..a532f3a2d7f377ab820ad478279700d3cbb98130 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_vrf_topo1.py
@@ -8,20 +9,6 @@
 # Network Device Education Foundation, Inc. ("NetDEF")
 # Copyright (c) 2019 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_vrf_topo1.py: Test the FRR BFD daemon.
index b7afb8e3b902fc2dfd45b80e2ceb6b62aa3dbc4b..30f4a2f9b574e72858dc38d45d1f55c59850d528 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bfd_vrflite_topo1.py
@@ -8,20 +9,6 @@
 # Network Device Education Foundation, Inc. ("NetDEF")
 # Copyright (c) 2022 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bfd_vrflite_topo1.py: Test the FRR BFD daemon.
index daef6dcd52c764c594ee63f5276f2b92dd02c018..d294da0934b9518e07019ff210814d16d482ff8a 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 
index edf50dc9e0e66d1d9a33efe946b1816e83767fe0..5a4a5fb657cf6be9288691619d9a256b1cb94bd1 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if aggregate-address command works fine when suppressing summary-only
index 0d01fa2ade568548bc5d31c193b65913c1cd87e3..739685d417648db405f93c6e274a68b2af62cb8a 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_aggregate-address_origin.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_aggregate-address_origin.py:
index df20594566e9a6b9bd8f038f3c2e81a008745710..cec06920cb8b3a7e1f919a18e3e9f9a935ad31c7 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_aggregate-address_route-map.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_aggregate-address_route-map.py:
index f506792c42a19e278af6d4d94fb038642fc40f0b..370d01e52598604a8d99de6740f3df20440a453d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_aggregate_address_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test BGP aggregate address features.
index ea71c82d8164555f4843d305f3121ad87630d949..d9ef3e1ce151d78fec658734408facc7cec5fca2 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP UPDATE with AGGREGATOR AS attribute with value zero (0)
index 9fa80c6da38e7c1a011a65d2c4982a385ccdd0c6..6fda45940514438bdcdca4512ef9f79ca248ffeb 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 r7 sets aigp-metric for 10.0.0.71/32 to 71, and 72 for 10.0.0.72/32.
@@ -151,30 +138,34 @@ def test_bgp_aigp():
         )
         expected = {
             "routes": {
-                "10.0.0.71/32": [
-                    {
-                        "aigpMetric": 101,
-                        "valid": True,
-                    },
-                    {
-                        "aigpMetric": 91,
-                        "valid": True,
-                        "bestpath": {"selectionReason": "AIGP"},
-                        "nexthops": [{"hostname": "r3", "accessible": True}],
-                    },
-                ],
-                "10.0.0.72/32": [
-                    {
-                        "aigpMetric": 102,
-                        "valid": True,
-                    },
-                    {
-                        "aigpMetric": 92,
-                        "valid": True,
-                        "bestpath": {"selectionReason": "AIGP"},
-                        "nexthops": [{"hostname": "r3", "accessible": True}],
-                    },
-                ],
+                "10.0.0.71/32": {
+                    "paths": [
+                        {
+                            "aigpMetric": 101,
+                            "valid": True,
+                        },
+                        {
+                            "aigpMetric": 91,
+                            "valid": True,
+                            "bestpath": {"selectionReason": "AIGP"},
+                            "nexthops": [{"hostname": "r3", "accessible": True}],
+                        },
+                    ],
+                },
+                "10.0.0.72/32": {
+                    "paths": [
+                        {
+                            "aigpMetric": 102,
+                            "valid": True,
+                        },
+                        {
+                            "aigpMetric": 92,
+                            "valid": True,
+                            "bestpath": {"selectionReason": "AIGP"},
+                            "nexthops": [{"hostname": "r3", "accessible": True}],
+                        },
+                    ],
+                },
             }
         }
         return topotest.json_cmp(output, expected)
index 7ded0ce8b46fe32a1323f52f7599094b9875773d..c49a2e5384d584ccab2e58f9de50c350187eefc8 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test bgp allowas-in functionality:
index 40085cd7ecc0aafe6192b763caa574ba476c0233..7cb4f81cfc18c12797447ab78d60507e051ab77a 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 """
index 571e28cf7be28d0ce69ab66db0e6303a52432f00..5c09a6b0e0b9ccef06693081f5e061c8cd052fee 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_as_wide_bgp_identifier.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 rfc6286: Autonomous-System-Wide Unique BGP Identifier for BGP-4
diff --git a/tests/topotests/bgp_asdot_regex/__init__.py b/tests/topotests/bgp_asdot_regex/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_asdot_regex/r1/bgpd.conf b/tests/topotests/bgp_asdot_regex/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..4dd95dd
--- /dev/null
@@ -0,0 +1,27 @@
+router bgp 1.1
+  no bgp ebgp-requires-policy
+  no bgp network import-check
+  neighbor 192.168.255.2 remote-as 1.2
+  address-family ipv4 unicast
+   network 172.31.1.0/24 route-map rmapout
+   network 172.31.2.0/24 route-map rmapout
+   neighbor 192.168.255.2 route-map rmapin in
+   neighbor 192.168.255.2 activate
+  exit-address-family
+exit
+bgp as-path access-list only1_4 permit _1.4_
+bgp as-path access-list only65540 permit _65540_
+access-list 172313 permit 172.31.3.0/24
+access-list 172314 permit 172.31.4.0/24
+route-map rmapout permit 1
+ set as-path prepend 1.4
+exit
+route-map rmapin permit 1
+ match ip address 172313
+ match as-path only1_4 
+exit
+route-map rmapin permit 2
+ match ip address 172314
+ match as-path only65540
+exit
+
diff --git a/tests/topotests/bgp_asdot_regex/r1/show_bgp_ipv4.json b/tests/topotests/bgp_asdot_regex/r1/show_bgp_ipv4.json
new file mode 100644 (file)
index 0000000..e3703bf
--- /dev/null
@@ -0,0 +1,80 @@
+{   
+ "vrfId": 0,
+ "vrfName": "default",
+ "tableVersion": 3,
+ "routerId": "192.168.255.1",
+ "defaultLocPrf": 100,
+ "localAS": "1.1",
+ "routes": { "172.31.1.0/24": [
+  { 
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.1.0",
+    "prefixLen":24,
+    "network":"172.31.1.0/24",
+    "metric":0,
+    "weight":32768,
+    "peerId":"(unspec)",
+    "path":"1.4",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"0.0.0.0",
+        "hostname":"r1",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  } 
+]   
+,"172.31.2.0/24": [
+  { 
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.2.0",
+    "prefixLen":24,
+    "network":"172.31.2.0/24",
+    "metric":0,
+    "weight":32768,
+    "peerId":"(unspec)",
+    "path":"1.4",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"0.0.0.0",
+        "hostname":"r1",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  }
+]
+,"172.31.3.0/24": [
+  {
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.3.0",
+    "prefixLen":24,
+    "network":"172.31.3.0/24",
+    "metric":0,
+    "weight":0,
+    "peerId":"192.168.255.2",
+    "path":"1.2 1.4",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"192.168.255.2",
+        "hostname":"r2",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  }
+]
+ }  } 
diff --git a/tests/topotests/bgp_asdot_regex/r1/zebra.conf b/tests/topotests/bgp_asdot_regex/r1/zebra.conf
new file mode 100644 (file)
index 0000000..6e9b0b4
--- /dev/null
@@ -0,0 +1,6 @@
+!
+interface r1-eth0
+  ip address 192.168.255.1/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_asdot_regex/r2/bgpd.conf b/tests/topotests/bgp_asdot_regex/r2/bgpd.conf
new file mode 100644 (file)
index 0000000..216dbd1
--- /dev/null
@@ -0,0 +1,26 @@
+router bgp 65538
+  no bgp ebgp-requires-policy
+  no bgp network import-check
+  neighbor 192.168.255.1 remote-as 65537
+  address-family ipv4 unicast
+   network 172.31.3.0/24 route-map rmapout
+   network 172.31.4.0/24 route-map rmapout
+   neighbor 192.168.255.1 route-map rmapin in
+   neighbor 192.168.255.1 activate
+  exit-address-family
+exit
+bgp as-path access-list only65540 permit _65540_
+bgp as-path access-list only1_4 permit _1.4_
+access-list 172311 permit 172.31.1.0/24
+access-list 172312 permit 172.31.2.0/24
+route-map rmapout permit 1
+ set as-path prepend 65540
+exit
+route-map rmapin permit 1
+ match ip address 172311
+ match as-path only65540 
+exit
+route-map rmapin permit 2
+ match ip address 172312
+ match as-path only1_4 
+exit
diff --git a/tests/topotests/bgp_asdot_regex/r2/show_bgp_ipv4.json b/tests/topotests/bgp_asdot_regex/r2/show_bgp_ipv4.json
new file mode 100644 (file)
index 0000000..1af4ff7
--- /dev/null
@@ -0,0 +1,80 @@
+{
+ "vrfId": 0,
+ "vrfName": "default",
+ "tableVersion": 3,
+ "routerId": "192.168.255.2",
+ "defaultLocPrf": 100,
+ "localAS": 65538,
+ "routes": { "172.31.1.0/24": [
+  {
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.1.0",
+    "prefixLen":24,
+    "network":"172.31.1.0/24",
+    "metric":0,
+    "weight":0,
+    "peerId":"192.168.255.1",
+    "path":"65537 65540",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"192.168.255.1",
+        "hostname":"r1",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  }
+]
+,"172.31.3.0/24": [
+  {
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.3.0",
+    "prefixLen":24,
+    "network":"172.31.3.0/24",
+    "metric":0,
+    "weight":32768,
+    "peerId":"(unspec)",
+    "path":"65540",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"0.0.0.0",
+        "hostname":"r2",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  }
+]
+,"172.31.4.0/24": [
+  {
+    "valid":true,
+    "bestpath":true,
+    "selectionReason":"First path received",
+    "pathFrom":"external",
+    "prefix":"172.31.4.0",
+    "prefixLen":24,
+    "network":"172.31.4.0/24",
+    "metric":0,
+    "weight":32768,
+    "peerId":"(unspec)",
+    "path":"65540",
+    "origin":"IGP",
+    "nexthops":[
+      {
+        "ip":"0.0.0.0",
+        "hostname":"r2",
+        "afi":"ipv4",
+        "used":true
+      }
+    ]
+  }
+]
+ }  } 
diff --git a/tests/topotests/bgp_asdot_regex/r2/zebra.conf b/tests/topotests/bgp_asdot_regex/r2/zebra.conf
new file mode 100644 (file)
index 0000000..6c14de5
--- /dev/null
@@ -0,0 +1,6 @@
+!
+interface r2-eth0
+  ip address 192.168.255.2/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_asdot_regex/test_bgp_asdot_regex.py b/tests/topotests/bgp_asdot_regex/test_bgp_asdot_regex.py
new file mode 100644 (file)
index 0000000..5d5f165
--- /dev/null
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+
+#
+# test_bgp_asdot_regex.py
+# Part of Topotests
+#
+# Copyright 2022 6WIND S.A.
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+test_bgp_asdot_regex.py:
+
+Test how regex applies when asnotation to forge bgp config is based on dot or not.
+"""
+
+import os
+import sys
+import json
+import pytest
+from functools import partial
+
+# add after imports, before defining classes or functions:
+pytestmark = [pytest.mark.bgpd]
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topolog import logger
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    for routern in range(1, 3):
+        tgen.add_router("r{}".format(routern))
+
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["r1"])
+    switch.add_link(tgen.gears["r2"])
+
+
+def setup_module(mod):
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    router_list = tgen.routers()
+
+    for i, (rname, router) in enumerate(router_list.items(), 1):
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_asdot_regex():
+    tgen = get_topogen()
+
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    router1 = tgen.gears["r1"]
+    router2 = tgen.gears["r2"]
+
+    def _bgp_converge(router):
+        output = json.loads(router.vtysh_cmd("show ip bgp neighbor 192.168.255.2 json"))
+        expected = {
+            "192.168.255.2": {
+                "bgpState": "Established",
+                "addressFamilyInfo": {"ipv4Unicast": {"acceptedPrefixCounter": 1}},
+            }
+        }
+        return topotest.json_cmp(output, expected)
+
+    logger.info("Check if neighbor sessions are up in {}".format(router1.name))
+    test_func = partial(_bgp_converge, router1)
+    success, result = topotest.run_and_expect(test_func, None, count=15, wait=0.5)
+    assert result is None, 'Failed to see BGP convergence in "{}"'.format(router1.name)
+
+    logger.info("BGP neighbor session is up in {}".format(router1.name))
+
+    logger.info("waiting for bgp peers exchanging UPDATES")
+
+    for router in tgen.routers().values():
+        ref_file = "{}/{}/show_bgp_ipv4.json".format(CWD, router.name)
+        expected = json.loads(open(ref_file).read())
+        test_func = partial(
+            topotest.router_json_cmp, router, "show bgp ipv4 unicast json", expected
+        )
+        _, res = topotest.run_and_expect(test_func, None, count=40, wait=2.5)
+        assertmsg = "{}: BGP UPDATE exchange failure".format(router.name)
+        assert res is None, assertmsg
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 14689d737818be8539d5fbe10d170b046c4b2f30..0f1a08308fd0592b2e08acd267629935e95957c9 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP UPDATE with AS-PATH attribute with value zero (0)
index 14e4d05c08354f0c98f1a09b59855609c45f5d5c..824498ef90aecf469d6a35b25e87de869cdc0f7e 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_auth.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_auth.py: Test BGP Md5 Authentication
index 5be07cf8a967af4dc0246e95de1a132875d13c16..566d391f7ab0ec7234db8489f5cbdf9c08ba10b2 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_auth.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_auth.py: Test BGP Md5 Authentication
index 2b37e80869eae89e6bc3901f3782d84f49a03691..0e9942a22725ea98a17fcb09b4dacd3768f6bf36 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_auth.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_auth.py: Test BGP Md5 Authentication
index 220f350d80d6417e0de51e35b0a4d7b23751b32d..99a8953b3fc316b6701d5a6a8f9e661feece1449 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_auth.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_auth.py: Test BGP Md5 Authentication
index 2b7a355483586ddbdd2750fc5bcc23ebc8722c16..dffef0eef70079c62d7c23596c3abdee74d211ad 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_auth.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_auth.py: Test BGP Md5 Authentication
index 42b9b8adb9ed673fc1c7d6a65562e187b8dd0480..c97fc5f0eb48ffd53e5ce735c047439f22dccee3 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP basic functionality:
index a9b43e234760f2aea6ef7a5e3ca607bc3d563ec3..0bc0306d7db75ee3e285eb59f691cf5fc83e36dc 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_bfd_down_cease_notification.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if Cease/BFD Down notification message is sent/received
index 4f8fc0d67a5ff06440ce911471ac88140c2b1377..16191911a9147b4a9d02a25eafff3ebf46ea5cee 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if 172.16.255.254/32 tagged with BLACKHOLE community is not
index a2904e6e1e114877b4a127159c14b77806f563ad..efc8f200a35ea0be3d4af9ccdb22266a840f5aaf 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_comm-list_delete.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_comm-list_delete.py:
index 1b8f73d2333344d91f4815b38ec547355ff3d50e..03fa8da9d4bc12a5c30125b2bb0298de709558a2 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if BGP community-list works as OR if multiple community entries specified,
index 1c1a5cdfe49234a0344ba2f3133e241551f9690b..f3e03a06af3b3cfd36350dfe465a7371a5bd353b 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test bgp community functionality:
index a93061740f87eaaad877fb998347424a59aed2fe..324f53f3a6d18957e1cbbc461b6213b829ab42ae 100644 (file)
@@ -1,30 +1,17 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test bgp community functionality:
 1. Verify that BGP well known communities work fine for
    eBGP and iBGP peers.
-   Well known communities tested: no-export, local-AS, internet
+   Well known communities tested: no-export, local-AS
 
 """
 
@@ -153,11 +140,11 @@ def teardown_module(mod):
 #####################################################
 
 
-def test_bgp_no_export_local_as_and_internet_communities_p0(request):
+def test_bgp_no_export_local_as_communities_p0(request):
     """
     Verify that BGP well known communities work fine for
     eBGP and iBGP peers.
-    Well known communities tested: no-export, local-AS, internet
+    Well known communities tested: no-export, local-AS
     """
 
     tc_name = request.node.name
@@ -183,7 +170,7 @@ def test_bgp_no_export_local_as_and_internet_communities_p0(request):
             tc_name, result
         )
 
-    for comm_type in ["no-export", "local-AS", "internet"]:
+    for comm_type in ["no-export", "local-AS"]:
 
         step("Create a route-map on R1 to set community as {}".format(comm_type))
 
@@ -271,45 +258,23 @@ def test_bgp_no_export_local_as_and_internet_communities_p0(request):
                 tc_name, result
             )
 
-            if comm_type == "internet":
-                step(
-                    "Verify that these prefixes, originated on R1, are"
-                    "received on both R2 and R3"
-                )
-
-                result = verify_rib(
-                    tgen,
-                    addr_type,
-                    "r3",
-                    input_dict_4,
-                    next_hop=topo["routers"]["r1"]["links"]["r3"][addr_type].split("/")[
-                        0
-                    ],
-                )
-                assert result is True, "Testcase {} : Failed \n Error: {}".format(
-                    tc_name, result
-                )
-            else:
-                step(
-                    "Verify that these prefixes, originated on R1, are not"
-                    "received on R3 but received on R2"
-                )
-
-                result = verify_rib(
-                    tgen,
-                    addr_type,
-                    "r3",
-                    input_dict_4,
-                    next_hop=topo["routers"]["r1"]["links"]["r3"][addr_type].split("/")[
-                        0
-                    ],
-                    expected=False,
-                )
-                assert result is not True, (
-                    "Testcase {} : Failed \n "
-                    "Expected: Routes are still present in rib of r3 \n "
-                    "Found: {}".format(tc_name, result)
-                )
+        step(
+            "Verify that these prefixes, originated on R1, are not"
+            "received on R3 but received on R2"
+        )
+        result = verify_rib(
+            tgen,
+            addr_type,
+            "r3",
+            input_dict_4,
+            next_hop=topo["routers"]["r1"]["links"]["r3"][addr_type].split("/")[0],
+            expected=False,
+        )
+        assert result is not True, (
+            "Testcase {} : Failed \n "
+            "Expected: Routes are still present in rib of r3 \n "
+            "Found: {}".format(tc_name, result)
+        )
 
         step("Remove route-map from redistribute static on R1")
         input_dict_2 = {
index 0b41dc7c6fe356456b4ceac4b1c732fa6c464b88..000ea6075b6c569f8c5aa29a567297d5602edfde 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP community alias is visible in CLI outputs
@@ -118,12 +105,16 @@ def test_bgp_community_alias():
         )
         expected = {
             "routes": {
-                "172.16.16.1/32": [
-                    {
-                        "community": {"string": "community-r2-1 65001:2"},
-                        "largeCommunity": {"string": "large-community-r2-1 65001:1:2"},
-                    }
-                ]
+                "172.16.16.1/32": {
+                    "paths": [
+                        {
+                            "community": {"string": "community-r2-1 65001:2"},
+                            "largeCommunity": {
+                                "string": "large-community-r2-1 65001:1:2"
+                            },
+                        }
+                    ]
+                }
             }
         }
         return topotest.json_cmp(output, expected)
index 31f033ae12f92b8ecebd514242c3c933226648a4..5ad15e064589f035dc2dfbac6abb86bd31ac6465 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 Reference: https://www.cmand.org/communityexploration
index 0e16b97e4a8def32c8f9c5646e659bf6f6853e7c..0128c883491699c560de3f78e49919edc60f0602 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_conditional_advertisement.py
@@ -7,20 +8,6 @@
 # Samsung R&D Institute India - Bangalore.
 # Madhurilatha Kuruganti
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test BGP conditional advertisement functionality.
index 591bac1682abca836540a13294e71a222b34a40a..e76307291e4adc0363941f9ceacd796352b47e30 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Conditionally advertise 172.16.255.2/32 to r1, only if 172.16.255.3/32
index 7a35a10852c5a54c3afa393fa2a7986b00726fac..57a8522020e74e7edbfe4e5c902babd85af1a9ce 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_confed1.py
 #
 # Copyright 2022 6WIND S.A.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND 6WIND DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 6WIND BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_confed1.py: Test the FRR BGP confederations with AS member
index eae2a7d59ec3956c652dfe680c7ddc2dede2a07b..a0014c72e64fe4f2e06b10e1623f7b90643810a2 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if `bgp default ipv4-unicast`, `bgp default ipv6-unicast`
index 4d7f436eac3f439e3c694fe70f26d4eccc19fe21..50c34d45fad7f7cf7692c65946c6a52795fdc1fc 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Following tests are covered.
 1. Verify default-originate route with default static and network command
index 814272374a8e7cb28ab5b1f8ae309e523da4cb26..6156968ded7d5f0f29196739ed5274d08a4302c5 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Following tests are covered.
 1. Verify BGP default-originate route with IBGP peer
index 8e6f9306335d0aec10f4bb49822fdba7441360c9..59f833b93c526bfe0edf7ff7e6f610623646bfd1 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Following tests are covered.
 5. Verify BGP  default originate route-map with OUT route-map
index 9e5250406b7ea8e8dfc89651a269ee01347c4368..eca41e3b9ea0c4c546d5461120fb717622b93614 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Following tests are covered.
 10. Verify default-originate route after BGP and FRR process restart
index fa5164fb7157fb31e9d084858c85b9497e76f0a0..4dedac5535d89752d553bb4daa4f92bb18475567 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 import os
 import sys
 import time
index 9e3a3b56605d28023f189cbad93f44394f60c87c..82c4e7e0ab5a7fba05e576f37f3aec616bdef330 100644 (file)
@@ -1,23 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
+#                       Shreenidhi A R <rshreenidhi@vmware.com>
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-# Shreenidhi A R <rshreenidhi@vmware.com>
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Following scenerios are covered.
 1. When there is change in route-map policy associated with default-originate, changes does not reflect.
diff --git a/tests/topotests/bgp_default_originate_withdraw/__init__.py b/tests/topotests/bgp_default_originate_withdraw/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_default_originate_withdraw/r1/bgpd.conf b/tests/topotests/bgp_default_originate_withdraw/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..6813b02
--- /dev/null
@@ -0,0 +1,12 @@
+router bgp 65001
+ no bgp ebgp-requires-policy
+ neighbor 192.168.1.2 remote-as external
+ neighbor 192.168.1.2 timers 1 3
+ neighbor 192.168.1.2 timers connect 1
+ neighbor 192.168.2.2 remote-as external
+ neighbor 192.168.2.2 timers 1 3
+ neighbor 192.168.2.2 timers connect 1
+ address-family ipv4
+  neighbor 192.168.1.2 default-originate
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_default_originate_withdraw/r1/zebra.conf b/tests/topotests/bgp_default_originate_withdraw/r1/zebra.conf
new file mode 100644 (file)
index 0000000..3692361
--- /dev/null
@@ -0,0 +1,7 @@
+!
+interface r1-eth0
+ ip address 192.168.1.1/24
+!
+interface r1-eth1
+ ip address 192.168.2.1/24
+!
diff --git a/tests/topotests/bgp_default_originate_withdraw/r2/bgpd.conf b/tests/topotests/bgp_default_originate_withdraw/r2/bgpd.conf
new file mode 100644 (file)
index 0000000..60e6236
--- /dev/null
@@ -0,0 +1,9 @@
+router bgp 65002
+ no bgp ebgp-requires-policy
+ neighbor 192.168.1.1 remote-as external
+ neighbor 192.168.1.1 timers 1 3
+ neighbor 192.168.1.1 timers connect 1
+ address-family ipv4 unicast
+  network 192.168.2.0/24
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_default_originate_withdraw/r2/zebra.conf b/tests/topotests/bgp_default_originate_withdraw/r2/zebra.conf
new file mode 100644 (file)
index 0000000..0c95656
--- /dev/null
@@ -0,0 +1,4 @@
+!
+interface r2-eth0
+ ip address 192.168.1.2/24
+!
diff --git a/tests/topotests/bgp_default_originate_withdraw/r3/bgpd.conf b/tests/topotests/bgp_default_originate_withdraw/r3/bgpd.conf
new file mode 100644 (file)
index 0000000..547cf86
--- /dev/null
@@ -0,0 +1,9 @@
+router bgp 65003
+ no bgp ebgp-requires-policy
+ neighbor 192.168.2.1 remote-as external
+ neighbor 192.168.2.1 timers 1 3
+ neighbor 192.168.2.1 timers connect 1
+ address-family ipv4 unicast
+  network 0.0.0.0/0
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_default_originate_withdraw/r3/zebra.conf b/tests/topotests/bgp_default_originate_withdraw/r3/zebra.conf
new file mode 100644 (file)
index 0000000..7ccdcfd
--- /dev/null
@@ -0,0 +1,5 @@
+!
+interface r3-eth0
+ ip address 192.168.2.2/24
+!
+ip route 0.0.0.0/0 Null0
diff --git a/tests/topotests/bgp_default_originate_withdraw/test_bgp_default_originate_withdraw.py b/tests/topotests/bgp_default_originate_withdraw/test_bgp_default_originate_withdraw.py
new file mode 100644 (file)
index 0000000..e25f85a
--- /dev/null
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+# SPDX-License-Identifier: ISC
+
+#
+# Copyright (c) 2022 by
+# Donatas Abraitis <donatas@opensourcerouting.org>
+#
+
+"""
+Check if bgpd do not crash if we use default-originate while
+received a default route from the neighbor as well. 0.0.0.0/0
+MUST be kept in RIB even if we remove default-originate from
+the neighbor.
+"""
+
+import os
+import sys
+import json
+import pytest
+import functools
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.common_config import step
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    for routern in range(1, 4):
+        tgen.add_router("r{}".format(routern))
+
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["r1"])
+    switch.add_link(tgen.gears["r2"])
+
+    switch = tgen.add_switch("s2")
+    switch.add_link(tgen.gears["r1"])
+    switch.add_link(tgen.gears["r3"])
+
+
+def setup_module(mod):
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    router_list = tgen.routers()
+
+    for i, (rname, router) in enumerate(router_list.items(), 1):
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_default_originate_with_default_received():
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    r1 = tgen.gears["r1"]
+
+    def _bgp_default_received_from_r3():
+        output = json.loads(r1.vtysh_cmd("show bgp ipv4 unicast 0.0.0.0/0 json"))
+        expected = {
+            "paths": [
+                {
+                    "nexthops": [
+                        {
+                            "hostname": "r3",
+                            "ip": "192.168.2.2",
+                        }
+                    ],
+                }
+            ],
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_default_received_from_r3)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Cannot see default route received from r3"
+
+    def _bgp_advertised_default_originate_to_r2():
+        output = json.loads(
+            r1.vtysh_cmd(
+                "show bgp ipv4 unicast neighbors 192.168.1.2 advertised-routes json"
+            )
+        )
+        expected = {
+            "bgpOriginatingDefaultNetwork": "0.0.0.0/0",
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_advertised_default_originate_to_r2)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Cannot see default-originate route advertised to r2"
+
+    step("Disable default-originate for r2")
+    r1.vtysh_cmd(
+        """
+    configure
+        router bgp
+            address-family ipv4 unicast
+                no neighbor 192.168.1.2 default-originate
+    """
+    )
+
+    def _bgp_advertised_default_from_r3_to_r2():
+        output = json.loads(
+            r1.vtysh_cmd(
+                "show bgp ipv4 unicast neighbors 192.168.1.2 advertised-routes json"
+            )
+        )
+        expected = {
+            "bgpOriginatingDefaultNetwork": None,
+            "advertisedRoutes": {
+                "0.0.0.0/0": {
+                    "valid": True,
+                }
+            },
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_advertised_default_from_r3_to_r2)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Cannot see default route advertised to r2"
+
+    step("Enable default-originate for r2")
+    r1.vtysh_cmd(
+        """
+    configure
+        router bgp
+            address-family ipv4 unicast
+                neighbor 192.168.1.2 default-originate
+    do clear ip bgp *
+    """
+    )
+
+    step("Check if default-originate route advertised to r2")
+    test_func = functools.partial(_bgp_advertised_default_originate_to_r2)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Cannot see default-originate route advertised to r2"
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index b2d530b423fe3b0726b4a8302a68a379864cbbaf..2463b0546994188ea4dee250e83de81380d06b6c 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2019-2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if default-originate works without route-map.
index 11eaa7b3734646c63ff35b8a98ff44bbf5682321..9dcb5a1eef320c6c8b3a222686c7f9e8365b5588 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2019-2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if default-originate works with ONLY match operations.
index 99528f675eb50d1eec5dd85b650525a81889b434..965d348bd70366d6f624103de7001ad64bc9ad88 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if default-originate works with conditional match.
index c890b0d7dcf9ca6681d0509a9cabbd45397df01c..f94620b2c97751df1f556174f36392e200e5a55a 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if default-originate works with match operations.
index cc2243a1c47db18d001a1ecc0c53224f0291bc6c..3bd900bda03762d97dd3f575dbb1c56effd7a283 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2019-2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if default-originate works with ONLY set operations.
index ed88d5df22b0c8f9e150375179ae3c028d7fd235..70562ce31f3b7b71bba374fb7a1eef90a7986811 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if AddPath RX direction is not negotiated via AddPath capability.
index 90c3d22240e6ff94c3dad705564bdf39535232fd..0bd3d2814bb0f7bd36cdc8aefcb8a5e8ae5618ec 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import time
index 559dc93aa0e9e78f864c34993d1076f8cc5ab3d3..bf30f2e5667e3e0e0dec4619ef91056fd4c97ff7 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import time
index a7040dbe8c255f3369f3f7610b2f9c0fa247f1f8..2ca50aa56ead36dba08e1c0dca23a246f88ed777 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_distance_change.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_distance_change.py:
index 211472e57d267fd3d323b06039a99aa745e93656..ab71f87a04bd1c291b58608fd4fb2ef05e270584 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP connection is established if at least one peer
index 0fc9d9ddce651af45d735bade7c349afd4dcab7d..34f7dc8cd4b95c8e7b460fa248516c5d2ab245da 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 https://tools.ietf.org/html/rfc4271
index e6fe22bf0e14c0b53b1a9a7376bb1c452c608bc3..6e3b2859c43114c77d93953d15450e7bee93d745 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_ebgp_requires_policy.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_ebgp_requires_policy.py:
index 96e4bf6ed39e812979db15d0806a8b48f49cdf5d..97751ec8cfbea2cdb9c097d2ea63cddc7ffa6075 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python2
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_ecmp_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_ecmp_topo1.py: Test BGP topology with ECMP (Equal Cost MultiPath).
index 8fd0120dd82172a9061d3625bcdd5a2d625e6127..8362776b7b0dbb0239fd4228139166fbe5f272e5 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index 185a086838683cd04f3d0839e3ae14a38c8d192c..b347042dcf32008d3e151b17a5884ee6012cbe0f 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index b7f6b7aca7f0351d3180451046f71570276fdf13..366cf3d4a5f520e79b8d177a0a059b84e1bebd48 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index b0e438106c33a493235fd5ed2c7891635c79d411..0bde5d5a9f529f928e1ab11fdf1247b3dd71af09 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_evpn_mh.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Anuradha Karuppiah
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_evpn_mh.py: Testing EVPN multihoming
index 86a87516216082c955fe2c202ae40d69719e9dcc..10662692927d8bb1b9c8404b9a9c4b0f7a63d518 100755 (executable)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_evpn_overlay_index_gateway.py: Test EVPN gateway IP overlay index functionality
index 3e2fb2b6e096c2ebf43f1d397f96724ce74f00d2..7e4bcc8adaeac12b58e29257384c2948354b6c72 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_evpn.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2019 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_evpn.py: Test the FRR BGP daemon with BGP IPv6 interface
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/bgpd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/bgpd.conf
new file mode 100644 (file)
index 0000000..cdf4cb4
--- /dev/null
@@ -0,0 +1 @@
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/ospfd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/ospfd.conf
new file mode 100644 (file)
index 0000000..2db7edb
--- /dev/null
@@ -0,0 +1,13 @@
+!
+router ospf
+ network 10.20.0.0/16 area 0
+ network 10.20.20.20/32 area 0
+!
+int P1-eth0
+ ip ospf hello-interval 2
+ ip ospf dead-interval 10
+!
+int P1-eth1
+ ip ospf hello-interval 2
+ ip ospf dead-interval 10
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/zebra.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/P1/zebra.conf
new file mode 100644 (file)
index 0000000..95b5da8
--- /dev/null
@@ -0,0 +1,7 @@
+!
+interface lo
+ ip address 10.20.20.20/32
+interface P1-eth0
+ ip address 10.20.1.2/24
+interface P1-eth1
+ ip address 10.20.2.2/24
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/bgpd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/bgpd.conf
new file mode 100644 (file)
index 0000000..39ac8ca
--- /dev/null
@@ -0,0 +1,19 @@
+router bgp 65000
+ timers 3 9
+ bgp router-id 10.10.10.10
+ no bgp default ipv4-unicast
+ neighbor 10.30.30.30 remote-as 65000
+ neighbor 10.30.30.30 update-source lo
+ neighbor 10.30.30.30 timers 3 10
+ address-family l2vpn evpn
+  neighbor 10.30.30.30 activate
+  advertise-all-vni
+  advertise-svi-ip
+!
+router bgp 65000 vrf vrf-red
+ !
+ address-family l2vpn evpn
+  route-target import *:300
+  route-target import auto
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/evpn.vni.json b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/evpn.vni.json
new file mode 100644 (file)
index 0000000..98ae92c
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "vni":101,
+  "type":"L2",
+  "vrf":"default",
+  "vxlanInterface":"vxlan0",
+  "vtepIp":"10.10.10.10",
+  "mcastGroup":"0.0.0.0",
+  "advertiseGatewayMacip":"No",
+  "remoteVteps":[
+    {
+      "ip":"10.30.30.30",
+      "flood":"HER"
+    }
+  ]
+}
+
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/ospfd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/ospfd.conf
new file mode 100644 (file)
index 0000000..f1c2b42
--- /dev/null
@@ -0,0 +1,9 @@
+!
+router ospf
+ network 10.20.0.0/16 area 0
+ network 10.10.10.10/32 area 0
+!
+int PE1-eth1
+ ip ospf hello-interval 2
+ ip ospf dead-interval 10
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/zebra.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE1/zebra.conf
new file mode 100644 (file)
index 0000000..8c6cf3e
--- /dev/null
@@ -0,0 +1,13 @@
+!
+log file zebra.log
+!
+vrf vrf-red
+ vni 100
+ exit-vrf
+!
+!
+interface lo
+ ip address 10.10.10.10/32
+interface PE1-eth1
+ ip address 10.20.1.1/24
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/bgpd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/bgpd.conf
new file mode 100644 (file)
index 0000000..10809da
--- /dev/null
@@ -0,0 +1,24 @@
+!
+router bgp 65000
+ timers bgp 3 9
+ bgp router-id 10.30.30.30
+ no bgp default ipv4-unicast
+ neighbor 10.10.10.10 remote-as 65000
+ neighbor 10.10.10.10 update-source lo
+ neighbor 10.10.10.10 timers 3 10
+ !
+ address-family l2vpn evpn
+  neighbor 10.10.10.10 activate
+  advertise-all-vni
+  advertise-svi-ip
+!
+router bgp 65000 vrf vrf-blue
+ !
+ address-family ipv4 unicast
+  redistribute static
+ exit-address-family
+ !
+ address-family l2vpn evpn
+  advertise ipv4 unicast
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/evpn.vni.json b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/evpn.vni.json
new file mode 100644 (file)
index 0000000..5c05978
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "vni":101,
+  "type":"L2",
+  "vrf":"default",
+  "vxlanInterface":"vxlan0",
+  "vtepIp":"10.30.30.30",
+  "mcastGroup":"0.0.0.0",
+  "advertiseGatewayMacip":"No",
+  "remoteVteps":[
+    {
+      "ip":"10.10.10.10",
+      "flood":"HER"
+    }
+  ]
+}
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/ospfd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/ospfd.conf
new file mode 100644 (file)
index 0000000..065c993
--- /dev/null
@@ -0,0 +1,9 @@
+!
+router ospf
+ network 10.20.0.0/16 area 0
+ network 10.30.30.30/32 area 0
+!
+int PE2-eth0
+ ip ospf hello-interval 2
+ ip ospf dead-interval 10
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/zebra.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/PE2/zebra.conf
new file mode 100644 (file)
index 0000000..cee4355
--- /dev/null
@@ -0,0 +1,17 @@
+vrf vrf-blue
+ vni 300
+ exit-vrf
+!
+vrf vrf-red
+ vni 100
+ exit-vrf
+!
+interface lo
+ ip address 10.30.30.30/32
+interface PE2-eth0
+ ip address 10.20.2.3/24
+!
+interface vrf-blue
+ ip address 30.0.0.3/24
+!
+ip route 4.4.4.1/32 30.0.0.100 vrf vrf-blue
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/__init__.py b/tests/topotests/bgp_evpn_vxlan_svd_topo1/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/bgpd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/bgpd.conf
new file mode 100644 (file)
index 0000000..cdf4cb4
--- /dev/null
@@ -0,0 +1 @@
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/ospfd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/ospfd.conf
new file mode 100644 (file)
index 0000000..cdf4cb4
--- /dev/null
@@ -0,0 +1 @@
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/zebra.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host1/zebra.conf
new file mode 100644 (file)
index 0000000..91fae9e
--- /dev/null
@@ -0,0 +1,3 @@
+!
+int host1-eth0
+ ip address 10.10.1.55/24
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/bgpd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/bgpd.conf
new file mode 100644 (file)
index 0000000..cdf4cb4
--- /dev/null
@@ -0,0 +1 @@
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/ospfd.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/ospfd.conf
new file mode 100644 (file)
index 0000000..cdf4cb4
--- /dev/null
@@ -0,0 +1 @@
+!
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/zebra.conf b/tests/topotests/bgp_evpn_vxlan_svd_topo1/host2/zebra.conf
new file mode 100644 (file)
index 0000000..df9adeb
--- /dev/null
@@ -0,0 +1,3 @@
+!
+interface host2-eth0
+ ip address 10.10.1.56/24
diff --git a/tests/topotests/bgp_evpn_vxlan_svd_topo1/test_bgp_evpn_vxlan_svd.py b/tests/topotests/bgp_evpn_vxlan_svd_topo1/test_bgp_evpn_vxlan_svd.py
new file mode 100755 (executable)
index 0000000..f8af210
--- /dev/null
@@ -0,0 +1,534 @@
+#!/usr/bin/env python
+
+#
+# test_bgp_evpn_vxlan_svd.py
+# Part of NetDEF Topology Tests
+#
+# Copyright (c) 2020 NVIDIA Corporation
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+test_bgp_evpn_vxlan.py: Test VXLAN EVPN MAC and route signalling over BGP
+using Single Vxlan Device Configurtion
+"""
+
+import os
+import sys
+import json
+from functools import partial
+from time import sleep
+import pytest
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.topolog import logger
+from lib.common_config import required_linux_kernel_version
+
+# Required to instantiate the topology builder class.
+
+pytestmark = [pytest.mark.bgpd, pytest.mark.ospfd]
+
+
+def build_topo(tgen):
+    "Build function"
+
+    # This function only purpose is to define allocation and relationship
+    # between routers, switches and hosts.
+    #
+    #
+    # Create routers
+    tgen.add_router("P1")
+    tgen.add_router("PE1")
+    tgen.add_router("PE2")
+    tgen.add_router("host1")
+    tgen.add_router("host2")
+
+    # Host1-PE1
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["host1"])
+    switch.add_link(tgen.gears["PE1"])
+
+    # PE1-P1
+    switch = tgen.add_switch("s2")
+    switch.add_link(tgen.gears["PE1"])
+    switch.add_link(tgen.gears["P1"])
+
+    # P1-PE2
+    switch = tgen.add_switch("s3")
+    switch.add_link(tgen.gears["P1"])
+    switch.add_link(tgen.gears["PE2"])
+
+    # PE2-host2
+    switch = tgen.add_switch("s4")
+    switch.add_link(tgen.gears["PE2"])
+    switch.add_link(tgen.gears["host2"])
+
+def setup_pe_router(tgen, pe_name, tunnel_local_ip, svi_ip, intf):
+    pe = tgen.gears[pe_name]
+
+    # configure vlan aware bridge
+    pe.run("ip link add name bridge type bridge stp_state 0")
+    pe.run("ip link set dev bridge type bridge vlan_filtering 1")
+    pe.run("bridge vlan add vid 1 dev bridge self")
+    pe.run("ip link set dev bridge up")
+
+    # setup svi
+    pe.run("ip link add link bridge name vlan1 type vlan id 1 protocol 802.1q")
+    pe.run("ip link set dev vlan1 up")
+    pe.run("ip addr add {0} dev vlan1".format(svi_ip))
+    pe.run("/sbin/sysctl net.ipv4.conf.vlan1.arp_accept=1")
+
+    # setup single vxlan device
+    pe.run(
+        "ip link add dev vxlan0 type vxlan dstport 4789 local {0} nolearning external".format(tunnel_local_ip)
+    )
+    pe.run("ip link set dev vxlan0 master bridge")
+    pe.run("bridge link set dev vxlan0 vlan_tunnel on")
+    pe.run("bridge link set dev vxlan0 neigh_suppress on")
+    pe.run("bridge link set dev vxlan0 learning off")
+    pe.run("bridge vlan add dev vxlan0 vid 1")
+    pe.run("bridge vlan add dev vxlan0 vid 1 tunnel_info id 101")
+    pe.run("ip link set up dev vxlan0")
+
+    # setup PE interface
+    pe.run("ip link set dev {0}-{1} master bridge".format(pe_name, intf))
+    pe.run("bridge vlan del vid 1 dev {0}-{1}".format(pe_name, intf))
+    pe.run("bridge vlan del vid 1 untagged pvid dev {0}-{1}".format(pe_name, intf))
+    pe.run("bridge vlan add vid 1 dev {0}-{1}".format(pe_name, intf))
+    pe.run("bridge vlan add vid 1 pvid untagged dev {0}-{1}".format(pe_name, intf))
+
+    # l3vni 100
+    pe.run("ip link add vrf-red type vrf table 1400")
+    pe.run("ip link add link bridge name vlan100 type vlan id 100 protocol 802.1q")
+    pe.run("ip link set dev vlan100 master vrf-blue")
+    pe.run("ip link set dev vlan100 up")
+    pe.run("bridge vlan add vid 100 dev bridge self")
+    pe.run("bridge vlan add dev vxlan0 vid 100")
+    pe.run("bridge vlan add dev vxlan0 vid 100 tunnel_info id 100")
+
+    # add a vrf for testing DVNI
+    if pe_name == "PE2":
+        pe.run("ip link add vrf-blue type vrf table 2400")
+        pe.run("ip link add link bridge name vlan300 type vlan id 300 protocol 802.1q")
+        pe.run("ip link set dev vlan300 master vrf-blue")
+        pe.run("ip link set dev vlan300 up")
+        pe.run("bridge vlan add vid 300 dev bridge self")
+        pe.run("bridge vlan add dev vxlan0 vid 300")
+        pe.run("bridge vlan add dev vxlan0 vid 300 tunnel_info id 300")
+
+def setup_p_router(tgen, p_name):
+    p1 = tgen.gears[p_name]
+    p1.run("sysctl -w net.ipv4.ip_forward=1")
+
+def setup_module(mod):
+    "Sets up the pytest environment"
+
+    result = required_linux_kernel_version("5.7")
+    if result is not True:
+        pytest.skip("Kernel requirements are not met, kernel version should be >= 5.7")
+
+    # This function initiates the topology build with Topogen...
+    tgen = Topogen(build_topo, mod.__name__)
+
+    # ... and here it calls Mininet initialization functions.
+    tgen.start_topology()
+
+    setup_pe_router(tgen, "PE1", "10.10.10.10", "10.10.1.1/24", "eth0")
+    setup_pe_router(tgen, "PE2", "10.30.30.30", "10.10.1.3/24", "eth1")
+    setup_p_router(tgen, "P1")
+
+    # This is a sample of configuration loading.
+    router_list = tgen.routers()
+
+    # For all registred routers, load the zebra configuration file
+    for rname, router in router_list.items():
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    # After loading the configurations, this function loads configured daemons.
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    "Teardown the pytest environment"
+    tgen = get_topogen()
+
+    #tgen.mininet_cli()
+    # This function tears down the whole topology.
+    tgen.stop_topology()
+
+
+def show_vni_json_elide_ifindex(pe, vni, expected):
+    output_json = pe.vtysh_cmd("show evpn vni {} json".format(vni), isjson=True)
+
+    if "ifindex" in output_json:
+        output_json.pop("ifindex")
+
+    return topotest.json_cmp(output_json, expected)
+
+
+def check_vni_macs_present(tgen, router, vni, maclist):
+    result = router.vtysh_cmd("show evpn mac vni {} json".format(vni), isjson=True)
+    for rname, ifname in maclist:
+        m = tgen.net.macs[(rname, ifname)]
+        if m not in result["macs"]:
+            return "MAC ({}) for interface {} on {} missing on {} from {}".format(
+                m, ifname, rname, router.name, json.dumps(result, indent=4)
+            )
+    return None
+
+def check_flood_entry_present(pe, vni, vtep):
+    if not topotest.iproute2_is_fdb_get_capable():
+        return None
+
+    output = pe.run("bridge fdb get 00:00:00:00:00:00 dev vxlan0 vni {} self".format(vni))
+
+    if str(vtep) not in output:
+        return output
+
+    return None
+
+def test_pe1_converge_evpn():
+    "Wait for protocol convergence"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    pe1 = tgen.gears["PE1"]
+    json_file = "{}/{}/evpn.vni.json".format(CWD, pe1.name)
+    expected = json.loads(open(json_file).read())
+
+    test_func = partial(show_vni_json_elide_ifindex, pe1, 101, expected)
+    _, result = topotest.run_and_expect(test_func, None, count=45, wait=1)
+    assertmsg = '"{}" JSON output mismatches'.format(pe1.name)
+
+    test_func = partial(
+        check_vni_macs_present,
+        tgen,
+        pe1,
+        101,
+        (("host1", "host1-eth0"), ("host2", "host2-eth0")),
+    )
+    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+    if result:
+        logger.warning("%s", result)
+        assert None, '"{}" missing expected MACs'.format(pe1.name)
+
+    vtep = "10.30.30.30"
+    test_func = partial(check_flood_entry_present, pe1, 101, vtep)
+    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+    assertmsg = '"{}" Flood FDB Entry for VTEP {} not found'.format(pe1.name, vtep)
+    assert result is None, assertmsg
+
+def test_pe2_converge_evpn():
+    "Wait for protocol convergence"
+
+    tgen = get_topogen()
+#Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    pe2 = tgen.gears["PE2"]
+    json_file = "{}/{}/evpn.vni.json".format(CWD, pe2.name)
+    expected = json.loads(open(json_file).read())
+
+    test_func = partial(show_vni_json_elide_ifindex, pe2, 101, expected)
+    _, result = topotest.run_and_expect(test_func, None, count=45, wait=1)
+    assertmsg = '"{}" JSON output mismatches'.format(pe2.name)
+    assert result is None, assertmsg
+
+    test_func = partial(
+        check_vni_macs_present,
+        tgen,
+        pe2,
+        101,
+        (("host1", "host1-eth0"), ("host2", "host2-eth0")),
+    )
+    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+    if result:
+        logger.warning("%s", result)
+        assert None, '"{}" missing expected MACs'.format(pe2.name)
+
+    vtep = "10.10.10.10"
+    test_func = partial(check_flood_entry_present, pe2, 101, vtep)
+    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+    assertmsg = '"{}" Flood FDB Entry for VTEP {} not found'.format(pe2.name, vtep)
+    assert result is None, assertmsg
+
+def mac_learn_test(host, local):
+    "check the host MAC gets learned by the VNI"
+
+    host_output = host.vtysh_cmd("show interface {}-eth0".format(host.name))
+    int_lines = host_output.splitlines()
+    for line in int_lines:
+        line_items = line.split(": ")
+        if "HWaddr" in line_items[0]:
+            mac = line_items[1]
+            break
+
+    mac_output = local.vtysh_cmd("show evpn mac vni 101 mac {} json".format(mac))
+    mac_output_json = json.loads(mac_output)
+    assertmsg = "Local MAC output does not match interface mac {}".format(mac)
+    assert mac_output_json[mac]["type"] == "local", assertmsg
+
+
+def mac_test_local_remote(local, remote):
+    "test MAC transfer between local and remote"
+
+    local_output = local.vtysh_cmd("show evpn mac vni all json")
+    remote_output = remote.vtysh_cmd("show evpn mac vni all json")
+    local_output_vni = local.vtysh_cmd("show evpn vni detail json")
+    local_output_json = json.loads(local_output)
+    remote_output_json = json.loads(remote_output)
+    local_output_vni_json = json.loads(local_output_vni)
+
+    for vni in local_output_json:
+        if vni not in remote_output_json:
+            continue
+
+        mac_list = local_output_json[vni]["macs"]
+        for mac in mac_list:
+            if mac_list[mac]["type"] == "local" and mac_list[mac]["intf"] != "br101":
+                assertmsg = "JSON output mismatches local: {} remote: {}".format(
+                    local_output_vni_json[0]["vtepIp"],
+                    remote_output_json[vni]["macs"][mac]["remoteVtep"],
+                )
+                assert (
+                    remote_output_json[vni]["macs"][mac]["remoteVtep"]
+                    == local_output_vni_json[0]["vtepIp"]
+                ), assertmsg
+
+
+def test_learning_pe1():
+    "test MAC learning on PE1"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    host1 = tgen.gears["host1"]
+    pe1 = tgen.gears["PE1"]
+    mac_learn_test(host1, pe1)
+
+
+def test_learning_pe2():
+    "test MAC learning on PE2"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    host2 = tgen.gears["host2"]
+    pe2 = tgen.gears["PE2"]
+    mac_learn_test(host2, pe2)
+
+
+def test_local_remote_mac_pe1():
+    "Test MAC transfer PE1 local and PE2 remote"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    pe1 = tgen.gears["PE1"]
+    pe2 = tgen.gears["PE2"]
+    mac_test_local_remote(pe1, pe2)
+
+
+def test_local_remote_mac_pe2():
+    "Test MAC transfer PE2 local and PE1 remote"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    pe1 = tgen.gears["PE1"]
+    pe2 = tgen.gears["PE2"]
+    mac_test_local_remote(pe2, pe1)
+
+
+def ip_learn_test(tgen, host, local, remote, ip_addr):
+    "check the host IP gets learned by the VNI"
+    host_output = host.vtysh_cmd("show interface {}-eth0".format(host.name))
+    int_lines = host_output.splitlines()
+    for line in int_lines:
+        line_items = line.split(": ")
+        if "HWaddr" in line_items[0]:
+            mac = line_items[1]
+            break
+    #print(host_output)
+
+    # check we have a local association between the MAC and IP
+    local_output = local.vtysh_cmd("show evpn mac vni 101 mac {} json".format(mac))
+    #print(local_output)
+    local_output_json = json.loads(local_output)
+    mac_type = local_output_json[mac]["type"]
+    assertmsg = "Failed to learn local IP address on host {}".format(host.name)
+    assert local_output_json[mac]["neighbors"] != "none", assertmsg
+    learned_ip = local_output_json[mac]["neighbors"]["active"][0]
+
+    assertmsg = "local learned mac wrong type: {} ".format(mac_type)
+    assert mac_type == "local", assertmsg
+
+    assertmsg = (
+        "learned address mismatch with configured address host: {} learned: {}".format(
+            ip_addr, learned_ip
+        )
+    )
+    assert ip_addr == learned_ip, assertmsg
+
+    # now lets check the remote
+    count = 0
+    converged = False
+    while count < 30:
+        remote_output = remote.vtysh_cmd(
+            "show evpn mac vni 101 mac {} json".format(mac)
+        )
+        #print(remote_output)
+        remote_output_json = json.loads(remote_output)
+        type = remote_output_json[mac]["type"]
+        if not remote_output_json[mac]["neighbors"] == "none":
+            # due to a kernel quirk, learned IPs can be inactive
+            if (
+                remote_output_json[mac]["neighbors"]["active"]
+                or remote_output_json[mac]["neighbors"]["inactive"]
+            ):
+                converged = True
+                break
+        count += 1
+        sleep(1)
+
+    #print("tries: {}".format(count))
+    assertmsg = "{} remote learned mac no address: {} ".format(host.name, mac)
+    # some debug for this failure
+    if not converged == True:
+        log_output = remote.run("cat zebra.log")
+        #print(log_output)
+
+    assert converged == True, assertmsg
+    if remote_output_json[mac]["neighbors"]["active"]:
+        learned_ip = remote_output_json[mac]["neighbors"]["active"][0]
+    else:
+        learned_ip = remote_output_json[mac]["neighbors"]["inactive"][0]
+    assertmsg = "remote learned mac wrong type: {} ".format(type)
+    assert type == "remote", assertmsg
+
+    assertmsg = "remote learned address mismatch with configured address host: {} learned: {}".format(
+        ip_addr, learned_ip
+    )
+    assert ip_addr == learned_ip, assertmsg
+
+
+def test_ip_pe1_learn():
+    "run the IP learn test for PE1"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    host1 = tgen.gears["host1"]
+    pe1 = tgen.gears["PE1"]
+    pe2 = tgen.gears["PE2"]
+    pe2.vtysh_cmd("debug zebra vxlan")
+    pe2.vtysh_cmd("debug zebra kernel")
+    # lets populate that arp cache
+    host1.run("ping -c1 10.10.1.1")
+    ip_learn_test(tgen, host1, pe1, pe2, "10.10.1.55")
+    # tgen.mininet_cli()
+
+
+def test_ip_pe2_learn():
+    "run the IP learn test for PE2"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    host2 = tgen.gears["host2"]
+    pe1 = tgen.gears["PE1"]
+    pe2 = tgen.gears["PE2"]
+    pe1.vtysh_cmd("debug zebra vxlan")
+    pe1.vtysh_cmd("debug zebra kernel")
+    # lets populate that arp cache
+    host2.run("ping -c1 10.10.1.3")
+    ip_learn_test(tgen, host2, pe2, pe1, "10.10.1.56")
+    # tgen.mininet_cli()
+
+def show_dvni_route(pe, vni, prefix, vrf):
+    output = pe.vtysh_cmd("show ip route vrf {} {}".format(vrf, prefix))
+
+    if str(vni) not in output:
+        return output
+
+    output = pe.run("ip route show vrf {} {}".format(vrf, prefix))
+
+    if str(vni) not in output:
+        return output
+
+    return None
+
+def test_dvni():
+    "test Downstream VNI works as expected importing into PE1"
+
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    pe1 = tgen.gears["PE1"]
+
+    prefix = "4.4.4.1/32"
+    test_func = partial(show_dvni_route, pe1, 300, prefix, "vrf-red")
+    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+    assertmsg = '"{}" DVNI route {} not found'.format(pe1.name, prefix)
+    assert result is None, assertmsg
+    #tgen.mininet_cli()
+
+
+def test_memory_leak():
+    "Run the memory leak test and report results."
+    tgen = get_topogen()
+    if not tgen.is_memleak_enabled():
+        pytest.skip("Memory leak test/report is disabled")
+
+    tgen.report_memory_leaks()
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index ce7915c4af69417a9976f067466a4481ea1b7270..eb8668b7befde0a03acb80ddbdf7357982c18834 100644 (file)
@@ -1,13 +1,17 @@
 {
   "vni":101,
   "type":"L2",
-  "vrf":"default",
+  "tenantVrf":"default",
   "vxlanInterface":"vxlan101",
   "vtepIp":"10.10.10.10",
   "mcastGroup":"0.0.0.0",
   "advertiseGatewayMacip":"No",
-  "numRemoteVteps":[
-    "10.30.30.30"
+  "numRemoteVteps":1,
+  "remoteVteps":[
+      {
+        "ip":"10.30.30.30",
+        "flood":"HER"
+      }
   ]
 }
 
index 6c692026429d4e4bb1a4adf7c03a34c9e008a9fe..befb4160742e3927a2bf2cec089ba940279d038b 100644 (file)
@@ -1,12 +1,16 @@
 {
   "vni":101,
   "type":"L2",
-  "vrf":"default",
+  "tenantVrf":"default",
   "vxlanInterface":"vxlan101",
   "vtepIp":"10.30.30.30",
   "mcastGroup":"0.0.0.0",
   "advertiseGatewayMacip":"No",
-  "numRemoteVteps":[
-    "10.10.10.10"
-  ]
+  "numRemoteVteps":1,
+  "remoteVteps":[
+      {
+        "ip":"10.10.10.10",
+        "flood":"HER"
+      }
+   ]
 }
index 5d0a326afb6166b94b5b4cfee3914f86a0471472..48b79ab5eed6f2566a93917c6c67a9db9cd088e8 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_evpn_vxlan.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_evpn_vxlan.py: Test VXLAN EVPN MAC a route signalling over BGP.
@@ -144,7 +131,6 @@ def teardown_module(mod):
 
 def show_vni_json_elide_ifindex(pe, vni, expected):
     output_json = pe.vtysh_cmd("show evpn vni {} json".format(vni), isjson=True)
-
     if "ifindex" in output_json:
         output_json.pop("ifindex")
 
index e677dc6ff6540eefe6775fafef94de632daf5ea5..eef122b369a02198664154557a3146ff6148d0e1 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if Extended Optional Parameters Length encoding format works
index 0f501f708941d9c0587b9348f51376595a6e3fa7..c0a5a1905d747e4235b30f5fd0d816fdf34d33b2 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_features.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_features.py: Test various BGP features.
index 682ff4ceecf8dda102c8a57c1475e9d2cab7f510..fd675dc8aeb523a55206cdf41bafeb53bb65bb5d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_flowspec_topo.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2019 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_flowspec_topo.py: Test BGP topology with Flowspec EBGP peering
index deca4bcfd7d690d4f1e7abab45fd1bcc800c3a1a..5e2b2f37b234ca0a77da1c890d579589b57569f8 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index a92fde2d0dca81d4a226bec428f90b2efc3bd728..13c5ba538c4a8c492e6ee412f38c7a82a4619d3c 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index b0166033df6a39df643003f11cc579ecfccca951..6388295c951f3c963644b3008aae42a4ee020558 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index f408ff4854833cf2deab45c8b0f0049702aa622f..1166cdc0efb8018d4e2b38081dfe4bc12d6e3fdf 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index 293f3042eb692abe82239c6bfd0ce5cec3341aa9..cb6bf56967b0f3fbd50b28f34dbed33d42f561ff 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index fe885372d5af66422529a399b47577622569c5c9..cf9a474a8125ada6945cf2b7866d564225c160cb 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index 4ff62a97858ea63c044805800c701c93e1ff3644..4746d71a323fc2436ed563aac883574ee4e696fe 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index fd1ef097c4420389d0bab7b96d4f6ed3c1f00b0f..1c41df98e1637a8414115199a46428519acd1c03 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Graceful Restart functionality.
index 76522206a419d5bf761821452548bbbffb962d0e..593a8d64179e6c27993cb103c8ea0df062e6f3f9 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index 3519e5cc7b1cf2fb23bf8b36ee7dab3cf6f79214..2ffcb723ec42ae89b392cc81946a406f8821c5d7 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_gr_notification.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 TC1: Disable the link between R1-R2 and wait for HoldTimerExpire notification:
index 52ce0d5b57ed12388162994a2c96242c5d779942..0b6152568dd0be461e18f728b5e317ad5c04bbe1 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if routes are retained during BGP restarts.
index 764252d9621e25af902f395f8c0114847dc81eb9..61a0fe63c18093385dc0f6208ed6a8bbdc812cc1 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_gshut.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Vivek Venkatraman <vivek@nvidia.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test the ability to initiate and stop BGP graceful shutdown.
index 684d2fcb57925551fa1c03b1dfb39a071da31ed9..5ec9db0db63b76357a6283d49cb4b1e946e8765f 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index 16572a7967e6cecee302800a093f6ea209cb2fd1..1e0f7266aa456bdeee38ad406cc32e1d30c3f62d 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index 0c7e84a5a302f8fe7fd123daf357a5c29b69ac0f..ddb5fe5d82e2e28d80c019e00a1f0f28bd3f08a5 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index c2f0d2e0dc3c52f56df81e774e82268520b5fe03..c7cb213de5d776cc6753008026e2bb6e0c144b34 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_ipv4_class_e_peer.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if the peering works by using IPv4 Class E IP ranges, and if
index 9f01287c91d910f6ba1ba9c279c6218c3a5fb9f6..1873fb0ea6d5e750c27280642b04bead92b7abc5 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """RFC5549 Automation."""
index 48f308e316e94a5ff9159e4c209fb2cc3b500eef..47cc378eeb1e271648443397695c6583f612062e 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """RFC5549 Automation."""
index c0709043538b7fb908ee804b4f3875b6e263bed6..395ef2d9194604f7a6aab414084e8923794cc02e 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """RFC5549 Automation."""
index a9e6d21b8d928b3412afaa8307e3d10766f7c240..56152b91670afc3ffdf3dc762da7c413dfc7b708 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """RFC5549 Automation."""
index 9a0fc441755e8ca555db5c91ad2f8a814019dc5d..526b267ea52718818af39211f86253f7e7fe53d1 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """RFC5549 Automation."""
index 981028ff76ed30f496aec79f1d8be41c066ad663..045ac91fc7feb9660bb67e8433f6d57e84e28242 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_ipv6_rtadv.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2019 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_ipv6_rtadv.py: Test the FRR BGP daemon with BGP IPv6 interface
index c0a5c7ad9cc8cefc6ba3ad88c26c8fc6afcd052f..41114b69c3b081d18d687400510036114692a821 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 customize.py: Simple FRR MPLS L3VPN test topology
index be12cfde37808390e291bed4392722a6c2629a54..7930f093326fb0d1703dd1917e7a7fe84cbce871 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index 5161d8471febd282fc0d54dabd77b8dbe710c1a0..0ac535030846387035bb3ed244d05f236ba11f9d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 customize.py: Simple FRR MPLS L3VPN test topology
index 3844b5ef81fbdd8297a4cef7a39b78abd2eacabc..60d959fd1eac6d796e5e33732a3dc5222f208a9c 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index aae901eabee4e79b087b487afadd5b88896c3d52..3af779c427c24b12ea254f8c2823b08806fa1121 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if labeled-unicast works correctly with addpath capability.
index 91a92d2dd1ea4ae72e321304245ab75730073ae9..c3ccefb56964dca3ee8c3a03d8e5c58ff8eb4871 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if labeled-unicast works correctly with default-originate.
index 03cfded514cc8e0814765f4f92d0c2948a1e80cd..892b15a061fc7b62d29e1e85c31f39214b7dc98a 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index b11cda3cd043c107e304b0ef526a32ef9f06ad10..0044dbba54cec2de524829d17dcc06385e647ac8 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_large_community_topo_1.py: Test BGP large community.
index 4214f3a8676f79e7050cf6db3439af4486940a9a..af6976b5a6edb8d1f301255178c18e651cfb6dee 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_linkbw_ip.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc
 # Vivek Venkatraman
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_linkbw_ip.py: Test weighted ECMP using BGP link-bandwidth
index 4b4335a014bd31bd1e9b8ffe95ba6898f56db250..988b5790b8dba0192e80278d1c2105033f37b489 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_listen_on_multiple_addresses.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by Boeing Defence Australia
 # Adriano Marto Reis
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_listen_on_multiple_addresses.py: Test BGP daemon listening for
index fa57f664007cb1956744ed398fc40465c569cba6..d604871303ffd09ee1a03f5749831c67e3cd7061 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP Long-lived Graceful Restart capability works:
index 525d44220fcee988021a0d28ebdc6c61e83a90f4..9e5f146b47cb225cc19536c10621ae2afde1db10 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/__init__.py b/tests/topotests/bgp_local_as_dotplus_private_remove/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r1/bgpd.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..1846df2
--- /dev/null
@@ -0,0 +1,8 @@
+router bgp 0.65000 as-notation dot+
+  no bgp ebgp-requires-policy
+  neighbor 192.168.255.2 remote-as 0.1000
+  neighbor 192.168.255.2 timers 3 10
+  neighbor 192.168.255.2 local-as 0.500
+  address-family ipv4 unicast
+    neighbor 192.168.255.2 remove-private-AS
+    redistribute connected
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r1/zebra.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r1/zebra.conf
new file mode 100644 (file)
index 0000000..0a283c0
--- /dev/null
@@ -0,0 +1,9 @@
+!
+interface lo
+ ip address 172.16.255.254/32
+!
+interface r1-eth0
+ ip address 192.168.255.1/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r2/bgpd.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r2/bgpd.conf
new file mode 100644 (file)
index 0000000..c9adfa4
--- /dev/null
@@ -0,0 +1,5 @@
+router bgp 0.1000 as-notation dot+
+  no bgp ebgp-requires-policy
+  neighbor 192.168.255.1 remote-as 0.500
+  neighbor 192.168.255.1 timers 3 10
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r2/zebra.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r2/zebra.conf
new file mode 100644 (file)
index 0000000..606c17b
--- /dev/null
@@ -0,0 +1,6 @@
+!
+interface r2-eth0
+ ip address 192.168.255.2/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r3/bgpd.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r3/bgpd.conf
new file mode 100644 (file)
index 0000000..9a83127
--- /dev/null
@@ -0,0 +1,8 @@
+router bgp 3000
+  no bgp ebgp-requires-policy
+  neighbor 192.168.255.2 remote-as 1000
+  neighbor 192.168.255.2 timers 3 10
+  neighbor 192.168.255.2 local-as 500
+  address-family ipv4 unicast
+    neighbor 192.168.255.2 remove-private-AS
+    redistribute connected
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r3/zebra.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r3/zebra.conf
new file mode 100644 (file)
index 0000000..39499a1
--- /dev/null
@@ -0,0 +1,9 @@
+!
+interface lo
+ ip address 172.16.255.254/32
+!
+interface r3-eth0
+ ip address 192.168.255.1/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r4/bgpd.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r4/bgpd.conf
new file mode 100644 (file)
index 0000000..c9adfa4
--- /dev/null
@@ -0,0 +1,5 @@
+router bgp 0.1000 as-notation dot+
+  no bgp ebgp-requires-policy
+  neighbor 192.168.255.1 remote-as 0.500
+  neighbor 192.168.255.1 timers 3 10
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/r4/zebra.conf b/tests/topotests/bgp_local_as_dotplus_private_remove/r4/zebra.conf
new file mode 100644 (file)
index 0000000..b859115
--- /dev/null
@@ -0,0 +1,6 @@
+!
+interface r4-eth0
+ ip address 192.168.255.2/24
+!
+ip forwarding
+!
diff --git a/tests/topotests/bgp_local_as_dotplus_private_remove/test_bgp_local_as_dotplus_private_remove.py b/tests/topotests/bgp_local_as_dotplus_private_remove/test_bgp_local_as_dotplus_private_remove.py
new file mode 100644 (file)
index 0000000..efecad3
--- /dev/null
@@ -0,0 +1,114 @@
+#!/usr/bin/env python
+
+#
+# bgp_local_as_private_remove.py
+# Part of NetDEF Topology Tests
+#
+# Copyright (c) 2019 by
+# Network Device Education Foundation, Inc. ("NetDEF")
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+bgp_local_as_private_remove.py:
+Test if primary AS number is not removed in cases when `local-as`
+used together with `remove-private-AS`.
+"""
+
+import os
+import sys
+import json
+import time
+import pytest
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib.topogen import Topogen, TopoRouter, get_topogen
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    for routern in range(1, 5):
+        tgen.add_router("r{}".format(routern))
+
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["r1"])
+    switch.add_link(tgen.gears["r2"])
+
+    switch = tgen.add_switch("s2")
+    switch.add_link(tgen.gears["r3"])
+    switch.add_link(tgen.gears["r4"])
+
+
+def setup_module(mod):
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    router_list = tgen.routers()
+
+    for i, (rname, router) in enumerate(router_list.items(), 1):
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_remove_private_as():
+    tgen = get_topogen()
+
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    def _bgp_converge(router):
+        while True:
+            output = json.loads(
+                tgen.gears[router].vtysh_cmd("show ip bgp neighbor 192.168.255.1 json")
+            )
+            if output["192.168.255.1"]["bgpState"] == "Established":
+                time.sleep(1)
+                return True
+
+    def _bgp_as_path(router):
+        output = json.loads(
+            tgen.gears[router].vtysh_cmd("show ip bgp 172.16.255.254/32 json")
+        )
+        if output["prefix"] == "172.16.255.254/32":
+            return output["paths"][0]["aspath"]["segments"][0]["list"]
+
+    if _bgp_converge("r2"):
+        assert len(_bgp_as_path("r2")) == 1
+        assert '0.65000' not in _bgp_as_path("r2")
+
+    if _bgp_converge("r4"):
+        assert len(_bgp_as_path("r4")) == 2
+        assert '0.3000' in _bgp_as_path("r4")
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 2b4c4e816b6a0bca65e21705c6076589cf674088..9d22a799a6b584fc6cae12d0c101526b334bb56a 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_local_as_private_remove.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_local_as_private_remove.py:
index 8f7e1285e4560b5be8f50b9df6cc888cde9c36bd..26e8fe970193c6aa0e99249b5c5c4f1e72f1fbc2 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index d7c480d0bf529fad0d17f123e7e28813f19e17f7..8a1157052e5bc5fc7989f72752e95b03ae5bd653 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 #
 ##########################################################################################################################################
 #
index 925980a4345385ec0b30d185871783666df6df4e..25c9bee93c85cf58c4ebcdd505e09e913b3b9dd7 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 ##########################################################################################################
 #
index 6f4dc1befd0cd2edb032539db05e5c0ebe62c0b3..0c10c6409f1815d3c0fbbca024f0c399fa00a427 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 ##########################################################################################################
 #
 #   Testcases
index 5e2503f81382435fd9b4ce728965304326f50faf..ea6ab59b3f0f1c49618e38c4fcffaf1f086e52b7 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 1. Verify the BGP Local AS functionality by adding new AS when dynamically import routes
index 5992e06556dd50859876a7f931b5039a6387bedd..b1204bf583663e14104dcc74b24d9b49afcdb078 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 1. Verify the BGP Local AS functionality by adding new AS when leaking routes
diff --git a/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_agg.json b/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_agg.json
new file mode 100644 (file)
index 0000000..b481932
--- /dev/null
@@ -0,0 +1,147 @@
+{
+    "address_types": ["ipv4", "ipv6"],
+    "ipv4base": "10.0.0.0",
+    "ipv4mask": 30,
+    "ipv6base": "fd00::",
+    "ipv6mask": 64,
+    "link_ip_start": {"ipv4": "10.0.0.0", "v4mask": 30, "ipv6": "fd00::", "v6mask": 64},
+    "lo_prefix": {"ipv4": "1.0.", "v4mask": 32, "ipv6": "2001:db8:f::", "v6mask": 128},
+    "routers": {
+        "r1": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r3": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.100",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r3": {"dest_link": {"r1": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r3": {"dest_link": {"r1": {}}}
+                            }
+                        }
+                    }
+                }
+            },
+            "static_routes":[
+                {
+                "network":"10.1.1.0/32",
+                "next_hop":"Null0"
+                },
+                {
+                "network":"10:1::1:0/128",
+                "next_hop":"Null0"
+                }]
+            },
+        "r2": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r3": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.200",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                            ],
+                            "neighbor": {
+                                "r3": {"dest_link": {"r2": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                            ],
+                            "neighbor": {
+                                "r3": {"dest_link": {"r2": {}}}
+                            }
+                        }
+                    }
+                }
+            },
+            "static_routes":[
+                {
+                "network":"10.1.2.0/32",
+                "next_hop":"Null0"
+                },
+                {
+                "network":"10:1::2:0/128",
+                "next_hop":"Null0"
+                }]
+            },
+        "r3": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r1": {"ipv4": "auto", "ipv6": "auto"},
+                "r2": {"ipv4": "auto", "ipv6": "auto"},
+                "r4": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.300",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {"dest_link": {"r3": {}}},
+                                "r2": {"dest_link": {"r3": {}}},
+                                "r4": {"dest_link": {"r3": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {"dest_link": {"r3": {}}},
+                                "r2": {"dest_link": {"r3": {}}},
+                                "r4": {"dest_link": {"r3": {}}}
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "r4": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r3": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.400",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {"dest_link": {"r4": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {"dest_link": {"r4": {}}}
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_ecmp.json b/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_ecmp.json
new file mode 100644 (file)
index 0000000..afacab4
--- /dev/null
@@ -0,0 +1,317 @@
+{
+    "address_types": [
+        "ipv4",
+        "ipv6"
+    ],
+    "ipv4base": "10.0.0.0",
+    "ipv4mask": 24,
+    "ipv6base": "fd00::",
+    "ipv6mask": 64,
+    "link_ip_start": {
+        "ipv4": "10.0.0.0",
+        "v4mask": 24,
+        "ipv6": "fd00::",
+        "v6mask": 64
+    },
+    "lo_prefix": {
+        "ipv4": "1.0.",
+        "v4mask": 32,
+        "ipv6": "2001:DB8:F::",
+        "v6mask": 128
+    },
+    "routers": {
+        "r1": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "ipv6": "auto",
+                    "type": "loopback"
+                },
+                "r2-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                }
+            },
+            "bgp": [{
+                "local_as": "1.100",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r2": {
+                                    "dest_link": {
+                                        "r1-link1": {}
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r2": {
+                                    "dest_link": {
+                                        "r1-link1": {}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            ],
+            "static_routes":[
+                {
+                   "network":"10.0.0.1/32",
+                   "next_hop":"Null0"
+                },
+                {
+                   "network":"10::1/128",
+                   "next_hop":"Null0"
+                }
+            ]
+        },
+        "r2": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "ipv6": "auto",
+                    "type": "loopback"
+                },
+                "r1-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                }
+            },
+            "bgp": [{
+                "local_as": "1.200",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {
+                                    "dest_link": {
+                                        "r2-link1": {}
+                                    }
+                                },
+                                "r3": {
+                                    "dest_link": {
+                                        "r2-link1": {}
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {
+                                    "dest_link": {
+                                        "r2-link1": {}
+                                    }
+                                },
+                                "r3": {
+                                    "dest_link": {
+                                        "r2-link1": {}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        ]
+        },
+        "r3": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "ipv6": "auto",
+                    "type": "loopback"
+                },
+                "r2-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link2": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link3": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link4": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link5": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link6": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link7": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r4-link8": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                }
+            },
+            "bgp": [{
+                "local_as": "1.300",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {
+                                    "dest_link": {
+                                        "r3-link1": {}
+                                    }
+                                },
+                                "r4": {
+                                    "dest_link": {
+                                        "r3-link1": {},
+                                        "r3-link2": {},
+                                        "r3-link3": {},
+                                        "r3-link4": {},
+                                        "r3-link5": {},
+                                        "r3-link6": {},
+                                        "r3-link7": {},
+                                        "r3-link8": {}
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {
+                                    "dest_link": {
+                                        "r3-link1": {}
+                                    }
+                                },
+                                "r4": {
+                                    "dest_link": {
+                                        "r3-link1": {},
+                                        "r3-link2": {},
+                                        "r3-link3": {},
+                                        "r3-link4": {},
+                                        "r3-link5": {},
+                                        "r3-link6": {},
+                                        "r3-link7": {},
+                                        "r3-link8": {}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        ]
+        },
+        "r4": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "ipv6": "auto",
+                    "type": "loopback"
+                },
+                "r3-link1": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link2": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link3": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link4": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link5": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link6": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link7": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                },
+                "r3-link8": {
+                    "ipv4": "auto",
+                    "ipv6": "auto"
+                }
+            },
+            "bgp": [{
+                "local_as": "1.400",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {
+                                    "dest_link": {
+                                        "r4-link1": {},
+                                        "r4-link2": {},
+                                        "r4-link3": {},
+                                        "r4-link4": {},
+                                        "r4-link5": {},
+                                        "r4-link6": {},
+                                        "r4-link7": {},
+                                        "r4-link8": {}
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {
+                                    "dest_link": {
+                                        "r4-link1": {},
+                                        "r4-link2": {},
+                                        "r4-link3": {},
+                                        "r4-link4": {},
+                                        "r4-link5": {},
+                                        "r4-link6": {},
+                                        "r4-link7": {},
+                                        "r4-link8": {}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        ]
+        }
+    }
+}
diff --git a/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_topo1.json b/tests/topotests/bgp_local_asn_dot/bgp_local_asn_dot_topo1.json
new file mode 100644 (file)
index 0000000..02aacf7
--- /dev/null
@@ -0,0 +1,132 @@
+{
+    "address_types": ["ipv4", "ipv6"],
+    "ipv4base": "10.0.0.0",
+    "ipv4mask": 30,
+    "ipv6base": "fd00::",
+    "ipv6mask": 64,
+    "link_ip_start": {"ipv4": "10.0.0.0", "v4mask": 30, "ipv6": "fd00::", "v6mask": 64},
+    "lo_prefix": {"ipv4": "1.0.", "v4mask": 32, "ipv6": "2001:db8:f::", "v6mask": 128},
+    "routers": {
+        "r1": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r2": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.100",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r2": {"dest_link": {"r1": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "redistribute": [
+                                {"redist_type": "static"}
+                             ],
+                            "neighbor": {
+                                "r2": {"dest_link": {"r1": {}}}
+                            }
+                        }
+                    }
+                }
+            },
+            "static_routes":[
+                {
+                   "network":"10.1.1.0/32",
+                   "next_hop":"Null0"
+                },
+                {
+                   "network":"10:1::1:0/128",
+                   "next_hop":"Null0"
+                }]
+            },
+        "r2": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r1": {"ipv4": "auto", "ipv6": "auto"},
+                "r3": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.200",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {"dest_link": {"r2": {}}},
+                                "r3": {"dest_link": {"r2": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r1": {"dest_link": {"r2": {}}},
+                                "r3": {"dest_link": {"r2": {}}}
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "r3": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r2": {"ipv4": "auto", "ipv6": "auto"},
+                "r4": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.300",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {"dest_link": {"r3": {}}},
+                                "r4": {"dest_link": {"r3": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {"dest_link": {"r3": {}}},
+                                "r4": {"dest_link": {"r3": {}}}
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "r4": {
+            "links": {
+                "lo": {"ipv4": "auto", "ipv6": "auto", "type": "loopback"},
+                "r3": {"ipv4": "auto", "ipv6": "auto"}
+            },
+            "bgp": {
+                "local_as": "1.400",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {"dest_link": {"r4": {}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {"dest_link": {"r4": {}}}
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_agg.py
new file mode 100644 (file)
index 0000000..cb8fa1e
--- /dev/null
@@ -0,0 +1,420 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2022 by VMware, Inc. ("VMware")
+# Used Copyright (c) 2018 by Network Device Education Foundation,
+# Inc. ("NetDEF") in this file.
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+
+"""
+Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
+1. Verify the BGP Local AS functionality by aggregating routes  in between eBGP Peers.
+"""
+
+import os
+import sys
+import time
+import pytest
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+sys.path.append(os.path.join(CWD, "../lib/"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib.topogen import Topogen, get_topogen
+from lib.topotest import version_cmp
+
+from lib.common_config import (
+    start_topology,
+    write_test_header,
+    write_test_footer,
+    reset_config_on_routers,
+    verify_rib,
+    step,
+    check_address_types,
+    check_router_status
+)
+
+from lib.topolog import logger
+from lib.bgp import (
+    verify_bgp_convergence,
+    verify_bgp_rib,
+    create_router_bgp,
+)
+from lib.topojson import build_config_from_json
+
+pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
+
+# Global variables
+BGP_CONVERGENCE = False
+ADDR_TYPES = check_address_types()
+NETWORK_1_1 = {"ipv4": "10.1.1.0/32", "ipv6": "10:1::1:0/128"}
+NETWORK_1_2 = {"ipv4": "10.1.2.0/32", "ipv6": "10:1::2:0/128"}
+AGGREGATE_NW = {"ipv4": "10.1.0.0/16", "ipv6": "10:1::/96"}
+NEXT_HOP_IP = {"ipv4": "Null0", "ipv6": "Null0"}
+
+
+def setup_module(mod):
+    """
+    Sets up the pytest environment
+
+    * `mod`: module name
+    """
+
+    testsuite_run_time = time.asctime(time.localtime(time.time()))
+    logger.info("Testsuite start time: {}".format(testsuite_run_time))
+    logger.info("=" * 40)
+
+    logger.info("Running setup_module to create topology")
+
+    # This function initiates the topology build with Topogen...
+    json_file = "{}/bgp_local_asn_dot_agg.json".format(CWD)
+    tgen = Topogen(json_file, mod.__name__)
+    global topo
+    topo = tgen.json_topo
+    # ... and here it calls Mininet initialization functions.
+
+    # Starting topology, create tmp files which are loaded to routers
+    #  to start daemons and then start routers
+    start_topology(tgen)
+
+    # Creating configuration from JSON
+    build_config_from_json(tgen, topo)
+
+    global BGP_CONVERGENCE
+    global ADDR_TYPES
+    ADDR_TYPES = check_address_types()
+
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    logger.info("Running setup_module() done")
+
+
+def teardown_module():
+    """Teardown the pytest environment"""
+
+    logger.info("Running teardown_module to delete topology")
+
+    tgen = get_topogen()
+
+    # Stop toplogy and Remove tmp files
+    tgen.stop_topology()
+
+    logger.info(
+        "Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
+    )
+    logger.info("=" * 40)
+
+
+####################################################################################################################
+#
+#   Testcases
+#
+####################################################################################################################
+
+
+def test_verify_bgp_local_as_agg_in_EBGP_p0(request):
+    """
+    Verify the BGP Local AS functionality by aggregating routes  in between eBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Done in base config: Advertise prefix 10.1.1.0/24 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/120 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK_1_1[addr_type]}]}
+        }
+
+        input_static_verify_r2 = {
+            "r2": {"static_routes": [{"network": NETWORK_1_2[addr_type]}]}
+        }
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        result = verify_rib(tgen, addr_type, "r2", input_static_verify_r2)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure aggregate-address to summarise all the advertised routes.")
+    for addr_type in ADDR_TYPES:
+        route_aggregate = {
+            "r3": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {
+                                "aggregate_address": [
+                                    {
+                                        "network": AGGREGATE_NW[addr_type],
+                                        "summary": True,
+                                        "as_set": True,
+                                    }
+                                ]
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        result = create_router_bgp(tgen, topo, route_aggregate)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step(
+        "Verify that we see a summarised route on advertising router R3 "
+        "and receiving router R4 for both AFIs"
+    )
+
+    for addr_type in ADDR_TYPES:
+        input_static_agg_r1 = {
+            "r1": {"static_routes": [{"network": AGGREGATE_NW[addr_type]}]}
+        }
+        input_static_r1 = {
+            "r1": {"static_routes": [{"network": [NETWORK_1_1[addr_type]]}]}
+        }
+
+        input_static_r2 = {
+            "r2": {"static_routes": [{"network": [NETWORK_1_2[addr_type]]}]}
+        }
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_agg_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1", "r2"], [input_static_r1, input_static_r2]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-110 is got added in the AS list 1.110 {1.100,1.110,1.200} by following "
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "{1.100,1.110,1.200}"
+    for addr_type in ADDR_TYPES:
+        input_static_agg_r1 = {
+            "r1": {"static_routes": [{"network": AGGREGATE_NW[addr_type]}]}
+        }
+        result = verify_bgp_rib(
+            tgen, addr_type, dut, input_static_agg_r1, aspath=aspath
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "{1.100,1.200}"
+    for addr_type in ADDR_TYPES:
+        input_static_agg_r1 = {
+            "r1": {"static_routes": [{"network": AGGREGATE_NW[addr_type]}]}
+        }
+        result = verify_bgp_rib(
+            tgen, addr_type, dut, input_static_agg_r1, aspath=aspath
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 {1.100,1.200}"
+    for addr_type in ADDR_TYPES:
+        input_static_agg_r1 = {
+            "r1": {"static_routes": [{"network": AGGREGATE_NW[addr_type]}]}
+        }
+        result = verify_bgp_rib(
+            tgen, addr_type, dut, input_static_agg_r1, aspath=aspath
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_ecmp.py
new file mode 100644 (file)
index 0000000..6937a61
--- /dev/null
@@ -0,0 +1,524 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2022 by VMware, Inc. ("VMware")
+# Used Copyright (c) 2018 by Network Device Education Foundation,
+# Inc. ("NetDEF") in this file.
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+#
+##########################################################################################################################################
+#
+#   Testcases
+#
+###########################################################################################################################################
+###########################################################################################################################################
+#
+# 1.10.1.7. Verify the BGP Local AS functionality with ECMP on 8 links by adding no-prepend and replace-as command in between eBGP Peers.
+#
+#################################################################################################################################################
+
+import os
+import sys
+import time
+import pytest
+import platform
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+sys.path.append(os.path.join(CWD, "../lib/"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib.topogen import Topogen, get_topogen
+from lib.topotest import version_cmp
+
+from lib.common_config import (
+    start_topology,
+    write_test_header,
+    create_static_routes,
+    write_test_footer,
+    reset_config_on_routers,
+    verify_rib,
+    step,
+    check_address_types,
+    check_router_status,
+    create_static_routes,
+    verify_fib_routes,
+)
+
+from lib.topolog import logger
+from lib.bgp import (
+    verify_bgp_convergence,
+    verify_bgp_rib,
+    create_router_bgp,
+)
+from lib.topojson import build_config_from_json
+
+pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
+
+# Global variables
+BGP_CONVERGENCE = False
+NETWORK = {"ipv4": "10.1.1.0/32", "ipv6": "10:1::1:0/128"}
+NEXT_HOP_IP = {"ipv4": "Null0", "ipv6": "Null0"}
+
+
+def setup_module(mod):
+    """
+    Sets up the pytest environment
+
+    * `mod`: module name
+    """
+
+    testsuite_run_time = time.asctime(time.localtime(time.time()))
+    logger.info("Testsuite start time: {}".format(testsuite_run_time))
+    logger.info("=" * 40)
+
+    logger.info("Running setup_module to create topology")
+
+    # This function initiates the topology build with Topogen...
+    json_file = "{}/bgp_local_asn_dot_ecmp.json".format(CWD)
+    tgen = Topogen(json_file, mod.__name__)
+    global topo
+    topo = tgen.json_topo
+    # ... and here it calls Mininet initialization functions.
+
+    # Starting topology, create tmp files which are loaded to routers
+    #  to start daemons and then start routers
+    start_topology(tgen)
+
+    # Creating configuration from JSON
+    build_config_from_json(tgen, topo)
+
+    global BGP_CONVERGENCE
+    global ADDR_TYPES
+    ADDR_TYPES = check_address_types()
+
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    logger.info("Running setup_module() done")
+
+
+def teardown_module():
+    """Teardown the pytest environment"""
+
+    logger.info("Running teardown_module to delete topology")
+
+    tgen = get_topogen()
+
+    # Stop toplogy and Remove tmp files
+    tgen.stop_topology()
+
+    logger.info(
+        "Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
+    )
+    logger.info("=" * 40)
+
+
+##########################################################################################################################################
+#
+#   Testcases
+#
+###########################################################################################################################################
+
+
+def test_verify_bgp_local_as_in_ecmp_EBGP_p0(request):
+    """
+    Verify the BGP Local AS functionality with ECMP on 8 links by
+    adding no-prepend and replace-as command in between eBGP Peers.
+    """
+
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    dut = "r1"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_dict_static_route = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_dict_static_route_redist = {
+            "r1": {
+                "bgp": [
+                    {
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {"redistribute": [{"redist_type": "static"}]}
+                            }
+                        }
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_static_route_redist)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("Verify IPv4 and IPv6 static routes received on R1")
+        result = verify_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_bgp_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_fib_routes(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3-link1": {
+                                                    "local_asn": {"local_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R4.")
+    dest_link = {}
+    for link_no in range(1, 9):
+        link = "r3-link" + str(link_no)
+        dest_link[link] = {"local_asn": {"local_as": "1.110"}}
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {"r4": {"dest_link": dest_link}}
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R2 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r2_to_r3 = {
+            "r2": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r2-link1": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r2_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R4 towards R3.")
+    dest_link = {}
+    for link_no in range(1, 9):
+        link = "r4-link" + str(link_no)
+        dest_link[link] = {"local_asn": {"remote_as": "1.110"}}
+    for addr_type in ADDR_TYPES:
+        input_dict_r4_to_r3 = {
+            "r4": {
+                "bgp": [
+                    {
+                        "local_as": "1.400",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {"r3": {"dest_link": dest_link}}
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r4_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify IPv4 and IPv6 static routes received on R3 & R4")
+    for addr_type in ADDR_TYPES:
+        static_routes_input = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+        for dut in ["r3", "r4"]:
+            result = verify_fib_routes(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+            result = verify_bgp_rib(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-110 is got added in the AS list 1.110 1.200 1.100 by following "
+        " commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3-link1": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4.")
+    dest_link = {}
+    for link_no in range(1, 9):
+        link = "r3-link" + str(link_no)
+        dest_link[link] = {"local_asn": {"local_as": "1.110"}}
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {"r4": {"dest_link": dest_link}}
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r2": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R2")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3-link1": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_rep_as_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4")
+    dest_link = {}
+    for link_no in range(1, 9):
+        link = "r3-link" + str(link_no)
+        dest_link[link] = {
+            "local_asn": {"local_as": "1.110", "no_prepend": True, "replace_as": True}
+        }
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {"r4": {"dest_link": dest_link}}
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_rep_as_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
diff --git a/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py b/tests/topotests/bgp_local_asn_dot/test_bgp_local_asn_dot_topo1.py
new file mode 100644 (file)
index 0000000..e9234f5
--- /dev/null
@@ -0,0 +1,3655 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2022 by VMware, Inc. ("VMware")
+# Used Copyright (c) 2018 by Network Device Education Foundation,
+# Inc. ("NetDEF") in this file.
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+##########################################################################################################
+#
+#   Functionality Testcases
+#
+##########################################################################################################
+"""
+1. Verify the BGP Local AS functionality by adding no-prepend and replace-as command in between eBGP Peers.
+2. Verify the BGP Local AS functionality by configuring 4 Byte AS at R3 and 2 Byte AS at R2 & R4 in between eBGP Peers.
+3. Verify that BGP Local AS functionality by performing graceful restart in between eBGP Peers.
+4. Verify the BGP Local AS functionality by adding another AS & by same AS with AS-Prepend command in between eBGP Peers.
+4. Verify the BGP Local AS functionality by adding no-prepend and replace-as command in between iBGP Peers.
+5. Verify the BGP Local AS functionality with allowas-in in between iBGP Peers.
+6. Verify that BGP Local AS functionality by performing shut/ noshut on the interfaces in between BGP neighbors.
+7. Verify that BGP Local AS functionality by restarting BGP,Zebra  and FRR services and
+   further restarting clear BGP * and shutdown BGP neighbor.
+8. Verify the BGP Local AS functionality with different AS configurations.
+9. Verify the BGP Local AS functionality with R3& R4 with different AS configurations.
+"""
+
+import os
+import sys
+import time
+import pytest
+from copy import deepcopy
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+sys.path.append(os.path.join(CWD, "../lib/"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib.topogen import Topogen, get_topogen
+from lib.topotest import version_cmp
+
+from lib.common_config import (
+    start_topology,
+    write_test_header,
+    create_static_routes,
+    write_test_footer,
+    reset_config_on_routers,
+    verify_rib,
+    step,
+    get_frr_ipv6_linklocal,
+    check_address_types,
+    check_router_status,
+    create_static_routes,
+    verify_fib_routes,
+    create_route_maps,
+    kill_router_daemons,
+    start_router_daemons,
+    shutdown_bringup_interface,
+)
+
+from lib.topolog import logger
+from lib.bgp import (
+    verify_bgp_convergence,
+    clear_bgp_and_verify,
+    verify_bgp_rib,
+    modify_as_number,
+    create_router_bgp,
+    verify_bgp_advertised_routes_from_neighbor,
+    verify_graceful_restart,
+    verify_r_bit,
+)
+from lib.topojson import build_config_from_json
+
+pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
+
+# Global variables
+NETWORK = {"ipv4": "10.1.1.0/32", "ipv6": "10:1::1:0/128"}
+NEXT_HOP_IP = {"ipv4": "Null0", "ipv6": "Null0"}
+NEXT_HOP_IP_GR = {"ipv4": "10.0.0.5", "ipv6": "fd00:0:0:1::2/64"}
+NEXT_HOP_IP_1 = {"ipv4": "10.0.0.101", "ipv6": "fd00::1"}
+NEXT_HOP_IP_2 = {"ipv4": "10.0.0.102", "ipv6": "fd00::2"}
+
+BGP_CONVERGENCE = False
+PREFERRED_NEXT_HOP = "link_local"
+KEEPALIVETIMER = 1
+HOLDDOWNTIMER = 3
+
+
+def setup_module(mod):
+    """
+    Sets up the pytest environment
+
+    * `mod`: module name
+    """
+
+    testsuite_run_time = time.asctime(time.localtime(time.time()))
+    logger.info("Testsuite start time: {}".format(testsuite_run_time))
+    logger.info("=" * 40)
+
+    logger.info("Running setup_module to create topology")
+
+    # This function initiates the topology build with Topogen...
+    json_file = "{}/bgp_local_asn_dot_topo1.json".format(CWD)
+    tgen = Topogen(json_file, mod.__name__)
+    global topo
+    topo = tgen.json_topo
+    # ... and here it calls Mininet initialization functions.
+
+    # Starting topology, create tmp files which are loaded to routers
+    #  to start daemons and then start routers
+    start_topology(tgen)
+
+    # Creating configuration from JSON
+    build_config_from_json(tgen, topo)
+
+    global BGP_CONVERGENCE
+    global ADDR_TYPES
+    ADDR_TYPES = check_address_types()
+
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    logger.info("Running setup_module() done")
+
+
+def teardown_module():
+    """Teardown the pytest environment"""
+
+    logger.info("Running teardown_module to delete topology")
+
+    tgen = get_topogen()
+
+    # Stop toplogy and Remove tmp files
+    tgen.stop_topology()
+
+    logger.info(
+        "Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
+    )
+    logger.info("=" * 40)
+
+
+##########################################################################################################
+#
+#   Local APIs
+#
+##########################################################################################################
+
+
+def configure_gr_followed_by_clear(tgen, topo, input_dict, tc_name, dut, peer):
+    """
+    This function groups the repetitive function calls into one function.
+    """
+    result = create_router_bgp(tgen, topo, input_dict)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    result = clear_bgp_and_verify(tgen, topo, dut)
+    assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+    return True
+
+
+def next_hop_per_address_family(
+    tgen, dut, peer, addr_type, next_hop_dict, preferred_next_hop=PREFERRED_NEXT_HOP
+):
+    """
+    This function returns link_local or global next_hop per address-family
+    """
+    intferface = topo["routers"][peer]["links"]["{}".format(dut)]["interface"]
+    if addr_type == "ipv6" and "link_local" in preferred_next_hop:
+        next_hop = get_frr_ipv6_linklocal(tgen, peer, intf=intferface)
+    else:
+        next_hop = next_hop_dict[addr_type]
+
+    return next_hop
+
+
+##########################################################################################################
+#
+#   Testcases
+#
+##########################################################################################################
+
+
+def test_verify_bgp_local_as_in_EBGP_p0(request):
+    """
+    Verify the BGP Local AS functionality by adding no-prepend and
+    replace-as command in between eBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify advertised routes to R4 at R3")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_4B_AS_mid_4B_AS_p0(request):
+    """
+    Verify the BGP Local AS functionality by configuring 4 Byte AS
+    at R3 and 4 Byte AS at R2 & R4 in between eBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "183.2926"
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {
+                                                    "local_asn": {
+                                                        "remote_as": "183.2926"
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-183.2926 is got added in the AS list 183.2926 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "183.2926 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "183.2926",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify advertised routes to R4 at R3")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "183.2926",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "183.2926 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_GR_EBGP_p0(request):
+    """
+    Verify that BGP Local AS functionality by performing graceful restart in between eBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Configure basic BGP Peerings between R1,R2,R3 and R4")
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_dict_static_route = {
+            "r1": {
+                "static_routes": [
+                    {
+                        "network": NETWORK[addr_type],
+                        "next_hop": NEXT_HOP_IP_GR[addr_type],
+                    }
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_dict_static_route_redist = {
+            "r1": {
+                "bgp": [
+                    {
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {"redistribute": [{"redist_type": "static"}]}
+                            }
+                        }
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_static_route_redist)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+        step("Verify IPv4 and IPv6 static routes received on R1")
+        result = verify_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_bgp_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_fib_routes(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R2 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r2_to_r3 = {
+            "r2": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r2": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r2_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R4 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r4_to_r3 = {
+            "r4": {
+                "bgp": [
+                    {
+                        "local_as": "1.400",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r4": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r4_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify IPv4 and IPv6 static routes received on R3 & R4")
+    for addr_type in ADDR_TYPES:
+        static_routes_input = {
+            "r1": {
+                "static_routes": [
+                    {
+                        "network": NETWORK[addr_type],
+                        "next_hop": NEXT_HOP_IP_GR[addr_type],
+                    }
+                ]
+            }
+        }
+        for dut in ["r3", "r4"]:
+            result = verify_fib_routes(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+            result = verify_bgp_rib(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following "
+        " commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    """
+    GR Steps : Helper BGP router R2, mark and unmark IPV4 routes
+    as stale as the restarting router R3 come up within the restart time
+    """
+    # Create route-map to prefer global next-hop
+    input_dict = {
+        "r2": {
+            "route_maps": {
+                "rmap_global": [
+                    {"action": "permit", "set": {"ipv6": {"nexthop": "prefer-global"}}}
+                ]
+            }
+        },
+        "r3": {
+            "route_maps": {
+                "rmap_global": [
+                    {"action": "permit", "set": {"ipv6": {"nexthop": "prefer-global"}}}
+                ]
+            }
+        },
+    }
+    result = create_route_maps(tgen, input_dict)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    # Configure neighbor for route map
+    input_dict_neigh_rm = {
+        "r2": {
+            "bgp": {
+                "address_family": {
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {
+                                    "dest_link": {
+                                        "r2": {
+                                            "route_maps": [
+                                                {
+                                                    "name": "rmap_global",
+                                                    "direction": "in",
+                                                }
+                                            ]
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        "r3": {
+            "bgp": {
+                "address_family": {
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {
+                                    "dest_link": {
+                                        "r3": {
+                                            "route_maps": [
+                                                {
+                                                    "name": "rmap_global",
+                                                    "direction": "in",
+                                                }
+                                            ]
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        },
+    }
+
+    result = create_router_bgp(tgen, topo, input_dict_neigh_rm)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    # Configure graceful-restart
+    input_dict = {
+        "r2": {
+            "bgp": {
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {
+                                    "dest_link": {
+                                        "r2": {
+                                            "graceful-restart-helper": True,
+                                            "local_asn": {"remote_as": "1.110"},
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r3": {
+                                    "dest_link": {
+                                        "r2": {
+                                            "graceful-restart-helper": True,
+                                            "local_asn": {"remote_as": "1.110"},
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    },
+                }
+            }
+        },
+        "r3": {
+            "bgp": {
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {"dest_link": {"r3": {"graceful-restart": True}}}
+                            }
+                        }
+                    },
+                    "ipv6": {
+                        "unicast": {
+                            "neighbor": {
+                                "r2": {"dest_link": {"r3": {"graceful-restart": True}}}
+                            }
+                        }
+                    },
+                }
+            }
+        },
+    }
+
+    configure_gr_followed_by_clear(tgen, topo, input_dict, tc_name, dut="r3", peer="r2")
+    for addr_type in ADDR_TYPES:
+        result = verify_graceful_restart(
+            tgen, topo, addr_type, input_dict, dut="r3", peer="r2"
+        )
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        # Verifying BGP RIB routes
+        dut = "r2"
+        peer = "r3"
+        next_hop = next_hop_per_address_family(
+            tgen, dut, peer, addr_type, NEXT_HOP_IP_2, preferred_next_hop="global"
+        )
+        input_topo = {key: topo["routers"][key] for key in ["r3"]}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_topo)
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        # Verifying RIB routes
+        result = verify_rib(tgen, addr_type, dut, input_topo, next_hop, "bgp")
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+    logger.info("[Phase 2] : R3 goes for reload  ")
+
+    kill_router_daemons(tgen, "r3", ["bgpd"])
+
+    logger.info(
+        "[Phase 3] : R3 is still down, restart time 120 sec."
+        " So time verify the routes are present in BGP RIB"
+        " and ZEBRA"
+    )
+
+    for addr_type in ADDR_TYPES:
+        # Verifying BGP RIB routes
+        next_hop = next_hop_per_address_family(
+            tgen, dut, peer, addr_type, NEXT_HOP_IP_2, preferred_next_hop="global"
+        )
+        result = verify_bgp_rib(tgen, addr_type, dut, input_topo, next_hop)
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        # Verifying RIB routes
+        protocol = "bgp"
+        result = verify_rib(tgen, addr_type, dut, input_topo, next_hop, protocol)
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+    logger.info("[Phase 5] : R3 is about to come up now  ")
+    start_router_daemons(tgen, "r3", ["bgpd"])
+
+    logger.info("[Phase 5] : R3 is UP Now !  ")
+
+    for addr_type in ADDR_TYPES:
+        result = verify_bgp_convergence(tgen, topo)
+        assert (
+            result is True
+        ), "BGP Convergence after BGPd restart" " :Failed \n Error:{}".format(result)
+
+        # Verifying GR stats
+        result = verify_graceful_restart(
+            tgen, topo, addr_type, input_dict, dut="r3", peer="r2"
+        )
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        result = verify_r_bit(tgen, topo, addr_type, input_dict, dut="r2", peer="r3")
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        # Verifying BGP RIB routes
+        next_hop = next_hop_per_address_family(
+            tgen, dut, peer, addr_type, NEXT_HOP_IP_2, preferred_next_hop="global"
+        )
+        result = verify_bgp_rib(tgen, addr_type, dut, input_topo, next_hop)
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+        # Verifying RIB routes
+        protocol = "bgp"
+        result = verify_rib(tgen, addr_type, dut, input_topo, next_hop, protocol)
+        assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
+
+    step("Configure local-as with no-prepend at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r2": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R2")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_rep_as_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_rep_as_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_aspath_p0(request):
+    """
+    Verify the BGP Local AS functionality by adding another AS & by same AS with AS-Prepend command in between eBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Configure basic BGP Peerings between R1,R2,R3 and R4")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify advertised routes to R4 at R3")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure a route-map on R3 to prepend AS 2 times.")
+    for addr_type in ADDR_TYPES:
+        input_dict_4 = {
+            "r3": {
+                "route_maps": {
+                    "ASP_{}".format(addr_type): [
+                        {
+                            "action": "permit",
+                            "set": {
+                                "path": {"as_num": "1.1000 1.1000", "as_action": "prepend"}
+                            },
+                        }
+                    ]
+                }
+            }
+        }
+        result = create_route_maps(tgen, input_dict_4)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure route map in out direction on R4")
+        # Configure neighbor for route map
+        input_dict_7 = {
+            "r3": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {
+                                "neighbor": {
+                                    "r4": {
+                                        "dest_link": {
+                                            "r3": {
+                                                "route_maps": [
+                                                    {
+                                                        "name": "ASP_{}".format(
+                                                            addr_type
+                                                        ),
+                                                        "direction": "out",
+                                                    }
+                                                ]
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        result = create_router_bgp(tgen, topo, input_dict_7)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step(
+        "Verify that AS-1.300 is got replaced with 1.200 in the AS list 1.110 1.1000 1.1000 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r4"
+    aspath = "1.110 1.1000 1.1000 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_iBGP_p0(request):
+    """
+    Verify the BGP Local AS functionality by adding no-prepend and replace-as command in between iBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Modify AS Number for R3")
+    input_dict_modify_as_number = {"r3": {"bgp": {"local_as": "1.200"}}}
+    result = modify_as_number(tgen, topo, input_dict_modify_as_number)
+
+    step("Base config is done as part of JSON")
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_dict_static_route = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_dict_static_route_redist = {
+            "r1": {
+                "bgp": [
+                    {
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {"redistribute": [{"redist_type": "static"}]}
+                            }
+                        }
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_static_route_redist)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("Verify IPv4 and IPv6 static routes received on R1")
+        result = verify_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_bgp_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_fib_routes(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R4 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r4_to_r3 = {
+            "r4": {
+                "bgp": [
+                    {
+                        "local_as": "1.400",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r4": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r4_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R2 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r2_to_r3 = {
+            "r2": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r2": {
+                                                    "next_hop_self": True,
+                                                    "local_asn": {
+                                                        "remote_as": "1.200",
+                                                    },
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r2_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify IPv4 and IPv6 static routes received on R3 & R4")
+    for addr_type in ADDR_TYPES:
+        static_routes_input = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+        for dut in ["r3", "r4"]:
+            result = verify_fib_routes(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+            result = verify_bgp_rib(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following "
+        " commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_no_prep_rep_as_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_allow_as_in_iBGP_p0(request):
+    """
+    Verify the BGP Local AS functionality with allowas-in in between iBGP Peers.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Modidy AS Number for R4")
+    input_dict_modify_as_number = {"r4": {"bgp": {"local_as": "1.100"}}}
+    result = modify_as_number(tgen, topo, input_dict_modify_as_number)
+
+    step("Base config is done as part of JSON")
+    dut = "r1"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_dict_static_route = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_dict_static_route_redist = {
+            "r1": {
+                "bgp": [
+                    {
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {"redistribute": [{"redist_type": "static"}]}
+                            }
+                        }
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_static_route_redist)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("Verify IPv4 and IPv6 static routes received on R1")
+        result = verify_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_bgp_rib(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+        result = verify_fib_routes(tgen, addr_type, "r1", input_dict_static_route)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure allow-as at R4")
+    for addr_type in ADDR_TYPES:
+        allow_as_config_r4 = {
+            "r4": {
+                "bgp": [
+                    {
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r4": {
+                                                    "allowas-in": {
+                                                        "number_occurences": 1
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                ]
+            }
+        }
+
+        step(
+            "Configuring allow-as for {} address-family on router R4 ".format(addr_type)
+        )
+        result = create_router_bgp(tgen, topo, allow_as_config_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    # now modify the as in r4 and reconfig bgp in r3 with new remote as.
+    topo1 = deepcopy(topo)
+    topo1["routers"]["r4"]["bgp"]["local_as"] = "1.100"
+
+    delete_bgp = {"r3": {"bgp": {"delete": True}}}
+    result = create_router_bgp(tgen, topo1, delete_bgp)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    build_config_from_json(tgen, topo1, save_bkup=False)
+
+    step("Configure local-as at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R2 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r2_to_r3 = {
+            "r2": {
+                "bgp": [
+                    {
+                        "local_as": "1.200",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r2": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_r2_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure remote-as at R4 towards R3.")
+    for addr_type in ADDR_TYPES:
+        input_dict_r4_to_r3 = {
+            "r4": {
+                "bgp": [
+                    {
+                        "local_as": "1.100",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r3": {
+                                            "dest_link": {
+                                                "r4": {
+                                                    "local_asn": {"remote_as": "1.110"}
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_r4_to_r3)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo1)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify IPv4 and IPv6 static routes received on R3 & R4")
+    for addr_type in ADDR_TYPES:
+        static_routes_input = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+        for dut in ["r3", "r4"]:
+            result = verify_fib_routes(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+            result = verify_bgp_rib(tgen, addr_type, dut, static_routes_input)
+            assert result is True, "Testcase {} : Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following "
+        " commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R2.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_no_prep_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_no_prep_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo1)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r2": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R2")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r2 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r2": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_no_prep_rep_as_r3_to_r2)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4")
+    for addr_type in ADDR_TYPES:
+        input_dict_no_prep_rep_as_r3_to_r4 = {
+            "r3": {
+                "bgp": [
+                    {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        "r4": {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                ]
+            }
+        }
+        result = create_router_bgp(tgen, topo1, input_dict_no_prep_rep_as_r3_to_r4)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo1)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_port_reset_p0(request):
+    """
+    Verify that BGP Local AS functionality by performing shut/ noshut on the interfaces in between BGP neighbors.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("Api call to modfiy BGP timers at R3")
+    for addr_type in ADDR_TYPES:
+        input_dict_r3_timers = {
+            "r3": {
+                "bgp": {
+                    "local_as": "1.300",
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {
+                                "neighbor": {
+                                    "r4": {
+                                        "dest_link": {
+                                            "r3": {
+                                                "keepalivetimer": KEEPALIVETIMER,
+                                                "holddowntimer": HOLDDOWNTIMER,
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    },
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_dict_r3_timers)
+        assert result is True, "Testcase {} :Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify advertised routes at R3 towards R4")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    for count in range(1, 1):
+        step("Iteration {}".format(count))
+        step("Shut down connecting interface between R3<<>>R4 on R3.")
+
+        intf1 = topo["routers"]["r3"]["links"]["r4"]["interface"]
+
+        interfaces = [intf1]
+        for intf in interfaces:
+            shutdown_bringup_interface(tgen, "r3", intf, False)
+
+        step(
+            "On R3, all BGP peering in respective vrf instances go down"
+            " when the interface is shut"
+        )
+
+        result = verify_bgp_convergence(tgen, topo, expected=False)
+        assert result is not True, (
+            "Testcase {} :Failed \n "
+            "Expected Behaviour: BGP will not be converged \n "
+            "Error {}".format(tc_name, result)
+        )
+
+    step("BGP neighborship is verified after restart of r3")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "setup_module :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_negative2_p0(request):
+    """
+    Verify the BGP Local AS functionality with different AS configurations.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step("Verify advertised routes to R4 at R3")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step(
+        "Verify that AS-1.110 is not prepended in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+    step("Verify that AS-1.300 is replaced with AS-1.110 at R3 router.")
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    # configure negative scenarios
+    step("Configure local-as at R3 towards R4.")
+    input_dict_r3 = {
+        "r3": {
+            "bgp": {
+                "local_as": "1.300",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r4": {
+                                    "dest_link": {
+                                        "r3": {"local_asn": {"local_as": "1.300"}}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                },
+            }
+        }
+    }
+    if "bgp" in topo["routers"]["r3"].keys():
+        result = create_router_bgp(tgen, topo, input_dict_r3)
+        assert result is not True, (
+            "Testcase {} :Failed \n "
+            "Expected Behaviour: Cannot have local-as same as BGP AS number \n "
+            "Error {}".format(tc_name, result)
+        )
+
+    step("Configure another local-as at R3 towards R4.")
+    input_dict_r3 = {
+        "r3": {
+            "bgp": {
+                "local_as": "1.110",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r4": {
+                                    "dest_link": {
+                                        "r3": {"local_asn": {"local_as": "1.110"}}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                },
+            }
+        }
+    }
+    if "bgp" in topo["routers"]["r3"].keys():
+        result = create_router_bgp(tgen, topo, input_dict_r3)
+        assert result is not True, (
+            "Testcase {} :Failed \n "
+            "Expected Behaviour: Cannot have local-as same as BGP AS number \n "
+            "Error {}".format(tc_name, result)
+        )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_negative3_p0(request):
+    """
+    Verify the BGP Local AS functionality with R3& R4 with different AS configurations.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+        reset_config_on_routers(tgen)
+
+    step("Configure basic BGP Peerings between R1,R2,R3 and R4")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    # Perform Negative scenarios
+    step("Configure another local-as at R3 towards R4.")
+    input_dict_r3 = {
+        "r3": {
+            "bgp": {
+                "local_as": "1.300",
+                "address_family": {
+                    "ipv4": {
+                        "unicast": {
+                            "neighbor": {
+                                "r4": {
+                                    "dest_link": {
+                                        "r3": {"local_asn": {"local_as": "1.300"}}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                },
+            }
+        }
+    }
+    if "bgp" in topo["routers"]["r3"].keys():
+        result = create_router_bgp(tgen, topo, input_dict_r3)
+        assert result is not True, (
+            "Testcase {} :Failed \n "
+            "Expected Behaviour: Cannot have local-as same as BGP AS number \n "
+            "Error {}".format(tc_name, result)
+        )
+
+    write_test_footer(tc_name)
+
+
+def test_verify_bgp_local_as_in_EBGP_restart_daemons_p0(request):
+    """
+    Verify that BGP Local AS functionality by restarting BGP,Zebra  and FRR services and
+    further restarting clear BGP * and shutdown BGP neighbor.
+    """
+    tgen = get_topogen()
+    global BGP_CONVERGENCE
+    if BGP_CONVERGENCE != True:
+        pytest.skip("skipped because of BGP Convergence failure")
+    # test case name
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+    reset_config_on_routers(tgen)
+
+    step("Base config is done as part of JSON")
+    step("Configure local-as at R3 towards R4.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {"local_asn": {"local_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    for addr_type in ADDR_TYPES:
+        for dut, asn, neighbor in zip(["r2", "r4"], ["1.200", "1.400"], ["r3", "r3"]):
+            input_dict_r2_r4 = {
+                dut: {
+                    "bgp": {
+                        "local_as": asn,
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                dut: {"local_asn": {"remote_as": "1.110"}}
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r2_r4)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    # configure static routes
+    step("Done in base config: Advertise prefix 10.1.1.0/32 from Router-1(AS-1.100).")
+    step(
+        "Done in base config: Advertise an ipv6 prefix 10:1::1:0/128 from Router-1(AS-1.100)."
+    )
+    step("Verify that Static routes are redistributed in BGP process")
+    dut = "r1"
+    protocol = "bgp"
+    for addr_type in ADDR_TYPES:
+        # Enable static routes
+        input_static_r1 = {
+            "r1": {
+                "static_routes": [
+                    {"network": NETWORK[addr_type], "next_hop": NEXT_HOP_IP[addr_type]}
+                ]
+            }
+        }
+
+        logger.info("Configure static routes")
+        result = create_static_routes(tgen, input_static_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        step("configure redistribute static in Router BGP in R1")
+        input_static_redist_r1 = {
+            "r1": {
+                "bgp": {
+                    "address_family": {
+                        addr_type: {
+                            "unicast": {"redistribute": [{"redist_type": "static"}]}
+                        }
+                    }
+                }
+            }
+        }
+        result = create_router_bgp(tgen, topo, input_static_redist_r1)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify that Static routes are redistributed in BGP process")
+    for addr_type in ADDR_TYPES:
+        input_static_verify_r1 = {
+            "r1": {"static_routes": [{"network": NETWORK[addr_type]}]}
+        }
+
+        result = verify_rib(tgen, addr_type, "r1", input_static_verify_r1)
+        assert result is True, "Testcase {}: Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+        for dut in ["r3", "r4"]:
+            result = verify_rib(tgen, addr_type, dut, input_static_r1)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+        for dut, input_routes in zip(["r1"], [input_static_r1]):
+            result = verify_rib(tgen, addr_type, dut, input_routes)
+            assert result is True, "Testcase {}: Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Kill BGPd daemon on R3.")
+    kill_router_daemons(tgen, "r3", ["bgpd"])
+
+    step("Bring up BGPd daemon on R3.")
+    start_router_daemons(tgen, "r3", ["bgpd"])
+
+    step(
+        "Verify that AS-1.110 is got added in the AS list 1.110 1.200 1.100 by following"
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Verify advertised routes at R3 towards R4")
+    expected_routes = {
+        "ipv4": [
+            {"network": "10.1.1.0/32", "nexthop": ""},
+        ],
+        "ipv6": [
+            {"network": "10:1::1:0/128", "nexthop": ""},
+        ],
+    }
+    result = verify_bgp_advertised_routes_from_neighbor(
+        tgen, topo, dut="r3", peer="r4", expected_routes=expected_routes
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Configure local-as with no-prepend at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step(
+        "Verify that AS-1.110 is not prepended in the AS list 1.200 1.100 by following "
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Kill BGPd daemon on R3.")
+    kill_router_daemons(tgen, "r3", ["bgpd"])
+
+    step("Bring up BGPd daemon on R3.")
+    start_router_daemons(tgen, "r3", ["bgpd"])
+
+    step(
+        "Verify that AS-1.110 is not prepended in the AS list 1.200 1.100 by following "
+        "commands at R3 router."
+    )
+    dut = "r3"
+    aspath = "1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Configure local-as with no-prepend and replace-as at R3 towards R4 & R2.")
+    for addr_type in ADDR_TYPES:
+        for neighbor in ["r2", "r4"]:
+            input_dict_r3 = {
+                "r3": {
+                    "bgp": {
+                        "local_as": "1.300",
+                        "address_family": {
+                            addr_type: {
+                                "unicast": {
+                                    "neighbor": {
+                                        neighbor: {
+                                            "dest_link": {
+                                                "r3": {
+                                                    "local_asn": {
+                                                        "local_as": "1.110",
+                                                        "no_prepend": True,
+                                                        "replace_as": True,
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                    }
+                }
+            }
+            result = create_router_bgp(tgen, topo, input_dict_r3)
+            assert result is True, "Testcase {} :Failed \n Error: {}".format(
+                tc_name, result
+            )
+
+    step("BGP neighborship is verified by following commands in R3 routers")
+    BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+    assert BGP_CONVERGENCE is True, "BGP convergence :Failed \n Error: {}".format(
+        BGP_CONVERGENCE
+    )
+
+    step(
+        "Verified that AS-1.300 is got replaced with original AS-1.110 at R4 by following commands"
+    )
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step(
+        "Verified that AS-1.300 is got replaced with original AS-1.110 at R4 by following commands"
+    )
+    dut = "r4"
+    aspath = "1.110 1.200 1.100"
+    for addr_type in ADDR_TYPES:
+        input_static_r1 = {"r1": {"static_routes": [{"network": NETWORK[addr_type]}]}}
+        result = verify_bgp_rib(tgen, addr_type, dut, input_static_r1, aspath=aspath)
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    write_test_footer(tc_name)
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 8955f2794dc236cb246191e99352acf9fb43afb0..7d59762410eff3c748802ce82521c413f71adb1c 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_lu.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_lu.py: Test BGP LU label allocation
index fc9d2c433a1a0f00c3795f63600f6a5151fd16fa..13e658260f782af391d0aebff6a81183d663f9ef 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # test_bgp_lu2.py
 #
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by Volta Networks
 # Copyright (c) 2021 by Nvidia, Inc.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_lu2.py: Test BGP LU label allocation
index a83d43310bf9737b5808aa0301488e3f2cf2d1c8..a9810ba264b3e154064c5f66170081fcdf7d2ca3 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_max_med_on_startup.py
 #
 # Copyright (c) 2022 Rubicon Communications, LLC.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test whether `bgp max-med on-startup (5-86400) [(0-4294967295)]` is working
index ee68ecd7b6ecf63c11d4f994a91a0da8bdfd78d0..c6bdbc3c1cce54738939d064ac7c4236355f4790 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_local_as_private_remove.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_maximum_prefix_invalid_update.py:
index 696d6d94ce4229393be458976ce56ce14535d150..0b346f63d51e0a2b29be69580efba09bcb9e9972 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_maximum_prefix_out.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if `neighbor <X.X.X.X> maximum-prefix-out <Y>` is working
index b1641b3c13b777ff2de98f066b337c61eed664e1..9f4d9682778a699d558f7a1018fccb197fbec2b3 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Takemasa Imada <takemasa.imada@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if minimum-holdtime works.
index 7eb5bda2d8d7a3fa8174557d2ef52adb7ff76cba..0d92a3c9f87c566e807e72511ede5f45151a67b2 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF:
index 04ebe61a0286faac2ee7dfff254d69aab31db18e..40a28fbcf492a066cdb718c5b2a4d4c5520bbf10 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF:
index 77619e59bb984dc104764ef009e56c9442cf69ce..2f3421d184e0d7fd71248eff7998663763400035 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_multiview_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2016 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_bgp_multiview_topo1.py: Simple FRR Route-Server Test
index cb74b85b767719c41afcad6f47f307384f145e45..7f45a242c9a10a85ef5c062e990ebf47fbf0deb4 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP ORF filtering is working correctly when modifying
index 4badf64c37c099b8d83ce1a35097a6db4009904c..ebaab603412a10f7d2ff75c8aca28c45f90f8049 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if `neighbor path-attribute discard` command works correctly,
@@ -81,24 +68,28 @@ def test_bgp_path_attribute_discard():
         output = json.loads(r1.vtysh_cmd("show bgp ipv4 unicast json detail"))
         expected = {
             "routes": {
-                "192.168.100.101/32": [
-                    {
-                        "valid": True,
-                        "atomicAggregate": True,
-                        "community": {
-                            "string": "65001:101",
-                        },
-                    }
-                ],
-                "192.168.100.102/32": [
-                    {
-                        "valid": True,
-                        "originatorId": "10.0.0.2",
-                        "community": {
-                            "string": "65001:102",
-                        },
-                    }
-                ],
+                "192.168.100.101/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                            "atomicAggregate": True,
+                            "community": {
+                                "string": "65001:101",
+                            },
+                        }
+                    ],
+                },
+                "192.168.100.102/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                            "originatorId": "10.0.0.2",
+                            "community": {
+                                "string": "65001:102",
+                            },
+                        }
+                    ],
+                },
             }
         }
         return topotest.json_cmp(output, expected)
@@ -120,20 +111,24 @@ def test_bgp_path_attribute_discard():
         output = json.loads(r1.vtysh_cmd("show bgp ipv4 unicast json detail"))
         expected = {
             "routes": {
-                "192.168.100.101/32": [
-                    {
-                        "valid": True,
-                        "atomicAggregate": None,
-                        "community": None,
-                    }
-                ],
-                "192.168.100.102/32": [
-                    {
-                        "valid": True,
-                        "originatorId": None,
-                        "community": None,
-                    }
-                ],
+                "192.168.100.101/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                            "atomicAggregate": None,
+                            "community": None,
+                        }
+                    ],
+                },
+                "192.168.100.102/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                            "originatorId": None,
+                            "community": None,
+                        }
+                    ],
+                },
             }
         }
         return topotest.json_cmp(output, expected)
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/__init__.py b/tests/topotests/bgp_path_attribute_treat_as_withdraw/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/bgpd.conf b/tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..4286b98
--- /dev/null
@@ -0,0 +1,14 @@
+!
+router bgp 65001
+ no bgp ebgp-requires-policy
+ no bgp network import-check
+ neighbor 10.0.0.2 remote-as external
+ neighbor 10.0.0.2 timers 3 10
+ address-family ipv4 unicast
+  network 10.10.10.10/32 route-map atomic
+  network 10.10.10.20/32
+ exit-address-family
+!
+route-map atomic permit 10
+ set atomic-aggregate
+!
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/zebra.conf b/tests/topotests/bgp_path_attribute_treat_as_withdraw/r1/zebra.conf
new file mode 100644 (file)
index 0000000..51a1b26
--- /dev/null
@@ -0,0 +1,4 @@
+!
+interface r1-eth0
+ ip address 10.0.0.1/24
+!
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/bgpd.conf b/tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/bgpd.conf
new file mode 100644 (file)
index 0000000..2e63fd8
--- /dev/null
@@ -0,0 +1,6 @@
+!
+router bgp 65002
+ no bgp ebgp-requires-policy
+ neighbor 10.0.0.1 remote-as external
+ neighbor 10.0.0.1 timers 3 10
+!
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/zebra.conf b/tests/topotests/bgp_path_attribute_treat_as_withdraw/r2/zebra.conf
new file mode 100644 (file)
index 0000000..12d3731
--- /dev/null
@@ -0,0 +1,4 @@
+!
+interface r2-eth0
+ ip address 10.0.0.2/24
+!
diff --git a/tests/topotests/bgp_path_attribute_treat_as_withdraw/test_bgp_path_attribute_treat_as_withdraw.py b/tests/topotests/bgp_path_attribute_treat_as_withdraw/test_bgp_path_attribute_treat_as_withdraw.py
new file mode 100644 (file)
index 0000000..a9d678a
--- /dev/null
@@ -0,0 +1,149 @@
+#!/usr/bin/env python
+
+#
+# Copyright (c) 2022 by
+# Donatas Abraitis <donatas@opensourcerouting.org>
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+Test if `neighbor path-attribute treat-as-withdraw` command works correctly,
+can withdraw unwanted prefixes from BGP table.
+"""
+
+import os
+import sys
+import json
+import pytest
+import functools
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.common_config import step
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    r1 = tgen.add_router("r1")
+    r2 = tgen.add_router("r2")
+
+    switch = tgen.add_switch("s1")
+    switch.add_link(r1)
+    switch.add_link(r2)
+
+
+def setup_module(mod):
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    r1 = tgen.gears["r1"]
+    r1.load_config(TopoRouter.RD_ZEBRA, os.path.join(CWD, "r1/zebra.conf"))
+    r1.load_config(TopoRouter.RD_BGP, os.path.join(CWD, "r1/bgpd.conf"))
+    r1.start()
+
+    r2 = tgen.gears["r2"]
+    r2.load_config(TopoRouter.RD_ZEBRA, os.path.join(CWD, "r2/zebra.conf"))
+    r2.load_config(TopoRouter.RD_BGP, os.path.join(CWD, "r2/bgpd.conf"))
+    r2.start()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_path_attribute_treat_as_withdraw():
+    tgen = get_topogen()
+
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    r2 = tgen.gears["r2"]
+
+    def _bgp_converge():
+        output = json.loads(r2.vtysh_cmd("show bgp ipv4 unicast json detail"))
+        expected = {
+            "routes": {
+                "10.10.10.10/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                            "atomicAggregate": True,
+                        }
+                    ],
+                },
+                "10.10.10.20/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                        }
+                    ],
+                },
+            }
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_converge)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Failed bgp convergence"
+
+    step("Withdraw prefixes with atomic-aggregate from r1")
+    r2.vtysh_cmd(
+        """
+    configure terminal
+        router bgp
+            neighbor 10.0.0.1 path-attribute treat-as-withdraw 6
+    """
+    )
+
+    def _bgp_check_if_route_withdrawn():
+        output = json.loads(r2.vtysh_cmd("show bgp ipv4 unicast json detail"))
+        expected = {
+            "routes": {
+                "10.10.10.10/32": None,
+                "10.10.10.20/32": {
+                    "paths": [
+                        {
+                            "valid": True,
+                        }
+                    ],
+                },
+            }
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_check_if_route_withdrawn)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Failed to withdraw prefixes with atomic-aggregate attribute"
+
+
+def test_memory_leak():
+    "Run the memory leak test and report results."
+    tgen = get_topogen()
+    if not tgen.is_memleak_enabled():
+        pytest.skip("Memory leak test/report is disabled")
+
+    tgen.report_memory_leaks()
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 870c2f7a10bbbcdee1a771024a255869e2def33a..df390327d40739ce82f226f81a1be4d3c2eb1200 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Modified work Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Original work Copyright (c) 2018 by Network Device Education
 # Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test AS-Path functionality:
index 50b71d8627ab6ed031de0beebc1ba3ad7b062884..bf5737b6604d3777ac9dd4f0008230b2ddd5f458 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Louis Scalbert <louis.scalbert@6wind.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 
index de62889a0e9c10865c87c127586304ea449a2e67..2eb936aaa0aaa86b94388860f88d7adfa3f8b322 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if routes from R1 has local-preference set to 0 and graceful-shutdown
index 494f6c68b9c935cb866444e593cf904f5d6914ce..e8c3feb76fffa84dd0e3562567947047856fbdd2 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if peer-group works for numbered and unnumbered configurations.
index 8321a57552430f4880ec4bf7012ddbd5c809e3da..ad6674c52469c0cee6f946502806110f77774ca0 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
 #
 # Copyright (c) 2021 Arista Networks, Inc.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND Arista Networks DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_peer-type_multipath-relax.py:
index 5131a89ce832512903b57e124b0842887fc78f71..f351dde7453f07af4a04adcbb134fa4adca244ab 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test prefix-list functionality:
index d51dc5f0c3089db0368953f6a1005781323d5af0..bfc083b5064036fe9b180132d1c25021f8c73bc3 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_prefix_sid.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by LINE Corporation
 # Copyright (c) 2020 by Hiroki Shirokura <slank.dev@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_prefix_sid.py: Test BGP topology with EBGP on prefix-sid
index 96c4b664bc3413b1f9e355f0a102ef1ef7fec4e3..d6b94329e4118978e270c00e0f23890ee0701e7d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_prefix_sid2.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by LINE Corporation
 # Copyright (c) 2020 by Hiroki Shirokura <slank.dev@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_prefix_sid2.py: Test BGP topology with EBGP on prefix-sid
index 04f866f35bcbdd08896b756a1ff2a31ada31f0cc..35459f6f68f9077ff000c976414eef64a6b2589d 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test bgp recursive route and ebgp
index 8d1e834986f71495c04dc2d82cd3f316837ef0d7..97366ebd5338784563bba0b6fea149e5cb8d7c5e 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_reject_as_sets.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if an aggregated route with AS_SET is not sent to peers.
index 1108919e13268db7e326fb68fcf8bda8998ba9ad..11342374471194a912c3987940af42fb9d1026ac 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_remove_private_as.py
@@ -6,20 +7,6 @@
 # Copyright (C) 2022  NVIDIA Corporation
 # Trey Aspelund
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NVIDIA BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_remove_private_as.py tests the following conditions:
index c82fe8321d39035be8bc800765125639908fec21..c789fa8c188cec29ae5f2dbecc76dff3b174a8f7 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -7,20 +8,6 @@
 # Network Device Education Foundation, Inc. ("NetDEF")
 # Modified by LabN Consulting, L.L.C.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 customize.py: Simple FRR MPLS L3VPN test topology
index fa04aaf366a61bb8438670a2635949af7e8e6166..7534dce1b3d5e3f816794061f0a8f93a96db3f2b 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index d34ac3cdda36a7a0ffde641cd4bcac38e11b94aa..5c7cc8eae36b33a06728bee570ed90d8a1a60da7 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if route-map extcommunity none works:
index d72fd19b91323b8b67fe3b30779582823d7403a4..52fda695c3cd7ff543cf43c9ed8df3b09bb6c2e1 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 #
 # test_bgp_roles_capability.py
 # Part of NetDEF Topology Tests
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_roles_capability: test bgp roles negotiation
index c5827d7a9eb630f98862f9f23dbd374b2b2d3a83..b3715863b58365c092d984b2222db92365cb44b2 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 #
 # test_bgp_roles_filtering.py
 # Part of NetDEF Topology Tests
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_roles_filtering: test leaks prevention and mitigation with roles
index 8c9d2c9dbf4988258db0b73e5f38f23a9b999bfa..412ecc12efe81beadddc2f6878002f2821a89e08 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test bgp aggregation functionality:
index 77bddbe3372491e5abcc8df38a52397b37dde672..e300e8d8db3c83caf72341161cd3bcea804a7f17 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import time
index 589482d6a594ca17650598dc2466c04d6297715d..95906ecbdb0b0d9b7dfdbd5f8adcf361c0420be3 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """Following tests are covered to test route-map functionality.
 TC_57:
index 8c86526bf15b341acf4040531f3fcd23f66231a9..a06e3edc44e053594f58bb11a0e2fe5ff0246b7a 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if we can match BGP prefixes by next-hop which is
diff --git a/tests/topotests/bgp_route_map_vpn_import/__init__.py b/tests/topotests/bgp_route_map_vpn_import/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_route_map_vpn_import/r1/bgpd.conf b/tests/topotests/bgp_route_map_vpn_import/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..c9ad0b1
--- /dev/null
@@ -0,0 +1,46 @@
+!
+debug bgp updates
+debug bgp vpn leak-from-vrf
+debug bgp vpn leak-to-vrf
+debug bgp nht
+debug route-map
+!
+router bgp 65001
+ bgp router-id 10.10.10.10
+ no bgp ebgp-requires-policy
+!
+router bgp 65001 vrf Customer
+ bgp router-id 192.168.1.2
+ no bgp ebgp-requires-policy
+ address-family ipv4 unicast
+  redistribute connected
+  rd vpn export 192.168.1.2:2
+  rt vpn import 192.168.1.2:2
+  rt vpn export 192.168.1.2:2
+  export vpn
+  import vpn
+ exit-address-family
+!
+router bgp 65001 vrf Service
+ bgp router-id 192.168.2.2
+ no bgp ebgp-requires-policy
+ address-family ipv4 unicast
+  redistribute connected
+  rd vpn export 192.168.2.2:2
+  rt vpn import 192.168.2.2:2 192.168.1.2:2
+  rt vpn export 192.168.2.2:2
+  route-map vpn import from-customer
+  export vpn
+  import vpn
+ exit-address-family
+!
+bgp extcommunity-list standard from-customer seq 5 permit rt 192.168.1.2:2
+!
+ip prefix-list p1 seq 5 permit 192.0.2.0/24
+!
+route-map from-customer permit 10
+ match extcommunity from-customer
+ match ip address prefix-list p1
+ set local-preference 123
+route-map from-customer permit 20
+!
diff --git a/tests/topotests/bgp_route_map_vpn_import/r1/zebra.conf b/tests/topotests/bgp_route_map_vpn_import/r1/zebra.conf
new file mode 100644 (file)
index 0000000..51966b2
--- /dev/null
@@ -0,0 +1,16 @@
+!
+interface lo
+ ip address 10.10.10.10/32
+!
+interface r1-eth0 vrf Customer
+ ip address 192.168.1.2/24
+!
+interface r1-eth1 vrf Service
+ ip address 192.168.2.2/24
+!
+interface r1-eth2
+ ip address 10.0.1.1/24
+!
+interface r1-eth3 vrf Customer
+ ip address 192.0.2.1/24
+!
diff --git a/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py b/tests/topotests/bgp_route_map_vpn_import/test_bgp_route_map_vpn_import.py
new file mode 100644 (file)
index 0000000..37082b4
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+# SPDX-License-Identifier: ISC
+
+#
+# Copyright (c) 2022 by
+# Donatas Abraitis <donatas@opensourcerouting.org>
+#
+
+"""
+Test if `route-map vpn import NAME` works by setting/matching via route-maps.
+Routes from VRF Customer to VRF Service MUST be leaked and modified later
+with `route-map vpn import`.
+"""
+
+import os
+import sys
+import json
+import pytest
+import functools
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.common_config import step
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    tgen.add_router("r1")
+
+    switch = tgen.add_switch("s1")
+    switch.add_link(tgen.gears["r1"])
+
+    switch = tgen.add_switch("s2")
+    switch.add_link(tgen.gears["r1"])
+
+    switch = tgen.add_switch("s3")
+    switch.add_link(tgen.gears["r1"])
+
+    switch = tgen.add_switch("s4")
+    switch.add_link(tgen.gears["r1"])
+
+
+def setup_module(mod):
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+
+    r1 = tgen.gears["r1"]
+
+    r1.run("ip link add Customer type vrf table 1001")
+    r1.run("ip link set up dev Customer")
+    r1.run("ip link set r1-eth0 master Customer")
+    r1.run("ip link add Service type vrf table 1002")
+    r1.run("ip link set up dev Service")
+    r1.run("ip link set r1-eth1 master Service")
+    r1.run("ip link set r1-eth3 master Customer")
+
+    router_list = tgen.routers()
+
+    for i, (rname, router) in enumerate(router_list.items(), 1):
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_route_map_vpn_import():
+    tgen = get_topogen()
+
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    r1 = tgen.gears["r1"]
+
+    def _bgp_check_received_leaked_with_vpn_import():
+        output = json.loads(r1.vtysh_cmd("show bgp vrf Service ipv4 unicast json"))
+        expected = {
+            "routes": {
+                "192.0.2.0/24": [
+                    {
+                        "locPrf": 123,
+                    },
+                ],
+                "192.168.1.0/24": [
+                    {
+                        "locPrf": None,
+                    }
+                ],
+            }
+        }
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_check_received_leaked_with_vpn_import)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
+    assert result is None, "Failed, imported routes are not modified"
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 21088f7008bd30f4bbe890d11af64ab23afdbac2..23cf041b681c835804b9e1372de74fd82e566a2c 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if we send ONLY GUA address for route-server-client peers.
index cf8315f5942ca6a3b395cf3954ec0bbac14930fd..9984abaa856176f6f6cc2d5b59998a87cd05e128 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_rr_ibgp_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_rr_ibgp_topo1.py: Testing IBGP with RR and no IGP
index ebeab05648e9670372b469b10f64825bd642701f..3886bc17723a5db05f5c3c01ede5ae102deb5091 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_sender-as-path-loop-detection.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if neighbor <neighbor> sender-as-path-loop-detection
index d5549ae899b841aeb26630e145a9365a16433a51..463df2f2a6881984c906b57e0edcb3c1ac0d5464 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_set_aspath_replace.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if `set as-path replace` is working correctly for route-maps.
index ec9c8a41c904edfae00734ea8231338f3f47bb17..292cf70d3617dd1e824f920342e0bbd711950081 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_set_local-preference_add_subtract.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_set_local-preference_add_subtract.py:
index 53ca10930b6d2f7bfac86f0e2fda37866408d8fd..583d89d40f02aaaf0b94e44a55f225580e2e66d2 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test some of the BGP4V2-MIB entries.
index bc53dfb469bc361bafb841c151e6fe518c8e7c6e..0131e12579b3f48dc085fdab2661485383b07306 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_snmp_mplsl3vpn.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_snmp_mplsl3vpn.py: Test mplsL3Vpn MIB [RFC4382].
diff --git a/tests/topotests/bgp_software_version/__init__.py b/tests/topotests/bgp_software_version/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/topotests/bgp_software_version/r1/bgpd.conf b/tests/topotests/bgp_software_version/r1/bgpd.conf
new file mode 100644 (file)
index 0000000..80a05b3
--- /dev/null
@@ -0,0 +1,8 @@
+!
+router bgp 65001
+ no bgp ebgp-requires-policy
+ neighbor 192.168.1.2 remote-as external
+ neighbor 192.168.1.2 timers 1 3
+ neighbor 192.168.1.2 timers connect 1
+ neighbor 192.168.1.2 capability software-version
+!
diff --git a/tests/topotests/bgp_software_version/r1/zebra.conf b/tests/topotests/bgp_software_version/r1/zebra.conf
new file mode 100644 (file)
index 0000000..b29940f
--- /dev/null
@@ -0,0 +1,4 @@
+!
+int r1-eth0
+ ip address 192.168.1.1/24
+!
diff --git a/tests/topotests/bgp_software_version/r2/bgpd.conf b/tests/topotests/bgp_software_version/r2/bgpd.conf
new file mode 100644 (file)
index 0000000..c8ab017
--- /dev/null
@@ -0,0 +1,7 @@
+router bgp 65002
+ no bgp ebgp-requires-policy
+ neighbor 192.168.1.1 remote-as external
+ neighbor 192.168.1.1 timers 1 3
+ neighbor 192.168.1.1 timers connect 1
+ neighbor 192.168.1.1 capability software-version
+!
diff --git a/tests/topotests/bgp_software_version/r2/zebra.conf b/tests/topotests/bgp_software_version/r2/zebra.conf
new file mode 100644 (file)
index 0000000..cffe827
--- /dev/null
@@ -0,0 +1,4 @@
+!
+int r2-eth0
+ ip address 192.168.1.2/24
+!
diff --git a/tests/topotests/bgp_software_version/test_bgp_software_version.py b/tests/topotests/bgp_software_version/test_bgp_software_version.py
new file mode 100644 (file)
index 0000000..55327b7
--- /dev/null
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2022 by
+# Donatas Abraitis <donatas@opensourcerouting.org>
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+"""
+Test if Software Version capability works if forced with a knob.
+Reference: https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability
+"""
+
+import os
+import re
+import sys
+import json
+import pytest
+import functools
+
+pytestmark = pytest.mark.bgpd
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def setup_module(mod):
+    topodef = {"s1": ("r1", "r2")}
+    tgen = Topogen(topodef, mod.__name__)
+    tgen.start_topology()
+
+    router_list = tgen.routers()
+
+    for i, (rname, router) in enumerate(router_list.items(), 1):
+        router.load_config(
+            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+        )
+        router.load_config(
+            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+        )
+
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def test_bgp_software_version():
+    tgen = get_topogen()
+
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    r1 = tgen.gears["r1"]
+
+    def _bgp_converge():
+        output = json.loads(r1.vtysh_cmd("show bgp summary json"))
+        expected = {"ipv4Unicast": {"peers": {"192.168.1.2": {"state": "Established"}}}}
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(
+        _bgp_converge,
+    )
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Can't converge"
+
+    def _bgp_check_software_version():
+        output = json.loads(r1.vtysh_cmd("show bgp neighbor 192.168.1.2 json"))
+
+        try:
+            versions = output["192.168.1.2"]["neighborCapabilities"]["softwareVersion"]
+            adv = versions["advertisedSoftwareVersion"]
+            rcv = versions["receivedSoftwareVersion"]
+
+            if not adv and not rcv:
+                return False
+
+            pattern = "^FRRouting/\\d.+"
+            if re.search(pattern, adv) and re.search(pattern, rcv):
+                return True
+        except:
+            return False
+
+        return False
+
+    assert _bgp_check_software_version(), "Neighbor's software version is n/a"
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index e3a7334c607776c8ae211d7408fcb1b2700410c8..967bed021358a8f69a26a5f66c3fb72d31fb95e6 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if BGP SoO per neighbor works correctly. Routes having SoO
index 0b8870cdcac1321665ce7e8736f2e920c865a467..9e529059e7432c657a590f24327d691bc8d153e1 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import re
index 16f8adb3c512d0bdd0df635353ab0e23f85bd52b..900d0c296e085569ee76b90c3cede07d22f13c9b 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022, LINE Corporation
 # Authored by Ryoga Saito <ryoga.saito@linecorp.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import re
index 7c23d4c576462a0e96486abc911deb0f77039ed1..fdc1f4eec3156f33bc4c8e929802a54f80d349d0 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index 1209e9d6e3789a24bcbb7350b27ecab3156790a7..a1202f5d93df7b5b1143417f3fd9820ae75f9055 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2018, LabN Consulting, L.L.C.
 # Authored by Lou Berger <lberger@labn.net>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import re
index 61ac7418a456fcb339ef0cc9d1ebba4f8f9b6ff4..eb0f30f84a5890218ff6f4e070ae472c69c575ea 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022, University of Rome Tor Vergata
 # Authored by Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import re
index 6d2b65a6140f5f2b37617deac2019bccd3fcb4c1..ed8e41903f179d9e5f02ce763f6ad0fd2c28b2f9 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_suppress_fib.py
 #
 # Copyright (c) 2019 by
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 """
index acf89835e1bc66e3e1c4a2bab4b56291cbd856b5..e7948eaaac47edb948024c5fb8d24e25f1e3e20e 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_tcp_mss.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Abhinay Ramesh <rabhinay@vmware.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_tcp_mss.py:
index 7094c2805d1729f12b1dea3e81bfa4534ed9946c..6fe044fceac61278b617980f36afe9cedd1a34e8 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # bgp_tcp_mss.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Shreenidhi A R <rshreenidhi@vmware.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 bgp_tcp_mss_vrf.py:
index 7156310536d01c5177e3a375b527ccd270018012..47b2452b81bdce2d1fe38202ec0a42ced7b0ad47 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import time
index e009efee87c753002cdfa597e3ee0d01bd544740..2a9e42dffbc56604e2d32ff770b510d4a37687e5 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import time
index de4c4cff3747a30b64798812681ebcad1a08dee8..2a53547f59bde0c1abfa2755e4801de983b975af 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2022 by
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test some bgp interface based issues that show up
index 1c00c492ec75f9358f086932329dc023b9fc92b9..4e66cf5548ab17068138ee282dd8a8b2a2d003e4 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_update_delay.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Don Slice <dslice@nvidia.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test the ability to define update-delay to delay bestpath, rib install
index e567d3654fb8b0e9f09490bf41f50b89779a89bf..533af19d93fc2fbde59cd58b7ed040305b62918e 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Check if we can override VPN underlay next-hop from PE1 to PE2.
index cd8a9b6d6f9bafbbd2a25f387da3225c737dd3a1..342bad20abe3c8857761fa86a00fdc105e4118c0 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_vpnv4_ebgp.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2022 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_vpnv4_ebgp.py: Test the FRR BGP daemon with EBGP direct connection
index f562f4417994d64e23c2ba0c54c5a707e3ba3e13..6f313be628f0f3d59471eaf32569180b054827d4 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_vpnv4_gre.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2021 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_vpnv4_gre.py: Test the FRR BGP daemon with BGP IPv6 interface
index ed5cc3faf66187ce950daf74f96e56ded3b04153..9b8ae4b7e3303736e46b2d07007156d0f8040407 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_vpnv4_noretain.py
@@ -6,20 +7,6 @@
 #
 # Copyright 2022 6WIND S.A.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_vpnv4_noretain.py: Do not keep the VPNvx entries when no
@@ -134,12 +121,21 @@ def teardown_module(_mod):
 
 
 def router_json_cmp_exact_filter(router, cmd, expected):
-    # filter out tableVersion, version and nhVrfID
-    output = router.cmd('vtysh -c "{}" | grep -v ersion | grep -v nhVrfId'.format(cmd))
+    output = router.vtysh_cmd(cmd)
     logger.info("{}: {}\n{}".format(router.name, cmd, output))
 
     json_output = json.loads(output)
 
+    # filter out tableVersion, version and nhVrfID
+    json_output.pop("tableVersion")
+    for rd, data in json_output["routes"]["routeDistinguishers"].items():
+        for prefix, attrs in data.items():
+            for attr in attrs:
+                if "nhVrfId" in attr:
+                    attr.pop("nhVrfId")
+                if "version" in attr:
+                    attr.pop("version")
+
     return topotest.json_cmp(json_output, expected, exact=True)
 
 
index 7d71ef761e6126ec142f7a5314207d0835984868..c34c3ebe163b8b7e384e3bc845309dbb64c634dd 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index f193317b1e01a1093063a90e60369aea3c931a42..6b9dc3e94ae933eb6421ffb9497169c6145c04b0 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index a9aefc5003d6541439d8db432ca6ea857bc76f71..1787021ebcf3765ff0bdc63704b36f2ea94b21e3 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index c51beca72afcd381012844287a64bf04401cfb50..c7fbc01eb19b9b8031386a463bc379ccf51a90aa 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index bfeaaa17df171c81aaaa7c8ec21238cbdcadb52f..02950eb3d28f0b526036452c43b6b0580c48c9c7 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index 1d80a2a64a8113ec43421522884748ee4c3f396c..4b18903429df30155c65e57e5069a4f61afce9ac 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP Multi-VRF Dynamic Route Leaking:
index dd27ad3ed1538edd3594faefc929f9558380bb7b..244db6c46a182abe8ace9efd439a05ef95f87c01 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022, LINE Corporation
 # Authored by Ryoga Saito <ryoga.saito@linecorp.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import re
index 36243407d88292e6a6eb83702f25fd652e9b2aaf..42cbf1e33e75d92615ab5761663e389bba0ec034 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by
 # Donatas Abraitis <donatas@opensourcerouting.org>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 If we overwrite import/export RT list via route-maps or even flush by using
index b95e71c2eb17e8d44e4f6c05ab3f7f954ce3e332..934c4dc05fda54b7de7d6a1ce5dd1b6f737d8e02 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP VRF Lite:
index 9291fbd9661c190a08a4f1f73a034dc0264f2832..5d939643808886e50a0c782cb5e344ec0138904a 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test BGP VRF Lite:
index b70e2731552f8b69c7bf1d2789886d5aae894641..32239e9618054201b734febe4cc506cfff31f3b0 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_ipv6_rtadv.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2019 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
  test_bgp_ipv6_rtadv.py: Test the FRR BGP daemon with BGP IPv6 interface
index c380cc10bf15db352ec4bbb4dc1d5fd4cac27543..8457b752afafad9ab177b1092f9cf63e527f2459 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_vrf_netns_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2018 by 6WIND
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_vrf_netns_topo1.py: Test BGP topology with EBGP on NETNS VRF
index 191a0b53ec2820c1742178a598972d5e04075689..fd7ffff17cc4ab506a5f1022fa96eb0fba40101f 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp-vrf-route-leak-basic.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2018 Cumulus Networks, Inc.
 #                    Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND Cumulus Networks DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp-vrf-route-leak-basic.py.py: Test basic vrf route leaking
index 0e5508b56dbc6dad1faf952cfd71f9dfdc774eb1..fec9d485b5d3b0fe039f81871741dbabb8cb35c2 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # June 2 2021, Christian Hopps <chopps@labn.net>
 #
@@ -6,20 +7,6 @@
 # Copyright (c) 2019-2020 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test the timing of config operations.
index 7fe86cfabcfcc7f42c127bc855b853c190962eeb..072a2dd1341c1c7cac6392c84514e9ec743480d4 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_cspf_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2022 by Orange
 # Author: Olivier Dugeon <olivier.dugeon@orange.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_cspf_topo1.py: Test the FRR Constraint Shortest Path First algorithm.
index 70ce2efe851667d176a382b91b0ec985a7e5d859..aec20587ba395717391e077da5a24a9c715f1df0 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 cd "$(dirname "$0")"/..
 
index 1eaaea2971134861ed1dbfc786c2bbfa44c45d74..ce373d9bd082f523d9c30d562561286bba4ddac8 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 set -e
 
index 495beaf3cc401d9946772183f68fdf8e164955fd..3b296a149758bacc7499dce5199fcc3bc53063d3 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 set -e
 
index 451d0a27d98a29f9e25d2bf6fc3e6dbbfdd3990a..44e16db4b9ffc0095d5b97f7aaf9fab3d9f7b3c8 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 # Load shared functions
 CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
index d78d5006bc2d61b45cc8e67edc68f6ca5a9e1048..4ebacbb23970a1f939d7fc3451fd2ef50b4ac57d 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 FRR_HOST_DIR=/root/host-frr
 FRR_BUILD_DIR=/root/persist/frr-build
index 67142f04ce2384e143adc6f00fa5f3c7171e955e..926a25ca653f8fbf36dbb8c36d7d74d670dba026 100755 (executable)
@@ -1,26 +1,7 @@
 #!/bin/bash
+# SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 # Load shared functions
 CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
index 8b7c9fc6d79875be2502506acf9a32397e59174a..3c9392c3f58db8123d04d965389f6754b7a6551d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_eigrp_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_eigrp_topo1.py: Testing EIGRP
index 6d5c096c0a17c31d601d3b9d72c9abb8af5e15ba..c0621d75a50601b4090224f133b20f36a4e43392 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_evpn-pim_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_evpn_pim_topo1.py: Testing evpn-pim
index e92c1c30d119ddfc1812539d14318cd6d5b1ab10..45868663a8c65ba7092b1d2d67577aaeb16e4cb1 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test EVPN-Type5 functionality:
index 3ce6c6cb5c394676f30cda85e3304a40affb4399..10d216ab1ed4746a93e2be63d27eaf974bd6fe82 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test EVPN-Type5 functionality:
index 4c073f259ca17a84e3a0687320f646987fdc6d22..27975483a84ffb655833823224edb5917d20e41f 100644 (file)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: ISC
 #
 # <template>.py
 # Part of NetDEF Topology Tests
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 <template>.py: Test <template>.
index 42e8bc6e7a0592eab2577b823744330784ca5de9..7a53260a193a3a42961873b9d0e109688c86ff7b 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # September 5 2021, Christian Hopps <chopps@labn.net>
 #
@@ -6,20 +7,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 <template>.py: Test <template>.
index fe4a2564849ef22b3065eb1a996df75aff6ca540..49afc82f4360a3aa14c48abdd42da3c4618b0ed3 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 <example>.py: Test <example tests>.
index 8bc28528dc161640658fd2e4e530d64826449dac..120399c829e4dc3960e56a8ee5b498a9555c04e6 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF")
 # in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 <example>.py: Test <example tests>.
index caf0a7c1385f3b519fb9ad2b20f3224a2a45e4c4..4f3a8d82abf9c1c065ae3059e901f1ca55b13e0d 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 <example>.py: Test <example tests>.
index 6bd0be9fd981f23c80ed9b4a0ee598d3c3f9851c..88bfa98d2ff2959036ca6894085a31b174e86ed8 100644 (file)
@@ -1,23 +1,10 @@
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # February 21 2022, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2022, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 """
 test_basic_grpc.py: Test Basic gRPC.
 """
index 012814919d79749edd4b600a5cbe0ba175312a8c..44b3dd0b7927597e485bfe8b2a15805e63294b40 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_tilfa_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_lfa_topo1.py:
index 9b4cd95110c756ba26c0b176864ad3fa03fb75bc..c4ce6a30cd4348e9e734df99901f86e53ae4421d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_lsp_bits_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2021 by  Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_lsp_bits_topo1.py:
index ba0543a82d018a495310b0b45bc2a781868866a4..15327fe03adfe72a11fe6ffdfcf1bda3744f003e 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_rlfa_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_rlfa_topo1.py:
index 206291a85fcfac8ca68e3025956eb8a5244fbb35..ddef08008b4394fe0fedd5614673b7912f20fd03 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_snmp.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_snmp.py:
index b3b14b557bcad68e9a0e18fa055bab89f75e2b5e..fc2ce7cb4b666bd915d6e828f05de29644374b79 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_sr_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_sr_te_topo1.py:
index 40a7b76afd43488698e558917a9ee818f2c0c194..40b87e3a9e8de478e62c6e43c1ca1a6d8def5e3f 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_sr_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_sr_topo1.py:
diff --git a/tests/topotests/isis_te_topo1/reference/ted_step10.json b/tests/topotests/isis_te_topo1/reference/ted_step10.json
new file mode 100644 (file)
index 0000000..7d017b3
--- /dev/null
@@ -0,0 +1,969 @@
+{
+  "ted":{
+    "name":"ISIS",
+    "key":1,
+    "verticesCount":4,
+    "edgesCount":16,
+    "subnetsCount":24,
+    "vertices":[
+      {
+        "vertex-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r1",
+        "router-id":"10.0.255.1"
+      },
+      {
+        "vertex-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r2",
+        "router-id":"10.0.255.2"
+      },
+      {
+        "vertex-id":3,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r3",
+        "router-id":"10.0.255.3",
+        "router-id-v6":"2001:db8:1000::3"
+      },
+      {
+        "vertex-id":4,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r4",
+        "router-id":"10.0.255.4",
+        "segment-routing":{
+          "srgb-size":10000,
+          "srgb-lower":10000,
+          "algorithms":[
+            {
+              "0":"SPF"
+            }
+          ],
+          "srlb-size":1000,
+          "srlb-lower":5000,
+          "msd":12
+        }
+      }
+    ],
+    "edges":[
+      {
+        "edge-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000000",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              128
+            ]
+          },
+          "local-address-v6":"2001:db8::1",
+          "remote-address-v6":"2001:db8::2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8::2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65537,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:1",
+          "remote-address-v6":"2001:db8:1::1:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65538,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:2",
+          "remote-address-v6":"2001:db8:1::1:1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196610,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:3::3:2",
+          "remote-address-v6":"2001:db8:3::3:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196611,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address-v6":"2001:db8:3::3:3",
+          "remote-address-v6":"2001:db8:3::3:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196612,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:5::3:4",
+          "remote-address-v6":"2001:db8:5::4:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5001,
+            "flags":"0xb0",
+            "weight":0
+          }
+        ]
+      },
+      {
+        "edge-id":262147,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":10,
+          "local-address-v6":"2001:db8:5::4:3",
+          "remote-address-v6":"2001:db8:5::3:4",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":50000
+        }
+      },
+      {
+        "edge-id":167772161,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000000",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              128
+            ]
+          },
+          "local-address":"10.0.0.1",
+          "remote-address":"10.0.0.2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":167772162,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.0.2",
+          "remote-address":"10.0.0.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772417,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.1",
+          "remote-address":"10.0.1.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772418,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.2",
+          "remote-address":"10.0.1.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772930,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.3.2",
+          "remote-address":"10.0.3.3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772931,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address":"10.0.3.3",
+          "remote-address":"10.0.3.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167773186,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":30,
+          "local-address":"10.0.4.2",
+          "remote-address":"10.0.4.4",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":25000
+        }
+      },
+      {
+        "edge-id":167773188,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.4.4",
+          "remote-address":"10.0.4.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":20000,
+          "jitter":10000
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5000,
+            "flags":"0x30",
+            "weight":0
+          }
+        ]
+      }
+    ],
+    "subnets":[
+      {
+        "subnet-id":"10.0.0.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.0.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.3\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.4\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.1\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.2\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.3\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.4\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      },
+      {
+        "subnet-id":"2001:db8::1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8::2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::3:4\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::4:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::1\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::2\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::3\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::4\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":1400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      }
+    ]
+  }
+}
diff --git a/tests/topotests/isis_te_topo1/reference/ted_step7.json b/tests/topotests/isis_te_topo1/reference/ted_step7.json
new file mode 100644 (file)
index 0000000..447febc
--- /dev/null
@@ -0,0 +1,971 @@
+{
+  "ted":{
+    "name":"ISIS",
+    "key":1,
+    "verticesCount":4,
+    "edgesCount":16,
+    "subnetsCount":24,
+    "vertices":[
+      {
+        "vertex-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r1",
+        "router-id":"10.0.255.1"
+      },
+      {
+        "vertex-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r2",
+        "router-id":"10.0.255.2"
+      },
+      {
+        "vertex-id":3,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r3",
+        "router-id":"10.0.255.3",
+        "router-id-v6":"2001:db8:1000::3"
+      },
+      {
+        "vertex-id":4,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r4",
+        "router-id":"10.0.255.4",
+        "segment-routing":{
+          "srgb-size":10000,
+          "srgb-lower":10000,
+          "algorithms":[
+            {
+              "0":"SPF"
+            }
+          ],
+          "srlb-size":1000,
+          "srlb-lower":5000,
+          "msd":12
+        }
+      }
+    ],
+    "edges":[
+      {
+        "edge-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000001",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              32,
+              128
+            ]
+          },
+          "local-address-v6":"2001:db8::1",
+          "remote-address-v6":"2001:db8::2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8::2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65537,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:1",
+          "remote-address-v6":"2001:db8:1::1:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65538,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:2",
+          "remote-address-v6":"2001:db8:1::1:1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196610,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:3::3:2",
+          "remote-address-v6":"2001:db8:3::3:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196611,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address-v6":"2001:db8:3::3:3",
+          "remote-address-v6":"2001:db8:3::3:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196612,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:5::3:4",
+          "remote-address-v6":"2001:db8:5::4:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5001,
+            "flags":"0xb0",
+            "weight":0
+          }
+        ]
+      },
+      {
+        "edge-id":262147,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":10,
+          "local-address-v6":"2001:db8:5::4:3",
+          "remote-address-v6":"2001:db8:5::3:4",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":50000
+        }
+      },
+      {
+        "edge-id":167772161,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000001",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              32,
+              128
+            ]
+          },
+          "local-address":"10.0.0.1",
+          "remote-address":"10.0.0.2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":167772162,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.0.2",
+          "remote-address":"10.0.0.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772417,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.1",
+          "remote-address":"10.0.1.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772418,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.2",
+          "remote-address":"10.0.1.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772930,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.3.2",
+          "remote-address":"10.0.3.3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772931,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address":"10.0.3.3",
+          "remote-address":"10.0.3.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167773186,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":30,
+          "local-address":"10.0.4.2",
+          "remote-address":"10.0.4.4",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":25000
+        }
+      },
+      {
+        "edge-id":167773188,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.4.4",
+          "remote-address":"10.0.4.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":20000,
+          "jitter":10000
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5000,
+            "flags":"0x30",
+            "weight":0
+          }
+        ]
+      }
+    ],
+    "subnets":[
+      {
+        "subnet-id":"10.0.0.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.0.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.3\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.4\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.1\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.2\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.3\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.4\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      },
+      {
+        "subnet-id":"2001:db8::1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8::2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::3:4\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::4:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::1\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::2\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::3\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::4\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":1400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      }
+    ]
+  }
+}
diff --git a/tests/topotests/isis_te_topo1/reference/ted_step8.json b/tests/topotests/isis_te_topo1/reference/ted_step8.json
new file mode 100644 (file)
index 0000000..510e034
--- /dev/null
@@ -0,0 +1,971 @@
+{
+  "ted":{
+    "name":"ISIS",
+    "key":1,
+    "verticesCount":4,
+    "edgesCount":16,
+    "subnetsCount":24,
+    "vertices":[
+      {
+        "vertex-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r1",
+        "router-id":"10.0.255.1"
+      },
+      {
+        "vertex-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r2",
+        "router-id":"10.0.255.2"
+      },
+      {
+        "vertex-id":3,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r3",
+        "router-id":"10.0.255.3",
+        "router-id-v6":"2001:db8:1000::3"
+      },
+      {
+        "vertex-id":4,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "name":"r4",
+        "router-id":"10.0.255.4",
+        "segment-routing":{
+          "srgb-size":10000,
+          "srgb-lower":10000,
+          "algorithms":[
+            {
+              "0":"SPF"
+            }
+          ],
+          "srlb-size":1000,
+          "srlb-lower":5000,
+          "msd":12
+        }
+      }
+    ],
+    "edges":[
+      {
+        "edge-id":1,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000002",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              33,
+              128
+            ]
+          },
+          "local-address-v6":"2001:db8::1",
+          "remote-address-v6":"2001:db8::2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":2,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8::2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65537,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:1",
+          "remote-address-v6":"2001:db8:1::1:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":65538,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:1::1:2",
+          "remote-address-v6":"2001:db8:1::1:1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196610,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:3::3:2",
+          "remote-address-v6":"2001:db8:3::3:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196611,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address-v6":"2001:db8:3::3:3",
+          "remote-address-v6":"2001:db8:3::3:2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":196612,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address-v6":"2001:db8:5::3:4",
+          "remote-address-v6":"2001:db8:5::4:3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5001,
+            "flags":"0xb0",
+            "weight":0
+          }
+        ]
+      },
+      {
+        "edge-id":262147,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":10,
+          "local-address-v6":"2001:db8:5::4:3",
+          "remote-address-v6":"2001:db8:5::3:4",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":50000
+        }
+      },
+      {
+        "edge-id":167772161,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":20,
+          "extAdminGroup":{
+            "words":[
+              "0x80000001",
+              "0x00000002",
+              "0x00000000",
+              "0x00000000",
+             "0x00000001"
+            ],
+            "bitPositions":[
+              0,
+              31,
+              33,
+              128
+            ]
+          },
+          "local-address":"10.0.0.1",
+          "remote-address":"10.0.0.2",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":10000,
+          "available-bandwidth":125000000.0
+        }
+      },
+      {
+        "edge-id":167772162,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.0.2",
+          "remote-address":"10.0.0.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772417,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "local-vertex-id":1,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.1",
+          "remote-address":"10.0.1.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772418,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":1,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.1.2",
+          "remote-address":"10.0.1.1",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772930,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":3,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.3.2",
+          "remote-address":"10.0.3.3",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167772931,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "local-vertex-id":3,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "admin-group":32,
+          "local-address":"10.0.3.3",
+          "remote-address":"10.0.3.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ]
+        }
+      },
+      {
+        "edge-id":167773186,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "local-vertex-id":2,
+        "remote-vertex-id":4,
+        "metric":10,
+        "edge-attributes":{
+          "te-metric":30,
+          "local-address":"10.0.4.2",
+          "remote-address":"10.0.4.4",
+          "max-link-bandwidth":99999997952,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":25000
+        }
+      },
+      {
+        "edge-id":167773188,
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "local-vertex-id":4,
+        "remote-vertex-id":2,
+        "metric":10,
+        "edge-attributes":{
+          "local-address":"10.0.4.4",
+          "remote-address":"10.0.4.2",
+          "max-link-bandwidth":1250000,
+          "max-resv-link-bandwidth":1250000,
+          "unreserved-bandwidth":[
+            {
+              "class-type-0":1250000
+            },
+            {
+              "class-type-1":1250000
+            },
+            {
+              "class-type-2":1250000
+            },
+            {
+              "class-type-3":1250000
+            },
+            {
+              "class-type-4":1250000
+            },
+            {
+              "class-type-5":1250000
+            },
+            {
+              "class-type-6":1250000
+            },
+            {
+              "class-type-7":1250000
+            }
+          ],
+          "delay":20000,
+          "jitter":10000
+        },
+        "segment-routing":[
+          {
+            "adj-sid":5000,
+            "flags":"0x30",
+            "weight":0
+          }
+        ]
+      }
+    ],
+    "subnets":[
+      {
+        "subnet-id":"10.0.0.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.0.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.1\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.1.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.3.3\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.2\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.4.4\/24",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.1\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.2\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.3\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"10.0.255.4\/32",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      },
+      {
+        "subnet-id":"2001:db8::1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8::2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:1\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:1::1:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:2\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:3::3:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::3:4\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:5::4:3\/64",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::1\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0001",
+        "vertex-id":1,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::2\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0002",
+        "vertex-id":2,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::3\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0003",
+        "vertex-id":3,
+        "metric":10
+      },
+      {
+        "subnet-id":"2001:db8:ffff::4\/128",
+        "status":"Sync",
+        "origin":"ISIS_L2",
+        "advertised-router":"0000.0000.0004",
+        "vertex-id":4,
+        "metric":10,
+        "segment-routing":{
+          "pref-sid":1400,
+          "algo":0,
+          "flags":"0x60"
+        }
+      }
+    ]
+  }
+}
diff --git a/tests/topotests/isis_te_topo1/reference/ted_step9.json b/tests/topotests/isis_te_topo1/reference/ted_step9.json
new file mode 120000 (symlink)
index 0000000..1c01a91
--- /dev/null
@@ -0,0 +1 @@
+ted_step8.json
\ No newline at end of file
index 0e453d30e3cee5506a2652b72ba8a837d83a8258..9c70e05784fc2ef8c68303d3d16d12962c913795 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_te_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by Orange
 # Author: Olivier Dugeon <olivier.dugeon@orange.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_te_topo1.py: Test the FRR IS-IS with Traffic Engineering.
@@ -250,6 +237,60 @@ def test_step6():
         compare_ted_json_output(tgen, rname, "ted_step6.json")
 
 
+def test_step7():
+    "Step7: Set extended admin-group on r1-eth0"
+
+    tgen = setup_testcase("Step7: Modify link parameters on r1")
+
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "affinity-map WHITE bit-position 0"')
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "affinity-map RED bit-position 31"')
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "affinity-map GREEN bit-position 32"')
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "affinity-map BLACK bit-position 128"')
+
+    tgen.net["r1"].cmd(
+        'vtysh -c "conf t" -c "interface r1-eth0" -c "link-params" -c "affinity RED WHITE BLACK GREEN"'
+    )
+
+    for rname in ["r1", "r2", "r3", "r4"]:
+        compare_ted_json_output(tgen, rname, "ted_step7.json")
+
+
+def test_step8():
+    "Step8: Change value of affinity-map GREEN"
+
+    tgen = setup_testcase("Step8: Change value of affinity-map GREEN")
+
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "affinity-map GREEN bit-position 33"')
+
+    for rname in ["r1", "r2", "r3", "r4"]:
+        compare_ted_json_output(tgen, rname, "ted_step8.json")
+
+
+def test_step9():
+    "Step9: Trying to remove affinity-map GREEN. \
+    Must not succeed because in use"
+
+    tgen = setup_testcase("Step9: Trying to remove affinity-map GREEN")
+
+    tgen.net["r1"].cmd('vtysh -c "conf t" -c "no affinity-map GREEN"')
+
+    for rname in ["r1", "r2", "r3", "r4"]:
+        compare_ted_json_output(tgen, rname, "ted_step9.json")
+
+
+def test_step10():
+    "Step10: Removing r1-eth0 affinity GREEN"
+
+    tgen = setup_testcase("Step10: Removing r1-eth0 affinity GREEN")
+
+    tgen.net["r1"].cmd(
+        'vtysh -c "conf t" -c "interface r1-eth0" -c "link-params" -c "no affinity GREEN"'
+    )
+
+    for rname in ["r1", "r2", "r3", "r4"]:
+        compare_ted_json_output(tgen, rname, "ted_step10.json")
+
+
 def test_memory_leak():
     "Run the memory leak test and report results."
 
index 213439d3f5558ab226923434e49c577f7706e027..1ed52ab76d5c49f5d3d9ab0f0a36ade14a027271 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_tilfa_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_tilfa_topo1.py:
index 8b6c3772b8d9406a11831f5d892a191938027997..608ef48ff4b9ec91a491afb2d6743c75b3793183 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_isis_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_topo1.py: Test ISIS topology.
index ff9ad6150a227c5cd6676f27b3623ecf954e8d40..032319c446a111614b569bda913e45d72ea54741 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by  Niral Networks, Inc. ("Niral Networks")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_isis_topo1_vrf.py: Test ISIS vrf topology.
index 01f3fe18284e80b9fdd63511ba6372ac40b62ab3..c2bcaa84ceb2929fe9cf42429b43fb3264507b4f 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_oc_acl_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ldp_oc_acl_topo1.py: Simple FRR LDP Test
index 4faaf45c17d86deccf254d111b1b776029f1ba33..387fd89c20d37674aef9722b37323b49781a8acd 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_oc_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ldp_oc_topo1.py: Simple FRR LDP Test
index b198f2936060229b4d092ce26cfb3ebd72ab2e70..52a67d8bb8da55fea4372879c1939fd732ec1ece 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_isis_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ldp_vpls_topo1.py:
index 48584f042a73cd19afb09338c11680c1dd1257c2..cb6b784d6d3625180f34ec48efdcab9239741a7b 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_isis_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ldp_vpls_topo1.py:
index dc6e1a7671384851fe4f437fafe97e66448cecaf..760b4e3df566ec40e183b90f817f9ae9d7bd1686 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_ospf_topo1.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ldp_vpls_topo1.py:
index cb8adfb55db693b200c6e691d61a4ae4ca8d3663..fdd75581a3ec5cb789517a0498d19819e562a718 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_multiview_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2016 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ldp_topo1.py: Simple FRR LDP Test
index 8a41ea510e11b5c5b4339adc02532d9a0c58c2fa..1f4a4b5fd59526abb7a15f1a0ef0a2b4924eb772 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ldp_vpls_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ldp_vpls_topo1.py:
index aa7b4a21742d4d544b7868a6d8deedc1bfeb3f44..a0b12b2d6425b138ccaee1e404e23c9a0548f777 100644 (file)
@@ -1,22 +1,9 @@
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import ipaddress
 import sys
index 35a57d0a9991214c8253c0dee990b02fcfaec729..cd449cb50c727beb2c8deaa1de9d7879df8e32b2 100644 (file)
@@ -1,20 +1,7 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: GPL-2.0-or-later
 
 # Copyright 2018, LabN Consulting, L.L.C.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 #
 # want_rd_routes = [
index 8ed37d1a824849570f56da0f4009ee79f15361dc..3e02769d873a5db0afb8595161456f1ea82c5ac0 100644 (file)
@@ -1,22 +1,9 @@
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import ipaddress
 import json
index 9d8f63aacdfe654aa7c02ccb7c7c24f43d4e2d39..042ed09d42a37ea3e9edf25eaf12855ebf8747b5 100644 (file)
@@ -1,26 +1,9 @@
 # -*- coding: utf-8 eval: (yapf-mode 1) -*-
+# SPDX-License-Identifier: MIT
 #
 # August 27 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C. ("LabN")
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 import lib.topojson as topojson
 import lib.topogen as topogen
index 61f01c36bb6fdf8a26a52e5c300c754f453c106f..6457bbefdd54a3f3fdf86838906ff6dc7d3f19d3 100755 (executable)
@@ -1,27 +1,10 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: MIT
 #
 # February 22 2022, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2022, LabN Consulting, L.L.C.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 
 import argparse
 import logging
index 2544023c435d0dc9ddddbb514d7ea899ad38b110..e897a81035799cd7d29665038862125da63e9f93 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Part of NetDEF Topology Tests
@@ -6,20 +7,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 ltemplate.py: LabN template for FRR tests.
index 62c21e9ce4eaa6ffe0b84bf87563fb823c6e7ffb..9aef41cd1cd7b5061a027f24c13407ea11dbd5cc 100644 (file)
@@ -1,20 +1,7 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: GPL-2.0-or-later
 
 # Copyright 2017, LabN Consulting, L.L.C.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 import os
 import re
index 30beccb7870be0aeed12d084f48a1c8ab8ebdd9f..8a8251010c2537ed45f487ad8c8f34d7b8ed55ef 100755 (executable)
@@ -1,19 +1,8 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # Copyright (C) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
 
 """
 Subscribe to a multicast group so that the kernel sends an IGMP JOIN
index ba3d59823cd97834bf57dcb1c1bc5cfabdb27410..13810091682ef4e61c7d6dbc9a2cd5e143262c76 100644 (file)
@@ -1,23 +1,10 @@
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # July 9 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 import datetime
 import logging
 import os
index ef804f6dc261233fd9f6c2393cec3f5dc14a0b00..e54b75f71014bfbcdf08394c782c7acf3f6d5d8f 100644 (file)
@@ -1,23 +1,10 @@
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # July 24 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 import argparse
 import logging
 import os
index a3d3f4c685f85dea1a8e186d68d31631438d9679..5a69c56d8dde7e259c18a7157e765d39b32d5991 100644 (file)
@@ -1,23 +1,10 @@
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # July 11 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 
 import glob
 import logging
index 59ae1a2559f374ff3a91b247b3168e548e74ba6c..7609c7f89973ed0a0b7770f3ee609c788400b950 100644 (file)
@@ -1,26 +1,14 @@
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import ipaddress
 import sys
 from copy import deepcopy
+from time import sleep
 
 # Import common_config to use commomnly used APIs
 from lib.common_config import (
@@ -201,6 +189,24 @@ def __create_ospf_global(tgen, input_dict, router, build, load_config, ospf):
             cmd = "no maximum-paths"
         config_data.append(cmd)
 
+    # Flood reduction.
+    flood_data = ospf_data.setdefault("flood-reduction", {})
+    if flood_data:
+        cmd = "flood-reduction"
+        del_action = ospf_data.setdefault("del_flood_reduction", False)
+        if del_action:
+            cmd = "no flood-reduction"
+        config_data.append(cmd)
+
+    # LSA refresh timer - A hidden command.
+    refresh_data = ospf_data.setdefault("lsa-refresh", {})
+    if refresh_data:
+        cmd = "ospf lsa-refresh {}".format(refresh_data)
+        del_action = ospf_data.setdefault("del_lsa_refresh", False)
+        if del_action:
+            cmd = "no ospf lsa-refresh"
+        config_data.append(cmd)
+
     # redistribute command
     redistribute_data = ospf_data.setdefault("redistribute", {})
     if redistribute_data:
@@ -233,6 +239,9 @@ def __create_ospf_global(tgen, input_dict, router, build, load_config, ospf):
                 if "type" in area:
                     cmd = cmd + " {}".format(area["type"])
 
+                if "flood-reduction" in area:
+                    cmd = cmd + " flood-reduction"
+
                 del_action = area.setdefault("delete", False)
                 if del_action:
                     cmd = "no {}".format(cmd)
@@ -737,9 +746,6 @@ def verify_ospf_neighbor(
     return result
 
 
-################################
-# Verification procs
-################################
 @retry(retry_timeout=50)
 def verify_ospf6_neighbor(tgen, topo=None, dut=None, input_dict=None, lan=False):
     """
@@ -1352,8 +1358,10 @@ def verify_ospf_interface(
     return result
 
 
-@retry(retry_timeout=20)
-def verify_ospf_database(tgen, topo, dut, input_dict, expected=True):
+@retry(retry_timeout=40)
+def verify_ospf_database(
+    tgen, topo, dut, input_dict, vrf=None, lsatype=None, rid=None, expected=True
+):
     """
     This API is to verify ospf lsa's by running
     show ip ospf database command.
@@ -1411,7 +1419,23 @@ def verify_ospf_database(tgen, topo, dut, input_dict, expected=True):
     rnode = tgen.routers()[dut]
 
     logger.info("Verifying OSPF interface on router %s:", dut)
-    show_ospf_json = run_frr_cmd(rnode, "show ip ospf database json", isjson=True)
+
+    if not rid:
+        rid = "self-originate"
+    if lsatype:
+        if vrf is None:
+            command = "show ip ospf database {} {} json".format(lsatype, rid)
+        else:
+            command = "show ip ospf database {} {} vrf {} json".format(
+                lsatype, rid, vrf
+            )
+    else:
+        if vrf is None:
+            command = "show ip ospf database json"
+        else:
+            command = "show ip ospf database vrf {} json".format(vrf)
+
+    show_ospf_json = run_frr_cmd(rnode, command, isjson=True)
     # Verifying output dictionary show_ospf_json is empty or not
     if not bool(show_ospf_json):
         errormsg = "OSPF is not running"
@@ -1420,26 +1444,40 @@ def verify_ospf_database(tgen, topo, dut, input_dict, expected=True):
     # for inter and inter lsa's
     ospf_db_data = input_dict.setdefault("areas", None)
     ospf_external_lsa = input_dict.setdefault("AS External Link States", None)
+    # import pdb; pdb.set_trace()
     if ospf_db_data:
         for ospf_area, area_lsa in ospf_db_data.items():
-            if ospf_area in show_ospf_json["areas"]:
-                if "Router Link States" in area_lsa:
-                    for lsa in area_lsa["Router Link States"]:
+            if ospf_area in show_ospf_json["routerLinkStates"]["areas"]:
+                if "routerLinkStates" in area_lsa:
+                    for lsa in area_lsa["routerLinkStates"]:
+                        _advrtr = lsa.setdefault("advertisedRouter", None)
+                        _options = lsa.setdefault("options", None)
+
                         if (
-                            lsa
-                            in show_ospf_json["areas"][ospf_area]["Router Link States"]
+                            _options
+                            and lsa["lsaId"]
+                            == show_ospf_json["routerLinkStates"]["areas"][ospf_area][
+                                0
+                            ]["linkStateId"]
+                            and lsa["options"]
+                            == show_ospf_json["routerLinkStates"]["areas"][ospf_area][
+                                0
+                            ]["options"]
                         ):
-                            logger.info(
-                                "[DUT: %s]  OSPF LSDB area %s:Router " "LSA %s",
-                                router,
-                                ospf_area,
-                                lsa,
-                            )
                             result = True
+                            break
                         else:
-                            errormsg = (
-                                "[DUT: {}]  OSPF LSDB area {}: expected"
-                                " Router LSA is {}".format(router, ospf_area, lsa)
+                            errormsg = '[DUT: {}]  OSPF LSA options: expected {}, Received Options are {} lsa["options"] {} OSPF LSAID: expected lsaid {}, Received lsaid {}'.format(
+                                dut,
+                                show_ospf_json["routerLinkStates"]["areas"][ospf_area][
+                                    0
+                                ]["options"],
+                                _options,
+                                lsa["options"],
+                                show_ospf_json["routerLinkStates"]["areas"][ospf_area][
+                                    0
+                                ]["linkStateId"],
+                                lsa["lsaId"],
                             )
                             return errormsg
                 if "Net Link States" in area_lsa:
@@ -2489,3 +2527,495 @@ def verify_ospf_gr_helper(tgen, topo, dut, input_dict=None):
 
     logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
     return result
+
+
+def get_ospf_database(tgen, topo, dut, input_dict, vrf=None, lsatype=None, rid=None):
+    """
+    This API is to return ospf lsa's by running
+    show ip ospf database command.
+
+    Parameters
+    ----------
+    * `tgen` : Topogen object
+    * `dut`: device under test
+    * `input_dict` : Input dict data, required when configuring from testcase
+    * `topo` : next to be verified
+    * `vrf` : vrf to be checked
+    * `lsatype` : type of lsa to be checked
+    * `rid` : router id for lsa to be checked
+    Usage
+    -----
+    input_dict = {
+        "areas": {
+        "0.0.0.0": {
+            "routerLinkStates": {
+                "100.1.1.0-100.1.1.0": {
+                    "LSID": "100.1.1.0",
+                    "Advertised router": "100.1.1.0",
+                    "LSA Age": 130,
+                    "Sequence Number": "80000006",
+                    "Checksum": "a703",
+                    "Router links": 3
+                }
+            },
+            "networkLinkStates": {
+                "10.0.0.2-100.1.1.1": {
+                    "LSID": "10.0.0.2",
+                    "Advertised router": "100.1.1.1",
+                    "LSA Age": 137,
+                    "Sequence Number": "80000001",
+                    "Checksum": "9583"
+                }
+            },
+        },
+        }
+    }
+    result = get_ospf_database(tgen, topo, dut, input_dict)
+
+    Returns
+    -------
+    True or False (Error Message)
+    """
+
+    result = False
+    router = dut
+    logger.debug("Entering lib API: {}".format(sys._getframe().f_code.co_name))
+    sleep(10)
+    if "ospf" not in topo["routers"][dut]:
+        errormsg = "[DUT: {}] OSPF is not configured on the router.".format(dut)
+        return errormsg
+
+    rnode = tgen.routers()[dut]
+
+    logger.info("Verifying OSPF interface on router %s:", dut)
+    if not rid:
+        rid = "self-originate"
+    if lsatype:
+        if vrf is None:
+            command = "show ip ospf database {} {} json".format(lsatype, rid)
+        else:
+            command = "show ip ospf database {} {} vrf {} json".format(
+                lsatype, rid, vrf
+            )
+    else:
+        if vrf is None:
+            command = "show ip ospf database json"
+        else:
+            command = "show ip ospf database vrf {} json".format(vrf)
+
+    show_ospf_json = run_frr_cmd(rnode, command, isjson=True)
+    # Verifying output dictionary show_ospf_json is empty or not
+    if not bool(show_ospf_json):
+        errormsg = "OSPF is not running"
+        return errormsg
+
+    # for inter and inter lsa's
+    ospf_db_data = input_dict.setdefault("areas", None)
+    ospf_external_lsa = input_dict.setdefault("asExternalLinkStates", None)
+
+    if ospf_db_data:
+        for ospf_area, area_lsa in ospf_db_data.items():
+            if "areas" in show_ospf_json and ospf_area in show_ospf_json["areas"]:
+                if "routerLinkStates" in area_lsa:
+                    for lsa in area_lsa["routerLinkStates"]:
+                        for rtrlsa in show_ospf_json["areas"][ospf_area][
+                            "routerLinkStates"
+                        ]:
+                            _advrtr = lsa.setdefault("advertisedRouter", None)
+                            _options = lsa.setdefault("options", None)
+                            if (
+                                _advrtr
+                                and lsa["lsaId"] == rtrlsa["lsaId"]
+                                and lsa["advertisedRouter"]
+                                == rtrlsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                            if (
+                                _options
+                                and lsa["lsaId"] == rtrlsa["lsaId"]
+                                and lsa["options"] == rtrlsa["options"]
+                            ):
+                                result = True
+                                break
+
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Router " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                    else:
+                        errormsg = (
+                            "[DUT: {}]  OSPF LSDB area {}: expected"
+                            " Router LSA is {}\n found Router LSA: {}".format(
+                                router, ospf_area, lsa, rtrlsa
+                            )
+                        )
+                        return errormsg
+
+                if "networkLinkStates" in area_lsa:
+                    for lsa in area_lsa["networkLinkStates"]:
+                        for netlsa in show_ospf_json["areas"][ospf_area][
+                            "networkLinkStates"
+                        ]:
+                            if (
+                                lsa
+                                in show_ospf_json["areas"][ospf_area][
+                                    "networkLinkStates"
+                                ]
+                            ):
+                                if (
+                                    lsa["lsaId"] == netlsa["lsaId"]
+                                    and lsa["advertisedRouter"]
+                                    == netlsa["advertisedRouter"]
+                                ):
+                                    result = True
+                                    break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Network " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Network LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "summaryLinkStates" in area_lsa:
+                    for lsa in area_lsa["summaryLinkStates"]:
+                        for t3lsa in show_ospf_json["areas"][ospf_area][
+                            "summaryLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t3lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t3lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Summary " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Summary LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "nssaExternalLinkStates" in area_lsa:
+                    for lsa in area_lsa["nssaExternalLinkStates"]:
+                        for t7lsa in show_ospf_json["areas"][ospf_area][
+                            "nssaExternalLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t7lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t7lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Type7 " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Type7 LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "asbrSummaryLinkStates" in area_lsa:
+                    for lsa in area_lsa["asbrSummaryLinkStates"]:
+                        for t4lsa in show_ospf_json["areas"][ospf_area][
+                            "asbrSummaryLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t4lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t4lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:ASBR Summary " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            result = True
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " ASBR Summary LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "linkLocalOpaqueLsa" in area_lsa:
+                    for lsa in area_lsa["linkLocalOpaqueLsa"]:
+                        try:
+                            for lnklsa in show_ospf_json["areas"][ospf_area][
+                                "linkLocalOpaqueLsa"
+                            ]:
+                                if (
+                                    lsa["lsaId"] in lnklsa["lsaId"]
+                                    and "linkLocalOpaqueLsa"
+                                    in show_ospf_json["areas"][ospf_area]
+                                ):
+                                    logger.info(
+                                        (
+                                            "[DUT: FRR]  OSPF LSDB area %s:Opaque-LSA"
+                                            "%s",
+                                            ospf_area,
+                                            lsa,
+                                        )
+                                    )
+                                    result = True
+                                else:
+                                    errormsg = (
+                                        "[DUT: FRR] OSPF LSDB area: {} "
+                                        "expected Opaque-LSA is {}, Found is {}".format(
+                                            ospf_area, lsa, show_ospf_json
+                                        )
+                                    )
+                                    raise ValueError(errormsg)
+                                    return errormsg
+                        except KeyError:
+                            errormsg = "[DUT: FRR] linkLocalOpaqueLsa Not " "present"
+                            return errormsg
+            else:
+                if "routerLinkStates" in area_lsa:
+                    for lsa in area_lsa["routerLinkStates"]:
+                        for rtrlsa in show_ospf_json["routerLinkStates"]:
+                            _advrtr = lsa.setdefault("advertisedRouter", None)
+                            _options = lsa.setdefault("options", None)
+                            _age = lsa.setdefault("lsaAge", None)
+                            if (
+                                _options
+                                and lsa["options"]
+                                == show_ospf_json["routerLinkStates"][rtrlsa][
+                                    ospf_area
+                                ][0]["options"]
+                            ):
+                                result = True
+                                break
+                            if (
+                                _age is not "get"
+                                and lsa["lsaAge"]
+                                == show_ospf_json["routerLinkStates"][rtrlsa][
+                                    ospf_area
+                                ][0]["lsaAge"]
+                            ):
+                                result = True
+                                break
+
+                            if _age == "get":
+                                return "{}".format(
+                                    show_ospf_json["routerLinkStates"][rtrlsa][
+                                        ospf_area
+                                    ][0]["lsaAge"]
+                                )
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Router " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                    else:
+                        errormsg = (
+                            "[DUT: {}]  OSPF LSDB area {}: expected"
+                            " Router LSA is {}\n found Router LSA: {}".format(
+                                router,
+                                ospf_area,
+                                lsa,
+                                show_ospf_json["routerLinkStates"],
+                            )
+                        )
+                        return errormsg
+
+                if "networkLinkStates" in area_lsa:
+                    for lsa in area_lsa["networkLinkStates"]:
+                        for netlsa in show_ospf_json["areas"][ospf_area][
+                            "networkLinkStates"
+                        ]:
+                            if (
+                                lsa
+                                in show_ospf_json["areas"][ospf_area][
+                                    "networkLinkStates"
+                                ]
+                            ):
+                                if (
+                                    lsa["lsaId"] == netlsa["lsaId"]
+                                    and lsa["advertisedRouter"]
+                                    == netlsa["advertisedRouter"]
+                                ):
+                                    result = True
+                                    break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Network " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Network LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "summaryLinkStates" in area_lsa:
+                    for lsa in area_lsa["summaryLinkStates"]:
+                        for t3lsa in show_ospf_json["areas"][ospf_area][
+                            "summaryLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t3lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t3lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Summary " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Summary LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "nssaExternalLinkStates" in area_lsa:
+                    for lsa in area_lsa["nssaExternalLinkStates"]:
+                        for t7lsa in show_ospf_json["areas"][ospf_area][
+                            "nssaExternalLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t7lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t7lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:Type7 " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            break
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " Type7 LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "asbrSummaryLinkStates" in area_lsa:
+                    for lsa in area_lsa["asbrSummaryLinkStates"]:
+                        for t4lsa in show_ospf_json["areas"][ospf_area][
+                            "asbrSummaryLinkStates"
+                        ]:
+                            if (
+                                lsa["lsaId"] == t4lsa["lsaId"]
+                                and lsa["advertisedRouter"] == t4lsa["advertisedRouter"]
+                            ):
+                                result = True
+                                break
+                        if result:
+                            logger.info(
+                                "[DUT: %s]  OSPF LSDB area %s:ASBR Summary " "LSA %s",
+                                router,
+                                ospf_area,
+                                lsa,
+                            )
+                            result = True
+                        else:
+                            errormsg = (
+                                "[DUT: {}]  OSPF LSDB area {}: expected"
+                                " ASBR Summary LSA is {}".format(router, ospf_area, lsa)
+                            )
+                            return errormsg
+
+                if "linkLocalOpaqueLsa" in area_lsa:
+                    for lsa in area_lsa["linkLocalOpaqueLsa"]:
+                        try:
+                            for lnklsa in show_ospf_json["areas"][ospf_area][
+                                "linkLocalOpaqueLsa"
+                            ]:
+                                if (
+                                    lsa["lsaId"] in lnklsa["lsaId"]
+                                    and "linkLocalOpaqueLsa"
+                                    in show_ospf_json["areas"][ospf_area]
+                                ):
+                                    logger.info(
+                                        (
+                                            "[DUT: FRR]  OSPF LSDB area %s:Opaque-LSA"
+                                            "%s",
+                                            ospf_area,
+                                            lsa,
+                                        )
+                                    )
+                                    result = True
+                                else:
+                                    errormsg = (
+                                        "[DUT: FRR] OSPF LSDB area: {} "
+                                        "expected Opaque-LSA is {}, Found is {}".format(
+                                            ospf_area, lsa, show_ospf_json
+                                        )
+                                    )
+                                    raise ValueError(errormsg)
+                                    return errormsg
+                        except KeyError:
+                            errormsg = "[DUT: FRR] linkLocalOpaqueLsa Not " "present"
+                            return errormsg
+
+    if ospf_external_lsa:
+        for lsa in ospf_external_lsa:
+            try:
+                for t5lsa in show_ospf_json["asExternalLinkStates"]:
+                    if (
+                        lsa["lsaId"] == t5lsa["lsaId"]
+                        and lsa["advertisedRouter"] == t5lsa["advertisedRouter"]
+                    ):
+                        result = True
+                        break
+            except KeyError:
+                result = False
+            if result:
+                logger.info("[DUT: %s]  OSPF LSDB:External LSA %s", router, lsa)
+                result = True
+            else:
+                errormsg = (
+                    "[DUT: {}]  OSPF LSDB : expected"
+                    " External LSA is {}".format(router, lsa)
+                )
+                return errormsg
+
+    logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
+    return result
index 0af1ecf6a07fac2a6bf5b2add220c59bb907cebd..e5af24d419675569b5ba81492dc633bac1b8c61d 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: ISC
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
-#
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
 
 import datetime
 import os
index 0bb6a72092f64de3a0b90e9e0b53cb164b38daa7..377146e052b4d48c3b6dac32202e5810b818ca9d 100755 (executable)
@@ -1,28 +1,11 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: MIT
 #
 # July 29 2021, Christian Hopps <chopps@labn.net>
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C. ("LabN")
 #
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
 import argparse
 import logging
 import re
index c226899324560c8da5f9c4cf5a75df7595a35950..c11de64b1e1651030226d3b161f08241192d5def 100755 (executable)
@@ -1,22 +1,9 @@
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import sys
 import argparse
index d695443906309903ff76846e95dc723442ca538d..e7cd657b20274e629b108994de5a71d88538a4dd 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: ISC
 #
 # topogen.py
 # Library of helper functions for NetDEF Topology Tests
@@ -5,20 +6,6 @@
 # Copyright (c) 2020 by Volta Networks
 #
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 SNMP library to test snmp walks and gets
index 7b3c8593ccb9a9177f0e80178b6dc84f6616f699..ae58d9b2d1fd44cb4ceaf2ba888b492b16a4f1a6 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_json.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Tests for the json_cmp() function.
index d65d5baf37cdfc5b0042b588a758627dfa477ae5..5e171b2320bbb7c3501582289e4e18faad33ee74 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_run_and_expect.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Tests for the `run_and_expect(_type)()` functions.
index 7c2df003377412ea618ad788c74aeda232128efa..7b18daaa8ffbfd299bceae3623a805261d7bdaa0 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_version.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Tests for the version_cmp() function.
index 04712eda874065e2ae6d7c72455adf61067b4d08..16d89f079a720d9182c3055336b2796f91e80b41 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: ISC
 #
 # topogen.py
 # Library of helper functions for NetDEF Topology Tests
@@ -5,20 +6,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Topogen (Topology Generator) is an abstraction around Topotest and Mininet to
index b49b09e63625ae6fd1be0550aec76cfdd2e71caa..53e6945bee1ad0d4e3f1fa8101e8ad2dfdf44520 100644 (file)
@@ -1,22 +1,9 @@
+# SPDX-License-Identifier: ISC
 #
 # Modified work Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Original work Copyright (c) 2018 by Network Device Education
 # Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import json
 import ipaddress
index 9cc3386206824d9e28c48580738ecb827023064a..b50167078982dc5ac038e5193f0719a4c5cce361 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: ISC
 #
 # topolog.py
 # Library of helper functions for NetDEF Topology Tests
@@ -5,20 +6,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Logging utilities for topology tests.
index 7f68b4ccf3e2760faf5d4c3ae27794ad41198e26..0cd60b228d0803fd8ddc32d7310ceca88d732e29 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # topotest.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2016 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import difflib
 import errno
@@ -595,6 +582,29 @@ def iproute2_is_vrf_capable():
             pass
     return False
 
+def iproute2_is_fdb_get_capable():
+    """
+    Checks if the iproute2 version installed on the system is capable of
+    handling `bridge fdb get` commands to query neigh table resolution.
+
+    Returns True if capability can be detected, returns False otherwise.
+    """
+
+    if is_linux():
+        try:
+            subp = subprocess.Popen(
+                ["bridge", "fdb", "get", "help"],
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                stdin=subprocess.PIPE,
+            )
+            iproute2_out = subp.communicate()[1].splitlines()[0].split()[0]
+
+            if "Usage" in str(iproute2_out):
+                return True
+        except Exception:
+            pass
+    return False
 
 def module_present_linux(module, load):
     """
index 138e1909865740d8d0e6e22ebe95a0f41055905e..2f31608e64223825f88830dfa5c377485afa3f02 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_msdp_mesh_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (C) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_msdp_mesh_topo1.py: Test the FRR PIM MSDP mesh groups.
index 46ccd5e599c87cffbe54f4ed9e0717c4a87d705d..4a007e7d2074a2c7d92de730b45f4be3f23c5846 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_msdp_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_msdp_topo1.py: Test the FRR PIM MSDP peer.
index a6f876f066f4dc11f61f5488f98b5372d873e831..95b4004e14a837e437dc9c194c5d6690c7b55a99 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test Multicast basic functionality:
index b615b9b824d3a477099df4599b4f76e1c7419970..2fedb6e517e58eac224c3fdd3723b4aa644f0e45 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test Multicast basic functionality:
index 1f62cb24c912ea3bbf5ceb93b5fb3841c8c93225..9ee411206d073e3a98122bc253a117a642e4d34d 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test PIM BSM processing basic functionality:
index 9ad9f0021c8a5326be580a5013a134ec5efeb890..302a778585044f26854a90ac6226e41c50b462a0 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test PIM BSM processing basic functionality:
index 7034696a8c2ccbef8731c5ad7885731f2cf98fd7..00d38fe647dcb2d0864f472b77e58472896b13b2 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 7c6928f6619a90a8c3ab7a0033e518224957c842..7c509cd0917dd9be0dc278365bc221e4364e4b56 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 181151649f391efaeb5190c8d5de39e12fa39b04..19870010027c1040af8bdd4e2faeb9ab4ad02da6 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 531fea95b43ecad45afa9ebf1521d51dd528efe1..1de6eac8975d9dca01ec5cc2fdad0b8236179cb6 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 044f378fb0a02925cdd9e83bfcf329bd0da98795..17f52cb86050445bc82e92eb3b6cac93cbc9f1d6 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 16603ae2d51e5c1d26eb17b98a78c8d21a8ffda4..2ffd3a3ac0ef914188eb37449d827ef1b1c358e9 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 91ee026022d9b028812650620be2a2c6602802ab..825281afbb0171879ce6e6d24701db5b5d100fe0 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim sm:
index 772f0751ef4c45b833df5f5ced66abd0feb06246..c492d95d40afd273a5d9c16226c2b46b6694c591 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test Multicast basic functionality:
index 06f3c4110b4af04efd2de610a52fb7064499cdc4..690c92f58087aa81d06dbe25dd2ee1bfb8374776 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test Multicast basic functionality:
index 088b54e33e7484a66b675c25dc5954e98ba1be34..8aa2e4efa1eb839c270690cc97ae6afd538703fd 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test Multicast basic functionality:
index a750c7fdba731f68d7abb6a511a7230879ec2a23..b50573e77564e2a0a3908b7b79d90516b98bbf51 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Following tests are covered to test multicast pim uplink:
index e6e551906a981f6acb17fa0d4509c5c12e82baa6..879f5250ec730ef64c66aa9b578919a97236afc7 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_nhrp_topo.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2019 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_nhrp_topo.py: Test the FRR/Quagga NHRP daemon
index 553f9361863afe23a4e17f2776eef1f0c0a89a63..ec15ff9b1a37067036771cbd5d264edc75876196 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # test_ospf6_ecmp_inter_area.py
 #
@@ -6,20 +7,6 @@
 # Copyright (c) 2016 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ospf6_ecmp_inter_area.py: Test OSPFv3 ECMP inter-area nexthop update
index 1876dabed736a72cbdba0c6811ed236e8a6ed39a..aa43b977b02f471d334db236209b2a6103565c5d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf6_gr_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf6_gr_topo1.py:
index 53d84e6192451f6dee68d5c9a98f31795f271661..5649757010c3172b9c64b37da2cdce938b1bb50d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf6_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2016 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ospf6_topo1.py:
index f823d5aeffbd03e3aa3f202e64f02f92c8e6a194..f982990987b5427540310e0d3ef67f75e6f80b07 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf6_topo1_vrf.py
@@ -8,20 +9,6 @@
 # Used Copyright (c) 2016 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 r"""
 test_ospf6_topo1_vrf.py:
index f16e8f396e02c8962a0fcdc6603b749f029b1fad..9ec0266aa0f48217c5c5d534a174754d400b4b60 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf6_topo2.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf6_topo2.py: Test the FRR OSPFv3 daemon.
diff --git a/tests/topotests/ospf_basic_functionality/ospf_flood_reduction.json b/tests/topotests/ospf_basic_functionality/ospf_flood_reduction.json
new file mode 100644 (file)
index 0000000..74443cd
--- /dev/null
@@ -0,0 +1,214 @@
+{
+
+    "ipv4base": "10.0.0.0",
+    "ipv4mask": 24,
+    "link_ip_start": {
+        "ipv4": "10.0.0.0",
+        "v4mask": 24
+    },
+    "lo_prefix": {
+        "ipv4": "1.0.",
+        "v4mask": 32
+    },
+    "routers": {
+        "r0": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "type": "loopback"
+                },
+                "r1": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r2": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r3": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4,
+                        "network": "point-to-point"
+                    }
+                }
+            },
+            "ospf": {
+                "router_id": "100.1.1.0",
+                "neighbors": {
+                    "r1": {},
+                    "r2": {},
+                    "r3": {}
+                },
+                "graceful-restart": {
+                    "helper-only": []
+                }
+            }
+        },
+        "r1": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "type": "loopback"
+                },
+                "r0": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r2": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.1",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r3": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r3-link0": {
+                    "ipv4": "auto",
+                    "description": "DummyIntftoR3"
+                }
+            },
+            "ospf": {
+                "router_id": "100.1.1.1",
+                "neighbors": {
+                    "r0": {},
+                    "r2": {},
+                    "r3": {}
+                },
+                "graceful-restart": {
+                    "helper-only": []
+                }
+            }
+        },
+        "r2": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "type": "loopback"
+                },
+                "r0": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r1": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.1",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r3": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.2",
+                        "hello_interval": 1,
+                        "dead_interval": 4,
+                        "network": "broadcast"
+                    }
+                }
+            },
+            "ospf": {
+                "router_id": "100.1.1.2",
+                "area": [
+                    {
+                        "id": "0.0.0.2",
+                        "type": "nssa"
+                    }
+                ],
+                "neighbors": {
+                    "r1": {},
+                    "r0": {},
+                    "r3": {}
+                },
+                "graceful-restart": {
+                    "helper-only": []
+                }
+            }
+        },
+        "r3": {
+            "links": {
+                "lo": {
+                    "ipv4": "auto",
+                    "type": "loopback"
+                },
+                "r0": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4,
+                        "network": "point-to-point"
+                    }
+                },
+                "r1": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.0",
+                        "hello_interval": 1,
+                        "dead_interval": 4
+                    }
+                },
+                "r2": {
+                    "ipv4": "auto",
+                    "ospf": {
+                        "area": "0.0.0.2",
+                        "hello_interval": 1,
+                        "dead_interval": 4,
+                        "network": "broadcast"
+                    }
+                },
+                "r1-link0": {
+                    "ipv4": "auto",
+                    "description": "DummyIntftoR1",
+                    "ospf": {
+                        "area": "0.0.0.0"
+                    }
+                }
+            },
+            "ospf": {
+                "router_id": "100.1.1.3",
+                "area": [
+                    {
+                        "id": "0.0.0.2",
+                        "type": "nssa"
+                    }
+                ],
+                "neighbors": {
+                    "r0": {},
+                    "r1": {},
+                    "r2": {}
+                },
+                "graceful-restart": {
+                    "helper-only": []
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
index af21290dd6f7ba1ce947352ab824e5bc807b9e0d..3d15e94a51e0bfcbd8d176a5ce128cf606521cc7 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Summarisation Functionality Automation."""
index 9886339796585839dff6a4c925c06083d73d7d2f..cff59c3a40618977497ab3218195db6c5848209d 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Summarisation Functionality Automation."""
index 8a94bf1178819b33eb18e7a8e5e295e61018f058..40df0b230861da07c5f49950784570769f772642 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 27c6954d2b55b6bdc8d7fd0f6974e6f7d975b374..124b36a5fa34df6db8a369dd3c57b4052a730b5f 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index d6bcbd0fcc3cf2f7aefe3c8a0c023f854149a9bc..d58e2503edcb61a10a5a3f4c1149765c3f54658d 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 049c2b83f0733735ba6b2a35c1d4d3c77501a5aa..6a565571be3f75c75c89731ae98a1abad77d60c6 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_flood_reduction.py b/tests/topotests/ospf_basic_functionality/test_ospf_flood_reduction.py
new file mode 100644 (file)
index 0000000..bd7db64
--- /dev/null
@@ -0,0 +1,1066 @@
+#!/usr/bin/python
+
+#
+# Copyright (c) 2022 by VMware, Inc. ("VMware")
+# Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
+# ("NetDEF") in this file.
+#
+# Permission to use, copy, modify, and/or distribute this software
+# for any purpose with or without fee is hereby granted, provided
+# that the above copyright notice and this permission notice appear
+# in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+#
+
+
+"""OSPF Basic Functionality Automation."""
+import os
+import sys
+import time
+import pytest
+from time import sleep
+
+# Save the Current Working Directory to find configuration files.
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+sys.path.append(os.path.join(CWD, "../lib/"))
+
+pytestmark = [pytest.mark.ospfd, pytest.mark.staticd]
+# Global variables
+topo = None
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib.topolog import logger
+from lib.topojson import build_config_from_json
+
+# Import topoJson from lib, to create topology and initial configuration
+from lib.common_config import (
+    start_topology,
+    write_test_header,
+    write_test_footer,
+    reset_config_on_routers,
+    create_static_routes,
+    step,
+    topo_daemons,
+    shutdown_bringup_interface,
+    check_router_status,
+    start_topology,
+    write_test_header,
+    write_test_footer,
+    reset_config_on_routers,
+    create_static_routes,
+    step,
+    shutdown_bringup_interface,
+    check_router_status,
+    start_topology,
+    write_test_header,
+    write_test_footer,
+    reset_config_on_routers,
+    stop_router,
+    start_router,
+    step,
+    create_static_routes,
+    kill_router_daemons,
+    check_router_status,
+    start_router_daemons,
+)
+from lib.topolog import logger
+from lib.topogen import Topogen, get_topogen
+
+from lib.topojson import build_config_from_json
+from lib.ospf import (
+    verify_ospf_neighbor,
+    clear_ospf,
+    create_router_ospf,
+    verify_ospf_database,
+    get_ospf_database,
+)
+
+# Global variables
+topo = None
+NETWORK = {
+    "ipv4": [
+        "11.0.20.1/32",
+        "11.0.20.2/32",
+        "11.0.20.3/32",
+        "11.0.20.4/32",
+        "11.0.20.5/32",
+    ]
+}
+"""
+TOPOOLOGY =
+      Please view in a fixed-width font such as Courier.
+      +---+  A1       +---+
+      +R1 +------------+R2 |
+      +-+-+-           +--++
+        |  --        --  |
+        |    -- A0 --    |
+      A0|      ----      |
+        |      ----      | A2
+        |    --    --    |
+        |  --        --  |
+      +-+-+-            +-+-+
+      +R0 +-------------+R3 |
+      +---+     A3     +---+
+
+TESTCASES =
+1. Verify OSPF Flood reduction functionality with ospf enabled on process level.
+2. Verify OSPF Flood reduction functionality with ospf enabled on area level.
+3. Verify OSPF Flood reduction functionality between different area's.
+4. Verify OSPF Flood reduction functionality with ospf enabled on process level with default lsa refresh timer.
+5. Chaos - Verify OSPF TTL GTSM and flood  reduction functionality in chaos scenarios.
+"""
+
+
+def setup_module(mod):
+    """
+    Sets up the pytest environment
+
+    * `mod`: module name
+    """
+    global topo
+    testsuite_run_time = time.asctime(time.localtime(time.time()))
+    logger.info("Testsuite start time: {}".format(testsuite_run_time))
+    logger.info("=" * 40)
+
+    logger.info("Running setup_module to create topology")
+
+    # This function initiates the topology build with Topogen...
+    json_file = "{}/ospf_flood_reduction.json".format(CWD)
+    tgen = Topogen(json_file, mod.__name__)
+    global topo
+    topo = tgen.json_topo
+    # ... and here it calls Mininet initialization functions.
+
+    # get list of daemons needs to be started for this suite.
+    daemons = topo_daemons(tgen)
+
+    # Starting topology, create tmp files which are loaded to routers
+    #  to start daemons and then start routers
+    start_topology(tgen)
+
+    # Creating configuration from JSON
+    build_config_from_json(tgen, topo)
+
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+    # Api call verify whether OSPF is converged
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    logger.info("Running setup_module() done")
+
+
+def teardown_module(mod):
+    """
+    Teardown the pytest environment.
+
+    * `mod`: module name
+    """
+
+    logger.info("Running teardown_module to delete topology")
+
+    tgen = get_topogen()
+
+    # Stop toplogy and Remove tmp files
+    tgen.stop_topology()
+
+    logger.info(
+        "Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
+    )
+    logger.info("=" * 40)
+
+
+
+def red_static(dut, config=True):
+    """Local def for Redstribute static routes inside ospf."""
+    global topo
+    tgen = get_topogen()
+    if config:
+        ospf_red = {dut: {"ospf": {"redistribute": [{"redist_type": "static"}]}}}
+    else:
+        ospf_red = {
+            dut: {
+                "ospf": {
+                    "redistribute": [{"redist_type": "static", "del_action": True}]
+                }
+            }
+        }
+    result = create_router_ospf(tgen, topo, ospf_red)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+
+# ##################################
+# Test cases start here.
+# ##################################
+def test_ospf_flood_red_tc1_p0(request):
+    """Verify OSPF Flood reduction functionality with ospf enabled on process level."""
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    tgen = get_topogen()
+
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+
+    global topo
+
+    step("Bring up the base config as per the topology")
+    reset_config_on_routers(tgen)
+    red_static("r0")
+    step("Base config should be up, verify using OSPF convergence on all the routers")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    input_dict = {
+        "r0": {
+            "static_routes": [
+                {
+                    "network": NETWORK["ipv4"][0],
+                    "no_of_ip": 5,
+                    "next_hop": "Null0",
+                }
+            ]
+        }
+    }
+    result = create_static_routes(tgen, input_dict)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Enable flood reduction in process level on R0")
+    ospf_flood = {"r0": {"ospf": {"flood-reduction": True}}}
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Configure the custom refresh timer")
+    ospf_flood = {"r0": {"ospf": {"lsa-refresh": 120}}}
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step("Enable flood. reduction in all the routers of the topology.")
+    for rtr in topo["routers"].keys():
+        ospf_flood = {rtr: {"ospf": {"lsa-refresh": 120, "flood-reduction": True}}}
+        result = create_router_ospf(tgen, topo, ospf_flood)
+        assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    for rtr in topo["routers"]:
+        dut = rtr
+        lsid = "{}".format(topo["routers"][rtr]["ospf"]["router_id"])
+        input_dict_db = {
+            "routerId": lsid,
+            "areas": {
+                "0.0.0.0": {
+                    "routerLinkStates": [
+                        {
+                            "lsaId": lsid,
+                            "options": "*|-|DC|-|-|-|E|-",
+                        },
+                    ]
+                }
+            },
+        }
+        result = verify_ospf_database(
+            tgen, topo, dut, input_dict_db, lsatype="router", rid=lsid
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(
+            tc_name, result
+        )
+
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    # this wait is put so that we wait for 5secs to check if lsa is refreshed.
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    assert (result1 == result2) is True, "Testcase {} : Failed \n Error: {}".format(
+        tc_name, result
+    )
+
+    step("Disable flood reduction in R0.")
+    ospf_flood = {
+        "r0": {"ospf": {"flood-reduction": True, "del_flood_reduction": True}}
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    clear_ospf(tgen, "r0")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lea's are not set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0", expected=False
+    )
+    assert result is not True, (
+        "Testcase {} : Failed \n "
+        "Expected: OSPF LSA should not be set with DC bit in {} \n "
+        "Found: {}".format(tc_name, dut, result)
+    )
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    if result2 is not result1:
+        result = True
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step(
+        "Enable flood reduction on each router with 10 secs delay of between each router."
+    )
+    for rtr in topo["routers"].keys():
+        ospf_flood = {rtr: {"ospf": {"lsa-refresh": 120, "flood-reduction": True}}}
+        sleep(10)
+        result = create_router_ospf(tgen, topo, ospf_flood)
+        assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    step("Verify that LSA's are not refreshed. Do not age bit should be set to 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step(
+        "Verify OSPF neighborship when OSPF flood reduction  is configured and ospf process is restarted"
+    )
+
+    step("Kill OSPFd daemon on R0.")
+    kill_router_daemons(tgen, "r0", ["ospfd"])
+    start_router_daemons(tgen, "r0", ["ospfd"])
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that LSA's are not refreshed. Do not age bit should be set to 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    write_test_footer(tc_name)
+
+
+def test_ospf_flood_red_tc2_p0(request):
+    """Verify OSPF Flood reduction functionality with ospf enabled on area level."""
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    tgen = get_topogen()
+
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+
+    global topo
+
+    step("Bring up the base config as per the topology")
+    reset_config_on_routers(tgen)
+    red_static("r0")
+    step("Base config should be up, verify using OSPF convergence on all the routers")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    input_dict = {
+        "r0": {
+            "static_routes": [
+                {
+                    "network": NETWORK["ipv4"][0],
+                    "no_of_ip": 5,
+                    "next_hop": "Null0",
+                }
+            ]
+        }
+    }
+    result = create_static_routes(tgen, input_dict)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Enable flood reduction in area level on R0 in area 0")
+    ospf_flood = {
+        "r0": {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Configure the custom refresh timer")
+    ospf_flood = {"r0": {"ospf": {"lsa-refresh": 120}}}
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step("Enable flood. reduction in all the routers of the topology.")
+    for rtr in topo["routers"].keys():
+        ospf_flood = {
+            rtr: {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+        }
+        result = create_router_ospf(tgen, topo, ospf_flood)
+        assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    for rtr in topo["routers"]:
+        dut = rtr
+        lsid = "{}".format(topo["routers"][rtr]["ospf"]["router_id"])
+        input_dict_db = {
+            "routerId": lsid,
+            "areas": {
+                "0.0.0.0": {
+                    "routerLinkStates": [
+                        {
+                            "lsaId": lsid,
+                            "options": "*|-|DC|-|-|-|E|-",
+                        },
+                    ]
+                }
+            },
+        }
+        result = verify_ospf_database(
+            tgen, topo, dut, input_dict_db, lsatype="router", rid=lsid
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    assert (result1 == result2) is True, "Testcase {} : Failed \n Error: {}".format(
+        tc_name, result
+    )
+
+    step("Disable flood reduction in R0.")
+    ospf_flood = {
+        "r0": {
+            "ospf": {
+                "area": [{"id": "0.0.0.0", "flood-reduction": True, "delete": True}]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    clear_ospf(tgen, "r0")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lea's are not set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0", expected=False
+    )
+    assert result is not True, (
+        "Testcase {} : Failed \n "
+        "Expected: OSPF LSA should not be set with DC bit in {} \n "
+        "Found: {}".format(tc_name, dut, result)
+    )
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    if result2 is not result1:
+        result = True
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step(
+        "Enable flood reduction on each router with 10 secs delay of between each router."
+    )
+    for rtr in topo["routers"].keys():
+        ospf_flood = {
+            rtr: {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+        }
+        sleep(10)
+        result = create_router_ospf(tgen, topo, ospf_flood)
+        assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    step("Verify that LSA's are not refreshed. Do not age bit should be set to 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    write_test_footer(tc_name)
+
+
+def test_ospf_flood_red_tc3_p0(request):
+    """Verify OSPF Flood reduction functionality between different area's"""
+    tc_name = request.node.name
+    write_test_header(tc_name)
+    tgen = get_topogen()
+
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        check_router_status(tgen)
+
+    global topo
+
+    step("Bring up the base config as per the topology")
+    reset_config_on_routers(tgen)
+    red_static("r0")
+    step("Base config should be up, verify using OSPF convergence on all the routers")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    input_dict = {
+        "r0": {
+            "static_routes": [
+                {
+                    "network": NETWORK["ipv4"][0],
+                    "no_of_ip": 5,
+                    "next_hop": "Null0",
+                }
+            ]
+        }
+    }
+    result = create_static_routes(tgen, input_dict)
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Enable flood reduction in area level on R0 in area 0")
+    ospf_flood = {
+        "r0": {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Configure the custom refresh timer")
+    ospf_flood = {"r0": {"ospf": {"lsa-refresh": 120}}}
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    step(
+        "Enable flood. reduction in all the routers of the topology in area 0. Redistribute static route in area 0 R1 and area1 in R2."
+    )
+    for rtr in topo["routers"].keys():
+        ospf_flood = {
+            rtr: {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+        }
+        result = create_router_ospf(tgen, topo, ospf_flood)
+        assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    sleep(10)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lsa's are set with dc bit 1.")
+    for rtr in topo["routers"]:
+        dut = rtr
+        lsid = "{}".format(topo["routers"][rtr]["ospf"]["router_id"])
+        input_dict_db = {
+            "routerId": lsid,
+            "areas": {
+                "0.0.0.0": {
+                    "routerLinkStates": [
+                        {
+                            "lsaId": lsid,
+                            "options": "*|-|DC|-|-|-|E|-",
+                        },
+                    ]
+                }
+            },
+        }
+        result = verify_ospf_database(
+            tgen, topo, dut, input_dict_db, lsatype="router", rid=lsid
+        )
+        assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    assert (result1 == result2) is True, "Testcase {} : Failed \n Error: {}".format(
+        tc_name, result
+    )
+
+    step("Enable flood reduction in area 1.")
+
+    ospf_flood = {
+        "r0": {"ospf": {"area": [{"id": "0.0.0.0", "flood-reduction": True}]}}
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r1": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True},
+                    {"id": "0.0.0.1", "flood-reduction": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r2": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True},
+                    {"id": "0.0.0.1", "flood-reduction": True},
+                    {"id": "0.0.0.2", "flood-reduction": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r3": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True},
+                    {"id": "0.0.0.2", "flood-reduction": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    for rtr in topo["routers"]:
+        clear_ospf(tgen, rtr)
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lea's are  set with dc bit 1.")
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.1",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.1",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.1"
+    )
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.1",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.1", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.1"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.1"
+    )
+
+    if result2 is result1:
+        result = True
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    step("Disable flood reduction in R0.")
+
+    ospf_flood = {
+        "r0": {
+            "ospf": {
+                "area": [{"id": "0.0.0.0", "flood-reduction": True, "delete": True}]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r1": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True, "delete": True},
+                    {"id": "0.0.0.1", "flood-reduction": True, "delete": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r2": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True, "delete": True},
+                    {"id": "0.0.0.1", "flood-reduction": True, "delete": True},
+                    {"id": "0.0.0.2", "flood-reduction": True, "delete": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    ospf_flood = {
+        "r3": {
+            "ospf": {
+                "area": [
+                    {"id": "0.0.0.0", "flood-reduction": True, "delete": True},
+                    {"id": "0.0.0.2", "flood-reduction": True, "delete": True},
+                ]
+            }
+        }
+    }
+    result = create_router_ospf(tgen, topo, ospf_flood)
+    assert result is True, "Testcase : Failed \n Error: {}".format(result)
+
+    clear_ospf(tgen, "r0")
+
+    ospf_covergence = verify_ospf_neighbor(tgen, topo)
+    assert ospf_covergence is True, "Testcase :Failed \n Error:" " {}".format(
+        ospf_covergence
+    )
+
+    step("Verify that ospf lea's are not set with dc bit 1.")
+    dut = "r0"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {
+                        "lsaId": "100.1.1.0",
+                        "options": "*|-|DC|-|-|-|E|-",
+                    },
+                ]
+            }
+        },
+    }
+    result = verify_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0", expected=False
+    )
+
+    assert result is not True, (
+        "Testcase {} : Failed \n "
+        "Expected: OSPF LSA should not be set with DC bit in {} \n "
+        "Found: {}".format(tc_name, dut, result)
+    )
+
+    step("Wait for 120 secs and verify that LSA's are not refreshed. ")
+    # get LSA age
+    dut = "r1"
+    input_dict_db = {
+        "routerId": "100.1.1.0",
+        "areas": {
+            "0.0.0.0": {
+                "routerLinkStates": [
+                    {"lsaId": "100.1.1.0", "lsaAge": "get"},
+                ]
+            }
+        },
+    }
+    sleep(10)
+
+    result1 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+    sleep(5)
+    result2 = get_ospf_database(
+        tgen, topo, dut, input_dict_db, lsatype="router", rid="100.1.1.0"
+    )
+
+    if result2 is not result1:
+        result = True
+    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
+    write_test_footer(tc_name)
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))
index 773e83bd95504c8bab1bf45887ac7ce00906db60..53b1be6d716d51771f7690e4fd695e537b84319d 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 7391379bb91cbbe8d045ece9e91537b242a477b3..0c4697cc212cbd69dc343893f4fe4c555e457e65 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 9e48f8e39bb0642c658fc4c9e33955a7c54f3b71..858412f1d35a1747fac98a16000170d8d3535efa 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index c41985e0fe94390b205ce1794abc1ee789c31085..dad6d915e8efa04281f0336e2955358f7460b2bc 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index b9da460909fc2462bfba42f3382d2693ee7df2b4..63c421ec8456abc6877f678eaaf136a23f89e35b 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 37f558b99cf9d98252e80918613288b18856a01d..39bbab42e7d0e3ad6791f3e0ab266412737aa7c0 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index f72cac4f1f797373fe27e5f7ad578907763b5975..1c265962304dc091283bcc368dc0df08bd10c2bd 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index a6b993d147af8c126256a0914929729d3b9bb031..a3ccb58d38e5726418059b8992773a5cfc695d51 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 0d3baeb15d02803cc1fca613d3b6342888c86e16..64aac2fba8abf5bdac25458277beae5a507075cf 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 429b7dc96d4f2c0928a40b1738bb042392304802..ca2a3b287c3cba864389a377eed009894499a401 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_gr_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_gr_topo1.py:
index 88c236d7a004e156432a679f0ecd023014ef0075..9dfe5e1b768381d9b132a8c79868d5e299f644b9 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_instance_redistribute.py
@@ -7,20 +8,6 @@
 # Nvidia, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_instance_redistribute
index 0b6b50ec068ad1690accadea2020e2c6dd3742a1..792304e19d382bd0c41cd8295b298c1269c16504 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_multi_vrf_bgp_route_leak.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2022 ATCorp
 # Jafar Al-Gharaibeh
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import os
 import sys
index 621d8079dccb711a5ad3a98a7516a3e4d603c1f7..2716f63348c802e5cd9d0e42a2a8a773200caf78 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_netns_vrf.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_netns_vrf.py: Test OSPF with Network Namespace VRFs.
index 6e992674ac017031bbfa7ceca14564945dcbb87c..21ae14323137c9671a35a59e8897ce0c994630e9 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_sr_te_topo1.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2021 by
 # Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_sr_te_topo1.py:
index 96e37fdcc270f3e0c6f31f4e18651133c4ddd00c..936b438e9d7c28bcfeaf41e1000890a2b5ceae97 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_sr_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_sr_topo1.py:
index 5903649d67bf56d33fc1605471cb590171f3f8b8..5b1a53b895b33323c7238185731870c92acf29fd 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_suppres_fa.py
 # Carles Kishimoto
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_suppres_fa.py: Test OSPF suppress-fa feature
index 699cdc90546bcc8de6464b0ca78133bc6782a768..c8533cfbba61bbae220bd6fbb0d386b88ff6d45a 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_te_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by Orange
 # Author: Olivier Dugeon <olivier.dugeon@orange.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_te_topo1.py: Test the FRR OSPF with Traffic Engineering.
index 696cb90d0a6f5c325bd67ab1b4f02f1d4428b801..f939f3f578f087b48f87696f36beeb2b72796f41 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_tilfa_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_tilfa_topo1.py:
index 37facfc5da3c4e991bca56255bc58aecbb5304ba..a079f5698ff1113d1e942d522c758831cb73309c 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_topo1.py: Test the FRR OSPF routing daemon.
index a9640adca3311e7f4964157f0144f458beb13a38..d07f5dc5c9a0225db42c18c91cc5fad09d2c5d32 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_unnumbered.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_unnumbered.py: Test the OSPF unnumbered.
index 8fd202a0238d32fdd279c9b148070ebd7d734783..ab23744ed467f2c2b71b491bd92f9c981c6e8654 100755 (executable)
@@ -1,27 +1,10 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: MIT
 #
 # January 17 2022, Christian Hopps <chopps@labn.net>
 #
 # Copyright 2022, LabN Consulting, L.L.C.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
 import argparse
 import asyncio
 import logging
index 8d1355684750b95a27b057bc131627cd1e5bfc64..338691bbf3779a7eebd307721ed2f907d22d1180 100644 (file)
@@ -4,7 +4,12 @@ interface r1-eth0
   ip ospf dead-interval 10
   ip ospf area 1.2.3.4
 !
+interface r1-eth1
+  ip ospf hello-interval 2
+  ip ospf dead-interval 10
+  ip ospf area 1.2.3.4
+!
 router ospf
-  ospf router-id 192.168.0.1
+  ospf router-id 1.0.0.0
   capability opaque
 !
index aae87408c3237eee05961a259bf20854aed5e5fe..745159141d17882d373763858f89701bc20984b1 100644 (file)
@@ -2,3 +2,5 @@
 interface r1-eth0
  ip address 10.0.1.1/24
 !
+interface r1-eth1
+ ip address 10.0.4.1/24
index be0712742b0fd9f8348ca090b7d542c0f0e348b5..1bf2a0c7f214c44e786258d7dcc4e811c448f9eb 100644 (file)
@@ -10,6 +10,6 @@ interface r2-eth1
   ip ospf area 1.2.3.4
 !
 router ospf
-  ospf router-id 192.168.0.2
+  ospf router-id 2.0.0.0
   capability opaque
 !
index 77cd86a975a326db91c534a3bd3fb62a2735aa32..ecf2042b4286d6e5a58baf34db64d6dfeec776bb 100644 (file)
@@ -10,6 +10,6 @@ interface r3-eth1
   ip ospf area 1.2.3.4
 !
 router ospf
-  ospf router-id 192.168.0.3
+  ospf router-id 3.0.0.0
   capability opaque
 !
index 32e55d546ba9381084209115709a68ed20d603bd..4de8caeb17a1a52ee19761a29ff163d7e03e7e71 100644 (file)
@@ -4,7 +4,12 @@ interface r4-eth0
   ip ospf dead-interval 10
   ip ospf area 1.2.3.4
 !
+interface r4-eth1
+  ip ospf hello-interval 2
+  ip ospf dead-interval 10
+  ip ospf area 1.2.3.4
+!
 router ospf
-  ospf router-id 192.168.0.4
+  ospf router-id 4.0.0.0
   capability opaque
 !
index 702219720da2bb6d2a4dda9d45562d1d190bcbb5..233ffa5c7b34091c517e3f500580e348e147e1ac 100644 (file)
@@ -2,3 +2,5 @@
 interface r4-eth0
  ip address 10.0.3.4/24
 !
+interface r4-eth1
+ ip address 10.0.4.4/24
\ No newline at end of file
index 94c8c5c732faa6f2b7bb9da57e31d70e4dc30b77..b01c96226ef29e1c20ad5d97e57afe19b0368d4f 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (c) 2021-2022, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 
 """
 test_ospf_clientapi.py: Test the OSPF client API.
@@ -34,7 +21,7 @@ from datetime import datetime, timedelta
 import pytest
 
 from lib.common_config import retry, run_frr_cmd, step
-from lib.micronet import comm_error
+from lib.micronet import Timeout, comm_error
 from lib.topogen import Topogen, TopoRouter
 from lib.topotest import interface_set_status, json_cmp
 
@@ -56,15 +43,20 @@ assert os.path.exists(
 # Test Setup
 # ----------
 
+#
+#  r1 - r2
+#  |    |
+#  r4 - r3
+#
+
 
 @pytest.fixture(scope="function", name="tgen")
 def _tgen(request):
     "Setup/Teardown the environment and provide tgen argument to tests"
     nrouters = request.param
-    if nrouters == 1:
-        topodef = {"sw1:": ("r1",)}
-    else:
-        topodef = {f"sw{i}": (f"r{i}", f"r{i+1}") for i in range(1, nrouters)}
+    topodef = {f"sw{i}": (f"r{i}", f"r{i+1}") for i in range(1, nrouters)}
+    if nrouters == 4:
+        topodef["sw4"] = ("r4", "r1")
 
     tgen = Topogen(topodef, request.module.__name__)
     tgen.start_topology()
@@ -107,23 +99,23 @@ def verify_ospf_database(tgen, dut, input_dict, cmd="show ip ospf database json"
 def myreadline(f):
     buf = b""
     while True:
-        # logging.info("READING 1 CHAR")
+        # logging.debug("READING 1 CHAR")
         c = f.read(1)
         if not c:
             return buf if buf else None
         buf += c
-        # logging.info("READ CHAR: '%s'", c)
+        # logging.debug("READ CHAR: '%s'", c)
         if c == b"\n":
             return buf
 
 
-def _wait_output(p, regex, timeout=120):
-    retry_until = datetime.now() + timedelta(seconds=timeout)
-    while datetime.now() < retry_until:
+def _wait_output(p, regex, maxwait=120):
+    timeout = Timeout(maxwait)
+    while not timeout.is_expired():
         # line = p.stdout.readline()
         line = myreadline(p.stdout)
         if not line:
-            assert None, "Timeout waiting for '{}'".format(regex)
+            assert None, "EOF waiting for '{}'".format(regex)
         line = line.decode("utf-8")
         line = line.rstrip()
         if line:
@@ -131,7 +123,9 @@ def _wait_output(p, regex, timeout=120):
         m = re.search(regex, line)
         if m:
             return m
-    assert None, "Failed to get output withint {}s".format(timeout)
+    assert None, "Failed to get output matching '{}' withint {} actual {}s".format(
+        regex, maxwait, timeout.elapsed()
+    )
 
 
 # -----
@@ -141,12 +135,13 @@ def _wait_output(p, regex, timeout=120):
 
 def _test_reachability(tgen, testbin):
     waitlist = [
-        "192.168.0.1,192.168.0.2,192.168.0.4",
-        "192.168.0.2,192.168.0.4",
-        "192.168.0.1,192.168.0.2,192.168.0.4",
+        "1.0.0.0,2.0.0.0,4.0.0.0",
+        "2.0.0.0,4.0.0.0",
+        "1.0.0.0,2.0.0.0,4.0.0.0",
     ]
     r2 = tgen.gears["r2"]
     r3 = tgen.gears["r3"]
+    r4 = tgen.gears["r4"]
 
     wait_args = [f"--wait={x}" for x in waitlist]
 
@@ -164,10 +159,12 @@ def _test_reachability(tgen, testbin):
 
         step("reachable: check for modified reachability")
         interface_set_status(r2, "r2-eth0", False)
+        interface_set_status(r4, "r4-eth1", False)
         _wait_output(p, "SUCCESS: {}".format(waitlist[1]))
 
         step("reachable: check for restored reachability")
         interface_set_status(r2, "r2-eth0", True)
+        interface_set_status(r4, "r4-eth1", True)
         _wait_output(p, "SUCCESS: {}".format(waitlist[2]))
     except Exception as error:
         logging.error("ERROR: %s", error)
@@ -182,16 +179,16 @@ def _test_reachability(tgen, testbin):
 def test_ospf_reachability(tgen):
     testbin = os.path.join(TESTDIR, "ctester.py")
     rc, o, e = tgen.gears["r2"].net.cmd_status([testbin, "--help"])
-    logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
+    logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
     _test_reachability(tgen, testbin)
 
 
 def _test_router_id(tgen, testbin):
     r1 = tgen.gears["r1"]
     waitlist = [
-        "192.168.0.1",
+        "1.0.0.0",
         "1.1.1.1",
-        "192.168.0.1",
+        "1.0.0.0",
     ]
 
     mon_args = [f"--monitor={x}" for x in waitlist]
@@ -213,7 +210,7 @@ def _test_router_id(tgen, testbin):
         _wait_output(p, "SUCCESS: {}".format(waitlist[1]))
 
         step("router id: check for restored router id")
-        r1.vtysh_multicmd("conf t\nrouter ospf\nospf router-id 192.168.0.1")
+        r1.vtysh_multicmd("conf t\nrouter ospf\nospf router-id 1.0.0.0")
         _wait_output(p, "SUCCESS: {}".format(waitlist[2]))
     except Exception as error:
         logging.error("ERROR: %s", error)
@@ -228,7 +225,7 @@ def _test_router_id(tgen, testbin):
 def test_ospf_router_id(tgen):
     testbin = os.path.join(TESTDIR, "ctester.py")
     rc, o, e = tgen.gears["r1"].net.cmd_status([testbin, "--help"])
-    logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
+    logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
     _test_router_id(tgen, testbin)
 
 
@@ -243,13 +240,13 @@ def _test_add_data(tgen, apibin):
     try:
         p = r1.popen([apibin, "-v", "add,9,10.0.1.1,230,2,00000202"])
         input_dict = {
-            "routerId": "192.168.0.1",
+            "routerId": "1.0.0.0",
             "areas": {
                 "1.2.3.4": {
                     "linkLocalOpaqueLsa": [
                         {
                             "lsId": "230.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
                         }
                     ],
@@ -265,7 +262,7 @@ def _test_add_data(tgen, apibin):
                     "1.2.3.4": [
                         {
                             "linkStateId": "230.0.0.2",
-                            "advertisingRouter": "192.168.0.1",
+                            "advertisingRouter": "1.0.0.0",
                             "lsaSeqNumber": "80000001",
                             "opaqueData": "00000202",
                         },
@@ -285,13 +282,13 @@ def _test_add_data(tgen, apibin):
         p = None
         p = r1.popen([apibin, "-v", "add,10,1.2.3.4,231,1,00010101"])
         input_dict = {
-            "routerId": "192.168.0.1",
+            "routerId": "1.0.0.0",
             "areas": {
                 "1.2.3.4": {
                     "linkLocalOpaqueLsa": [
                         {
                             "lsId": "230.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
                             "lsaAge": 3600,
                         }
@@ -299,7 +296,7 @@ def _test_add_data(tgen, apibin):
                     "areaLocalOpaqueLsa": [
                         {
                             "lsId": "231.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
                         },
                     ],
@@ -315,7 +312,7 @@ def _test_add_data(tgen, apibin):
                     "1.2.3.4": [
                         {
                             "linkStateId": "231.0.0.1",
-                            "advertisingRouter": "192.168.0.1",
+                            "advertisingRouter": "1.0.0.0",
                             "lsaSeqNumber": "80000001",
                             "opaqueData": "00010101",
                         },
@@ -336,13 +333,13 @@ def _test_add_data(tgen, apibin):
 
         p = r1.popen([apibin, "-v", "add,11,232,3,deadbeaf01234567"])
         input_dict = {
-            "routerId": "192.168.0.1",
+            "routerId": "1.0.0.0",
             "areas": {
                 "1.2.3.4": {
                     "areaLocalOpaqueLsa": [
                         {
                             "lsId": "231.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
                             "lsaAge": 3600,
                         },
@@ -352,7 +349,7 @@ def _test_add_data(tgen, apibin):
             "asExternalOpaqueLsa": [
                 {
                     "lsId": "232.0.0.3",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000001",
                 },
             ],
@@ -364,7 +361,7 @@ def _test_add_data(tgen, apibin):
             "asExternalOpaqueLsa": [
                 {
                     "linkStateId": "232.0.0.3",
-                    "advertisingRouter": "192.168.0.1",
+                    "advertisingRouter": "1.0.0.0",
                     "lsaSeqNumber": "80000001",
                     "opaqueData": "deadbeaf01234567",
                 },
@@ -382,11 +379,11 @@ def _test_add_data(tgen, apibin):
         p = None
 
         input_dict = {
-            "routerId": "192.168.0.1",
+            "routerId": "1.0.0.0",
             "asExternalOpaqueLsa": [
                 {
                     "lsId": "232.0.0.3",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000001",
                     "lsaAge": 3600,
                 },
@@ -400,11 +397,11 @@ def _test_add_data(tgen, apibin):
         # Originate it again
         p = r1.popen([apibin, "-v", "add,11,232,3,ebadf00d"])
         input_dict = {
-            "routerId": "192.168.0.1",
+            "routerId": "1.0.0.0",
             "asExternalOpaqueLsa": [
                 {
                     "lsId": "232.0.0.3",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000002",
                 },
             ],
@@ -415,7 +412,7 @@ def _test_add_data(tgen, apibin):
             "asExternalOpaqueLsa": [
                 {
                     "linkStateId": "232.0.0.3",
-                    "advertisingRouter": "192.168.0.1",
+                    "advertisingRouter": "1.0.0.0",
                     "lsaSeqNumber": "80000002",
                     "opaqueData": "ebadf00d",
                 },
@@ -425,6 +422,7 @@ def _test_add_data(tgen, apibin):
         json_cmd = "show ip ospf da opaque-as json"
         assert verify_ospf_database(tgen, r1, input_dict, json_cmd) is None
 
+        logging.debug("sending interrupt to writer api client")
         p.send_signal(signal.SIGINT)
         time.sleep(2)
         p.wait()
@@ -439,6 +437,7 @@ def _test_add_data(tgen, apibin):
         raise
     finally:
         if p:
+            logging.debug("cleanup: sending interrupt to writer api client")
             p.terminate()
             p.wait()
 
@@ -447,7 +446,7 @@ def _test_add_data(tgen, apibin):
 def test_ospf_opaque_add_data3(tgen):
     apibin = os.path.join(CLIENTDIR, "ospfclient.py")
     rc, o, e = tgen.gears["r2"].net.cmd_status([apibin, "--help"])
-    logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
+    logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
     _test_add_data(tgen, apibin)
 
 
@@ -459,10 +458,12 @@ def _test_opaque_add_del(tgen, apibin):
 
     p = None
     pread = None
+    # Log to our stdin, stderr
+    pout = open(os.path.join(r1.net.logdir, "r1/add-del.log"), "a+")
     try:
         step("reachable: check for add notification")
         pread = r2.popen(
-            ["/usr/bin/timeout", "120", apibin, "-v"],
+            ["/usr/bin/timeout", "120", apibin, "-v", "--logtag=READER", "wait,120"],
             encoding=None,  # don't buffer
             stdin=subprocess.DEVNULL,
             stdout=subprocess.PIPE,
@@ -492,30 +493,30 @@ def _test_opaque_add_del(tgen, apibin):
                     "linkLocalOpaqueLsa": [
                         {
                             "lsId": "230.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "6d5f",
+                            "checksum": "76bf",
                         },
                         {
                             "lsId": "230.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "8142",
+                            "checksum": "8aa2",
                         },
                     ],
                     "linkLocalOpaqueLsaCount": 2,
                     "areaLocalOpaqueLsa": [
                         {
                             "lsId": "231.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "5278",
+                            "checksum": "5bd8",
                         },
                         {
                             "lsId": "231.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "6d30",
+                            "checksum": "7690",
                         },
                     ],
                     "areaLocalOpaqueLsaCount": 2,
@@ -524,15 +525,15 @@ def _test_opaque_add_del(tgen, apibin):
             "asExternalOpaqueLsa": [
                 {
                     "lsId": "232.0.0.1",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000001",
-                    "checksum": "5575",
+                    "checksum": "5ed5",
                 },
                 {
                     "lsId": "232.0.0.2",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000001",
-                    "checksum": "d05d",
+                    "checksum": "d9bd",
                 },
             ],
             "asExternalOpaqueLsaCount": 2,
@@ -556,17 +557,17 @@ def _test_opaque_add_del(tgen, apibin):
                         "1.2.3.4": [
                             {
                                 "linkStateId": "230.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "6d5f",
+                                "checksum": "76bf",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "linkStateId": "230.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "8142",
+                                "checksum": "8aa2",
                                 "length": 24,
                                 "opaqueId": 2,
                                 "opaqueDataLength": 4,
@@ -581,17 +582,17 @@ def _test_opaque_add_del(tgen, apibin):
                         "1.2.3.4": [
                             {
                                 "linkStateId": "231.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "5278",
+                                "checksum": "5bd8",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "linkStateId": "231.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "6d30",
+                                "checksum": "7690",
                                 "length": 28,
                                 "opaqueDataLength": 8,
                             },
@@ -603,17 +604,17 @@ def _test_opaque_add_del(tgen, apibin):
                 "asExternalOpaqueLsa": [
                     {
                         "linkStateId": "232.0.0.1",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaSeqNumber": "80000001",
-                        "checksum": "5575",
+                        "checksum": "5ed5",
                         "length": 20,
                         "opaqueDataLength": 0,
                     },
                     {
                         "linkStateId": "232.0.0.2",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaSeqNumber": "80000001",
-                        "checksum": "d05d",
+                        "checksum": "d9bd",
                         "length": 24,
                         "opaqueDataLength": 4,
                     },
@@ -655,32 +656,32 @@ def _test_opaque_add_del(tgen, apibin):
                     "linkLocalOpaqueLsa": [
                         {
                             "lsId": "230.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "6d5f",
+                            "checksum": "76bf",
                         },
                         {
                             "lsId": "230.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "lsaAge": 3600,
                             "sequenceNumber": "80000001",
-                            "checksum": "8142",
+                            "checksum": "8aa2",
                         },
                     ],
                     "linkLocalOpaqueLsaCount": 2,
                     "areaLocalOpaqueLsa": [
                         {
                             "lsId": "231.0.0.1",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "sequenceNumber": "80000001",
-                            "checksum": "5278",
+                            "checksum": "5bd8",
                         },
                         {
                             "lsId": "231.0.0.2",
-                            "advertisedRouter": "192.168.0.1",
+                            "advertisedRouter": "1.0.0.0",
                             "lsaAge": 3600,
                             "sequenceNumber": "80000002",
-                            "checksum": "4682",
+                            "checksum": "4fe2",
                         },
                     ],
                     "areaLocalOpaqueLsaCount": 2,
@@ -689,16 +690,16 @@ def _test_opaque_add_del(tgen, apibin):
             "asExternalOpaqueLsa": [
                 {
                     "lsId": "232.0.0.1",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "lsaAge": 3600,
                     "sequenceNumber": "80000001",
-                    "checksum": "5575",
+                    "checksum": "5ed5",
                 },
                 {
                     "lsId": "232.0.0.2",
-                    "advertisedRouter": "192.168.0.1",
+                    "advertisedRouter": "1.0.0.0",
                     "sequenceNumber": "80000001",
-                    "checksum": "d05d",
+                    "checksum": "d9bd",
                 },
             ],
             "asExternalOpaqueLsaCount": 2,
@@ -716,18 +717,18 @@ def _test_opaque_add_del(tgen, apibin):
                         "1.2.3.4": [
                             {
                                 "linkStateId": "230.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "6d5f",
+                                "checksum": "76bf",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "linkStateId": "230.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaAge": 3600,
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "8142",
+                                "checksum": "8aa2",
                                 "length": 24,
                                 "opaqueId": 2,
                                 "opaqueDataLength": 4,
@@ -742,18 +743,18 @@ def _test_opaque_add_del(tgen, apibin):
                         "1.2.3.4": [
                             {
                                 "linkStateId": "231.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "5278",
+                                "checksum": "5bd8",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "lsaAge": 3600,
                                 "linkStateId": "231.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000002",
-                                "checksum": "4682",
+                                "checksum": "4fe2",
                                 # data removed
                                 "length": 20,
                                 "opaqueDataLength": 0,
@@ -766,18 +767,18 @@ def _test_opaque_add_del(tgen, apibin):
                 "asExternalOpaqueLsa": [
                     {
                         "linkStateId": "232.0.0.1",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaAge": 3600,
                         "lsaSeqNumber": "80000001",
-                        "checksum": "5575",
+                        "checksum": "5ed5",
                         "length": 20,
                         "opaqueDataLength": 0,
                     },
                     {
                         "linkStateId": "232.0.0.2",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaSeqNumber": "80000001",
-                        "checksum": "d05d",
+                        "checksum": "d9bd",
                         "length": 24,
                         "opaqueDataLength": 4,
                     },
@@ -808,19 +809,19 @@ def _test_opaque_add_del(tgen, apibin):
                         "1.2.3.4": [
                             {
                                 "linkStateId": "230.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaAge": 3600,
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "6d5f",
+                                "checksum": "76bf",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "linkStateId": "230.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaAge": 3600,
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "8142",
+                                "checksum": "8aa2",
                                 "length": 24,
                                 "opaqueId": 2,
                                 "opaqueDataLength": 4,
@@ -836,18 +837,18 @@ def _test_opaque_add_del(tgen, apibin):
                             {
                                 "lsaAge": 3600,
                                 "linkStateId": "231.0.0.1",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000001",
-                                "checksum": "5278",
+                                "checksum": "5bd8",
                                 "length": 20,
                                 "opaqueDataLength": 0,
                             },
                             {
                                 "lsaAge": 3600,
                                 "linkStateId": "231.0.0.2",
-                                "advertisingRouter": "192.168.0.1",
+                                "advertisingRouter": "1.0.0.0",
                                 "lsaSeqNumber": "80000002",
-                                "checksum": "4682",
+                                "checksum": "4fe2",
                                 # data removed
                                 "length": 20,
                                 "opaqueDataLength": 0,
@@ -860,19 +861,19 @@ def _test_opaque_add_del(tgen, apibin):
                 "asExternalOpaqueLsa": [
                     {
                         "linkStateId": "232.0.0.1",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaAge": 3600,
                         "lsaSeqNumber": "80000001",
-                        "checksum": "5575",
+                        "checksum": "5ed5",
                         "length": 20,
                         "opaqueDataLength": 0,
                     },
                     {
                         "linkStateId": "232.0.0.2",
-                        "advertisingRouter": "192.168.0.1",
+                        "advertisingRouter": "1.0.0.0",
                         "lsaAge": 3600,
                         "lsaSeqNumber": "80000001",
-                        "checksum": "d05d",
+                        "checksum": "d9bd",
                         "length": 24,
                         "opaqueDataLength": 4,
                     },
@@ -931,7 +932,7 @@ def _test_opaque_add_del(tgen, apibin):
 def test_ospf_opaque_delete_data3(tgen):
     apibin = os.path.join(CLIENTDIR, "ospfclient.py")
     rc, o, e = tgen.gears["r2"].net.cmd_status([apibin, "--help"])
-    logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
+    logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
     _test_opaque_add_del(tgen, apibin)
 
 
index b8fbbb3f63bf59ae9c2c2ae94ac93f3eeb184714..55166367c1e7baf48eaa31c790ecd0399392d049 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Summarisation Functionality Automation."""
index 0fe0fd95b0d13be9ccdbc650a15c36d3a4ca0b2f..2f90c98785b394efa70bd70239ab5f83a31fefb3 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 6bb88ebca39ed2611725d02edfc9203bc18eb244..472364e84f1b93539d8e89f0935cae9c5608e9ab 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 5cbfb0d6e1775a941605b20d3683b02de0bb5026..6b3e16965c6fc6dc8ec567cccb54f079577d72f6 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 4cccd9734fb6f3e07ea9df83461953545b10601f..138112775f9d5466170f9288033833d52aac7083 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index ee15a5fe1cb39ec59a9001f63a711ef64bb6995b..b2cd0da24e786eb93f4bc0021e75c606ef88a36f 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index e5b20db6de0e25da3b75c74edb47a502890c8216..9e7f112efbc5d8aa98dd5307ca789d5483a9f3b4 100644 (file)
@@ -1,23 +1,10 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 6aee3b815d17ec1fa5e2f7329abd231a0068d812..5d5ba1480fb1d785bd7ab3d0f98fbaa798d4e735 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2021 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """OSPF Basic Functionality Automation."""
index 8506a151359a39bab40625c9fa9dda18b52fb59f..a5a29f7e3dc61e843714c65fa1a999be654c8bbe 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_pbr_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_pbr_topo1.py: Testing PBR
index a4e6630f789d62746c8955d34fb59563f51cda15..6e5092dabb5044fb9700996a9b9cb8d6376b00ed 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_pim_acl.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_pim_acl.py: Test PIM with RP selection using ACLs
index 885337666a17579df52036c7684715a56324632f..d05ed1a49cf7d64ead681b5228d2a15f0dab7447 100755 (executable)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # mcast-rx.py
 #
 # Copyright (c) 2018 Cumulus Networks, Inc.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND Cumulus Networks DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 Subscribe to a multicast group so that the kernel sends an IGMP JOIN
 for the multicast group we subscribed to.
index 88c234573fff607a5bc0cfec237b492566554524..ed3faf488996d6abd2c8d1eb4abec734e1ae87a8 100755 (executable)
@@ -1,23 +1,10 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: ISC
 #
 # mcast-tx.py
 #
 # Copyright (c) 2018 Cumulus Networks, Inc.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND Cumulus Networks DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 import argparse
 import logging
index ca01a566362f1360224c4554d6e33b20eb7dfef8..24987e516d2481bd1622c74e7d06221f22270b5f 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_pim.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2018 Cumulus Networks, Inc.
 #                    Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND Cumulus Networks DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_pim.py: Test pim
index 5aa313137fd9b63371d8319324a81f873c1904ae..cb6d0d7aeba3f9d8cffa46fc2a1097c39c1e8bc2 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_pim_basic_topo2.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2021 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_pim_basic_topo2.py: Test the FRR PIM protocol convergence.
index 64001deade84f5c051d8317a4f0dcd06bb9a5cdd..ddc430330d3dbb5320b05f630b9428ce349f2464 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_pim_vrf.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_pim_vrf.py: Test PIM with VRFs.
index 7d59e8422f513d3356084f4ae7b943e3e0ceaa8e..d23962b77d211499057ec96ff1fd704ad36b7679 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_rip_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_rip_topo1.py: Testing RIPv2
index 563c4f74979a1c3b04f7b9a22b7852db2ded6740..ce2f5986d1ea43e005a8b94e7f8f2dd4caee8b15 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ripng_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ripng_topo1.py: Test of RIPng Topology
index b9f324d56199bb2fdb0423d26f45a355c94b8297..6227e81b986a6dbda752674f08bd5a433325e6cd 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # scale_test_common.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 scale_test_common.py: Common routines for testing route scale
index b563883b4524d578e47e58696f42450daf4f9909..0f25b28c742c69b1548ed0dd0e77cc1958f2a6eb 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_route_scale1.py
@@ -7,20 +8,6 @@
 # Nvidia, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_route_scale1.py: Testing route scale
index 7045995f263b23a2f7c0acb6c01f6bc355acc86b..3b55fcd8f597422e13af4261a06cdf9caaad93e9 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_route_scale2.py
@@ -7,20 +8,6 @@
 # Nvidia, Inc.
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NVIDIA BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_route_scale2.py: Testing route scale
index 1ca06c6571749c936b2a251d3fbdd0fb70b80d0b..ee02c7b519938856e37c70d97b4747fb87390719 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_simple_snmp.py
@@ -6,20 +7,6 @@
 #
 # Copyright (c) 2020 by Volta Networks
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_bgp_simple snmp.py: Test snmp infrastructure.
index b918da065567732721e0b3a2d42d8475fab5c0e3..3a27d9c2fc5f00af5e3acd879ed57f7a4b3a308b 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_srv6_manager.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # LINE Corporation, Hiroki Shirokura <slank.dev@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_srv6_manager.py:
index 4bd0682bde4720737c846993e2a0137a8e4052d3..92980d3b179e75505ba814cdb7166335f5453707 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022, University of Rome Tor Vergata
 # Authored by Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_srv6_manager.py:
index 40235555247b132c592c65ac77735d6b8e072139..54187351b2f491296c1b42c00522e8b31b1433a6 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2022, University of Rome Tor Vergata
 # Authored by Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_srv6_locator_usid.py:
index abfba029f4e8411742f7607249705ba876f7a347..63c0a86897fb4973815fd445d34fd8ca20463513 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 
     -Verify static route ECMP functionality with 2 next hop.
index f04279a081763c27967094d63d13a18514c66203..530c49f6bf43f43858d7d810520cebd4c58989a0 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index 088ac600c13d103ad02e14530ed02856d31f1357..358047607ab760c185cd5ad64d5d6662328affc2 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
     -Verify static route ECMP functionality with 8 next hop
 
index 3f49ced7cabcd5b1708455cc4d3175aef290b042..c1099bd97eadae31b54c22d8879434bc9554f3d8 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 
index 6b7b2adfd9150b712728997eca2fe9d8a2cbe189..176ce7e48b91c3aef0352f17efcffc30a9b3b722 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 
     -Verify static route ECMP functionality with 2 next hop
index 350a117b949a538bbb420ff7921ee2ba6827697c..20c68dc25f38e7991392a17c6cd8035ed1d23dca 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
index cdd7e13f7531fc4817f6be841622b64fda120f3c..7f3592731113dcb69c59b064b46547da29a6ccaf 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
     -Verify static route ECMP functionality with 8 next hop
 
index d5e5148eae124f1ec263818530f70bf4a378533a..e50362b5714e25027aed5ef1e1ebfd5ac279e12f 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2020 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 
index e98e11d71d55d919f67674c973da774a0ae770b2..f64e83c3cb06c74222a3fc59418c6278f586a81f 100755 (executable)
@@ -1,24 +1,11 @@
 #!/usr/bin/python
+# SPDX-License-Identifier: ISC
 
 #
 # test_tc_basic.py
 #
 # Copyright (c) 2022 by Shichu Yang
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 """
 test_tc_basic.py: Test basic TC filters, classes and qdiscs.
 """
index 8882cf5bdac15e288ba1edc4f25c0cf28edc997d..529520cd9e817a8eaca03d6dd21131786221910d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_zebra_multiple_connected.py
@@ -7,20 +8,6 @@
 # Nvidia Corporation
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_zebra_multiple_connected.py: Testing multiple connected
index 6d7b99291a13fbf5d53cc3e59aa3415160634b96..5a30f79279e45ff81ac50b91f41fceaadb33df60 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_zebra_netlink.py
 #
 # Copyright (c) 2020 by
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_zebra_netlink.py: Test some basic interactions with kernel using Netlink
index 9a8f7cc1f7878413356f2eb1770931d17817ed16..6956ab74099678a4df4b35c4ec99ddb071a5f35b 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2022 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation,
 # Inc. ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test is indended for validating zebra NH resolution logic
index 202e28a178fa626595c7c82c31e64aa710a6e3fc..25fbb97806deeb52a59caf363317bf580edbdc09 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 # Copyright (c) 2021 by
 # Donatas Abraitis <donatas.abraitis@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 Test if Opaque Data is accessable from other daemons in Zebra
index 2334a198da60fe1c376061e512876e33c987d877..6137471ea69096795015fd037dd6b94568c202ef 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 #
 # test_zebra_rib.py
 #
@@ -6,20 +7,6 @@
 # Cumulus Networks, Inc
 # Donald Sharp
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_zebra_rib.py: Test some basic zebra <-> kernel interactions
index 399af748a11f849eea3a79cc581f1370746e9d5e..1d01263d9a3a655a0f4950b4f81c03f3214288b4 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_zebra_seg6_route.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2020 by
 # LINE Corporation, Hiroki Shirokura <slank.dev@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_zebra_seg6_route.py: Test seg6 route addition with zapi.
index 66d3b6d9172d7be81e3080c19ed1d3531fd86f5d..0dc87741aacc982efc4668bb9b062e65787faa97 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_zebra_seg6local_route.py
@@ -6,20 +7,6 @@
 # Copyright (c) 2020 by
 # LINE Corporation, Hiroki Shirokura <slank.dev@gmail.com>
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_zebra_seg6local_route.py: Test seg6local route addition with zapi.
index ecfb0857934dd3116f56f2016e0e6a87e4bc565e..9ad0bc4e17c73d596b73d7be2051591671d30e46 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Label Manager tests.
  * Copyright (C) 2020 Volta Networks
  *                    Patrick Ruddy
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index 3c922c355ce881a7e7bef16a0cde82a41f80e8ba..d614ba01d9271750bdf1325b323101afefe18f5e 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: NONE
 #
 # Written by Daniil Baturin, 2018
 # Rewritten by Ondřej Surý, 2020
index db6460f3437c8741ba1b2bbb2507cbee0eacb57a..b5892e8da5121c6290dd2a9a03203da1598d9f1a 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0-or-later
 # (c) 2001, Dave Jones. (the file handling bit)
 # (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit)
 # (c) 2007,2008, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite)
 # (c) 2008-2010 Andy Whitcroft <apw@canonical.com>
-# Licensed under the terms of the GNU GPL License version 2
 
 use strict;
 use warnings;
@@ -3627,7 +3627,9 @@ sub process {
 
 # no C99 // comments
                if ($line =~ m{//}) {
-                       if (!$allow_c99_comments) {
+                       if ($rawlines[$linenr - 1] =~ /SPDX-License-Identifier:/) {
+                               # ignore
+                       } elsif (!$allow_c99_comments) {
                                if(ERROR("C99_COMMENTS",
                                         "do not use C99 // comments\n" . $herecurr) &&
                                   $fix) {
index 6e14eb7abcc88a205f5648ee905ccd06d463389c..75b20d76bc10d971edddbd0e9547ea673f4612b4 100644 (file)
@@ -17,6 +17,7 @@ if  $programname == 'babeld' or
     $programname == 'pimd' or
     $programname == 'pim6d' or
     $programname == 'pathd' or
+    $programname == 'pbrd' or
     $programname == 'ripd' or
     $programname == 'ripngd' or
     $programname == 'vrrpd' or
@@ -38,6 +39,7 @@ if  $programname == 'babeld' or
     $programname == 'pimd' or
     $programname == 'pim6d' or
     $programname == 'pathd' or
+    $programname == 'pbrd' or
     $programname == 'ripd' or
     $programname == 'ripngd' or
     $programname == 'vrrpd' or
index 57f9df90658f15e3180fd9db238a60bd4cc04f7a..ad3ae54aba2e1671f945bbd2b3d8130d068d9c8d 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
+# SPDX-License-Identifier: NONE
 #
 # Script used to replace deprecated quagga/frr mactors/types/etc.
 #
index 8ce754fecccfc3c853ca41f5e01e8ae25d956cf2..51e8fb7b7ec1be0fd085ccf823ed0fdb1dcd54f7 100644 (file)
@@ -1,28 +1,4 @@
-// This is free and unencumbered software released into the public domain.
-//
-// Anyone is free to copy, modify, publish, use, compile, sell, or
-// distribute this software, either in source code form or as a compiled
-// binary, for any purpose, commercial or non-commercial, and by any
-// means.
-//
-// In jurisdictions that recognize copyright laws, the author or authors
-// of this software dedicate any and all copyright interest in the
-// software to the public domain. We make this dedication for the benefit
-// of the public at large and to the detriment of our heirs and
-// successors. We intend this dedication to be an overt act of
-// relinquishment in perpetuity of all present and future rights to this
-// software under copyright law.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// For more information, please refer to <http://unlicense.org/>
-
+// SPDX-License-Identifier: Unlicense
 /* based on example code: https://github.com/sheredom/llvm_bc_parsing_example
  * which came under the above (un-)license.  does not depend on any FRR
  * pieces, so no reason to change the license.
index ed3ad956b886e5d550f5d6e5574886fd51f1c460..16ad18bed73f2edb5d5de1b34946cb49b5cdbdbf 100644 (file)
@@ -1,27 +1,4 @@
-// This is free and unencumbered software released into the public domain.
-//
-// Anyone is free to copy, modify, publish, use, compile, sell, or
-// distribute this software, either in source code form or as a compiled
-// binary, for any purpose, commercial or non-commercial, and by any
-// means.
-//
-// In jurisdictions that recognize copyright laws, the author or authors
-// of this software dedicate any and all copyright interest in the
-// software to the public domain. We make this dedication for the benefit
-// of the public at large and to the detriment of our heirs and
-// successors. We intend this dedication to be an overt act of
-// relinquishment in perpetuity of all present and future rights to this
-// software under copyright law.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// For more information, please refer to <http://unlicense.org/>
+// SPDX-License-Identifier: Unlicense
 
 #include <llvm-c/BitReader.h>
 #include <llvm-c/BitWriter.h>
index fca4bc1f9714c88b3b2b43e3041a7be0665f38ab..4d2985cf79f69a4993949b3d906f8056f7ee4588 100644 (file)
@@ -1,27 +1,4 @@
-// This is free and unencumbered software released into the public domain.
-//
-// Anyone is free to copy, modify, publish, use, compile, sell, or
-// distribute this software, either in source code form or as a compiled
-// binary, for any purpose, commercial or non-commercial, and by any
-// means.
-//
-// In jurisdictions that recognize copyright laws, the author or authors
-// of this software dedicate any and all copyright interest in the
-// software to the public domain. We make this dedication for the benefit
-// of the public at large and to the detriment of our heirs and
-// successors. We intend this dedication to be an overt act of
-// relinquishment in perpetuity of all present and future rights to this
-// software under copyright law.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-// For more information, please refer to <http://unlicense.org/>
+// SPDX-License-Identifier: Unlicense
 
 #ifndef _FRR_LLVM_DEBUGINFO_H
 #define _FRR_LLVM_DEBUGINFO_H
index dfbc9b80083dbd49c3d47b47481769e5ea8a6725..a69b0a7bf1cb6222d785c7f14ab0a3364312ecc5 100755 (executable)
@@ -1,24 +1,8 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-or-later
 # Frr Reloader
 # Copyright (C) 2014 Cumulus Networks, Inc.
 #
-# This file is part of Frr.
-#
-# Frr is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any
-# later version.
-#
-# Frr is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Frr; see the file COPYING.  If not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-#  02111-1307, USA.
-#
 """
 This program
 - reads a frr configuration text file
index 86aa0c0e3f4795d009bbc3bc6cdc6f438ec187be..19ac3fc99b315e20e26265b56590885282e4d2c0 100644 (file)
@@ -1,3 +1,4 @@
+" SPDX-License-Identifier: NONE
 " settings & syntax hilighting for FRR codebase
 " 2019 by David Lamparter, placed in public domain
 
@@ -34,3 +35,44 @@ endfunction
 
 " auto-apply the above based on path rules
 "autocmd BufRead,BufNewFile /home/.../frr/*.[ch] call CStyleFRR()
+
+" only load xref file once, remember on script-scope
+let s:xrefjson = ""
+let s:xrefpath = ""
+
+" call directly to force reload with :call FRRLoadXrefJson()
+function! FRRLoadXrefJson() abort
+       let s:xrefpath = findfile("frr.xref", ".;")
+       if empty(s:xrefpath)
+               throw "frr.xref JSON file not found in current or parent directories"
+       endif
+       let xreflines = readfile(s:xrefpath)
+       let s:xrefjson = json_decode(join(xreflines, "\n"))
+endfunction
+
+function! FRRXrefJson() abort
+       if empty(s:xrefjson)
+               call FRRLoadXrefJson()
+       endif
+       return s:xrefjson
+endfunction
+
+function! FRRGotoXref(ident) abort
+       let refs = FRRXrefJson()["refs"]
+       if has_key(refs, a:ident)
+               " TODO: in rare cases, one ID may occur in multiple places.
+               " Add some UI for that.  (This happens if the exact same
+               " format string is logged in multiple places in the same
+               " file.)
+               let loc = refs[a:ident][0]
+               let basepath = fnamemodify(s:xrefpath, ":p:h")
+               let path = fnamemodify(basepath . "/" . loc["file"], ":.")
+               execute "e ".fnameescape(path)
+               execute ":".loc["line"]
+       else
+               echoerr printf("cannot find xref with ID %s", a:ident)
+       endif
+endfunction
+
+" invoke as :GotoXref 23456-ABCDE
+command! -bang -nargs=1 GotoXref :call FRRGotoXref(<q-args>)
index 27d830a11997c88fe21bff37c137340abcb9ea5e..4d974ad356f8c6eaf1153566190d40a72776a5ff 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-or-later
 """
 Usage: frr_babeltrace.py trace_path
 
@@ -9,20 +10,6 @@ that pretty printing.
 
 Copyright (C) 2021  NVIDIA Corporation
 Anuradha Karuppiah
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; see the file COPYING; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 """
 
 import ipaddress
diff --git a/tools/gcc-plugins/COPYING.GPLv3 b/tools/gcc-plugins/COPYING.GPLv3
deleted file mode 100644 (file)
index 94a9ed0..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
index 0a24b091a3931ee0a5a9d01ec9bc138dd117a5d2..2240a171b40e2c4be0d27c10a28b3c293a835aad 100644 (file)
@@ -1,24 +1,10 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
 /* Check calls to formatted I/O functions (-Wformat).
    Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
    Extended for FRR's printfrr() with Linux kernel style extensions
    Copyright (C) 2019-2020  David Lamparter, for NetDEF, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.GPLv3.  If not see
-<http://www.gnu.org/licenses/>.  */
+ */
 
 #include "gcc-common.h"
 
index 599dbc56f9cb23f84767e062860cf5e5f47ac63d..373ef07242ba5454f2deaddd09228668bb370d2b 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
 /* Check calls to formatted I/O functions (-Wformat).
    Copyright (C) 1992-2018 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
+ */
 
 #ifndef GCC_C_FORMAT_H
 #define GCC_C_FORMAT_H
index 1705a3203fa426fe7629ed41de29fa46a9a2d5fb..5b778a15855669bbc371eab31ba7bdd6cdd08b8e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define REALLY_NEED_PLAIN_GETOPT 1
index 8aa5695d3ecd4451d39f60db150b147fc5b1a5a0..fc9f55bcbc3ddd348bd32f8994948d39d8fee774 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define REALLY_NEED_PLAIN_GETOPT 1
index 104d9714d427e43e671ab8223c641be0c3f5cc74..04a374d850a8f8c3955d4a3ffcedc20a9f24edf2 100755 (executable)
@@ -1,21 +1,8 @@
 #!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
 # Copyright (c) 2021, LabN Consulting, L.L.C.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 
 ########################################################
 ### Python Script to generate the FRR support bundle ###
index 61a0fd4454e819b5515c778b30b39117cecda202..fe9eb7c2526b382dce31e043e65f4dc20bc1341c 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
+# SPDX-License-Identifier: NONE
 # 2017 by David Lamparter, placed in public domain
 
 import sys, re, subprocess, os
index 5dce43fe8489331276dc9bd735a2847a0a88728d..e7eaf46f6614620cb2728a3324f98e06c60aceda 100755 (executable)
@@ -1,22 +1,9 @@
 #!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
 
 # Author: Joe Maimon
 # Released to public domain
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
 
 PROGNAME=`basename $0`
 VERSION="0.0.6"
index a0b041f2f2fbd88e030db22871bfb102c4742407..f3883b107a9971c7186d66d0507ef7a432480072 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Generates all possible matching inputs for a command string.
  * --
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 7636496b62dc547da0dd853458d8cffd7f8c4e5c..80e26f341cd1a27aff314eb03ac690a3585f993c 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: NONE
 # written 2016 by David Lamparter, placed in Public Domain.
 import sys, markdown
 
index 0e4cf271f3e42877dda3f6bbaaad1bf16e20be08..9f566bd1e24fecf8e9ec7d721ed427284da67227 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: NONE
 /*
  * A rewrite of the original Debian's start-stop-daemon Perl script
  * in C (faster - it is executed many times during system startup).
@@ -885,7 +886,7 @@ static int run_stop_schedule(void)
                                              strerror(errno));
                        }
 
-               default:
+               case sched_forever:
                        assert(!"schedule[].type value must be valid");
                }
 
index 1c75c86a0d7abbf19efbd54d4e09484db1877a1e..29fcb86ea1b2fa02e4d2b44425e01efa52a0b9d9 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: NONE
 # 2020 by David Lamparter, placed in the public domain.
 
 import sys
index eefeee3b05614983c0423c19c02bffb53a7c2a25..b136ce5901f602dd511f0a5f873eefc80810dadf 100644 (file)
@@ -1,5 +1,6 @@
 <html>
 <!--
+  - SPDX-License-Identifier: NONE
   - 2019 by David Lamparter, placed in public domain
   -->
   <head>
index ce0bfde0a50001998c71b9f3727a991b1e2302d1..7d37a1a314681568c9aa2ee511ab973db3ddbe46 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/python3
+# SPDX-License-Identifier: NONE
 #
 # 2019 by David Lamparter, placed in public domain
 #
index 5307fa3878f5a88fd32341039136d22ed4140569..77af50085e9da646bd700a4f6abe2b29e7ac7d74 100755 (executable)
@@ -1,24 +1,8 @@
 #!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0-or-later
 ##
 ## Zebra interactive console
 ## Copyright (C) 2000 Vladimir B. Grebenschikov <vova@express.ru>
-##
-## This file is part of GNU Zebra.
-##
-## GNU Zebra is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2, or (at your option) any
-## later version.
-##
-## GNU Zebra is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Zebra; see the file COPYING.  If not, write to the
-## Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-## Boston, MA 02111-1307, USA.
 
 use Net::Telnet ();
 use Getopt::Std;
index e1bb40c28d40e7108842993f4b05b226b5564a35..5bb1d6911cbd9808a49ae7638a9e069dfeec02bc 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP global definitions and state machine.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -671,6 +658,9 @@ void vrrp_vrouter_destroy(struct vrrp_vrouter *vr)
 
 struct vrrp_vrouter *vrrp_lookup(const struct interface *ifp, uint8_t vrid)
 {
+       if (!ifp)
+               return NULL;
+
        struct vrrp_vrouter vr;
 
        vr.vrid = vrid;
index b3141ef318492471d313c6b020bccfea3a992259..9da9c8a5182af10875e9b672c3314e52560189de 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP global definitions and state machine.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_H__
 #define __VRRP_H__
index 749b59cc43bdff3148969c0a1eac20d11e2932cc..0072053798f7e2b52f0eca74d3a53e3ed965a4e7 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP ARP handling.
  * Copyright (C) 2001-2017 Alexandre Cassen
  * Portions:
  *     Copyright (C) 2018-2019 Cumulus Networks, Inc.
  *     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 21f2c4edd1363f00d0e50bad627124477136c69b..46aa128ce3baf97d333e441ebb5391b698c562c3 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP ARP handling.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_ARP_H__
 #define __VRRP_ARP_H__
index 09d5e780cfb73e82f37fdb2f03d4ef7b7d89344b..a772b3b5c5374d011ec72f6068695e558c8e50ac 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP debugging.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 459d4d01aa67acc4db9bd71df856e0a1f856b1f1..c1421ebbaa7fb141bf543ef5147e8ca2abda028a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP debugging.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_DEBUG_H__
 #define __VRRP_DEBUG_H__
index 59769788e7e5ec6fcb5f313deec9e37bd7efce3d..d3d230d20508225cd8d1817e4de507a3bb64397f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP entry point.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index b989e66f60097af7f254c7c0869975202e895604..038d293226926195321340788c8292c256b21801 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP Neighbor Discovery.
  * Copyright (C) 2019 Cumulus Networks, Inc.
@@ -5,20 +6,6 @@
  *
  * Portions:
  *     Copyright (C) 2001-2017 Alexandre Cassen
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index efbef348d096e02af92a4c8c4d7523b5d4a85c76..15fa71941d45506181bf61bf866e74f17083998d 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP Neighbor Discovery.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_NDISC_H__
 #define __VRRP_NDISC_H__
index 76d0ad3b1b082cdac7d4e0d0e15f6043e4955ce6..1f8da4cf209074356d35717b077596606c32e7a9 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP northbound bindings.
  * Copyright (C) 2019  Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 96a19da88cad016d1123ce6eeef45cb5564c8cb2..36494c7df8b704ed536277ee281f0049aa2d3dcf 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP packet crafting.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 #include <netinet/in.h>
index eec709593e41d1a6df0de6c379d482b8ee57c447..99136dace72c2aefbe669b01ffa369c8c3129752 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP packet crafting.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_PACKET_H__
 #define __VRRP_PACKET_H__
index 1e1edb8212bf5bdcc251c84321f39b9d09cb50fd..7a17de747ce79cd25c64871b56831b37462f639c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP CLI commands.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index be88349e783b21cc9d65bfc2eb2f0af9cff942d1..6feb8e8ec2cdb8574ec61ecefd199c71fd12f48a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP CLI commands.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_VTY_H__
 #define __VRRP_VTY_H__
index 4cea8ebe4a44af101bad85da1dfe7571e4958ccd..6d753d2e47649178fc21fd8e312ed7011c5b38fd 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP Zebra interfacing.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index c09943dcef9d32cc277a75eb8fe03a5a62203c85..5e59256e1d87f2c82309971b308644402734d606 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * VRRP Zebra interfacing.
  * Copyright (C) 2018-2019 Cumulus Networks, Inc.
  * Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #ifndef __VRRP_ZEBRA_H__
 #define __VRRP_ZEBRA_H__
index fc95173406f4818e9a377c84f61b743baea42819..c75bae0c1f0b8faf3173e3bcf717a0482d3a6ef4 100755 (executable)
@@ -1,26 +1,9 @@
 #!/usr/bin/perl
+# SPDX-License-Identifier: GPL-2.0-or-later
 ##
 ## generate daemons list and help strings
 ##
 ## Copyright (C) 2020 NFWare Inc.
-##
-## This file is part of FRR.
-##
-## FRR is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2, or (at your option) any
-## later version.
-##
-## FRR is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with FRR; see the file COPYING; if not, write to the Free
-## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-## 02110-1301, USA.
-##
 
 use strict;
 
index acc984ced70cd20f9524da8018fa3215b4025396..200427fb6e1d48aa6bffb84d90a1fa5cef3fb03e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Virtual terminal interface shell.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1688,10 +1673,14 @@ DEFUNSH(VTYSH_ZEBRA, srv6_locator, srv6_locator_cmd,
 
 #ifdef HAVE_BGPD
 DEFUNSH(VTYSH_BGPD, router_bgp, router_bgp_cmd,
-       "router bgp [(1-4294967295) [<view|vrf> VIEWVRFNAME]]",
+       "router bgp [ASNUM [<view|vrf> VIEWVRFNAME] [as-notation <dot|dot+|plain>]]",
        ROUTER_STR BGP_STR AS_STR
        "BGP view\nBGP VRF\n"
-       "View/VRF name\n")
+       "View/VRF name\n"
+       "Force the AS notation output\n"
+       "use 'AA.BB' format for AS 4 byte values\n"
+       "use 'AA.BB' format for all AS values\n"
+       "use plain format for all AS values\n")
 {
        vty->node = BGP_NODE;
        return CMD_SUCCESS;
@@ -2216,6 +2205,29 @@ DEFUNSH(VTYSH_PATHD, pcep_cli_pcep_pce_config, pcep_cli_pcep_pce_config_cmd,
 
 #endif /* HAVE_PATHD */
 
+/* max value is EXT_ADMIN_GROUP_MAX_POSITIONS - 1 */
+DEFUNSH(VTYSH_AFFMAP, affinity_map, vtysh_affinity_map_cmd,
+       "affinity-map NAME bit-position (0-1023)",
+       "Affinity map configuration\n"
+       "Affinity attribute name\n"
+       "Bit position for affinity attribute value\n"
+       "Bit position\n")
+{
+       return CMD_SUCCESS;
+}
+
+/* max value is EXT_ADMIN_GROUP_MAX_POSITIONS - 1 */
+DEFUNSH(VTYSH_AFFMAP, no_affinity_map, vtysh_no_affinity_map_cmd,
+       "no affinity-map NAME$name [bit-position (0-1023)$position]",
+       NO_STR
+       "Affinity map configuration\n"
+       "Affinity attribute name\n"
+       "Bit position for affinity attribute value\n"
+       "Bit position\n")
+{
+       return CMD_SUCCESS;
+}
+
 DEFUNSH(VTYSH_RMAP, vtysh_route_map, vtysh_route_map_cmd,
        "route-map RMAP_NAME <deny|permit> (1-65535)",
        "Create route-map or enter route-map command mode\n"
@@ -4850,6 +4862,9 @@ void vtysh_init_vty(void)
        install_element(VRF_NODE, &vtysh_exit_vrf_cmd);
        install_element(VRF_NODE, &vtysh_quit_vrf_cmd);
 
+       install_element(CONFIG_NODE, &vtysh_affinity_map_cmd);
+       install_element(CONFIG_NODE, &vtysh_no_affinity_map_cmd);
+
        install_node(&rmap_node);
        install_element(CONFIG_NODE, &vtysh_route_map_cmd);
        install_element(RMAP_NODE, &vtysh_exit_rmap_cmd);
index 1de4ab0179973992e3dce43805788e74162a4912..538837391b86bf8ab4ee7df9c79cc53ebb4f0bc0 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Virtual terminal interface shell.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef VTYSH_H
@@ -59,6 +44,7 @@ extern struct thread_master *master;
  * things like prefix lists are not even initialised) */
 #define VTYSH_ALL        VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_PIM6D|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD|VTYSH_SHARPD|VTYSH_PBRD|VTYSH_STATICD|VTYSH_BFDD|VTYSH_FABRICD|VTYSH_VRRPD|VTYSH_PATHD
 #define VTYSH_ACL         VTYSH_BFDD|VTYSH_BABELD|VTYSH_BGPD|VTYSH_EIGRPD|VTYSH_ISISD|VTYSH_FABRICD|VTYSH_LDPD|VTYSH_NHRPD|VTYSH_OSPF6D|VTYSH_OSPFD|VTYSH_PBRD|VTYSH_PIMD|VTYSH_PIM6D|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_VRRPD|VTYSH_ZEBRA
+#define VTYSH_AFFMAP VTYSH_ZEBRA | VTYSH_ISISD
 #define VTYSH_RMAP       VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_EIGRPD|VTYSH_FABRICD
 #define VTYSH_INTERFACE_SUBSET                                                 \
        VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D | \
index ac32f0a774bdb851e507ad6050cfe63a92ab2998..905761a01110a1b179bf1418b1a15d9e54fce6d2 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Configuration generator.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -395,6 +380,9 @@ void vtysh_config_parse_line(void *arg, const char *line)
                else if (strncmp(line, "router openfabric", strlen("router openfabric"))
                         == 0)
                        config = config_get(OPENFABRIC_NODE, line);
+               else if (strncmp(line, "affinity-map",
+                                strlen("affinity-map")) == 0)
+                       config = config_get(AFFMAP_NODE, line);
                else if (strncmp(line, "route-map", strlen("route-map")) == 0)
                        config = config_get(RMAP_NODE, line);
                else if (strncmp(line, "no route-map", strlen("no route-map"))
@@ -526,14 +514,15 @@ void vtysh_config_parse_line(void *arg, const char *line)
 /* Macro to check delimiter is needed between each configuration line
  * or not. */
 #define NO_DELIMITER(I)                                                        \
-       ((I) == ACCESS_NODE || (I) == PREFIX_NODE || (I) == IP_NODE            \
-        || (I) == AS_LIST_NODE || (I) == COMMUNITY_LIST_NODE                  \
-        || (I) == COMMUNITY_ALIAS_NODE || (I) == ACCESS_IPV6_NODE             \
-        || (I) == ACCESS_MAC_NODE || (I) == PREFIX_IPV6_NODE                  \
-        || (I) == FORWARDING_NODE || (I) == DEBUG_NODE || (I) == AAA_NODE     \
-        || (I) == VRF_DEBUG_NODE || (I) == NORTHBOUND_DEBUG_NODE              \
-        || (I) == RMAP_DEBUG_NODE || (I) == RESOLVER_DEBUG_NODE               \
-        || (I) == MPLS_NODE || (I) == KEYCHAIN_KEY_NODE)
+       ((I) == AFFMAP_NODE || (I) == ACCESS_NODE || (I) == PREFIX_NODE ||     \
+        (I) == IP_NODE || (I) == AS_LIST_NODE ||                              \
+        (I) == COMMUNITY_LIST_NODE || (I) == COMMUNITY_ALIAS_NODE ||          \
+        (I) == ACCESS_IPV6_NODE || (I) == ACCESS_MAC_NODE ||                  \
+        (I) == PREFIX_IPV6_NODE || (I) == FORWARDING_NODE ||                  \
+        (I) == DEBUG_NODE || (I) == AAA_NODE || (I) == VRF_DEBUG_NODE ||      \
+        (I) == NORTHBOUND_DEBUG_NODE || (I) == RMAP_DEBUG_NODE ||             \
+        (I) == RESOLVER_DEBUG_NODE || (I) == MPLS_NODE ||                     \
+        (I) == KEYCHAIN_KEY_NODE)
 
 static void configvec_dump(vector vec, bool nested)
 {
index be7eb3ecdfd666860a76220aacf84f7bd7597f6b..25b667252e51218dbc2df44974c0f591df524bae 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Virtual terminal interface shell.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 1ed284809ed845c3097fab3bc53f4cf3ad500f34..a0667acc7ed8ce942ee71206ec32b6a9a9e3dbc8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* User authentication for vtysh.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2b31589f23f0441bb9e8618e6e98b211d61f6b04..322a3b26310daa9718e9502e9f449c68be639a4f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* User authentication for vtysh.
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _VTYSH_USER_H
index c37626ccc66ec280511d8a3e779aa77916f8e13a..84f4d02a8af4a164f7102a4aea672b63482d70c1 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Monitor status of frr daemons and restart if necessary.
  *
  * Copyright (C) 2004  Andrew J. Schorr
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4987a932c03c484dee4dd62db085839a32e38510..ed915fedbd984be3c871aa8f0d3a985aefa03ab8 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Common definitions for watchfrr API socket.
  *
  * Copyright (C) 2016  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef FRR_WATCHFRR_H
index 0aa27ef661a8f9e81c3d4fe5d5348be45bf2aeac..e79265dfa7c3bc6178ddc374b33529b6b1cb521a 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Watchfrr-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9d5abde52b7eb774d1b5ad1e7907568c38abdf1e..bf9ce78671b95d1f59a0a6bdc4662d6d4629ed6c 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Watchfrr-specific error messages.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __WATCHFRR_ERRORS_H__
index 742b474eab6f8ebc25c38fc6aac926b4130b7d2b..3afc76761d3edf2b83d78eca4b8702ef6356d271 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * watchfrr CLI functions.
  *
  * Copyright (C) 2016  David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
diff --git a/yang/LICENSE b/yang/LICENSE
deleted file mode 100644 (file)
index a7cec5d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright 2020 FRRouting
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
index c532973d7cee77f69d50e65820ab4f154ed08e62..6d37839cf36ea660a189cfb5be239a776797c975 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/python3
+# SPDX-License-Identifier: NONE
 #
 # YANG module to C wrapper
 # written 2018 by David Lamparter, placed in Public Domain.
diff --git a/yang/frr-affinity-map.yang b/yang/frr-affinity-map.yang
new file mode 100644 (file)
index 0000000..c4377e6
--- /dev/null
@@ -0,0 +1,81 @@
+module frr-affinity-map {
+  yang-version 1.1;
+  namespace "http://frrouting.org/yang/affinity-map";
+  prefix frr-affinity-map;
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+
+  import frr-filter {
+    prefix filter;
+  }
+
+  import frr-interface {
+    prefix frr-interface;
+  }
+
+  organization
+    "FRRouting";
+  contact
+    "FRR Users List:       <mailto:frog@lists.frrouting.org>
+     FRR Development List: <mailto:dev@lists.frrouting.org>";
+  description
+    "This module defines route map settings
+
+     Copyright 2022 FRRouting
+
+     Redistribution and use in source and binary forms, with or without
+     modification, are permitted provided that the following conditions
+     are met:
+
+     1. Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+
+     2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+     \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+     HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2022-11-03 {
+    description
+      "Initial revision";
+  }
+
+  container lib {
+    container affinity-maps {
+      description
+        "Affinity Mapping Table";
+      list affinity-map {
+        key "name";
+        description
+          "Affinity Mapping configuration";
+        leaf name {
+          type string {
+            length "1..32";
+          }
+          description
+            "Affinity Name";
+        }
+        leaf value {
+          type uint16 {
+            range "0..1023";
+          }
+          description
+            "Bit position";
+        }
+      }
+    }
+  }
+}
index d3e756e0bfce0a78593ec37161cbd89bac7109af..ffba42b53b9a3424d3cc03d5efdd4b8b4d608b31 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-bfdd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/bfdd";
index 8c3de839b6a85ea83b4f853fe15d24ad64f19cc4..d6196d68be61fbf13c2c71ad21fae628c6633654 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 submodule frr-bgp-bmp {
   yang-version 1.1;
 
index 4b080613d6371b86d509ec4c6bf63d762f7ed196..c22bdf996473eb4af9b7d07028c8d7e7288f8b83 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 submodule frr-bgp-common-multiprotocol {
   yang-version 1.1;
 
index 4c12b956c472e4ccf2b3153a6ef88410dae14d94..81683e899d1927c617dacd6914da42b517ff74ac 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 submodule frr-bgp-common-structure {
   yang-version 1.1;
 
index 6d7358066121e13f618656805a4a8f6a03bd544c..5a4c37974f40565c46ef12639a2a2dced0da5557 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 submodule frr-bgp-neighbor {
   yang-version 1.1;
 
index 15c31bf0103699e85b886f40ed0d7193f5246fb3..34214b7dbf6bb83bc7b858fd737a5f957a074820 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 submodule frr-bgp-peer-group {
   yang-version 1.1;
 
index ad2a142fef6d180310a924304f13c5a8b0c946b2..8e288194eceddafc06aec513867525bcf986f537 100644 (file)
@@ -356,6 +356,102 @@ module frr-bgp-route-map {
     }
   }
 
+  typedef route-distinguisher {
+    type string {
+      pattern
+        '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+      +     '42949672[0-8][0-9]|'
+      +     '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+      +     '42949[0-5][0-9]{4}|'
+      +     '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+      +     '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+      +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+      + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+      +     '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+      +     '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+      +     '655[0-2][0-9]|'
+      +     '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+      + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+      +     '4294967[01][0-9]{2}|'
+      +     '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+      +     '4294[0-8][0-9]{5}|'
+      +     '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+      +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+      +     '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+      + '(6(:[a-fA-F0-9]{2}){6})|'
+      + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+      +     '[0-9a-fA-F]{1,12})|'
+      +  '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+      +     '42949672[0-8][0-9]|'
+      +     '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+      +     '42949[0-5][0-9]{4}|'
+      +     '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+      +     '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+      +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)|'
+      +  '((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+      +     '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+      +     '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+      +     '655[0-2][0-9]|'
+      +     '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+      + '((429496729[0-5]|42949672[0-8][0-9]|'
+      +     '4294967[01][0-9]{2}|'
+      +     '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+      +     '4294[0-8][0-9]{5}|'
+      +     '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+      +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+      +     '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+      +  '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0).'
+      +  '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+      +     '6[0-4][0-9]{3}|'
+      +     '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):'
+      +     '(429496729[0-5]|42949672[0-8][0-9]|'
+      +     '4294967[01][0-9]{2}|'
+      +     '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+      +     '4294[0-8][0-9]{5}|'
+      +     '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+      +     '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))';
+    }
+
+    description
+      "A Route Distinguisher is an 8-octet value used to
+       distinguish routes from different BGP VPNs (RFC 4364).
+       A Route Distinguisher will have the same format as a
+       Route Target as per RFC 4360 and will consist of
+       two or three fields: a 2-octet Type field, an administrator
+       field, and, optionally, an assigned number field.
+       According to the data formats for types 0, 1, 2, and 6 as
+       defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
+       pattern is defined as:
+       0:2-octet-asn:4-octet-number
+       1:4-octet-ipv4addr:2-octet-number
+       2:4-octet-asn:2-octet-number
+       6:6-octet-mac-address
+       Additionally, a generic pattern is defined for future
+       route discriminator types:
+       2-octet-other-hex-number:6-octet-hex-number
+       Some valid examples are 0:100:100, 1:1.1.1.1:100,
+       2:1234567890:203, and 6:26:00:08:92:78:00.
+       The following route distinguisher with two fields are also
+       accepted : 10000:44 1.2.3.4:44.";
+    reference
+      "RFC 4360: BGP Extended Communities Attribute.
+       RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+       RFC 5668: 4-Octet AS Specific BGP Extended Community.
+       RFC 7432: BGP MPLS-Based Ethernet VPN.";
+  }
+
   typedef extcommunity-lb-type {
     type enumeration {
       enum "explicit-bandwidth" {
@@ -598,7 +694,7 @@ module frr-bgp-route-map {
       description
         "Match eVPN route-distinguisher";
       leaf route-distinguisher {
-        type rt-types:route-distinguisher;
+        type route-distinguisher;
       }
     }
 
index e9b6752f26c82724f8207fffcdfabef40622ee6a..7e75580eb573cc6b611bd7c79764e0a36c21d97d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-bgp-rpki {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/frr-bgp-rpki";
index 55834df2ee520ed4ca74e75e723a350facf309e0..7229572935d2c5efa4853461b8eb5f9f171f0a3b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-bgp-types {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/bgp-types";
index 0e15195dd5ad0ed8ef92d487a1b51a8a0c0ff9f4..b34fd43e78debcbaf1698d9f6caba970c4698180 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-bgp {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/bgp";
index 9d2725b253603db8b80d4f12c56d737c8bcf5ac8..46092cb248000afc503fbed146c255ed125a9607 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-deviations-bgp-datacenter {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/frr-deviations-bgp-datacenter";
index 2127ac498866803038f0ecba0bb4b667aafb75c1..e9071c8971994b55e6cfd1afec3753b8df535a19 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-eigrpd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/eigrpd";
index 46a9100ab2cb92972a56e5e57c7dde54e746833b..a1946d8342406550832544ba9fd207fd9c977f12 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-filter {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/filter";
index 298b2aafda5839bb43fb79dab9c8ae6f93e7dd38..a18651db284bd9ad741d27aa98e158bf7d2068b1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-gmp {
   yang-version "1.1";
   namespace "http://frrouting.org/yang/gmp";
index 4a152aaddab4e5df22c8ab290a4b4412fc40c019..012c96b6007bf8941c792f7cff871c587595294e 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-interface {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/interface";
index 5483410d04f73a3236e443ae5f3a8013c0d03eed..fd8a0de4ee3b12b465fa4d7a00acc1f1885a0ad2 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-isisd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/isisd";
index 90d3cc8601ee3975a58df4c1e7ac6867e003599b..668bb2160a288caeb04a36b0d1ef9e9c25f299be 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-module-translator {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/frr-module-translator";
index adcbacbfea5e4663fe980b554244b2fdba1324c1..d73fdb8bd3d67d3b462a9688962bddc924535b27 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-nexthop {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/nexthop";
index 33b453b299b512743e9a7a30b2a41125f74577b4..4cc214135df4aa736cf66cfd17b7b9c74fecbe79 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-pim-rp {
   yang-version "1.1";
   namespace "http://frrouting.org/yang/pim-rp";
index 9e40d786020f11f2d077b4e9bec75ce3c2ee5f97..105dab895da536b2371a2b708e015abf733b8224 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-pim {
   yang-version "1.1";
   namespace "http://frrouting.org/yang/pim";
index d77241cb15db0d450fbd4e532bff4dca1f0256e2..746bf35d28fe286b80ba87c67cd67f6dc87d22d8 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-ripd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/ripd";
index 07d38bd4167e0f238beda2d8fb2059223f1823b7..d7de4c398a3516a84239daa670f5cf8bb8186790 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-ripngd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/ripngd";
index 1e8c04bc6f9baf169911ed51ab7cd60d7bf686fc..224b2caef777d77097bc49fe62b8217c519527e6 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-route-map {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/route-map";
index ffc671c99ad2dad75a681e6510db6a08c625e1cc..728607cabe64711a3ec80a8575752636fa6c794f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-route-types {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/route-types";
index 6a721b29244d3e26184b891fb3b1500c95e247c1..b304c241a41c553c96acf8d4ff73f686a8e96b03 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-routing {
   yang-version "1.1";
   namespace "http://frrouting.org/yang/routing";
index cb5e25b877fa750ea0cbede4258396ad59ffbb14..1e6c54c00662d292dfe91d5afda47991f5cd192d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-staticd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/staticd";
index 2f89ebca886d26854fd8f7433da2234a32c64682..d6e7188240684319e22d0e2e5a454fedbb5df656 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-test-module {
   yang-version 1.1;
   namespace "urn:frr-test-module";
index bb17bfaddb3a8a1aa6553d516169bc1d89982c94..39123b72de78289168a2bff1fd92702621f35edf 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-vrf {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/vrf";
index cd04df267086e3ed3697f2163aded618e10fa4d1..ad9f1393557ffdb8fed1a83ccf517e9351e615f5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: BSD-2-Clause
 module frr-vrrpd {
   yang-version 1.1;
   namespace "http://frrouting.org/yang/vrrpd";
index a2c6bb4c2b8f496ad98c2ac21d5a9019d4e614ae..7f4254cd41379e9fb21c423eeff274d04e3414d6 100644 (file)
@@ -11,6 +11,10 @@ module frr-zebra {
     prefix inet;
   }
 
+  import frr-affinity-map {
+    prefix frr-affinity-map;
+  }
+
   import frr-route-map {
     prefix frr-route-map;
   }
@@ -1985,7 +1989,55 @@ module frr-zebra {
         description
           "Link bandwidth informational parameter, in megabits.";
       }
-      // TODO -- link-params for (experimental/partial TE use in IGP extensions)
+      container link-params {
+        description
+          "link-params for Traffic-Engineering (TE) use in IGP extensions.";
+        choice admin-group-mode {
+          description "Admin-group mode";
+          case legacy {
+            description
+              "Legacy mode. Only support standard admin-group (RFC3630/5305/5329)";
+            leaf legacy-admin-group {
+              description "Admin-Group value";
+              type uint32;
+            }
+          }
+          case affinity {
+            container affinities {
+              leaf-list affinity {
+                type string;
+                max-elements "256";
+                description
+                  "Array of Attribute Names";
+              }
+            }
+          }
+        }
+        leaf affinity-mode {
+          description
+            "Affinity mode";
+          default "extended";
+          type enumeration {
+              enum extended {
+              value 0;
+              description
+                "Extended Admin-Group only (RFC7308)";
+            }
+            enum standard {
+            value 1;
+              description
+                "Standard Admin-Group only (RFC3630/5305/5329)";
+            }
+            enum both {
+              value 2;
+              description
+                "Standard and extended Admin-Group";
+            }
+          }
+        }
+        // TODO -- other link-params options
+        // for (experimental/partial TE use in IGP extensions)
+      }
       container state {
         config false;
         description
index 48cdceccf43e864cad9e12ff79afc354c36eb3e6..70a8da39caeb1d8d213fd8a57419cb40db6a58fd 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 80028fcb18294bebd03dca35e7d1319097c8a61c..82a6a01474a46a1906c980c5a4e2a9c35b00f4b1 100644 (file)
@@ -19,6 +19,7 @@ EXTRA_DIST += yang/embedmodel.py
 # global symbols :(.  Just put it in the daemon.  Dynamic libraries.so work
 # without problems, as seen in libfrr.
 
+dist_yangmodels_DATA += yang/frr-affinity-map.yang
 dist_yangmodels_DATA += yang/frr-filter.yang
 dist_yangmodels_DATA += yang/frr-module-translator.yang
 dist_yangmodels_DATA += yang/frr-nexthop.yang
index c01be58e826813582fac3ceeadafa9eae6357a49..ee0823f56f458ac8ebbf7427c2ace23878af5baa 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Address linked list routine.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -247,7 +232,9 @@ void connected_up(struct interface *ifp, struct connected *ifc)
                        return;
 #endif
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                flog_warn(EC_ZEBRA_CONNECTED_AFI_UNKNOWN,
                          "Received unknown AFI: %s", afi2str(afi));
                return;
@@ -435,7 +422,9 @@ void connected_down(struct interface *ifp, struct connected *ifc)
                if (IN6_IS_ADDR_UNSPECIFIED(&p.u.prefix6))
                        return;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                zlog_warn("Unknown AFI: %s", afi2str(afi));
                break;
        }
index 3ed9f6d5b9afe1abc76c4ead8dcf32bc2af60915..4d714eaf51500ca1e1b7fc4ec1ece910b6ad0fdb 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface's address and mask.
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_CONNECTED_H
index 977af0e198963f35f8cfc0eb4b5a85d7172485a8..68bedaf0578abcddb74e3c663117e6c440954f2d 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra debug related function
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 514827707a1434d08f4a2b6280955f6456bf89cf..075d903c6b0efbf5fc969cbdb2a89e9f2f14b310 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra debug related function
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_DEBUG_H
index afefab66746d4543b5fafe326cd7f0cc3aedfaea..df0b5aae7bb6092eb3d36914998e9c4965fae90f 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2018 Rafael Zalamena
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
index 11a1af86c6f7e913ec8bc3995951419573daa050..87245f47e8f384ed079aa86a970cf9cb626fc63a 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane plugin for DPDK based hw offload
  *
  * Copyright (C) 2021 Nvidia
  * Anuradha Karuppiah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
index 40f9263ca1db5b8fb9d511034bb4eb0229fa8cd9..e5a3dbebab29f6e16c104046b1801a1fbd143b08 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane plugin for DPDK based hw offload
  *
  * Copyright (C) 2021 Nvidia
  * Anuradha Karuppiah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_DPLANE_DPDK_H
index b8483f4918b2f1ea8fd8554bb65f8859f6294e2f..e10f5258e43bdb2e2dcded81e8265dbd70aecefb 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane plugin for DPDK based hw offload
  *
  * Copyright (C) 2021 Nvidia
  * Anuradha Karuppiah
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_DPLANE_DPDK_PRIVATE_H
index d1814af3b7d8e4ea1d5cad794433b01a55d00850..45334a7c9498a1e88a15865562ed239b25b4d757 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane plugin for DPDK based hw offload
  *
  * Copyright (C) 2021 Nvidia
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 0a9fecc9dff1b306ac2bc1688768365459db2bee..18aed7b376a81a3b24a23969c97a79b7b42fc860 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane plugin for Forwarding Plane Manager (FPM) using netlink.
  *
  * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
  *                    Rafael Zalamena
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
 #include "zebra/zebra_dplane.h"
 #include "zebra/zebra_mpls.h"
 #include "zebra/zebra_router.h"
+#include "zebra/interface.h"
+#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mac.h"
-#include "zebra/zebra_vxlan_private.h"
 #include "zebra/kernel_netlink.h"
 #include "zebra/rt_netlink.h"
 #include "zebra/debug.h"
@@ -1189,7 +1177,7 @@ static void fpm_enqueue_rmac_table(struct hash_bucket *bucket, void *arg)
        struct fpm_rmac_arg *fra = arg;
        struct zebra_mac *zrmac = bucket->data;
        struct zebra_if *zif = fra->zl3vni->vxlan_if->info;
-       const struct zebra_l2info_vxlan *vxl = &zif->l2info.vxl;
+       struct zebra_vxlan_vni *vni;
        struct zebra_if *br_zif;
        vlanid_t vid;
        bool sticky;
@@ -1201,14 +1189,15 @@ static void fpm_enqueue_rmac_table(struct hash_bucket *bucket, void *arg)
        sticky = !!CHECK_FLAG(zrmac->flags,
                              (ZEBRA_MAC_STICKY | ZEBRA_MAC_REMOTE_DEF_GW));
        br_zif = (struct zebra_if *)(zif->brslave_info.br_if->info);
-       vid = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) ? vxl->access_vlan : 0;
+       vni = zebra_vxlan_if_vni_find(zif, fra->zl3vni->vni);
+       vid = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) ? vni->access_vlan : 0;
 
        dplane_ctx_reset(fra->ctx);
        dplane_ctx_set_op(fra->ctx, DPLANE_OP_MAC_INSTALL);
        dplane_mac_init(fra->ctx, fra->zl3vni->vxlan_if,
-                       zif->brslave_info.br_if, vid,
-                       &zrmac->macaddr, zrmac->fwd_info.r_vtep_ip, sticky,
-                       0 /*nhg*/, 0 /*update_flags*/);
+                       zif->brslave_info.br_if, vid, &zrmac->macaddr, vni->vni,
+                       zrmac->fwd_info.r_vtep_ip, sticky, 0 /*nhg*/,
+                       0 /*update_flags*/);
        if (fpm_nl_enqueue(fra->fnc, fra->ctx) == -1) {
                thread_add_timer(zrouter.master, fpm_rmac_send,
                                 fra->fnc, 1, &fra->fnc->t_rmacwalk);
index e02f3d5624a8ff059a2c2f6ed0bd23980cc9d16a..b3cf86512258f7b14b0e1c9ba4f48a2e435a88e4 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface looking up by ioctl ().
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index d628e47492a845ff41ea0f2b725995ce2c7a142d..21cad01374d438d819b4a6cf543bad8d81c0853e 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface looking up by netlink.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -544,7 +529,7 @@ static int netlink_extract_bridge_info(struct rtattr *link_data,
        memset(bridge_info, 0, sizeof(*bridge_info));
        netlink_parse_rtattr_nested(attr, IFLA_BR_MAX, link_data);
        if (attr[IFLA_BR_VLAN_FILTERING])
-               bridge_info->vlan_aware =
+               bridge_info->bridge.vlan_aware =
                        *(uint8_t *)RTA_DATA(attr[IFLA_BR_VLAN_FILTERING]);
        return 0;
 }
@@ -612,6 +597,7 @@ static int netlink_extract_gre_info(struct rtattr *link_data,
 static int netlink_extract_vxlan_info(struct rtattr *link_data,
                                      struct zebra_l2info_vxlan *vxl_info)
 {
+       uint8_t svd = 0;
        struct rtattr *attr[IFLA_VXLAN_MAX + 1];
        vni_t vni_in_msg;
        struct in_addr vtep_ip_in_msg;
@@ -619,15 +605,33 @@ static int netlink_extract_vxlan_info(struct rtattr *link_data,
 
        memset(vxl_info, 0, sizeof(*vxl_info));
        netlink_parse_rtattr_nested(attr, IFLA_VXLAN_MAX, link_data);
-       if (!attr[IFLA_VXLAN_ID]) {
+       if (attr[IFLA_VXLAN_COLLECT_METADATA]) {
+               svd = *(uint8_t *)RTA_DATA(attr[IFLA_VXLAN_COLLECT_METADATA]);
                if (IS_ZEBRA_DEBUG_KERNEL)
                        zlog_debug(
-                               "IFLA_VXLAN_ID missing from VXLAN IF message");
-               return -1;
+                               "IFLA_VXLAN_COLLECT_METADATA=%u in VXLAN IF message",
+                               svd);
+       }
+
+       if (!svd) {
+               /*
+                * In case of svd we will not get vni info directly from the
+                * device
+                */
+               if (!attr[IFLA_VXLAN_ID]) {
+                       if (IS_ZEBRA_DEBUG_KERNEL)
+                               zlog_debug(
+                                       "IFLA_VXLAN_ID missing from VXLAN IF message");
+                       return -1;
+               }
+
+               vxl_info->vni_info.iftype = ZEBRA_VXLAN_IF_VNI;
+               vni_in_msg = *(vni_t *)RTA_DATA(attr[IFLA_VXLAN_ID]);
+               vxl_info->vni_info.vni.vni = vni_in_msg;
+       } else {
+               vxl_info->vni_info.iftype = ZEBRA_VXLAN_IF_SVD;
        }
 
-       vni_in_msg = *(vni_t *)RTA_DATA(attr[IFLA_VXLAN_ID]);
-       vxl_info->vni = vni_in_msg;
        if (!attr[IFLA_VXLAN_LOCAL]) {
                if (IS_ZEBRA_DEBUG_KERNEL)
                        zlog_debug(
@@ -639,8 +643,10 @@ static int netlink_extract_vxlan_info(struct rtattr *link_data,
        }
 
        if (attr[IFLA_VXLAN_GROUP]) {
-               vxl_info->mcast_grp =
-                       *(struct in_addr *)RTA_DATA(attr[IFLA_VXLAN_GROUP]);
+               if (!svd)
+                       vxl_info->vni_info.vni.mcast_grp =
+                               *(struct in_addr *)RTA_DATA(
+                                       attr[IFLA_VXLAN_GROUP]);
        }
 
        if (!attr[IFLA_VXLAN_LINK]) {
@@ -701,16 +707,113 @@ static void netlink_interface_update_l2info(struct interface *ifp,
        }
 }
 
+static int netlink_bridge_vxlan_vlan_vni_map_update(struct interface *ifp,
+                                                   struct rtattr *af_spec)
+{
+       int rem;
+       vni_t vni_id;
+       vlanid_t vid;
+       uint16_t flags;
+       struct rtattr *i;
+       struct zebra_vxlan_vni vni;
+       struct zebra_vxlan_vni *vnip;
+       struct hash *vni_table = NULL;
+       struct zebra_vxlan_vni vni_end;
+       struct zebra_vxlan_vni vni_start;
+       struct rtattr *aftb[IFLA_BRIDGE_VLAN_TUNNEL_MAX + 1];
+
+       memset(&vni_start, 0, sizeof(vni_start));
+       memset(&vni_end, 0, sizeof(vni_end));
+
+       for (i = RTA_DATA(af_spec), rem = RTA_PAYLOAD(af_spec); RTA_OK(i, rem);
+            i = RTA_NEXT(i, rem)) {
+
+               if (i->rta_type != IFLA_BRIDGE_VLAN_TUNNEL_INFO)
+                       continue;
+
+               memset(aftb, 0, sizeof(aftb));
+               netlink_parse_rtattr_nested(aftb, IFLA_BRIDGE_VLAN_TUNNEL_MAX,
+                                           i);
+               if (!aftb[IFLA_BRIDGE_VLAN_TUNNEL_ID] ||
+                   !aftb[IFLA_BRIDGE_VLAN_TUNNEL_VID])
+                       /* vlan-vni info missing */
+                       return 0;
+
+               flags = 0;
+               memset(&vni, 0, sizeof(vni));
+
+               vni.vni = *(vni_t *)RTA_DATA(aftb[IFLA_BRIDGE_VLAN_TUNNEL_ID]);
+               vni.access_vlan = *(vlanid_t *)RTA_DATA(
+                       aftb[IFLA_BRIDGE_VLAN_TUNNEL_VID]);
+
+               if (aftb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS])
+                       flags = *(uint16_t *)RTA_DATA(
+                               aftb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]);
+
+               if (flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
+                       vni_start = vni;
+                       continue;
+               }
+
+               if (flags & BRIDGE_VLAN_INFO_RANGE_END)
+                       vni_end = vni;
+
+               if (!(flags & BRIDGE_VLAN_INFO_RANGE_END)) {
+                       vni_start = vni;
+                       vni_end = vni;
+               }
+
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug(
+                               "Vlan-Vni(%d:%d-%d:%d) update for VxLAN IF %s(%u)",
+                               vni_start.access_vlan, vni_end.access_vlan,
+                               vni_start.vni, vni_end.vni, ifp->name,
+                               ifp->ifindex);
+
+               if (!vni_table) {
+                       vni_table = zebra_vxlan_vni_table_create();
+                       if (!vni_table)
+                               return 0;
+               }
+
+               for (vid = vni_start.access_vlan, vni_id = vni_start.vni;
+                    vid <= vni_end.access_vlan; vid++, vni_id++) {
+
+                       memset(&vni, 0, sizeof(vni));
+                       vni.vni = vni_id;
+                       vni.access_vlan = vid;
+                       vnip = hash_get(vni_table, &vni, zebra_vxlan_vni_alloc);
+                       if (!vnip)
+                               return 0;
+               }
+
+               memset(&vni_start, 0, sizeof(vni_start));
+               memset(&vni_end, 0, sizeof(vni_end));
+       }
+
+       if (vni_table)
+               zebra_vxlan_if_vni_table_add_update(ifp, vni_table);
+
+       return 0;
+}
+
 static int netlink_bridge_vxlan_update(struct interface *ifp,
                struct rtattr *af_spec)
 {
        struct rtattr *aftb[IFLA_BRIDGE_MAX + 1];
        struct bridge_vlan_info *vinfo;
+       struct zebra_if *zif;
        vlanid_t access_vlan;
 
        if (!af_spec)
                return 0;
 
+       zif = (struct zebra_if *)ifp->info;
+
+       /* Single vxlan devices has vni-vlan range to update */
+       if (IS_ZEBRA_VXLAN_IF_SVD(zif))
+               return netlink_bridge_vxlan_vlan_vni_map_update(ifp, af_spec);
+
        /* There is a 1-to-1 mapping of VLAN to VxLAN - hence
         * only 1 access VLAN is accepted.
         */
@@ -1362,7 +1465,57 @@ static ssize_t netlink_intf_msg_encoder(struct zebra_dplane_ctx *ctx, void *buf,
        case DPLANE_OP_INTF_DELETE:
                cmd = RTM_DELLINK;
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                flog_err(
                        EC_ZEBRA_NHG_FIB_UPDATE,
                        "Context received for kernel interface update with incorrect OP code (%u)",
@@ -1996,7 +2149,15 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
                        if (tb[IFLA_PROTO_DOWN])
                                netlink_proc_dplane_if_protodown(ifp->info, tb);
-
+                       if (IS_ZEBRA_IF_BRIDGE(ifp)) {
+                               zif = ifp->info;
+                               if (IS_ZEBRA_DEBUG_KERNEL)
+                                       zlog_debug(
+                                               "RTM_NEWLINK ADD for %s(%u), vlan-aware %d",
+                                               name, ifp->ifindex,
+                                               IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(
+                                                       zif));
+                       }
                } else if (ifp->vrf->vrf_id != vrf_id) {
                        /* VRF change for an interface. */
                        if (IS_ZEBRA_DEBUG_KERNEL)
@@ -2132,6 +2293,14 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        else if (IS_ZEBRA_IF_BOND_SLAVE(ifp) || was_bond_slave)
                                zebra_l2if_update_bond_slave(ifp, bond_ifindex,
                                                             !!bypass);
+                       if (IS_ZEBRA_IF_BRIDGE(ifp)) {
+                               if (IS_ZEBRA_DEBUG_KERNEL)
+                                       zlog_debug(
+                                               "RTM_NEWLINK update for %s(%u), vlan-aware %d",
+                                               name, ifp->ifindex,
+                                               IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(
+                                                       zif));
+                       }
                }
 
                zif = ifp->info;
@@ -2354,4 +2523,235 @@ int netlink_tunneldump_read(struct zebra_ns *zns)
 
        return 0;
 }
+
+static const char *port_state2str(uint8_t state)
+{
+       switch (state) {
+       case BR_STATE_DISABLED:
+               return "DISABLED";
+       case BR_STATE_LISTENING:
+               return "LISTENING";
+       case BR_STATE_LEARNING:
+               return "LEARNING";
+       case BR_STATE_FORWARDING:
+               return "FORWARDING";
+       case BR_STATE_BLOCKING:
+               return "BLOCKING";
+       }
+
+       return "UNKNOWN";
+}
+
+static void vxlan_vni_state_change(struct zebra_if *zif, uint16_t id,
+                                  uint8_t state)
+{
+       struct zebra_vxlan_vni *vnip;
+
+       vnip = zebra_vxlan_if_vlanid_vni_find(zif, id);
+
+       if (!vnip) {
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Cannot find VNI for VID (%u) IF %s for vlan state update",
+                               id, zif->ifp->name);
+
+               return;
+       }
+
+       switch (state) {
+       case BR_STATE_FORWARDING:
+               zebra_vxlan_if_vni_up(zif->ifp, vnip);
+               break;
+       case BR_STATE_BLOCKING:
+               zebra_vxlan_if_vni_down(zif->ifp, vnip);
+               break;
+       case BR_STATE_DISABLED:
+       case BR_STATE_LISTENING:
+       case BR_STATE_LEARNING:
+       default:
+               /* Not used for anything at the moment */
+               break;
+       }
+}
+
+static void vlan_id_range_state_change(struct interface *ifp, uint16_t id_start,
+                                      uint16_t id_end, uint8_t state)
+{
+       struct zebra_if *zif;
+
+       zif = (struct zebra_if *)ifp->info;
+
+       if (!zif)
+               return;
+
+       for (uint16_t i = id_start; i <= id_end; i++)
+               vxlan_vni_state_change(zif, i, state);
+}
+
+/**
+ * netlink_vlan_change() - Read in change about vlans from the kernel
+ *
+ * @h:         Netlink message header
+ * @ns_id:     Namspace id
+ * @startup:   Are we reading under startup conditions?
+ *
+ * Return:     Result status
+ */
+int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
+{
+       int len, rem;
+       struct interface *ifp;
+       struct br_vlan_msg *bvm;
+       struct bridge_vlan_info *vinfo;
+       struct rtattr *vtb[BRIDGE_VLANDB_ENTRY_MAX + 1] = {};
+       struct rtattr *attr;
+       uint8_t state;
+       uint32_t vrange;
+       int type;
+
+       /* We only care about state changes for now */
+       if (!(h->nlmsg_type == RTM_NEWVLAN))
+               return 0;
+
+       len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct br_vlan_msg));
+       if (len < 0) {
+               zlog_warn(
+                       "%s: Message received from netlink is of a broken size %d %zu",
+                       __func__, h->nlmsg_len,
+                       (size_t)NLMSG_LENGTH(sizeof(struct br_vlan_msg)));
+               return -1;
+       }
+
+       bvm = NLMSG_DATA(h);
+
+       if (bvm->family != AF_BRIDGE)
+               return 0;
+
+       ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), bvm->ifindex);
+       if (!ifp) {
+               zlog_debug("Cannot find bridge-vlan IF (%u) for vlan update",
+                          bvm->ifindex);
+               return 0;
+       }
+
+       if (!IS_ZEBRA_IF_VXLAN(ifp)) {
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug("Ignoring non-vxlan IF (%s) for vlan update",
+                                  ifp->name);
+
+               return 0;
+       }
+
+       if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("%s %s IF %s NS %u",
+                          nl_msg_type_to_str(h->nlmsg_type),
+                          nl_family_to_str(bvm->family), ifp->name, ns_id);
+
+       /* Loop over "ALL" BRIDGE_VLANDB_ENTRY */
+       rem = len;
+       for (attr = BRVLAN_RTA(bvm); RTA_OK(attr, rem);
+            attr = RTA_NEXT(attr, rem)) {
+               vinfo = NULL;
+               vrange = 0;
+
+               type = attr->rta_type & NLA_TYPE_MASK;
+
+               if (type != BRIDGE_VLANDB_ENTRY)
+                       continue;
+
+               /* Parse nested entry data */
+               netlink_parse_rtattr_nested(vtb, BRIDGE_VLANDB_ENTRY_MAX, attr);
+
+               /* It must have info for the ID */
+               if (!vtb[BRIDGE_VLANDB_ENTRY_INFO])
+                       continue;
+
+               vinfo = (struct bridge_vlan_info *)RTA_DATA(
+                       vtb[BRIDGE_VLANDB_ENTRY_INFO]);
+
+               /*
+                * We only care about state info, if there is none, just ignore
+                * it.
+                */
+               if (!vtb[BRIDGE_VLANDB_ENTRY_STATE])
+                       continue;
+
+               state = *(uint8_t *)RTA_DATA(vtb[BRIDGE_VLANDB_ENTRY_STATE]);
+
+               if (vtb[BRIDGE_VLANDB_ENTRY_RANGE])
+                       vrange = *(uint32_t *)RTA_DATA(
+                               vtb[BRIDGE_VLANDB_ENTRY_RANGE]);
+
+               if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN) {
+                       if (vrange)
+                               zlog_debug("VLANDB_ENTRY: VID (%u-%u) state=%s",
+                                          vinfo->vid, vrange,
+                                          port_state2str(state));
+                       else
+                               zlog_debug("VLANDB_ENTRY: VID (%u) state=%s",
+                                          vinfo->vid, port_state2str(state));
+               }
+
+               vlan_id_range_state_change(
+                       ifp, vinfo->vid, (vrange ? vrange : vinfo->vid), state);
+       }
+
+       return 0;
+}
+
+/**
+ * netlink_request_vlan() - Request vlan information from the kernel
+ * @zns:       Zebra namespace
+ * @family:    AF_* netlink family
+ * @type:      RTM_* type
+ *
+ * Return:     Result status
+ */
+static int netlink_request_vlan(struct zebra_ns *zns, int family, int type)
+{
+       struct {
+               struct nlmsghdr n;
+               struct br_vlan_msg bvm;
+               char buf[256];
+       } req;
+
+       /* Form the request, specifying filter (rtattr) if needed. */
+       memset(&req, 0, sizeof(req));
+       req.n.nlmsg_type = type;
+       req.n.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+       req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct br_vlan_msg));
+       req.bvm.family = family;
+
+       nl_attr_put32(&req.n, sizeof(req), BRIDGE_VLANDB_DUMP_FLAGS,
+                     BRIDGE_VLANDB_DUMPF_STATS);
+
+       return netlink_request(&zns->netlink_cmd, &req);
+}
+
+/**
+ * netlink_vlan_read() - Vlan read function using netlink interface
+ *
+ * @zns:       Zebra name space
+ *
+ * Return:     Result status
+ * Only called at bootstrap time.
+ */
+int netlink_vlan_read(struct zebra_ns *zns)
+{
+       int ret;
+       struct zebra_dplane_info dp_info;
+
+       zebra_dplane_info_from_zns(&dp_info, zns, true /*is_cmd*/);
+
+       /* Get bridg vlan info */
+       ret = netlink_request_vlan(zns, PF_BRIDGE, RTM_GETVLAN);
+       if (ret < 0)
+               return ret;
+
+       ret = netlink_parse_info(netlink_vlan_change, &zns->netlink_cmd,
+                                &dp_info, 0, 1);
+
+       return ret;
+}
+
 #endif /* GNU_LINUX */
index 21ae1713be9f7beee2757be86e0fe7c1e9ff2eac..ede6224188a1b88a183929059b84b65e3a516878 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Header file exported by if_netlink.c to zebra.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_IF_NETLINK_H
@@ -40,6 +25,9 @@ int netlink_interface_addr_dplane(struct nlmsghdr *h, ns_id_t ns_id,
 extern int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
 extern int interface_lookup_netlink(struct zebra_ns *zns);
 
+extern int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
+extern int netlink_vlan_read(struct zebra_ns *zns);
+
 extern ssize_t netlink_intf_msg_encode(uint16_t cmd,
                                       const struct zebra_dplane_ctx *ctx,
                                       void *buf, size_t buflen);
index da9fadf7c7e3665dbfdbdccddad668ce7f9d0180..1172f8b1011668f9f882c2f678dcb99f055671f3 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Interface interaction with the kernel using socket.
  * Copyright (C) 2022  NVIDIA CORPORATION & AFFILIATES
  *                     Stephen Worley
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index 70d11646c34488916fc4d9513cc377a90a443992..ae292689ed3050680898870a1fe54e995a8645c7 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Get interface's address and mask information by sysctl() function.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 59563834ef9c64d2ec2035f9ad56c0d0febbfe62..1ba5e972f8d7606b211ef548548e9cdf6276e603 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Interface function.
  * Copyright (C) 1997, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -33,6 +18,7 @@
 #include "log.h"
 #include "zclient.h"
 #include "vrf.h"
+#include "lib/northbound_cli.h"
 
 #include "zebra/rtadv.h"
 #include "zebra_ns.h"
@@ -228,6 +214,7 @@ static int if_zebra_delete_hook(struct interface *ifp)
 
                rtadv_if_fini(zebra_if);
 
+               zebra_l2_bridge_if_cleanup(ifp);
                zebra_evpn_if_cleanup(zebra_if);
                zebra_evpn_mac_ifp_del(ifp);
 
@@ -806,12 +793,12 @@ void if_delete_update(struct interface **pifp)
        /* Reset some zebra interface params to default values. */
        zif = ifp->info;
        if (zif) {
+               zebra_evpn_if_cleanup(zif);
                zif->zif_type = ZEBRA_IF_OTHER;
                zif->zif_slave_type = ZEBRA_IF_SLAVE_NONE;
                memset(&zif->l2info, 0, sizeof(union zebra_l2if_info));
                memset(&zif->brslave_info, 0,
                       sizeof(struct zebra_l2info_brslave));
-               zebra_evpn_if_cleanup(zif);
                zebra_evpn_mac_ifp_del(ifp);
        }
 
@@ -1889,6 +1876,63 @@ static inline bool if_is_protodown_applicable(struct interface *ifp)
        return true;
 }
 
+static void zebra_vxlan_if_vni_dump_vty(struct vty *vty,
+                                       struct zebra_vxlan_vni *vni)
+{
+       char str[INET6_ADDRSTRLEN];
+
+       vty_out(vty, "  VxLAN Id %u", vni->vni);
+       if (vni->access_vlan)
+               vty_out(vty, " Access VLAN Id %u\n", vni->access_vlan);
+
+       if (vni->mcast_grp.s_addr != INADDR_ANY)
+               vty_out(vty, "  Mcast Group %s",
+                       inet_ntop(AF_INET, &vni->mcast_grp, str, sizeof(str)));
+}
+
+static void zebra_vxlan_if_vni_hash_dump_vty(struct hash_bucket *bucket,
+                                            void *ctxt)
+{
+       struct vty *vty;
+       struct zebra_vxlan_vni *vni;
+
+       vni = (struct zebra_vxlan_vni *)bucket->data;
+       vty = (struct vty *)ctxt;
+
+       zebra_vxlan_if_vni_dump_vty(vty, vni);
+}
+
+static void zebra_vxlan_if_dump_vty(struct vty *vty, struct zebra_if *zebra_if)
+{
+       struct zebra_l2info_vxlan *vxlan_info;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       vxlan_info = &zebra_if->l2info.vxl;
+       vni_info = &vxlan_info->vni_info;
+
+       if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
+               vty_out(vty, " VTEP IP: %pI4", &vxlan_info->vtep_ip);
+
+       if (vxlan_info->ifindex_link && (vxlan_info->link_nsid != NS_UNKNOWN)) {
+               struct interface *ifp;
+
+               ifp = if_lookup_by_index_per_ns(
+                       zebra_ns_lookup(vxlan_info->link_nsid),
+                       vxlan_info->ifindex_link);
+               vty_out(vty, " Link Interface %s",
+                       ifp == NULL ? "Unknown" : ifp->name);
+       }
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) {
+               zebra_vxlan_if_vni_dump_vty(vty, &vni_info->vni);
+       } else {
+               hash_iterate(vni_info->vni_table,
+                            zebra_vxlan_if_vni_hash_dump_vty, vty);
+       }
+
+       vty_out(vty, "\n");
+}
+
 /* Interface's information print out to vty interface. */
 static void if_dump_vty(struct vty *vty, struct interface *ifp)
 {
@@ -1997,42 +2041,15 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
                zebra_zifslavetype_2str(zebra_if->zif_slave_type));
 
        if (IS_ZEBRA_IF_BRIDGE(ifp)) {
-               struct zebra_l2info_bridge *bridge_info;
-
-               bridge_info = &zebra_if->l2info.br;
                vty_out(vty, "  Bridge VLAN-aware: %s\n",
-                       bridge_info->vlan_aware ? "yes" : "no");
+                       IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zebra_if) ? "yes" : "no");
        } else if (IS_ZEBRA_IF_VLAN(ifp)) {
                struct zebra_l2info_vlan *vlan_info;
 
                vlan_info = &zebra_if->l2info.vl;
                vty_out(vty, "  VLAN Id %u\n", vlan_info->vid);
        } else if (IS_ZEBRA_IF_VXLAN(ifp)) {
-               struct zebra_l2info_vxlan *vxlan_info;
-
-               vxlan_info = &zebra_if->l2info.vxl;
-               vty_out(vty, "  VxLAN Id %u", vxlan_info->vni);
-               if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
-                       vty_out(vty, " VTEP IP: %pI4",
-                               &vxlan_info->vtep_ip);
-               if (vxlan_info->access_vlan)
-                       vty_out(vty, " Access VLAN Id %u\n",
-                               vxlan_info->access_vlan);
-               if (vxlan_info->mcast_grp.s_addr != INADDR_ANY)
-                       vty_out(vty, "  Mcast Group %pI4",
-                                       &vxlan_info->mcast_grp);
-               if (vxlan_info->ifindex_link &&
-                   (vxlan_info->link_nsid != NS_UNKNOWN)) {
-                               struct interface *ifp;
-
-                               ifp = if_lookup_by_index_per_ns(
-                                       zebra_ns_lookup(vxlan_info->link_nsid),
-                                       vxlan_info->ifindex_link);
-                               vty_out(vty, " Link Interface %s",
-                                       ifp == NULL ? "Unknown" :
-                                       ifp->name);
-               }
-               vty_out(vty, "\n");
+               zebra_vxlan_if_dump_vty(vty, zebra_if);
        } else if (IS_ZEBRA_IF_GRE(ifp)) {
                struct zebra_l2info_gre *gre_info;
 
@@ -2225,6 +2242,59 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
 #endif /* HAVE_NET_RT_IFLIST */
 }
 
+static void zebra_vxlan_if_vni_dump_vty_json(json_object *json_if,
+                                            struct zebra_vxlan_vni *vni)
+{
+       json_object_int_add(json_if, "vxlanId", vni->vni);
+       if (vni->access_vlan)
+               json_object_int_add(json_if, "accessVlanId", vni->access_vlan);
+       if (vni->mcast_grp.s_addr != INADDR_ANY)
+               json_object_string_addf(json_if, "mcastGroup", "%pI4",
+                                       &vni->mcast_grp);
+}
+
+static void zebra_vxlan_if_vni_hash_dump_vty_json(struct hash_bucket *bucket,
+                                                 void *ctxt)
+{
+       json_object *json_if;
+       struct zebra_vxlan_vni *vni;
+
+       vni = (struct zebra_vxlan_vni *)bucket->data;
+       json_if = (json_object *)ctxt;
+
+       zebra_vxlan_if_vni_dump_vty_json(json_if, vni);
+}
+
+static void zebra_vxlan_if_dump_vty_json(json_object *json_if,
+                                        struct zebra_if *zebra_if)
+{
+       struct zebra_l2info_vxlan *vxlan_info;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       vxlan_info = &zebra_if->l2info.vxl;
+       vni_info = &vxlan_info->vni_info;
+
+       if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
+               json_object_string_addf(json_if, "vtepIp", "%pI4",
+                                       &vxlan_info->vtep_ip);
+
+       if (vxlan_info->ifindex_link && (vxlan_info->link_nsid != NS_UNKNOWN)) {
+               struct interface *ifp;
+
+               ifp = if_lookup_by_index_per_ns(
+                       zebra_ns_lookup(vxlan_info->link_nsid),
+                       vxlan_info->ifindex_link);
+               json_object_string_add(json_if, "linkInterface",
+                                      ifp == NULL ? "Unknown" : ifp->name);
+       }
+       if (IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) {
+               zebra_vxlan_if_vni_dump_vty_json(json_if, &vni_info->vni);
+       } else {
+               hash_iterate(vni_info->vni_table,
+                            zebra_vxlan_if_vni_hash_dump_vty_json, json_if);
+       }
+}
+
 static void if_dump_vty_json(struct vty *vty, struct interface *ifp,
                             json_object *json)
 {
@@ -2352,37 +2422,15 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp,
 
                bridge_info = &zebra_if->l2info.br;
                json_object_boolean_add(json_if, "bridgeVlanAware",
-                                       bridge_info->vlan_aware);
+                                       bridge_info->bridge.vlan_aware);
        } else if (IS_ZEBRA_IF_VLAN(ifp)) {
                struct zebra_l2info_vlan *vlan_info;
 
                vlan_info = &zebra_if->l2info.vl;
                json_object_int_add(json_if, "vlanId", vlan_info->vid);
        } else if (IS_ZEBRA_IF_VXLAN(ifp)) {
-               struct zebra_l2info_vxlan *vxlan_info;
-
-               vxlan_info = &zebra_if->l2info.vxl;
-               json_object_int_add(json_if, "vxlanId", vxlan_info->vni);
-               if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
-                       json_object_string_addf(json_if, "vtepIp", "%pI4",
-                                               &vxlan_info->vtep_ip);
-               if (vxlan_info->access_vlan)
-                       json_object_int_add(json_if, "accessVlanId",
-                                           vxlan_info->access_vlan);
-               if (vxlan_info->mcast_grp.s_addr != INADDR_ANY)
-                       json_object_string_addf(json_if, "mcastGroup", "%pI4",
-                                               &vxlan_info->mcast_grp);
-               if (vxlan_info->ifindex_link
-                   && (vxlan_info->link_nsid != NS_UNKNOWN)) {
-                       struct interface *ifp;
+               zebra_vxlan_if_dump_vty_json(json_if, zebra_if);
 
-                       ifp = if_lookup_by_index_per_ns(
-                               zebra_ns_lookup(vxlan_info->link_nsid),
-                               vxlan_info->ifindex_link);
-                       json_object_string_add(json_if, "linkInterface",
-                                              ifp == NULL ? "Unknown"
-                                                          : ifp->name);
-               }
        } else if (IS_ZEBRA_IF_GRE(ifp)) {
                struct zebra_l2info_gre *gre_info;
 
@@ -3300,6 +3348,8 @@ DEFUN (no_link_params_enable,
        NO_STR
        "Disable link parameters on this interface\n")
 {
+       char xpath[XPATH_MAXLEN];
+       int ret;
        VTY_DECLVAR_CONTEXT(interface, ifp);
 
        if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
@@ -3308,6 +3358,18 @@ DEFUN (no_link_params_enable,
 
        if_link_params_free(ifp);
 
+       snprintf(
+               xpath, sizeof(xpath),
+               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities",
+               ifp->name);
+       if (yang_dnode_exists(running_config->dnode, xpath))
+               nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
+
+       ret = nb_cli_apply_changes(vty, NULL);
+
+       if (ret != CMD_SUCCESS)
+               return ret;
+
        /* force protocols to update LINK STATE due to parameters change */
        if (if_is_operative(ifp))
                zebra_interface_parameters_update(ifp);
@@ -3473,16 +3535,27 @@ DEFUN (link_params_unrsv_bw,
        return CMD_SUCCESS;
 }
 
-DEFUN (link_params_admin_grp,
-       link_params_admin_grp_cmd,
-       "admin-grp BITPATTERN",
-       "Administrative group membership\n"
-       "32-bit Hexadecimal value (e.g. 0xa1)\n")
+DEFPY_YANG(link_params_admin_grp, link_params_admin_grp_cmd,
+          "admin-grp BITPATTERN",
+          "Administrative group membership\n"
+          "32-bit Hexadecimal value (e.g. 0xa1)\n")
 {
+       char xpath[XPATH_MAXLEN];
        int idx_bitpattern = 1;
-       VTY_DECLVAR_CONTEXT(interface, ifp);
-       struct if_link_params *iflp = if_link_params_get(ifp);
        unsigned long value;
+       char value_str[11];
+
+       VTY_DECLVAR_CONTEXT(interface, ifp);
+
+       snprintf(
+               xpath, sizeof(xpath),
+               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities",
+               ifp->name);
+       if (yang_dnode_exists(running_config->dnode, xpath)) {
+               vty_out(vty,
+                       "cannot use the admin-grp command when affinity is set\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        if (sscanf(argv[idx_bitpattern]->arg, "0x%lx", &value) != 1) {
                vty_out(vty, "link_params_admin_grp: fscanf: %s\n",
@@ -3490,27 +3563,29 @@ DEFUN (link_params_admin_grp,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
-       if (!iflp)
-               iflp = if_link_params_enable(ifp);
+       if (value > 0xFFFFFFFF) {
+               vty_out(vty, "value must be not be superior to 0xFFFFFFFF\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
-       /* Update Administrative Group if needed */
-       link_param_cmd_set_uint32(ifp, &iflp->admin_grp, LP_ADM_GRP, value);
+       snprintf(value_str, sizeof(value_str), "%ld", value);
 
-       return CMD_SUCCESS;
+       nb_cli_enqueue_change(
+               vty, "./frr-zebra:zebra/link-params/legacy-admin-group",
+               NB_OP_MODIFY, value_str);
+
+       return nb_cli_apply_changes(vty, NULL);
 }
 
-DEFUN (no_link_params_admin_grp,
-       no_link_params_admin_grp_cmd,
-       "no admin-grp",
-       NO_STR
-       "Disable Administrative group membership on this interface\n")
+DEFPY_YANG(no_link_params_admin_grp, no_link_params_admin_grp_cmd,
+          "no admin-grp",
+          NO_STR "Disable Administrative group membership on this interface\n")
 {
-       VTY_DECLVAR_CONTEXT(interface, ifp);
+       nb_cli_enqueue_change(
+               vty, "./frr-zebra:zebra/link-params/legacy-admin-group",
+               NB_OP_DESTROY, NULL);
 
-       /* Unset Admin Group */
-       link_param_cmd_unset(ifp, LP_ADM_GRP);
-
-       return CMD_SUCCESS;
+       return nb_cli_apply_changes(vty, NULL);
 }
 
 /* RFC5392 & RFC5316: INTER-AS */
@@ -3927,6 +4002,118 @@ DEFUN (no_link_params_use_bw,
        return CMD_SUCCESS;
 }
 
+static int ag_change(struct vty *vty, int argc, struct cmd_token **argv,
+                    const char *xpath, bool no, int start_idx)
+{
+       for (int i = start_idx; i < argc; i++)
+               nb_cli_enqueue_change(vty, xpath,
+                                     no ? NB_OP_DESTROY : NB_OP_CREATE,
+                                     argv[i]->arg);
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity
+ */
+DEFPY_YANG(link_params_affinity, link_params_affinity_cmd,
+          "[no] affinity NAME...",
+          NO_STR
+          "Interface affinities\n"
+          "Affinity names\n")
+{
+       VTY_DECLVAR_CONTEXT(interface, ifp);
+       char xpath[XPATH_MAXLEN];
+
+       snprintf(
+               xpath, sizeof(xpath),
+               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/legacy-admin-group",
+               ifp->name);
+       if (yang_dnode_exists(running_config->dnode, xpath)) {
+               vty_out(vty,
+                       "cannot use the affinity command when admin-grp is set\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       return ag_change(vty, argc, argv,
+                        "./frr-zebra:zebra/link-params/affinities/affinity",
+                        no, no ? 2 : 1);
+}
+
+
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity-mode
+ */
+DEFPY_YANG(link_params_affinity_mode, link_params_affinity_mode_cmd,
+          "affinity-mode <standard|extended|both>$affmode",
+          "Interface affinity mode\n"
+          "Standard Admin-Group only RFC3630,5305,5329 (default)\n"
+          "Extended Admin-Group only RFC7308\n"
+          "Standard and extended Admin-Group format\n")
+{
+       const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
+
+       nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, affmode);
+
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+DEFPY_YANG(no_link_params_affinity_mode, no_link_params_affinity_mode_cmd,
+          "no affinity-mode [<standard|extended|both>]",
+          NO_STR
+          "Interface affinity mode\n"
+          "Standard Admin-Group only RFC3630,5305,5329 (default)\n"
+          "Extended Admin-Group only RFC7308\n"
+          "Standard and extended Admin-Group format\n")
+{
+       const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
+
+       nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, "standard");
+
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+static int ag_iter_cb(const struct lyd_node *dnode, void *arg)
+{
+       struct vty *vty = (struct vty *)arg;
+
+       vty_out(vty, " %s", yang_dnode_get_string(dnode, "."));
+       return YANG_ITER_CONTINUE;
+}
+
+void cli_show_legacy_admin_group(struct vty *vty, const struct lyd_node *dnode,
+                                bool show_defaults)
+{
+       if (!yang_dnode_exists(dnode, "./legacy-admin-group"))
+               return;
+
+       vty_out(vty, "  admin-group 0x%x\n",
+               yang_dnode_get_uint32(dnode, "./legacy-admin-group"));
+}
+
+void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode,
+                           bool show_defaults)
+{
+       enum affinity_mode affinity_mode = yang_dnode_get_enum(dnode, ".");
+
+       if (affinity_mode == AFFINITY_MODE_STANDARD)
+               vty_out(vty, "  affinity-mode standard\n");
+       else if (affinity_mode == AFFINITY_MODE_BOTH)
+               vty_out(vty, "  affinity-mode both\n");
+}
+
+void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
+                      bool show_defaults)
+{
+       if (!yang_dnode_exists(dnode, "./affinity"))
+               return;
+
+       vty_out(vty, "  affinity");
+       yang_dnode_iterate(ag_iter_cb, vty, dnode, "./affinity");
+       vty_out(vty, "\n");
+}
+
 int if_ip_address_install(struct interface *ifp, struct prefix *prefix,
                          const char *label, struct prefix *pp)
 {
@@ -4523,6 +4710,8 @@ DEFUN (no_ipv6_address,
 
 static int link_params_config_write(struct vty *vty, struct interface *ifp)
 {
+       const struct lyd_node *dnode;
+       char xpath[XPATH_MAXLEN];
        int i;
 
        if ((ifp == NULL) || !HAS_LINK_PARAMS(ifp))
@@ -4545,8 +4734,15 @@ static int link_params_config_write(struct vty *vty, struct interface *ifp)
                                vty_out(vty, "  unrsv-bw %d %g\n", i,
                                        iflp->unrsv_bw[i]);
        }
-       if (IS_PARAM_SET(iflp, LP_ADM_GRP))
-               vty_out(vty, "  admin-grp 0x%x\n", iflp->admin_grp);
+
+       snprintf(
+               xpath, sizeof(xpath),
+               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params",
+               ifp->name);
+       dnode = yang_dnode_get(running_config->dnode, xpath);
+       if (dnode)
+               nb_cli_show_dnode_cmds(vty, dnode, false);
+
        if (IS_PARAM_SET(iflp, LP_DELAY)) {
                vty_out(vty, "  delay %u", iflp->av_delay);
                if (IS_PARAM_SET(iflp, LP_MM_DELAY)) {
@@ -4568,6 +4764,7 @@ static int link_params_config_write(struct vty *vty, struct interface *ifp)
        if (IS_PARAM_SET(iflp, LP_RMT_AS))
                vty_out(vty, "  neighbor %pI4 as %u\n", &iflp->rmt_ip,
                        iflp->rmt_as);
+
        vty_out(vty, " exit-link-params\n");
        return 0;
 }
@@ -4727,6 +4924,9 @@ void zebra_if_init(void)
        install_element(LINK_PARAMS_NODE, &no_link_params_res_bw_cmd);
        install_element(LINK_PARAMS_NODE, &link_params_use_bw_cmd);
        install_element(LINK_PARAMS_NODE, &no_link_params_use_bw_cmd);
+       install_element(LINK_PARAMS_NODE, &link_params_affinity_cmd);
+       install_element(LINK_PARAMS_NODE, &link_params_affinity_mode_cmd);
+       install_element(LINK_PARAMS_NODE, &no_link_params_affinity_mode_cmd);
        install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
 
        /* setup EVPN MH elements */
index 0242438dc2284a5845ced1c892fc49f69764954a..c8ae906c916b98bf8f4c33c9b4019bab075f9c8e 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 
 /* Interface function header.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_INTERFACE_H
@@ -28,6 +13,7 @@
 #include "bitfield.h"
 
 #include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
 #include "zebra/zebra_nhg_private.h"
 #include "zebra/zebra_router.h"
 #include "zebra/rtadv.h"
@@ -302,6 +288,16 @@ extern void zebra_if_update_all_links(struct zebra_ns *zns);
  */
 extern int zebra_if_update_protodown_rc(struct interface *ifp, bool new_down,
                                        uint32_t new_protodown_rc);
+
+extern void cli_show_legacy_admin_group(struct vty *vty,
+                                       const struct lyd_node *dnode,
+                                       bool show_defaults);
+extern void cli_show_affinity_mode(struct vty *vty,
+                                  const struct lyd_node *dnode,
+                                  bool show_defaults);
+extern void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
+                             bool show_defaults);
+
 /**
  * Set protodown with single reason.
  */
index 6311400251e99d6b3a7d78017786922f93a332a5..8da1ae37c69f4b505589af171a28e3abe1d761e1 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Common ioctl functions.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index debe5ba1ca337cf55147fd574b9e4da7b4419fd0..8a97cbcd6a16e14deb1487aab72090c949d7c747 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Common ioctl functions.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_IOCTL_H
index 9884678c7a687b4198fa77b6af3d7e25aea08732..e56e0428060cabfde80486c4b2cf0d48541caf36 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* IP forward settings.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_IPFORWARD_H
index 4bd160ddbca6e741b0c3ff8e40a457c254d02fa8..08fbfede42aff314518df36463ec7a7b44883c81 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Fetch ipforward value by reading /proc filesystem.
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 0015018f945de88c6a505d35b481a865472ec264..bc9d12b5225ac8c7b09edd27bb29f0a1174f9cb1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* IP forward control by sysctl function.
  * Copyright (C) 1997, 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 19f549cc5b31efae21644a3c6fcc5a9103cb48c1..9b97bb93fa41e16f7b97c3b5426e5d6bff8989c4 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* ICMP Router Discovery Messages
  * Copyright (C) 1997, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 36852b65b6c27f8f21c8fad231adb151cb045a33..0c9b6f3d3965eb758b04be459abc2ca6ba38785d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright (C) 1997, 2000
@@ -8,22 +9,6 @@
  *
  * Thanks to Jens Laas at Swedish University of Agricultural Sciences
  * for reviewing and tests.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 65aad49a25c9bdea718dcb01eb96eb5228b2dbd8..ddcad92bdc7bb7c16107a4039fca8b0b6cb7234f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright (C) 2000  Robert Olsson.
  * Swedish University of Agricultural Sciences
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index c27d97ba71b572e0afdcbc854c00ce04253b81ae..4f4f3772dc806b9e45477664770fab61e0bf08bb 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright (C) 2000  Robert Olsson.
  * Swedish University of Agricultural Sciences
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 42afe61469d4f3ce96a7143d93bfed124a0fff13..a980b56b33845375c4a7ec74d598f643ac121ec1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Kernel communication using netlink interface.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -124,6 +109,9 @@ static const struct message nlmsg_str[] = {{RTM_NEWROUTE, "RTM_NEWROUTE"},
                                           {RTM_NEWTFILTER, "RTM_NEWTFILTER"},
                                           {RTM_DELTFILTER, "RTM_DELTFILTER"},
                                           {RTM_GETTFILTER, "RTM_GETTFILTER"},
+                                          {RTM_NEWVLAN, "RTM_NEWVLAN"},
+                                          {RTM_DELVLAN, "RTM_DELVLAN"},
+                                          {RTM_GETVLAN, "RTM_GETVLAN"},
                                           {0}};
 
 static const struct message rtproto_str[] = {
@@ -432,6 +420,10 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
        case RTM_NEWTFILTER:
        case RTM_DELTFILTER:
                return netlink_tfilter_change(h, ns_id, startup);
+       case RTM_NEWVLAN:
+               return netlink_vlan_change(h, ns_id, startup);
+       case RTM_DELVLAN:
+               return netlink_vlan_change(h, ns_id, startup);
 
        /* Messages handled in the dplane thread */
        case RTM_NEWADDR:
@@ -705,6 +697,12 @@ bool nl_attr_put32(struct nlmsghdr *n, unsigned int maxlen, int type,
        return nl_attr_put(n, maxlen, type, &data, sizeof(uint32_t));
 }
 
+bool nl_attr_put64(struct nlmsghdr *n, unsigned int maxlen, int type,
+                  uint64_t data)
+{
+       return nl_attr_put(n, maxlen, type, &data, sizeof(uint64_t));
+}
+
 struct rtattr *nl_attr_nest(struct nlmsghdr *n, unsigned int maxlen, int type)
 {
        struct rtattr *nest = NLMSG_TAIL(n);
@@ -1080,7 +1078,8 @@ static int netlink_parse_error(const struct nlsock *nl, struct nlmsghdr *h,
                                   nl_msg_type_to_str(msg_type), msg_type,
                                   err->msg.nlmsg_seq, err->msg.nlmsg_pid);
        } else {
-               if ((msg_type != RTM_GETNEXTHOP) || !startup)
+               if ((msg_type != RTM_GETNEXTHOP && msg_type != RTM_GETVLAN) ||
+                   !startup)
                        flog_err(EC_ZEBRA_UNEXPECTED_MESSAGE,
                                 "%s error: %s, type=%s(%u), seq=%u, pid=%u",
                                 nl->name, safe_strerror(-errnum),
@@ -1761,7 +1760,7 @@ void kernel_init(struct zebra_ns *zns)
 {
        uint32_t groups, dplane_groups, ext_groups;
 #if defined SOL_NETLINK
-       int one, ret;
+       int one, ret, grp;
 #endif
 
        /*
@@ -1772,6 +1771,11 @@ void kernel_init(struct zebra_ns *zns)
         * keeping track of all the different values would
         * lead to confusion, so we need to convert the
         * RTNLGRP_XXX to a bit position for ourself
+        *
+        *
+        * NOTE: If the bit is >= 32, you must use setsockopt(). Those
+        * groups are added further below after SOL_NETLINK is verified to
+        * exist.
         */
        groups = RTMGRP_LINK                   |
                        RTMGRP_IPV4_ROUTE              |
@@ -1851,6 +1855,18 @@ void kernel_init(struct zebra_ns *zns)
         * sure that we want to pull into our build system.
         */
 #if defined SOL_NETLINK
+
+       /*
+        * setsockopt multicast group subscriptions that don't fit in nl_groups
+        */
+       grp = RTNLGRP_BRVLAN;
+       ret = setsockopt(zns->netlink.sock, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
+                        &grp, sizeof(grp));
+
+       if (ret < 0)
+               zlog_notice(
+                       "Registration for RTNLGRP_BRVLAN Membership failed : %d %s",
+                       errno, safe_strerror(errno));
        /*
         * Let's tell the kernel that we want to receive extended
         * ACKS over our command socket(s)
index 08cd706a9f17b1015f30125878bee16421ecc418..446c860327028198957b17a425cfb1d378a07918 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Declarations and definitions for kernel interaction over netlink
  * Copyright (C) 2016 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_KERNEL_NETLINK_H
@@ -31,7 +16,7 @@ extern "C" {
        ((struct rtattr *)(((char *)(h)) + NLMSG_ALIGN(sizeof(struct nhmsg))))
 
 
-#define NL_RCV_PKT_BUF_SIZE     32768
+#define NL_RCV_PKT_BUF_SIZE     (34 * 1024)
 #define NL_PKT_BUF_SIZE         8192
 
 /*
@@ -48,6 +33,8 @@ extern bool nl_attr_put16(struct nlmsghdr *n, unsigned int maxlen, int type,
                          uint16_t data);
 extern bool nl_attr_put32(struct nlmsghdr *n, unsigned int maxlen, int type,
                          uint32_t data);
+extern bool nl_attr_put64(struct nlmsghdr *n, unsigned int maxlen, int type,
+                         uint64_t data);
 
 /*
  * nl_attr_nest - start an attribute nest.
index 684ccc3ed5481516338668a35c50a8ce44c84b01..915fd087fed2b79ed89f55aa0fc202c0c4a7afa1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Kernel communication using routing socket.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1226,7 +1211,8 @@ int rtm_write(int message, union sockunion *dest, union sockunion *mask,
        case BLACKHOLE_REJECT:
                msg.rtm.rtm_flags |= RTF_REJECT;
                break;
-       default:
+       case BLACKHOLE_NULL:
+       case BLACKHOLE_ADMINPROHIB:
                msg.rtm.rtm_flags |= RTF_BLACKHOLE;
                break;
        }
index 15079d796d624d16c484608d600bb562eb2e11e7..0d29abd92396a8096b7a2c4bb2d9eb69dc08dea1 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Exported kernel_socket functions, exported only for convenience of
  * sysctl methods.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __ZEBRA_KERNEL_SOCKET_H
index 2634a333eec2f233a1daabd9587abebf0dfc2e72..c77470a70109271812e9b9ea131f1ead7a37e842 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Label Manager for FRR
  *
@@ -5,20 +6,6 @@
  *                       Volta Networks Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8636c79219920aa1c7d570485d9a9e5d1f139f42..c0bd8e369fa7d28b2b850af59bfa93d9f020ea4a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Label Manager header
  *
@@ -5,20 +6,6 @@
  *                       Volta Networks Inc.
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _LABEL_MANAGER_H
index e38f9a85e3b1eb45a2668ffc78fe69fcbfb97206..c40a03551d501f39e7eefc794e2932f55a43b057 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra daemon main routine.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -33,6 +18,7 @@
 #include "sigevent.h"
 #include "vrf.h"
 #include "libfrr.h"
+#include "affinitymap.h"
 #include "routemap.h"
 #include "routing_nb.h"
 
@@ -259,6 +245,7 @@ struct frr_signal_t zebra_signals[] = {
        },
 };
 
+/* clang-format off */
 static const struct frr_yang_module_info *const zebra_yang_modules[] = {
        &frr_filter_info,
        &frr_interface_info,
@@ -266,8 +253,10 @@ static const struct frr_yang_module_info *const zebra_yang_modules[] = {
        &frr_zebra_info,
        &frr_vrf_info,
        &frr_routing_info,
+       &frr_affinity_map_info,
        &frr_zebra_route_map_info,
 };
+/* clang-format on */
 
 FRR_DAEMON_INFO(
        zebra, ZEBRA, .vty_port = ZEBRA_VTY_PORT, .flags = FRR_NO_ZCLIENT,
index 4c30544e5df472d4f33dd9767024ba98a276ac39..7352dfb2eec5f456f3bd2b3afcc7332a436d075d 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * netconf_netlink.c - netconf interaction with the kernel using
  * netlink
  * Copyright (C) 2021  Nvidia, Inc.
  *                     Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
index 1b3450bcb5f774a80ca89571cec54955eeacd426..3abc72e2fbbc2b4870e1ba37750ae25142f7d93e 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * netconf_netlink.h - netconf interaction with the kernel using
  * netlink
  * Copyright (C) 2021  Nvidia, Inc.
  *                     Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __NETCONF_NETLINK_H__
 #define __NETCONF_NETLINK_H__
index 4a8fe938edafe587f675605e33461a181615d541..8cdc419cce4a8b4d5953f464791f5203c7306b08 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Redistribution Handler
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -118,13 +103,15 @@ static void zebra_redistribute(struct zserv *client, int type,
                RNODE_FOREACH_RE (rn, newre) {
                        if (IS_ZEBRA_DEBUG_RIB)
                                zlog_debug(
-                                       "%s: client %s %pRN(%u:%u) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d",
+                                       "%s: client %s %pRN(%u:%u) checking: selected=%d, type=%s, instance=%u, distance=%d, metric=%d zebra_check_addr=%d",
                                        __func__,
                                        zebra_route_string(client->proto), rn,
                                        vrf_id, newre->instance,
                                        !!CHECK_FLAG(newre->flags,
                                                     ZEBRA_FLAG_SELECTED),
-                                       newre->type, newre->distance,
+                                       zebra_route_string(newre->type),
+                                       newre->instance,
+                                       newre->distance,
                                        newre->metric,
                                        zebra_check_addr(&rn->p));
 
index ac257d6389673c49e5f7dacd86dc21c16e5103b8..4347454eb7c676e3e6681a74452ac8a43c2058cb 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Redistribution Handler
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_REDISTRIBUTE_H
index 166500fa5cc7d829b03432cd6e94503db1567f2d..70968d3900c8e5c5cc9a4e7534682e02b3b4a375 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Routing Information Base header
  * Copyright (C) 1997 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RIB_H
@@ -407,12 +392,9 @@ extern void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
 extern struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
                                     const union g_addr *addr,
                                     struct route_node **rn_out);
-extern struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
-                                                   struct in_addr addr,
-                                                   struct route_node **rn_out);
-extern struct route_entry *rib_match_ipv6_multicast(vrf_id_t vrf_id,
-                                                   struct in6_addr addr,
-                                                   struct route_node **rn_out);
+extern struct route_entry *rib_match_multicast(afi_t afi, vrf_id_t vrf_id,
+                                              union g_addr *gaddr,
+                                              struct route_node **rn_out);
 
 extern struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p,
                                           vrf_id_t vrf_id);
@@ -625,6 +607,9 @@ extern pid_t pid;
 
 extern bool v6_rr_semantics;
 
+/* Name of hook calls */
+#define ZEBRA_ON_RIB_PROCESS_HOOK_CALL "on_rib_process_dplane_results"
+
 #ifdef __cplusplus
 }
 #endif
index 9f56cf0e6af93824e75da2475a39d6f47c11b4a9..e8cb33c35c03fc4e0402d3bab8f9e88ce259424a 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Router ID for zebra daemon.
  *
  * Copyright (C) 2004 James R. Leu
  *
  * This file is part of Quagga routing suite.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -113,9 +100,13 @@ int router_id_get(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
                if (addr)
                        memcpy(&p->u.prefix6, addr, sizeof(struct in6_addr));
                return 0;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                return -1;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
@@ -133,7 +124,9 @@ static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
        case AFI_IP6:
                zvrf->rid6_user_assigned.u.prefix6 = p->u.prefix6;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                return -1;
        }
 
index 4a35f6605b7a5a261792da834e25d5c642058a28..45860d8b7b805e59f8d3a998086a5ebaf918da1b 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Router ID for zebra daemon.
  *
  * Copyright (C) 2004 James R. Leu
  *
  * This file is part of Quagga routing suite.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ROUTER_ID_H_
index 6f4dd48a54cd0d85ee45dbc3c7ffebc48507d191..2e3495a03731e3fdc2e2c08b7ac90b48822d9b76 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * kernel routing table update prototype.
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RT_H
@@ -103,7 +88,9 @@ extern void kernel_init(struct zebra_ns *zns);
 extern void kernel_terminate(struct zebra_ns *zns, bool complete);
 extern void macfdb_read(struct zebra_ns *zns);
 extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
-                                  struct interface *br_if);
+                                  struct interface *br_if, vlanid_t vid);
+extern void macfdb_read_mcast_entry_for_vni(struct zebra_ns *zns,
+                                           struct interface *ifp, vni_t vni);
 extern void macfdb_read_specific_mac(struct zebra_ns *zns,
                                     struct interface *br_if,
                                     const struct ethaddr *mac, vlanid_t vid);
@@ -127,6 +114,7 @@ extern void kernel_update_multi(struct dplane_ctx_list_head *ctx_list);
  * Called by the dplane pthread to read incoming OS messages and dispatch them.
  */
 int kernel_dplane_read(struct zebra_dplane_info *info);
+extern void vlan_read(struct zebra_ns *zns);
 
 #ifdef __cplusplus
 }
index 79d79d74be65d425fa72950766308cf76c4cc414..900c6520d30155121a25775c8ece7049c593547f 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Kernel routing table updates using netlink over GNU/Linux system.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -153,6 +138,22 @@ static bool is_proto_nhg(uint32_t id, int type)
        return false;
 }
 
+/* Is vni mcast group */
+static bool is_mac_vni_mcast_group(struct ethaddr *mac, vni_t vni,
+                                  struct in_addr grp_addr)
+{
+       if (!vni)
+               return false;
+
+       if (!is_zero_mac(mac))
+               return false;
+
+       if (!IN_MULTICAST(ntohl(grp_addr.s_addr)))
+               return false;
+
+       return true;
+}
+
 /*
  * The ipv4_ll data structure is used for all 5549
  * additions to the kernel.  Let's figure out the
@@ -1309,6 +1310,7 @@ static bool _netlink_route_add_gateway_info(uint8_t route_family,
 }
 
 static int build_label_stack(struct mpls_label_stack *nh_label,
+                            enum lsp_types_t nh_label_type,
                             mpls_lse_t *out_lse, char *label_buf,
                             size_t label_buf_size)
 {
@@ -1316,7 +1318,8 @@ static int build_label_stack(struct mpls_label_stack *nh_label,
        int num_labels = 0;
 
        for (int i = 0; nh_label && i < nh_label->num_labels; i++) {
-               if (nh_label->label[i] == MPLS_LABEL_IMPLICIT_NULL)
+               if (nh_label_type != ZEBRA_LSP_EVPN &&
+                   nh_label->label[i] == MPLS_LABEL_IMPLICIT_NULL)
                        continue;
 
                if (IS_ZEBRA_DEBUG_KERNEL) {
@@ -1330,15 +1333,58 @@ static int build_label_stack(struct mpls_label_stack *nh_label,
                        }
                }
 
-               out_lse[num_labels] =
-                       mpls_lse_encode(nh_label->label[i], 0, 0, 0);
+               if (nh_label_type == ZEBRA_LSP_EVPN)
+                       out_lse[num_labels] = label2vni(&nh_label->label[i]);
+               else
+                       out_lse[num_labels] =
+                               mpls_lse_encode(nh_label->label[i], 0, 0, 0);
                num_labels++;
        }
 
        return num_labels;
 }
 
-static bool _netlink_route_encode_label_info(struct mpls_label_stack *nh_label,
+static bool _netlink_nexthop_encode_dvni_label(const struct nexthop *nexthop,
+                                              struct nlmsghdr *nlmsg,
+                                              mpls_lse_t *out_lse,
+                                              size_t buflen, char *label_buf)
+{
+       struct in_addr ipv4;
+
+       if (!nl_attr_put64(nlmsg, buflen, LWTUNNEL_IP_ID,
+                          htonll((uint64_t)out_lse[0])))
+               return false;
+
+       if (nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
+               if (!nl_attr_put(nlmsg, buflen, LWTUNNEL_IP_DST,
+                                &nexthop->gate.ipv4, 4))
+                       return false;
+
+       } else if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
+               if (IS_MAPPED_IPV6(&nexthop->gate.ipv6)) {
+                       ipv4_mapped_ipv6_to_ipv4(&nexthop->gate.ipv6, &ipv4);
+                       if (!nl_attr_put(nlmsg, buflen, LWTUNNEL_IP_DST, &ipv4,
+                                        4))
+                               return false;
+
+               } else {
+                       if (!nl_attr_put(nlmsg, buflen, LWTUNNEL_IP_DST,
+                                        &nexthop->gate.ipv6, 16))
+                               return false;
+               }
+       } else {
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug(
+                               "%s: nexthop %pNHv %s must NEXTHOP_TYPE_IPV*_IFINDEX to be vxlan encapped",
+                               __func__, nexthop, label_buf);
+
+               return false;
+       }
+
+       return true;
+}
+
+static bool _netlink_route_encode_label_info(const struct nexthop *nexthop,
                                             struct nlmsghdr *nlmsg,
                                             size_t buflen, struct rtmsg *rtmsg,
                                             char *label_buf,
@@ -1346,6 +1392,12 @@ static bool _netlink_route_encode_label_info(struct mpls_label_stack *nh_label,
 {
        mpls_lse_t out_lse[MPLS_MAX_LABELS];
        int num_labels;
+       struct rtattr *nest;
+       struct mpls_label_stack *nh_label;
+       enum lsp_types_t nh_label_type;
+
+       nh_label = nexthop->nh_label;
+       nh_label_type = nexthop->nh_label_type;
 
        /*
         * label_buf is *only* currently used within debugging.
@@ -1355,10 +1407,26 @@ static bool _netlink_route_encode_label_info(struct mpls_label_stack *nh_label,
         */
        label_buf[0] = '\0';
 
-       num_labels =
-               build_label_stack(nh_label, out_lse, label_buf, label_buf_size);
+       num_labels = build_label_stack(nh_label, nh_label_type, out_lse,
+                                      label_buf, label_buf_size);
+
+       if (num_labels && nh_label_type == ZEBRA_LSP_EVPN) {
+               if (!nl_attr_put16(nlmsg, buflen, RTA_ENCAP_TYPE,
+                                  LWTUNNEL_ENCAP_IP))
+                       return false;
+
+               nest = nl_attr_nest(nlmsg, buflen, RTA_ENCAP);
+               if (!nest)
+                       return false;
+
+               if (_netlink_nexthop_encode_dvni_label(nexthop, nlmsg, out_lse,
+                                                      buflen,
+                                                      label_buf) == false)
+                       return false;
+
+               nl_attr_nest_end(nlmsg, nest);
 
-       if (num_labels) {
+       } else if (num_labels) {
                /* Set the BoS bit */
                out_lse[num_labels - 1] |= htonl(1 << MPLS_LS_S_SHIFT);
 
@@ -1367,8 +1435,6 @@ static bool _netlink_route_encode_label_info(struct mpls_label_stack *nh_label,
                                         num_labels * sizeof(mpls_lse_t)))
                                return false;
                } else {
-                       struct rtattr *nest;
-
                        if (!nl_attr_put16(nlmsg, buflen, RTA_ENCAP_TYPE,
                                           LWTUNNEL_ENCAP_MPLS))
                                return false;
@@ -1482,9 +1548,8 @@ static bool _netlink_route_build_singlepath(const struct prefix *p,
 
        vrf = vrf_lookup_by_id(nexthop->vrf_id);
 
-       if (!_netlink_route_encode_label_info(nexthop->nh_label, nlmsg,
-                                             req_size, rtmsg, label_buf,
-                                             sizeof(label_buf)))
+       if (!_netlink_route_encode_label_info(nexthop, nlmsg, req_size, rtmsg,
+                                             label_buf, sizeof(label_buf)))
                return false;
 
        if (nexthop->nh_srv6) {
@@ -1569,7 +1634,16 @@ static bool _netlink_route_build_singlepath(const struct prefix *p,
                                                   ctx->table))
                                        return false;
                                break;
-                       default:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_DX6:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_B6:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_B6_ENCAP:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_BM:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_S:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_AS:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_AM:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_BPF:
+                       case ZEBRA_SEG6_LOCAL_ACTION_UNSPEC:
                                zlog_err("%s: unsupport seg6local behaviour action=%u",
                                         __func__,
                                         nexthop->nh_srv6->seg6local_action);
@@ -1756,9 +1830,8 @@ static bool _netlink_route_build_multipath(
 
        vrf = vrf_lookup_by_id(nexthop->vrf_id);
 
-       if (!_netlink_route_encode_label_info(nexthop->nh_label, nlmsg,
-                                             req_size, rtmsg, label_buf,
-                                             sizeof(label_buf)))
+       if (!_netlink_route_encode_label_info(nexthop, nlmsg, req_size, rtmsg,
+                                             label_buf, sizeof(label_buf)))
                return false;
 
        if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK))
@@ -2151,7 +2224,8 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
                        case BLACKHOLE_REJECT:
                                req->r.rtm_type = RTN_UNREACHABLE;
                                break;
-                       default:
+                       case BLACKHOLE_UNSPEC:
+                       case BLACKHOLE_NULL:
                                req->r.rtm_type = RTN_BLACKHOLE;
                                break;
                        }
@@ -2639,11 +2713,28 @@ ssize_t netlink_nexthop_msg_encode(uint16_t cmd,
                        if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ONLINK))
                                req->nhm.nh_flags |= RTNH_F_ONLINK;
 
-                       num_labels =
-                               build_label_stack(nh->nh_label, out_lse,
-                                                 label_buf, sizeof(label_buf));
+                       num_labels = build_label_stack(
+                               nh->nh_label, nh->nh_label_type, out_lse,
+                               label_buf, sizeof(label_buf));
+
+                       if (num_labels && nh->nh_label_type == ZEBRA_LSP_EVPN) {
+                               if (!nl_attr_put16(&req->n, buflen,
+                                                  NHA_ENCAP_TYPE,
+                                                  LWTUNNEL_ENCAP_IP))
+                                       return 0;
+
+                               nest = nl_attr_nest(&req->n, buflen, NHA_ENCAP);
+                               if (!nest)
+                                       return 0;
+
+                               if (_netlink_nexthop_encode_dvni_label(
+                                           nh, &req->n, out_lse, buflen,
+                                           label_buf) == false)
+                                       return 0;
+
+                               nl_attr_nest_end(&req->n, nest);
 
-                       if (num_labels) {
+                       } else if (num_labels) {
                                /* Set the BoS bit */
                                out_lse[num_labels - 1] |=
                                        htonl(1 << MPLS_LS_S_SHIFT);
@@ -3390,17 +3481,32 @@ static ssize_t netlink_neigh_update_msg_encode(
 
        if (op == DPLANE_OP_MAC_INSTALL || op == DPLANE_OP_MAC_DELETE) {
                vlanid_t vid = dplane_ctx_mac_get_vlan(ctx);
+               vni_t vni = dplane_ctx_mac_get_vni(ctx);
 
                if (vid > 0) {
                        if (!nl_attr_put16(&req->n, datalen, NDA_VLAN, vid))
                                return 0;
                }
 
+               if (vni > 0) {
+                       if (!nl_attr_put32(&req->n, datalen, NDA_SRC_VNI, vni))
+                               return 0;
+               }
+
                if (!nl_attr_put32(&req->n, datalen, NDA_MASTER,
                                   dplane_ctx_mac_get_br_ifindex(ctx)))
                        return 0;
        }
 
+       if (op == DPLANE_OP_VTEP_ADD || op == DPLANE_OP_VTEP_DELETE) {
+               vni_t vni = dplane_ctx_neigh_get_vni(ctx);
+
+               if (vni > 0) {
+                       if (!nl_attr_put32(&req->n, datalen, NDA_SRC_VNI, vni))
+                               return 0;
+               }
+       }
+
        return NLMSG_ALIGN(req->n.nlmsg_len);
 }
 
@@ -3447,7 +3553,9 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
        bool sticky;
        bool local_inactive = false;
        bool dp_static = false;
+       vni_t vni = 0;
        uint32_t nhg_id = 0;
+       bool vni_mcast_grp = false;
 
        ndm = NLMSG_DATA(h);
 
@@ -3493,7 +3601,8 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                       IPV4_MAX_BYTELEN);
                snprintfrr(dst_buf, sizeof(dst_buf), " dst %pI4",
                           &vtep_ip);
-       }
+       } else
+               memset(&vtep_ip, 0, sizeof(vtep_ip));
 
        if (tb[NDA_NH_ID])
                nhg_id = *(uint32_t *)RTA_DATA(tb[NDA_NH_ID]);
@@ -3518,12 +3627,16 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                }
        }
 
+       if (tb[NDA_SRC_VNI])
+               vni = *(vni_t *)RTA_DATA(tb[NDA_SRC_VNI]);
+
        if (IS_ZEBRA_DEBUG_KERNEL)
-               zlog_debug("Rx %s AF_BRIDGE IF %u%s st 0x%x fl 0x%x MAC %pEA%s nhg %d",
-                          nl_msg_type_to_str(h->nlmsg_type),
-                          ndm->ndm_ifindex, vid_present ? vid_buf : "",
-                          ndm->ndm_state, ndm->ndm_flags, &mac,
-                          dst_present ? dst_buf : "", nhg_id);
+               zlog_debug(
+                       "Rx %s AF_BRIDGE IF %u%s st 0x%x fl 0x%x MAC %pEA%s nhg %d vni %d",
+                       nl_msg_type_to_str(h->nlmsg_type), ndm->ndm_ifindex,
+                       vid_present ? vid_buf : "", ndm->ndm_state,
+                       ndm->ndm_flags, &mac, dst_present ? dst_buf : "",
+                       nhg_id, vni);
 
        /* The interface should exist. */
        ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id),
@@ -3546,6 +3659,14 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                return 0;
        }
 
+       /* For per vni device, vni comes from device itself */
+       if (IS_ZEBRA_IF_VXLAN(ifp) && IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               struct zebra_vxlan_vni *vnip;
+
+               vnip = zebra_vxlan_if_vni_find(zif, 0);
+               vni = vnip->vni;
+       }
+
        sticky = !!(ndm->ndm_flags & NTF_STICKY);
 
        if (filter_vlan && vid != filter_vlan) {
@@ -3555,6 +3676,11 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                return 0;
        }
 
+       /*
+        * Check if this is a mcast group update (svd case)
+        */
+       vni_mcast_grp = is_mac_vni_mcast_group(&mac, vni, vtep_ip);
+
        /* If add or update, do accordingly if learnt on a "local" interface; if
         * the notification is over VxLAN, this has to be related to
         * multi-homing,
@@ -3562,17 +3688,25 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
         */
        if (h->nlmsg_type == RTM_NEWNEIGH) {
                 /* Drop "permanent" entries. */
-                if (ndm->ndm_state & NUD_PERMANENT) {
+               if (!vni_mcast_grp && (ndm->ndm_state & NUD_PERMANENT)) {
                        if (IS_ZEBRA_DEBUG_KERNEL)
                                zlog_debug(
                                        "        Dropping entry because of NUD_PERMANENT");
                        return 0;
                }
 
-               if (IS_ZEBRA_IF_VXLAN(ifp))
+               if (IS_ZEBRA_IF_VXLAN(ifp)) {
+                       if (!dst_present)
+                               return 0;
+
+                       if (vni_mcast_grp)
+                               return zebra_vxlan_if_vni_mcast_group_add_update(
+                                       ifp, vni, &vtep_ip);
+
                        return zebra_vxlan_dp_network_mac_add(
-                               ifp, br_if, &mac, vid, nhg_id, sticky,
+                               ifp, br_if, &mac, vid, vni, nhg_id, sticky,
                                !!(ndm->ndm_flags & NTF_EXT_LEARNED));
+               }
 
                return zebra_vxlan_local_mac_add_update(ifp, br_if, &mac, vid,
                                sticky, local_inactive, dp_static);
@@ -3592,15 +3726,18 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
                return 0;
 
        if (dst_present) {
-               u_char zero_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+               if (vni_mcast_grp)
+                       return zebra_vxlan_if_vni_mcast_group_del(ifp, vni,
+                                                                 &vtep_ip);
+
+               if (is_zero_mac(&mac) && vni)
+                       return zebra_vxlan_check_readd_vtep(ifp, vni, vtep_ip);
 
-               if (!memcmp(zero_mac, mac.octet, ETH_ALEN))
-                       return zebra_vxlan_check_readd_vtep(ifp, vtep_ip);
                return 0;
        }
 
        if (IS_ZEBRA_IF_VXLAN(ifp))
-               return zebra_vxlan_dp_network_mac_del(ifp, br_if, &mac, vid);
+               return 0;
 
        return zebra_vxlan_local_mac_del(ifp, br_if, &mac, vid);
 }
@@ -3677,11 +3814,9 @@ int netlink_macfdb_read(struct zebra_ns *zns)
  * specific bridge and matching specific access VLAN (if VLAN-aware bridge).
  */
 int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
-                                  struct interface *br_if)
+                                  struct interface *br_if, vlanid_t vid)
 {
        struct zebra_if *br_zif;
-       struct zebra_if *zif;
-       struct zebra_l2info_vxlan *vxl;
        struct zebra_dplane_info dp_info;
        int ret = 0;
 
@@ -3689,10 +3824,8 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
 
        /* Save VLAN we're filtering on, if needed. */
        br_zif = (struct zebra_if *)br_if->info;
-       zif = (struct zebra_if *)ifp->info;
-       vxl = &zif->l2info.vxl;
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif))
-               filter_vlan = vxl->access_vlan;
+               filter_vlan = vid;
 
        /* Get bridge FDB table for specific bridge - we do the VLAN filtering.
         */
@@ -3710,40 +3843,45 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
 
 
 /* Request for MAC FDB for a specific MAC address in VLAN from the kernel */
-static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns,
-                                                 int family, int type,
-                                                 struct interface *br_if,
-                                                 const struct ethaddr *mac,
-                                                 vlanid_t vid)
+static int netlink_request_specific_mac(struct zebra_ns *zns, int family,
+                                       int type, struct interface *ifp,
+                                       const struct ethaddr *mac, vlanid_t vid,
+                                       vni_t vni, uint8_t flags)
 {
        struct {
                struct nlmsghdr n;
                struct ndmsg ndm;
                char buf[256];
        } req;
-       struct zebra_if *br_zif;
+       struct zebra_if *zif;
 
        memset(&req, 0, sizeof(req));
        req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg));
        req.n.nlmsg_type = type;        /* RTM_GETNEIGH */
        req.n.nlmsg_flags = NLM_F_REQUEST;
        req.ndm.ndm_family = family;    /* AF_BRIDGE */
+       req.ndm.ndm_flags = flags;
        /* req.ndm.ndm_state = NUD_REACHABLE; */
 
        nl_attr_put(&req.n, sizeof(req), NDA_LLADDR, mac, 6);
 
-       br_zif = (struct zebra_if *)br_if->info;
-       if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0)
-               nl_attr_put16(&req.n, sizeof(req), NDA_VLAN, vid);
-
-       nl_attr_put32(&req.n, sizeof(req), NDA_MASTER, br_if->ifindex);
+       zif = (struct zebra_if *)ifp->info;
+       /* Is this a read on a VXLAN interface? */
+       if (IS_ZEBRA_IF_VXLAN(ifp)) {
+               nl_attr_put32(&req.n, sizeof(req), NDA_VNI, vni);
+               /* TBD: Why is ifindex not filled in the non-vxlan case? */
+               req.ndm.ndm_ifindex = ifp->ifindex;
+       } else {
+               if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) && vid > 0)
+                       nl_attr_put16(&req.n, sizeof(req), NDA_VLAN, vid);
+               nl_attr_put32(&req.n, sizeof(req), NDA_MASTER, ifp->ifindex);
+       }
 
        if (IS_ZEBRA_DEBUG_KERNEL)
-               zlog_debug(
-                       "%s: Tx family %s IF %s(%u) vrf %s(%u) MAC %pEA vid %u",
-                       __func__, nl_family_to_str(req.ndm.ndm_family),
-                       br_if->name, br_if->ifindex, br_if->vrf->name,
-                       br_if->vrf->vrf_id, mac, vid);
+               zlog_debug("Tx %s %s IF %s(%u) MAC %pEA vid %u vni %u",
+                          nl_msg_type_to_str(type),
+                          nl_family_to_str(req.ndm.ndm_family), ifp->name,
+                          ifp->ifindex, mac, vid, vni);
 
        return netlink_request(&zns->netlink_cmd, &req);
 }
@@ -3759,9 +3897,34 @@ int netlink_macfdb_read_specific_mac(struct zebra_ns *zns,
 
        /* Get bridge FDB table for specific bridge - we do the VLAN filtering.
         */
-       ret = netlink_request_specific_mac_in_bridge(zns, AF_BRIDGE,
-                                                    RTM_GETNEIGH,
-                                                    br_if, mac, vid);
+       ret = netlink_request_specific_mac(zns, AF_BRIDGE, RTM_GETNEIGH, br_if,
+                                          mac, vid, 0, 0);
+       if (ret < 0)
+               return ret;
+
+       ret = netlink_parse_info(netlink_macfdb_table, &zns->netlink_cmd,
+                                &dp_info, 1, 0);
+
+       return ret;
+}
+
+int netlink_macfdb_read_mcast_for_vni(struct zebra_ns *zns,
+                                     struct interface *ifp, vni_t vni)
+{
+       struct zebra_if *zif;
+       struct ethaddr mac = {.octet = {0}};
+       struct zebra_dplane_info dp_info;
+       int ret = 0;
+
+       zif = ifp->info;
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif))
+               return 0;
+
+       zebra_dplane_info_from_zns(&dp_info, zns, true /*is_cmd*/);
+
+       /* Get specific FDB entry for BUM handling, if any */
+       ret = netlink_request_specific_mac(zns, AF_BRIDGE, RTM_GETNEIGH, ifp,
+                                          &mac, 0, vni, NTF_SELF);
        if (ret < 0)
                return ret;
 
@@ -4448,7 +4611,7 @@ static int netlink_neigh_table_update_ctx(const struct zebra_dplane_ctx *ctx,
 static ssize_t netlink_neigh_msg_encoder(struct zebra_dplane_ctx *ctx,
                                         void *buf, size_t buflen)
 {
-       ssize_t ret;
+       ssize_t ret = 0;
 
        switch (dplane_ctx_get_op(ctx)) {
        case DPLANE_OP_NEIGH_INSTALL:
@@ -4472,7 +4635,51 @@ static ssize_t netlink_neigh_msg_encoder(struct zebra_dplane_ctx *ctx,
        case DPLANE_OP_NEIGH_TABLE_UPDATE:
                ret = netlink_neigh_table_update_ctx(ctx, buf, buflen);
                break;
-       default:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
+       case DPLANE_OP_NONE:
                ret = -1;
        }
 
index 8506367ae4b502202c8775485d24fa715292cf52..3ca59ce676f381e94f30248bbf4d8ad0322b8eda 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Header file exported by rt_netlink.c to zebra.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RT_NETLINK_H
@@ -92,7 +77,10 @@ extern int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id);
 extern int netlink_macfdb_read(struct zebra_ns *zns);
 extern int netlink_macfdb_read_for_bridge(struct zebra_ns *zns,
                                          struct interface *ifp,
-                                         struct interface *br_if);
+                                         struct interface *br_if,
+                                         vlanid_t vid);
+extern int netlink_macfdb_read_mcast_for_vni(struct zebra_ns *zns,
+                                            struct interface *ifp, vni_t vni);
 extern int netlink_neigh_read(struct zebra_ns *zns);
 extern int netlink_neigh_read_for_vlan(struct zebra_ns *zns,
                                       struct interface *vlan_if);
index 1f3f66a68e981751838c9ddea865656912cfd7d5..f9888b12d4e8ef5b78bbda1e271abc461c6d87e4 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Kernel routing table updates by routing socket.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2b9246515d32894d692ee3f278872368363770a5..1e0769fb6d742ce6964d070b584183b04054299c 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Router advertisement
  * Copyright (C) 2016 Cumulus Networks
  * Copyright (C) 2005 6WIND <jean-mickael.guerin@6wind.com>
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2304af19d1da76671067c849408502035987bcda..2338efe0bd0983841a54eb3dbf7417cb10be3a98 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Router advertisement
  * Copyright (C) 2005 6WIND <jean-mickael.guerin@6wind.com>
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RTADV_H
index 8990f66ef8d8022daeaa031e00dba99ce7ffa83b..39daed28352a0c76df30bc98e1bd9f0da39bd0bf 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Kernel routing table readup by netlink
  * Copyright (C) 1998 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -28,6 +13,7 @@
 #include "zebra/zebra_pbr.h"
 #include "zebra/zebra_tc.h"
 #include "zebra/rt_netlink.h"
+#include "zebra/if_netlink.h"
 #include "zebra/rule_netlink.h"
 #include "zebra/tc_netlink.h"
 
@@ -42,9 +28,15 @@ void macfdb_read(struct zebra_ns *zns)
 }
 
 void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
-                           struct interface *br_if)
+                           struct interface *br_if, vlanid_t vid)
 {
-       netlink_macfdb_read_for_bridge(zns, ifp, br_if);
+       netlink_macfdb_read_for_bridge(zns, ifp, br_if, vid);
+}
+
+void macfdb_read_mcast_entry_for_vni(struct zebra_ns *zns,
+                                    struct interface *ifp, vni_t vni)
+{
+       netlink_macfdb_read_mcast_for_vni(zns, ifp, vni);
 }
 
 void macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if,
@@ -78,4 +70,9 @@ void kernel_read_tc_qdisc(struct zebra_ns *zns)
        netlink_qdisc_read(zns);
 }
 
+void vlan_read(struct zebra_ns *zns)
+{
+       netlink_vlan_read(zns);
+}
+
 #endif /* GNU_LINUX */
index 35dde0e686601766fd8dbbf7dcf91d9cccb9ff59..ef1e21b4f7d072876491f09a686f61b620905122 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Kernel routing table read by sysctl function.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -84,7 +69,12 @@ void macfdb_read(struct zebra_ns *zns)
 }
 
 void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
-                           struct interface *br_if)
+                           struct interface *br_if, vlanid_t vid)
+{
+}
+
+void macfdb_read_mcast_entry_for_vni(struct zebra_ns *zns,
+                                    struct interface *ifp, vni_t vni)
 {
 }
 
@@ -113,4 +103,8 @@ void kernel_read_tc_qdisc(struct zebra_ns *zns)
 {
 }
 
+void vlan_read(struct zebra_ns *zns)
+{
+}
+
 #endif /* !defined(GNU_LINUX) */
index 135f06542836d63edd764c5955528991a12514e2..c7832992ea06e50f507678e5561776e5ad11d42b 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Policy Based Routing (PBR) interaction with the kernel using
  * netlink.
  * Copyright (C) 2018  Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index cf4d978e78e1ead6c7bc7b05509cec515fa9f652..8ffca49b6f0dbb32564d650d2a6ca5636a4cb452 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Policy Based Routing (PBR) interaction with the kernel using
  * netlink - public definitions and function declarations.
  * Copyright (C) 2018 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_RULE_NETLINK_H
index e629017bdf88ae79599072e71659d0e825870a35..d013749bc34c21f3a5095d1ac99eb72acb4cec55 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Policy Based Routing (PBR) interaction with the kernel using
  * netlink.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
index e54186bc182be07e28795a5965aeb4a95b44d3cb..0ccf736f24d50384db5f54ea55ba7f65d80e2744 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Sample plugin for the FRR zebra dataplane.
  *
  * Copyright (c) 2019 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 5c4a87b93427a6cb6f5731c699d43720b244cc47..1060e38785326aa911a1815fcfa4d5a6917f5134 100644 (file)
@@ -62,10 +62,12 @@ zebra_zebra_SOURCES = \
        zebra/tc_netlink.c \
        zebra/tc_socket.c \
        zebra/zapi_msg.c \
+       zebra/zebra_affinitymap.c \
        zebra/zebra_dplane.c \
        zebra/zebra_errors.c \
        zebra/zebra_gr.c \
        zebra/zebra_l2.c \
+       zebra/zebra_l2_bridge_if.c \
        zebra/zebra_evpn.c \
        zebra/zebra_evpn_mac.c \
        zebra/zebra_evpn_neigh.c \
@@ -105,6 +107,7 @@ zebra_zebra_SOURCES = \
        zebra/zebra_vrf.c \
        zebra/zebra_vty.c \
        zebra/zebra_vxlan.c \
+       zebra/zebra_vxlan_if.c \
        zebra/zebra_evpn_mh.c \
        zebra/zebra_neigh.c \
        zebra/zserv.c \
@@ -145,6 +148,7 @@ noinst_HEADERS += \
        zebra/table_manager.h \
        zebra/tc_netlink.h \
        zebra/zapi_msg.h \
+       zebra/zebra_affinitymap.h \
        zebra/zebra_dplane.h \
        zebra/zebra_errors.h \
        zebra/zebra_evpn.h \
@@ -183,6 +187,8 @@ noinst_HEADERS += \
        zebra/zebra_vxlan_private.h \
        zebra/zebra_evpn_mh.h \
        zebra/zebra_neigh.h \
+       zebra/zebra_l2_bridge_if.h \
+       zebra/zebra_vxlan_if.h \
        zebra/zserv.h \
        zebra/dpdk/zebra_dplane_dpdk.h \
        zebra/dpdk/zebra_dplane_dpdk_private.h \
index a3daca6c595a15ee300f73ec94dc2a8b106c803e..77ec42e64bd6618d9483ae41b2b173a417f88693 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra table Manager for routing table identifier management
  * Copyright (C) 2018 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index fa1366842e45801ce9886322a114beab20ff74d1..deed4fa30b5c997c0f53c50f691ba17d520f6cd7 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra table Manager for routing table identifier management
  * Copyright (C) 2018 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _TABLE_MANAGER_H
index 1fa80e846a988a5aef6734e69b44ff5a4231b0c4..679dc80a583e2a76cbcccc2e87f5d05bf4329c3f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Traffic Control (TC) interaction with the kernel using netlink.
  *
  * Copyright (C) 2022 Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -745,7 +732,8 @@ int netlink_qdisc_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        case TC_QDISC_NOQUEUE:
                /* "noqueue" is the default qdisc */
                break;
-       default:
+       case TC_QDISC_HTB:
+       case TC_QDISC_UNSPEC:
                break;
        }
 
index 166bd917c6254b6d70011b888ea9db64be7c4f21..5e95e6c1d80d41cad6ea9cdfe97b1c38518e26a0 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Traffic Control (TC) interaction with the kernel using netlink.
  *
  * Copyright (C) 2022 Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_TC_NETLINK_H
index 17373c7af798927280fd9bbd6a3e14d2a5e5c80a..1bd69ba356e554ad26655cff66920863e38ae74b 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Traffic Control (TC) interaction with the kernel using socket.
  *
  * Copyright (C) 2022 Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a2233a6667a0e8c6fe58482904fe929263956805..59152df2f151f2b28baa330eee182c943fec72de 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra API message creation & consumption.
  * Portions:
  *   Copyright (C) 1997-1999  Kunihiro Ishiguro
  *   Copyright (C) 2015-2018  Cumulus Networks, Inc.
  *   et al.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -143,7 +130,7 @@ static int zserv_encode_nexthop(struct stream *s, struct nexthop *nexthop)
        case NEXTHOP_TYPE_IFINDEX:
                stream_putl(s, nexthop->ifindex);
                break;
-       default:
+       case NEXTHOP_TYPE_BLACKHOLE:
                /* do nothing */
                break;
        }
@@ -576,7 +563,9 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
                else
                        client->redist_v6_del_cnt++;
                break;
-       default:
+       case AFI_L2VPN:
+       case AFI_MAX:
+       case AFI_UNSPEC:
                break;
        }
 
@@ -1777,13 +1766,19 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
                        nexthop->srte_color = api_nh->srte_color;
                }
 
-               /* MPLS labels for BGP-LU or Segment Routing */
+               /* Labels for MPLS BGP-LU or Segment Routing or EVPN */
                if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL)
                    && api_nh->type != NEXTHOP_TYPE_IFINDEX
                    && api_nh->type != NEXTHOP_TYPE_BLACKHOLE
                    && api_nh->label_num > 0) {
 
-                       label_type = lsp_type_from_re_type(client->proto);
+                       /* If label type was passed, use it */
+                       if (api_nh->label_type)
+                               label_type = api_nh->label_type;
+                       else
+                               label_type =
+                                       lsp_type_from_re_type(client->proto);
+
                        nexthop_add_labels(nexthop, label_type,
                                           api_nh->label_num,
                                           &api_nh->labels[0]);
@@ -1821,7 +1816,7 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
                                mpls_label2str(nexthop->nh_label->num_labels,
                                               nexthop->nh_label->label,
                                               labelbuf, sizeof(labelbuf),
-                                              false);
+                                              nexthop->nh_label_type, false);
                        }
 
                        zlog_debug("%s: nh=%s, vrf_id=%d %s",
@@ -2241,17 +2236,18 @@ static void zread_nexthop_lookup_mrib(ZAPI_HANDLER_ARGS)
 {
        struct ipaddr addr;
        struct route_entry *re = NULL;
+       union g_addr gaddr;
 
        STREAM_GET_IPADDR(msg, &addr);
 
        switch (addr.ipa_type) {
        case IPADDR_V4:
-               re = rib_match_ipv4_multicast(zvrf_id(zvrf), addr.ipaddr_v4,
-                                             NULL);
+               gaddr.ipv4 = addr.ipaddr_v4;
+               re = rib_match_multicast(AFI_IP, zvrf_id(zvrf), &gaddr, NULL);
                break;
        case IPADDR_V6:
-               re = rib_match_ipv6_multicast(zvrf_id(zvrf), addr.ipaddr_v6,
-                                             NULL);
+               gaddr.ipv6 = addr.ipaddr_v6;
+               re = rib_match_multicast(AFI_IP6, zvrf_id(zvrf), &gaddr, NULL);
                break;
        case IPADDR_NONE:
                /* ??? */
@@ -3424,7 +3420,10 @@ static inline void zread_tc_filter(ZAPI_HANDLER_ARGS)
                        STREAM_GETL(s, filter.filter.u.flower.classid);
                        break;
                }
-               default:
+               case TC_FILTER_BPF:
+               case TC_FILTER_FLOW:
+               case TC_FILTER_U32:
+               case TC_FILTER_UNSPEC:
                        break;
                }
 
index 4fdc863682908619c3ee8310250437e38e10b080..ce8e154465ffa093f7e76582407234cd2f2cd4d9 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra API message creation & consumption.
  * Portions:
  *   Copyright (C) 1997-1999  Kunihiro Ishiguro
  *   Copyright (C) 2015-2018  Cumulus Networks, Inc.
  *   et al.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "lib/if.h"
diff --git a/zebra/zebra_affinitymap.c b/zebra/zebra_affinitymap.c
new file mode 100644 (file)
index 0000000..ae0f9a8
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * zebra affinity-map.
+ *
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+#include "lib/if.h"
+#include "lib/vrf.h"
+#include "zebra/redistribute.h"
+#include "zebra/zebra_affinitymap.h"
+
+static bool zebra_affinity_map_check_use(const char *affmap_name)
+{
+       char xpath[XPATH_MAXLEN];
+       struct interface *ifp;
+       struct vrf *vrf;
+
+       RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
+               FOR_ALL_INTERFACES (vrf, ifp) {
+                       snprintf(xpath, sizeof(xpath),
+                                "/frr-interface:lib/interface[name='%s']",
+                                ifp->name);
+                       if (!yang_dnode_exists(running_config->dnode, xpath))
+                               continue;
+                       snprintf(
+                               xpath, sizeof(xpath),
+                               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities[affinity='%s']",
+                               ifp->name, affmap_name);
+                       if (yang_dnode_exists(running_config->dnode, xpath))
+                               return true;
+               }
+       }
+       return false;
+}
+
+static bool zebra_affinity_map_check_update(const char *affmap_name,
+                                           uint16_t new_pos)
+{
+       char xpath[XPATH_MAXLEN];
+       struct interface *ifp;
+       struct vrf *vrf;
+
+       /* check whether the affinity-map new bit position is upper than 31
+        * but is used on an interface on which affinity-mode is standard.
+        * Return false if the change is not possible.
+        */
+       if (new_pos < 32)
+               return true;
+
+       RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
+               FOR_ALL_INTERFACES (vrf, ifp) {
+                       snprintf(xpath, sizeof(xpath),
+                                "/frr-interface:lib/interface[name='%s']",
+                                ifp->name);
+                       if (!yang_dnode_exists(running_config->dnode, xpath))
+                               continue;
+                       snprintf(
+                               xpath, sizeof(xpath),
+                               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities[affinity='%s']",
+                               ifp->name, affmap_name);
+                       if (!yang_dnode_exists(running_config->dnode, xpath))
+                               continue;
+                       if (yang_dnode_get_enum(
+                                   running_config->dnode,
+                                   "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinity-mode",
+                                   ifp->name) == AFFINITY_MODE_STANDARD)
+                               return false;
+               }
+       }
+       return true;
+}
+
+static void zebra_affinity_map_update(const char *affmap_name, uint16_t old_pos,
+                                     uint16_t new_pos)
+{
+       struct if_link_params *iflp;
+       enum affinity_mode aff_mode;
+       char xpath[XPATH_MAXLEN];
+       struct interface *ifp;
+       struct vrf *vrf;
+
+       RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
+               FOR_ALL_INTERFACES (vrf, ifp) {
+                       snprintf(xpath, sizeof(xpath),
+                                "/frr-interface:lib/interface[name='%s']",
+                                ifp->name);
+                       if (!yang_dnode_exists(running_config->dnode, xpath))
+                               continue;
+                       snprintf(
+                               xpath, sizeof(xpath),
+                               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities[affinity='%s']",
+                               ifp->name, affmap_name);
+                       if (!yang_dnode_exists(running_config->dnode, xpath))
+                               continue;
+                       aff_mode = yang_dnode_get_enum(
+                               running_config->dnode,
+                               "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinity-mode",
+                               ifp->name);
+                       iflp = if_link_params_get(ifp);
+                       if (aff_mode == AFFINITY_MODE_EXTENDED ||
+                           aff_mode == AFFINITY_MODE_BOTH) {
+                               admin_group_unset(&iflp->ext_admin_grp,
+                                                 old_pos);
+                               admin_group_set(&iflp->ext_admin_grp, new_pos);
+                       }
+                       if (aff_mode == AFFINITY_MODE_STANDARD ||
+                           aff_mode == AFFINITY_MODE_BOTH) {
+                               iflp->admin_grp &= ~(1 << old_pos);
+                               if (new_pos < 32)
+                                       iflp->admin_grp |= 1 << new_pos;
+                               if (iflp->admin_grp == 0)
+                                       UNSET_PARAM(iflp, LP_ADM_GRP);
+                       }
+                       if (if_is_operative(ifp))
+                               zebra_interface_parameters_update(ifp);
+               }
+       }
+}
+
+void zebra_affinity_map_init(void)
+{
+       affinity_map_init();
+
+       affinity_map_set_check_use_hook(zebra_affinity_map_check_use);
+       affinity_map_set_check_update_hook(zebra_affinity_map_check_update);
+       affinity_map_set_update_hook(zebra_affinity_map_update);
+}
diff --git a/zebra/zebra_affinitymap.h b/zebra/zebra_affinitymap.h
new file mode 100644 (file)
index 0000000..5ddc998
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Zebra affinity-map header
+ *
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (FRR).
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __ZEBRA_AFFINITYMAP_H__
+#define __ZEBRA_AFFINITYMAP_H__
+
+#include "lib/affinitymap.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void zebra_affinity_map_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index ef4cef65ca55c59bd0da228add6c623c4f7962db..af1dd6b5fd87c9c4c8105415a8413360ee1cc667 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane layer.
  * Copyright (c) 2018 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifdef HAVE_CONFIG_H
@@ -222,6 +209,7 @@ struct dplane_mac_info {
        vlanid_t vid;
        ifindex_t br_ifindex;
        struct ethaddr mac;
+       vni_t vni;
        struct in_addr vtep_ip;
        bool is_sticky;
        uint32_t nhg_id;
@@ -237,6 +225,7 @@ struct dplane_neigh_info {
                struct ethaddr mac;
                struct ipaddr ip_addr;
        } link;
+       vni_t vni;
        uint32_t flags;
        uint16_t state;
        uint32_t update_flags;
@@ -628,17 +617,16 @@ static enum zebra_dplane_result pw_update_internal(struct zebra_pw *pw,
 static enum zebra_dplane_result intf_addr_update_internal(
        const struct interface *ifp, const struct connected *ifc,
        enum dplane_op_e op);
-static enum zebra_dplane_result mac_update_common(
-       enum dplane_op_e op, const struct interface *ifp,
-       const struct interface *br_ifp,
-       vlanid_t vid, const struct ethaddr *mac,
-       struct in_addr vtep_ip, bool sticky, uint32_t nhg_id,
-       uint32_t update_flags);
+static enum zebra_dplane_result
+mac_update_common(enum dplane_op_e op, const struct interface *ifp,
+                 const struct interface *br_ifp, vlanid_t vid,
+                 const struct ethaddr *mac, vni_t vni, struct in_addr vtep_ip,
+                 bool sticky, uint32_t nhg_id, uint32_t update_flags);
 static enum zebra_dplane_result
 neigh_update_internal(enum dplane_op_e op, const struct interface *ifp,
                      const void *link, int link_family,
-                     const struct ipaddr *ip, uint32_t flags, uint16_t state,
-                     uint32_t update_flags, int protocol);
+                     const struct ipaddr *ip, vni_t vni, uint32_t flags,
+                     uint16_t state, uint32_t update_flags, int protocol);
 
 /*
  * Public APIs
@@ -2229,6 +2217,12 @@ const struct ethaddr *dplane_ctx_mac_get_addr(
        return &(ctx->u.macinfo.mac);
 }
 
+vni_t dplane_ctx_mac_get_vni(const struct zebra_dplane_ctx *ctx)
+{
+       DPLANE_CTX_VALID(ctx);
+       return ctx->u.macinfo.vni;
+}
+
 const struct in_addr *dplane_ctx_mac_get_vtep_ip(
        const struct zebra_dplane_ctx *ctx)
 {
@@ -2264,6 +2258,12 @@ const struct ethaddr *dplane_ctx_neigh_get_mac(
        return &(ctx->u.neigh.link.mac);
 }
 
+vni_t dplane_ctx_neigh_get_vni(const struct zebra_dplane_ctx *ctx)
+{
+       DPLANE_CTX_VALID(ctx);
+       return ctx->u.neigh.vni;
+}
+
 uint32_t dplane_ctx_neigh_get_flags(const struct zebra_dplane_ctx *ctx)
 {
        DPLANE_CTX_VALID(ctx);
@@ -4649,14 +4649,11 @@ enum zebra_dplane_result dplane_intf_delete(const struct interface *ifp)
 /*
  * Enqueue vxlan/evpn mac add (or update).
  */
-enum zebra_dplane_result dplane_rem_mac_add(const struct interface *ifp,
-                                       const struct interface *bridge_ifp,
-                                       vlanid_t vid,
-                                       const struct ethaddr *mac,
-                                       struct in_addr vtep_ip,
-                                       bool sticky,
-                                       uint32_t nhg_id,
-                                       bool was_static)
+enum zebra_dplane_result
+dplane_rem_mac_add(const struct interface *ifp,
+                  const struct interface *bridge_ifp, vlanid_t vid,
+                  const struct ethaddr *mac, vni_t vni, struct in_addr vtep_ip,
+                  bool sticky, uint32_t nhg_id, bool was_static)
 {
        enum zebra_dplane_result result;
        uint32_t update_flags = 0;
@@ -4666,8 +4663,9 @@ enum zebra_dplane_result dplane_rem_mac_add(const struct interface *ifp,
                update_flags |= DPLANE_MAC_WAS_STATIC;
 
        /* Use common helper api */
-       result = mac_update_common(DPLANE_OP_MAC_INSTALL, ifp, bridge_ifp,
-                                  vid, mac, vtep_ip, sticky, nhg_id, update_flags);
+       result = mac_update_common(DPLANE_OP_MAC_INSTALL, ifp, bridge_ifp, vid,
+                                  mac, vni, vtep_ip, sticky, nhg_id,
+                                  update_flags);
        return result;
 }
 
@@ -4675,10 +4673,10 @@ enum zebra_dplane_result dplane_rem_mac_add(const struct interface *ifp,
  * Enqueue vxlan/evpn mac delete.
  */
 enum zebra_dplane_result dplane_rem_mac_del(const struct interface *ifp,
-                                       const struct interface *bridge_ifp,
-                                       vlanid_t vid,
-                                       const struct ethaddr *mac,
-                                       struct in_addr vtep_ip)
+                                           const struct interface *bridge_ifp,
+                                           vlanid_t vid,
+                                           const struct ethaddr *mac,
+                                           vni_t vni, struct in_addr vtep_ip)
 {
        enum zebra_dplane_result result;
        uint32_t update_flags = 0;
@@ -4686,8 +4684,8 @@ enum zebra_dplane_result dplane_rem_mac_del(const struct interface *ifp,
        update_flags |= DPLANE_MAC_REMOTE;
 
        /* Use common helper api */
-       result = mac_update_common(DPLANE_OP_MAC_DELETE, ifp, bridge_ifp,
-                                  vid, mac, vtep_ip, false, 0, update_flags);
+       result = mac_update_common(DPLANE_OP_MAC_DELETE, ifp, bridge_ifp, vid,
+                                  mac, vni, vtep_ip, false, 0, update_flags);
        return result;
 }
 
@@ -4716,7 +4714,7 @@ enum zebra_dplane_result dplane_neigh_ip_update(enum dplane_op_e op,
        update_flags = DPLANE_NEIGH_NO_EXTENSION;
 
        result = neigh_update_internal(op, ifp, (const void *)link_ip,
-                                      ipaddr_family(link_ip), ip, 0, state,
+                                      ipaddr_family(link_ip), ip, 0, 0, state,
                                       update_flags, protocol);
 
        return result;
@@ -4746,9 +4744,8 @@ enum zebra_dplane_result dplane_local_mac_add(const struct interface *ifp,
        vtep_ip.s_addr = 0;
 
        /* Use common helper api */
-       result = mac_update_common(DPLANE_OP_MAC_INSTALL, ifp, bridge_ifp,
-                                    vid, mac, vtep_ip, sticky, 0,
-                                    update_flags);
+       result = mac_update_common(DPLANE_OP_MAC_INSTALL, ifp, bridge_ifp, vid,
+                                  mac, 0, vtep_ip, sticky, 0, update_flags);
        return result;
 }
 
@@ -4767,21 +4764,17 @@ dplane_local_mac_del(const struct interface *ifp,
 
        /* Use common helper api */
        result = mac_update_common(DPLANE_OP_MAC_DELETE, ifp, bridge_ifp, vid,
-                                  mac, vtep_ip, false, 0, 0);
+                                  mac, 0, vtep_ip, false, 0, 0);
        return result;
 }
 /*
  * Public api to init an empty context - either newly-allocated or
  * reset/cleared - for a MAC update.
  */
-void dplane_mac_init(struct zebra_dplane_ctx *ctx,
-                    const struct interface *ifp,
-                    const struct interface *br_ifp,
-                    vlanid_t vid,
-                    const struct ethaddr *mac,
-                    struct in_addr vtep_ip,
-                    bool sticky,
-                    uint32_t nhg_id,
+void dplane_mac_init(struct zebra_dplane_ctx *ctx, const struct interface *ifp,
+                    const struct interface *br_ifp, vlanid_t vid,
+                    const struct ethaddr *mac, vni_t vni,
+                    struct in_addr vtep_ip, bool sticky, uint32_t nhg_id,
                     uint32_t update_flags)
 {
        struct zebra_ns *zns;
@@ -4801,6 +4794,7 @@ void dplane_mac_init(struct zebra_dplane_ctx *ctx,
        ctx->u.macinfo.br_ifindex = br_ifp->ifindex;
        ctx->u.macinfo.vtep_ip = vtep_ip;
        ctx->u.macinfo.mac = *mac;
+       ctx->u.macinfo.vni = vni;
        ctx->u.macinfo.vid = vid;
        ctx->u.macinfo.is_sticky = sticky;
        ctx->u.macinfo.nhg_id = nhg_id;
@@ -4811,15 +4805,10 @@ void dplane_mac_init(struct zebra_dplane_ctx *ctx,
  * Common helper api for MAC address/vxlan updates
  */
 static enum zebra_dplane_result
-mac_update_common(enum dplane_op_e op,
-                 const struct interface *ifp,
-                 const struct interface *br_ifp,
-                 vlanid_t vid,
-                 const struct ethaddr *mac,
-                 struct in_addr vtep_ip,
-                 bool sticky,
-                 uint32_t nhg_id,
-                 uint32_t update_flags)
+mac_update_common(enum dplane_op_e op, const struct interface *ifp,
+                 const struct interface *br_ifp, vlanid_t vid,
+                 const struct ethaddr *mac, vni_t vni, struct in_addr vtep_ip,
+                 bool sticky, uint32_t nhg_id, uint32_t update_flags)
 {
        enum zebra_dplane_result result = ZEBRA_DPLANE_REQUEST_FAILURE;
        int ret;
@@ -4833,7 +4822,7 @@ mac_update_common(enum dplane_op_e op,
        ctx->zd_op = op;
 
        /* Common init for the ctx */
-       dplane_mac_init(ctx, ifp, br_ifp, vid, mac, vtep_ip, sticky,
+       dplane_mac_init(ctx, ifp, br_ifp, vid, mac, vni, vtep_ip, sticky,
                        nhg_id, update_flags);
 
        /* Enqueue for processing on the dplane pthread */
@@ -4873,7 +4862,7 @@ enum zebra_dplane_result dplane_rem_neigh_add(const struct interface *ifp,
 
        result = neigh_update_internal(
                DPLANE_OP_NEIGH_INSTALL, ifp, (const void *)mac, AF_ETHERNET,
-               ip, flags, DPLANE_NUD_NOARP, update_flags, 0);
+               ip, 0, flags, DPLANE_NUD_NOARP, update_flags, 0);
 
        return result;
 }
@@ -4906,8 +4895,8 @@ enum zebra_dplane_result dplane_local_neigh_add(const struct interface *ifp,
                ntf |= DPLANE_NTF_ROUTER;
 
        result = neigh_update_internal(DPLANE_OP_NEIGH_INSTALL, ifp,
-                                      (const void *)mac, AF_ETHERNET, ip, ntf,
-                                      state, update_flags, 0);
+                                      (const void *)mac, AF_ETHERNET, ip, 0,
+                                      ntf, state, update_flags, 0);
 
        return result;
 }
@@ -4924,7 +4913,8 @@ enum zebra_dplane_result dplane_rem_neigh_delete(const struct interface *ifp,
        update_flags |= DPLANE_NEIGH_REMOTE;
 
        result = neigh_update_internal(DPLANE_OP_NEIGH_DELETE, ifp, NULL,
-                                      AF_ETHERNET, ip, 0, 0, update_flags, 0);
+                                      AF_ETHERNET, ip, 0, 0, 0, update_flags,
+                                      0);
 
        return result;
 }
@@ -4948,7 +4938,7 @@ enum zebra_dplane_result dplane_vtep_add(const struct interface *ifp,
        addr.ipaddr_v4 = *ip;
 
        result = neigh_update_internal(DPLANE_OP_VTEP_ADD, ifp, &mac,
-                                      AF_ETHERNET, &addr, 0, 0, 0, 0);
+                                      AF_ETHERNET, &addr, vni, 0, 0, 0, 0);
 
        return result;
 }
@@ -4974,7 +4964,7 @@ enum zebra_dplane_result dplane_vtep_delete(const struct interface *ifp,
 
        result = neigh_update_internal(DPLANE_OP_VTEP_DELETE, ifp,
                                       (const void *)&mac, AF_ETHERNET, &addr,
-                                      0, 0, 0, 0);
+                                      vni, 0, 0, 0, 0);
 
        return result;
 }
@@ -4985,7 +4975,7 @@ enum zebra_dplane_result dplane_neigh_discover(const struct interface *ifp,
        enum zebra_dplane_result result;
 
        result = neigh_update_internal(DPLANE_OP_NEIGH_DISCOVER, ifp, NULL,
-                                      AF_ETHERNET, ip, DPLANE_NTF_USE,
+                                      AF_ETHERNET, ip, 0, DPLANE_NTF_USE,
                                       DPLANE_NUD_INCOMPLETE, 0, 0);
 
        return result;
@@ -5053,8 +5043,8 @@ enum zebra_dplane_result dplane_neigh_table_update(const struct interface *ifp,
 static enum zebra_dplane_result
 neigh_update_internal(enum dplane_op_e op, const struct interface *ifp,
                      const void *link, const int link_family,
-                     const struct ipaddr *ip, uint32_t flags, uint16_t state,
-                     uint32_t update_flags, int protocol)
+                     const struct ipaddr *ip, vni_t vni, uint32_t flags,
+                     uint16_t state, uint32_t update_flags, int protocol)
 {
        enum zebra_dplane_result result = ZEBRA_DPLANE_REQUEST_FAILURE;
        int ret;
@@ -5105,6 +5095,7 @@ neigh_update_internal(enum dplane_op_e op, const struct interface *ifp,
                ctx->u.neigh.link.ip_addr = *link_ip;
 
        ctx->u.neigh.flags = flags;
+       ctx->u.neigh.vni = vni;
        ctx->u.neigh.state = state;
        ctx->u.neigh.update_flags = update_flags;
 
index ae13243a16ef62e836ec339322d148dc21c047df..3a4f3c217403a63f8ff133808c1cc8b86519bd4f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra dataplane layer api interfaces.
  * Copyright (c) 2018 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_DPLANE_H
@@ -568,6 +555,7 @@ uint32_t dplane_ctx_mac_get_update_flags(const struct zebra_dplane_ctx *ctx);
 uint32_t dplane_ctx_mac_get_nhg_id(const struct zebra_dplane_ctx *ctx);
 const struct ethaddr *dplane_ctx_mac_get_addr(
        const struct zebra_dplane_ctx *ctx);
+vni_t dplane_ctx_mac_get_vni(const struct zebra_dplane_ctx *ctx);
 const struct in_addr *dplane_ctx_mac_get_vtep_ip(
        const struct zebra_dplane_ctx *ctx);
 ifindex_t dplane_ctx_mac_get_br_ifindex(const struct zebra_dplane_ctx *ctx);
@@ -577,6 +565,7 @@ const struct ipaddr *dplane_ctx_neigh_get_ipaddr(
        const struct zebra_dplane_ctx *ctx);
 const struct ethaddr *dplane_ctx_neigh_get_mac(
        const struct zebra_dplane_ctx *ctx);
+vni_t dplane_ctx_neigh_get_vni(const struct zebra_dplane_ctx *ctx);
 const struct ipaddr *
 dplane_ctx_neigh_get_link_ip(const struct zebra_dplane_ctx *ctx);
 uint32_t dplane_ctx_neigh_get_flags(const struct zebra_dplane_ctx *ctx);
@@ -792,14 +781,11 @@ enum zebra_dplane_result dplane_neigh_ip_update(enum dplane_op_e op,
 /*
  * Enqueue evpn mac operations for the dataplane.
  */
-enum zebra_dplane_result dplane_rem_mac_add(const struct interface *ifp,
-                                       const struct interface *bridge_ifp,
-                                       vlanid_t vid,
-                                       const struct ethaddr *mac,
-                                       struct in_addr vtep_ip,
-                                       bool sticky,
-                                       uint32_t nhg_id,
-                                       bool was_static);
+enum zebra_dplane_result
+dplane_rem_mac_add(const struct interface *ifp,
+                  const struct interface *bridge_ifp, vlanid_t vid,
+                  const struct ethaddr *mac, vni_t vni, struct in_addr vtep_ip,
+                  bool sticky, uint32_t nhg_id, bool was_static);
 
 enum zebra_dplane_result dplane_local_mac_add(const struct interface *ifp,
                                        const struct interface *bridge_ifp,
@@ -815,20 +801,17 @@ dplane_local_mac_del(const struct interface *ifp,
                     const struct ethaddr *mac);
 
 enum zebra_dplane_result dplane_rem_mac_del(const struct interface *ifp,
-                                       const struct interface *bridge_ifp,
-                                       vlanid_t vid,
-                                       const struct ethaddr *mac,
-                                       struct in_addr vtep_ip);
+                                           const struct interface *bridge_ifp,
+                                           vlanid_t vid,
+                                           const struct ethaddr *mac,
+                                           vni_t vni, struct in_addr vtep_ip);
 
 /* Helper api to init an empty or new context for a MAC update */
-void dplane_mac_init(struct zebra_dplane_ctx *ctx,
-                    const struct interface *ifp,
-                    const struct interface *br_ifp,
-                    vlanid_t vid,
-                    const struct ethaddr *mac,
-                    struct in_addr vtep_ip,
-                    bool sticky,
-                    uint32_t nhg_id, uint32_t update_flags);
+void dplane_mac_init(struct zebra_dplane_ctx *ctx, const struct interface *ifp,
+                    const struct interface *br_ifp, vlanid_t vid,
+                    const struct ethaddr *mac, vni_t vni,
+                    struct in_addr vtep_ip, bool sticky, uint32_t nhg_id,
+                    uint32_t update_flags);
 
 /*
  * Enqueue evpn neighbor updates for the dataplane.
index 7549a3d5c075b97c0de5a1d85021419e16265712..09b369e23eaf7a96c02ae6e9314b875c69917b99 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra-specific error messages.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5164de09d6753d853eeba4e320c3a0e785694eea..3ac654bda5c39c594ded24ea2f6da8d4bbe28890 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra-specific error messages.
  * Copyright (C) 2018  Cumulus Networks, Inc.
  *                     Quentin Young
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __EC_ZEBRAORS_H__
index f207477445d375c2c95ed4b1099aa8cfcbebe242..ce5e6399285000336910a623fa9476bc5f6071ee 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN for VxLAN code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mac.h"
 #include "zebra/zebra_evpn_neigh.h"
-#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn_mh.h"
 #include "zebra/zebra_evpn_vxlan.h"
 #include "zebra/zebra_router.h"
@@ -101,14 +86,15 @@ int advertise_svi_macip_enabled(struct zebra_evpn *zevpn)
  */
 void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
 {
-       struct vty *vty;
-       struct zebra_vtep *zvtep;
-       uint32_t num_macs;
-       uint32_t num_neigh;
+
+       struct vty *vty = NULL;
+       struct zebra_vtep *zvtep = NULL;
+       uint32_t num_macs = 0;
+       uint32_t num_neigh = 0;
+       uint32_t num_vteps = 0;
        json_object *json = NULL;
        json_object *json_vtep_list = NULL;
-       json_object *json_ip_str = NULL;
-       char buf[PREFIX_STRLEN];
+       json_object *json_vtep = NULL;
 
        vty = ctxt[0];
        json = ctxt[1];
@@ -116,17 +102,28 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
        if (json == NULL) {
                vty_out(vty, "VNI: %u\n", zevpn->vni);
                vty_out(vty, " Type: %s\n", "L2");
+               vty_out(vty, " Vlan: %u\n", zevpn->vid);
+               vty_out(vty, " Bridge: %s\n",
+                       zevpn->bridge_if ? zevpn->bridge_if->name : "-");
                vty_out(vty, " Tenant VRF: %s\n", vrf_id_to_name(zevpn->vrf_id));
        } else {
                json_object_int_add(json, "vni", zevpn->vni);
                json_object_string_add(json, "type", "L2");
+#if CONFDATE > 20240210
+CPP_NOTICE("Drop `vrf` from JSON output")
+#endif
                json_object_string_add(json, "vrf",
                                       vrf_id_to_name(zevpn->vrf_id));
+               json_object_string_add(json, "tenantVrf",
+                                      vrf_id_to_name(zevpn->vrf_id));
        }
 
        if (!zevpn->vxlan_if) { // unexpected
                if (json == NULL)
                        vty_out(vty, " VxLAN interface: unknown\n");
+               else
+                       json_object_string_add(json, "vxlanInterface",
+                                              "unknown");
                return;
        }
        num_macs = num_valid_macs(zevpn);
@@ -145,7 +142,12 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
        } else {
                json_object_string_add(json, "vxlanInterface",
                                       zevpn->vxlan_if->name);
+#if CONFDATE > 20240210
+CPP_NOTICE("Drop `ifindex` from JSON output")
+#endif
                json_object_int_add(json, "ifindex", zevpn->vxlan_if->ifindex);
+               json_object_int_add(json, "vxlanIfindex",
+                                   zevpn->vxlan_if->ifindex);
                if (zevpn->svi_if) {
                        json_object_string_add(json, "sviInterface",
                                               zevpn->svi_if->name);
@@ -157,7 +159,8 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
                json_object_string_addf(json, "mcastGroup", "%pI4",
                                        &zevpn->mcast_grp);
                json_object_string_add(json, "advertiseGatewayMacip",
-                                      zevpn->advertise_gw_macip ? "Yes" : "No");
+                                      zevpn->advertise_gw_macip ? "Yes"
+                                                                : "No");
                json_object_string_add(json, "advertiseSviMacip",
                                       zevpn->advertise_svi_macip ? "Yes"
                                                                  : "No");
@@ -167,32 +170,38 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
        if (!zevpn->vteps) {
                if (json == NULL)
                        vty_out(vty, " No remote VTEPs known for this VNI\n");
+               else
+                       json_object_int_add(json, "numRemoteVteps", num_vteps);
        } else {
                if (json == NULL)
                        vty_out(vty, " Remote VTEPs for this VNI:\n");
                else
                        json_vtep_list = json_object_new_array();
                for (zvtep = zevpn->vteps; zvtep; zvtep = zvtep->next) {
-                       const char *flood_str = lookup_msg(zvtep_flood_str,
-                                       zvtep->flood_control,
-                                       VXLAN_FLOOD_STR_DEFAULT);
+                       const char *flood_str = lookup_msg(
+                               zvtep_flood_str, zvtep->flood_control,
+                               VXLAN_FLOOD_STR_DEFAULT);
 
                        if (json == NULL) {
                                vty_out(vty, "  %pI4 flood: %s\n",
                                                &zvtep->vtep_ip,
                                                flood_str);
                        } else {
-                               json_ip_str = json_object_new_string(
-                                               inet_ntop(AF_INET,
-                                                         &zvtep->vtep_ip, buf,
-                                                         sizeof(buf)));
+                               json_vtep = json_object_new_object();
+                               json_object_string_addf(json_vtep, "ip", "%pI4",
+                                                       &zvtep->vtep_ip);
+                               json_object_string_add(json_vtep, "flood",
+                                                      flood_str);
                                json_object_array_add(json_vtep_list,
-                                               json_ip_str);
+                                                     json_vtep);
                        }
+                       num_vteps++;
                }
-               if (json)
-                       json_object_object_add(json, "numRemoteVteps",
+               if (json) {
+                       json_object_int_add(json, "numRemoteVteps", num_vteps);
+                       json_object_object_add(json, "remoteVteps",
                                               json_vtep_list);
+               }
        }
        if (json == NULL) {
                vty_out(vty,
@@ -434,16 +443,16 @@ int zebra_evpn_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn,
 {
        struct zebra_mac *mac = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
+       struct zebra_vxlan_vni *vni;
 
        zif = zevpn->vxlan_if->info;
        if (!zif)
                return -1;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
 
        zebra_evpn_mac_gw_macip_add(ifp, zevpn, ip, &mac, macaddr,
-                                   vxl->access_vlan, true);
+                                   vni->access_vlan, true);
 
        return zebra_evpn_neigh_gw_macip_add(ifp, zevpn, ip, mac);
 }
@@ -502,7 +511,7 @@ void zebra_evpn_gw_macip_del_for_evpn_hash(struct hash_bucket *bucket,
 {
        struct zebra_evpn *zevpn = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan zl2_info;
+       struct zebra_vxlan_vni *vni = NULL;
        struct interface *vlan_if = NULL;
        struct interface *vrr_if = NULL;
        struct interface *ifp;
@@ -529,10 +538,11 @@ void zebra_evpn_gw_macip_del_for_evpn_hash(struct hash_bucket *bucket,
        if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                return;
 
-       zl2_info = zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return;
 
-       vlan_if =
-               zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
+       vlan_if = zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
        if (!vlan_if)
                return;
 
@@ -552,10 +562,10 @@ void zebra_evpn_gw_macip_add_for_evpn_hash(struct hash_bucket *bucket,
 {
        struct zebra_evpn *zevpn = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan zl2_info;
        struct interface *vlan_if = NULL;
        struct interface *vrr_if = NULL;
        struct interface *ifp = NULL;
+       struct zebra_vxlan_vni *vni = NULL;
 
        zevpn = (struct zebra_evpn *)bucket->data;
 
@@ -567,10 +577,11 @@ void zebra_evpn_gw_macip_add_for_evpn_hash(struct hash_bucket *bucket,
        /* If down or not mapped to a bridge, we're done. */
        if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                return;
-       zl2_info = zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return;
 
-       vlan_if =
-               zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
+       vlan_if = zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
        if (!vlan_if)
                return;
 
@@ -594,8 +605,8 @@ void zebra_evpn_svi_macip_del_for_evpn_hash(struct hash_bucket *bucket,
 {
        struct zebra_evpn *zevpn = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan zl2_info;
        struct interface *vlan_if = NULL;
+       struct zebra_vxlan_vni *vni = NULL;
        struct interface *ifp;
 
        /* Add primary SVI MAC*/
@@ -622,10 +633,11 @@ void zebra_evpn_svi_macip_del_for_evpn_hash(struct hash_bucket *bucket,
        if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                return;
 
-       zl2_info = zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return;
 
-       vlan_if =
-               zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
+       vlan_if = zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
        if (!vlan_if)
                return;
 
@@ -639,6 +651,7 @@ static int zebra_evpn_map_vlan_ns(struct ns *ns,
                                  void *_in_param,
                                  void **_p_zevpn)
 {
+       int found = 0;
        struct zebra_ns *zns = ns->info;
        struct route_node *rn;
        struct interface *br_if;
@@ -646,42 +659,59 @@ static int zebra_evpn_map_vlan_ns(struct ns *ns,
        struct zebra_evpn *zevpn;
        struct interface *tmp_if = NULL;
        struct zebra_if *zif;
-       struct zebra_l2info_vxlan *vxl = NULL;
        struct zebra_from_svi_param *in_param =
                (struct zebra_from_svi_param *)_in_param;
+       vlanid_t vid;
+       vni_t vni_id = 0;
+       uint8_t bridge_vlan_aware;
 
        assert(p_zevpn && in_param);
 
        br_if = in_param->br_if;
+       assert(br_if);
        zif = in_param->zif;
        assert(zif);
-       assert(br_if);
+       vid = in_param->vid;
+       bridge_vlan_aware = in_param->bridge_vlan_aware;
 
-       /* See if this interface (or interface plus VLAN Id) maps to a VxLAN */
-       /* TODO: Optimize with a hash. */
-       for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
-               tmp_if = (struct interface *)rn->info;
-               if (!tmp_if)
-                       continue;
-               zif = tmp_if->info;
-               if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
-                       continue;
-               if (!if_is_operative(tmp_if))
-                       continue;
-               vxl = &zif->l2info.vxl;
-
-               if (zif->brslave_info.br_if != br_if)
-                       continue;
-
-               if (!in_param->bridge_vlan_aware
-                   || vxl->access_vlan == in_param->vid) {
-                       zevpn = zebra_evpn_lookup(vxl->vni);
-                       *p_zevpn = zevpn;
-                       return NS_WALK_STOP;
+       if (bridge_vlan_aware) {
+               vni_id = zebra_l2_bridge_if_vni_find(zif, vid);
+               if (vni_id)
+                       found = 1;
+       } else {
+               /*
+                * See if this interface (or interface plus VLAN Id) maps to a
+                * VxLAN
+                */
+               /* TODO: Optimize with a hash. */
+               for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
+                       tmp_if = (struct interface *)rn->info;
+                       if (!tmp_if)
+                               continue;
+                       zif = tmp_if->info;
+                       if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
+                               continue;
+                       if (!if_is_operative(tmp_if))
+                               continue;
+
+                       if (zif->brslave_info.br_if != br_if)
+                               continue;
+
+                       vni_id =
+                               zebra_vxlan_if_access_vlan_vni_find(zif, br_if);
+                       if (vni_id) {
+                               found = 1;
+                               break;
+                       }
                }
        }
 
-       return NS_WALK_CONTINUE;
+       if (!found)
+               return NS_WALK_CONTINUE;
+
+       zevpn = zebra_evpn_lookup(vni_id);
+       *p_zevpn = zevpn;
+       return NS_WALK_STOP;
 }
 
 /*
@@ -692,7 +722,6 @@ struct zebra_evpn *zebra_evpn_map_vlan(struct interface *ifp,
                                       struct interface *br_if, vlanid_t vid)
 {
        struct zebra_if *zif;
-       struct zebra_l2info_bridge *br;
        struct zebra_evpn **p_zevpn;
        struct zebra_evpn *zevpn = NULL;
        struct zebra_from_svi_param in_param;
@@ -700,8 +729,7 @@ struct zebra_evpn *zebra_evpn_map_vlan(struct interface *ifp,
        /* Determine if bridge is VLAN-aware or not */
        zif = br_if->info;
        assert(zif);
-       br = &zif->l2info.br;
-       in_param.bridge_vlan_aware = br->vlan_aware;
+       in_param.bridge_vlan_aware = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif);
        in_param.vid = vid;
        in_param.br_if = br_if;
        in_param.zif = zif;
@@ -724,43 +752,60 @@ static int zebra_evpn_from_svi_ns(struct ns *ns,
        struct zebra_evpn *zevpn;
        struct interface *tmp_if = NULL;
        struct zebra_if *zif;
-       struct zebra_l2info_vxlan *vxl = NULL;
+       struct zebra_if *br_zif;
+       struct zebra_l2_bridge_vlan *bvlan;
        struct zebra_from_svi_param *in_param =
                (struct zebra_from_svi_param *)_in_param;
        int found = 0;
+       vni_t vni_id = 0;
+       vlanid_t vid = 0;
+       uint8_t bridge_vlan_aware;
 
        if (!in_param)
                return NS_WALK_STOP;
+
        br_if = in_param->br_if;
        zif = in_param->zif;
        assert(zif);
-
-       /* TODO: Optimize with a hash. */
-       for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
-               tmp_if = (struct interface *)rn->info;
-               if (!tmp_if)
-                       continue;
-               zif = tmp_if->info;
-               if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
-                       continue;
-               if (!if_is_operative(tmp_if))
-                       continue;
-               vxl = &zif->l2info.vxl;
-
-               if (zif->brslave_info.br_if != br_if)
-                       continue;
-
-               if (!in_param->bridge_vlan_aware
-                   || vxl->access_vlan == in_param->vid) {
+       bridge_vlan_aware = in_param->bridge_vlan_aware;
+       vid = in_param->vid;
+       br_zif = br_if->info;
+       assert(br_zif);
+
+       if (bridge_vlan_aware) {
+               bvlan = zebra_l2_bridge_if_vlan_find(br_zif, vid);
+               if (bvlan && bvlan->access_bd && bvlan->access_bd->vni) {
                        found = 1;
-                       break;
+                       vni_id = bvlan->access_bd->vni;
+               }
+       } else {
+               /* TODO: Optimize with a hash. */
+               for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
+                       tmp_if = (struct interface *)rn->info;
+                       if (!tmp_if)
+                               continue;
+                       zif = tmp_if->info;
+                       if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
+                               continue;
+                       if (!if_is_operative(tmp_if))
+                               continue;
+
+                       if (zif->brslave_info.br_if != br_if)
+                               continue;
+
+                       vni_id =
+                               zebra_vxlan_if_access_vlan_vni_find(zif, br_if);
+                       if (vni_id) {
+                               found = 1;
+                               break;
+                       }
                }
        }
 
        if (!found)
                return NS_WALK_CONTINUE;
 
-       zevpn = zebra_evpn_lookup(vxl->vni);
+       zevpn = zebra_evpn_lookup(vni_id);
        if (p_zevpn)
                *p_zevpn = zevpn;
        return NS_WALK_STOP;
@@ -773,7 +818,6 @@ static int zebra_evpn_from_svi_ns(struct ns *ns,
 struct zebra_evpn *zebra_evpn_from_svi(struct interface *ifp,
                                       struct interface *br_if)
 {
-       struct zebra_l2info_bridge *br;
        struct zebra_evpn *zevpn = NULL;
        struct zebra_evpn **p_zevpn;
        struct zebra_if *zif;
@@ -789,8 +833,7 @@ struct zebra_evpn *zebra_evpn_from_svi(struct interface *ifp,
        /* Determine if bridge is VLAN-aware or not */
        zif = br_if->info;
        assert(zif);
-       br = &zif->l2info.br;
-       in_param.bridge_vlan_aware = br->vlan_aware;
+       in_param.bridge_vlan_aware = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif);
        in_param.vid = 0;
 
        if (in_param.bridge_vlan_aware) {
@@ -884,10 +927,25 @@ struct interface *zebra_evpn_map_to_macvlan(struct interface *br_if,
        return tmp_if;
 }
 
+/*
+ * Uninstall MAC hash entry - called upon access VLAN change.
+ */
+static void zebra_evpn_uninstall_mac_hash(struct hash_bucket *bucket,
+                                         void *ctxt)
+{
+       struct zebra_mac *mac;
+       struct mac_walk_ctx *wctx = ctxt;
+
+       mac = (struct zebra_mac *)bucket->data;
+
+       if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE))
+               zebra_evpn_rem_mac_uninstall(wctx->zevpn, mac, false);
+}
+
 /*
  * Install MAC hash entry - called upon access VLAN change.
  */
-void zebra_evpn_install_mac_hash(struct hash_bucket *bucket, void *ctxt)
+static void zebra_evpn_install_mac_hash(struct hash_bucket *bucket, void *ctxt)
 {
        struct zebra_mac *mac;
        struct mac_walk_ctx *wctx = ctxt;
@@ -898,6 +956,44 @@ void zebra_evpn_install_mac_hash(struct hash_bucket *bucket, void *ctxt)
                zebra_evpn_rem_mac_install(wctx->zevpn, mac, false);
 }
 
+/*
+ * Uninstall remote MAC entries for this EVPN.
+ */
+void zebra_evpn_rem_mac_uninstall_all(struct zebra_evpn *zevpn)
+{
+       struct mac_walk_ctx wctx;
+
+       if (!zevpn->mac_table)
+               return;
+
+       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       wctx.zevpn = zevpn;
+       wctx.uninstall = 1;
+       wctx.upd_client = 0;
+       wctx.flags = ZEBRA_MAC_REMOTE;
+
+       hash_iterate(zevpn->mac_table, zebra_evpn_uninstall_mac_hash, &wctx);
+}
+
+/*
+ * Install remote MAC entries for this EVPN.
+ */
+void zebra_evpn_rem_mac_install_all(struct zebra_evpn *zevpn)
+{
+       struct mac_walk_ctx wctx;
+
+       if (!zevpn->mac_table)
+               return;
+
+       memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+       wctx.zevpn = zevpn;
+       wctx.uninstall = 0;
+       wctx.upd_client = 0;
+       wctx.flags = ZEBRA_MAC_REMOTE;
+
+       hash_iterate(zevpn->mac_table, zebra_evpn_install_mac_hash, &wctx);
+}
+
 /*
  * Read and populate local MACs and neighbors corresponding to this EVPN.
  */
@@ -907,11 +1003,11 @@ void zebra_evpn_read_mac_neigh(struct zebra_evpn *zevpn, struct interface *ifp)
        struct zebra_vrf *zvrf;
        struct zebra_if *zif;
        struct interface *vlan_if;
-       struct zebra_l2info_vxlan *vxl;
+       struct zebra_vxlan_vni *vni;
        struct interface *vrr_if;
 
        zif = ifp->info;
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
        zvrf = zebra_vrf_lookup_by_id(zevpn->vrf_id);
        if (!zvrf || !zvrf->zns)
                return;
@@ -923,8 +1019,13 @@ void zebra_evpn_read_mac_neigh(struct zebra_evpn *zevpn, struct interface *ifp)
                        ifp->name, ifp->ifindex, zevpn->vni,
                        zif->brslave_info.bridge_ifindex);
 
-       macfdb_read_for_bridge(zns, ifp, zif->brslave_info.br_if);
-       vlan_if = zvni_map_to_svi(vxl->access_vlan, zif->brslave_info.br_if);
+       macfdb_read_for_bridge(zns, ifp, zif->brslave_info.br_if,
+                              vni->access_vlan);
+       /* We need to specifically read and retrieve the entry for BUM handling
+        * via multicast, if any.
+        */
+       macfdb_read_mcast_entry_for_vni(zns, ifp, zevpn->vni);
+       vlan_if = zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
        if (vlan_if) {
                /* Add SVI MAC */
                zebra_evpn_acc_bd_svi_mac_add(vlan_if);
@@ -1497,7 +1598,7 @@ void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr,
        struct interface *ifp = NULL;
        struct zebra_if *zif = NULL;
        struct zebra_ns *zns;
-       struct zebra_l2info_vxlan *vxl;
+       struct zebra_vxlan_vni *vnip;
        struct zebra_vrf *zvrf;
        char buf1[INET6_ADDRSTRLEN];
 
@@ -1520,7 +1621,14 @@ void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr,
                return;
        }
        zns = zebra_ns_lookup(NS_DEFAULT);
-       vxl = &zif->l2info.vxl;
+       vnip = zebra_vxlan_if_vni_find(zif, vni);
+       if (!vnip) {
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "VNI %u not in interface upon remote MACIP DEL",
+                               vni);
+               return;
+       }
 
        mac = zebra_evpn_mac_lookup(zevpn, macaddr);
        if (ipa_len)
@@ -1575,7 +1683,7 @@ void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr,
                                        "%s: MAC %pEA (flags 0x%x) is remote and duplicate, read kernel for local entry",
                                        __func__, macaddr, mac->flags);
                        macfdb_read_specific_mac(zns, zif->brslave_info.br_if,
-                                                macaddr, vxl->access_vlan);
+                                                macaddr, vnip->access_vlan);
                }
 
                if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) {
index 2c84d23045a47eb117cd503bcd68fbefe292a6db..c946425dd52fd0e3be6d4b8aa6d976b53b5d2b8f 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN Data structures and definitions
  * These are "internal" to this function.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
  * Copyright (C) 2020 Volta Networks.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_EVPN_H
@@ -33,6 +17,7 @@
 
 #include "zebra/zebra_l2.h"
 #include "zebra/interface.h"
+#include "zebra/zebra_vxlan.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -83,6 +68,10 @@ struct zebra_evpn {
        uint32_t flags;
 #define ZEVPN_READY_FOR_BGP (1 << 0) /* ready to be sent to BGP */
 
+       /* Corresponding Bridge information */
+       vlanid_t vid;
+       struct interface *bridge_if;
+
        /* Flag for advertising gw macip */
        uint8_t advertise_gw_macip;
 
@@ -138,7 +127,7 @@ static inline struct interface *zevpn_map_to_svi(struct zebra_evpn *zevpn)
 {
        struct interface *ifp;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan zl2_info;
+       struct zebra_vxlan_vni *vni;
 
        ifp = zevpn->vxlan_if;
        if (!ifp)
@@ -146,12 +135,15 @@ static inline struct interface *zevpn_map_to_svi(struct zebra_evpn *zevpn)
        zif = ifp->info;
        if (!zif)
                return NULL;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return NULL;
 
        /* If down or not mapped to a bridge, we're done. */
        if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                return NULL;
-       zl2_info = zif->l2info.vxl;
-       return zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
+
+       return zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
 }
 
 int advertise_gw_macip_enabled(struct zebra_evpn *zevpn);
@@ -181,7 +173,8 @@ struct zebra_evpn *zebra_evpn_from_svi(struct interface *ifp,
                                       struct interface *br_if);
 struct interface *zebra_evpn_map_to_macvlan(struct interface *br_if,
                                            struct interface *svi_if);
-void zebra_evpn_install_mac_hash(struct hash_bucket *bucket, void *ctxt);
+void zebra_evpn_rem_mac_install_all(struct zebra_evpn *zevpn);
+void zebra_evpn_rem_mac_uninstall_all(struct zebra_evpn *zevpn);
 void zebra_evpn_read_mac_neigh(struct zebra_evpn *zevpn, struct interface *ifp);
 unsigned int zebra_evpn_hash_keymake(const void *p);
 bool zebra_evpn_hash_cmp(const void *p1, const void *p2);
index 2c953eef15db361ce46091d91eee9a0008123e9a..a2d310a10b2c3bf42a46d22abb544ce736eb8159 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN for VxLAN code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -36,6 +20,8 @@
 #include "zebra/zebra_router.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_vrf.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mh.h"
 #include "zebra/zebra_evpn_mac.h"
@@ -198,7 +184,7 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac,
                               bool was_static)
 {
        const struct zebra_if *zif, *br_zif;
-       const struct zebra_l2info_vxlan *vxl;
+       const struct zebra_vxlan_vni *vni;
        bool sticky;
        enum zebra_dplane_result res;
        const struct interface *br_ifp;
@@ -214,7 +200,9 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac,
        if (br_ifp == NULL)
                return -1;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return -1;
 
        sticky = !!CHECK_FLAG(mac->flags,
                              (ZEBRA_MAC_STICKY | ZEBRA_MAC_REMOTE_DEF_GW));
@@ -235,12 +223,12 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac,
        br_zif = (const struct zebra_if *)(br_ifp->info);
 
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif))
-               vid = vxl->access_vlan;
+               vid = vni->access_vlan;
        else
                vid = 0;
 
        res = dplane_rem_mac_add(zevpn->vxlan_if, br_ifp, vid, &mac->macaddr,
-                                vtep_ip, sticky, nhg_id, was_static);
+                                vni->vni, vtep_ip, sticky, nhg_id, was_static);
        if (res != ZEBRA_DPLANE_REQUEST_FAILURE)
                return 0;
        else
@@ -254,7 +242,7 @@ int zebra_evpn_rem_mac_uninstall(struct zebra_evpn *zevpn,
                                 struct zebra_mac *mac, bool force)
 {
        const struct zebra_if *zif, *br_zif;
-       const struct zebra_l2info_vxlan *vxl;
+       struct zebra_vxlan_vni *vni;
        struct in_addr vtep_ip;
        const struct interface *ifp, *br_ifp;
        vlanid_t vid;
@@ -280,19 +268,22 @@ int zebra_evpn_rem_mac_uninstall(struct zebra_evpn *zevpn,
        if (br_ifp == NULL)
                return -1;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return -1;
 
        br_zif = (const struct zebra_if *)br_ifp->info;
 
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif))
-               vid = vxl->access_vlan;
+               vid = vni->access_vlan;
        else
                vid = 0;
 
        ifp = zevpn->vxlan_if;
        vtep_ip = mac->fwd_info.r_vtep_ip;
 
-       res = dplane_rem_mac_del(ifp, br_ifp, vid, &mac->macaddr, vtep_ip);
+       res = dplane_rem_mac_del(ifp, br_ifp, vid, &mac->macaddr, vni->vni,
+                                vtep_ip);
        if (res != ZEBRA_DPLANE_REQUEST_FAILURE)
                return 0;
        else
@@ -327,6 +318,8 @@ static void zebra_evpn_mac_get_access_info(struct zebra_mac *mac,
                                           struct interface **p_ifp,
                                           vlanid_t *vid)
 {
+       struct zebra_vxlan_vni *vni;
+
        /* if the mac is associated with an ES we must get the access
         * info from the ES
         */
@@ -338,7 +331,8 @@ static void zebra_evpn_mac_get_access_info(struct zebra_mac *mac,
                /* get the vlan from the EVPN */
                if (mac->zevpn->vxlan_if) {
                        zif = mac->zevpn->vxlan_if->info;
-                       *vid = zif->l2info.vxl.access_vlan;
+                       vni = zebra_vxlan_if_vni_find(zif, mac->zevpn->vni);
+                       *vid = vni->access_vlan;
                } else {
                        *vid = 0;
                }
index 9b4ea2b79ee83a4cc5161f6d86ce327aacd5a854..befb1c398d43613140e638edf6d0361495e8fd56 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN MAC Data structures and definitions
  * These are "internal" to this function.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
  * Copyright (C) 2020 Volta Networks.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_EVPN_MAC_H
index 01ea9c5b9c924d4af15dba0bd64f9247ad3cf2e6..334dde3b101230d4243435e8e8c95ed205d8c8fd 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN multihoming code
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Anuradha Karuppiah
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
  */
 
 #include <zebra.h>
 #include "zebra/if_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mac.h"
-#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_router.h"
 #include "zebra/zebra_evpn_mh.h"
 #include "zebra/zebra_nhg.h"
@@ -481,6 +471,7 @@ void zebra_evpn_update_all_es(struct zebra_evpn *zevpn)
        struct interface *vlan_if;
        struct interface *vxlan_if;
        struct zebra_if *vxlan_zif;
+       struct zebra_vxlan_vni *vni;
 
        /* the EVPN is now elgible as a base for EVPN-MH */
        if (zebra_evpn_send_to_client_ok(zevpn))
@@ -497,11 +488,15 @@ void zebra_evpn_update_all_es(struct zebra_evpn *zevpn)
                vxlan_zif = vxlan_if->info;
                if (if_is_operative(vxlan_if)
                    && vxlan_zif->brslave_info.br_if) {
-                       vlan_if = zvni_map_to_svi(
-                               vxlan_zif->l2info.vxl.access_vlan,
-                               vxlan_zif->brslave_info.br_if);
-                       if (vlan_if)
-                               zebra_evpn_acc_bd_svi_mac_add(vlan_if);
+                       vni = zebra_vxlan_if_vni_find(vxlan_zif, zevpn->vni);
+                       /* VLAN-VNI mappings may not exist */
+                       if (vni) {
+                               vlan_if = zvni_map_to_svi(
+                                       vni->access_vlan,
+                                       vxlan_zif->brslave_info.br_if);
+                               if (vlan_if)
+                                       zebra_evpn_acc_bd_svi_mac_add(vlan_if);
+                       }
                }
        }
 }
@@ -520,7 +515,7 @@ static unsigned int zebra_evpn_acc_vl_hash_keymake(const void *p)
 {
        const struct zebra_evpn_access_bd *acc_bd = p;
 
-       return jhash_1word(acc_bd->vid, 0);
+       return jhash_2words(acc_bd->vid, acc_bd->bridge_ifindex, 0);
 }
 
 /* Compare two VLAN based broadcast domains */
@@ -535,16 +530,19 @@ static bool zebra_evpn_acc_vl_cmp(const void *p1, const void *p2)
        if (acc_bd1 == NULL || acc_bd2 == NULL)
                return false;
 
-       return (acc_bd1->vid == acc_bd2->vid);
+       return ((acc_bd1->vid == acc_bd2->vid) &&
+               (acc_bd1->bridge_ifindex == acc_bd2->bridge_ifindex));
 }
 
 /* Lookup VLAN based broadcast domain */
-static struct zebra_evpn_access_bd *zebra_evpn_acc_vl_find(vlanid_t vid)
+struct zebra_evpn_access_bd *zebra_evpn_acc_vl_find(vlanid_t vid,
+                                                   struct interface *br_if)
 {
        struct zebra_evpn_access_bd *acc_bd;
        struct zebra_evpn_access_bd tmp;
 
        tmp.vid = vid;
+       tmp.bridge_ifindex = br_if->ifindex;
        acc_bd = hash_lookup(zmh_info->evpn_vlan_table, &tmp);
 
        return acc_bd;
@@ -560,11 +558,13 @@ zebra_evpn_acc_vl_new(vlanid_t vid, struct interface *br_if)
        struct interface *vlan_if;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d add", vid);
+               zlog_debug("access vlan %d bridge %s add", vid, br_if->name);
 
        acc_bd = XCALLOC(MTYPE_ZACC_BD, sizeof(struct zebra_evpn_access_bd));
 
        acc_bd->vid = vid;
+       acc_bd->bridge_ifindex = br_if->ifindex;
+       acc_bd->bridge_zif = (struct zebra_if *)br_if->info;
 
        /* Initialize the mbr list */
        acc_bd->mbr_zifs = list_new();
@@ -573,14 +573,12 @@ zebra_evpn_acc_vl_new(vlanid_t vid, struct interface *br_if)
        (void)hash_get(zmh_info->evpn_vlan_table, acc_bd, hash_alloc_intern);
 
        /* check if an svi exists for the vlan */
-       if (br_if) {
-               vlan_if = zvni_map_to_svi(vid, br_if);
-               if (vlan_if) {
-                       if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-                               zlog_debug("vlan %d SVI %s set", vid,
-                                          vlan_if->name);
-                       acc_bd->vlan_zif = vlan_if->info;
-               }
+       vlan_if = zvni_map_to_svi(vid, br_if);
+       if (vlan_if) {
+               if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
+                       zlog_debug("vlan %d bridge %s SVI %s set", vid,
+                                  br_if->name, vlan_if->name);
+               acc_bd->vlan_zif = vlan_if->info;
        }
        return acc_bd;
 }
@@ -621,16 +619,32 @@ static void zebra_evpn_acc_bd_free_on_deref(struct zebra_evpn_access_bd *acc_bd)
        if (!list_isempty(acc_bd->mbr_zifs) || acc_bd->vxlan_zif)
                return;
 
+       /* Remove this access_bd from bridge hash table */
+       zebra_l2_bridge_if_vlan_access_bd_deref(acc_bd);
+
        /* if there are no references free the EVI */
        zebra_evpn_acc_vl_free(acc_bd);
 }
 
+static struct zebra_evpn_access_bd *
+zebra_evpn_acc_bd_alloc_on_ref(vlanid_t vid, struct interface *br_if)
+{
+       struct zebra_evpn_access_bd *acc_bd = NULL;
+
+       assert(br_if && br_if->info);
+       acc_bd = zebra_evpn_acc_vl_new(vid, br_if);
+       if (acc_bd)
+               /* Add this access_bd to bridge hash table */
+               zebra_l2_bridge_if_vlan_access_bd_ref(acc_bd);
+
+       return acc_bd;
+}
+
 /* called when a SVI is goes up/down */
 void zebra_evpn_acc_bd_svi_set(struct zebra_if *vlan_zif,
                               struct zebra_if *br_zif, bool is_up)
 {
        struct zebra_evpn_access_bd *acc_bd;
-       struct zebra_l2info_bridge *br;
        uint16_t vid;
        struct zebra_if *tmp_br_zif = br_zif;
 
@@ -641,20 +655,19 @@ void zebra_evpn_acc_bd_svi_set(struct zebra_if *vlan_zif,
                tmp_br_zif = vlan_zif->link->info;
        }
 
-       br = &tmp_br_zif->l2info.br;
        /* ignore vlan unaware bridges */
-       if (!br->vlan_aware)
+       if (!IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(tmp_br_zif))
                return;
 
        vid = vlan_zif->l2info.vl.vid;
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       acc_bd = zebra_evpn_acc_vl_find(vid, tmp_br_zif->ifp);
        if (!acc_bd)
                return;
 
        if (is_up) {
                if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-                       zlog_debug("vlan %d SVI %s set", vid,
-                                  vlan_zif->ifp->name);
+                       zlog_debug("vlan %d bridge %s SVI %s set", vid,
+                                  tmp_br_zif->ifp->name, vlan_zif->ifp->name);
 
                acc_bd->vlan_zif = vlan_zif;
                if (acc_bd->zevpn)
@@ -662,7 +675,8 @@ void zebra_evpn_acc_bd_svi_set(struct zebra_if *vlan_zif,
                                               acc_bd->zevpn);
        } else if (acc_bd->vlan_zif) {
                if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-                       zlog_debug("vlan %d SVI clear", vid);
+                       zlog_debug("vlan %d bridge %s SVI clear", vid,
+                                  tmp_br_zif->ifp->name);
                acc_bd->vlan_zif = NULL;
                if (acc_bd->zevpn && acc_bd->zevpn->mac_table)
                        zebra_evpn_mac_svi_del(vlan_zif->ifp, acc_bd->zevpn);
@@ -687,8 +701,9 @@ static void zebra_evpn_acc_bd_evpn_set(struct zebra_evpn_access_bd *acc_bd,
        struct listnode *node;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d l2-vni %u set",
-                               acc_bd->vid, zevpn ? zevpn->vni : 0);
+               zlog_debug("access vlan %d bridge %s l2-vni %u set",
+                          acc_bd->vid, acc_bd->bridge_zif->ifp->name,
+                          zevpn ? zevpn->vni : 0);
 
        for (ALL_LIST_ELEMENTS_RO(acc_bd->mbr_zifs, node, zif)) {
                if (!zif->es_info.es)
@@ -711,33 +726,44 @@ static void zebra_evpn_acc_bd_evpn_set(struct zebra_evpn_access_bd *acc_bd,
 }
 
 /* handle VLAN->VxLAN_IF association */
-void zebra_evpn_vl_vxl_ref(uint16_t vid, struct zebra_if *vxlan_zif)
+void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
+                          struct zebra_if *vxlan_zif)
 {
+       vni_t old_vni;
        struct zebra_evpn_access_bd *acc_bd;
-       struct zebra_if *old_vxlan_zif;
        struct zebra_evpn *old_zevpn;
+       struct interface *br_if;
 
        if (!vid)
                return;
 
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       if (!vni_id)
+               return;
+
+       br_if = vxlan_zif->brslave_info.br_if;
+
+       if (!br_if)
+               return;
+
+       acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
        if (!acc_bd)
-               acc_bd = zebra_evpn_acc_vl_new(vid,
-                                              vxlan_zif->brslave_info.br_if);
+               acc_bd = zebra_evpn_acc_bd_alloc_on_ref(vid, br_if);
 
-       old_vxlan_zif = acc_bd->vxlan_zif;
-       acc_bd->vxlan_zif = vxlan_zif;
-       if (vxlan_zif == old_vxlan_zif)
+       old_vni = acc_bd->vni;
+
+       if (vni_id == old_vni)
                return;
 
+       acc_bd->vni = vni_id;
+       acc_bd->vxlan_zif = vxlan_zif;
+
        old_zevpn = acc_bd->zevpn;
-       acc_bd->zevpn = zebra_evpn_lookup(vxlan_zif->l2info.vxl.vni);
+       acc_bd->zevpn = zebra_evpn_lookup(vni_id);
        if (acc_bd->zevpn == old_zevpn)
                return;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d vni %u ref",
-                               acc_bd->vid, vxlan_zif->l2info.vxl.vni);
+               zlog_debug("access vlan %d vni %u ref", acc_bd->vid, vni_id);
 
        if (old_zevpn)
                zebra_evpn_acc_bd_evpn_set(acc_bd, NULL, old_zevpn);
@@ -747,30 +773,66 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, struct zebra_if *vxlan_zif)
 }
 
 /* handle VLAN->VxLAN_IF deref */
-void zebra_evpn_vl_vxl_deref(uint16_t vid, struct zebra_if *vxlan_zif)
+void zebra_evpn_vl_vxl_deref(uint16_t vid, vni_t vni_id,
+                            struct zebra_if *vxlan_zif)
 {
+       struct interface *br_if;
        struct zebra_evpn_access_bd *acc_bd;
 
        if (!vid)
                return;
 
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       if (!vni_id)
+               return;
+
+       br_if = vxlan_zif->brslave_info.br_if;
+       if (!br_if)
+               return;
+
+       acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
        if (!acc_bd)
                return;
 
        /* clear vxlan_if only if it matches */
-       if (acc_bd->vxlan_zif != vxlan_zif)
+       if (acc_bd->vni != vni_id)
                return;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d vni %u deref",
-                               acc_bd->vid, vxlan_zif->l2info.vxl.vni);
+               zlog_debug("access vlan %d bridge %s vni %u deref", acc_bd->vid,
+                          br_if->name, vni_id);
 
        if (acc_bd->zevpn)
                zebra_evpn_acc_bd_evpn_set(acc_bd, NULL, acc_bd->zevpn);
 
        acc_bd->zevpn = NULL;
        acc_bd->vxlan_zif = NULL;
+       acc_bd->vni = 0;
+
+       /* if there are no other references the access_bd can be freed */
+       zebra_evpn_acc_bd_free_on_deref(acc_bd);
+}
+
+/* handle BridgeIf<->AccessBD cleanup */
+void zebra_evpn_access_bd_bridge_cleanup(vlanid_t vid, struct interface *br_if,
+                                        struct zebra_evpn_access_bd *acc_bd)
+{
+       struct zebra_evpn *zevpn;
+
+       if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
+               zlog_debug("access bd vlan %d bridge %s cleanup", acc_bd->vid,
+                          br_if->name);
+
+       zevpn = acc_bd->zevpn;
+       if (zevpn)
+               zebra_evpn_acc_bd_evpn_set(acc_bd, NULL, zevpn);
+
+       /* cleanup resources maintained against the ES */
+       list_delete_all_node(acc_bd->mbr_zifs);
+
+       acc_bd->zevpn = NULL;
+       acc_bd->vxlan_zif = NULL;
+       acc_bd->vni = 0;
+       acc_bd->bridge_zif = NULL;
 
        /* if there are no other references the access_bd can be freed */
        zebra_evpn_acc_bd_free_on_deref(acc_bd);
@@ -780,15 +842,23 @@ void zebra_evpn_vl_vxl_deref(uint16_t vid, struct zebra_if *vxlan_zif)
 void zebra_evpn_vxl_evpn_set(struct zebra_if *zif, struct zebra_evpn *zevpn,
                             bool set)
 {
-       struct zebra_l2info_vxlan *vxl;
+       struct interface *br_if;
+       struct zebra_vxlan_vni *vni;
        struct zebra_evpn_access_bd *acc_bd;
 
        if (!zif)
                return;
 
        /* locate access_bd associated with the vxlan device */
-       vxl = &zif->l2info.vxl;
-       acc_bd = zebra_evpn_acc_vl_find(vxl->access_vlan);
+       vni = zebra_vxlan_if_vni_find(zif, zevpn->vni);
+       if (!vni)
+               return;
+
+       br_if = zif->brslave_info.br_if;
+       if (!br_if)
+               return;
+
+       acc_bd = zebra_evpn_acc_vl_find(vni->access_vlan, br_if);
        if (!acc_bd)
                return;
 
@@ -810,21 +880,26 @@ void zebra_evpn_vxl_evpn_set(struct zebra_if *zif, struct zebra_evpn *zevpn,
 /* handle addition of new VLAN members */
 void zebra_evpn_vl_mbr_ref(uint16_t vid, struct zebra_if *zif)
 {
+       struct interface *br_if;
        struct zebra_evpn_access_bd *acc_bd;
 
        if (!vid)
                return;
 
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       br_if = zif->brslave_info.br_if;
+       if (!br_if)
+               return;
+
+       acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
        if (!acc_bd)
-               acc_bd = zebra_evpn_acc_vl_new(vid, zif->brslave_info.br_if);
+               acc_bd = zebra_evpn_acc_bd_alloc_on_ref(vid, br_if);
 
        if (listnode_lookup(acc_bd->mbr_zifs, zif))
                return;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d mbr %s ref",
-                               vid, zif->ifp->name);
+               zlog_debug("access vlan %d bridge %s mbr %s ref", vid,
+                          br_if->name, zif->ifp->name);
 
        listnode_add(acc_bd->mbr_zifs, zif);
        if (acc_bd->zevpn && zif->es_info.es)
@@ -834,13 +909,18 @@ void zebra_evpn_vl_mbr_ref(uint16_t vid, struct zebra_if *zif)
 /* handle deletion of VLAN members */
 void zebra_evpn_vl_mbr_deref(uint16_t vid, struct zebra_if *zif)
 {
+       struct interface *br_if;
        struct zebra_evpn_access_bd *acc_bd;
        struct listnode *node;
 
        if (!vid)
                return;
 
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       br_if = zif->brslave_info.br_if;
+       if (!br_if)
+               return;
+
+       acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
        if (!acc_bd)
                return;
 
@@ -849,8 +929,8 @@ void zebra_evpn_vl_mbr_deref(uint16_t vid, struct zebra_if *zif)
                return;
 
        if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
-               zlog_debug("access vlan %d mbr %s deref",
-                               vid, zif->ifp->name);
+               zlog_debug("access vlan %d bridge %s mbr %s deref", vid,
+                          br_if->name, zif->ifp->name);
 
        list_delete_node(acc_bd->mbr_zifs, node);
 
@@ -917,14 +997,19 @@ static void zebra_evpn_acc_vl_show_entry_detail(struct vty *vty,
        if (json) {
                zebra_evpn_acc_vl_json_fill(acc_bd, json, true);
        } else {
-               vty_out(vty, "VLAN: %u\n", acc_bd->vid);
+               vty_out(vty, "VLAN: %s.%u\n", acc_bd->bridge_zif->ifp->name,
+                       acc_bd->vid);
                vty_out(vty, " VxLAN Interface: %s\n",
                                acc_bd->vxlan_zif ?
                                acc_bd->vxlan_zif->ifp->name : "-");
                vty_out(vty, " SVI: %s\n",
                        acc_bd->vlan_zif ? acc_bd->vlan_zif->ifp->name : "-");
-               vty_out(vty, " L2-VNI: %d\n",
-                               acc_bd->zevpn ? acc_bd->zevpn->vni : 0);
+               if (acc_bd->zevpn)
+                       vty_out(vty, " L2-VNI: %d\n", acc_bd->zevpn->vni);
+               else {
+                       vty_out(vty, " L2-VNI: 0\n");
+                       vty_out(vty, " L3-VNI: %d\n", acc_bd->vni);
+               }
                vty_out(vty, " Member Count: %d\n",
                                listcount(acc_bd->mbr_zifs));
                vty_out(vty, " Members: \n");
@@ -940,7 +1025,8 @@ static void zebra_evpn_acc_vl_show_entry(struct vty *vty,
        if (json) {
                zebra_evpn_acc_vl_json_fill(acc_bd, json, false);
        } else {
-               vty_out(vty, "%-5u %-15s %-8d %-15s %u\n", acc_bd->vid,
+               vty_out(vty, "%-5s.%-5u %-15s %-8d %-15s %u\n",
+                       acc_bd->bridge_zif->ifp->name, acc_bd->vid,
                        acc_bd->vlan_zif ? acc_bd->vlan_zif->ifp->name : "-",
                        acc_bd->zevpn ? acc_bd->zevpn->vni : 0,
                        acc_bd->vxlan_zif ? acc_bd->vxlan_zif->ifp->name : "-",
@@ -978,7 +1064,7 @@ void zebra_evpn_acc_vl_show(struct vty *vty, bool uj)
        wctx.detail = false;
 
        if (!uj)
-               vty_out(vty, "%-5s %-15s %-8s %-15s %s\n", "VLAN", "SVI",
+               vty_out(vty, "%-12s %-15s %-8s %-15s %s\n", "VLAN", "SVI",
                        "L2-VNI", "VXLAN-IF", "# Members");
 
        hash_iterate(zmh_info->evpn_vlan_table, zebra_evpn_acc_vl_show_hash,
@@ -1007,7 +1093,8 @@ void zebra_evpn_acc_vl_show_detail(struct vty *vty, bool uj)
                vty_json(vty, json_array);
 }
 
-void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid)
+void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid,
+                               struct interface *br_if)
 {
        json_object *json = NULL;
        struct zebra_evpn_access_bd *acc_bd;
@@ -1015,12 +1102,13 @@ void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid)
        if (uj)
                json = json_object_new_object();
 
-       acc_bd = zebra_evpn_acc_vl_find(vid);
+       acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
        if (acc_bd) {
                zebra_evpn_acc_vl_show_entry_detail(vty, acc_bd, json);
        } else {
                if (!json)
-                       vty_out(vty, "VLAN %u not present\n", vid);
+                       vty_out(vty, "VLAN %s.%u not present\n", br_if->name,
+                               vid);
        }
 
        if (uj)
@@ -1977,7 +2065,7 @@ static void zebra_evpn_es_setup_evis(struct zebra_evpn_es *es)
                return;
 
        bf_for_each_set_bit(zif->vlan_bitmap, vid, IF_VLAN_BITMAP_MAX) {
-               acc_bd = zebra_evpn_acc_vl_find(vid);
+               acc_bd = zebra_evpn_acc_vl_find(vid, zif->brslave_info.br_if);
                if (acc_bd->zevpn)
                        zebra_evpn_local_es_evi_add(es, acc_bd->zevpn);
        }
@@ -1986,9 +2074,10 @@ static void zebra_evpn_es_setup_evis(struct zebra_evpn_es *es)
 static void zebra_evpn_flush_local_mac(struct zebra_mac *mac,
                                       struct interface *ifp)
 {
+       vlanid_t vid;
        struct zebra_if *zif;
        struct interface *br_ifp;
-       vlanid_t vid;
+       struct zebra_vxlan_vni *vni;
 
        zif = ifp->info;
        br_ifp = zif->brslave_info.br_if;
@@ -1997,7 +2086,8 @@ static void zebra_evpn_flush_local_mac(struct zebra_mac *mac,
 
        if (mac->zevpn->vxlan_if) {
                zif = mac->zevpn->vxlan_if->info;
-               vid = zif->l2info.vxl.access_vlan;
+               vni = zebra_vxlan_if_vni_find(zif, mac->zevpn->vni);
+               vid = vni->access_vlan;
        } else {
                vid = 0;
        }
index 037648311c824fc87df80b0e060a61574dc558e8..89a917628d2e4d30646a0c250fcad40b1d4f8075 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN MH Data structures and definitions
  *
  * Copyright (C) 2019 Cumulus Networks, Inc.
  * Anuradha Karuppiah
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
  */
 
 #ifndef _ZEBRA_EVPN_MH_H
@@ -179,6 +168,10 @@ struct zebra_evpn_es_vtep {
 struct zebra_evpn_access_bd {
        vlanid_t vid;
 
+       ifindex_t bridge_ifindex;
+       struct zebra_if *bridge_zif; /* associated bridge */
+
+       vni_t vni;                  /* vni associated with the vxlan device */
        struct zebra_if *vxlan_zif; /* vxlan device */
        /* list of members associated with the BD i.e. (potential) ESs */
        struct list *mbr_zifs;
@@ -319,8 +312,10 @@ extern void zebra_evpn_vxl_evpn_set(struct zebra_if *zif,
                                    struct zebra_evpn *zevpn, bool set);
 extern void zebra_evpn_es_set_base_evpn(struct zebra_evpn *zevpn);
 extern void zebra_evpn_es_clear_base_evpn(struct zebra_evpn *zevpn);
-extern void zebra_evpn_vl_vxl_ref(uint16_t vid, struct zebra_if *vxlan_zif);
-extern void zebra_evpn_vl_vxl_deref(uint16_t vid, struct zebra_if *vxlan_zif);
+extern void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
+                                 struct zebra_if *vxlan_zif);
+extern void zebra_evpn_vl_vxl_deref(uint16_t vid, vni_t vni_id,
+                                   struct zebra_if *vxlan_zif);
 extern void zebra_evpn_vl_mbr_ref(uint16_t vid, struct zebra_if *zif);
 extern void zebra_evpn_vl_mbr_deref(uint16_t vid, struct zebra_if *zif);
 extern void zebra_evpn_es_send_all_to_client(bool add);
@@ -345,9 +340,12 @@ extern void zebra_evpn_interface_init(void);
 extern int zebra_evpn_mh_if_write(struct vty *vty, struct interface *ifp);
 extern void zebra_evpn_acc_vl_show(struct vty *vty, bool uj);
 extern void zebra_evpn_acc_vl_show_detail(struct vty *vty, bool uj);
-extern void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid);
 extern void zebra_evpn_if_es_print(struct vty *vty, json_object *json,
                                   struct zebra_if *zif);
+extern struct zebra_evpn_access_bd *
+zebra_evpn_acc_vl_find(vlanid_t vid, struct interface *br_if);
+extern void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid,
+                                      struct interface *br_if);
 extern void zebra_evpn_es_cleanup(void);
 extern int zebra_evpn_mh_mac_holdtime_update(struct vty *vty,
                uint32_t duration, bool set_default);
@@ -373,6 +371,9 @@ extern void zebra_evpn_l2_nh_show(struct vty *vty, bool uj);
 extern void zebra_evpn_acc_bd_svi_set(struct zebra_if *vlan_zif,
                                      struct zebra_if *br_zif, bool is_up);
 extern void zebra_evpn_acc_bd_svi_mac_add(struct interface *vlan_if);
+extern void
+zebra_evpn_access_bd_bridge_cleanup(vlanid_t vid, struct interface *br_if,
+                                   struct zebra_evpn_access_bd *acc_bd);
 extern void zebra_evpn_es_bypass_update(struct zebra_evpn_es *es,
                                        struct interface *ifp, bool bypass);
 extern void zebra_evpn_proc_remote_nh(ZAPI_HANDLER_ARGS);
index 684720bb4d785632da6c00628974f3588ea25013..acd60aa08f619ed97ccfed87d2114b135381f141 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN Neighbor code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -36,6 +20,8 @@
 #include "zebra/rt.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_vrf.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mh.h"
 #include "zebra/zebra_evpn_neigh.h"
index 9271817440823c6cb81a6d5f4345d0ee8353a466..18ef8546de31d5afd4ee560aade2fec9d802d124 100644 (file)
@@ -1,25 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN Neighbor Data structures and definitions
  * These are "internal" to this function.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
  * Copyright (C) 2020 Volta Networks.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_EVPN_NEIGH_H
@@ -63,6 +47,9 @@ struct zebra_neigh {
 
        struct zebra_evpn *zevpn;
 
+       /* Refcnt - Only used by SVD neighs currently */
+       uint32_t refcnt;
+
        uint32_t flags;
 #define ZEBRA_NEIGH_LOCAL 0x01
 #define ZEBRA_NEIGH_REMOTE 0x02
index 3884a1e7ea17d31f3e46f6f484685d79229eaacd..80b87f91cee9ca25e13d6902a9f956640df0f431 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN for VxLAN code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 /* Get the VRR interface for SVI if any */
@@ -69,3 +53,33 @@ static inline void zevpn_vxlan_if_set(struct zebra_evpn *zevpn,
 
        zebra_evpn_vxl_evpn_set(zif, zevpn, set);
 }
+
+/* EVPN<=>Bridge interface association */
+static inline void zevpn_bridge_if_set(struct zebra_evpn *zevpn,
+                                      struct interface *ifp, bool set)
+{
+       if (set) {
+               if (zevpn->bridge_if == ifp)
+                       return;
+               zevpn->bridge_if = ifp;
+       } else {
+               if (!zevpn->bridge_if)
+                       return;
+               zevpn->bridge_if = NULL;
+       }
+}
+
+/* EVPN<=>Bridge interface association */
+static inline void zl3vni_bridge_if_set(struct zebra_l3vni *zl3vni,
+                                       struct interface *ifp, bool set)
+{
+       if (set) {
+               if (zl3vni->bridge_if == ifp)
+                       return;
+               zl3vni->bridge_if = ifp;
+       } else {
+               if (!zl3vni->bridge_if)
+                       return;
+               zl3vni->bridge_if = NULL;
+       }
+}
index f9f4ee476df553d6502acb7c59679b813ca2b403..15765b5e185741a1c3a4b8a2378fe4a7495f1a25 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Main implementation file for interface to Forwarding Plane Manager.
  *
  * Copyright (C) 2012 by Open Source Routing.
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -902,7 +887,7 @@ static inline int zfpm_encode_route(rib_dest_t *dest, struct route_entry *re,
 #endif /* HAVE_NETLINK */
                break;
 
-       default:
+       case ZFPM_MSG_FORMAT_NONE:
                break;
        }
 
index e39272203032dfd77ec3735c8e414aa2ea060990..94308a961b071242875e2bac4d1ea54deefbebc2 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * zebra_fpm_dt.c
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 06c45578a6bf31d88cf2fe1e09fbd26b456df5d1..5adca14d717171b053f1f92733af0e9205e71b4e 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Code for encoding/decoding FPM messages that are in netlink format.
  *
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
  * Copyright (C) 2012 by Open Source Routing.
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -315,7 +300,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
                                ri->rtm_type = RTN_UNREACHABLE;
                                break;
                        case BLACKHOLE_NULL:
-                       default:
+                       case BLACKHOLE_UNSPEC:
                                ri->rtm_type = RTN_BLACKHOLE;
                                break;
                        }
index 13415c7e1d9bd3e56df3a3fe4eda40dfac8f7cd6..e55efc6118b7d26d51151f07e3d58b16d162b168 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Private header file for the zebra FPM module.
  *
  * Copyright (C) 2012 by Open Source Routing.
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_FPM_PRIVATE_H
index 4b31cc0281fe5ebc5d76a53d4d68f622bfc4199c..f3c5ca7c3177b1682e30e2a0d4432a029374af21 100644 (file)
@@ -1,25 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * zebra_fpm_protobuf.c
  *
  * @copyright Copyright (C) 2016 Sproute Networks, Inc.
  *
  * @author Avneesh Sachdev <avneesh@sproute.com>
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -186,7 +171,8 @@ static Fpm__AddRoute *create_add_route_message(qpb_allocator_t *allocator,
                                msg->route_type = FPM__ROUTE_TYPE__UNREACHABLE;
                                break;
                        case BLACKHOLE_NULL:
-                       default:
+                       case BLACKHOLE_UNSPEC:
+                       case BLACKHOLE_ADMINPROHIB:
                                msg->route_type = FPM__ROUTE_TYPE__BLACKHOLE;
                                break;
                        }
index d3c104cc8054549027b90a79d7a359e3cc997db5..3bd5b51fbc2ddf1c64b74c65e6fb4b962e94aad1 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra GR related helper functions.
  *
  * Portions:
  *     Copyright (C) 2019 VMware, Inc.
  *     et al.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 8a9f3dffe3668ebf6590a929ab298ee22af81765..2eea772f9f5cfd7ff397ef3c6a5b486d3c3e7ef4 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Layer-2 interface handling code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -42,7 +26,9 @@
 #include "zebra/rt_netlink.h"
 #include "zebra/interface.h"
 #include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
 #include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
 #include "zebra/zebra_evpn_mh.h"
 
 /* definitions */
@@ -262,12 +248,14 @@ void zebra_l2_bridge_add_update(struct interface *ifp,
                                int add)
 {
        struct zebra_if *zif;
+       struct zebra_l2_bridge_if *br;
 
        zif = ifp->info;
        assert(zif);
 
-       /* Copy over the L2 information. */
-       memcpy(&zif->l2info.br, bridge_info, sizeof(*bridge_info));
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       br->vlan_aware = bridge_info->bridge.vlan_aware;
+       zebra_l2_bridge_if_add(ifp);
 
        /* Link all slaves to this bridge */
        map_slaves_to_bridge(ifp, 1, false, ZEBRA_BRIDGE_NO_ACTION);
@@ -278,6 +266,8 @@ void zebra_l2_bridge_add_update(struct interface *ifp,
  */
 void zebra_l2_bridge_del(struct interface *ifp)
 {
+       zebra_l2_bridge_if_del(ifp);
+
        /* Unlink all slaves to this bridge */
        map_slaves_to_bridge(ifp, 0, false, ZEBRA_BRIDGE_NO_ACTION);
 }
@@ -341,34 +331,40 @@ void zebra_l2_vxlanif_add_update(struct interface *ifp,
                                 struct zebra_l2info_vxlan *vxlan_info, int add)
 {
        struct zebra_if *zif;
-       struct in_addr old_vtep_ip;
        uint16_t chgflags = 0;
+       struct zebra_vxlan_if_update_ctx ctx;
 
        zif = ifp->info;
        assert(zif);
 
        if (add) {
                memcpy(&zif->l2info.vxl, vxlan_info, sizeof(*vxlan_info));
-               zebra_evpn_vl_vxl_ref(zif->l2info.vxl.access_vlan, zif);
                zebra_vxlan_if_add(ifp);
                return;
        }
 
-       old_vtep_ip = zif->l2info.vxl.vtep_ip;
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.old_vtep_ip = zif->l2info.vxl.vtep_ip;
 
-       if (!IPV4_ADDR_SAME(&old_vtep_ip, &vxlan_info->vtep_ip)) {
+       if (!IPV4_ADDR_SAME(&ctx.old_vtep_ip, &vxlan_info->vtep_ip)) {
                chgflags |= ZEBRA_VXLIF_LOCAL_IP_CHANGE;
                zif->l2info.vxl.vtep_ip = vxlan_info->vtep_ip;
        }
 
-       if (!IPV4_ADDR_SAME(&zif->l2info.vxl.mcast_grp,
-                               &vxlan_info->mcast_grp)) {
-               chgflags |= ZEBRA_VXLIF_MCAST_GRP_CHANGE;
-               zif->l2info.vxl.mcast_grp = vxlan_info->mcast_grp;
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               ctx.old_vni = vxlan_info->vni_info.vni;
+               if (!IPV4_ADDR_SAME(&zif->l2info.vxl.vni_info.vni.mcast_grp,
+                                   &vxlan_info->vni_info.vni.mcast_grp)) {
+                       chgflags |= ZEBRA_VXLIF_MCAST_GRP_CHANGE;
+                       zif->l2info.vxl.vni_info.vni.mcast_grp =
+                               vxlan_info->vni_info.vni.mcast_grp;
+               }
        }
 
-       if (chgflags)
-               zebra_vxlan_if_update(ifp, chgflags);
+       if (chgflags) {
+               ctx.chgflags = chgflags;
+               zebra_vxlan_if_update(ifp, &ctx);
+       }
 }
 
 /*
@@ -379,19 +375,30 @@ void zebra_l2_vxlanif_update_access_vlan(struct interface *ifp,
 {
        struct zebra_if *zif;
        vlanid_t old_access_vlan;
+       struct zebra_vxlan_vni *vni;
+       struct zebra_vxlan_if_update_ctx ctx;
+
 
        zif = ifp->info;
        assert(zif);
 
-       old_access_vlan = zif->l2info.vxl.access_vlan;
+       /* This would be called only in non svd case */
+       assert(IS_ZEBRA_VXLAN_IF_VNI(zif));
+
+       old_access_vlan = zif->l2info.vxl.vni_info.vni.access_vlan;
+       ;
        if (old_access_vlan == access_vlan)
                return;
 
-       zif->l2info.vxl.access_vlan = access_vlan;
+       memset(&ctx, 0, sizeof(ctx));
+       vni = zebra_vxlan_if_vni_find(zif, 0);
+       ctx.old_vni = *vni;
+       ctx.chgflags = ZEBRA_VXLIF_VLAN_CHANGE;
+       vni->access_vlan = access_vlan;
 
-       zebra_evpn_vl_vxl_deref(old_access_vlan, zif);
-       zebra_evpn_vl_vxl_ref(zif->l2info.vxl.access_vlan, zif);
-       zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_VLAN_CHANGE);
+       zebra_evpn_vl_vxl_deref(old_access_vlan, vni->vni, zif);
+       zebra_evpn_vl_vxl_ref(access_vlan, vni->vni, zif);
+       zebra_vxlan_if_update(ifp, &ctx);
 }
 
 /*
@@ -404,7 +411,6 @@ void zebra_l2_vxlanif_del(struct interface *ifp)
        zif = ifp->info;
        assert(zif);
 
-       zebra_evpn_vl_vxl_deref(zif->l2info.vxl.access_vlan, zif);
        zebra_vxlan_if_del(ifp);
 }
 
@@ -421,6 +427,9 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
        ifindex_t old_bridge_ifindex;
        ns_id_t old_ns_id;
        struct zebra_vrf *zvrf;
+       struct zebra_vxlan_if_update_ctx ctx;
+
+       memset(&ctx, 0, sizeof(ctx));
 
        zif = ifp->info;
        assert(zif);
@@ -431,11 +440,14 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
 
        if (zif->zif_type == ZEBRA_IF_VXLAN
            && chgflags != ZEBRA_BRIDGE_NO_ACTION) {
-               if (chgflags & ZEBRA_BRIDGE_MASTER_MAC_CHANGE)
-                       zebra_vxlan_if_update(ifp,
-                                             ZEBRA_VXLIF_MASTER_MAC_CHANGE);
-               if (chgflags & ZEBRA_BRIDGE_MASTER_UP)
-                       zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+               if (chgflags & ZEBRA_BRIDGE_MASTER_MAC_CHANGE) {
+                       ctx.chgflags = ZEBRA_VXLIF_MASTER_MAC_CHANGE;
+                       zebra_vxlan_if_update(ifp, &ctx);
+               }
+               if (chgflags & ZEBRA_BRIDGE_MASTER_UP) {
+                       ctx.chgflags = ZEBRA_VXLIF_MASTER_CHANGE;
+                       zebra_vxlan_if_update(ifp, &ctx);
+               }
        }
        old_bridge_ifindex = zif->brslave_info.bridge_ifindex;
        old_ns_id = zif->brslave_info.ns_id;
@@ -443,6 +455,9 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
            old_ns_id == zif->brslave_info.ns_id)
                return;
 
+       ctx.chgflags = ZEBRA_VXLIF_MASTER_CHANGE;
+
+
        zif->brslave_info.ns_id = ns_id;
        zif->brslave_info.bridge_ifindex = bridge_ifindex;
        /* Set up or remove link with master */
@@ -450,7 +465,7 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
                zebra_l2_map_slave_to_bridge(&zif->brslave_info, zvrf->zns);
                /* In the case of VxLAN, invoke the handler for EVPN. */
                if (zif->zif_type == ZEBRA_IF_VXLAN)
-                       zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+                       zebra_vxlan_if_update(ifp, &ctx);
                if (zif->es_info.es)
                        zebra_evpn_es_local_br_port_update(zif);
        } else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
@@ -460,7 +475,7 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
                 * to unmapping the interface from the bridge.
                 */
                if (zif->zif_type == ZEBRA_IF_VXLAN)
-                       zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+                       zebra_vxlan_if_update(ifp, &ctx);
                if (zif->es_info.es)
                        zebra_evpn_es_local_br_port_update(zif);
                zebra_l2_unmap_slave_from_bridge(&zif->brslave_info);
index 1c3e98158d4765a6bd80404306ea03e6c628792f..3be002656ac8d5541c2be982611ba04c069e140b 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Layer-2 interface Data structures and definitions
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_L2_H
@@ -49,9 +33,30 @@ struct zebra_l2info_bond {
        struct list *mbr_zifs; /* slaves using this bond as a master */
 };
 
+struct zebra_l2_bridge_vlan {
+       vlanid_t vid;
+       struct zebra_evpn_access_bd *access_bd;
+};
+
+struct zebra_l2_bridge_if_ctx {
+       /* input */
+       struct zebra_if *zif;
+       int (*func)(struct zebra_if *zif, struct zebra_l2_bridge_vlan *vlan,
+                   void *arg);
+
+       /* input-output */
+       void *arg;
+};
+
+struct zebra_l2_bridge_if {
+       uint8_t vlan_aware;
+       struct zebra_if *br_zif;
+       struct hash *vlan_table;
+};
+
 /* zebra L2 interface information - bridge interface */
 struct zebra_l2info_bridge {
-       uint8_t vlan_aware; /* VLAN-aware bridge? */
+       struct zebra_l2_bridge_if bridge;
 };
 
 /* zebra L2 interface information - VLAN interface */
@@ -71,12 +76,52 @@ struct zebra_l2info_gre {
        ns_id_t link_nsid;
 };
 
+struct zebra_vxlan_vni {
+       vni_t vni;            /* VNI */
+       vlanid_t access_vlan; /* Access VLAN - for VLAN-aware bridge. */
+       struct in_addr mcast_grp;
+};
+
+enum {
+       ZEBRA_VXLAN_IF_VNI = 0, /* per vni vxlan if */
+       ZEBRA_VXLAN_IF_SVD      /* single vxlan device */
+};
+
+struct zebra_vxlan_if_vlan_ctx {
+       vlanid_t vid;
+       struct zebra_vxlan_vni *vni;
+};
+
+struct zebra_vxlan_if_update_ctx {
+       uint16_t chgflags;
+       struct in_addr old_vtep_ip;
+       struct zebra_vxlan_vni old_vni;
+       struct hash *old_vni_table;
+};
+
+struct zebra_vxlan_if_ctx {
+       /* input */
+       struct zebra_if *zif;
+       int (*func)(struct zebra_if *zif, struct zebra_vxlan_vni *vni,
+                   void *arg);
+
+       /* input-output */
+       void *arg;
+};
+
+struct zebra_vxlan_vni_info {
+       int iftype;
+       union {
+               struct zebra_vxlan_vni vni; /* per vni vxlan device vni info */
+               struct hash
+                       *vni_table; /* table of vni's assocated with this if */
+       };
+};
+
 /* zebra L2 interface information - VXLAN interface */
 struct zebra_l2info_vxlan {
-       vni_t vni;              /* VNI */
+       struct zebra_vxlan_vni_info vni_info;
        struct in_addr vtep_ip; /* Local tunnel IP */
-       vlanid_t access_vlan;   /* Access VLAN - for VLAN-aware bridge. */
-       struct in_addr mcast_grp;
        ifindex_t ifindex_link; /* Interface index of interface
                                 * linked with VXLAN
                                 */
@@ -99,10 +144,16 @@ union zebra_l2if_info {
  * IOW, the macro VNI_FROM_ZEBRA_IF() will assume the interface is
  * of type ZEBRA_IF_VXLAN.
  */
-#define VNI_FROM_ZEBRA_IF(zif) (zif)->l2info.vxl.vni
+#define VNI_INFO_FROM_ZEBRA_IF(zif) (&((zif)->l2info.vxl.vni_info))
+#define IS_ZEBRA_VXLAN_IF_SVD(zif)                                             \
+       ((zif)->l2info.vxl.vni_info.iftype == ZEBRA_VXLAN_IF_SVD)
+#define IS_ZEBRA_VXLAN_IF_VNI(zif)                                             \
+       ((zif)->l2info.vxl.vni_info.iftype == ZEBRA_VXLAN_IF_VNI)
 #define VLAN_ID_FROM_ZEBRA_IF(zif) (zif)->l2info.vl.vid
 
-#define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) ((zif)->l2info.br.vlan_aware == 1)
+#define BRIDGE_FROM_ZEBRA_IF(zif) (&((zif)->l2info.br.bridge))
+#define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif)                                     \
+       ((zif)->l2info.br.bridge.vlan_aware == 1)
 
 extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave,
                                         struct zebra_ns *zns);
diff --git a/zebra/zebra_l2_bridge_if.c b/zebra/zebra_l2_bridge_if.c
new file mode 100644 (file)
index 0000000..b85d39b
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * Zebra L2 bridge interface handling
+ *
+ * Copyright (C) 2021 Cumulus Networks, Inc.
+ * Sharath Ramamurthy
+ *
+ * This file is part of FRR.
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <zebra.h>
+
+#include "hash.h"
+#include "if.h"
+#include "jhash.h"
+#include "linklist.h"
+#include "log.h"
+#include "memory.h"
+#include "prefix.h"
+#include "stream.h"
+#include "table.h"
+#include "vlan.h"
+#include "vxlan.h"
+#ifdef GNU_LINUX
+#include <linux/neighbour.h>
+#endif
+
+#include "zebra/zebra_router.h"
+#include "zebra/debug.h"
+#include "zebra/interface.h"
+#include "zebra/rib.h"
+#include "zebra/rt.h"
+#include "zebra/rt_netlink.h"
+#include "zebra/zebra_errors.h"
+#include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
+#include "zebra/zebra_ns.h"
+#include "zebra/zebra_vrf.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
+#include "zebra/zebra_evpn.h"
+#include "zebra/zebra_evpn_mac.h"
+#include "zebra/zebra_evpn_neigh.h"
+#include "zebra/zebra_vxlan_private.h"
+#include "zebra/zebra_evpn_mh.h"
+#include "zebra/zebra_evpn_vxlan.h"
+#include "zebra/zebra_router.h"
+
+static unsigned int zebra_l2_bridge_vlan_hash_keymake(const void *p)
+{
+       const struct zebra_l2_bridge_vlan *bvlan;
+
+       bvlan = (const struct zebra_l2_bridge_vlan *)p;
+       return jhash(&bvlan->vid, sizeof(bvlan->vid), 0);
+}
+
+static bool zebra_l2_bridge_vlan_hash_cmp(const void *p1, const void *p2)
+{
+       const struct zebra_l2_bridge_vlan *bv1;
+       const struct zebra_l2_bridge_vlan *bv2;
+
+       bv1 = (const struct zebra_l2_bridge_vlan *)p1;
+       bv2 = (const struct zebra_l2_bridge_vlan *)p2;
+
+       return (bv1->vid == bv2->vid);
+}
+
+static int zebra_l2_bridge_if_vlan_walk_callback(struct hash_bucket *bucket,
+                                                void *ctxt)
+{
+       int ret;
+       struct zebra_l2_bridge_vlan *bvlan;
+       struct zebra_l2_bridge_if_ctx *ctx;
+
+       bvlan = (struct zebra_l2_bridge_vlan *)bucket->data;
+       ctx = (struct zebra_l2_bridge_if_ctx *)ctxt;
+
+       ret = ctx->func(ctx->zif, bvlan, ctx->arg);
+       return ret;
+}
+
+static void zebra_l2_bridge_if_vlan_iterate_callback(struct hash_bucket *bucket,
+                                                    void *ctxt)
+{
+       struct zebra_l2_bridge_vlan *bvlan;
+       struct zebra_l2_bridge_if_ctx *ctx;
+
+       bvlan = (struct zebra_l2_bridge_vlan *)bucket->data;
+       ctx = (struct zebra_l2_bridge_if_ctx *)ctxt;
+
+       ctx->func(ctx->zif, bvlan, ctx->arg);
+}
+
+static int zebra_l2_bridge_if_vlan_clean(struct zebra_if *zif,
+                                        struct zebra_l2_bridge_vlan *bvlan,
+                                        void *ctxt)
+{
+       struct zebra_evpn_access_bd *acc_bd;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("access vlan %d bridge %s cleanup", bvlan->vid,
+                          zif->ifp->name);
+
+       acc_bd = zebra_evpn_acc_vl_find(bvlan->vid, zif->ifp);
+       if (acc_bd)
+               zebra_evpn_access_bd_bridge_cleanup(bvlan->vid, zif->ifp,
+                                                   acc_bd);
+
+       bvlan->access_bd = NULL;
+       return 0;
+}
+
+static void zebra_l2_bridge_vlan_free(void *arg)
+{
+       struct zebra_l2_bridge_vlan *bvl;
+
+       bvl = (struct zebra_l2_bridge_vlan *)arg;
+       XFREE(MTYPE_TMP, bvl);
+}
+
+static void *zebra_l2_bridge_vlan_alloc(void *p)
+{
+       struct zebra_l2_bridge_vlan *bvlan;
+       const struct zebra_l2_bridge_vlan *bvl;
+
+       bvl = (const struct zebra_l2_bridge_vlan *)p;
+       bvlan = XCALLOC(MTYPE_TMP, sizeof(*bvlan));
+       bvlan->vid = bvl->vid;
+       bvlan->access_bd = bvl->access_bd;
+
+       return (void *)bvlan;
+}
+
+static void zebra_l2_bridge_vlan_table_destroy(struct hash *vlan_table)
+{
+       if (vlan_table) {
+               hash_clean(vlan_table, zebra_l2_bridge_vlan_free);
+               hash_free(vlan_table);
+       }
+}
+
+static struct hash *zebra_l2_bridge_vlan_table_create(void)
+{
+       return hash_create(zebra_l2_bridge_vlan_hash_keymake,
+                          zebra_l2_bridge_vlan_hash_cmp,
+                          "Zebra L2 Bridge Vlan Table");
+}
+
+static void zebra_l2_bridge_if_vlan_table_destroy(struct zebra_if *zif)
+{
+       struct zebra_l2_bridge_if *br;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       zebra_l2_bridge_if_vlan_iterate(zif, zebra_l2_bridge_if_vlan_clean,
+                                       NULL);
+       zebra_l2_bridge_vlan_table_destroy(br->vlan_table);
+       br->vlan_table = NULL;
+}
+
+static int zebra_l2_bridge_if_vlan_table_create(struct zebra_if *zif)
+{
+       struct zebra_l2_bridge_if *br;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       if (!br->vlan_table) {
+               br->vlan_table = zebra_l2_bridge_vlan_table_create();
+               if (!br->vlan_table)
+                       return -ENOMEM;
+       }
+
+       return 0;
+}
+
+static int zebra_l2_bridge_if_vlan_del(struct interface *ifp, vlanid_t vid)
+{
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_if *br;
+       struct zebra_l2_bridge_vlan bvl;
+       struct zebra_l2_bridge_vlan *bvlan;
+
+       zif = (struct zebra_if *)ifp->info;
+       memset(&bvl, 0, sizeof(bvl));
+       bvl.vid = vid;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       bvlan = hash_release(br->vlan_table, &bvl);
+
+       if (bvlan)
+               zebra_l2_bridge_vlan_free(bvlan);
+
+       return 0;
+}
+
+static int zebra_l2_bridge_if_vlan_update(struct interface *ifp,
+                                         struct zebra_l2_bridge_vlan *bvl,
+                                         int chgflags)
+{
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_vlan *bvlan;
+
+       zif = (struct zebra_if *)ifp->info;
+       bvlan = zebra_l2_bridge_if_vlan_find(zif, bvl->vid);
+       if (!bvlan)
+               return 0;
+
+       if (chgflags & ZEBRA_BRIDGEIF_ACCESS_BD_CHANGE)
+               bvlan->access_bd = bvl->access_bd;
+
+       if (!bvlan->access_bd)
+               return zebra_l2_bridge_if_vlan_del(ifp, bvl->vid);
+
+       return 0;
+}
+
+static int zebra_l2_bridge_if_vlan_add(struct interface *ifp,
+                                      struct zebra_l2_bridge_vlan *bvlan)
+{
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_if *br;
+
+       zif = (struct zebra_if *)ifp->info;
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       hash_get(br->vlan_table, (void *)bvlan, zebra_l2_bridge_vlan_alloc);
+
+       return 0;
+}
+
+struct zebra_l2_bridge_vlan *
+zebra_l2_bridge_if_vlan_find(const struct zebra_if *zif, vlanid_t vid)
+{
+       const struct zebra_l2_bridge_if *br;
+       struct zebra_l2_bridge_vlan *bvl;
+       struct zebra_l2_bridge_vlan bvlan;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       memset(&bvlan, 0, sizeof(bvlan));
+       bvlan.vid = vid;
+       bvl = (struct zebra_l2_bridge_vlan *)hash_lookup(br->vlan_table,
+                                                        (void *)&bvlan);
+
+       /* TODO: For debugging. Remove later */
+       if (bvl)
+               assert(bvl->vid == vid);
+
+       return bvl;
+}
+
+vni_t zebra_l2_bridge_if_vni_find(const struct zebra_if *zif, vlanid_t vid)
+{
+       vni_t vni_id = 0;
+       struct zebra_l2_bridge_vlan *bvlan;
+
+       bvlan = zebra_l2_bridge_if_vlan_find(zif, vid);
+       if (bvlan && bvlan->access_bd && bvlan->access_bd->vni)
+               vni_id = bvlan->access_bd->vni;
+
+       return vni_id;
+}
+
+void zebra_l2_bridge_if_vlan_iterate(struct zebra_if *zif,
+                                    int (*func)(struct zebra_if *zif,
+                                                struct zebra_l2_bridge_vlan *,
+                                                void *),
+                                    void *arg)
+{
+       struct zebra_l2_bridge_if *br;
+       struct zebra_l2_bridge_if_ctx ctx;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.zif = zif;
+       ctx.func = func;
+       ctx.arg = arg;
+       hash_iterate(br->vlan_table, zebra_l2_bridge_if_vlan_iterate_callback,
+                    &ctx);
+}
+
+void zebra_l2_bridge_if_vlan_walk(struct zebra_if *zif,
+                                 int (*func)(struct zebra_if *zif,
+                                             struct zebra_l2_bridge_vlan *,
+                                             void *),
+                                 void *arg)
+{
+       struct zebra_l2_bridge_if *br;
+       struct zebra_l2_bridge_if_ctx ctx;
+
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.zif = zif;
+       ctx.func = func;
+       ctx.arg = arg;
+       hash_walk(br->vlan_table, zebra_l2_bridge_if_vlan_walk_callback, &ctx);
+}
+
+int zebra_l2_bridge_if_vlan_access_bd_deref(struct zebra_evpn_access_bd *bd)
+{
+       int chgflags = 0;
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_vlan bvl;
+       struct zebra_l2_bridge_vlan *bvlan;
+
+       zif = bd->bridge_zif;
+       if (!zif)
+               return -1;
+
+       bvlan = zebra_l2_bridge_if_vlan_find(zif, bd->vid);
+       if (!bvlan)
+               return 0;
+
+       memset(&bvl, 0, sizeof(bvl));
+       bvl.vid = bd->vid;
+       bvl.access_bd = NULL;
+       chgflags = ZEBRA_BRIDGEIF_ACCESS_BD_CHANGE;
+       return zebra_l2_bridge_if_vlan_update(zif->ifp, &bvl, chgflags);
+}
+
+int zebra_l2_bridge_if_vlan_access_bd_ref(struct zebra_evpn_access_bd *bd)
+{
+       int chgflags = 0;
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_vlan bvl;
+       struct zebra_l2_bridge_vlan *bvlan;
+
+       zif = bd->bridge_zif;
+       if (!zif)
+               return -1;
+
+       if (!bd->vid)
+               return -1;
+
+       memset(&bvl, 0, sizeof(bvl));
+       bvl.vid = bd->vid;
+       bvl.access_bd = bd;
+
+       bvlan = zebra_l2_bridge_if_vlan_find(zif, bd->vid);
+       if (!bvlan)
+               return zebra_l2_bridge_if_vlan_add(zif->ifp, &bvl);
+
+       chgflags = ZEBRA_BRIDGEIF_ACCESS_BD_CHANGE;
+       return zebra_l2_bridge_if_vlan_update(zif->ifp, &bvl, chgflags);
+}
+
+int zebra_l2_bridge_if_cleanup(struct interface *ifp)
+{
+       struct zebra_if *zif;
+
+       if (!IS_ZEBRA_IF_BRIDGE(ifp))
+               return 0;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("bridge %s cleanup", ifp->name);
+
+       zif = (struct zebra_if *)ifp->info;
+       zebra_l2_bridge_if_vlan_table_destroy(zif);
+       return 0;
+}
+
+int zebra_l2_bridge_if_del(struct interface *ifp)
+{
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("bridge %s delete", ifp->name);
+
+       return zebra_l2_bridge_if_cleanup(ifp);
+}
+
+int zebra_l2_bridge_if_add(struct interface *ifp)
+{
+       struct zebra_if *zif;
+       struct zebra_l2_bridge_if *br;
+
+       zif = (struct zebra_if *)ifp->info;
+       br = BRIDGE_FROM_ZEBRA_IF(zif);
+       br->br_zif = (struct zebra_if *)ifp->info;
+       zebra_l2_bridge_if_vlan_table_create(zif);
+       return 0;
+}
diff --git a/zebra/zebra_l2_bridge_if.h b/zebra/zebra_l2_bridge_if.h
new file mode 100644 (file)
index 0000000..734ecfd
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Zebra L2 bridge interface data structures and definitions
+ * These are public definitions referenced by other files.
+ * Copyright (C) 2021 Cumulus Networks, Inc.
+ * Sharath Ramamurthy
+ *
+ * This file is part of FRR.
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FRR; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _ZEBRA_L2_BRIDGE_IF_H
+#define _ZEBRA_L2_BRIDGE_IF_H
+
+#include <zebra.h>
+#include <zebra/zebra_router.h>
+
+#include "linklist.h"
+#include "if.h"
+#include "vlan.h"
+#include "vxlan.h"
+
+#include "lib/json.h"
+#include "zebra/zebra_vrf.h"
+#include "zebra/zserv.h"
+
+#include "zebra/zebra_dplane.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Bridge interface change flags of interest. */
+#define ZEBRA_BRIDGEIF_ACCESS_BD_CHANGE (1 << 0)
+
+extern struct zebra_l2_bridge_vlan *
+zebra_l2_bridge_if_vlan_find(const struct zebra_if *zif, vlanid_t vid);
+extern vni_t zebra_l2_bridge_if_vni_find(const struct zebra_if *zif,
+                                        vlanid_t vid);
+extern void zebra_l2_bridge_if_vlan_iterate(
+       struct zebra_if *zif,
+       int (*func)(struct zebra_if *zif, struct zebra_l2_bridge_vlan *,
+                   void *),
+       void *arg);
+extern void
+zebra_l2_bridge_if_vlan_walk(struct zebra_if *zif,
+                            int (*func)(struct zebra_if *zif,
+                                        struct zebra_l2_bridge_vlan *, void *),
+                            void *arg);
+extern int
+zebra_l2_bridge_if_vlan_access_bd_deref(struct zebra_evpn_access_bd *bd);
+extern int
+zebra_l2_bridge_if_vlan_access_bd_ref(struct zebra_evpn_access_bd *bd);
+extern int zebra_l2_bridge_if_del(struct interface *ifp);
+extern int zebra_l2_bridge_if_add(struct interface *ifp);
+extern int zebra_l2_bridge_if_cleanup(struct interface *ifp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZEBRA_L2_BRIDGE_IF_H */
index 2042f94038d10719343541aba32cca005bc7ae6e..b4a0c575a25e3956f1d97f548e788be3da167203 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Mlag Code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include "zebra.h"
 
@@ -888,7 +872,14 @@ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type)
                if (cleanup)
                        return -1;
        } break;
-       default:
+       case MLAG_REGISTER:
+       case MLAG_DEREGISTER:
+       case MLAG_STATUS_UPDATE:
+       case MLAG_DUMP:
+       case MLAG_PIM_CFG_DUMP:
+       case MLAG_VXLAN_UPDATE:
+       case MLAG_PEER_FRR_STATUS:
+       case MLAG_MSG_NONE:
                break;
        }
 
index eb96a57d3016499c123ecc01b7046c861c6efb9d..d60af446ba2df31fd164e223966a730e0b282295 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra mlag header.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __ZEBRA_MLAG_H__
 #define __ZEBRA_MLAG_H__
index 50a290b9e8de354d37979b00b70cb14eaa18d400..334eb6dc469583e9735ea236aaa71b879393045a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of MLAG Functionality
  *
@@ -6,20 +7,6 @@
  * Author: sathesh Kumar karra <sathk@cumulusnetworks.com>
  *
  * Copyright (C) 2019 Cumulus Networks http://www.cumulusnetworks.com
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "zebra.h"
 
index a1c544d5d84827a486c1c603d8e6c19a2a683b9a..1145d12e07d2fa7443e103383a9834522f0c881f 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Mlag vty Code.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
index 789154d684ea0e55f18cde749462cdaa7e9ef643..12ecff9e3452ede2fdb5c4285f23cd79b0bbdb69 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Mlag vty Code.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __ZEBRA_MLAG_VTY_CODE__
 #define __ZEBRA_MLAG_VTY_CODE__
index fe3f77f3c74f30e1db98b8cc81decc371b87cf41..d25505839c2a15f19b155dfe0f04bc90c7dbfc93 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra MPLS code
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -492,7 +477,7 @@ static void fec_print(struct zebra_fec *fec, struct vty *vty)
 
        rn = fec->rn;
        vty_out(vty, "%pRN\n", rn);
-       vty_out(vty, "  Label: %s", label2str(fec->label, buf, BUFSIZ));
+       vty_out(vty, "  Label: %s", label2str(fec->label, 0, buf, BUFSIZ));
        if (fec->label_index != MPLS_INVALID_LABEL_INDEX)
                vty_out(vty, ", Label Index: %u", fec->label_index);
        vty_out(vty, "\n");
@@ -1597,8 +1582,8 @@ static void nhlfe_print(struct zebra_nhlfe *nhlfe, struct vty *vty,
        vty_out(vty, " type: %s remote label: %s distance: %d\n",
                nhlfe_type2str(nhlfe->type),
                mpls_label2str(nexthop->nh_label->num_labels,
-                              nexthop->nh_label->label,
-                              buf, sizeof(buf), 0),
+                              nexthop->nh_label->label, buf, sizeof(buf),
+                              nexthop->nh_label_type, 0),
                nhlfe->distance);
 
        if (indent)
@@ -1848,7 +1833,57 @@ void zebra_mpls_lsp_dplane_result(struct zebra_dplane_ctx *ctx)
                                             ZEBRA_SR_POLICY_LABEL_REMOVED);
                break;
 
-       default:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
 
        } /* Switch */
@@ -2669,7 +2704,7 @@ int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf)
 
                        write = 1;
                        vty_out(vty, "mpls label bind %pFX %s\n", &rn->p,
-                               label2str(fec->label, lstr, BUFSIZ));
+                               label2str(fec->label, 0, lstr, BUFSIZ));
                }
        }
 
@@ -3114,10 +3149,10 @@ lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t type,
 
                        nhlfe2str(nhlfe, buf, sizeof(buf));
                        mpls_label2str(num_out_labels, out_labels, buf2,
-                                      sizeof(buf2), 0);
+                                      sizeof(buf2), 0, 0);
                        mpls_label2str(nh->nh_label->num_labels,
                                       nh->nh_label->label, buf3, sizeof(buf3),
-                                      0);
+                                      nh->nh_label_type, 0);
 
                        zlog_debug("LSP in-label %u type %d %snexthop %s out-label(s) changed to %s (old %s)",
                                   lsp->ile.in_label, type, backup_str, buf,
@@ -3145,7 +3180,7 @@ lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t type,
 
                        nhlfe2str(nhlfe, buf, sizeof(buf));
                        mpls_label2str(num_out_labels, out_labels, buf2,
-                                      sizeof(buf2), 0);
+                                      sizeof(buf2), 0, 0);
 
                        zlog_debug("Add LSP in-label %u type %d %snexthop %s out-label(s) %s",
                                   lsp->ile.in_label, type, backup_str, buf,
@@ -3728,10 +3763,10 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
                json = json_object_new_object();
 
                for (ALL_LIST_ELEMENTS_RO(lsp_list, node, lsp))
-                       json_object_object_add(
-                               json, label2str(lsp->ile.in_label, buf,
-                                               sizeof(buf)),
-                               lsp_json(lsp));
+                       json_object_object_add(json,
+                                              label2str(lsp->ile.in_label, 0,
+                                                        buf, sizeof(buf)),
+                                              lsp_json(lsp));
 
                vty_json(vty, json);
        } else {
@@ -3783,7 +3818,8 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
                                        out_label_str = mpls_label2str(
                                                nexthop->nh_label->num_labels,
                                                &nexthop->nh_label->label[0],
-                                               buf, sizeof(buf), 1);
+                                               buf, sizeof(buf),
+                                               nexthop->nh_label_type, 1);
                                else
                                        out_label_str = "-";
 
index cf247861f8d58caf54eacf0fee47574e143478df..7feace56b55d2c1a9a1a51418a19975cdacb0714 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra MPLS Data structures and definitions
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_MPLS_H
@@ -446,6 +431,7 @@ static inline uint8_t lsp_distance(enum lsp_types_t type)
                return (route_distance(ZEBRA_ROUTE_BGP));
        case ZEBRA_LSP_NONE:
        case ZEBRA_LSP_SHARP:
+       case ZEBRA_LSP_EVPN:
        case ZEBRA_LSP_OSPF_SR:
        case ZEBRA_LSP_ISIS_SR:
        case ZEBRA_LSP_SRTE:
@@ -498,6 +484,7 @@ static inline int re_type_from_lsp_type(enum lsp_types_t lsp_type)
        case ZEBRA_LSP_LDP:
                return ZEBRA_ROUTE_LDP;
        case ZEBRA_LSP_BGP:
+       case ZEBRA_LSP_EVPN:
                return ZEBRA_ROUTE_BGP;
        case ZEBRA_LSP_OSPF_SR:
                return ZEBRA_ROUTE_OSPF;
@@ -538,6 +525,8 @@ static inline const char *nhlfe_type2str(enum lsp_types_t lsp_type)
                return "SHARP";
        case ZEBRA_LSP_SRTE:
                return "SR-TE";
+       case ZEBRA_LSP_EVPN:
+               return "EVPN";
        case ZEBRA_LSP_NONE:
                return "Unknown";
        }
index ce7702b82313d8bd500fb7748371ff34e6963a16..4bc676f3926e255883c290130e2b043bf2fabfa5 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* MPLS forwarding table updates using netlink over GNU/Linux system.
  * Copyright (C) 2016  Cumulus Networks, Inc.
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2cc3f3b69dc5ab72b7d195bcc92410dc273dcd96..ac578930e714a5ab8a59d7d298ee08875797768c 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cdf34936c0b4eeec2c0df1c34cd97c44d3d7b0ef..ee6f7045f558c008295850a82acc7e8e2c9d0744 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 by Open Source Routing.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -255,7 +240,57 @@ static int kernel_lsp_cmd(struct zebra_dplane_ctx *ctx)
        case DPLANE_OP_LSP_UPDATE:
                action = RTM_CHANGE;
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                return -1;
        }
 
@@ -415,7 +450,58 @@ enum zebra_dplane_result kernel_pw_update(struct zebra_dplane_ctx *ctx)
        case DPLANE_OP_PW_UNINSTALL:
                result = kmpw_uninstall(ctx);
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
        }
 
index ca66e0310a4fa8f35adfa0c105f6d3d34c841ca9..7e3cdd738e0a23199ebdb43d20cf7d5352f633a1 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra MPLS VTY functions
  * Copyright (C) 2002 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 5d38c379019de691b9019709c110f66a89ca4174..881b681c2f6d837ae69ea62219701fc0dd90ad2c 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra_mroute code
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 6c56c2e41d885bc73e8d7ad475a0a9de44d50afd..6f4c4f58874b21501dd00c7fa37a90d6209b9a3f 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra_mroute.h
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __ZEBRA_MROUTE_H__
index 90d4ee7ced3420ac3b1df900d27faf514c667373..d94547cffc61f628e8d4da2a7bd7a6731f819340 100644 (file)
@@ -1,23 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
+#include "interface.h"
 #include "northbound.h"
 #include "libfrr.h"
 #include "zebra_nb.h"
@@ -350,6 +338,41 @@ const struct frr_yang_module_info frr_zebra_info = {
                                .destroy = lib_interface_zebra_bandwidth_destroy,
                        }
                },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/bandwidth",
+                       .cbs = {
+                               .modify = lib_interface_zebra_bandwidth_modify,
+                               .destroy = lib_interface_zebra_bandwidth_destroy,
+                       }
+               },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/link-params/legacy-admin-group",
+                       .cbs = {
+                               .modify = lib_interface_zebra_legacy_admin_group_modify,
+                               .destroy = lib_interface_zebra_legacy_admin_group_destroy,
+                               .cli_show = cli_show_legacy_admin_group,
+                       },
+               },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities",
+                       .cbs = {
+                               .cli_show = cli_show_affinity,
+                       },
+               },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity",
+                       .cbs = {
+                               .create = lib_interface_zebra_affinity_create,
+                               .destroy = lib_interface_zebra_affinity_destroy,
+                       },
+               },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/link-params/affinity-mode",
+                       .cbs = {
+                               .modify = lib_interface_zebra_affinity_mode_modify,
+                               .cli_show = cli_show_affinity_mode,
+                       },
+               },
                {
                        .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/state/up-count",
                        .cbs = {
index 95907059a8511e7ab95318c436e0899af8cd06b7..fa576ec3f4c1d1aeb3414c8cdedf682b173810d9 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Cumulus Networks, Inc.
  *                    Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef ZEBRA_ZEBRA_NB_H_
@@ -109,6 +96,13 @@ int lib_interface_zebra_shutdown_modify(struct nb_cb_modify_args *args);
 int lib_interface_zebra_shutdown_destroy(struct nb_cb_destroy_args *args);
 int lib_interface_zebra_bandwidth_modify(struct nb_cb_modify_args *args);
 int lib_interface_zebra_bandwidth_destroy(struct nb_cb_destroy_args *args);
+int lib_interface_zebra_legacy_admin_group_modify(
+       struct nb_cb_modify_args *args);
+int lib_interface_zebra_legacy_admin_group_destroy(
+       struct nb_cb_destroy_args *args);
+int lib_interface_zebra_affinity_create(struct nb_cb_create_args *args);
+int lib_interface_zebra_affinity_destroy(struct nb_cb_destroy_args *args);
+int lib_interface_zebra_affinity_mode_modify(struct nb_cb_modify_args *args);
 struct yang_data *
 lib_interface_zebra_state_up_count_get_elem(struct nb_cb_get_elem_args *args);
 struct yang_data *
index dfb55b0d6d8ecda198bed5c353009c731160ebd8..336669a49b2893c9d29e7ae522172662dd7fc9ad 100644 (file)
@@ -1,24 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2019  Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
 
+#include "lib/admin_group.h"
+#include "lib/affinitymap.h"
 #include "lib/log.h"
 #include "lib/northbound.h"
 #include "lib/printfrr.h"
@@ -1139,6 +1128,275 @@ int lib_interface_zebra_bandwidth_destroy(struct nb_cb_destroy_args *args)
        return NB_OK;
 }
 
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-zebra:zebra/link-params/legacy-admin-group
+ */
+int lib_interface_zebra_legacy_admin_group_modify(
+       struct nb_cb_modify_args *args)
+{
+       struct interface *ifp;
+       struct if_link_params *iflp;
+       uint32_t admin_group_value;
+
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
+       admin_group_value = yang_dnode_get_uint32(args->dnode, ".");
+
+       if (!ifp)
+               return NB_ERR_RESOURCE;
+
+       iflp = if_link_params_get(ifp);
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               if (!iflp)
+                       iflp = if_link_params_enable(ifp);
+
+               iflp->admin_grp = admin_group_value;
+               SET_PARAM(iflp, LP_ADM_GRP);
+
+               admin_group_clear(&iflp->ext_admin_grp);
+               UNSET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+
+               if (if_is_operative(ifp))
+                       zebra_interface_parameters_update(ifp);
+               break;
+       }
+       return NB_OK;
+}
+
+int lib_interface_zebra_legacy_admin_group_destroy(
+       struct nb_cb_destroy_args *args)
+{
+       struct interface *ifp;
+       struct if_link_params *iflp;
+
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
+
+       if (!ifp)
+               return NB_ERR_RESOURCE;
+
+       iflp = if_link_params_get(ifp);
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               if (!iflp)
+                       iflp = if_link_params_enable(ifp);
+
+               iflp->admin_grp = 0;
+               UNSET_PARAM(iflp, LP_ADM_GRP);
+
+               if (if_is_operative(ifp))
+                       zebra_interface_parameters_update(ifp);
+               break;
+       }
+       return NB_OK;
+}
+
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity
+ */
+int lib_interface_zebra_affinity_create(struct nb_cb_create_args *args)
+{
+       struct interface *ifp;
+       const char *affname;
+       struct if_link_params *iflp;
+       struct affinity_map *affmap;
+       enum affinity_mode affinity_mode;
+
+
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
+       affname = yang_dnode_get_string(args->dnode, ".");
+       affinity_mode = yang_dnode_get_enum(args->dnode, "../../affinity-mode");
+
+       if (!ifp)
+               return NB_ERR_RESOURCE;
+
+       affmap = affinity_map_get(affname);
+       iflp = if_link_params_get(ifp);
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+               if (!affmap) {
+                       snprintf(args->errmsg, args->errmsg_len,
+                                "affinity-map %s not found.", affname);
+                       return NB_ERR_VALIDATION;
+               }
+               if (affinity_mode == AFFINITY_MODE_STANDARD &&
+                   affmap->bit_position > 31) {
+                       snprintf(
+                               args->errmsg, args->errmsg_len,
+                               "affinity %s bit-position %d is not compatible with affinity-mode standard (bit-position > 31).",
+                               affname, affmap->bit_position);
+                       return NB_ERR_VALIDATION;
+               }
+               break;
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               if (!iflp)
+                       iflp = if_link_params_enable(ifp);
+
+               if (affmap->bit_position < 32 &&
+                   (affinity_mode == AFFINITY_MODE_STANDARD ||
+                    affinity_mode == AFFINITY_MODE_BOTH)) {
+                       iflp->admin_grp |= 1 << affmap->bit_position;
+                       SET_PARAM(iflp, LP_ADM_GRP);
+               }
+               if (affinity_mode == AFFINITY_MODE_EXTENDED ||
+                   affinity_mode == AFFINITY_MODE_BOTH) {
+                       admin_group_set(&iflp->ext_admin_grp,
+                                       affmap->bit_position);
+                       SET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+               }
+
+               if (if_is_operative(ifp))
+                       zebra_interface_parameters_update(ifp);
+               break;
+       }
+       return NB_OK;
+}
+
+int lib_interface_zebra_affinity_destroy(struct nb_cb_destroy_args *args)
+{
+       struct interface *ifp;
+       const char *affname;
+       struct if_link_params *iflp;
+       struct affinity_map *affmap;
+       enum affinity_mode affinity_mode;
+
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
+       affname = yang_dnode_get_string(args->dnode, ".");
+       affinity_mode = yang_dnode_get_enum(args->dnode, "../../affinity-mode");
+
+       if (!ifp)
+               return NB_ERR_RESOURCE;
+
+       affmap = affinity_map_get(affname);
+       iflp = if_link_params_get(ifp);
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+               if (!affmap) {
+                       snprintf(args->errmsg, args->errmsg_len,
+                                "affinity-map %s not found.", affname);
+                       return NB_ERR_VALIDATION;
+               }
+               break;
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               if (!iflp)
+                       return NB_OK;
+               if (affmap->bit_position < 32 &&
+                   (affinity_mode == AFFINITY_MODE_STANDARD ||
+                    affinity_mode == AFFINITY_MODE_BOTH)) {
+                       iflp->admin_grp &= ~(1 << affmap->bit_position);
+                       if (iflp->admin_grp == 0)
+                               UNSET_PARAM(iflp, LP_ADM_GRP);
+               }
+               if (affinity_mode == AFFINITY_MODE_EXTENDED ||
+                   affinity_mode == AFFINITY_MODE_BOTH) {
+                       admin_group_unset(&iflp->ext_admin_grp,
+                                         affmap->bit_position);
+                       if (admin_group_zero(&iflp->ext_admin_grp))
+                               UNSET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+               }
+
+               if (if_is_operative(ifp))
+                       zebra_interface_parameters_update(ifp);
+               break;
+       }
+       return NB_OK;
+}
+
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinity-mode
+ */
+int lib_interface_zebra_affinity_mode_modify(struct nb_cb_modify_args *args)
+{
+       struct interface *ifp;
+       struct if_link_params *iflp;
+       enum affinity_mode affinity_mode;
+
+
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
+       affinity_mode = yang_dnode_get_enum(args->dnode, ".");
+
+       if (!ifp)
+               return NB_ERR_RESOURCE;
+
+       iflp = if_link_params_get(ifp);
+
+       switch (args->event) {
+       case NB_EV_VALIDATE:
+               if (affinity_mode == AFFINITY_MODE_STANDARD &&
+                   admin_group_nb_words(&iflp->ext_admin_grp) > 1) {
+                       snprintf(
+                               args->errmsg, args->errmsg_len,
+                               "affinity-mode standard cannot be set when a bit-position > 31 is set.");
+                       return NB_ERR_VALIDATION;
+               }
+               break;
+       case NB_EV_PREPARE:
+       case NB_EV_ABORT:
+               break;
+       case NB_EV_APPLY:
+               if (!iflp)
+                       iflp = if_link_params_enable(ifp);
+               if (affinity_mode == AFFINITY_MODE_STANDARD) {
+                       if (!IS_PARAM_SET(iflp, LP_ADM_GRP) &&
+                           IS_PARAM_SET(iflp, LP_EXTEND_ADM_GRP)) {
+                               iflp->admin_grp = admin_group_get_offset(
+                                       &iflp->ext_admin_grp, 0);
+                               SET_PARAM(iflp, LP_ADM_GRP);
+                       }
+                       admin_group_clear(&iflp->ext_admin_grp);
+                       UNSET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+               }
+               if (affinity_mode == AFFINITY_MODE_EXTENDED) {
+                       if (!IS_PARAM_SET(iflp, LP_EXTEND_ADM_GRP) &&
+                           IS_PARAM_SET(iflp, LP_ADM_GRP)) {
+                               admin_group_bulk_set(&iflp->ext_admin_grp,
+                                                    iflp->admin_grp, 0);
+                               SET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+                       }
+                       iflp->admin_grp = 0;
+                       UNSET_PARAM(iflp, LP_ADM_GRP);
+               }
+               if (affinity_mode == AFFINITY_MODE_BOTH) {
+                       if (!IS_PARAM_SET(iflp, LP_EXTEND_ADM_GRP) &&
+                           IS_PARAM_SET(iflp, LP_ADM_GRP)) {
+                               admin_group_bulk_set(&iflp->ext_admin_grp,
+                                                    iflp->admin_grp, 0);
+                               SET_PARAM(iflp, LP_EXTEND_ADM_GRP);
+                       } else if (!IS_PARAM_SET(iflp, LP_ADM_GRP) &&
+                                  IS_PARAM_SET(iflp, LP_EXTEND_ADM_GRP)) {
+                               iflp->admin_grp = admin_group_get_offset(
+                                       &iflp->ext_admin_grp, 0);
+                               SET_PARAM(iflp, LP_ADM_GRP);
+                       }
+               }
+
+               if (if_is_operative(ifp))
+                       zebra_interface_parameters_update(ifp);
+               break;
+       }
+       return NB_OK;
+}
+
 /*
  * XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
  */
index e7d438b1af8836c72c9dc9aad8462d6df507e8a0..083ab3fde69d28de7462f4ae44ddd4457f5e272d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020 Cumulus Networks, Inc.
  *                    Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 219e4d028a4443420a31fe56aa447524a2fbd508..acf0b80aca685d72ed8aeb0e6d3fa79911e786b1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  Cumulus Networks, Inc.
  * Chirag Shah
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -25,6 +12,8 @@
 #include "zebra/zebra_router.h"
 #include "zebra/debug.h"
 #include "printfrr.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
 
 /*
  * XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count
@@ -101,15 +90,18 @@ lib_interface_zebra_state_vni_id_get_elem(struct nb_cb_get_elem_args *args)
 {
        const struct interface *ifp = args->list_entry;
        struct zebra_if *zebra_if;
-       struct zebra_l2info_vxlan *vxlan_info;
+       struct zebra_vxlan_vni *vni;
 
        if (!IS_ZEBRA_IF_VXLAN(ifp))
                return NULL;
 
        zebra_if = ifp->info;
-       vxlan_info = &zebra_if->l2info.vxl;
 
-       return yang_data_new_uint32(args->xpath, vxlan_info->vni);
+       if (!IS_ZEBRA_VXLAN_IF_VNI(zebra_if))
+               return NULL;
+
+       vni = zebra_vxlan_if_vni_find(zebra_if, 0);
+       return yang_data_new_uint32(args->xpath, vni->vni);
 }
 
 /*
@@ -139,15 +131,18 @@ lib_interface_zebra_state_mcast_group_get_elem(struct nb_cb_get_elem_args *args)
 {
        const struct interface *ifp = args->list_entry;
        struct zebra_if *zebra_if;
-       struct zebra_l2info_vxlan *vxlan_info;
+       struct zebra_vxlan_vni *vni;
 
        if (!IS_ZEBRA_IF_VXLAN(ifp))
                return NULL;
 
        zebra_if = ifp->info;
-       vxlan_info = &zebra_if->l2info.vxl;
 
-       return yang_data_new_ipv4(args->xpath, &vxlan_info->mcast_grp);
+       if (!IS_ZEBRA_VXLAN_IF_VNI(zebra_if))
+               return NULL;
+
+       vni = zebra_vxlan_if_vni_find(zebra_if, 0);
+       return yang_data_new_ipv4(args->xpath, &vni->mcast_grp);
 }
 
 const void *lib_vrf_zebra_ribs_rib_get_next(struct nb_cb_get_next_args *args)
@@ -706,7 +701,7 @@ lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_nexthop_nh_type_get_elem(
        case NEXTHOP_TYPE_IPV6_IFINDEX:
                return yang_data_new_string(args->xpath, "ip6-ifindex");
                break;
-       default:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
index 09e9a62f68147afab01dd2ec7c089015bffa33c8..0c3fb97afdf7df8472b80ff0a12d225a70a48c2e 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra neighbor table management
  *
  * Copyright (C) 2021 Nvidia
  * Anuradha Karuppiah
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
  */
 
 #include <zebra.h>
index 953f2e300a401849999675969aef8584d010eba6..b957b5efe580732c25d0ab3dd8206f02c7b1fc37 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra neighbor table management
  *
  * Copyright (C) 2021 Nvidia
  * Anuradha Karuppiah
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
  */
 
 #ifndef _ZEBRA_NEIGH_H
index 8905b72ec5f2eb5b77a67d67020a876435957fd1..0531ab959100b11c02a23045866514c0e1944067 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra NETNS ID handling routines
  * those routines are implemented locally to avoid having external dependencies.
  * Copyright (C) 2018 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index dd9eab18e0f773e6ffb8730dcc3c11abfcc5c7e7..1139fecf88c9fd97aa0cb8b6ef68336123cbd174 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra NETNS ID handling routines
  * Copyright (C) 2018 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #if !defined(__ZEBRA_NS_ID_H__)
 #define __ZEBRA_NS_ID_H__
index 50b7ff923343d76bc550c248f0e5fd6ac41a0fd6..cdba0c21aba9a53c003842033f9a13196a0492f6 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra NS collector and notifier for Network NameSpaces
  * Copyright (C) 2017 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 18939283a70783dc47f1cdb6ac0356a52dcc4f30..c701b0f8ac2379e0a223f3c953bc7a4ca62c346a 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra NS collector and notifier for Network NameSpaces
  * Copyright (C) 2017 6WIND
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _NETNS_NOTIFY_H
index 758fed7280db4d818da1be810a6dff59e08750d3..654cf50d49c267ff3c914a5878beeb77a89bb7f4 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Nexthop Group Code.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Donald Sharp
  *                    Stephen Worley
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include <zebra.h>
 
@@ -44,6 +28,7 @@
 #include "zebra/interface.h"
 #include "zebra/zapi_msg.h"
 #include "zebra/rib.h"
+#include "zebra/zebra_vxlan.h"
 
 DEFINE_MTYPE_STATIC(ZEBRA, NHG, "Nexthop Group Entry");
 DEFINE_MTYPE_STATIC(ZEBRA, NHG_CONNECTED, "Nexthop Group Connected");
@@ -1922,10 +1907,42 @@ static bool nexthop_valid_resolve(const struct nexthop *nexthop,
 }
 
 /*
- * When resolving a recursive nexthop, capture backup nexthop(s) also
- * so they can be conveyed through the dataplane to the FIB. We'll look
- * at the backups in the resolving nh 'nexthop' and its nhe, and copy them
- * into the route's resolved nh 'resolved' and its nhe 'nhe'.
+ * Downstream VNI and Single VXlan device check.
+ *
+ * If it has nexthop VNI labels at this point it must be D-VNI allocated
+ * and all the nexthops have to be on an SVD.
+ *
+ * If SVD is not available, mark as inactive.
+ */
+static bool nexthop_set_evpn_dvni_svd(vrf_id_t re_vrf_id,
+                                     struct nexthop *nexthop)
+{
+       if (!is_vrf_l3vni_svd_backed(re_vrf_id)) {
+               if (IS_ZEBRA_DEBUG_NHG_DETAIL) {
+                       struct vrf *vrf = vrf_lookup_by_id(re_vrf_id);
+
+                       zlog_debug(
+                               "nexthop %pNHv D-VNI but route's vrf %s(%u) doesn't use SVD",
+                               nexthop, VRF_LOGNAME(vrf), re_vrf_id);
+               }
+
+               return false;
+       }
+
+       nexthop->ifindex = get_l3vni_vxlan_ifindex(re_vrf_id);
+       nexthop->vrf_id = 0;
+
+       if (IS_ZEBRA_DEBUG_NHG_DETAIL)
+               zlog_debug("nexthop %pNHv using SVD", nexthop);
+
+       return true;
+}
+
+/*
+ * Given a nexthop we need to properly recursively resolve
+ * the route.  As such, do a table lookup to find and match
+ * if at all possible.  Set the nexthop->ifindex and resolved_id
+ * as appropriate
  */
 static int resolve_backup_nexthops(const struct nexthop *nexthop,
                                   const struct nhg_hash_entry *nhe,
@@ -2195,6 +2212,12 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
         * sure the nexthop's interface is known and is operational.
         */
        if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK)) {
+               /* DVNI/SVD Checks for EVPN routes */
+               if (nexthop->nh_label &&
+                   nexthop->nh_label_type == ZEBRA_LSP_EVPN &&
+                   !nexthop_set_evpn_dvni_svd(vrf_id, nexthop))
+                       return 0;
+
                ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id);
                if (!ifp) {
                        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
@@ -2250,7 +2273,9 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
                        endpoint.ipa_type = IPADDR_V6;
                        endpoint.ipaddr_v6 = nexthop->gate.ipv6;
                        break;
-               default:
+               case AFI_UNSPEC:
+               case AFI_L2VPN:
+               case AFI_MAX:
                        flog_err(EC_LIB_DEVELOPMENT,
                                 "%s: unknown address-family: %u", __func__,
                                 afi);
@@ -2291,7 +2316,9 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
                p.prefixlen = IPV6_MAX_BITLEN;
                p.u.prefix6 = nexthop->gate.ipv6;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                assert(afi != AFI_IP && afi != AFI_IP6);
                break;
        }
@@ -2702,6 +2729,51 @@ done:
        return valid;
 }
 
+/* Checks if the first nexthop is EVPN. If not, early return.
+ *
+ * This is used to determine if there is a mismatch between l3VNI
+ * of the route's vrf and the nexthops in use's VNI labels.
+ *
+ * If there is a mismatch, we keep the labels as these MUST be DVNI nexthops.
+ *
+ * IF there is no mismatch, we remove the labels and handle the routes as
+ * we have traditionally with evpn.
+ */
+static bool nexthop_list_set_evpn_dvni(struct route_entry *re,
+                                      struct nexthop_group *nhg)
+{
+       struct nexthop *nexthop;
+       vni_t re_vrf_vni;
+       vni_t nh_vni;
+       bool use_dvni = false;
+
+       nexthop = nhg->nexthop;
+
+       if (!nexthop->nh_label || nexthop->nh_label_type != ZEBRA_LSP_EVPN)
+               return false;
+
+       re_vrf_vni = get_l3vni_vni(re->vrf_id);
+
+       for (; nexthop; nexthop = nexthop->next) {
+               if (!nexthop->nh_label ||
+                   nexthop->nh_label_type != ZEBRA_LSP_EVPN)
+                       continue;
+
+               nh_vni = label2vni(&nexthop->nh_label->label[0]);
+
+               if (nh_vni != re_vrf_vni)
+                       use_dvni = true;
+       }
+
+       /* Using traditional way, no VNI encap - remove labels */
+       if (!use_dvni) {
+               for (nexthop = nhg->nexthop; nexthop; nexthop = nexthop->next)
+                       nexthop_del_labels(nexthop);
+       }
+
+       return use_dvni;
+}
+
 /*
  * Process a list of nexthops, given an nhe, determining
  * whether each one is ACTIVE/installable at this time.
@@ -2717,12 +2789,16 @@ static uint32_t nexthop_list_active_update(struct route_node *rn,
        uint32_t counter = 0;
        struct nexthop *nexthop;
        struct nexthop_group *nhg = &nhe->nhg;
+       bool vni_removed = false;
 
        nexthop = nhg->nexthop;
 
        /* Init recursive nh mtu */
        re->nexthop_mtu = 0;
 
+       /* Handler for dvni evpn nexthops. Has to be done at nhg level */
+       vni_removed = !nexthop_list_set_evpn_dvni(re, nhg);
+
        /* Process nexthops one-by-one */
        for ( ; nexthop; nexthop = nexthop->next) {
 
@@ -2760,16 +2836,17 @@ static uint32_t nexthop_list_active_update(struct route_node *rn,
                        counter++;
 
                /* Check for changes to the nexthop - set ROUTE_ENTRY_CHANGED */
-               if (prev_active != new_active || prev_index != nexthop->ifindex
-                   || ((nexthop->type >= NEXTHOP_TYPE_IFINDEX
-                        && nexthop->type < NEXTHOP_TYPE_IPV6)
-                       && prev_src.ipv4.s_addr
-                                  != nexthop->rmap_src.ipv4.s_addr)
-                   || ((nexthop->type >= NEXTHOP_TYPE_IPV6
-                        && nexthop->type < NEXTHOP_TYPE_BLACKHOLE)
-                       && !(IPV6_ADDR_SAME(&prev_src.ipv6,
-                                           &nexthop->rmap_src.ipv6)))
-                   || CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED))
+               if (prev_active != new_active ||
+                   prev_index != nexthop->ifindex ||
+                   ((nexthop->type >= NEXTHOP_TYPE_IFINDEX &&
+                     nexthop->type < NEXTHOP_TYPE_IPV6) &&
+                    prev_src.ipv4.s_addr != nexthop->rmap_src.ipv4.s_addr) ||
+                   ((nexthop->type >= NEXTHOP_TYPE_IPV6 &&
+                     nexthop->type < NEXTHOP_TYPE_BLACKHOLE) &&
+                    !(IPV6_ADDR_SAME(&prev_src.ipv6,
+                                     &nexthop->rmap_src.ipv6))) ||
+                   CHECK_FLAG(re->status, ROUTE_ENTRY_LABELS_CHANGED) ||
+                   vni_removed)
                        SET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
        }
 
index 9b925bf10fd7dc8dede4733864a3c96a3086609a..5830952d5acaef7755091e14769ac82d0949525b 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Nexthop Group header.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Donald Sharp
  *                    Stephen Worley
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __ZEBRA_NHG_H__
 #define __ZEBRA_NHG_H__
index 25048258d5b96090f9d84844d97e3a42c1c705ce..2f4a92fec8e28dbde60c5ced8a66a629152d18c3 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Nexthop Group Private Functions.
  * Copyright (C) 2019 Cumulus Networks, Inc.
  *                    Stephen Worley
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
index 7b076b8a4a9fa7a30743c0be512150c839053946..6bb5e971e616e2a443cf4afdb472e986696127fd 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra NS Routines
  * Copyright (C) 2016 Cumulus Networks, Inc.
  *                    Donald Sharp
  * Copyright (C) 2017/2018 6WIND
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "zebra.h"
 
@@ -127,6 +112,8 @@ int zebra_ns_enable(ns_id_t ns_id, void **info)
        zebra_dplane_ns_enable(zns, true);
        interface_list(zns);
        route_read(zns);
+
+       vlan_read(zns);
        kernel_read_pbr_rules(zns);
        kernel_read_tc_qdisc(zns);
 
index 7a0ffbc1ee6f3edcdef662f0104c552c6ea1cf09..5e8764854ed33671d483890ceb1fd65cf55b4357 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra NS header
  * Copyright (C) 2016 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #if !defined(__ZEBRA_NS_H__)
 #define __ZEBRA_NS_H__
index d18c5fd5ebb4cb07831feb00d383e377fcf7d924..7cfb3294eb893e513e43e6a49bbb02711b14b898 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra opaque message handler module
  * Copyright (c) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index a9610bfef5734f78e47685a208158266a62dc175..86372da422a11dedebc00ad0ed4cf104cda40ecf 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra opaque message zapi message handler
  * Copyright (c) 2020 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 405241fc22808b4ea40022a9aea1426e606aba39..56cac1342ef8622718848818e34a22afd0ce2a13 100644 (file)
@@ -1,22 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Policy Based Routing (PBR) main handling.
  * Copyright (C) 2018  Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
@@ -648,7 +632,8 @@ static void zebra_pbr_expand_rule(struct zebra_pbr_rule *rule)
                        zebra_neigh_ref(action->ifindex, &ip, rule);
                        break;
 
-               default:
+               case NEXTHOP_TYPE_BLACKHOLE:
+               case NEXTHOP_TYPE_IFINDEX:
                        action->afi = AFI_UNSPEC;
                }
        }
index 60457914cc2439d4e160941db0d6e506da403c29..15ad4e35cf0ec801dd25c79c07f5512b716dfefa 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Policy Based Routing (PBR) Data structures and definitions
  * These are public definitions referenced by multiple files.
  * Copyright (C) 2018 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_PBR_H
index 4a18eb021e8edab9729316a20515138d37626ae1..a8f4953d5a1e7949501c02998e396d4c9632e6aa 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Kernel routing table updates using netlink over GNU/Linux system.
  * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -31,7 +16,6 @@
 #include "ptm_lib.h"
 #include "rib.h"
 #include "stream.h"
-#include "lib/version.h"
 #include "vrf.h"
 #include "vty.h"
 #include "lib_errors.h"
index 2eed7f301c8bbb5c886b1654809439cd0d2b475b..9cea96555b650dc94575baf94317efb2c6285272 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Definitions for prescriptive topology module (PTM).
  * Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_PTM_H
index 537d69fbcaad1dad85e15b2406431f10610f71cf..cab6944a87a5e19456a9e929c46121550f8542de 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 4daf405825372f82f6a572c25742a56a1ce61e2b..0fa8a9b792b0497fdf194f67917f53018aa2f9eb 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /**
  * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
index be089fc7594c8bf55ea6db7e8b6617c3f711543a..dc56ba3c3042d4416911c57337b0183671d74802 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra PW code
  * Copyright (C) 2016 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 9800c5853a5456186e18883fed718fb27496d17b..d939cc07eaa941fdcce4570ed1961d70cbd6f60a 100644 (file)
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra PW code
  * Copyright (C) 2016 Volta Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
  */
 
 #ifndef ZEBRA_PW_H_
index 2f71a10d3d249198e244ae2c126ec1737e391678..6c499b77d70adcdec329dcb2a53f84688c487e10 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Routing Information Base.
  * Copyright (C) 1997, 98, 99, 2001 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -99,42 +84,79 @@ static const struct {
        uint8_t distance;
        enum meta_queue_indexes meta_q_map;
 } route_info[ZEBRA_ROUTE_MAX] = {
-       [ZEBRA_ROUTE_NHG] = {ZEBRA_ROUTE_NHG, 255 /* Unneeded for nhg's */,
-                            META_QUEUE_NHG},
-       [ZEBRA_ROUTE_SYSTEM] = {ZEBRA_ROUTE_SYSTEM, 0, META_QUEUE_KERNEL},
-       [ZEBRA_ROUTE_KERNEL] = {ZEBRA_ROUTE_KERNEL, 0, META_QUEUE_KERNEL},
-       [ZEBRA_ROUTE_CONNECT] = {ZEBRA_ROUTE_CONNECT, 0, META_QUEUE_CONNECTED},
-       [ZEBRA_ROUTE_STATIC] = {ZEBRA_ROUTE_STATIC, 1, META_QUEUE_STATIC},
-       [ZEBRA_ROUTE_RIP] = {ZEBRA_ROUTE_RIP, 120, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_RIPNG] = {ZEBRA_ROUTE_RIPNG, 120, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_OSPF] = {ZEBRA_ROUTE_OSPF, 110, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, 110, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, 115, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */,
+       [ZEBRA_ROUTE_NHG] =
+               {ZEBRA_ROUTE_NHG,
+                ZEBRA_MAX_DISTANCE_DEFAULT /* Unneeded for nhg's */,
+                META_QUEUE_NHG},
+       [ZEBRA_ROUTE_SYSTEM] = {ZEBRA_ROUTE_SYSTEM,
+                               ZEBRA_KERNEL_DISTANCE_DEFAULT,
+                               META_QUEUE_KERNEL},
+       [ZEBRA_ROUTE_KERNEL] = {ZEBRA_ROUTE_KERNEL,
+                               ZEBRA_KERNEL_DISTANCE_DEFAULT,
+                               META_QUEUE_KERNEL},
+       [ZEBRA_ROUTE_CONNECT] = {ZEBRA_ROUTE_CONNECT,
+                                ZEBRA_CONNECT_DISTANCE_DEFAULT,
+                                META_QUEUE_CONNECTED},
+       [ZEBRA_ROUTE_STATIC] = {ZEBRA_ROUTE_STATIC,
+                               ZEBRA_STATIC_DISTANCE_DEFAULT,
+                               META_QUEUE_STATIC},
+       [ZEBRA_ROUTE_RIP] = {ZEBRA_ROUTE_RIP, ZEBRA_RIP_DISTANCE_DEFAULT,
+                            META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_RIPNG] = {ZEBRA_ROUTE_RIPNG, ZEBRA_RIP_DISTANCE_DEFAULT,
+                              META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_OSPF] = {ZEBRA_ROUTE_OSPF, ZEBRA_OSPF_DISTANCE_DEFAULT,
+                             META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, ZEBRA_OSPF6_DISTANCE_DEFAULT,
+                              META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, ZEBRA_ISIS_DISTANCE_DEFAULT,
+                             META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP,
+                            ZEBRA_EBGP_DISTANCE_DEFAULT /* IBGP is 200. */,
                             META_QUEUE_BGP},
-       [ZEBRA_ROUTE_PIM] = {ZEBRA_ROUTE_PIM, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_EIGRP] = {ZEBRA_ROUTE_EIGRP, 90, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_NHRP] = {ZEBRA_ROUTE_NHRP, 10, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_HSLS] = {ZEBRA_ROUTE_HSLS, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_OLSR] = {ZEBRA_ROUTE_OLSR, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_TABLE] = {ZEBRA_ROUTE_TABLE, 150, META_QUEUE_STATIC},
-       [ZEBRA_ROUTE_LDP] = {ZEBRA_ROUTE_LDP, 150, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_VNC] = {ZEBRA_ROUTE_VNC, 20, META_QUEUE_BGP},
-       [ZEBRA_ROUTE_VNC_DIRECT] = {ZEBRA_ROUTE_VNC_DIRECT, 20, META_QUEUE_BGP},
-       [ZEBRA_ROUTE_VNC_DIRECT_RH] = {ZEBRA_ROUTE_VNC_DIRECT_RH, 20,
+       [ZEBRA_ROUTE_PIM] = {ZEBRA_ROUTE_PIM, ZEBRA_MAX_DISTANCE_DEFAULT,
+                            META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_EIGRP] = {ZEBRA_ROUTE_EIGRP, ZEBRA_EIGRP_DISTANCE_DEFAULT,
+                              META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_NHRP] = {ZEBRA_ROUTE_NHRP, ZEBRA_NHRP_DISTANCE_DEFAULT,
+                             META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_HSLS] = {ZEBRA_ROUTE_HSLS, ZEBRA_MAX_DISTANCE_DEFAULT,
+                             META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_OLSR] = {ZEBRA_ROUTE_OLSR, ZEBRA_MAX_DISTANCE_DEFAULT,
+                             META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_TABLE] = {ZEBRA_ROUTE_TABLE, ZEBRA_TABLE_DISTANCE_DEFAULT, META_QUEUE_STATIC},
+       [ZEBRA_ROUTE_LDP] = {ZEBRA_ROUTE_LDP, ZEBRA_LDP_DISTANCE_DEFAULT,
+                            META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_VNC] = {ZEBRA_ROUTE_VNC, ZEBRA_EBGP_DISTANCE_DEFAULT,
+                            META_QUEUE_BGP},
+       [ZEBRA_ROUTE_VNC_DIRECT] = {ZEBRA_ROUTE_VNC_DIRECT,
+                                   ZEBRA_EBGP_DISTANCE_DEFAULT,
+                                   META_QUEUE_BGP},
+       [ZEBRA_ROUTE_VNC_DIRECT_RH] = {ZEBRA_ROUTE_VNC_DIRECT_RH,
+                                      ZEBRA_EBGP_DISTANCE_DEFAULT,
                                       META_QUEUE_BGP},
-       [ZEBRA_ROUTE_BGP_DIRECT] = {ZEBRA_ROUTE_BGP_DIRECT, 20, META_QUEUE_BGP},
-       [ZEBRA_ROUTE_BGP_DIRECT_EXT] = {ZEBRA_ROUTE_BGP_DIRECT_EXT, 20,
+       [ZEBRA_ROUTE_BGP_DIRECT] = {ZEBRA_ROUTE_BGP_DIRECT,
+                                   ZEBRA_EBGP_DISTANCE_DEFAULT,
+                                   META_QUEUE_BGP},
+       [ZEBRA_ROUTE_BGP_DIRECT_EXT] = {ZEBRA_ROUTE_BGP_DIRECT_EXT,
+                                       ZEBRA_EBGP_DISTANCE_DEFAULT,
                                        META_QUEUE_BGP},
-       [ZEBRA_ROUTE_BABEL] = {ZEBRA_ROUTE_BABEL, 100, META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_SHARP] = {ZEBRA_ROUTE_SHARP, 150, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_PBR] = {ZEBRA_ROUTE_PBR, 200, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_BFD] = {ZEBRA_ROUTE_BFD, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_OPENFABRIC] = {ZEBRA_ROUTE_OPENFABRIC, 115,
+       [ZEBRA_ROUTE_BABEL] = {ZEBRA_ROUTE_BABEL, ZEBRA_BABEL_DISTANCE_DEFAULT,
+                              META_QUEUE_NOTBGP},
+       [ZEBRA_ROUTE_SHARP] = {ZEBRA_ROUTE_SHARP, ZEBRA_SHARP_DISTANCE_DEFAULT,
+                              META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_PBR] = {ZEBRA_ROUTE_PBR, ZEBRA_PBR_DISTANCE_DEFAULT,
+                            META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_BFD] = {ZEBRA_ROUTE_BFD, ZEBRA_MAX_DISTANCE_DEFAULT,
+                            META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_OPENFABRIC] = {ZEBRA_ROUTE_OPENFABRIC,
+                                   ZEBRA_OPENFABRIC_DISTANCE_DEFAULT,
                                    META_QUEUE_NOTBGP},
-       [ZEBRA_ROUTE_VRRP] = {ZEBRA_ROUTE_VRRP, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_SRTE] = {ZEBRA_ROUTE_SRTE, 255, META_QUEUE_OTHER},
-       [ZEBRA_ROUTE_ALL] = {ZEBRA_ROUTE_ALL, 255, META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_VRRP] = {ZEBRA_ROUTE_VRRP, ZEBRA_MAX_DISTANCE_DEFAULT,
+                             META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_SRTE] = {ZEBRA_ROUTE_SRTE, ZEBRA_MAX_DISTANCE_DEFAULT,
+                             META_QUEUE_OTHER},
+       [ZEBRA_ROUTE_ALL] = {ZEBRA_ROUTE_ALL, ZEBRA_MAX_DISTANCE_DEFAULT,
+                            META_QUEUE_OTHER},
        /* Any new route type added to zebra, should be mirrored here */
 
        /* no entry/default: 150 */
@@ -487,31 +509,28 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
        return NULL;
 }
 
-struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
-                                            struct in_addr addr,
-                                            struct route_node **rn_out)
+struct route_entry *rib_match_multicast(afi_t afi, vrf_id_t vrf_id,
+                                       union g_addr *gaddr,
+                                       struct route_node **rn_out)
 {
        struct route_entry *re = NULL, *mre = NULL, *ure = NULL;
        struct route_node *m_rn = NULL, *u_rn = NULL;
-       union g_addr gaddr = {.ipv4 = addr};
 
        switch (zrouter.ipv4_multicast_mode) {
        case MCAST_MRIB_ONLY:
-               return rib_match(AFI_IP, SAFI_MULTICAST, vrf_id, &gaddr,
-                                rn_out);
+               return rib_match(afi, SAFI_MULTICAST, vrf_id, gaddr, rn_out);
        case MCAST_URIB_ONLY:
-               return rib_match(AFI_IP, SAFI_UNICAST, vrf_id, &gaddr, rn_out);
+               return rib_match(afi, SAFI_UNICAST, vrf_id, gaddr, rn_out);
        case MCAST_NO_CONFIG:
        case MCAST_MIX_MRIB_FIRST:
-               re = mre = rib_match(AFI_IP, SAFI_MULTICAST, vrf_id, &gaddr,
-                                    &m_rn);
+               re = mre = rib_match(afi, SAFI_MULTICAST, vrf_id, gaddr, &m_rn);
                if (!mre)
-                       re = ure = rib_match(AFI_IP, SAFI_UNICAST, vrf_id,
-                                            &gaddr, &u_rn);
+                       re = ure = rib_match(afi, SAFI_UNICAST, vrf_id, gaddr,
+                                            &u_rn);
                break;
        case MCAST_MIX_DISTANCE:
-               mre = rib_match(AFI_IP, SAFI_MULTICAST, vrf_id, &gaddr, &m_rn);
-               ure = rib_match(AFI_IP, SAFI_UNICAST, vrf_id, &gaddr, &u_rn);
+               mre = rib_match(afi, SAFI_MULTICAST, vrf_id, gaddr, &m_rn);
+               ure = rib_match(afi, SAFI_UNICAST, vrf_id, gaddr, &u_rn);
                if (mre && ure)
                        re = ure->distance < mre->distance ? ure : mre;
                else if (mre)
@@ -520,8 +539,8 @@ struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
                        re = ure;
                break;
        case MCAST_MIX_PFXLEN:
-               mre = rib_match(AFI_IP, SAFI_MULTICAST, vrf_id, &gaddr, &m_rn);
-               ure = rib_match(AFI_IP, SAFI_UNICAST, vrf_id, &gaddr, &u_rn);
+               mre = rib_match(afi, SAFI_MULTICAST, vrf_id, gaddr, &m_rn);
+               ure = rib_match(afi, SAFI_UNICAST, vrf_id, gaddr, &u_rn);
                if (mre && ure)
                        re = u_rn->p.prefixlen > m_rn->p.prefixlen ? ure : mre;
                else if (mre)
@@ -536,10 +555,12 @@ struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
 
        if (IS_ZEBRA_DEBUG_RIB) {
                char buf[BUFSIZ];
-               inet_ntop(AF_INET, &addr, buf, BUFSIZ);
+               inet_ntop(afi == AFI_IP ? AF_INET : AF_INET6, gaddr, buf,
+                         BUFSIZ);
 
-               zlog_debug("%s: %s: vrf: %s(%u) found %s, using %s", __func__,
-                          buf, vrf_id_to_name(vrf_id), vrf_id,
+               zlog_debug("%s: %s: %pRN vrf: %s(%u) found %s, using %s",
+                          __func__, buf, (re == mre) ? m_rn : u_rn,
+                          vrf_id_to_name(vrf_id), vrf_id,
                           mre ? (ure ? "MRIB+URIB" : "MRIB")
                               : ure ? "URIB" : "nothing",
                           re == ure ? "URIB" : re == mre ? "MRIB" : "none");
@@ -547,62 +568,6 @@ struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
        return re;
 }
 
-struct route_entry *rib_match_ipv6_multicast(vrf_id_t vrf_id,
-                                            struct in6_addr addr,
-                                            struct route_node **rn_out)
-{
-       struct route_entry *re = NULL, *mre = NULL, *ure = NULL;
-       struct route_node *m_rn = NULL, *u_rn = NULL;
-       union g_addr gaddr = {.ipv6 = addr};
-
-       switch (zrouter.ipv4_multicast_mode) {
-       case MCAST_MRIB_ONLY:
-               return rib_match(AFI_IP6, SAFI_MULTICAST, vrf_id, &gaddr,
-                                rn_out);
-       case MCAST_URIB_ONLY:
-               return rib_match(AFI_IP6, SAFI_UNICAST, vrf_id, &gaddr, rn_out);
-       case MCAST_NO_CONFIG:
-       case MCAST_MIX_MRIB_FIRST:
-               re = mre = rib_match(AFI_IP6, SAFI_MULTICAST, vrf_id, &gaddr,
-                                    &m_rn);
-               if (!mre)
-                       re = ure = rib_match(AFI_IP6, SAFI_UNICAST, vrf_id,
-                                            &gaddr, &u_rn);
-               break;
-       case MCAST_MIX_DISTANCE:
-               mre = rib_match(AFI_IP6, SAFI_MULTICAST, vrf_id, &gaddr, &m_rn);
-               ure = rib_match(AFI_IP6, SAFI_UNICAST, vrf_id, &gaddr, &u_rn);
-               if (mre && ure)
-                       re = ure->distance < mre->distance ? ure : mre;
-               else if (mre)
-                       re = mre;
-               else if (ure)
-                       re = ure;
-               break;
-       case MCAST_MIX_PFXLEN:
-               mre = rib_match(AFI_IP6, SAFI_MULTICAST, vrf_id, &gaddr, &m_rn);
-               ure = rib_match(AFI_IP6, SAFI_UNICAST, vrf_id, &gaddr, &u_rn);
-               if (mre && ure)
-                       re = u_rn->p.prefixlen > m_rn->p.prefixlen ? ure : mre;
-               else if (mre)
-                       re = mre;
-               else if (ure)
-                       re = ure;
-               break;
-       }
-
-       if (rn_out)
-               *rn_out = (re == mre) ? m_rn : u_rn;
-
-       if (IS_ZEBRA_DEBUG_RIB)
-               zlog_debug("%s: %pI6: vrf: %s(%u) found %s, using %s", __func__,
-                          &addr, vrf_id_to_name(vrf_id), vrf_id,
-                          mre ? (ure ? "MRIB+URIB" : "MRIB")
-                              : ure ? "URIB" : "nothing",
-                          re == ure ? "URIB" : re == mre ? "MRIB" : "none");
-       return re;
-}
-
 struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, vrf_id_t vrf_id)
 {
        struct route_table *table;
@@ -2158,7 +2123,58 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
                    (old_re && RIB_SYSTEM_ROUTE(old_re)))
                        zebra_rib_fixup_system(rn);
                break;
-       default:
+
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
        }
 
@@ -3851,7 +3867,9 @@ static void rib_link(struct route_node *rn, struct route_entry *re, int process)
 
                rmap_name = zebra_get_import_table_route_map(afi, re->table);
                zebra_add_import_table_entry(zvrf, rn, re, rmap_name);
-       } else if (process)
+       }
+
+       if (process)
                rib_queue_add(rn);
 }
 
@@ -3926,11 +3944,9 @@ void rib_delnode(struct route_node *rn, struct route_entry *re)
                        zlog_debug("%s(%u):%pRN: Freeing route rn %p, re %p (%s)",
                                   vrf_id_to_name(re->vrf_id), re->vrf_id, rn,
                                   rn, re, zebra_route_string(re->type));
-
-               rib_unlink(rn, re);
-       } else {
-               rib_queue_add(rn);
        }
+
+       rib_queue_add(rn);
 }
 
 /*
@@ -3974,7 +3990,8 @@ static void _route_entry_dump_nh(const struct route_entry *re,
        if (nexthop->nh_label && nexthop->nh_label->num_labels > 0) {
                mpls_label2str(nexthop->nh_label->num_labels,
                               nexthop->nh_label->label, label_str,
-                              sizeof(label_str), 0 /*pretty*/);
+                              sizeof(label_str), nexthop->nh_label_type,
+                              0 /*pretty*/);
                strlcat(label_str, ", ", sizeof(label_str));
        }
 
@@ -4334,7 +4351,7 @@ void rib_update_table(struct route_table *table, enum rib_update_event event,
                case RIB_UPDATE_OTHER:
                        rib_update_route_node(rn, rtype);
                        break;
-               default:
+               case RIB_UPDATE_MAX:
                        break;
                }
        }
index e24556122b8862a75e1031309d60d95d2a83924c..2666dc232f08093513002b3489e7b89c40295f67 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra next hop tracking code
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1401,7 +1386,8 @@ void show_nexthop_json_helper(json_object *json_nexthop,
                        json_object_string_addf(json_nexthop, "source", "%pI6",
                                                &nexthop->src.ipv6);
                break;
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
@@ -1412,8 +1398,14 @@ void show_nexthop_json_helper(json_object *json_nexthop,
                     label_index < nexthop->nh_label->num_labels; label_index++)
                        json_object_array_add(
                                json_labels,
-                               json_object_new_int(
-                                       nexthop->nh_label->label[label_index]));
+                               json_object_new_int((
+                                       (nexthop->nh_label_type ==
+                                        ZEBRA_LSP_EVPN)
+                                               ? label2vni(
+                                                         &nexthop->nh_label->label
+                                                                  [label_index])
+                                               : nexthop->nh_label->label
+                                                         [label_index])));
 
                json_object_object_add(json_nexthop, "labels", json_labels);
        }
@@ -1523,7 +1515,8 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
                if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
                        vty_out(vty, ", src %pI6", &nexthop->src.ipv6);
                break;
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
@@ -1532,7 +1525,7 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
                vty_out(vty, ", label %s",
                        mpls_label2str(nexthop->nh_label->num_labels,
                                       nexthop->nh_label->label, buf,
-                                      sizeof(buf), 1));
+                                      sizeof(buf), nexthop->nh_label_type, 1));
        }
 
        if (nexthop->nh_srv6) {
index 88be69a81db31dc8fbc180a865806a3ec9c2496d..07db7bbd7a108f33b9c48adc7aa133b1a3ca8694 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra next hop tracking header
  * Copyright (C) 2013 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_RNH_H
index 4f43cea4930df0794d96f96c342d90b673e50c24..c5bccd05a6c3952d2cc1b3a0f297379a32572f3b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra routemap.
  * Copyright (C) 2006 IBM Corporation
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1049,12 +1034,19 @@ route_match_ip_next_hop(void *rule, const struct prefix *prefix, void *object)
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        alist = access_list_lookup(AFI_IP, (char *)rule);
-       if (alist == NULL)
+       if (alist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (access_list_apply(alist, &p) == FILTER_DENY ? RMAP_NOMATCH
                                                            : RMAP_MATCH);
@@ -1105,12 +1097,19 @@ route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix,
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        plist = prefix_list_lookup(AFI_IP, (char *)rule);
-       if (plist == NULL)
+       if (plist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (prefix_list_apply(plist, &p) == PREFIX_DENY ? RMAP_NOMATCH
                                                            : RMAP_MATCH);
@@ -1145,8 +1144,13 @@ route_match_address(afi_t afi, void *rule, const struct prefix *prefix,
        struct access_list *alist;
 
        alist = access_list_lookup(afi, (char *)rule);
-       if (alist == NULL)
+       if (alist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (access_list_apply(alist, prefix) == FILTER_DENY ? RMAP_NOMATCH
                                                                : RMAP_MATCH);
@@ -1202,8 +1206,13 @@ route_match_address_prefix_list(void *rule, const struct prefix *prefix,
        struct prefix_list *plist;
 
        plist = prefix_list_lookup(afi, (char *)rule);
-       if (plist == NULL)
+       if (plist == NULL) {
+               if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL))
+                       zlog_debug(
+                               "%s: Prefix List %s specified does not exist defaulting to NO_MATCH",
+                               __func__, (char *)rule);
                return RMAP_NOMATCH;
+       }
 
        return (prefix_list_apply(plist, prefix) == PREFIX_DENY ? RMAP_NOMATCH
                                                                : RMAP_MATCH);
@@ -1364,7 +1373,9 @@ route_match_ip_nexthop_prefix_len(void *rule, const struct prefix *prefix,
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        return ((p.prefixlen == *prefixlen) ? RMAP_MATCH : RMAP_NOMATCH);
index 02b01fa53a0cd0103177f0c0ef3e55a7ad7a80d5..f77735edc21b6c66ead8b7c02b5152cf2b57d27a 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra routemap header
  * Copyright (C) 2015 Cumulus Networks, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef __ZEBRA_ROUTEMAP_H__
index 9da4589501e9d88edc82f00d868d91c3050c5d5b..11ea7d7abb2e0ae0fbe52cf152f1bff2e4bcd395 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index a43f2b2ae905298a06688ece470d9b4725d40215..19b50f3a6329e0038eb1f2e6e72038063a058815 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020        Vmware
  *                           Sarita Patra
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_ZEBRA_ROUTEMAP_NB_H_
index a9a7b66ce7ec0109ac52ffe2ca69a9cd670aeed6..21e09a81f7550fe8584f69a99976772ce9b3e547 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Router Code.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #include "zebra.h"
 
index e0ef86f0825081451f9f8e82fc9bf6f96d0a73bf..3112fcab4647ecf03863e59ddd2e0add7c5ccb72 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra Router header.
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *                    Donald Sharp
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 #ifndef __ZEBRA_ROUTER_H__
 #define __ZEBRA_ROUTER_H__
index 5c67ad4f1674d3cebe66a2dbf21615de59056134..3f107cb48d4504a258e2a6b8ba26dc09032f3695 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frrscript encoders and decoders for data structures in Zebra
  * Copyright (C) 2021 Donald Lee
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
index 5eb59753c672e4cc3fd0c030304b61d041400d69..85bfe845a2c39477cdcf1a1f8a58e60050d041cf 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * frrscript encoders and decoders for data structures in Zebra
  * Copyright (C) 2021 Donald Lee
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SCRIPT_H
index 6fe24dfa5492b0532a32101a40a46829104e3a76..c8b652f54a36f7ca5f48ab6aa340c88fd48ba054 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* FIB SNMP.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
index 746158c4b31d937c971e7e4d4ce9c2cca03a725b..c0b83382c457f037267ff3eaa099dc4cc7c82bd8 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra SR-TE code
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -140,7 +125,7 @@ static int zebra_sr_policy_notify_update_client(struct zebra_sr_policy *policy,
                stream_putc(s, IPV6_MAX_BITLEN);
                stream_put(s, &policy->endpoint.ipaddr_v6, IPV6_MAX_BYTELEN);
                break;
-       default:
+       case IPADDR_NONE:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown policy endpoint address family: %u",
                          __func__, policy->endpoint.ipa_type);
@@ -202,7 +187,7 @@ static void zebra_sr_policy_notify_update(struct zebra_sr_policy *policy)
                p.prefixlen = IPV6_MAX_BITLEN;
                p.u.prefix6 = policy->endpoint.ipaddr_v6;
                break;
-       default:
+       case IPADDR_NONE:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown policy endpoint address family: %u",
                          __func__, policy->endpoint.ipa_type);
index dff2f595fd3a822c3723bcded5964e09998dbbd7..1cdee454048a75ede8a5b781e73ef8bc0c935d65 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra's client header.
  * Copyright (C) 2020 Netdef, Inc.
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SRTE_H
index d61e4f8045d9493f8ca2ed78f057c25cab8a4f91..94b93e5e8dbba3cf29e4ef3acaf5399f543b21f6 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra SRv6 definitions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
  * Copyright (C) 2020  Masakazu Asama
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index f320b9ca0f94e3c514b64b602ad2af028118483e..51db83d6fb64f8ead0b36d13b7095cccedf8dd7e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra SRv6 definitions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SRV6_H
index b4fd5f01817d3b392eb895b5ece2dbdf5d97c7dc..3775d3dcdfc4133fe4f377d03ec2d80714db7ea0 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra SRv6 VTY functions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 2f8b5048d5948016f784a285be6f2e8519f71d27..f2730b09e017391bdbe8bf530e926c2aad38db7f 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra SRv6 VTY functions
  * Copyright (C) 2020  Hiroki Shirokura, LINE Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_SRV6_VTY_H
index 09d9986fb38b2f75acc616233dc6911e0e4b81fb..3d7e03b63ee275c14e9d4dad03c340e06eca3a9f 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Traffic Control (TC) main handling.
  *
  * Copyright (C) 2022 Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index 832972b713c1bc37e58c51153690a7e9e367e4b8..335430c93dbfd661c8c6b4eca9cf1cc64f3bbca2 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Traffic Control (TC) Data structures and definitions
  * These are public definitions referenced by multiple files.
  *
  * Copyright (C) 2022 Shichu Yang
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_TC_H
index 374305fcda5f2f0327399bdc440e741854a691ed..17528c4bf1f8a110036c896143204cb72ba61343 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Tracing for zebra
  *
  * Copyright (C) 2020  NVIDIA Corporation
  * Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #if !defined(__ZEBRA_TRACE_H__) || defined(TRACEPOINT_HEADER_MULTI_READ)
index be5e91495f90c3ab4c713c5711c2493308d2176e..3365cdcdbaa8b9e25cb106b6eb263f9faccd4040 100644 (file)
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2016 CumulusNetworks
  *                    Donald Sharp
  *
  * This file is part of Quagga
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
index 02e3c197c9bea70ee71c42984813875edd7696c7..b23b7282610bdf5de89129807d010833a191006f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Vrf Header
  * Copyright (C) 2016 Cumulus Networks
  *                    Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #if !defined(__ZEBRA_VRF_H__)
 #define __ZEBRA_VRF_H__
index 8a73ae3d281e8c53c320853042c7ec94012651b3..6d6143002999e2c780be2d4ef8c85ca3f4e01057 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Zebra VTY functions
  * Copyright (C) 2002 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -34,6 +19,7 @@
 #include "srcdest_table.h"
 #include "vxlan.h"
 #include "termtable.h"
+#include "affinitymap.h"
 
 #include "zebra/zebra_router.h"
 #include "zebra/zserv.h"
@@ -41,6 +27,7 @@
 #include "zebra/zebra_mpls.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/redistribute.h"
+#include "zebra/zebra_affinitymap.h"
 #include "zebra/zebra_routemap.h"
 #include "lib/json.h"
 #include "lib/route_opaque.h"
@@ -144,11 +131,12 @@ DEFUN (no_ip_multicast_mode,
 }
 
 
-DEFUN (show_ip_rpf,
+DEFPY (show_ip_rpf,
        show_ip_rpf_cmd,
-       "show ip rpf [json]",
+       "show [ip$ip|ipv6$ipv6] rpf [json]",
        SHOW_STR
        IP_STR
+       IPV6_STR
        "Display RPF information for multicast source\n"
        JSON_STR)
 {
@@ -157,32 +145,46 @@ DEFUN (show_ip_rpf,
                .multi = false,
        };
 
-       return do_show_ip_route(vty, VRF_DEFAULT_NAME, AFI_IP, SAFI_MULTICAST,
-                               false, uj, 0, NULL, false, 0, 0, 0, false,
-                               &ctx);
+       return do_show_ip_route(vty, VRF_DEFAULT_NAME, ip ? AFI_IP : AFI_IP6,
+                               SAFI_MULTICAST, false, uj, 0, NULL, false, 0, 0,
+                               0, false, &ctx);
 }
 
-DEFUN (show_ip_rpf_addr,
+DEFPY (show_ip_rpf_addr,
        show_ip_rpf_addr_cmd,
-       "show ip rpf A.B.C.D",
+       "show ip rpf A.B.C.D$address",
        SHOW_STR
        IP_STR
        "Display RPF information for multicast source\n"
        "IP multicast source address (e.g. 10.0.0.0)\n")
 {
-       int idx_ipv4 = 3;
-       struct in_addr addr;
        struct route_node *rn;
        struct route_entry *re;
-       int ret;
 
-       ret = inet_aton(argv[idx_ipv4]->arg, &addr);
-       if (ret == 0) {
-               vty_out(vty, "%% Malformed address\n");
-               return CMD_WARNING;
-       }
+       re = rib_match_multicast(AFI_IP, VRF_DEFAULT, (union g_addr *)&address,
+                                &rn);
 
-       re = rib_match_ipv4_multicast(VRF_DEFAULT, addr, &rn);
+       if (re)
+               vty_show_ip_route_detail(vty, rn, 1, false, false);
+       else
+               vty_out(vty, "%% No match for RPF lookup\n");
+
+       return CMD_SUCCESS;
+}
+
+DEFPY (show_ipv6_rpf_addr,
+       show_ipv6_rpf_addr_cmd,
+       "show ipv6 rpf X:X::X:X$address",
+       SHOW_STR
+       IPV6_STR
+       "Display RPF information for multicast source\n"
+       "IPv6 multicast source address\n")
+{
+       struct route_node *rn;
+       struct route_entry *re;
+
+       re = rib_match_multicast(AFI_IP6, VRF_DEFAULT, (union g_addr *)&address,
+                                &rn);
 
        if (re)
                vty_show_ip_route_detail(vty, rn, 1, false, false);
@@ -405,7 +407,8 @@ static void show_nexthop_detail_helper(struct vty *vty,
                }
                break;
 
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
@@ -417,7 +420,8 @@ static void show_nexthop_detail_helper(struct vty *vty,
                vty_out(vty, ", label %s",
                        mpls_label2str(nexthop->nh_label->num_labels,
                                       nexthop->nh_label->label, buf,
-                                      sizeof(buf), 1 /*pretty*/));
+                                      sizeof(buf), nexthop->nh_label_type,
+                                      1 /*pretty*/));
        }
 
        if (nexthop->weight)
@@ -3015,20 +3019,37 @@ DEFPY(show_evpn_es_evi,
        return CMD_SUCCESS;
 }
 
-DEFPY(show_evpn_access_vlan,
-      show_evpn_access_vlan_cmd,
-      "show evpn access-vlan [(1-4094)$vid | detail$detail] [json$json]",
+DEFPY(show_evpn_access_vlan, show_evpn_access_vlan_cmd,
+      "show evpn access-vlan [IFNAME$if_name (1-4094)$vid | detail$detail] [json$json]",
       SHOW_STR
       "EVPN\n"
       "Access VLANs\n"
+      "Interface Name\n"
       "VLAN ID\n"
-      "Detailed information\n"
-      JSON_STR)
+      "Detailed information\n" JSON_STR)
 {
        bool uj = !!json;
 
-       if (vid) {
-               zebra_evpn_acc_vl_show_vid(vty, uj, vid);
+       if (if_name && vid) {
+               bool found = false;
+               struct vrf *vrf;
+               struct interface *ifp;
+
+               RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
+                       if (if_name) {
+                               ifp = if_lookup_by_name(if_name, vrf->vrf_id);
+                               if (ifp) {
+                                       zebra_evpn_acc_vl_show_vid(vty, uj, vid,
+                                                                  ifp);
+                                       found = true;
+                                       break;
+                               }
+                       }
+               }
+               if (!found) {
+                       vty_out(vty, "%% Can't find interface %s\n", if_name);
+                       return CMD_WARNING;
+               }
        } else {
                if (detail)
                        zebra_evpn_acc_vl_show_detail(vty, uj);
@@ -3178,6 +3199,30 @@ DEFUN (show_evpn_nh_vni_ip,
        return CMD_SUCCESS;
 }
 
+DEFUN_HIDDEN (show_evpn_nh_svd_ip,
+              show_evpn_nh_svd_ip_cmd,
+              "show evpn next-hops svd ip WORD [json]",
+              SHOW_STR
+              "EVPN\n"
+              "Remote Vteps\n"
+              "Single Vxlan Device\n"
+              "Ip address\n"
+              "Host address (ipv4 or ipv6)\n"
+              JSON_STR)
+{
+       struct ipaddr ip;
+       bool uj = use_json(argc, argv);
+
+       if (str2ipaddr(argv[5]->arg, &ip) != 0) {
+               if (!uj)
+                       vty_out(vty, "%% Malformed Neighbor address\n");
+               return CMD_WARNING;
+       }
+       zebra_vxlan_print_specific_nh_l3vni(vty, 0, &ip, uj);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN (show_evpn_nh_vni,
        show_evpn_nh_vni_cmd,
        "show evpn next-hops vni " CMD_VNI_RANGE "[json]",
@@ -3197,6 +3242,22 @@ DEFUN (show_evpn_nh_vni,
        return CMD_SUCCESS;
 }
 
+DEFUN_HIDDEN (show_evpn_nh_svd,
+              show_evpn_nh_svd_cmd,
+              "show evpn next-hops svd [json]",
+              SHOW_STR
+              "EVPN\n"
+              "Remote VTEPs\n"
+              "Single Vxlan Device\n"
+              JSON_STR)
+{
+       bool uj = use_json(argc, argv);
+
+       zebra_vxlan_print_nh_svd(vty, uj);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN (show_evpn_nh_vni_all,
        show_evpn_nh_vni_all_cmd,
        "show evpn next-hops vni all [json]",
@@ -4495,6 +4556,8 @@ void zebra_vty_init(void)
        /* Route-map */
        zebra_route_map_init();
 
+       zebra_affinity_map_init();
+
        install_node(&ip_node);
        install_node(&protocol_node);
 
@@ -4528,6 +4591,7 @@ void zebra_vty_init(void)
 
        install_element(VIEW_NODE, &show_ip_rpf_cmd);
        install_element(VIEW_NODE, &show_ip_rpf_addr_cmd);
+       install_element(VIEW_NODE, &show_ipv6_rpf_addr_cmd);
 
        install_element(CONFIG_NODE, &ip_nht_default_route_cmd);
        install_element(CONFIG_NODE, &no_ip_nht_default_route_cmd);
@@ -4552,7 +4616,9 @@ void zebra_vty_init(void)
        install_element(VIEW_NODE, &show_evpn_rmac_vni_cmd);
        install_element(VIEW_NODE, &show_evpn_rmac_vni_all_cmd);
        install_element(VIEW_NODE, &show_evpn_nh_vni_ip_cmd);
+       install_element(VIEW_NODE, &show_evpn_nh_svd_ip_cmd);
        install_element(VIEW_NODE, &show_evpn_nh_vni_cmd);
+       install_element(VIEW_NODE, &show_evpn_nh_svd_cmd);
        install_element(VIEW_NODE, &show_evpn_nh_vni_all_cmd);
        install_element(VIEW_NODE, &show_evpn_mac_vni_cmd);
        install_element(VIEW_NODE, &show_evpn_mac_vni_all_cmd);
index c6ff5089ca9e50dabdf34187b32665d056e0b858..19f1839ac7c4052791400046c17d05b2310b6352 100644 (file)
@@ -1,23 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra EVPN for VxLAN code
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #include <zebra.h>
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn.h"
 #include "zebra/zebra_evpn_mac.h"
 #include "zebra/zebra_evpn_neigh.h"
-#include "zebra/zebra_vxlan_private.h"
 #include "zebra/zebra_evpn_mh.h"
 #include "zebra/zebra_evpn_vxlan.h"
 #include "zebra/zebra_router.h"
@@ -72,6 +57,9 @@ DEFINE_HOOK(zebra_rmac_update,
 /* config knobs */
 static bool accept_bgp_seq = true;
 
+/* Single VXlan Device Global Neigh Table */
+struct hash *svd_nh_table;
+
 /* static function declarations */
 static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket,
                                            void **args);
@@ -92,6 +80,11 @@ static int zl3vni_nh_del(struct zebra_l3vni *zl3vni, struct zebra_neigh *n);
 static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n);
 static int zl3vni_nh_uninstall(struct zebra_l3vni *zl3vni,
                               struct zebra_neigh *n);
+static struct zebra_neigh *svd_nh_add(const struct ipaddr *vtep_ip,
+                                     const struct ethaddr *rmac);
+static int svd_nh_del(struct zebra_neigh *n);
+static int svd_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n);
+static int svd_nh_uninstall(struct zebra_l3vni *zl3vni, struct zebra_neigh *n);
 
 /* l3-vni rmac related APIs */
 static void zl3vni_print_rmac_hash(struct hash_bucket *, void *);
@@ -110,8 +103,6 @@ static int zl3vni_rmac_uninstall(struct zebra_l3vni *zl3vni,
 static void *zl3vni_alloc(void *p);
 static struct zebra_l3vni *zl3vni_add(vni_t vni, vrf_id_t vrf_id);
 static int zl3vni_del(struct zebra_l3vni *zl3vni);
-static void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni);
-static void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni);
 
 static void zevpn_build_hash_table(void);
 static unsigned int zebra_vxlan_sg_hash_key_make(const void *p);
@@ -121,10 +112,6 @@ static void zebra_vxlan_sg_do_deref(struct zebra_vrf *zvrf,
 static struct zebra_vxlan_sg *zebra_vxlan_sg_do_ref(struct zebra_vrf *vrf,
                                                    struct in_addr sip,
                                                    struct in_addr mcast_grp);
-static void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip,
-                               struct in_addr mcast_grp);
-static void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip,
-                               struct in_addr mcast_grp);
 static void zebra_vxlan_cleanup_sg_table(struct zebra_vrf *zvrf);
 
 bool zebra_evpn_do_dup_addr_detect(struct zebra_vrf *zvrf)
@@ -375,11 +362,16 @@ static void zl3vni_print_nh(struct zebra_neigh *n, struct vty *vty,
                        ipaddr2str(&n->ip, buf2, sizeof(buf2)));
                vty_out(vty, "  RMAC: %s\n",
                        prefix_mac2str(&n->emac, buf1, sizeof(buf1)));
-               vty_out(vty, "  Refcount: %d\n",
-                       rb_host_count(&n->host_rb));
-               vty_out(vty, "  Prefixes:\n");
-               RB_FOREACH (hle, host_rb_tree_entry, &n->host_rb)
-                       vty_out(vty, "    %pFX\n", &hle->p);
+               if (n->refcnt)
+                       /* SVD neigh */
+                       vty_out(vty, "  Refcount: %u\n", n->refcnt);
+               else {
+                       vty_out(vty, "  Refcount: %d\n",
+                               rb_host_count(&n->host_rb));
+                       vty_out(vty, "  Prefixes:\n");
+                       RB_FOREACH (hle, host_rb_tree_entry, &n->host_rb)
+                               vty_out(vty, "    %pFX\n", &hle->p);
+               }
        } else {
                json_hosts = json_object_new_array();
                json_object_string_add(
@@ -387,13 +379,19 @@ static void zl3vni_print_nh(struct zebra_neigh *n, struct vty *vty,
                json_object_string_add(
                        json, "routerMac",
                        prefix_mac2str(&n->emac, buf2, sizeof(buf2)));
-               json_object_int_add(json, "refCount",
-                                   rb_host_count(&n->host_rb));
-               RB_FOREACH (hle, host_rb_tree_entry, &n->host_rb)
-                       json_object_array_add(json_hosts,
-                                             json_object_new_string(prefix2str(
-                                                                               &hle->p, buf2, sizeof(buf2))));
-               json_object_object_add(json, "prefixList", json_hosts);
+               if (n->refcnt)
+                       /* SVD neigh */
+                       json_object_int_add(json, "refCount", n->refcnt);
+               else {
+                       json_object_int_add(json, "refCount",
+                                           rb_host_count(&n->host_rb));
+                       RB_FOREACH (hle, host_rb_tree_entry, &n->host_rb)
+                               json_object_array_add(
+                                       json_hosts,
+                                       json_object_new_string(prefix2str(
+                                               &hle->p, buf2, sizeof(buf2))));
+                       json_object_object_add(json, "prefixList", json_hosts);
+               }
        }
 }
 
@@ -597,33 +595,36 @@ static void zl3vni_print_nh_hash(struct hash_bucket *bucket, void *ctx)
        }
 }
 
-static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket,
-                                        void **args)
+static void zl3vni_print_nh_all_table(struct hash *nh_table, vni_t vni,
+                                     struct vty *vty, json_object *json)
 {
-       struct vty *vty = NULL;
-       json_object *json = NULL;
-       json_object *json_evpn = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
        uint32_t num_nh = 0;
        struct nh_walk_ctx wctx;
        char vni_str[VNI_STR_LEN];
+       json_object *json_evpn = NULL;
+       bool is_svd = false;
+       const char *svd_str = "Global SVD Table";
 
-       vty = (struct vty *)args[0];
-       json = (struct json_object *)args[1];
+       if (vni == 0)
+               is_svd = true;
 
-       zl3vni = (struct zebra_l3vni *)bucket->data;
+       num_nh = hashcount(nh_table);
 
-       num_nh = hashcount(zl3vni->nh_table);
        if (!num_nh)
                return;
 
        if (json) {
                json_evpn = json_object_new_object();
-               snprintf(vni_str, VNI_STR_LEN, "%u", zl3vni->vni);
+
+               snprintf(vni_str, VNI_STR_LEN, "%u", vni);
        }
 
        if (json == NULL) {
-               vty_out(vty, "\nVNI %u #Next-Hops %u\n\n", zl3vni->vni, num_nh);
+               if (is_svd)
+                       vty_out(vty, "\n%s #Next-Hops %u\n\n", svd_str, num_nh);
+               else
+                       vty_out(vty, "\nVNI %u #Next-Hops %u\n\n", vni, num_nh);
+
                vty_out(vty, "%-15s %-17s\n", "IP", "RMAC");
        } else
                json_object_int_add(json_evpn, "numNextHops", num_nh);
@@ -631,11 +632,26 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket,
        memset(&wctx, 0, sizeof(wctx));
        wctx.vty = vty;
        wctx.json = json_evpn;
-       hash_iterate(zl3vni->nh_table, zl3vni_print_nh_hash, &wctx);
+       hash_iterate(nh_table, zl3vni_print_nh_hash, &wctx);
        if (json)
                json_object_object_add(json, vni_str, json_evpn);
 }
 
+static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket,
+                                        void **args)
+{
+       struct vty *vty = NULL;
+       json_object *json = NULL;
+       struct zebra_l3vni *zl3vni = NULL;
+
+       vty = (struct vty *)args[0];
+       json = (struct json_object *)args[1];
+
+       zl3vni = (struct zebra_l3vni *)bucket->data;
+
+       zl3vni_print_nh_all_table(zl3vni->nh_table, zl3vni->vni, vty, json);
+}
+
 static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket,
                                           void **args)
 {
@@ -728,6 +744,9 @@ static void zl3vni_print(struct zebra_l3vni *zl3vni, void **ctx)
                vty_out(vty, "VNI: %u\n", zl3vni->vni);
                vty_out(vty, "  Type: %s\n", "L3");
                vty_out(vty, "  Tenant VRF: %s\n", zl3vni_vrf_name(zl3vni));
+               vty_out(vty, "  Vlan: %u\n", zl3vni->vid);
+               vty_out(vty, "  Bridge: %s\n",
+                       zl3vni->bridge_if ? zl3vni->bridge_if->name : "-");
                vty_out(vty, "  Local Vtep Ip: %pI4\n",
                        &zl3vni->local_vtep_ip);
                vty_out(vty, "  Vxlan-Intf: %s\n",
@@ -750,6 +769,12 @@ static void zl3vni_print(struct zebra_l3vni *zl3vni, void **ctx)
                json_evpn_list = json_object_new_array();
                json_object_int_add(json, "vni", zl3vni->vni);
                json_object_string_add(json, "type", "L3");
+#if CONFDATE > 20240210
+CPP_NOTICE("Drop `vrf` from JSON outputs")
+#endif
+               json_object_string_add(json, "vrf", zl3vni_vrf_name(zl3vni));
+               json_object_string_add(json, "tenantVrf",
+                                      zl3vni_vrf_name(zl3vni));
                json_object_string_addf(json, "localVtepIp", "%pI4",
                                        &zl3vni->local_vtep_ip);
                json_object_string_add(json, "vxlanIntf",
@@ -757,7 +782,6 @@ static void zl3vni_print(struct zebra_l3vni *zl3vni, void **ctx)
                json_object_string_add(json, "sviIntf",
                                       zl3vni_svi_if_name(zl3vni));
                json_object_string_add(json, "state", zl3vni_state2str(zl3vni));
-               json_object_string_add(json, "vrf", zl3vni_vrf_name(zl3vni));
                json_object_string_add(
                        json, "sysMac",
                        zl3vni_sysmac2str(zl3vni, buf, sizeof(buf)));
@@ -884,7 +908,6 @@ struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if)
 {
        struct interface *tmp_if = NULL;
        struct zebra_if *zif;
-       struct zebra_l2info_bridge *br;
        struct zebra_from_svi_param in_param;
        struct interface **p_ifp;
        /* Defensive check, caller expected to invoke only with valid bridge. */
@@ -894,8 +917,7 @@ struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if)
        /* Determine if bridge is VLAN-aware or not */
        zif = br_if->info;
        assert(zif);
-       br = &zif->l2info.br;
-       in_param.bridge_vlan_aware = br->vlan_aware;
+       in_param.bridge_vlan_aware = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif);
        /* Check oper status of the SVI. */
        if (!in_param.bridge_vlan_aware)
                return if_is_operative(br_if) ? br_if : NULL;
@@ -910,9 +932,11 @@ struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if)
        return tmp_if;
 }
 
-static int zebra_evpn_vxlan_del(struct zebra_evpn *zevpn)
+int zebra_evpn_vxlan_del(struct zebra_evpn *zevpn)
 {
+       zevpn->vid = 0;
        zevpn_vxlan_if_set(zevpn, zevpn->vxlan_if, false /* set */);
+       zevpn_bridge_if_set(zevpn, zevpn->bridge_if, false /* set */);
 
        /* Remove references to the BUM mcast grp */
        zebra_vxlan_sg_deref(zevpn->local_vtep_ip, zevpn->mcast_grp);
@@ -920,6 +944,136 @@ static int zebra_evpn_vxlan_del(struct zebra_evpn *zevpn)
        return zebra_evpn_del(zevpn);
 }
 
+static int zevpn_build_vni_hash_table(struct zebra_if *zif,
+                                     struct zebra_vxlan_vni *vnip, void *arg)
+{
+       vni_t vni;
+       struct zebra_evpn *zevpn;
+       struct zebra_l3vni *zl3vni;
+       struct interface *ifp;
+       struct zebra_l2info_vxlan *vxl;
+       struct interface *br_if;
+
+       ifp = zif->ifp;
+       vxl = &zif->l2info.vxl;
+       vni = vnip->vni;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("Build vni table for vni %u for Intf %s", vni,
+                          ifp->name);
+
+       /* L3-VNI and L2-VNI are handled seperately */
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "create L3-VNI hash for Intf %s(%u) L3-VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+
+               /* associate with vxlan_if */
+               zl3vni->local_vtep_ip = vxl->vtep_ip;
+               zl3vni->vxlan_if = ifp;
+
+               /*
+                * we need to associate with SVI.
+                * we can associate with svi-if only after association
+                * with vxlan-intf is complete
+                */
+               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
+
+               /* Associate l3vni to mac-vlan and extract VRR MAC */
+               zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "create l3vni %u svi_if %s mac_vlan_if %s", vni,
+                               zl3vni->svi_if ? zl3vni->svi_if->name : "NIL",
+                               zl3vni->mac_vlan_if ? zl3vni->mac_vlan_if->name
+                                                   : "NIL");
+
+               if (is_l3vni_oper_up(zl3vni))
+                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
+
+       } else {
+               struct interface *vlan_if = NULL;
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Create L2-VNI hash for intf %s(%u) L2-VNI %u local IP %pI4",
+                               ifp->name, ifp->ifindex, vni, &vxl->vtep_ip);
+
+               /*
+                * EVPN hash entry is expected to exist, if the BGP process is
+                * killed
+                */
+               zevpn = zebra_evpn_lookup(vni);
+               if (zevpn) {
+                       zlog_debug(
+                               "EVPN hash already present for IF %s(%u) L2-VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+
+                       /*
+                        * Inform BGP if intf is up and mapped to
+                        * bridge.
+                        */
+                       if (if_is_operative(ifp) && zif->brslave_info.br_if)
+                               zebra_evpn_send_add_to_client(zevpn);
+
+                       /* Send Local MAC-entries to client */
+                       zebra_evpn_send_mac_list_to_client(zevpn);
+
+                       /* Send Loval Neighbor entries to client */
+                       zebra_evpn_send_neigh_to_client(zevpn);
+               } else {
+                       zevpn = zebra_evpn_add(vni);
+                       if (!zevpn) {
+                               zlog_debug(
+                                       "Failed to add EVPN hash, IF %s(%u) L2-VNI %u",
+                                       ifp->name, ifp->ifindex, vni);
+                               return 0;
+                       }
+
+                       if (zevpn->local_vtep_ip.s_addr !=
+                                   vxl->vtep_ip.s_addr ||
+                           zevpn->mcast_grp.s_addr != vnip->mcast_grp.s_addr) {
+                               zebra_vxlan_sg_deref(zevpn->local_vtep_ip,
+                                                    zevpn->mcast_grp);
+                               zebra_vxlan_sg_ref(vxl->vtep_ip,
+                                                  vnip->mcast_grp);
+                               zevpn->local_vtep_ip = vxl->vtep_ip;
+                               zevpn->mcast_grp = vnip->mcast_grp;
+                               /* on local vtep-ip check if ES
+                                * orig-ip needs to be updated
+                                */
+                               zebra_evpn_es_set_base_evpn(zevpn);
+                       }
+                       zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
+                       br_if = zif->brslave_info.br_if;
+                       zevpn_bridge_if_set(zevpn, br_if, true /* set */);
+                       vlan_if = zvni_map_to_svi(vnip->access_vlan, br_if);
+                       if (vlan_if) {
+                               zevpn->vid = vnip->access_vlan;
+                               zevpn->svi_if = vlan_if;
+                               zevpn->vrf_id = vlan_if->vrf->vrf_id;
+                               zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
+                               if (zl3vni)
+                                       listnode_add_sort(zl3vni->l2vnis,
+                                                         zevpn);
+                       }
+
+                       /*
+                        * Inform BGP if intf is up and mapped to
+                        * bridge.
+                        */
+                       if (if_is_operative(ifp) && zif->brslave_info.br_if)
+                               zebra_evpn_send_add_to_client(zevpn);
+               }
+       }
+
+       return 0;
+}
+
 static int zevpn_build_hash_table_zns(struct ns *ns,
                                     void *param_in __attribute__((unused)),
                                     void **param_out __attribute__((unused)))
@@ -933,9 +1087,6 @@ static int zevpn_build_hash_table_zns(struct ns *ns,
 
        /* Walk VxLAN interfaces and create EVPN hash. */
        for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
-               vni_t vni;
-               struct zebra_evpn *zevpn = NULL;
-               struct zebra_l3vni *zl3vni = NULL;
                struct zebra_if *zif;
                struct zebra_l2info_vxlan *vxl;
 
@@ -947,126 +1098,23 @@ static int zevpn_build_hash_table_zns(struct ns *ns,
                        continue;
 
                vxl = &zif->l2info.vxl;
-               vni = vxl->vni;
                /* link of VXLAN interface should be in zebra_evpn_vrf */
                if (zvrf->zns->ns_id != vxl->link_nsid) {
                        if (IS_ZEBRA_DEBUG_VXLAN)
                                zlog_debug(
-                                       "Intf %s(%u) VNI %u, link not in same "
+                                       "Intf %s(%u) link not in same "
                                        "namespace than BGP EVPN core instance ",
-                                       ifp->name, ifp->ifindex, vni);
+                                       ifp->name, ifp->ifindex);
                        continue;
                }
-               /* L3-VNI and L2-VNI are handled seperately */
-               zl3vni = zl3vni_lookup(vni);
-               if (zl3vni) {
-
-                       if (IS_ZEBRA_DEBUG_VXLAN)
-                               zlog_debug(
-                                       "create L3-VNI hash for Intf %s(%u) L3-VNI %u",
-                                       ifp->name, ifp->ifindex, vni);
-
-                       /* associate with vxlan_if */
-                       zl3vni->local_vtep_ip = vxl->vtep_ip;
-                       zl3vni->vxlan_if = ifp;
-
-                       /*
-                        * we need to associate with SVI.
-                        * we can associate with svi-if only after association
-                        * with vxlan-intf is complete
-                        */
-                       zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
-
-                       /* Associate l3vni to mac-vlan and extract VRR MAC */
-                       zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
-
-                       if (IS_ZEBRA_DEBUG_VXLAN)
-                               zlog_debug("create l3vni %u svi_if %s mac_vlan_if %s",
-                                  vni, zl3vni->svi_if ? zl3vni->svi_if->name
-                                  : "NIL",
-                                  zl3vni->mac_vlan_if ?
-                                  zl3vni->mac_vlan_if->name : "NIL");
-
-                       if (is_l3vni_oper_up(zl3vni))
-                               zebra_vxlan_process_l3vni_oper_up(zl3vni);
-
-               } else {
-                       struct interface *vlan_if = NULL;
 
-                       if (IS_ZEBRA_DEBUG_VXLAN)
-                               zlog_debug(
-                                       "Create L2-VNI hash for intf %s(%u) L2-VNI %u local IP %pI4",
-                                       ifp->name, ifp->ifindex, vni,
-                                       &vxl->vtep_ip);
-
-                       /* EVPN hash entry is expected to exist, if the BGP process is killed */
-                       zevpn = zebra_evpn_lookup(vni);
-                       if (zevpn) {
-                               zlog_debug(
-                                       "EVPN hash already present for IF %s(%u) L2-VNI %u",
-                                       ifp->name, ifp->ifindex, vni);
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Building vni table for %s-if %s",
+                                  IS_ZEBRA_VXLAN_IF_VNI(zif) ? "vni" : "svd",
+                                  ifp->name);
 
-                               /*
-                                * Inform BGP if intf is up and mapped to
-                                * bridge.
-                                */
-                               if (if_is_operative(ifp) &&
-                                       zif->brslave_info.br_if)
-                                       zebra_evpn_send_add_to_client(zevpn);
-
-                               /* Send Local MAC-entries to client */
-                               zebra_evpn_send_mac_list_to_client(zevpn);
-
-                               /* Send Loval Neighbor entries to client */
-                               zebra_evpn_send_neigh_to_client(zevpn);
-                       } else {
-                               zevpn = zebra_evpn_add(vni);
-                               if (!zevpn) {
-                                       zlog_debug(
-                                               "Failed to add EVPN hash, IF %s(%u) L2-VNI %u",
-                                               ifp->name, ifp->ifindex, vni);
-                                       return NS_WALK_CONTINUE;
-                               }
-
-                               if (zevpn->local_vtep_ip.s_addr !=
-                                       vxl->vtep_ip.s_addr ||
-                                       zevpn->mcast_grp.s_addr !=
-                                       vxl->mcast_grp.s_addr) {
-                                       zebra_vxlan_sg_deref(
-                                               zevpn->local_vtep_ip,
-                                               zevpn->mcast_grp);
-                                       zebra_vxlan_sg_ref(vxl->vtep_ip,
-                                               vxl->mcast_grp);
-                                       zevpn->local_vtep_ip = vxl->vtep_ip;
-                                       zevpn->mcast_grp = vxl->mcast_grp;
-                                       /* on local vtep-ip check if ES
-                                        * orig-ip needs to be updated
-                                        */
-                                       zebra_evpn_es_set_base_evpn(zevpn);
-                               }
-                               zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
-                               vlan_if = zvni_map_to_svi(
-                                       vxl->access_vlan,
-                                       zif->brslave_info.br_if);
-                               if (vlan_if) {
-                                       zevpn->svi_if = vlan_if;
-                                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
-                                       zl3vni = zl3vni_from_vrf(
-                                               vlan_if->vrf->vrf_id);
-                                       if (zl3vni)
-                                               listnode_add_sort(
-                                                       zl3vni->l2vnis, zevpn);
-                               }
-
-                               /*
-                                * Inform BGP if intf is up and mapped to
-                                * bridge.
-                                */
-                               if (if_is_operative(ifp) &&
-                                       zif->brslave_info.br_if)
-                                       zebra_evpn_send_add_to_client(zevpn);
-                       }
-               }
+               zebra_vxlan_if_vni_iterate(zif, zevpn_build_vni_hash_table,
+                                          NULL);
        }
        return NS_WALK_CONTINUE;
 }
@@ -1220,7 +1268,7 @@ static int zl3vni_rmac_install(struct zebra_l3vni *zl3vni,
                               struct zebra_mac *zrmac)
 {
        const struct zebra_if *zif = NULL, *br_zif = NULL;
-       const struct zebra_l2info_vxlan *vxl = NULL;
+       const struct zebra_vxlan_vni *vni;
        const struct interface *br_ifp;
        enum zebra_dplane_result res;
        vlanid_t vid;
@@ -1237,17 +1285,17 @@ static int zl3vni_rmac_install(struct zebra_l3vni *zl3vni,
        if (br_ifp == NULL)
                return -1;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zl3vni->vni);
 
        br_zif = (const struct zebra_if *)br_ifp->info;
 
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif))
-               vid = vxl->access_vlan;
+               vid = vni->access_vlan;
        else
                vid = 0;
 
-       res = dplane_rem_mac_add(zl3vni->vxlan_if, br_ifp, vid,
-                            &zrmac->macaddr, zrmac->fwd_info.r_vtep_ip, 0, 0,
+       res = dplane_rem_mac_add(zl3vni->vxlan_if, br_ifp, vid, &zrmac->macaddr,
+                                vni->vni, zrmac->fwd_info.r_vtep_ip, 0, 0,
                                 false /*was_static*/);
        if (res != ZEBRA_DPLANE_REQUEST_FAILURE)
                return 0;
@@ -1262,7 +1310,7 @@ static int zl3vni_rmac_uninstall(struct zebra_l3vni *zl3vni,
                                 struct zebra_mac *zrmac)
 {
        const struct zebra_if *zif = NULL, *br_zif;
-       const struct zebra_l2info_vxlan *vxl = NULL;
+       const struct zebra_vxlan_vni *vni;
        const struct interface *br_ifp;
        vlanid_t vid;
        enum zebra_dplane_result res;
@@ -1287,16 +1335,16 @@ static int zl3vni_rmac_uninstall(struct zebra_l3vni *zl3vni,
        if (br_ifp == NULL)
                return -1;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zl3vni->vni);
 
        br_zif = (const struct zebra_if *)br_ifp->info;
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif))
-               vid = vxl->access_vlan;
+               vid = vni->access_vlan;
        else
                vid = 0;
 
-       res = dplane_rem_mac_del(zl3vni->vxlan_if, br_ifp, vid,
-                            &zrmac->macaddr, zrmac->fwd_info.r_vtep_ip);
+       res = dplane_rem_mac_del(zl3vni->vxlan_if, br_ifp, vid, &zrmac->macaddr,
+                                vni->vni, zrmac->fwd_info.r_vtep_ip);
        if (res != ZEBRA_DPLANE_REQUEST_FAILURE)
                return 0;
        else
@@ -1419,21 +1467,41 @@ static void zl3vni_remote_rmac_del(struct zebra_l3vni *zl3vni,
 }
 
 /*
- * Look up nh hash entry on a l3-vni.
+ * Common code for look up of nh hash entry.
  */
-static struct zebra_neigh *zl3vni_nh_lookup(struct zebra_l3vni *zl3vni,
-                                           const struct ipaddr *ip)
+static struct zebra_neigh *_nh_lookup(struct zebra_l3vni *zl3vni,
+                                     const struct ipaddr *ip)
 {
        struct zebra_neigh tmp;
        struct zebra_neigh *n;
 
        memset(&tmp, 0, sizeof(tmp));
        memcpy(&tmp.ip, ip, sizeof(struct ipaddr));
-       n = hash_lookup(zl3vni->nh_table, &tmp);
+
+       if (zl3vni)
+               n = hash_lookup(zl3vni->nh_table, &tmp);
+       else
+               n = hash_lookup(svd_nh_table, &tmp);
 
        return n;
 }
 
+/*
+ * Look up nh hash entry on a l3-vni.
+ */
+static struct zebra_neigh *zl3vni_nh_lookup(struct zebra_l3vni *zl3vni,
+                                           const struct ipaddr *ip)
+{
+       return _nh_lookup(zl3vni, ip);
+}
+
+/*
+ * Look up nh hash entry on a SVD.
+ */
+static struct zebra_neigh *svd_nh_lookup(const struct ipaddr *ip)
+{
+       return _nh_lookup(NULL, ip);
+}
 
 /*
  * Callback to allocate NH hash entry on L3-VNI.
@@ -1450,18 +1518,24 @@ static void *zl3vni_nh_alloc(void *p)
 }
 
 /*
- * Add neighbor entry.
+ * Common code for neigh add.
  */
-static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni,
-                                        const struct ipaddr *ip,
-                                        const struct ethaddr *mac)
+static struct zebra_neigh *_nh_add(struct zebra_l3vni *zl3vni,
+                                  const struct ipaddr *ip,
+                                  const struct ethaddr *mac)
 {
        struct zebra_neigh tmp_n;
        struct zebra_neigh *n = NULL;
 
        memset(&tmp_n, 0, sizeof(tmp_n));
        memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr));
-       n = hash_get(zl3vni->nh_table, &tmp_n, zl3vni_nh_alloc);
+
+       if (zl3vni)
+               n = hash_get(zl3vni->nh_table, &tmp_n, zl3vni_nh_alloc);
+       else
+               n = hash_get(svd_nh_table, &tmp_n, zl3vni_nh_alloc);
+
+       assert(n);
 
        RB_INIT(host_rb_tree_entry, &n->host_rb);
 
@@ -1472,6 +1546,16 @@ static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni,
        return n;
 }
 
+/*
+ * Add neighbor entry.
+ */
+static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni,
+                                        const struct ipaddr *ip,
+                                        const struct ethaddr *mac)
+{
+       return _nh_add(zl3vni, ip, mac);
+}
+
 /*
  * Delete neighbor entry.
  */
@@ -1494,14 +1578,38 @@ static int zl3vni_nh_del(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
 }
 
 /*
- * Install remote nh as neigh into the kernel.
+ * Add Single VXlan Device neighbor entry.
  */
-static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
+static struct zebra_neigh *svd_nh_add(const struct ipaddr *ip,
+                                     const struct ethaddr *mac)
+{
+       return _nh_add(NULL, ip, mac);
+}
+
+/*
+ * Del Single VXlan Device neighbor entry.
+ */
+static int svd_nh_del(struct zebra_neigh *n)
+{
+       if (n->refcnt > 0)
+               return -1;
+
+       hash_release(svd_nh_table, n);
+       XFREE(MTYPE_L3NEIGH, n);
+
+       return 0;
+}
+
+/*
+ * Common code to install remote nh as neigh into the kernel.
+ */
+static int _nh_install(struct zebra_l3vni *zl3vni, struct interface *ifp,
+                      struct zebra_neigh *n)
 {
        uint8_t flags;
        int ret = 0;
 
-       if (!is_l3vni_oper_up(zl3vni))
+       if (zl3vni && !is_l3vni_oper_up(zl3vni))
                return -1;
 
        if (!(n->flags & ZEBRA_NEIGH_REMOTE)
@@ -1512,31 +1620,63 @@ static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
        if (n->flags & ZEBRA_NEIGH_ROUTER_FLAG)
                flags |= DPLANE_NTF_ROUTER;
 
-       dplane_rem_neigh_add(zl3vni->svi_if, &n->ip, &n->emac, flags,
-                       false /*was_static*/);
+       dplane_rem_neigh_add(ifp, &n->ip, &n->emac, flags,
+                            false /*was_static*/);
 
        return ret;
 }
 
 /*
- * Uninstall remote nh from the kernel.
+ * Common code to uninstall remote nh from the kernel.
  */
-static int zl3vni_nh_uninstall(struct zebra_l3vni *zl3vni,
-                              struct zebra_neigh *n)
+static int _nh_uninstall(struct interface *ifp, struct zebra_neigh *n)
 {
        if (!(n->flags & ZEBRA_NEIGH_REMOTE)
            || !(n->flags & ZEBRA_NEIGH_REMOTE_NH))
                return 0;
 
-       if (!zl3vni->svi_if || !if_is_operative(zl3vni->svi_if))
+       if (!ifp || !if_is_operative(ifp))
                return 0;
 
-       dplane_rem_neigh_delete(zl3vni->svi_if, &n->ip);
+       dplane_rem_neigh_delete(ifp, &n->ip);
 
        return 0;
 }
 
-/* add remote vtep as a neigh entry */
+/*
+ * Install remote nh as neigh into the kernel.
+ */
+static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
+{
+       return _nh_install(zl3vni, zl3vni->svi_if, n);
+}
+
+/*
+ * Uninstall remote nh from the kernel.
+ */
+static int zl3vni_nh_uninstall(struct zebra_l3vni *zl3vni,
+                              struct zebra_neigh *n)
+{
+       return _nh_uninstall(zl3vni->svi_if, n);
+}
+
+/*
+ * Install SVD remote nh as neigh into the kernel.
+ */
+static int svd_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
+{
+       return _nh_install(zl3vni, zl3vni->vxlan_if, n);
+}
+
+/*
+ * Uninstall SVD remote nh from the kernel.
+ */
+static int svd_nh_uninstall(struct zebra_l3vni *zl3vni, struct zebra_neigh *n)
+{
+       return _nh_uninstall(zl3vni->vxlan_if, n);
+}
+
+/* Add remote vtep as a neigh entry */
 static int zl3vni_remote_nh_add(struct zebra_l3vni *zl3vni,
                                const struct ipaddr *vtep_ip,
                                const struct ethaddr *rmac,
@@ -1574,7 +1714,7 @@ static int zl3vni_remote_nh_add(struct zebra_l3vni *zl3vni,
        return 0;
 }
 
-/* handle nh neigh delete */
+/* Del remote vtep as a neigh entry */
 static void zl3vni_remote_nh_del(struct zebra_l3vni *zl3vni,
                                 struct zebra_neigh *nh,
                                 struct prefix *host_prefix)
@@ -1590,32 +1730,117 @@ static void zl3vni_remote_nh_del(struct zebra_l3vni *zl3vni,
        }
 }
 
-/* handle neigh update from kernel - the only thing of interest is to
- * readd stale entries.
- */
-static int zl3vni_local_nh_add_update(struct zebra_l3vni *zl3vni,
-                                     struct ipaddr *ip, uint16_t state)
+/* Add remote vtep as a SVD neigh entry */
+static int svd_remote_nh_add(struct zebra_l3vni *zl3vni,
+                            const struct ipaddr *vtep_ip,
+                            const struct ethaddr *rmac,
+                            const struct prefix *host_prefix)
 {
-#ifdef GNU_LINUX
-       struct zebra_neigh *n = NULL;
+       struct zebra_neigh *nh = NULL;
 
-       n = zl3vni_nh_lookup(zl3vni, ip);
-       if (!n)
+       /* SVD backed VNI check */
+       if (!IS_ZL3VNI_SVD_BACKED(zl3vni))
                return 0;
 
-       /* all next hop neigh are remote and installed by frr.
-        * If the kernel has aged this entry, re-install.
-        */
-       if (state & NUD_STALE)
-               zl3vni_nh_install(zl3vni, n);
-#endif
-       return 0;
-}
-
-/* handle neigh delete from kernel */
-static int zl3vni_local_nh_del(struct zebra_l3vni *zl3vni, struct ipaddr *ip)
-{
-       struct zebra_neigh *n = NULL;
+       /* Create the SVD next hop entry, or update its mac, if necessary. */
+       nh = svd_nh_lookup(vtep_ip);
+       if (!nh) {
+               nh = svd_nh_add(vtep_ip, rmac);
+               if (!nh) {
+                       zlog_debug(
+                               "Failed to add NH %pIA as SVD Neigh (RMAC %pEA prefix %pFX)",
+                               vtep_ip, rmac, host_prefix);
+                       return -1;
+               }
+
+       } else if (memcmp(&nh->emac, rmac, ETH_ALEN) != 0) {
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "SVD RMAC change(%pEA --> %pEA) for nexthop %pIA, prefix %pFX",
+                               &nh->emac, rmac, vtep_ip, host_prefix);
+
+               memcpy(&nh->emac, rmac, ETH_ALEN);
+               /* install (update) the nh neigh in kernel */
+               svd_nh_install(zl3vni, nh);
+
+               /* Don't increment refcnt change */
+               return 0;
+       }
+
+       nh->refcnt++;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("SVD NH ADD refcnt (%u) for nexthop %pIA",
+                          nh->refcnt, vtep_ip);
+
+       /*
+        * Install the nh neigh in kernel if this is the first time we
+        * have seen it.
+        */
+       if (nh->refcnt == 1)
+               svd_nh_install(zl3vni, nh);
+
+       return 0;
+}
+
+/* Del remote vtep as a SVD neigh entry */
+static int svd_remote_nh_del(struct zebra_l3vni *zl3vni,
+                            const struct ipaddr *vtep_ip)
+{
+       struct zebra_neigh *nh;
+
+       /* SVD backed VNI check */
+       if (!IS_ZL3VNI_SVD_BACKED(zl3vni))
+               return 0;
+
+       nh = svd_nh_lookup(vtep_ip);
+       if (!nh) {
+               zlog_debug("Failed to del NH %pIA as SVD Neigh", vtep_ip);
+
+               return -1;
+       }
+
+       nh->refcnt--;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("SVD NH Del refcnt (%u) for nexthop %pIA",
+                          nh->refcnt, vtep_ip);
+
+       /* Last refcnt on NH, remove it completely. */
+       if (nh->refcnt == 0) {
+               svd_nh_uninstall(zl3vni, nh);
+               svd_nh_del(nh);
+       }
+
+       return 0;
+}
+
+/* handle neigh update from kernel - the only thing of interest is to
+ * readd stale entries.
+ */
+static int zl3vni_local_nh_add_update(struct zebra_l3vni *zl3vni,
+                                     struct ipaddr *ip, uint16_t state)
+{
+#ifdef GNU_LINUX
+       struct zebra_neigh *n = NULL;
+
+       n = zl3vni_nh_lookup(zl3vni, ip);
+       if (!n)
+               return 0;
+
+       /* all next hop neigh are remote and installed by frr.
+        * If the kernel has aged this entry, re-install.
+        */
+       if (state & NUD_STALE)
+               zl3vni_nh_install(zl3vni, n);
+#endif
+       return 0;
+}
+
+/* handle neigh delete from kernel */
+static int zl3vni_local_nh_del(struct zebra_l3vni *zl3vni, struct ipaddr *ip)
+{
+       struct zebra_neigh *n = NULL;
 
        n = zl3vni_nh_lookup(zl3vni, ip);
        if (!n)
@@ -1751,7 +1976,8 @@ static int zl3vni_map_to_vxlan_if_ns(struct ns *ns,
        for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
 
                struct zebra_if *zif = NULL;
-               struct zebra_l2info_vxlan *vxl = NULL;
+               struct zebra_l2info_vxlan *vxl;
+               struct zebra_vxlan_vni *vni = NULL;
 
                ifp = (struct interface *)rn->info;
                if (!ifp)
@@ -1762,7 +1988,8 @@ static int zl3vni_map_to_vxlan_if_ns(struct ns *ns,
                        continue;
 
                vxl = &zif->l2info.vxl;
-               if (vxl->vni != zl3vni->vni)
+               vni = zebra_vxlan_if_vni_find(zif, zl3vni->vni);
+               if (!vni || vni->vni != zl3vni->vni)
                        continue;
 
                /* link of VXLAN interface should be in zebra_evpn_vrf */
@@ -1771,12 +1998,12 @@ static int zl3vni_map_to_vxlan_if_ns(struct ns *ns,
                                zlog_debug(
                                        "Intf %s(%u) VNI %u, link not in same "
                                        "namespace than BGP EVPN core instance ",
-                                       ifp->name, ifp->ifindex, vxl->vni);
+                                       ifp->name, ifp->ifindex, vni->vni);
                        continue;
                }
 
 
-               zl3vni->local_vtep_ip = vxl->vtep_ip;
+               zl3vni->local_vtep_ip = zif->l2info.vxl.vtep_ip;
                *_pifp = (void *)ifp;
                return NS_WALK_STOP;
        }
@@ -1799,7 +2026,7 @@ struct interface *zl3vni_map_to_vxlan_if(struct zebra_l3vni *zl3vni)
 struct interface *zl3vni_map_to_svi_if(struct zebra_l3vni *zl3vni)
 {
        struct zebra_if *zif = NULL;       /* zebra_if for vxlan_if */
-       struct zebra_l2info_vxlan *vxl = NULL; /* l2 info for vxlan_if */
+       struct zebra_vxlan_vni *vni = NULL; /* vni info in vxlan_if */
 
        if (!zl3vni)
                return NULL;
@@ -1811,9 +2038,11 @@ struct interface *zl3vni_map_to_svi_if(struct zebra_l3vni *zl3vni)
        if (!zif)
                return NULL;
 
-       vxl = &zif->l2info.vxl;
+       vni = zebra_vxlan_if_vni_find(zif, zl3vni->vni);
+       if (!vni)
+               return NULL;
 
-       return zvni_map_to_svi(vxl->access_vlan, zif->brslave_info.br_if);
+       return zvni_map_to_svi(vni->access_vlan, zif->brslave_info.br_if);
 }
 
 struct interface *zl3vni_map_to_mac_vlan_if(struct zebra_l3vni *zl3vni)
@@ -1848,6 +2077,8 @@ struct zebra_l3vni *zl3vni_from_vrf(vrf_id_t vrf_id)
 
 static int zl3vni_from_svi_ns(struct ns *ns, void *_in_param, void **_p_zl3vni)
 {
+       int found = 0;
+       vni_t vni_id = 0;
        struct zebra_ns *zns = ns->info;
        struct zebra_l3vni **p_zl3vni = (struct zebra_l3vni **)_p_zl3vni;
        struct zebra_from_svi_param *in_param =
@@ -1855,33 +2086,46 @@ static int zl3vni_from_svi_ns(struct ns *ns, void *_in_param, void **_p_zl3vni)
        struct route_node *rn = NULL;
        struct interface *tmp_if = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
+       struct zebra_if *br_zif = NULL;
 
        assert(in_param && p_zl3vni);
 
-       /* loop through all vxlan-interface */
-       for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
-               tmp_if = (struct interface *)rn->info;
-               if (!tmp_if)
-                       continue;
-               zif = tmp_if->info;
-               if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
-                       continue;
-               if (!if_is_operative(tmp_if))
-                       continue;
-               vxl = &zif->l2info.vxl;
+       br_zif = in_param->br_if->info;
+       assert(br_zif);
 
-               if (zif->brslave_info.br_if != in_param->br_if)
-                       continue;
+       if (in_param->bridge_vlan_aware) {
+               vni_id = zebra_l2_bridge_if_vni_find(br_zif, in_param->vid);
+               if (vni_id)
+                       found = 1;
+       } else {
+               /* loop through all vxlan-interface */
+               for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
+                       tmp_if = (struct interface *)rn->info;
+                       if (!tmp_if)
+                               continue;
+                       zif = tmp_if->info;
+                       if (!zif || zif->zif_type != ZEBRA_IF_VXLAN)
+                               continue;
+                       if (!if_is_operative(tmp_if))
+                               continue;
 
-               if (!in_param->bridge_vlan_aware
-                   || vxl->access_vlan == in_param->vid) {
-                       *p_zl3vni = zl3vni_lookup(vxl->vni);
-                       return NS_WALK_STOP;
+                       if (zif->brslave_info.br_if != in_param->br_if)
+                               continue;
+
+                       vni_id = zebra_vxlan_if_access_vlan_vni_find(
+                               zif, in_param->br_if);
+                       if (vni_id) {
+                               found = 1;
+                               break;
+                       }
                }
        }
 
-       return NS_WALK_CONTINUE;
+       if (!found)
+               return NS_WALK_CONTINUE;
+
+       *p_zl3vni = zl3vni_lookup(vni_id);
+       return NS_WALK_STOP;
 }
 
 /*
@@ -1893,7 +2137,6 @@ static struct zebra_l3vni *zl3vni_from_svi(struct interface *ifp,
 {
        struct zebra_l3vni *zl3vni = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_bridge *br = NULL;
        struct zebra_from_svi_param in_param = {};
        struct zebra_l3vni **p_zl3vni;
 
@@ -1908,8 +2151,7 @@ static struct zebra_l3vni *zl3vni_from_svi(struct interface *ifp,
        /* Determine if bridge is VLAN-aware or not */
        zif = br_if->info;
        assert(zif);
-       br = &zif->l2info.br;
-       in_param.bridge_vlan_aware = br->vlan_aware;
+       in_param.bridge_vlan_aware = IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif);
        if (in_param.bridge_vlan_aware) {
                struct zebra_l2info_vlan *vl;
 
@@ -2056,7 +2298,7 @@ static int zl3vni_send_del_to_client(struct zebra_l3vni *zl3vni)
        return zserv_send_message(client, s);
 }
 
-static void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni)
+void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni)
 {
        if (!zl3vni)
                return;
@@ -2065,7 +2307,7 @@ static void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni)
        zl3vni_send_add_to_client(zl3vni);
 }
 
-static void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni)
+void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni)
 {
        if (!zl3vni)
                return;
@@ -2137,6 +2379,7 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
                struct route_node *rn;
                struct interface *ifp;
                struct zebra_if *zif;
+               struct zebra_vxlan_vni *vnip;
                struct zebra_l2info_vxlan *vxl;
                struct interface *vlan_if;
                bool found = false;
@@ -2156,7 +2399,8 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
                                continue;
 
                        vxl = &zif->l2info.vxl;
-                       if (vxl->vni == vni) {
+                       vnip = zebra_vxlan_if_vni_find(zif, vni);
+                       if (vnip) {
                                found = true;
                                break;
                        }
@@ -2178,7 +2422,7 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
                zevpn = zebra_evpn_add(vni);
 
                /* Find bridge interface for the VNI */
-               vlan_if = zvni_map_to_svi(vxl->access_vlan,
+               vlan_if = zvni_map_to_svi(vnip->access_vlan,
                                          zif->brslave_info.br_if);
                if (vlan_if) {
                        zevpn->vrf_id = vlan_if->vrf->vrf_id;
@@ -2277,6 +2521,9 @@ void zebra_vxlan_evpn_vrf_route_add(vrf_id_t vrf_id, const struct ethaddr *rmac,
         */
        zl3vni_remote_nh_add(zl3vni, vtep_ip, rmac, host_prefix);
 
+       /* Add SVD next hop neighbor */
+       svd_remote_nh_add(zl3vni, vtep_ip, rmac, host_prefix);
+
        /*
         * if the remote vtep is a ipv4 mapped ipv6 address convert it to ipv4
         * address. Rmac is programmed against the ipv4 vtep because we only
@@ -2320,6 +2567,9 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id,
        /* delete the next hop entry */
        zl3vni_remote_nh_del(zl3vni, nh, host_prefix);
 
+       /* Delete SVD next hop entry */
+       svd_remote_nh_del(zl3vni, vtep_ip);
+
        /* delete the rmac entry */
        if (zrmac)
                zl3vni_remote_rmac_del(zl3vni, zrmac, vtep_ip);
@@ -2449,22 +2699,29 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
        if (use_json)
                json = json_object_new_object();
 
-       zl3vni = zl3vni_lookup(l3vni);
-       if (!zl3vni) {
-               if (use_json)
-                       vty_out(vty, "{}\n");
-               else
-                       vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
-               return;
+       /* If vni=0 passed, assume svd lookup */
+       if (!l3vni)
+               n = svd_nh_lookup(ip);
+       else {
+               zl3vni = zl3vni_lookup(l3vni);
+               if (!zl3vni) {
+                       if (use_json)
+                               vty_out(vty, "{}\n");
+                       else
+                               vty_out(vty, "%% L3-VNI %u does not exist\n",
+                                       l3vni);
+                       return;
+               }
+
+               n = zl3vni_nh_lookup(zl3vni, ip);
        }
 
-       n = zl3vni_nh_lookup(zl3vni, ip);
        if (!n) {
                if (use_json)
                        vty_out(vty, "{}\n");
                else
                        vty_out(vty,
-                               "%% Requested next-hop not present for L3-VNI %u",
+                               "%% Requested next-hop not present for L3-VNI %u\n",
                                l3vni);
                return;
        }
@@ -2475,26 +2732,14 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
                vty_json(vty, json);
 }
 
-void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
+static void l3vni_print_nh_table(struct hash *nh_table, struct vty *vty,
+                                bool use_json)
 {
        uint32_t num_nh;
        struct nh_walk_ctx wctx;
        json_object *json = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
 
-       if (!is_evpn_enabled())
-               return;
-
-       zl3vni = zl3vni_lookup(l3vni);
-       if (!zl3vni) {
-               if (use_json)
-                       vty_out(vty, "{}\n");
-               else
-                       vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
-               return;
-       }
-
-       num_nh = hashcount(zl3vni->nh_table);
+       num_nh = hashcount(nh_table);
        if (!num_nh)
                return;
 
@@ -2510,12 +2755,45 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
        } else
                json_object_int_add(json, "numNextHops", num_nh);
 
-       hash_iterate(zl3vni->nh_table, zl3vni_print_nh_hash, &wctx);
+       hash_iterate(nh_table, zl3vni_print_nh_hash, &wctx);
 
        if (use_json)
                vty_json(vty, json);
 }
 
+void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
+{
+       struct zebra_l3vni *zl3vni = NULL;
+
+       if (!is_evpn_enabled()) {
+               if (use_json)
+                       vty_out(vty, "{}\n");
+               return;
+       }
+
+       zl3vni = zl3vni_lookup(l3vni);
+       if (!zl3vni) {
+               if (use_json)
+                       vty_out(vty, "{}\n");
+               else
+                       vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
+               return;
+       }
+
+       l3vni_print_nh_table(zl3vni->nh_table, vty, use_json);
+}
+
+void zebra_vxlan_print_nh_svd(struct vty *vty, bool use_json)
+{
+       if (!is_evpn_enabled()) {
+               if (use_json)
+                       vty_out(vty, "{}\n");
+               return;
+       }
+
+       l3vni_print_nh_table(svd_nh_table, vty, use_json);
+}
+
 void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
 {
        json_object *json = NULL;
@@ -3948,20 +4226,17 @@ stream_failure:
 /*
  * Handle remote vtep delete by kernel; re-add the vtep if we have it
  */
-int zebra_vxlan_check_readd_vtep(struct interface *ifp,
+int zebra_vxlan_check_readd_vtep(struct interface *ifp, vni_t vni,
                                 struct in_addr vtep_ip)
 {
        struct zebra_if *zif;
        struct zebra_vrf *zvrf = NULL;
-       struct zebra_l2info_vxlan *vxl;
-       vni_t vni;
        struct zebra_evpn *zevpn = NULL;
        struct zebra_vtep *zvtep = NULL;
+       struct zebra_vxlan_vni *vnip;
 
        zif = ifp->info;
        assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
 
        /* If EVPN is not enabled, nothing to do. */
        if (!is_evpn_enabled())
@@ -3972,6 +4247,10 @@ int zebra_vxlan_check_readd_vtep(struct interface *ifp,
        if (!zvrf)
                return -1;
 
+       vnip = zebra_vxlan_if_vni_find(zif, vni);
+       if (!vnip)
+               return 0;
+
        /* Locate hash entry; it is expected to exist. */
        zevpn = zebra_evpn_lookup(vni);
        if (!zevpn)
@@ -3999,18 +4278,14 @@ int zebra_vxlan_check_readd_vtep(struct interface *ifp,
 static int zebra_vxlan_check_del_local_mac(struct interface *ifp,
                                           struct interface *br_if,
                                           struct ethaddr *macaddr,
-                                          vlanid_t vid)
+                                          vlanid_t vid, vni_t vni)
 {
        struct zebra_if *zif;
-       struct zebra_l2info_vxlan *vxl;
-       vni_t vni;
        struct zebra_evpn *zevpn;
        struct zebra_mac *mac;
 
        zif = ifp->info;
        assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
 
        /* Check if EVPN is enabled. */
        if (!is_evpn_enabled())
@@ -4062,7 +4337,8 @@ static int zebra_vxlan_check_del_local_mac(struct interface *ifp,
 int zebra_vxlan_dp_network_mac_add(struct interface *ifp,
                                   struct interface *br_if,
                                   struct ethaddr *macaddr, vlanid_t vid,
-                                  uint32_t nhg_id, bool sticky, bool dp_static)
+                                  vni_t vni, uint32_t nhg_id, bool sticky,
+                                  bool dp_static)
 {
        struct zebra_evpn_es *es;
        struct interface *acc_ifp;
@@ -4078,7 +4354,8 @@ int zebra_vxlan_dp_network_mac_add(struct interface *ifp,
        }
 
        /* Get vxlan's vid for netlink message has no it. */
-       vid = ((struct zebra_if *)ifp->info)->l2info.vxl.access_vlan;
+       vid = ((struct zebra_if *)ifp->info)
+                     ->l2info.vxl.vni_info.vni.access_vlan;
 
        /* if remote mac delete the local entry */
        if (!nhg_id || !zebra_evpn_nhg_is_local_es(nhg_id, &es)
@@ -4086,8 +4363,8 @@ int zebra_vxlan_dp_network_mac_add(struct interface *ifp,
                if (IS_ZEBRA_DEBUG_VXLAN || IS_ZEBRA_DEBUG_EVPN_MH_MAC)
                        zlog_debug("dpAdd remote MAC %pEA VID %u", macaddr,
                                   vid);
-               return zebra_vxlan_check_del_local_mac(ifp, br_if, macaddr,
-                                                      vid);
+               return zebra_vxlan_check_del_local_mac(ifp, br_if, macaddr, vid,
+                                                      vni);
        }
 
        /* If local MAC on a down local ES translate the network-mac-add
@@ -4108,19 +4385,16 @@ int zebra_vxlan_dp_network_mac_add(struct interface *ifp,
  */
 int zebra_vxlan_dp_network_mac_del(struct interface *ifp,
                                   struct interface *br_if,
-                                  struct ethaddr *macaddr, vlanid_t vid)
+                                  struct ethaddr *macaddr, vlanid_t vid,
+                                  vni_t vni)
 {
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       vni_t vni;
        struct zebra_evpn *zevpn = NULL;
        struct zebra_l3vni *zl3vni = NULL;
        struct zebra_mac *mac = NULL;
 
        zif = ifp->info;
        assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
 
        /* Check if EVPN is enabled. */
        if (!is_evpn_enabled())
@@ -4799,507 +5073,6 @@ void zebra_vxlan_macvlan_up(struct interface *ifp)
        }
 }
 
-/*
- * Handle VxLAN interface down
- */
-int zebra_vxlan_if_down(struct interface *ifp)
-{
-       vni_t vni;
-       struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
-       struct zebra_evpn *zevpn;
-
-       /* Check if EVPN is enabled. */
-       if (!is_evpn_enabled())
-               return 0;
-
-       zif = ifp->info;
-       assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
-
-       zl3vni = zl3vni_lookup(vni);
-       if (zl3vni) {
-               /* process-if-down for l3-vni */
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Intf %s(%u) L3-VNI %u is DOWN", ifp->name,
-                                  ifp->ifindex, vni);
-
-               zebra_vxlan_process_l3vni_oper_down(zl3vni);
-       } else {
-               /* process if-down for l2-vni */
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Intf %s(%u) L2-VNI %u is DOWN", ifp->name,
-                                  ifp->ifindex, vni);
-
-               /* Locate hash entry; it is expected to exist. */
-               zevpn = zebra_evpn_lookup(vni);
-               if (!zevpn) {
-                       zlog_debug(
-                               "Failed to locate VNI hash at DOWN, IF %s(%u) VNI %u",
-                               ifp->name, ifp->ifindex, vni);
-                       return -1;
-               }
-
-               assert(zevpn->vxlan_if == ifp);
-
-               /* remove from l3-vni list */
-               zl3vni = zl3vni_from_vrf(zevpn->vrf_id);
-               if (zl3vni)
-                       listnode_delete(zl3vni->l2vnis, zevpn);
-
-               /* Delete this VNI from BGP. */
-               zebra_evpn_send_del_to_client(zevpn);
-
-               /* Free up all neighbors and MACs, if any. */
-               zebra_evpn_neigh_del_all(zevpn, 1, 0, DEL_ALL_NEIGH);
-               zebra_evpn_mac_del_all(zevpn, 1, 0, DEL_ALL_MAC);
-
-               /* Free up all remote VTEPs, if any. */
-               zebra_evpn_vtep_del_all(zevpn, 1);
-       }
-       return 0;
-}
-
-/*
- * Handle VxLAN interface up - update BGP if required.
- */
-int zebra_vxlan_if_up(struct interface *ifp)
-{
-       vni_t vni;
-       struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       struct zebra_evpn *zevpn = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
-
-       /* Check if EVPN is enabled. */
-       if (!is_evpn_enabled())
-               return 0;
-
-       zif = ifp->info;
-       assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
-
-       zl3vni = zl3vni_lookup(vni);
-       if (zl3vni) {
-               /* we need to associate with SVI, if any, we can associate with
-                * svi-if only after association with vxlan-intf is complete
-                */
-               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
-               zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Intf %s(%u) L3-VNI %u is UP svi_if %s mac_vlan_if %s"
-                               , ifp->name, ifp->ifindex, vni,
-                               zl3vni->svi_if ? zl3vni->svi_if->name : "NIL",
-                               zl3vni->mac_vlan_if ?
-                               zl3vni->mac_vlan_if->name : "NIL");
-
-               if (is_l3vni_oper_up(zl3vni))
-                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
-       } else {
-               /* Handle L2-VNI add */
-               struct interface *vlan_if = NULL;
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Intf %s(%u) L2-VNI %u is UP", ifp->name,
-                                  ifp->ifindex, vni);
-
-               /* Locate hash entry; it is expected to exist. */
-               zevpn = zebra_evpn_lookup(vni);
-               if (!zevpn) {
-                       zlog_debug(
-                               "Failed to locate EVPN hash at UP, IF %s(%u) VNI %u",
-                               ifp->name, ifp->ifindex, vni);
-                       return -1;
-               }
-
-               assert(zevpn->vxlan_if == ifp);
-               vlan_if = zvni_map_to_svi(vxl->access_vlan,
-                                         zif->brslave_info.br_if);
-               if (vlan_if) {
-                       zevpn->svi_if = vlan_if;
-                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
-                       zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
-                       if (zl3vni)
-                               listnode_add_sort_nodup(zl3vni->l2vnis, zevpn);
-               }
-
-               /* If part of a bridge, inform BGP about this VNI. */
-               /* Also, read and populate local MACs and neighbors. */
-               if (zif->brslave_info.br_if) {
-                       zebra_evpn_send_add_to_client(zevpn);
-                       zebra_evpn_read_mac_neigh(zevpn, ifp);
-               }
-       }
-
-       return 0;
-}
-
-/*
- * Handle VxLAN interface delete. Locate and remove entry in hash table
- * and update BGP, if required.
- */
-int zebra_vxlan_if_del(struct interface *ifp)
-{
-       vni_t vni;
-       struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       struct zebra_evpn *zevpn = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
-
-       /* Check if EVPN is enabled. */
-       if (!is_evpn_enabled())
-               return 0;
-
-       zif = ifp->info;
-       assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
-
-       zl3vni = zl3vni_lookup(vni);
-       if (zl3vni) {
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Del L3-VNI %u intf %s(%u)", vni, ifp->name,
-                                  ifp->ifindex);
-
-               /* process oper-down for l3-vni */
-               zebra_vxlan_process_l3vni_oper_down(zl3vni);
-
-               /* remove the association with vxlan_if */
-               memset(&zl3vni->local_vtep_ip, 0, sizeof(struct in_addr));
-               zl3vni->vxlan_if = NULL;
-       } else {
-
-               /* process if-del for l2-vni*/
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug("Del L2-VNI %u intf %s(%u)", vni, ifp->name,
-                                  ifp->ifindex);
-
-               /* Locate hash entry; it is expected to exist. */
-               zevpn = zebra_evpn_lookup(vni);
-               if (!zevpn) {
-                       zlog_debug(
-                               "Failed to locate VNI hash at del, IF %s(%u) VNI %u",
-                               ifp->name, ifp->ifindex, vni);
-                       return 0;
-               }
-
-               /* remove from l3-vni list */
-               zl3vni = zl3vni_from_vrf(zevpn->vrf_id);
-               if (zl3vni)
-                       listnode_delete(zl3vni->l2vnis, zevpn);
-               /* Delete VNI from BGP. */
-               zebra_evpn_send_del_to_client(zevpn);
-
-               /* Free up all neighbors and MAC, if any. */
-               zebra_evpn_neigh_del_all(zevpn, 0, 0, DEL_ALL_NEIGH);
-               zebra_evpn_mac_del_all(zevpn, 0, 0, DEL_ALL_MAC);
-
-               /* Free up all remote VTEPs, if any. */
-               zebra_evpn_vtep_del_all(zevpn, 0);
-
-               /* Delete the hash entry. */
-               if (zebra_evpn_vxlan_del(zevpn)) {
-                       flog_err(EC_ZEBRA_VNI_DEL_FAILED,
-                                "Failed to del EVPN hash %p, IF %s(%u) VNI %u",
-                                zevpn, ifp->name, ifp->ifindex, zevpn->vni);
-                       return -1;
-               }
-       }
-       return 0;
-}
-
-/*
- * Handle VxLAN interface update - change to tunnel IP, master or VLAN.
- */
-int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags)
-{
-       vni_t vni;
-       struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       struct zebra_evpn *zevpn = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
-       struct interface *vlan_if = NULL;
-
-       /* Check if EVPN is enabled. */
-       if (!is_evpn_enabled())
-               return 0;
-
-       zif = ifp->info;
-       assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
-
-       zl3vni = zl3vni_lookup(vni);
-       if (zl3vni) {
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug(
-                               "Update L3-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u chg 0x%x",
-                               vni, ifp->name, ifp->ifindex, vxl->access_vlan,
-                               &vxl->vtep_ip,
-                               zif->brslave_info.bridge_ifindex, chgflags);
-
-               /* Removed from bridge? Cleanup and return */
-               if ((chgflags & ZEBRA_VXLIF_MASTER_CHANGE)
-                   && (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
-                       zebra_vxlan_process_l3vni_oper_down(zl3vni);
-                       return 0;
-               }
-
-               if ((chgflags & ZEBRA_VXLIF_MASTER_MAC_CHANGE)
-                   && if_is_operative(ifp) && is_l3vni_oper_up(zl3vni)) {
-                       zebra_vxlan_process_l3vni_oper_down(zl3vni);
-                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
-                       return 0;
-               }
-
-               /* access-vlan change - process oper down, associate with new
-                * svi_if and then process oper up again
-                */
-               if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
-                       if (if_is_operative(ifp)) {
-                               zebra_vxlan_process_l3vni_oper_down(zl3vni);
-                               zl3vni->svi_if = NULL;
-                               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
-                               zl3vni->mac_vlan_if =
-                                       zl3vni_map_to_mac_vlan_if(zl3vni);
-                               zl3vni->local_vtep_ip = vxl->vtep_ip;
-                               if (is_l3vni_oper_up(zl3vni))
-                                       zebra_vxlan_process_l3vni_oper_up(
-                                               zl3vni);
-                       }
-               }
-
-               /*
-                * local-ip change - process oper down, associate with new
-                * local-ip and then process oper up again
-                */
-               if (chgflags & ZEBRA_VXLIF_LOCAL_IP_CHANGE) {
-                       if (if_is_operative(ifp)) {
-                               zebra_vxlan_process_l3vni_oper_down(zl3vni);
-                               zl3vni->local_vtep_ip = vxl->vtep_ip;
-                               if (is_l3vni_oper_up(zl3vni))
-                                       zebra_vxlan_process_l3vni_oper_up(
-                                               zl3vni);
-                       }
-               }
-
-               /* Update local tunnel IP. */
-               zl3vni->local_vtep_ip = vxl->vtep_ip;
-
-               /* if we have a valid new master, process l3-vni oper up */
-               if (chgflags & ZEBRA_VXLIF_MASTER_CHANGE) {
-                       if (if_is_operative(ifp) && is_l3vni_oper_up(zl3vni))
-                               zebra_vxlan_process_l3vni_oper_up(zl3vni);
-               }
-       } else {
-
-               /* Update VNI hash. */
-               zevpn = zebra_evpn_lookup(vni);
-               if (!zevpn) {
-                       zlog_debug(
-                               "Failed to find EVPN hash on update, IF %s(%u) VNI %u",
-                               ifp->name, ifp->ifindex, vni);
-                       return -1;
-               }
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug(
-                               "Update L2-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u chg 0x%x",
-                               vni, ifp->name, ifp->ifindex, vxl->access_vlan,
-                               &vxl->vtep_ip,
-                               zif->brslave_info.bridge_ifindex, chgflags);
-
-               /* Removed from bridge? Cleanup and return */
-               if ((chgflags & ZEBRA_VXLIF_MASTER_CHANGE)
-                   && (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
-                       /* Delete from client, remove all remote VTEPs */
-                       /* Also, free up all MACs and neighbors. */
-                       zevpn->svi_if = NULL;
-                       zebra_evpn_send_del_to_client(zevpn);
-                       zebra_evpn_neigh_del_all(zevpn, 1, 0, DEL_ALL_NEIGH);
-                       zebra_evpn_mac_del_all(zevpn, 1, 0, DEL_ALL_MAC);
-                       zebra_evpn_vtep_del_all(zevpn, 1);
-                       return 0;
-               }
-
-               /* Handle other changes. */
-               if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
-                       /* Remove all existing local neigh and MACs for this VNI
-                        * (including from BGP)
-                        */
-                       zebra_evpn_neigh_del_all(zevpn, 0, 1, DEL_LOCAL_MAC);
-                       zebra_evpn_mac_del_all(zevpn, 0, 1, DEL_LOCAL_MAC);
-               }
-
-               if (zevpn->local_vtep_ip.s_addr != vxl->vtep_ip.s_addr ||
-                       zevpn->mcast_grp.s_addr != vxl->mcast_grp.s_addr) {
-                       zebra_vxlan_sg_deref(zevpn->local_vtep_ip,
-                               zevpn->mcast_grp);
-                       zebra_vxlan_sg_ref(vxl->vtep_ip, vxl->mcast_grp);
-                       zevpn->local_vtep_ip = vxl->vtep_ip;
-                       zevpn->mcast_grp = vxl->mcast_grp;
-                       /* on local vtep-ip check if ES orig-ip
-                        * needs to be updated
-                        */
-                       zebra_evpn_es_set_base_evpn(zevpn);
-               }
-               zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
-               vlan_if = zvni_map_to_svi(vxl->access_vlan,
-                                         zif->brslave_info.br_if);
-               if (vlan_if) {
-                       zevpn->svi_if = vlan_if;
-                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
-                       zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
-                       if (zl3vni)
-                               listnode_add_sort_nodup(zl3vni->l2vnis, zevpn);
-               }
-
-               /* Take further actions needed.
-                * Note that if we are here, there is a change of interest.
-                */
-               /* If down or not mapped to a bridge, we're done. */
-               if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
-                       return 0;
-
-               /* Inform BGP, if there is a change of interest. */
-               if (chgflags &
-                   (ZEBRA_VXLIF_MASTER_CHANGE | ZEBRA_VXLIF_LOCAL_IP_CHANGE |
-                    ZEBRA_VXLIF_MCAST_GRP_CHANGE | ZEBRA_VXLIF_VLAN_CHANGE))
-                       zebra_evpn_send_add_to_client(zevpn);
-
-               /* If there is a valid new master or a VLAN mapping change,
-                * read and populate local MACs and neighbors.
-                * Also, reinstall any remote MACs and neighbors
-                * for this VNI (based on new VLAN).
-                */
-               if (chgflags & ZEBRA_VXLIF_MASTER_CHANGE)
-                       zebra_evpn_read_mac_neigh(zevpn, ifp);
-               else if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
-                       struct mac_walk_ctx m_wctx;
-                       struct neigh_walk_ctx n_wctx;
-
-                       zebra_evpn_read_mac_neigh(zevpn, ifp);
-
-                       memset(&m_wctx, 0, sizeof(m_wctx));
-                       m_wctx.zevpn = zevpn;
-                       hash_iterate(zevpn->mac_table,
-                                    zebra_evpn_install_mac_hash, &m_wctx);
-
-                       memset(&n_wctx, 0, sizeof(n_wctx));
-                       n_wctx.zevpn = zevpn;
-                       hash_iterate(zevpn->neigh_table,
-                                    zebra_evpn_install_neigh_hash, &n_wctx);
-               }
-       }
-
-       return 0;
-}
-
-/*
- * Handle VxLAN interface add.
- */
-int zebra_vxlan_if_add(struct interface *ifp)
-{
-       vni_t vni;
-       struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan *vxl = NULL;
-       struct zebra_evpn *zevpn = NULL;
-       struct zebra_l3vni *zl3vni = NULL;
-
-       /* Check if EVPN is enabled. */
-       if (!is_evpn_enabled())
-               return 0;
-
-       zif = ifp->info;
-       assert(zif);
-       vxl = &zif->l2info.vxl;
-       vni = vxl->vni;
-
-       zl3vni = zl3vni_lookup(vni);
-       if (zl3vni) {
-
-               /* process if-add for l3-vni*/
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug(
-                               "Add L3-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u",
-                               vni, ifp->name, ifp->ifindex, vxl->access_vlan,
-                               &vxl->vtep_ip,
-                               zif->brslave_info.bridge_ifindex);
-
-               /* associate with vxlan_if */
-               zl3vni->local_vtep_ip = vxl->vtep_ip;
-               zl3vni->vxlan_if = ifp;
-
-               /* Associate with SVI, if any. We can associate with svi-if only
-                * after association with vxlan_if is complete */
-               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
-
-               zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
-
-               if (is_l3vni_oper_up(zl3vni))
-                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
-       } else {
-
-               /* process if-add for l2-vni */
-               struct interface *vlan_if = NULL;
-
-               /* Create or update EVPN hash. */
-               zevpn = zebra_evpn_lookup(vni);
-               if (!zevpn)
-                       zevpn = zebra_evpn_add(vni);
-
-               if (zevpn->local_vtep_ip.s_addr != vxl->vtep_ip.s_addr ||
-                       zevpn->mcast_grp.s_addr != vxl->mcast_grp.s_addr) {
-                       zebra_vxlan_sg_deref(zevpn->local_vtep_ip,
-                               zevpn->mcast_grp);
-                       zebra_vxlan_sg_ref(vxl->vtep_ip, vxl->mcast_grp);
-                       zevpn->local_vtep_ip = vxl->vtep_ip;
-                       zevpn->mcast_grp = vxl->mcast_grp;
-                       /* on local vtep-ip check if ES orig-ip
-                        * needs to be updated
-                        */
-                       zebra_evpn_es_set_base_evpn(zevpn);
-               }
-               zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
-               vlan_if = zvni_map_to_svi(vxl->access_vlan,
-                                         zif->brslave_info.br_if);
-               if (vlan_if) {
-                       zevpn->svi_if = vlan_if;
-                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
-                       zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
-                       if (zl3vni)
-                               listnode_add_sort_nodup(zl3vni->l2vnis, zevpn);
-               }
-
-               if (IS_ZEBRA_DEBUG_VXLAN)
-                       zlog_debug(
-                               "Add L2-VNI %u VRF %s intf %s(%u) VLAN %u local IP %pI4 mcast_grp %pI4 master %u",
-                               vni,
-                               vlan_if ? vlan_if->vrf->name : VRF_DEFAULT_NAME,
-                               ifp->name, ifp->ifindex, vxl->access_vlan,
-                               &vxl->vtep_ip, &vxl->mcast_grp,
-                               zif->brslave_info.bridge_ifindex);
-
-               /* If down or not mapped to a bridge, we're done. */
-               if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
-                       return 0;
-
-               /* Inform BGP */
-               zebra_evpn_send_add_to_client(zevpn);
-
-               /* Read and populate local MACs and neighbors */
-               zebra_evpn_read_mac_neigh(zevpn, ifp);
-       }
-
-       return 0;
-}
-
 int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni,
                                    char *err, int err_str_sz, int filter,
                                    int add)
@@ -5552,8 +5325,8 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS)
 
        } else {
                struct zebra_if *zif = NULL;
-               struct zebra_l2info_vxlan zl2_info;
                struct interface *vlan_if = NULL;
+               struct zebra_vxlan_vni *zl2_info_vni;
                int old_advertise;
 
                zevpn = zebra_evpn_lookup(vni);
@@ -5587,8 +5360,11 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS)
                if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                        return;
 
-               zl2_info = zif->l2info.vxl;
-               vlan_if = zvni_map_to_svi(zl2_info.access_vlan,
+               zl2_info_vni = zebra_vxlan_if_vni_find(zif, vni);
+               if (!zl2_info_vni)
+                       return;
+
+               vlan_if = zvni_map_to_svi(zl2_info_vni->access_vlan,
                                          zif->brslave_info.br_if);
                if (!vlan_if)
                        return;
@@ -5618,8 +5394,8 @@ void zebra_vxlan_advertise_subnet(ZAPI_HANDLER_ARGS)
        struct zebra_evpn *zevpn = NULL;
        struct interface *ifp = NULL;
        struct zebra_if *zif = NULL;
-       struct zebra_l2info_vxlan zl2_info;
        struct interface *vlan_if = NULL;
+       struct zebra_vxlan_vni *zl2_info_vni = NULL;
 
        if (!EVPN_ENABLED(zvrf)) {
                zlog_debug("EVPN GW-MACIP Adv for non-EVPN VRF %u",
@@ -5656,10 +5432,12 @@ void zebra_vxlan_advertise_subnet(ZAPI_HANDLER_ARGS)
        if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                return;
 
-       zl2_info = zif->l2info.vxl;
+       zl2_info_vni = zebra_vxlan_if_vni_find(zif, vni);
+       if (!zl2_info_vni)
+               return;
 
-       vlan_if =
-               zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
+       vlan_if = zvni_map_to_svi(zl2_info_vni->access_vlan,
+                                 zif->brslave_info.br_if);
        if (!vlan_if)
                return;
 
@@ -5718,9 +5496,9 @@ void zebra_vxlan_advertise_gw_macip(ZAPI_HANDLER_ARGS)
 
        } else {
                struct zebra_if *zif = NULL;
-               struct zebra_l2info_vxlan zl2_info;
                struct interface *vlan_if = NULL;
                struct interface *vrr_if = NULL;
+               struct zebra_vxlan_vni *zl2_info_vni = NULL;
                int old_advertise;
 
                zevpn = zebra_evpn_lookup(vni);
@@ -5750,9 +5528,11 @@ void zebra_vxlan_advertise_gw_macip(ZAPI_HANDLER_ARGS)
                if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
                        return;
 
-               zl2_info = zif->l2info.vxl;
+               zl2_info_vni = zebra_vxlan_if_vni_find(zif, vni);
+               if (!zl2_info_vni)
+                       return;
 
-               vlan_if = zvni_map_to_svi(zl2_info.access_vlan,
+               vlan_if = zvni_map_to_svi(zl2_info_vni->access_vlan,
                                          zif->brslave_info.br_if);
                if (!vlan_if)
                        return;
@@ -5929,6 +5709,9 @@ void zebra_vxlan_init(void)
 {
        zrouter.l3vni_table = hash_create(l3vni_hash_keymake, l3vni_hash_cmp,
                                          "Zebra VRF L3 VNI table");
+
+       svd_nh_table = zebra_neigh_db_create("Zebra SVD next-hop table");
+
        zrouter.evpn_vrf = NULL;
        zebra_evpn_mh_init();
 }
@@ -5952,6 +5735,42 @@ ifindex_t get_l3vni_svi_ifindex(vrf_id_t vrf_id)
        return zl3vni->svi_if->ifindex;
 }
 
+/* get the l3vni vxlan ifindex */
+ifindex_t get_l3vni_vxlan_ifindex(vrf_id_t vrf_id)
+{
+       struct zebra_l3vni *zl3vni = NULL;
+
+       zl3vni = zl3vni_from_vrf(vrf_id);
+       if (!zl3vni || !is_l3vni_oper_up(zl3vni))
+               return 0;
+
+       return zl3vni->vxlan_if->ifindex;
+}
+
+/* get the l3vni vni */
+vni_t get_l3vni_vni(vrf_id_t vrf_id)
+{
+       struct zebra_l3vni *zl3vni = NULL;
+
+       zl3vni = zl3vni_from_vrf(vrf_id);
+       if (!zl3vni || !is_l3vni_oper_up(zl3vni))
+               return 0;
+
+       return zl3vni->vni;
+}
+
+/* is the vrf l3vni SVD backed? */
+bool is_vrf_l3vni_svd_backed(vrf_id_t vrf_id)
+{
+       struct zebra_l3vni *zl3vni = NULL;
+
+       zl3vni = zl3vni_from_vrf(vrf_id);
+       if (!zl3vni || !is_l3vni_oper_up(zl3vni))
+               return false;
+
+       return IS_ZL3VNI_SVD_BACKED(zl3vni);
+}
+
 /************************** vxlan SG cache management ************************/
 /* Inform PIM about the mcast group */
 static int zebra_vxlan_sg_send(struct zebra_vrf *zvrf,
@@ -6135,8 +5954,8 @@ static struct zebra_vxlan_sg *zebra_vxlan_sg_do_ref(struct zebra_vrf *zvrf,
        return vxlan_sg;
 }
 
-static void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip,
-               struct in_addr mcast_grp)
+void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip,
+                         struct in_addr mcast_grp)
 {
        struct zebra_vrf *zvrf;
 
@@ -6151,8 +5970,7 @@ static void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip,
        zebra_vxlan_sg_do_deref(zvrf, local_vtep_ip, mcast_grp);
 }
 
-static void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip,
-                               struct in_addr mcast_grp)
+void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip, struct in_addr mcast_grp)
 {
        struct zebra_vrf *zvrf;
 
index 16c5bc0a1af5163c0636d15b5194d7dd800794be..98c2767eb2bb5733a9a7a5f11e0d8986687d1c77 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra VxLAN (EVPN) Data structures and definitions
  * These are public definitions referenced by other files.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_VXLAN_H
@@ -36,6 +20,7 @@
 #include "zebra/zebra_vrf.h"
 #include "zebra/zserv.h"
 #include "zebra/zebra_dplane.h"
+#include "zebra/interface.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -62,6 +47,10 @@ is_vxlan_flooding_head_end(void)
 #define ZEBRA_VXLIF_MCAST_GRP_CHANGE    (1 << 3)
 #define ZEBRA_VXLIF_MASTER_MAC_CHANGE (1 << 4)
 
+#define ZEBRA_VXLIF_VNI_UPDATE(__flags)                                        \
+       ((__flags) & (ZEBRA_VXLIF_VLAN_CHANGE | ZEBRA_VXLIF_MCAST_GRP_CHANGE))
+#define ZEBRA_VXLIF_UPDATE(__flags)                                            \
+       ((__flags) & (ZEBRA_VXLIF_LOCAL_IP_CHANGE | ZEBRA_VXLIF_MASTER_CHANGE))
 
 #define VNI_STR_LEN 32
 
@@ -84,6 +73,9 @@ extern void zebra_vxlan_sg_replay(ZAPI_HANDLER_ARGS);
 
 extern int is_l3vni_for_prefix_routes_only(vni_t vni);
 extern ifindex_t get_l3vni_svi_ifindex(vrf_id_t vrf_id);
+extern ifindex_t get_l3vni_vxlan_ifindex(vrf_id_t vrf_id);
+extern vni_t get_l3vni_vni(vrf_id_t vrf_id);
+extern bool is_vrf_l3vni_svd_backed(vrf_id_t vrf_id);
 extern int zebra_vxlan_vrf_delete(struct zebra_vrf *zvrf);
 extern int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf);
 extern int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf);
@@ -153,6 +145,7 @@ extern void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t vni,
 extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json);
 extern void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t vni,
                                       bool use_json);
+extern void zebra_vxlan_print_nh_svd(struct vty *vty, bool use_json);
 extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json);
 extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json);
 extern void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
@@ -177,12 +170,13 @@ extern int zebra_vxlan_local_mac_add_update(struct interface *ifp,
 extern int zebra_vxlan_local_mac_del(struct interface *ifp,
                                     struct interface *br_if,
                                     struct ethaddr *mac, vlanid_t vid);
-extern int zebra_vxlan_check_readd_vtep(struct interface *ifp,
+extern int zebra_vxlan_check_readd_vtep(struct interface *ifp, vni_t vni,
                                        struct in_addr vtep_ip);
 extern int zebra_vxlan_if_up(struct interface *ifp);
 extern int zebra_vxlan_if_down(struct interface *ifp);
 extern int zebra_vxlan_if_add(struct interface *ifp);
-extern int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags);
+extern int zebra_vxlan_if_update(struct interface *ifp,
+                                struct zebra_vxlan_if_update_ctx *ctx);
 extern int zebra_vxlan_if_del(struct interface *ifp);
 extern int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni,
                                           char *err, int err_str_sz,
@@ -218,12 +212,12 @@ extern int vni_list_cmp(void *p1, void *p2);
 extern int zebra_vxlan_dp_network_mac_add(struct interface *ifp,
                                          struct interface *br_if,
                                          struct ethaddr *macaddr, vlanid_t vid,
-                                         uint32_t nhg_id, bool sticky,
-                                         bool dp_static);
+                                         vni_t vni, uint32_t nhg_id,
+                                         bool sticky, bool dp_static);
 extern int zebra_vxlan_dp_network_mac_del(struct interface *ifp,
                                          struct interface *br_if,
-                                         struct ethaddr *macaddr,
-                                         vlanid_t vid);
+                                         struct ethaddr *macaddr, vlanid_t vid,
+                                         vni_t vni);
 
 extern void zebra_vxlan_set_accept_bgp_seq(bool set);
 extern bool zebra_vxlan_get_accept_bgp_seq(void);
diff --git a/zebra/zebra_vxlan_if.c b/zebra/zebra_vxlan_if.c
new file mode 100644 (file)
index 0000000..08e07b6
--- /dev/null
@@ -0,0 +1,1162 @@
+/*
+ * Zebra EVPN for VxLAN interface handling
+ *
+ * Copyright (C) 2021 Cumulus Networks, Inc.
+ * Vivek Venkatraman, Stephen Worley, Sharath Ramamurthy
+ *
+ * This file is part of FRR.
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <zebra.h>
+
+#include "hash.h"
+#include "if.h"
+#include "jhash.h"
+#include "linklist.h"
+#include "log.h"
+#include "memory.h"
+#include "prefix.h"
+#include "stream.h"
+#include "table.h"
+#include "vlan.h"
+#include "vxlan.h"
+#ifdef GNU_LINUX
+#include <linux/neighbour.h>
+#endif
+
+#include "zebra/zebra_router.h"
+#include "zebra/debug.h"
+#include "zebra/interface.h"
+#include "zebra/rib.h"
+#include "zebra/rt.h"
+#include "zebra/rt_netlink.h"
+#include "zebra/zebra_errors.h"
+#include "zebra/zebra_l2.h"
+#include "zebra/zebra_ns.h"
+#include "zebra/zebra_vrf.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
+#include "zebra/zebra_evpn.h"
+#include "zebra/zebra_evpn_mac.h"
+#include "zebra/zebra_evpn_neigh.h"
+#include "zebra/zebra_vxlan_private.h"
+#include "zebra/zebra_evpn_mh.h"
+#include "zebra/zebra_evpn_vxlan.h"
+#include "zebra/zebra_router.h"
+
+static unsigned int zebra_vxlan_vni_hash_keymake(const void *p)
+{
+       const struct zebra_vxlan_vni *vni;
+
+       vni = (const struct zebra_vxlan_vni *)p;
+       return jhash_1word(vni->vni, 0);
+}
+
+static bool zebra_vxlan_vni_hash_cmp(const void *p1, const void *p2)
+{
+       const struct zebra_vxlan_vni *vni1;
+       const struct zebra_vxlan_vni *vni2;
+
+       vni1 = (const struct zebra_vxlan_vni *)p1;
+       vni2 = (const struct zebra_vxlan_vni *)p2;
+
+       return (vni1->vni == vni2->vni);
+}
+
+static int zebra_vxlan_if_vni_walk_callback(struct hash_bucket *bucket,
+                                           void *ctxt)
+{
+       int ret;
+       struct zebra_vxlan_vni *vni;
+       struct zebra_vxlan_if_ctx *ctx;
+
+       vni = (struct zebra_vxlan_vni *)bucket->data;
+       ctx = (struct zebra_vxlan_if_ctx *)ctxt;
+
+       ret = ctx->func(ctx->zif, vni, ctx->arg);
+       return ret;
+}
+
+static void zebra_vxlan_if_vni_iterate_callback(struct hash_bucket *bucket,
+                                               void *ctxt)
+{
+       struct zebra_vxlan_vni *vni;
+       struct zebra_vxlan_if_ctx *ctx;
+
+       vni = (struct zebra_vxlan_vni *)bucket->data;
+       ctx = (struct zebra_vxlan_if_ctx *)ctxt;
+
+       ctx->func(ctx->zif, vni, ctx->arg);
+}
+
+static int zebra_vxlan_if_del_vni(struct interface *ifp,
+                                 struct zebra_vxlan_vni *vnip)
+{
+       vni_t vni;
+       struct zebra_if *zif;
+       struct zebra_evpn *zevpn;
+       struct zebra_l3vni *zl3vni;
+       struct interface *br_if;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+       vni = vnip->vni;
+
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Del L3-VNI %u intf %s(%u)", vni, ifp->name,
+                                  ifp->ifindex);
+
+               /* process oper-down for l3-vni */
+               zebra_vxlan_process_l3vni_oper_down(zl3vni);
+
+               /* remove the association with vxlan_if */
+               memset(&zl3vni->local_vtep_ip, 0, sizeof(struct in_addr));
+               zl3vni->vxlan_if = NULL;
+               zl3vni->vid = 0;
+               br_if = zif->brslave_info.br_if;
+               zl3vni_bridge_if_set(zl3vni, br_if, false /* unset */);
+       } else {
+
+               /* process if-del for l2-vni*/
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Del L2-VNI %u intf %s(%u)", vni, ifp->name,
+                                  ifp->ifindex);
+
+               /* Locate hash entry; it is expected to exist. */
+               zevpn = zebra_evpn_lookup(vni);
+               if (!zevpn) {
+                       zlog_debug(
+                               "Failed to locate VNI hash at del, IF %s(%u) VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+                       return 0;
+               }
+
+               /* remove from l3-vni list */
+               zl3vni = zl3vni_from_vrf(zevpn->vrf_id);
+               if (zl3vni)
+                       listnode_delete(zl3vni->l2vnis, zevpn);
+               /* Delete VNI from BGP. */
+               zebra_evpn_send_del_to_client(zevpn);
+
+               /* Free up all neighbors and MAC, if any. */
+               zebra_evpn_neigh_del_all(zevpn, 1, 0, DEL_ALL_NEIGH);
+               zebra_evpn_mac_del_all(zevpn, 1, 0, DEL_ALL_MAC);
+
+               /* Free up all remote VTEPs, if any. */
+               zebra_evpn_vtep_del_all(zevpn, 1);
+
+               /* Delete the hash entry. */
+               if (zebra_evpn_vxlan_del(zevpn)) {
+                       flog_err(EC_ZEBRA_VNI_DEL_FAILED,
+                                "Failed to del EVPN hash %p, IF %s(%u) VNI %u",
+                                zevpn, ifp->name, ifp->ifindex, zevpn->vni);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int zebra_vxlan_if_update_vni(struct interface *ifp,
+                                    struct zebra_vxlan_vni *vnip,
+                                    struct zebra_vxlan_if_update_ctx *ctx)
+{
+       vni_t vni;
+       uint16_t chgflags;
+       vlanid_t access_vlan;
+       struct zebra_if *zif;
+       struct zebra_l2info_vxlan *vxl;
+       struct zebra_evpn *zevpn;
+       struct zebra_l3vni *zl3vni;
+       struct interface *vlan_if;
+       struct interface *br_if;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+       vxl = &zif->l2info.vxl;
+       vni = vnip->vni;
+       chgflags = ctx->chgflags;
+
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Update L3-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u chg 0x%x",
+                               vni, ifp->name, ifp->ifindex, vnip->access_vlan,
+                               &vxl->vtep_ip, zif->brslave_info.bridge_ifindex,
+                               chgflags);
+
+               /* Removed from bridge? Cleanup and return */
+               if ((chgflags & ZEBRA_VXLIF_MASTER_CHANGE) &&
+                   (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
+                       zebra_vxlan_process_l3vni_oper_down(zl3vni);
+                       return 0;
+               }
+
+               if ((chgflags & ZEBRA_VXLIF_MASTER_MAC_CHANGE) &&
+                   if_is_operative(ifp) && is_l3vni_oper_up(zl3vni)) {
+                       zebra_vxlan_process_l3vni_oper_down(zl3vni);
+                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
+                       return 0;
+               }
+
+               /* access-vlan change - process oper down, associate with new
+                * svi_if and then process oper up again
+                */
+               if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
+                       if (if_is_operative(ifp)) {
+                               zebra_vxlan_process_l3vni_oper_down(zl3vni);
+                               zl3vni->svi_if = NULL;
+                               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
+                               zl3vni->mac_vlan_if =
+                                       zl3vni_map_to_mac_vlan_if(zl3vni);
+                               zl3vni->local_vtep_ip = vxl->vtep_ip;
+                               if (is_l3vni_oper_up(zl3vni))
+                                       zebra_vxlan_process_l3vni_oper_up(
+                                               zl3vni);
+                       }
+               }
+
+               /*
+                * local-ip change - process oper down, associate with new
+                * local-ip and then process oper up again
+                */
+               if (chgflags & ZEBRA_VXLIF_LOCAL_IP_CHANGE) {
+                       if (if_is_operative(ifp)) {
+                               zebra_vxlan_process_l3vni_oper_down(zl3vni);
+                               zl3vni->local_vtep_ip = vxl->vtep_ip;
+                               if (is_l3vni_oper_up(zl3vni))
+                                       zebra_vxlan_process_l3vni_oper_up(
+                                               zl3vni);
+                       }
+               }
+
+               /* Update local tunnel IP. */
+               zl3vni->local_vtep_ip = vxl->vtep_ip;
+
+               zl3vni->vid = (zl3vni->vid != vnip->access_vlan)
+                                     ? vnip->access_vlan
+                                     : zl3vni->vid;
+               br_if = zif->brslave_info.br_if;
+               zl3vni_bridge_if_set(zl3vni, br_if, true /* set */);
+
+               /* if we have a valid new master, process l3-vni oper up */
+               if (chgflags & ZEBRA_VXLIF_MASTER_CHANGE) {
+                       if (if_is_operative(ifp) && is_l3vni_oper_up(zl3vni))
+                               zebra_vxlan_process_l3vni_oper_up(zl3vni);
+               }
+       } else {
+
+               /* Update VNI hash. */
+               zevpn = zebra_evpn_lookup(vni);
+               if (!zevpn) {
+                       zlog_debug(
+                               "Failed to find EVPN hash on update, IF %s(%u) VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+                       return -1;
+               }
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Update L2-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u chg 0x%x",
+                               vni, ifp->name, ifp->ifindex, vnip->access_vlan,
+                               &vxl->vtep_ip, zif->brslave_info.bridge_ifindex,
+                               chgflags);
+
+               /* Removed from bridge? Cleanup and return */
+               if ((chgflags & ZEBRA_VXLIF_MASTER_CHANGE) &&
+                   (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
+                       /* Delete from client, remove all remote VTEPs */
+                       /* Also, free up all MACs and neighbors. */
+                       zevpn->svi_if = NULL;
+                       zebra_evpn_send_del_to_client(zevpn);
+                       zebra_evpn_neigh_del_all(zevpn, 1, 0, DEL_ALL_NEIGH);
+                       zebra_evpn_mac_del_all(zevpn, 1, 0, DEL_ALL_MAC);
+                       zebra_evpn_vtep_del_all(zevpn, 1);
+                       return 0;
+               }
+
+               /* Handle other changes. */
+               if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
+                       /* Remove all existing local neigh and MACs for this VNI
+                        * (including from BGP)
+                        */
+                       access_vlan = vnip->access_vlan;
+                       vnip->access_vlan = ctx->old_vni.access_vlan;
+                       zebra_evpn_neigh_del_all(zevpn, 0, 1, DEL_LOCAL_MAC);
+                       zebra_evpn_mac_del_all(zevpn, 0, 1, DEL_LOCAL_MAC);
+                       zebra_evpn_rem_mac_uninstall_all(zevpn);
+                       vnip->access_vlan = access_vlan;
+               }
+
+               if (zevpn->local_vtep_ip.s_addr != vxl->vtep_ip.s_addr ||
+                   zevpn->mcast_grp.s_addr != vnip->mcast_grp.s_addr) {
+                       zebra_vxlan_sg_deref(zevpn->local_vtep_ip,
+                                            zevpn->mcast_grp);
+                       zebra_vxlan_sg_ref(vxl->vtep_ip, vnip->mcast_grp);
+                       zevpn->local_vtep_ip = vxl->vtep_ip;
+                       zevpn->mcast_grp = vnip->mcast_grp;
+                       /* on local vtep-ip check if ES orig-ip
+                        * needs to be updated
+                        */
+                       zebra_evpn_es_set_base_evpn(zevpn);
+               }
+               zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
+               zevpn->vid = (zevpn->vid != vnip->access_vlan)
+                                    ? vnip->access_vlan
+                                    : zevpn->vid;
+               br_if = zif->brslave_info.br_if;
+               zevpn_bridge_if_set(zevpn, br_if, true /* set */);
+
+               vlan_if = zvni_map_to_svi(vnip->access_vlan, br_if);
+               if (vlan_if)
+                       zevpn->svi_if = vlan_if;
+
+               /* Take further actions needed.
+                * Note that if we are here, there is a change of interest.
+                */
+               /* If down or not mapped to a bridge, we're done. */
+               if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
+                       return 0;
+
+               /* Inform BGP, if there is a change of interest. */
+               if (chgflags &
+                   (ZEBRA_VXLIF_MASTER_CHANGE | ZEBRA_VXLIF_LOCAL_IP_CHANGE |
+                    ZEBRA_VXLIF_MCAST_GRP_CHANGE | ZEBRA_VXLIF_VLAN_CHANGE))
+                       zebra_evpn_send_add_to_client(zevpn);
+
+               /* If there is a valid new master or a VLAN mapping change,
+                * read and populate local MACs and neighbors.
+                * Also, reinstall any remote MACs and neighbors
+                * for this VNI (based on new VLAN).
+                */
+               if (chgflags & ZEBRA_VXLIF_MASTER_CHANGE)
+                       zebra_evpn_read_mac_neigh(zevpn, ifp);
+               else if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
+                       struct neigh_walk_ctx n_wctx;
+
+                       zebra_evpn_read_mac_neigh(zevpn, ifp);
+
+                       zebra_evpn_rem_mac_install_all(zevpn);
+
+                       memset(&n_wctx, 0, sizeof(n_wctx));
+                       n_wctx.zevpn = zevpn;
+                       hash_iterate(zevpn->neigh_table,
+                                    zebra_evpn_install_neigh_hash, &n_wctx);
+               }
+       }
+
+       return 0;
+}
+
+static int zebra_vxlan_if_add_vni(struct interface *ifp,
+                                 struct zebra_vxlan_vni *vnip)
+{
+       vni_t vni;
+       struct zebra_if *zif;
+       struct zebra_l2info_vxlan *vxl;
+       struct zebra_evpn *zevpn;
+       struct zebra_l3vni *zl3vni;
+       struct interface *br_if;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+       vxl = &zif->l2info.vxl;
+       vni = vnip->vni;
+
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+
+               /* process if-add for l3-vni*/
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Add L3-VNI %u intf %s(%u) VLAN %u local IP %pI4 master %u",
+                               vni, ifp->name, ifp->ifindex, vnip->access_vlan,
+                               &vxl->vtep_ip,
+                               zif->brslave_info.bridge_ifindex);
+
+               /* associate with vxlan_if */
+               zl3vni->local_vtep_ip = vxl->vtep_ip;
+               zl3vni->vxlan_if = ifp;
+
+               /*
+                * Associate with SVI, if any. We can associate with svi-if only
+                * after association with vxlan_if is complete
+                */
+               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
+
+               zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
+
+               zl3vni->vid = vnip->access_vlan;
+               br_if = zif->brslave_info.br_if;
+               zl3vni_bridge_if_set(zl3vni, br_if, true /* set */);
+
+               if (is_l3vni_oper_up(zl3vni))
+                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
+       } else {
+
+               /* process if-add for l2-vni */
+               struct interface *vlan_if = NULL;
+
+               /* Create or update EVPN hash. */
+               zevpn = zebra_evpn_lookup(vni);
+               if (!zevpn)
+                       zevpn = zebra_evpn_add(vni);
+
+               if (zevpn->local_vtep_ip.s_addr != vxl->vtep_ip.s_addr ||
+                   zevpn->mcast_grp.s_addr != vnip->mcast_grp.s_addr) {
+                       zebra_vxlan_sg_deref(zevpn->local_vtep_ip,
+                                            zevpn->mcast_grp);
+                       zebra_vxlan_sg_ref(vxl->vtep_ip, vnip->mcast_grp);
+                       zevpn->local_vtep_ip = vxl->vtep_ip;
+                       zevpn->mcast_grp = vnip->mcast_grp;
+                       /* on local vtep-ip check if ES orig-ip
+                        * needs to be updated
+                        */
+                       zebra_evpn_es_set_base_evpn(zevpn);
+               }
+               zevpn_vxlan_if_set(zevpn, ifp, true /* set */);
+               br_if = zif->brslave_info.br_if;
+               zevpn_bridge_if_set(zevpn, br_if, true /* set */);
+               vlan_if = zvni_map_to_svi(vnip->access_vlan, br_if);
+               if (vlan_if) {
+                       zevpn->vid = vnip->access_vlan;
+                       zevpn->svi_if = vlan_if;
+                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
+                       zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
+                       if (zl3vni)
+                               listnode_add_sort_nodup(zl3vni->l2vnis, zevpn);
+               }
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Add L2-VNI %u VRF %s intf %s(%u) VLAN %u local IP %pI4 mcast_grp %pI4 master %u",
+                               vni,
+                               vlan_if ? vlan_if->vrf->name : VRF_DEFAULT_NAME,
+                               ifp->name, ifp->ifindex, vnip->access_vlan,
+                               &vxl->vtep_ip, &vnip->mcast_grp,
+                               zif->brslave_info.bridge_ifindex);
+
+               /* If down or not mapped to a bridge, we're done. */
+               if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
+                       return 0;
+
+               /* Inform BGP */
+               zebra_evpn_send_add_to_client(zevpn);
+
+               /* Read and populate local MACs and neighbors */
+               zebra_evpn_read_mac_neigh(zevpn, ifp);
+       }
+
+       return 0;
+}
+
+static void zebra_vxlan_if_vni_entry_del(struct zebra_if *zif,
+                                        struct zebra_vxlan_vni *vni)
+{
+       if (vni) {
+               zebra_evpn_vl_vxl_deref(vni->access_vlan, vni->vni, zif);
+               zebra_vxlan_if_del_vni(zif->ifp, vni);
+       }
+}
+
+static int zebra_vxlan_if_vni_entry_add(struct zebra_if *zif,
+                                       struct zebra_vxlan_vni *vni)
+{
+       zebra_evpn_vl_vxl_ref(vni->access_vlan, vni->vni, zif);
+       return zebra_vxlan_if_add_vni(zif->ifp, vni);
+}
+
+static int zebra_vxlan_if_add_update_vni(struct zebra_if *zif,
+                                        struct zebra_vxlan_vni *vni,
+                                        void *ctxt)
+{
+       struct zebra_vxlan_vni vni_tmp;
+       struct zebra_vxlan_if_update_ctx *ctx;
+       struct zebra_vxlan_vni *old_vni = NULL;
+
+       ctx = (struct zebra_vxlan_if_update_ctx *)ctxt;
+       memcpy(&vni_tmp, vni, sizeof(*vni));
+
+       if ((hashcount(ctx->old_vni_table) == 0) ||
+           !(old_vni = hash_release(ctx->old_vni_table, &vni_tmp))) {
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("vxlan %s adding vni(%d, %d)",
+                                  zif->ifp->name, vni->vni, vni->access_vlan);
+
+               zebra_vxlan_if_vni_entry_add(zif, &vni_tmp);
+               return 0;
+       }
+
+       ctx->old_vni = *old_vni;
+       ctx->chgflags = ZEBRA_VXLIF_VLAN_CHANGE;
+
+       /* copy mcast group from old_vni as thats not being changed here */
+       vni->mcast_grp = old_vni->mcast_grp;
+
+       if (old_vni->access_vlan != vni->access_vlan) {
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "vxlan %s updating vni(%d, %d) -> vni(%d, %d)",
+                               zif->ifp->name, old_vni->vni,
+                               old_vni->access_vlan, vni->vni,
+                               vni->access_vlan);
+
+               zebra_evpn_vl_vxl_deref(old_vni->access_vlan, old_vni->vni,
+                                       zif);
+               zebra_evpn_vl_vxl_ref(vni->access_vlan, vni->vni, zif);
+               zebra_vxlan_if_update_vni(zif->ifp, vni, ctx);
+               zebra_vxlan_vni_free(old_vni);
+       }
+
+       return 0;
+}
+
+static int zebra_vxlan_if_vni_entry_update_callback(struct zebra_if *zif,
+                                                   struct zebra_vxlan_vni *vni,
+                                                   void *ctxt)
+{
+       struct zebra_vxlan_if_update_ctx *ctx;
+
+       ctx = (struct zebra_vxlan_if_update_ctx *)ctxt;
+       return zebra_vxlan_if_update_vni(zif->ifp, vni, ctx);
+}
+
+static int zebra_vxlan_if_vni_entry_del_callback(struct zebra_if *zif,
+                                                struct zebra_vxlan_vni *vni,
+                                                void *ctxt)
+{
+       zebra_vxlan_if_vni_entry_del(zif, vni);
+       return 0;
+}
+
+static int zebra_vxlan_if_vni_entry_down_callback(struct zebra_if *zif,
+                                                 struct zebra_vxlan_vni *vni,
+                                                 void *ctxt)
+{
+       return zebra_vxlan_if_vni_down(zif->ifp, vni);
+}
+
+static int zebra_vxlan_if_vni_entry_up_callback(struct zebra_if *zif,
+                                               struct zebra_vxlan_vni *vni,
+                                               void *ctxt)
+{
+       return zebra_vxlan_if_vni_up(zif->ifp, vni);
+}
+
+static void zebra_vxlan_if_vni_clean(struct hash_bucket *bucket, void *arg)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni *vni;
+
+       zif = (struct zebra_if *)arg;
+       vni = (struct zebra_vxlan_vni *)bucket->data;
+       zebra_vxlan_if_vni_entry_del(zif, vni);
+}
+
+void zebra_vxlan_vni_free(void *arg)
+{
+       struct zebra_vxlan_vni *vni;
+
+       vni = (struct zebra_vxlan_vni *)arg;
+
+       XFREE(MTYPE_TMP, vni);
+}
+
+void *zebra_vxlan_vni_alloc(void *p)
+{
+       struct zebra_vxlan_vni *vni;
+       const struct zebra_vxlan_vni *vnip;
+
+       vnip = (const struct zebra_vxlan_vni *)p;
+       vni = XCALLOC(MTYPE_TMP, sizeof(*vni));
+       vni->vni = vnip->vni;
+       vni->access_vlan = vnip->access_vlan;
+       vni->mcast_grp = vnip->mcast_grp;
+
+       return (void *)vni;
+}
+
+struct hash *zebra_vxlan_vni_table_create(void)
+{
+       return hash_create(zebra_vxlan_vni_hash_keymake,
+                          zebra_vxlan_vni_hash_cmp, "Zebra Vxlan VNI Table");
+}
+
+void zebra_vxlan_vni_table_destroy(struct hash *vni_table)
+{
+       if (vni_table) {
+               hash_clean(vni_table, zebra_vxlan_vni_free);
+               hash_free(vni_table);
+       }
+}
+
+int zebra_vxlan_if_vni_table_destroy(struct zebra_if *zif)
+{
+       struct zebra_vxlan_vni_info *vni_info;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       if (vni_info->vni_table) {
+               zebra_vxlan_if_vni_iterate(
+                       zif, zebra_vxlan_if_vni_entry_del_callback, NULL);
+               zebra_vxlan_vni_table_destroy(vni_info->vni_table);
+               vni_info->vni_table = NULL;
+       }
+       return 0;
+}
+
+int zebra_vxlan_if_vni_table_create(struct zebra_if *zif)
+{
+       struct zebra_vxlan_vni_info *vni_info;
+
+       if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+               return 0;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       vni_info->vni_table = zebra_vxlan_vni_table_create();
+       if (!vni_info->vni_table)
+               return -ENOMEM;
+
+       return 0;
+}
+
+struct zebra_vxlan_vni *zebra_vxlan_if_vni_find(const struct zebra_if *zif,
+                                               vni_t vni)
+{
+       struct zebra_vxlan_vni *vnip = NULL;
+       const struct zebra_vxlan_vni_info *vni_info;
+       struct zebra_vxlan_vni vni_tmp;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vnip = (struct zebra_vxlan_vni *)&vni_info->vni;
+               assert(vnip);
+               if (vni && (vnip->vni != vni))
+                       vnip = NULL;
+
+               return vnip;
+       }
+
+       /* For SVD, the VNI value is a required parameter. */
+       assert(vni);
+
+       memset(&vni_tmp, 0, sizeof(vni_tmp));
+       vni_tmp.vni = vni;
+       vnip = (struct zebra_vxlan_vni *)hash_lookup(vni_info->vni_table,
+                                                    (void *)&vni_tmp);
+
+       /* TODO: For debugging. Remove later */
+       if (vnip)
+               assert(vnip->vni == vni);
+
+       return vnip;
+}
+
+static int zif_vlanid_vni_walker(struct zebra_if *zif,
+                                struct zebra_vxlan_vni *vnip, void *arg)
+{
+       struct zebra_vxlan_if_vlan_ctx *ctx;
+
+       ctx = (struct zebra_vxlan_if_vlan_ctx *)arg;
+
+       if (vnip->access_vlan == ctx->vid) {
+               ctx->vni = vnip;
+               return HASHWALK_ABORT;
+       }
+
+       return HASHWALK_CONTINUE;
+}
+
+struct zebra_vxlan_vni *zebra_vxlan_if_vlanid_vni_find(struct zebra_if *zif,
+                                                      vlanid_t vid)
+{
+       struct zebra_vxlan_if_vlan_ctx ctx = {};
+
+       if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+               return NULL;
+
+       ctx.vid = vid;
+
+       zebra_vxlan_if_vni_walk(zif, zif_vlanid_vni_walker, &ctx);
+
+       return ctx.vni;
+}
+
+void zebra_vxlan_if_vni_iterate(struct zebra_if *zif,
+                               int (*func)(struct zebra_if *zif,
+                                           struct zebra_vxlan_vni *, void *),
+                               void *arg)
+{
+       struct zebra_vxlan_vni_info *vni_info;
+       struct zebra_vxlan_vni *vni = NULL;
+       struct zebra_vxlan_if_ctx ctx;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni = zebra_vxlan_if_vni_find(zif, 0);
+               func(zif, vni, arg);
+               return;
+       }
+
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.zif = zif;
+       ctx.func = func;
+       ctx.arg = arg;
+       hash_iterate(vni_info->vni_table, zebra_vxlan_if_vni_iterate_callback,
+                    &ctx);
+}
+
+void zebra_vxlan_if_vni_walk(struct zebra_if *zif,
+                            int (*func)(struct zebra_if *zif,
+                                        struct zebra_vxlan_vni *, void *),
+                            void *arg)
+{
+       struct zebra_vxlan_vni_info *vni_info;
+       struct zebra_vxlan_vni *vni = NULL;
+       struct zebra_vxlan_if_ctx ctx;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni = zebra_vxlan_if_vni_find(zif, 0);
+               func(zif, vni, arg);
+               return;
+       }
+
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.zif = zif;
+       ctx.func = func;
+       ctx.arg = arg;
+       hash_walk(vni_info->vni_table, zebra_vxlan_if_vni_walk_callback, &ctx);
+}
+
+vni_t zebra_vxlan_if_access_vlan_vni_find(struct zebra_if *zif,
+                                         struct interface *br_if)
+{
+       struct zebra_vxlan_vni *vni = NULL;
+
+       /* Expected to be called only for vlan-unware bridges. In this case,
+        * we only support a per-VNI VXLAN interface model.
+        */
+       if (!IS_ZEBRA_VXLAN_IF_VNI(zif))
+               return 0;
+
+       vni = zebra_vxlan_if_vni_find(zif, 0);
+       assert(vni);
+
+       return vni->vni;
+}
+
+int zebra_vxlan_if_vni_table_add_update(struct interface *ifp,
+                                       struct hash *vni_table)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+       struct zebra_vxlan_if_update_ctx ctx;
+
+       zif = (struct zebra_if *)ifp->info;
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.old_vni_table = vni_info->vni_table;
+       vni_info->vni_table = vni_table;
+
+       zebra_vxlan_if_vni_iterate(zif, zebra_vxlan_if_add_update_vni, &ctx);
+
+       /* release kernel deleted vnis */
+       if (ctx.old_vni_table) {
+               if (hashcount(ctx.old_vni_table)) {
+                       /* UGLY HACK: Put back the old table so that delete of
+                        * MACs goes through and then flip back.
+                        */
+                       vni_info->vni_table = ctx.old_vni_table;
+                       hash_iterate(ctx.old_vni_table,
+                                    zebra_vxlan_if_vni_clean, zif);
+                       vni_info->vni_table = vni_table;
+               }
+               zebra_vxlan_vni_table_destroy(ctx.old_vni_table);
+               ctx.old_vni_table = NULL;
+       }
+
+       return 0;
+}
+
+int zebra_vxlan_if_vni_mcast_group_add_update(struct interface *ifp,
+                                             vni_t vni_id,
+                                             struct in_addr *mcast_group)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni *vni;
+       struct zebra_vxlan_if_update_ctx ctx;
+
+       zif = (struct zebra_if *)ifp->info;
+
+       if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+               return 0;
+
+       vni = zebra_vxlan_if_vni_find(zif, vni_id);
+       if (!vni)
+               return 0;
+
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.old_vni.mcast_grp = vni->mcast_grp;
+       ctx.chgflags = ZEBRA_VXLIF_MCAST_GRP_CHANGE;
+
+       vni->mcast_grp = *mcast_group;
+
+       return zebra_vxlan_if_update_vni(ifp, vni, &ctx);
+}
+
+int zebra_vxlan_if_vni_mcast_group_del(struct interface *ifp, vni_t vni_id,
+                                      struct in_addr *mcast_group)
+{
+       struct zebra_if *zif = NULL;
+       struct zebra_vxlan_vni *vni;
+       struct zebra_vxlan_if_update_ctx ctx;
+
+       zif = (struct zebra_if *)ifp->info;
+
+       if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+               return 0;
+
+       vni = zebra_vxlan_if_vni_find(zif, vni_id);
+       if (!vni)
+               return 0;
+
+       if (memcmp(mcast_group, &vni->mcast_grp, sizeof(*mcast_group)))
+               return 0;
+
+       memset(&ctx, 0, sizeof(ctx));
+       ctx.old_vni.mcast_grp = vni->mcast_grp;
+       ctx.chgflags = ZEBRA_VXLIF_MCAST_GRP_CHANGE;
+
+       memset(&vni->mcast_grp, 0, sizeof(vni->mcast_grp));
+
+       return zebra_vxlan_if_update_vni(ifp, vni, &ctx);
+}
+
+int zebra_vxlan_if_vni_down(struct interface *ifp, struct zebra_vxlan_vni *vnip)
+{
+       vni_t vni;
+       struct zebra_if *zif;
+       struct zebra_l3vni *zl3vni;
+       struct zebra_evpn *zevpn;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+       vni = vnip->vni;
+
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+               /* process-if-down for l3-vni */
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Intf %s(%u) L3-VNI %u is DOWN", ifp->name,
+                                  ifp->ifindex, vni);
+
+               zebra_vxlan_process_l3vni_oper_down(zl3vni);
+       } else {
+               /* process if-down for l2-vni */
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Intf %s(%u) L2-VNI %u is DOWN", ifp->name,
+                                  ifp->ifindex, vni);
+
+               /* Locate hash entry; it is expected to exist. */
+               zevpn = zebra_evpn_lookup(vni);
+               if (!zevpn) {
+                       zlog_debug(
+                               "Failed to locate VNI hash at DOWN, IF %s(%u) VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+                       return -1;
+               }
+
+               assert(zevpn->vxlan_if == ifp);
+
+               /* remove from l3-vni list */
+               zl3vni = zl3vni_from_vrf(zevpn->vrf_id);
+               if (zl3vni)
+                       listnode_delete(zl3vni->l2vnis, zevpn);
+
+               zebra_evpn_vl_vxl_deref(vnip->access_vlan, vnip->vni, zif);
+
+               /* Delete this VNI from BGP. */
+               zebra_evpn_send_del_to_client(zevpn);
+
+               /* Free up all neighbors and MACs, if any. */
+               zebra_evpn_neigh_del_all(zevpn, 1, 0, DEL_ALL_NEIGH);
+               zebra_evpn_mac_del_all(zevpn, 1, 0, DEL_ALL_MAC);
+
+               /* Free up all remote VTEPs, if any. */
+               zebra_evpn_vtep_del_all(zevpn, 1);
+       }
+       return 0;
+}
+
+/*
+ * Handle VxLAN interface down
+ */
+int zebra_vxlan_if_down(struct interface *ifp)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+               return zebra_vxlan_if_vni_down(ifp, &vni_info->vni);
+       }
+
+       zebra_vxlan_if_vni_iterate(zif, zebra_vxlan_if_vni_entry_down_callback,
+                                  NULL);
+
+       return 0;
+}
+
+int zebra_vxlan_if_vni_up(struct interface *ifp, struct zebra_vxlan_vni *vnip)
+{
+       vni_t vni;
+       struct zebra_if *zif;
+       struct zebra_evpn *zevpn;
+       struct zebra_l3vni *zl3vni;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+       vni = vnip->vni;
+
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni) {
+               /* we need to associate with SVI, if any, we can associate with
+                * svi-if only after association with vxlan-intf is complete
+                */
+               zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni);
+               zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug(
+                               "Intf %s(%u) L3-VNI %u is UP svi_if %s mac_vlan_if %s",
+                               ifp->name, ifp->ifindex, vni,
+                               zl3vni->svi_if ? zl3vni->svi_if->name : "NIL",
+                               zl3vni->mac_vlan_if ? zl3vni->mac_vlan_if->name
+                                                   : "NIL");
+
+               if (is_l3vni_oper_up(zl3vni))
+                       zebra_vxlan_process_l3vni_oper_up(zl3vni);
+       } else {
+               /* Handle L2-VNI add */
+               struct interface *vlan_if = NULL;
+
+               if (IS_ZEBRA_DEBUG_VXLAN)
+                       zlog_debug("Intf %s(%u) L2-VNI %u is UP", ifp->name,
+                                  ifp->ifindex, vni);
+
+               /* Locate hash entry; it is expected to exist. */
+               zevpn = zebra_evpn_lookup(vni);
+               if (!zevpn) {
+                       zlog_debug(
+                               "Failed to locate EVPN hash at UP, IF %s(%u) VNI %u",
+                               ifp->name, ifp->ifindex, vni);
+                       return -1;
+               }
+
+               assert(zevpn->vxlan_if == ifp);
+               zebra_evpn_vl_vxl_ref(vnip->access_vlan, vnip->vni, zif);
+               vlan_if = zvni_map_to_svi(vnip->access_vlan,
+                                         zif->brslave_info.br_if);
+               if (vlan_if) {
+                       zevpn->svi_if = vlan_if;
+                       zevpn->vrf_id = vlan_if->vrf->vrf_id;
+                       zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id);
+                       if (zl3vni)
+                               listnode_add_sort_nodup(zl3vni->l2vnis, zevpn);
+               }
+
+               /* If part of a bridge, inform BGP about this VNI. */
+               /* Also, read and populate local MACs and neighbors. */
+               if (zif->brslave_info.br_if) {
+                       zebra_evpn_send_add_to_client(zevpn);
+                       zebra_evpn_read_mac_neigh(zevpn, ifp);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * Handle VxLAN interface up - update BGP if required.
+ */
+int zebra_vxlan_if_up(struct interface *ifp)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       /* Check if EVPN is enabled. */
+       if (!is_evpn_enabled())
+               return 0;
+
+       zif = ifp->info;
+       assert(zif);
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+               return zebra_vxlan_if_vni_up(ifp, &vni_info->vni);
+       }
+
+       zebra_vxlan_if_vni_iterate(zif, zebra_vxlan_if_vni_entry_up_callback,
+                                  NULL);
+
+       return 0;
+}
+
+int zebra_vxlan_if_vni_del(struct interface *ifp, vni_t vni)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni *vnip;
+       struct zebra_vxlan_vni vni_tmp;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       zif = ifp->info;
+       assert(zif);
+
+       /* This should be called in SVD context only */
+       assert(IS_ZEBRA_VXLAN_IF_SVD(zif));
+
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       memset(&vni_tmp, 0, sizeof(vni_tmp));
+       vni_tmp.vni = vni;
+
+       vnip = hash_release(vni_info->vni_table, &vni_tmp);
+       if (vnip) {
+               zebra_vxlan_if_vni_entry_del(zif, vnip);
+               zebra_vxlan_vni_free(vnip);
+       }
+       return 0;
+}
+
+/*
+ * Handle VxLAN interface delete. Locate and remove entry in hash table
+ * and update BGP, if required.
+ */
+int zebra_vxlan_if_del(struct interface *ifp)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       zif = ifp->info;
+       assert(zif);
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+               zebra_evpn_vl_vxl_deref(vni_info->vni.access_vlan,
+                                       vni_info->vni.vni, zif);
+               return zebra_vxlan_if_del_vni(ifp, &vni_info->vni);
+       }
+
+       zebra_vxlan_if_vni_table_destroy(zif);
+
+       return 0;
+}
+
+/*
+ * Handle VxLAN interface update - change to tunnel IP, master or VLAN.
+ */
+int zebra_vxlan_if_update(struct interface *ifp,
+                         struct zebra_vxlan_if_update_ctx *ctx)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       zif = ifp->info;
+       assert(zif);
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+               return zebra_vxlan_if_update_vni(ifp, &vni_info->vni, ctx);
+       }
+
+       zebra_vxlan_if_vni_iterate(
+               zif, zebra_vxlan_if_vni_entry_update_callback, ctx);
+
+       return 0;
+}
+
+int zebra_vxlan_if_vni_add(struct interface *ifp, struct zebra_vxlan_vni *vni)
+{
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       zif = ifp->info;
+       assert(zif);
+
+       /* This should be called in SVD context only */
+       assert(IS_ZEBRA_VXLAN_IF_SVD(zif));
+
+       /* First insert into the table */
+       vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+       hash_get(vni_info->vni_table, (void *)vni, zebra_vxlan_vni_alloc);
+
+       return zebra_vxlan_if_vni_entry_add(zif, vni);
+}
+
+/*
+ * Handle VxLAN interface add.
+ */
+int zebra_vxlan_if_add(struct interface *ifp)
+{
+       int ret;
+       struct zebra_if *zif;
+       struct zebra_vxlan_vni_info *vni_info;
+
+       zif = ifp->info;
+       assert(zif);
+
+       if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
+               vni_info = VNI_INFO_FROM_ZEBRA_IF(zif);
+               zebra_evpn_vl_vxl_ref(vni_info->vni.access_vlan,
+                                     vni_info->vni.vni, zif);
+               return zebra_vxlan_if_add_vni(ifp, &vni_info->vni);
+       }
+
+       ret = zebra_vxlan_if_vni_table_create(zif);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
diff --git a/zebra/zebra_vxlan_if.h b/zebra/zebra_vxlan_if.h
new file mode 100644 (file)
index 0000000..8a03acb
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Zebra VxLAN (EVPN) interface data structures and definitions
+ * These are public definitions referenced by other files.
+ * Copyright (C) 2021 Cumulus Networks, Inc.
+ * Sharath Ramamurthy
+ *
+ * This file is part of FRR.
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FRR; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _ZEBRA_VXLAN_IF_H
+#define _ZEBRA_VXLAN_IF_H
+
+#include <zebra.h>
+#include <zebra/zebra_router.h>
+
+#include "linklist.h"
+#include "if.h"
+#include "vlan.h"
+#include "vxlan.h"
+
+#include "lib/json.h"
+#include "zebra/zebra_vrf.h"
+#include "zebra/zserv.h"
+#include "zebra/zebra_dplane.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void *zebra_vxlan_vni_alloc(void *p);
+extern void zebra_vxlan_vni_free(void *arg);
+extern struct hash *zebra_vxlan_vni_table_create(void);
+extern void zebra_vxlan_vni_table_destroy(struct hash *vni_table);
+extern int zebra_vxlan_if_vni_table_create(struct zebra_if *zif);
+extern int zebra_vxlan_if_vni_table_destroy(struct zebra_if *zif);
+extern struct zebra_vxlan_vni *
+zebra_vxlan_if_vni_find(const struct zebra_if *zif, vni_t vni);
+extern struct zebra_vxlan_vni *
+zebra_vxlan_if_vlanid_vni_find(struct zebra_if *zif, vlanid_t vni);
+extern void zebra_vxlan_if_vni_iterate(struct zebra_if *zif,
+                                      int (*func)(struct zebra_if *zif,
+                                                  struct zebra_vxlan_vni *,
+                                                  void *),
+                                      void *arg);
+extern void zebra_vxlan_if_vni_walk(struct zebra_if *zif,
+                                   int (*func)(struct zebra_if *zif,
+                                               struct zebra_vxlan_vni *,
+                                               void *),
+                                   void *arg);
+extern vni_t zebra_vxlan_if_access_vlan_vni_find(struct zebra_if *zif,
+                                                struct interface *br_if);
+extern int
+zebra_vxlan_if_vni_mcast_group_add_update(struct interface *ifp, vni_t vni_id,
+                                         struct in_addr *mcast_group);
+extern int zebra_vxlan_if_vni_mcast_group_del(struct interface *ifp,
+                                             vni_t vni_id,
+                                             struct in_addr *mcast_group);
+extern int zebra_vxlan_if_vni_down(struct interface *ifp,
+                                  struct zebra_vxlan_vni *vni);
+extern int zebra_vxlan_if_down(struct interface *ifp);
+extern int zebra_vxlan_if_vni_up(struct interface *ifp,
+                                struct zebra_vxlan_vni *vni);
+extern int zebra_vxlan_if_up(struct interface *ifp);
+extern int zebra_vxlan_if_vni_del(struct interface *ifp, vni_t vni);
+extern int zebra_vxlan_if_del(struct interface *ifp);
+extern int zebra_vxlan_if_vni_table_add_update(struct interface *ifp,
+                                              struct hash *vni_table);
+extern int zebra_vxlan_if_vni_update(struct interface *ifp,
+                                    struct zebra_vxlan_vni *vni,
+                                    uint16_t chgflags);
+extern int zebra_vxlan_if_update(struct interface *ifp,
+                                struct zebra_vxlan_if_update_ctx *ctx);
+extern int zebra_vxlan_if_vni_add(struct interface *ifp,
+                                 struct zebra_vxlan_vni *vni);
+extern int zebra_vxlan_if_add(struct interface *ifp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZEBRA_VXLAN_IF_H */
index fb17dac23ecbcea5594054f571ff41dc74803b99..002fc7db832c7b80b1ec8cc7b05e5b35969f697c 100644 (file)
@@ -1,24 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra VxLAN (EVPN) Data structures and definitions
  * These are "internal" to this function.
  * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
- *
- * This file is part of FRR.
- *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
  */
 
 #ifndef _ZEBRA_VXLAN_PRIVATE_H
@@ -29,6 +13,7 @@
 #include "if.h"
 #include "linklist.h"
 #include "zebra_vxlan.h"
+#include "zebra_vxlan_if.h"
 #include "zebra_evpn.h"
 #include "zebra_evpn_mac.h"
 
@@ -50,6 +35,10 @@ struct zebra_l3vni {
        uint32_t filter;
 #define PREFIX_ROUTES_ONLY     (1 << 0) /* l3-vni used for prefix routes only */
 
+       /* Corresponding Bridge information */
+       vlanid_t vid;
+       struct interface *bridge_if;
+
        /* Local IP */
        struct in_addr local_vtep_ip;
 
@@ -71,6 +60,10 @@ struct zebra_l3vni {
        struct hash *nh_table;
 };
 
+#define IS_ZL3VNI_SVD_BACKED(zl3vni)                                           \
+       (zl3vni->vxlan_if && zl3vni->vxlan_if->info &&                         \
+        IS_ZEBRA_VXLAN_IF_SVD((struct zebra_if *)zl3vni->vxlan_if->info))
+
 /* get the vx-intf name for l3vni */
 static inline const char *zl3vni_vxlan_if_name(struct zebra_l3vni *zl3vni)
 {
@@ -260,5 +253,12 @@ extern void zebra_vxlan_sync_mac_dp_install(struct zebra_mac *mac,
                                            bool force_clear_static,
                                            const char *caller);
 extern bool zebra_evpn_do_dup_addr_detect(struct zebra_vrf *zvrf);
+extern void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip,
+                              struct in_addr mcast_grp);
+extern void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip,
+                                struct in_addr mcast_grp);
+extern void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni);
+extern void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni);
+extern int zebra_evpn_vxlan_del(struct zebra_evpn *zevpn);
 
 #endif /* _ZEBRA_VXLAN_PRIVATE_H */
index 2024f3453468c8d58c701edb4349d3b80c5a6fe9..e064c27ad17253f8722fb7bbb39bbf97bf731d55 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra API server.
  * Portions:
  *   Copyright (C) 1997-1999  Kunihiro Ishiguro
  *   Copyright (C) 2015-2018  Cumulus Networks, Inc.
  *   et al.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
index cfc33f91699bee75e6ef1eb3261bdc38f2515509..1226cd7115b2a20ca8f360d544eb5cdc053a263f 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra API server.
  * Portions:
  *   Copyright (C) 1997-1999  Kunihiro Ishiguro
  *   Copyright (C) 2015-2018  Cumulus Networks, Inc.
  *   et al.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _ZEBRA_ZSERV_H