Commit 7dd1010
committed
fboss2
Adds `fboss2-dev config protocol bgp neighbor <ip> [<attribute> <value> ...]`
as a single dispatcher (mirroring the `global` command): the neighbor address
is the first positional token, one- or two-token attributes are matched
longest-prefix-first against a dispatch table, and handlers mutate the typed
bgp::thrift::BgpPeer via ConfigSession::getBgpConfig()/saveBgpConfig().
- Bare `neighbor <ip>` creates the peer; attribute sets find-or-create it,
keyed by the folly::IPAddress-normalized peer_addr (prefix notation for
passive sessions is accepted).
- New peers are seeded with parseable any-addresses for local_addr /
next_hop4 / next_hop6: bgpd constructs folly::IPAddress from these
non-optional fields at config load and aborts on the empty strings a
freshly created peer would otherwise serialize (reproduced on an NH-4010-F
device).
- add-path send/receive merge into the single AddPath enum (RECEIVE/SEND/
BOTH); clearing the last direction unsets the field.
- Rejected instead of persisting dead config: connect-mode BOTH (thrift only
models is_passive), peer-port / bind-addr port (no per-peer port field),
afi ipv4/ipv6-labeled-unicast (no thrift field).
- Value validation: 4-byte ASN range, IP family for next-hop4/next-hop6,
bind-addr address parse, thrift-enum membership for advertise-lbw /
receive-lbw, non-negative timers and route limits. A rejected value never
lands on disk.
- Deletes the 26 per-attribute `peer` command classes plus the now-dead
per-peer folly::dynamic BgpConfigSession API they used; parity attributes
those commands supported (next-hop4/6, next-hop-self, peer-id, type,
link-bandwidth, advertise/receive-lbw, timers withdraw-unprog-delay,
pre/post warning limits) are carried over in the dispatcher.
- `delete protocol bgp neighbor <ip>` removes the matching peer from the
staged config via shared BgpPeerAddr.h normalize/find helpers; deleting an
unknown neighbor errors without persisting anything.
- bgp_json_to_cli.py peer generators emit the new grammar (shlex-escaped,
including the neighbor address); explicit zero timers/limits are no longer
dropped and symbolic add_path enum names are handled.
- Integration tests verify committed neighbor config through the bgpd
TBgpService::getRunningConfig RPC (with a brief connection retry: systemd
reports the unit active before the thrift server binds its port), proving
the daemon parsed and adopted the promoted config rather than only
checking the file the CLI wrote.config protocol bgp neighbor and delete protocol bgp neighbor commands1 parent e9b8e2b commit 7dd1010
75 files changed
Lines changed: 2143 additions & 4072 deletions
File tree
- cmake
- fboss/cli/fboss2
- commands
- config/protocol/bgp
- neighbor
- peer
- delete/protocol/bgp
- neighbor
- docs
- test
- config
- integration_test
- tools
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
858 | 859 | | |
859 | 860 | | |
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
863 | 864 | | |
| 865 | + | |
| 866 | + | |
864 | 867 | | |
865 | 868 | | |
866 | 869 | | |
| |||
899 | 902 | | |
900 | 903 | | |
901 | 904 | | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | 905 | | |
955 | 906 | | |
956 | 907 | | |
| |||
998 | 949 | | |
999 | 950 | | |
1000 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
1001 | 974 | | |
1002 | 975 | | |
1003 | 976 | | |
| |||
1021 | 994 | | |
1022 | 995 | | |
1023 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
1024 | 1001 | | |
1025 | 1002 | | |
1026 | 1003 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| 1072 | + | |
1072 | 1073 | | |
1073 | 1074 | | |
1074 | 1075 | | |
| |||
1088 | 1089 | | |
1089 | 1090 | | |
1090 | 1091 | | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | 1092 | | |
1118 | 1093 | | |
1119 | 1094 | | |
| |||
1152 | 1127 | | |
1153 | 1128 | | |
1154 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
1155 | 1132 | | |
1156 | 1133 | | |
1157 | 1134 | | |
| |||
1196 | 1173 | | |
1197 | 1174 | | |
1198 | 1175 | | |
| 1176 | + | |
1199 | 1177 | | |
1200 | 1178 | | |
1201 | 1179 | | |
| 1180 | + | |
1202 | 1181 | | |
1203 | 1182 | | |
1204 | 1183 | | |
| |||
1214 | 1193 | | |
1215 | 1194 | | |
1216 | 1195 | | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | 1196 | | |
1236 | 1197 | | |
1237 | 1198 | | |
| |||
1271 | 1232 | | |
1272 | 1233 | | |
1273 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
1274 | 1237 | | |
1275 | 1238 | | |
1276 | 1239 | | |
| |||
0 commit comments