FD.io VPP
v20.05.1-6-gf53edbc3b
Vector Packet Processing
|
IPv6 to IPv4 translation. More...
Go to the source code of this file.
Macros | |
#define | frag_id_6to4(id) ((id) ^ ((id) >> 16)) |
Typedefs | |
typedef int(* | ip6_to_ip4_icmp_set_fn_t) (ip6_header_t *ip6, ip4_header_t *ip4, void *ctx) |
IPv6 to IPv4 set call back function type. More... | |
typedef int(* | ip6_to_ip4_tcp_udp_set_fn_t) (vlib_buffer_t *b, ip6_header_t *ip6, ip4_header_t *ip4, void *ctx) |
Functions | |
static_always_inline int | ip6_parse (vlib_main_t *vm, vlib_buffer_t *b, const ip6_header_t *ip6, u32 buff_len, u8 *l4_protocol, u16 *l4_offset, u16 *frag_hdr_offset) |
Parse some useful information from IPv6 header. More... | |
static u16 | ip6_get_port (vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6, u16 buffer_len, u8 *ip_protocol, u16 *src_port, u16 *dst_port, u8 *icmp_type_or_tcp_flags, u32 *tcp_ack_number, u32 *tcp_seq_number) |
Get L4 information like port number or ICMP id from IPv6 packet. More... | |
static_always_inline int | icmp6_to_icmp_header (icmp46_header_t *icmp, ip6_header_t **inner_ip6) |
Convert type and code value from ICMP6 to ICMP4. More... | |
static_always_inline u8 | ip6_translate_tos (u32 ip_version_traffic_class_and_flow_label) |
Translate TOS value from IPv6 to IPv4. More... | |
static int | icmp6_to_icmp (vlib_main_t *vm, vlib_buffer_t *p, ip6_to_ip4_icmp_set_fn_t fn, void *ctx, ip6_to_ip4_icmp_set_fn_t inner_fn, void *inner_ctx) |
Translate ICMP6 packet to ICMP4. More... | |
Variables | |
static u8 | icmp6_to_icmp_updater_pointer_table [] |
IPv6 to IPv4 translation.
Definition in file ip6_to_ip4.h.
Definition at line 49 of file ip6_to_ip4.h.
typedef int(* ip6_to_ip4_icmp_set_fn_t) (ip6_header_t *ip6, ip4_header_t *ip4, void *ctx) |
IPv6 to IPv4 set call back function type.
Definition at line 27 of file ip6_to_ip4.h.
typedef int(* ip6_to_ip4_tcp_udp_set_fn_t) (vlib_buffer_t *b, ip6_header_t *ip6, ip4_header_t *ip4, void *ctx) |
Definition at line 30 of file ip6_to_ip4.h.
|
inlinestatic |
Translate ICMP6 packet to ICMP4.
p | Buffer to translate. |
fn | The function to translate outer header. |
ctx | A context passed in the outer header translate function. |
inner_fn | The function to translate inner header. |
inner_ctx | A context passed in the inner header translate function. |
Definition at line 350 of file ip6_to_ip4.h.
static_always_inline int icmp6_to_icmp_header | ( | icmp46_header_t * | icmp, |
ip6_header_t ** | inner_ip6 | ||
) |
Convert type and code value from ICMP6 to ICMP4.
icmp | ICMP header. |
inner_ip6 | Inner IPv6 header if present, 0 otherwise. |
Definition at line 237 of file ip6_to_ip4.h.
|
inlinestatic |
Get L4 information like port number or ICMP id from IPv6 packet.
ip6 | IPv6 header. |
buffer_len | Buffer length. |
ip_protocol | L4 protocol |
src_port | L4 src port or icmp id |
dst_post | L4 dst port or icmp id |
icmp_type_or_tcp_flags | ICMP type or TCP flags, if applicable |
tcp_ack_number | TCP ack number, if applicable |
tcp_seq_number | TCP seq number, if applicable |
Definition at line 117 of file ip6_to_ip4.h.
static_always_inline int ip6_parse | ( | vlib_main_t * | vm, |
vlib_buffer_t * | b, | ||
const ip6_header_t * | ip6, | ||
u32 | buff_len, | ||
u8 * | l4_protocol, | ||
u16 * | l4_offset, | ||
u16 * | frag_hdr_offset | ||
) |
Parse some useful information from IPv6 header.
vm | vlib main |
b | vlib buffer |
ip6 | IPv6 header. |
buff_len | Buffer length. |
l4_protocol | L4 protocol number. |
l4_offset | L4 header offset. |
frag_hdr_offset | Fragment header offset if present, 0 otherwise. |
Definition at line 65 of file ip6_to_ip4.h.
static_always_inline u8 ip6_translate_tos | ( | u32 | ip_version_traffic_class_and_flow_label | ) |
Translate TOS value from IPv6 to IPv4.
ip_version_traffic_class_and_flow_label | in network byte order |
Definition at line 332 of file ip6_to_ip4.h.
|
static |
Definition at line 35 of file ip6_to_ip4.h.