From 4b7cdbf2d5c7a1a9abed996354c98d36cd51f102 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 5 Jun 2025 12:39:58 +0200 Subject: [PATCH] ip: common icmp echo structure Move the replicated ICMP echo structure from the NAT implementations to the common IP ICMP header. Type: improvement Change-Id: I3770d2609c2366859b014ae66096cd545f4b1262 Signed-off-by: Ole Troan --- src/plugins/nat/det44/det44.h | 6 ------ src/plugins/nat/nat44-ei/nat44_ei.h | 6 ------ src/plugins/nat/nat64/nat64.h | 6 ------ src/vnet/ip/icmp46_packet.h | 6 ++++++ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/plugins/nat/det44/det44.h b/src/plugins/nat/det44/det44.h index 683f554f03c..ae576311111 100644 --- a/src/plugins/nat/det44/det44.h +++ b/src/plugins/nat/det44/det44.h @@ -63,12 +63,6 @@ typedef enum #define DET44_SES_PER_USER 1000 -typedef struct -{ - u16 identifier; - u16 sequence; -} icmp_echo_header_t; - typedef struct { u16 src_port, dst_port; diff --git a/src/plugins/nat/nat44-ei/nat44_ei.h b/src/plugins/nat/nat44-ei/nat44_ei.h index 786fb0cfc2c..d399fc8a594 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei.h +++ b/src/plugins/nat/nat44-ei/nat44_ei.h @@ -83,12 +83,6 @@ typedef int (nat44_ei_alloc_out_addr_and_port_function_t) ( nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index); -typedef struct -{ - u16 identifier; - u16 sequence; -} icmp_echo_header_t; - typedef struct { u16 src_port, dst_port; diff --git a/src/plugins/nat/nat64/nat64.h b/src/plugins/nat/nat64/nat64.h index 2577880c7a4..1e144ca0d6c 100644 --- a/src/plugins/nat/nat64/nat64.h +++ b/src/plugins/nat/nat64/nat64.h @@ -34,12 +34,6 @@ #include -typedef struct -{ - u16 identifier; - u16 sequence; -} icmp_echo_header_t; - typedef struct { u16 src_port, dst_port; diff --git a/src/vnet/ip/icmp46_packet.h b/src/vnet/ip/icmp46_packet.h index 08e73f6cd7d..55b5b4e7490 100644 --- a/src/vnet/ip/icmp46_packet.h +++ b/src/vnet/ip/icmp46_packet.h @@ -355,4 +355,10 @@ typedef CLIB_PACKED (struct link_layer_option; }) icmp6_neighbor_solicitation_header_t; +typedef struct +{ + u16 identifier; + u16 sequence; +} icmp_echo_header_t; + #endif /* included_vnet_icmp46_packet_h */ -- 2.16.6