-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathsonic-bgp-voq-chassis-neighbor.yang
63 lines (53 loc) · 1.9 KB
/
sonic-bgp-voq-chassis-neighbor.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module sonic-bgp-voq-chassis-neighbor {
namespace "https://github.com/sonic-net/sonic-bgp-voq-chassis-neighbor";
prefix bgpintnbr;
yang-version 1.1;
import ietf-inet-types {
prefix inet;
}
import sonic-device_metadata {
prefix dm;
}
import sonic-bgp-common {
prefix bgpcmn;
}
organization
"SONiC";
contact
"SONiC";
description
"SONIC BGP Internal Neighbor for voq chassis platforms";
revision 2021-04-10 {
description
"Initial revision.";
}
container sonic-bgp-voq-chassis-neighbor {
container BGP_VOQ_CHASSIS_NEIGHBOR {
list BGP_VOQ_CHASSIS_NEIGHBOR_LIST {
description "List for internal neighbors in voq chassis platforms";
key "neighbor";
leaf neighbor {
type inet:ip-address;
description "BGP Neighbor address";
}
uses bgpcmn:sonic-bgp-cmn-neigh {
refine asn {
must "(current() = /dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:bgp_asn)" {
error-message "Voq chassis BGP neighbors should have same ASN as defined in device metadata";
}
must ". >= 1" {
error-message "ASN must be greater than 0";
}
}
refine local_addr {
mandatory true;
must "((contains(../neighbor, '.') and contains(current(), '.')) or
(contains(../neighbor, ':') and contains(current(), ':')))" {
error-message "local address and neighbor address family doesnt match";
}
}
}
}
}
}
}