Commit Graph

20148 Commits

Author SHA1 Message Date
Donald Sharp
17e2f0bff3 zebra: in_addr_cmp and struct prefix are not happy
Coverity is complaining that we are looking beyond the end
of the pointer.  Why not just use prefix_cmp here?  Since
we are comparing to route_nodes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16 20:14:55 -04:00
Donald Sharp
a83014ccd6
Merge pull request #6247 from FRRouting/nb_conversions
Merge nb_converions branch to master
2020-04-16 19:39:14 -04:00
Donald Sharp
2ff99507ad
Merge pull request #6135 from opensourcerouting/cli-node-cleanup
*: clean up the mess that is CLI command nodes
2020-04-16 19:24:56 -04:00
Quentin Young
edf7eff077
Merge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any
bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"
2020-04-16 15:40:03 -04:00
Quentin Young
40664f16e3 lib: suppress formatting on yang.c module array
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16 15:38:11 -04:00
Donatas Abraitis
45facd9c66
Merge pull request #5913 from taspelund/evpn_route_type_int
bgpd: Allow 'show bgp l2vpn evpn route type' to use RT number in addition to existing keywords
2020-04-16 22:28:19 +03:00
Olivier Dugeon
c2c3db58a4
Merge pull request #6224 from mjstapp/zclient_session_id
lib,zebra: add a session id for zapi sessions
2020-04-16 21:12:30 +02:00
Quentin Young
bec74cc8a3 lib: fix style nit in yang_wrappers.c
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16 15:10:19 -04:00
Mark Stapp
4cebdb9bb8 zebra,ldpd: use zapi client session id in LM apis
Use the zapi client session id in the label manager apis;
use the client struct directly in some code. Assign a session
id to ldpd's sync LM zapi session.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16 12:07:54 -04:00
Mark Stapp
4e0b5b31b7 lib,zebra: add a session id for zapi sessions
Distinguish zapi sessions, for daemons who use more than one,
by adding a session id. The tuple of proto + instance is not
adequate to support clients who use multiple zapi sessions.
Include the id in the client show output if it's present. Add
a bit of info about this to the developer doc.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16 12:07:54 -04:00
Chirag Shah
7225e61cca zebra: add weight to nb conversion
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:58:09 -07:00
Chirag Shah
d9d6232fb6 yang: add weight in nexthop operational model
add weight field to operational model.
add leafref to nexthopgroup.
format according to yanglint.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:51:41 -07:00
Chirag Shah
8f86689091 lib: increase xpath maxlen
Certain xpath are well 256 characters, increasing
to 512.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:51:41 -07:00
Chirag Shah
09268680bb zebra: add northbound support for zebra interface
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:51:38 -07:00
Stephen Worley
887a232c3b tests: add connected/recursive/duplicte/route-map NHG tests
Add some more NHG topotests using connected, recursive, duplicate
and higher ecmp nexthops as well as route maps.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-04-16 11:49:50 -04:00
Chirag Shah
83ed00f1df lib: remove gcc 4.x workaround for nb structure
Remove gcc 4.x workaround for variable size array as gcc
check moved to header file.

In lib/northbound.h : struct frr_yang_module_info made
size 1000 for gcc 4.x, where maximum 1000 nodes can fit.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:48:57 -07:00
Chirag Shah
b00f3e4be4 zebra: add nb callbacks for zebra if state
This is all stub callbacks autogenrated for
zebra interface state data.

Signed-off-by: chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:48:28 -07:00
Chirag Shah
4e0a7355c2 lib: add interface operational northbound callback
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:26:36 -07:00
Chirag Shah
93a6af756c yang: update zebra interface model
Modify interface config model
and add zebra specific interface state operational data.

augment /frr-interface:lib/frr-interface:interface:
  +--rw zebra
     +--rw ip-addrs* [address-family ip-prefix]
     |  +--rw address-family    identityref
     |  +--rw ip-prefix         ietf-inet-types:ip-prefix
     |  +--rw label?            string
     |  +--rw ip4-peer?         ietf-inet-types:ipv4-prefix
     +--rw multicast?     boolean
     +--rw link-detect?   boolean
     +--rw shutdown?      boolean
     +--rw bandwidth?     uint32
     +--ro state
        +--ro up-count?      uint16
        +--ro down-count?    uint16
        +--ro zif-type?      identityref
        +--ro ptm-status?    string <disabled>
        +--ro vlan-id?       uint16
        +--ro vni-id?        vni-id-type
        +--ro remote-vtep?   ietf-inet-types:ipv4-address
        +--ro mcast-group?   ietf-routing-types:ipv4-multicast-group-address

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:26:36 -07:00
Chirag Shah
219dabe8d4 yang: add operational data to frr-interface model
module: frr-interface
  +--rw lib
     +--rw interface* [name vrf]
        +--rw name           string
        +--rw vrf            frr-vrf:vrf-ref
        +--rw description?   string
        +--ro state
           +--ro if-index?      int32
           +--ro mtu?           uint16
           +--ro mtu6?          uint32
           +--ro speed?         uint32
           +--ro metric?        uint32
           +--ro flags?         if-flags-type
           +--ro type?          identityref
           +--ro phy-address?   ietf-yang-types:mac-address

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:26:36 -07:00
Chirag Shah
b0f502c521 yang: add ietf interface yang model
Add ietf interface yant model.
Also include it in the makefile.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:26:36 -07:00
Sarita Patra
7fd139b523 yang: igmp yang definition
Defined frr-igmp.yang file for IGMP protocol.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: Santosh P K <sapk@vmware.com>

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-16 08:26:29 -07:00
Chirag Shah
cad46cfdc9 lib: yang wrapper nexthop type to str
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:24:02 -07:00
Chirag Shah
b71df6891c lib: add yang wrapper for type empty
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:18:00 -07:00
Chirag Shah
ed5abdb2ad zebra: stub changes to assimilate re into rib nb
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:18:00 -07:00
Chirag Shah
303cfba626 yang: zebra rib model add route entry
FRR rib model need to accomodate route entries for
a given destination prefix.

Add a list of route entry under the list of prefix.

+--rw ribs
   +--rw rib* [afi-safi-name table-id]
      +--rw table-id         uint32
      +--rw afi-safi-name    identityref
      +--ro route* [prefix]
         +--ro prefix         ietf-inet-types:ip-prefix
         +--ro route-entry* [protocol]
            +--ro protocol           frr-route-types:frr-route-types-v4
            +--ro instance?          uint16
            +--ro distance?          uint8
            +--ro metric?            uint32
            +--ro tag?               uint32
            +--ro selected?          empty
            +--ro installed?         empty
            +--ro failed?            empty
            +--ro queued?            empty
            +--ro internal-flags?    int32
            +--ro internal-status?   int32
            +--ro uptime?            ietf-yang-types:date-and-time
            +--ro nexthop-group* [name]
               +--ro name            string
               +--ro frr-nexthops
                  +--ro nexthop* [nh-type gateway interface]
                     +--ro nh-type             frr-nexthop:nexthop-type
                     +--ro vrf?                frr-vrf:vrf-ref
                     +--ro gateway             frr-nexthop:optional-ip-address
                     +--ro interface           frr-interface:interface-ref
                     +--ro bh-type?            frr-nexthop:blackhole-type
                     +--ro onlink?             boolean <false>
                     +--ro mpls-label-stack
                     |  +--ro entry* [id]
                     |     +--ro id               uint8
                     |     +--ro label?           ietf-routing-types:mpls-label
                     |     +--ro ttl?             uint8
                     |     +--ro traffic-class?   uint8
                     +--ro duplicate?          empty
                     +--ro recursive?          empty
                     +--ro active?             empty
                     +--ro fib?                empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:17:59 -07:00
Chirag Shah
1fca062a25 yang: zebra rib model remove grouping for ip route
Grouping is referencing leaves outside the grouping
from where it is used. Removing it and defining leaves
at the used place.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:17:59 -07:00
Chirag Shah
d36228c956 zebra: convert clear evpn dup addr command to nb
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:17:59 -07:00
Chirag Shah
c37c6fd818 zebra: nb rpc cb for clear evpn dup addr cmd
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:17:57 -07:00
Chirag Shah
e20755b23e zebra: clear dup detect cleanup for nb conversion
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:13:15 -07:00
Chirag Shah
dd9ef518bf lib:api to convert mac to yang object
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:13:15 -07:00
Chirag Shah
ce45ffe73b zebra: nb callbacks support
Definition of the northbound callbacks
and associated YANG data paths for zebra.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:13:12 -07:00
Chirag Shah
0d2e2bd138 yang: add zebra model in makefile
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:11:51 -07:00
Chirag Shah
e7ecd0a657 *: frr nexthop yang in makefile
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:09:11 -07:00
Chirag Shah
4218384d6f yang: zebra rib operational model
augment /frr-vrf:lib/frr-vrf:vrf:
  +--rw ribs
     +--rw rib* [afi-safi-name table-id]
        +--rw table-id         uint32
        +--rw afi-safi-name    identityref
        +--ro route* [prefix]
           +--ro prefix             ietf-inet-types:ip-prefix
           +--ro protocol?          frr-route-types:frr-route-types-v4
           +--ro protocol-v6?       frr-route-types:frr-route-types-v6
           +--ro vrf?               frr-vrf:vrf-ref
           +--ro distance?          uint8
           +--ro metric?            uint32
           +--ro tag?               uint32
           +--ro selected?          empty
           +--ro installed?         empty
           +--ro failed?            empty
           +--ro queued?            empty
           +--ro internal-flags?    int32
           +--ro internal-status?   int32
           +--ro uptime?            ietf-yang-types:date-and-time
           +--ro nexthop-group* [name]
              +--ro name            string
              +--ro frr-nexthops
                 +--ro nexthop* [nh-type gateway interface]
                    +--ro nh-type             frr-nexthop:nexthop-type
                    +--ro vrf?                frr-vrf:vrf-ref
                    +--ro gateway             frr-nexthop:optional-ip-address
                    +--ro interface           frr-interface:interface-ref
                    +--ro bh-type?            frr-nexthop:blackhole-type
                    +--ro onlink?             boolean <false>
                    +--ro mpls-label-stack
                    |  +--ro entry* [id]
                    |     +--ro id               uint8
                    |     +--ro label?           ietf-routing-types:mpls-label
                    |     +--ro ttl?             uint8
                    |     +--ro traffic-class?   uint8
                    +--ro duplicate?          empty
                    +--ro recursive?          empty
                    +--ro active?             empty
                    +--ro fib?                empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:05:04 -07:00
Chirag Shah
115232e252 yang: revert leafref to get interface cmd working
Unable to access interface command:
root@bharat:~/stash/libyang/build# dpkg-query -W | grep libyang
libyang-dev	0.16.105-3~ubuntu18.04.1
libyang0.16	0.16.105-3~ubuntu18.04.1
root@bharat:~/stash/libyang/build# vtysh
bharat# config t
bharat(config)# interface lo
% Configuration failed: validation error.

Please check the logs for more details.

Logfile:
2020/03/21 16:48:55 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='lo'][vrf='default']/vrf)
2020/03/21 16:48:55 ZEBRA: [EC 100663337]
nb_candidate_commit_prepare: failed to validate
candidate configuration

CI system failure:
2020/03/21 18:53:18 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='r1-eth0'][vrf='default']/vrf)
2020/03/21 18:53:18 ZEBRA: [EC 100663337] nb_candidate_commit_prepare:
failed to validate candidate configuration
2020/03/21 18:53:18 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='r1-eth1'][vrf='default']/vrf)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:00:18 -07:00
Chirag Shah
8b4cb7a64b lib: convert vrf cmd to northbound config callback
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:00:18 -07:00
Chirag Shah
6fd8972aef *: include vrf northbound module in init
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:00:15 -07:00
Chirag Shah
bc867a5d30 lib: vrf northbound callbacks
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 07:55:56 -07:00
vdhingra
8b04316627 lib: yang defination for basic frr-routing
Yang files for basic frr-routing used by other
daemons like staticd and pim

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: vishaldhingra <vdhingra@vmware.com>
Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-04-16 07:55:53 -07:00
Santosh P K
09133ff4f7
Merge pull request #5451 from opensourcerouting/rcu-log
logging subsystem rewrite
2020-04-16 20:23:44 +05:30
vdhingra
56822e76fd staticd: yang defination
Yang files for staticd to use northbound APIs

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: vishaldhingra <vdhingra@vmware.com>
Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-04-16 07:49:10 -07:00
Santosh P K
f8614910a5 lib: FRR next-hop yang data model.
A common nexthop and group nexthop yang data model
for all protocols in FRR.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Vishaldhingra <vdhingra@vmware.com>
Signed-off-by: Santosh P K <sapk@vmware.com>
2020-04-16 07:49:10 -07:00
Chirag Shah
cc9f7265a8 yang: add vrf ref to interface model
module: frr-interface
  +--rw lib
     +--rw interface* [name vrf]
        +--rw name           string
        +--rw vrf            frr-vrf:vrf-ref
        +--rw description?   string

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 07:49:10 -07:00
Chirag Shah
3a7262b6a9 *: add frr-vrf yang module in makefile
lib: Adding frr-vrf yang module to common place
so it can be accessed from all frr modules.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 07:49:06 -07:00
Chirag Shah
85bb733513 yang: add vrf model
module: frr-vrf
  +--rw lib
     +--rw vrf* [name]
        +--rw name      string
        +--ro id?       uint32
        +--ro active?   boolean <false>
        +--rw netns {netns}?
           +--rw name?   string

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 07:41:56 -07:00
Donatas Abraitis
eb91f8d6d7 bgpd: Add a sanitify check for bgp_nexthop_cache against NULL
In real world sometimes happens that bgp_nexthop_cache is NULL. Avoid
segfaulting when using `show [ip] bgp ...` CLI commands.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-16 16:13:01 +03:00
Donatas Abraitis
c845358213
Merge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup
tests: Cleanup bgp config for evpn vxlan topotest
2020-04-16 16:05:34 +03:00
Donatas Abraitis
d3f6c580a8 bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"
That's only 0/1, useful to use just a bool for that.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-16 15:27:51 +03:00
Donald Sharp
e51d13ca7c tests: Cleanup bgp config for evpn vxlan topotest
The bgp configuration for the vxlan topotest mixed
and matched some configuration that does not belong
for an IBGP setup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16 07:04:27 -04:00