Commit 0cac475
NOS-6672..NOS-6679: fboss2 bgp policy routing-policy term action commands
Adds `config protocol bgp policy routing-policy <name> term <seq-num>
action result <ACCEPT|REJECT|CONTINUE>` and `... action set
<attribute> <value> ...` — the action level of a routing-policy term.
`action` is a pure grouping node; `result` and `set` are its subcommands,
each with its own handler (the policy and term args arrive through the
ancestor-args tuple). The term traits drop positionals_at_end() so CLI11
can classify `action` (and later `match`) after the seq-num; ancestor
attributes mixed with an action command are rejected since only the leaf
runs.
`set` MUST be a real subcommand rather than a parsed token: CLI11's
_valid_subcommand walks the parent chain unconditionally, so a bare `set`
arg token inside `action` was classified as the top-level `set` VERB and
stolen ("The following arguments were not expected"). A local subcommand
named `set` shadows the verb because _find_subcommand checks the local
scope first.
- `result` (NOS-6672) maps ACCEPT/REJECT/CONTINUE onto FlowControlAction
ACCEPT/DENY/NEXT_TERM in term_miss_action. GOTO-TERM stays deferred: no
FlowControlAction arm, and the per-action-entry next_term_id target has
no slot in the documented grammar.
- `set <attr>` writes one bgp_policy.BgpPolicyAction entry per action kind
in policy_entries[].policy_action_entries[] (keyed by which payload field
is set; re-issuing a kind updates its entry):
- as-path prepend <asn> [<asn> ...] (NOS-6673) -> SetAsPathPrepend{asn,
repeat_times}; the documented <asn-list> must be uniform since the
thrift models one ASN repeated N times
- community <community-string> [additive] (NOS-6674) -> inline
single-member CommunityList + route_action COMMUNITY_LIST_ADD/SET
- local-pref <0-4294967295> (NOS-6675) -> LocalPreference.local_pref
- med <0-4294967295> (NOS-6676) -> MedAction{med_value, SET}
- next-hop <ip-address> (NOS-6677) -> SetNextHop; the sheet's `self`
(bgpd rejects set_self) and `peer-address` (no thrift arm) are deferred
- origin <IGP|EGP|INCOMPLETE> (NOS-6678) -> set_origin
- weight <0-65535> (NOS-6679) -> WeightAction{weight_value, SET}
- unit tests (14) + a commit-path integration test staging every action
kind and verifying each entry in bgpd's running config.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 8bd9da9 commit 0cac475
12 files changed
Lines changed: 1129 additions & 3 deletions
File tree
- cmake
- fboss/cli/fboss2
- commands/config/protocol/bgp/policy/routing-policy/term
- action
- test
- config
- integration_test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| 905 | + | |
| 906 | + | |
905 | 907 | | |
906 | 908 | | |
907 | 909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
| 1112 | + | |
1112 | 1113 | | |
1113 | 1114 | | |
1114 | 1115 | | |
| |||
1235 | 1236 | | |
1236 | 1237 | | |
1237 | 1238 | | |
| 1239 | + | |
1238 | 1240 | | |
1239 | 1241 | | |
1240 | 1242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
481 | 506 | | |
482 | 507 | | |
483 | 508 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
0 commit comments