diff options
author | Neale Ranns <nranns@cisco.com> | 2019-05-15 02:13:37 -0700 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-05-28 13:30:44 +0000 |
commit | 50f0ac0f097e5495da1f2b1816106e3d420ff34b (patch) | |
tree | d10ae0385fc10b7da97b2a24f8dea3882f6d702d /src/vat | |
parent | 9080096f7c548415fc4d5354c7e582a3eda1a5ed (diff) |
Punt: socket register for exception dispatched/punted packets based on reason
- add to the Punt API to allow different descriptions of the desired packets: UDP or exceptions
- move the punt nodes into punt_node.c
- improve tests (test that the correct packets are punted to the registered socket)
Change-Id: I1a133dec88106874993cba1f5a439cd26b2fef72
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r-- | src/vat/api_format.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c index c57f045fdd4..fe8e6ecbb6e 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -20368,16 +20368,18 @@ 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 ipv = ~0; u32 protocol = ~0; u32 port = ~0; int is_add = 1; + u8 is_ip4 = 1; int ret; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { - if (unformat (i, "ip %d", &ipv)) + if (unformat (i, "%U", unformat_vl_api_address_family, &af)) ; else if (unformat (i, "protocol %d", &protocol)) ; @@ -20395,9 +20397,10 @@ api_set_punt (vat_main_t * vam) M (SET_PUNT, mp); mp->is_add = (u8) is_add; - mp->punt.ipv = (u8) ipv; - mp->punt.l4_protocol = (u8) protocol; - mp->punt.l4_port = htons ((u16) port); + 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); |