diff options
author | Neale Ranns <nranns@cisco.com> | 2017-11-15 12:54:46 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-11-18 01:34:22 +0000 |
commit | 70ed8aeff30c0eece0e19f0ad26c4cc8957278ae (patch) | |
tree | b09bda6fef287b46dac123949f25972edc41e600 /src/vnet/bier | |
parent | 8ac4ce8547d84c2d581f572b4f51fd34dbf1b01f (diff) |
unformat function for FIB paths
Change-Id: I32de25890ac0a643314f650591d2479879d9a2a6
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/bier')
-rw-r--r-- | src/vnet/bier/bier_update.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/vnet/bier/bier_update.c b/src/vnet/bier/bier_update.c index 170893d45b6..4d7509dd52e 100644 --- a/src/vnet/bier/bier_update.c +++ b/src/vnet/bier/bier_update.c @@ -79,13 +79,14 @@ vnet_bier_route_cmd (vlib_main_t * vm, fib_route_path_t *brps = NULL, brp = { .frp_flags = FIB_ROUTE_PATH_BIER_FMASK, }; + u32 hdr_len, payload_proto; bier_table_id_t bti = { }; - mpls_label_t out_label; bier_bp_t bp; - u32 hdr_len; u32 add = 1; + payload_proto = DPO_PROTO_BIER; + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "del")) { add = 0; @@ -93,11 +94,9 @@ vnet_bier_route_cmd (vlib_main_t * vm, } else if (unformat (input, "set %d", &bti.bti_set)) { } else if (unformat (input, "bsl %d", &hdr_len)) { } else if (unformat (input, "bp %d", &bp)) { - } else if (unformat (input, "v4-nh %U", - unformat_ip46_address, - &brp.frp_addr, 0)) { - } else if (unformat (input, "mpls %d", &out_label)) { - vec_add1(brp.frp_label_stack, out_label); + } else if (unformat (input, "via %U", + unformat_fib_route_path, + &brp, &payload_proto)) { } else { error = unformat_parse_error (input); goto done; @@ -124,7 +123,7 @@ done: } VLIB_CLI_COMMAND (bier_route_command) = { - .path = "bier route", + .path = "bier route via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]", .short_help = "Add/delete BIER Routes", .function = vnet_bier_route_cmd, }; |