- while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) {
- if (unformat (line_input, "del"))
- {
- is_add = 0;
- }
- else if (unformat (line_input, "instance %d", &instance))
- ;
- else if (unformat (line_input, "src %U",
- unformat_ip4_address, &src.ip4))
- {
- src_set = 1;
- ipv4_set = 1;
- }
- else if (unformat (line_input, "dst %U",
- unformat_ip4_address, &dst.ip4))
- {
- dst_set = 1;
- ipv4_set = 1;
- }
- else if (unformat (line_input, "src %U",
- unformat_ip6_address, &src.ip6))
- {
- src_set = 1;
- ipv6_set = 1;
- }
- else if (unformat (line_input, "dst %U",
- unformat_ip6_address, &dst.ip6))
- {
- dst_set = 1;
- ipv6_set = 1;
- }
- else if (unformat (line_input, "group %U %U",
- unformat_ip4_address, &dst.ip4,
- unformat_vnet_sw_interface,
- vnet_get_main(), &mcast_sw_if_index))
- {
- grp_set = dst_set = 1;
- ipv4_set = 1;
- }
- else if (unformat (line_input, "group %U %U",
- unformat_ip6_address, &dst.ip6,
- unformat_vnet_sw_interface,
- vnet_get_main(), &mcast_sw_if_index))
- {
- grp_set = dst_set = 1;
- ipv6_set = 1;
- }
- else if (unformat (line_input, "encap-vrf-id %d", &tmp))
- {
- encap_fib_index = fib_table_find (fib_ip_proto (ipv6_set), tmp);
- if (encap_fib_index == ~0)
- {
- error = clib_error_return (0, "nonexistent encap-vrf-id %d", tmp);
- goto done;
- }
- }
- else if (unformat (line_input, "decap-next %U", unformat_decap_next,
- &decap_next_index, ipv4_set))
- ;
- else if (unformat (line_input, "vni %d", &vni))
- {
- if (vni >> 24)
- {
- error = clib_error_return (0, "vni %d out of range", vni);
- goto done;
- }
- }
- else
- {
- error = clib_error_return (0, "parse error: '%U'",
- format_unformat_error, line_input);
- goto done;
- }
- }
-
- if (src_set == 0)