-static int
-api_set_punt (vat_main_t * vam)
-{
- unformat_input_t *i = vam->input;
- vl_api_address_family_t af;
- vl_api_set_punt_t *mp;
- u32 protocol = ~0;
- u32 port = ~0;
- int is_add = 1;
- int ret;
-
- while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (i, "%U", unformat_vl_api_address_family, &af))
- ;
- else if (unformat (i, "protocol %d", &protocol))
- ;
- else if (unformat (i, "port %d", &port))
- ;
- else if (unformat (i, "del"))
- is_add = 0;
- else
- {
- clib_warning ("parse error '%U'", format_unformat_error, i);
- return -99;
- }
- }
-
- M (SET_PUNT, mp);
-
- mp->is_add = (u8) is_add;
- mp->punt.type = PUNT_API_TYPE_L4;
- mp->punt.punt.l4.af = af;
- mp->punt.punt.l4.protocol = (u8) protocol;
- mp->punt.punt.l4.port = htons ((u16) port);
-
- S (mp);
- W (ret);
- return ret;
-}
-