summaryrefslogtreecommitdiffstats
path: root/src/plugins/stn/stn.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-20 13:40:17 -0700
committerDamjan Marion <dmarion@me.com>2020-10-21 11:04:47 +0000
commit5004b0d2f27476eb751cdfe4000236b28cba2064 (patch)
treeba7aac8d94aa18bef5e7ae0572917a5566a1b1d8 /src/plugins/stn/stn.c
parent97f9694ad364a9bb19d9f642ececfd271d1214ec (diff)
stn: remove dependency on tcp and udp headers
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8a842759009ec0f433f0aeff47f4e1c889d7b211
Diffstat (limited to 'src/plugins/stn/stn.c')
-rw-r--r--src/plugins/stn/stn.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/plugins/stn/stn.c b/src/plugins/stn/stn.c
index cab2cf10e01..760061fe23f 100644
--- a/src/plugins/stn/stn.c
+++ b/src/plugins/stn/stn.c
@@ -18,9 +18,8 @@
#include <vnet/plugin/plugin.h>
#include <vpp/app/version.h>
#include <vnet/ip/format.h>
+#include <vnet/ip/punt.h>
#include <vnet/ethernet/packet.h>
-#include <vnet/udp/udp.h>
-#include <vnet/tcp/tcp.h>
stn_main_t stn_main;
static vlib_node_registration_t stn_ip4_punt;
@@ -313,10 +312,23 @@ int stn_rule_add_del (stn_rule_add_del_args_t *args)
vnet_feature_enable_disable("ip4-punt", "stn-ip4-punt",
0, 1, 0, 0);
- udp_punt_unknown(vm, 0, 1);
- udp_punt_unknown(vm, 1, 1);
- tcp_punt_unknown(vm, 0, 1);
- tcp_punt_unknown(vm, 1, 1);
+ punt_reg_t pr = {
+ .punt = {
+ .l4 = {
+ .af = AF_IP4,
+ .port = ~0,
+ .protocol = IP_PROTOCOL_UDP,
+ },
+ },
+ .type = PUNT_TYPE_L4,
+ };
+ vnet_punt_add_del (vm, &pr, 1 /* is_add */);
+ pr.punt.l4.af = AF_IP6;
+ vnet_punt_add_del (vm, &pr, 1 /* is_add */);
+ pr.punt.l4.protocol = IP_PROTOCOL_TCP;
+ vnet_punt_add_del (vm, &pr, 1 /* is_add */);
+ pr.punt.l4.af = AF_IP4;
+ vnet_punt_add_del (vm, &pr, 1 /* is_add */);
}
}