FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
ip4_to_ip6.h File Reference

IPv4 to IPv6 translation. More...

+ Include dependency graph for ip4_to_ip6.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define frag_id_4to6(id)   (id)
 

Typedefs

typedef int(* ip4_to_ip6_set_fn_t) (vlib_buffer_t *b, ip4_header_t *ip4, ip6_header_t *ip6, void *ctx)
 IPv4 to IPv6 set call back function type. More...
 

Functions

static u16 ip4_get_port (ip4_header_t *ip, u8 sender)
 Get TCP/UDP port number or ICMP id from IPv4 packet. More...
 
static int icmp_to_icmp6_header (icmp46_header_t *icmp, ip4_header_t **inner_ip4)
 Convert type and code value from ICMP4 to ICMP6. More...
 
static int icmp_to_icmp6 (vlib_buffer_t *p, ip4_to_ip6_set_fn_t fn, void *ctx, ip4_to_ip6_set_fn_t inner_fn, void *inner_ctx)
 Translate ICMP4 packet to ICMP6. More...
 

Variables

static u8 icmp_to_icmp6_updater_pointer_table []
 

Detailed Description

IPv4 to IPv6 translation.

Definition in file ip4_to_ip6.h.

Macro Definition Documentation

◆ frag_id_4to6

#define frag_id_4to6 (   id)    (id)

Definition at line 40 of file ip4_to_ip6.h.

Typedef Documentation

◆ ip4_to_ip6_set_fn_t

typedef int(* ip4_to_ip6_set_fn_t) (vlib_buffer_t *b, ip4_header_t *ip4, ip6_header_t *ip6, void *ctx)

IPv4 to IPv6 set call back function type.

Definition at line 28 of file ip4_to_ip6.h.

Function Documentation

◆ icmp_to_icmp6()

static int icmp_to_icmp6 ( vlib_buffer_t p,
ip4_to_ip6_set_fn_t  fn,
void *  ctx,
ip4_to_ip6_set_fn_t  inner_fn,
void *  inner_ctx 
)
inlinestatic

Translate ICMP4 packet to ICMP6.

Parameters
pBuffer to translate.
fnThe function to translate outer header.
ctxA context passed in the outer header translate function.
inner_fnThe function to translate inner header.
inner_ctxA context passed in the inner header translate function.
Returns
0 on success, non-zero value otherwise.

Definition at line 220 of file ip4_to_ip6.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ icmp_to_icmp6_header()

static int icmp_to_icmp6_header ( icmp46_header_t *  icmp,
ip4_header_t **  inner_ip4 
)
inlinestatic

Convert type and code value from ICMP4 to ICMP6.

Parameters
icmpICMP header.
inner_ip4Inner IPv4 header if present, 0 otherwise.
Returns
0 on success, non-zero value otherwise.

Definition at line 102 of file ip4_to_ip6.h.

+ Here is the caller graph for this function:

◆ ip4_get_port()

static u16 ip4_get_port ( ip4_header_t ip,
u8  sender 
)
inlinestatic

Get TCP/UDP port number or ICMP id from IPv4 packet.

Parameters
ip4IPv4 header.
sender1 get sender port, 0 get receiver port.
Returns
Port number on success, 0 otherwise.

Definition at line 51 of file ip4_to_ip6.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ icmp_to_icmp6_updater_pointer_table

u8 icmp_to_icmp6_updater_pointer_table[]
static
Initial value:
=
{ 0, 1, 4, 4, ~0,
~0, ~0, ~0, 7, 6,
~0, ~0, 8, 8, 8,
8, 24, 24, 24, 24
}

Definition at line 32 of file ip4_to_ip6.h.