udp: cleanup input node
[vpp.git] / src / vnet / udp / udp.h
index f7985c9..0cb085b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Copyright (c) 2017-2020 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -202,7 +202,7 @@ vnet_get_udp_main ()
 }
 
 always_inline udp_connection_t *
-udp_get_connection_from_transport (transport_connection_t * tc)
+udp_connection_from_transport (transport_connection_t * tc)
 {
   return ((udp_connection_t *) tc);
 }
@@ -213,6 +213,7 @@ udp_connection_index (udp_connection_t * uc)
   return (uc - udp_main.connections[uc->c_thread_index]);
 }
 
+void udp_connection_free (udp_connection_t * uc);
 udp_connection_t *udp_connection_alloc (u32 thread_index);
 
 /**
@@ -269,7 +270,6 @@ udp_connection_clone_safe (u32 connection_index, u32 thread_index)
   return new_c;
 }
 
-
 always_inline udp_dst_port_info_t *
 udp_get_dst_port_info (udp_main_t * um, udp_dst_port_t dst_port, u8 is_ip4)
 {
@@ -279,6 +279,7 @@ udp_get_dst_port_info (udp_main_t * um, udp_dst_port_t dst_port, u8 is_ip4)
 
 format_function_t format_udp_header;
 format_function_t format_udp_rx_trace;
+format_function_t format_udp_connection;
 unformat_function_t unformat_udp_header;
 
 void udp_add_dst_port (udp_main_t * um, udp_dst_port_t dst_port,
@@ -289,7 +290,6 @@ void udp_register_dst_port (vlib_main_t * vm,
 void udp_unregister_dst_port (vlib_main_t * vm,
                              udp_dst_port_t dst_port, u8 is_ip4);
 bool udp_is_valid_dst_port (udp_dst_port_t dst_port, u8 is_ip4);
-
 void udp_connection_share_port (u16 lcl_port, u8 is_ip4);
 
 void udp_punt_unknown (vlib_main_t * vm, u8 is_ip4, u8 is_add);
@@ -308,10 +308,9 @@ vlib_buffer_push_udp (vlib_buffer_t * b, u16 sp, u16 dp, u8 offload_csum)
   uh->checksum = 0;
   uh->length = clib_host_to_net_u16 (udp_len);
   if (offload_csum)
-    {
-      b->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
-      vnet_buffer (b)->l4_hdr_offset = (u8 *) uh - b->data;
-    }
+    b->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
+  vnet_buffer (b)->l4_hdr_offset = (u8 *) uh - b->data;
+  b->flags |= VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
   return uh;
 }