FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip4_map_t.c File Reference
+ Include dependency graph for ip4_map_t.c:

Go to the source code of this file.

Enumerations

enum  ip4_mapt_next_t {
  IP4_MAPT_NEXT_MAPT_TCP_UDP, IP4_MAPT_NEXT_MAPT_ICMP, IP4_MAPT_NEXT_MAPT_FRAGMENTED, IP4_MAPT_NEXT_ICMP_ERROR,
  IP4_MAPT_NEXT_DROP, IP4_MAPT_N_NEXT
}
 
enum  ip4_mapt_icmp_next_t {
  IP4_MAPT_ICMP_NEXT_IP6_LOOKUP, IP4_MAPT_ICMP_NEXT_IP6_REWRITE, IP4_MAPT_ICMP_NEXT_IP6_FRAG, IP4_MAPT_ICMP_NEXT_DROP,
  IP4_MAPT_ICMP_N_NEXT
}
 
enum  ip4_mapt_tcp_udp_next_t {
  IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP, IP4_MAPT_TCP_UDP_NEXT_IP6_REWRITE, IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG, IP4_MAPT_TCP_UDP_NEXT_DROP,
  IP4_MAPT_TCP_UDP_N_NEXT
}
 
enum  ip4_mapt_fragmented_next_t {
  IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP, IP4_MAPT_FRAGMENTED_NEXT_IP6_REWRITE, IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG, IP4_MAPT_FRAGMENTED_NEXT_DROP,
  IP4_MAPT_FRAGMENTED_N_NEXT
}
 

Functions

typedef CLIB_PACKED (struct { ip6_address_t daddr;ip6_address_t saddr;u8 unused[28];})
 
static int ip4_to_ip6_set_icmp_cb (vlib_buffer_t *b, ip4_header_t *ip4, ip6_header_t *ip6, void *arg)
 
static int ip4_to_ip6_set_inner_icmp_cb (vlib_buffer_t *b, ip4_header_t *ip4, ip6_header_t *ip6, void *arg)
 
static uword ip4_map_t_icmp (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static int map_ip4_to_ip6_fragmented (vlib_buffer_t *p, ip4_mapt_pseudo_header_t *pheader)
 
static uword ip4_map_t_fragmented (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static int map_ip4_to_ip6_tcp_udp (vlib_buffer_t *p, ip4_mapt_pseudo_header_t *pheader)
 
static uword ip4_map_t_tcp_udp (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static_always_inline void ip4_map_t_classify (vlib_buffer_t *p0, map_domain_t *d0, ip4_header_t *ip40, u16 ip4_len0, i32 *dst_port0, u8 *error0, ip4_mapt_next_t *next0, u16 l4_dst_port)
 
static uword ip4_map_t (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (ip4_map_t_feature, static)
 

Variables

 icmp_to_icmp6_ctx_t
 
vlib_node_registration_t ip4_map_t_fragmented_node
 (constructor) VLIB_REGISTER_NODE (ip4_map_t_fragmented_node) More...
 
vlib_node_registration_t ip4_map_t_icmp_node
 (constructor) VLIB_REGISTER_NODE (ip4_map_t_icmp_node) More...
 
vlib_node_registration_t ip4_map_t_tcp_udp_node
 (constructor) VLIB_REGISTER_NODE (ip4_map_t_tcp_udp_node) More...
 
vlib_node_registration_t ip4_map_t_node
 (constructor) VLIB_REGISTER_NODE (ip4_map_t_node) More...
 

Enumeration Type Documentation

◆ ip4_mapt_fragmented_next_t

Enumerator
IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP 
IP4_MAPT_FRAGMENTED_NEXT_IP6_REWRITE 
IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG 
IP4_MAPT_FRAGMENTED_NEXT_DROP 
IP4_MAPT_FRAGMENTED_N_NEXT 

Definition at line 48 of file ip4_map_t.c.

◆ ip4_mapt_icmp_next_t

Enumerator
IP4_MAPT_ICMP_NEXT_IP6_LOOKUP 
IP4_MAPT_ICMP_NEXT_IP6_REWRITE 
IP4_MAPT_ICMP_NEXT_IP6_FRAG 
IP4_MAPT_ICMP_NEXT_DROP 
IP4_MAPT_ICMP_N_NEXT 

Definition at line 30 of file ip4_map_t.c.

◆ ip4_mapt_next_t

Enumerator
IP4_MAPT_NEXT_MAPT_TCP_UDP 
IP4_MAPT_NEXT_MAPT_ICMP 
IP4_MAPT_NEXT_MAPT_FRAGMENTED 
IP4_MAPT_NEXT_ICMP_ERROR 
IP4_MAPT_NEXT_DROP 
IP4_MAPT_N_NEXT 

Definition at line 20 of file ip4_map_t.c.

◆ ip4_mapt_tcp_udp_next_t

Enumerator
IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP 
IP4_MAPT_TCP_UDP_NEXT_IP6_REWRITE 
IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG 
IP4_MAPT_TCP_UDP_NEXT_DROP 
IP4_MAPT_TCP_UDP_N_NEXT 

Definition at line 39 of file ip4_map_t.c.

Function Documentation

◆ CLIB_PACKED()

typedef CLIB_PACKED ( struct { ip6_address_t daddr;ip6_address_t saddr;u8 unused[28];}  )

Definition at line 60 of file ip4_map_t.c.

◆ ip4_map_t()

static uword ip4_map_t ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 545 of file ip4_map_t.c.

+ Here is the call graph for this function:

◆ ip4_map_t_classify()

static_always_inline void ip4_map_t_classify ( vlib_buffer_t p0,
map_domain_t d0,
ip4_header_t ip40,
u16  ip4_len0,
i32 dst_port0,
u8 error0,
ip4_mapt_next_t next0,
u16  l4_dst_port 
)

Definition at line 495 of file ip4_map_t.c.

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

◆ ip4_map_t_fragmented()

static uword ip4_map_t_fragmented ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 259 of file ip4_map_t.c.

+ Here is the call graph for this function:

◆ ip4_map_t_icmp()

static uword ip4_map_t_icmp ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 112 of file ip4_map_t.c.

+ Here is the call graph for this function:

◆ ip4_map_t_tcp_udp()

static uword ip4_map_t_tcp_udp ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 428 of file ip4_map_t.c.

+ Here is the call graph for this function:

◆ ip4_to_ip6_set_icmp_cb()

static int ip4_to_ip6_set_icmp_cb ( vlib_buffer_t b,
ip4_header_t ip4,
ip6_header_t ip6,
void *  arg 
)
static

Definition at line 76 of file ip4_map_t.c.

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

◆ ip4_to_ip6_set_inner_icmp_cb()

static int ip4_to_ip6_set_inner_icmp_cb ( vlib_buffer_t b,
ip4_header_t ip4,
ip6_header_t ip6,
void *  arg 
)
static

Definition at line 91 of file ip4_map_t.c.

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

◆ map_ip4_to_ip6_fragmented()

static int map_ip4_to_ip6_fragmented ( vlib_buffer_t p,
ip4_mapt_pseudo_header_t *  pheader 
)
inlinestatic

Definition at line 215 of file ip4_map_t.c.

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

◆ map_ip4_to_ip6_tcp_udp()

static int map_ip4_to_ip6_tcp_udp ( vlib_buffer_t p,
ip4_mapt_pseudo_header_t *  pheader 
)
inlinestatic

Definition at line 327 of file ip4_map_t.c.

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

◆ VNET_FEATURE_INIT()

VNET_FEATURE_INIT ( ip4_map_t_feature  ,
static   
)

Variable Documentation

◆ icmp_to_icmp6_ctx_t

icmp_to_icmp6_ctx_t

Definition at line 73 of file ip4_map_t.c.

◆ ip4_map_t_fragmented_node

vlib_node_registration_t ip4_map_t_fragmented_node
Initial value:
= {
.function = ip4_map_t_fragmented,
.name = "ip4-map-t-fragmented",
.vector_size = sizeof(u32),
.format_trace = format_map_trace,
.n_errors = MAP_N_ERROR,
.error_counters = map_error_counters,
.n_next_nodes = IP4_MAPT_FRAGMENTED_N_NEXT,
.next_nodes = {
[IP4_MAPT_FRAGMENTED_NEXT_IP6_REWRITE] = "ip6-load-balance",
},
}

(constructor) VLIB_REGISTER_NODE (ip4_map_t_fragmented_node)

Definition at line 695 of file ip4_map_t.c.

◆ ip4_map_t_icmp_node

vlib_node_registration_t ip4_map_t_icmp_node
Initial value:
= {
.function = ip4_map_t_icmp,
.name = "ip4-map-t-icmp",
.vector_size = sizeof(u32),
.format_trace = format_map_trace,
.n_errors = MAP_N_ERROR,
.error_counters = map_error_counters,
.n_next_nodes = IP4_MAPT_ICMP_N_NEXT,
.next_nodes = {
[IP4_MAPT_ICMP_NEXT_IP6_REWRITE] = "ip6-load-balance",
[IP4_MAPT_ICMP_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (ip4_map_t_icmp_node)

Definition at line 716 of file ip4_map_t.c.

◆ ip4_map_t_node

vlib_node_registration_t ip4_map_t_node
Initial value:
= {
.function = ip4_map_t,
.name = "ip4-map-t",
.vector_size = sizeof(u32),
.format_trace = format_map_trace,
.n_errors = MAP_N_ERROR,
.error_counters = map_error_counters,
.n_next_nodes = IP4_MAPT_N_NEXT,
.next_nodes = {
[IP4_MAPT_NEXT_MAPT_TCP_UDP] = "ip4-map-t-tcp-udp",
[IP4_MAPT_NEXT_MAPT_ICMP] = "ip4-map-t-icmp",
[IP4_MAPT_NEXT_MAPT_FRAGMENTED] = "ip4-map-t-fragmented",
[IP4_MAPT_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[IP4_MAPT_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (ip4_map_t_node)

Definition at line 758 of file ip4_map_t.c.

◆ ip4_map_t_tcp_udp_node

vlib_node_registration_t ip4_map_t_tcp_udp_node
Initial value:
= {
.function = ip4_map_t_tcp_udp,
.name = "ip4-map-t-tcp-udp",
.vector_size = sizeof(u32),
.format_trace = format_map_trace,
.n_errors = MAP_N_ERROR,
.error_counters = map_error_counters,
.n_next_nodes = IP4_MAPT_TCP_UDP_N_NEXT,
.next_nodes = {
[IP4_MAPT_TCP_UDP_NEXT_IP6_REWRITE] = "ip6-load-balance",
[IP4_MAPT_TCP_UDP_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (ip4_map_t_tcp_udp_node)

Definition at line 737 of file ip4_map_t.c.

ip4_map_t
static uword ip4_map_t(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_map_t.c:545
IP4_MAPT_ICMP_NEXT_IP6_REWRITE
@ IP4_MAPT_ICMP_NEXT_IP6_REWRITE
Definition: ip4_map_t.c:33
IP4_MAPT_FRAGMENTED_N_NEXT
@ IP4_MAPT_FRAGMENTED_N_NEXT
Definition: ip4_map_t.c:54
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
IP4_MAPT_TCP_UDP_N_NEXT
@ IP4_MAPT_TCP_UDP_N_NEXT
Definition: ip4_map_t.c:45
IP4_MAPT_NEXT_DROP
@ IP4_MAPT_NEXT_DROP
Definition: ip4_map_t.c:26
IP4_MAPT_NEXT_MAPT_FRAGMENTED
@ IP4_MAPT_NEXT_MAPT_FRAGMENTED
Definition: ip4_map_t.c:24
IP4_MAPT_ICMP_NEXT_IP6_LOOKUP
@ IP4_MAPT_ICMP_NEXT_IP6_LOOKUP
Definition: ip4_map_t.c:32
IP4_MAPT_TCP_UDP_NEXT_IP6_REWRITE
@ IP4_MAPT_TCP_UDP_NEXT_IP6_REWRITE
Definition: ip4_map_t.c:42
IP4_MAPT_NEXT_MAPT_ICMP
@ IP4_MAPT_NEXT_MAPT_ICMP
Definition: ip4_map_t.c:23
IP4_MAPT_NEXT_MAPT_TCP_UDP
@ IP4_MAPT_NEXT_MAPT_TCP_UDP
Definition: ip4_map_t.c:22
IP4_MAPT_ICMP_NEXT_IP6_FRAG
@ IP4_MAPT_ICMP_NEXT_IP6_FRAG
Definition: ip4_map_t.c:34
ip4_map_t_tcp_udp
static uword ip4_map_t_tcp_udp(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_map_t.c:428
IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP
@ IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP
Definition: ip4_map_t.c:41
IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG
@ IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG
Definition: ip4_map_t.c:43
ip4_map_t_icmp
static uword ip4_map_t_icmp(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_map_t.c:112
ip4_map_t_fragmented
static uword ip4_map_t_fragmented(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_map_t.c:259
IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP
@ IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP
Definition: ip4_map_t.c:50
IP4_MAPT_N_NEXT
@ IP4_MAPT_N_NEXT
Definition: ip4_map_t.c:27
IP6_FRAG_NODE_NAME
#define IP6_FRAG_NODE_NAME
Definition: ip_frag.h:44
IP4_MAPT_NEXT_ICMP_ERROR
@ IP4_MAPT_NEXT_ICMP_ERROR
Definition: ip4_map_t.c:25
IP4_MAPT_FRAGMENTED_NEXT_IP6_REWRITE
@ IP4_MAPT_FRAGMENTED_NEXT_IP6_REWRITE
Definition: ip4_map_t.c:51
IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG
@ IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG
Definition: ip4_map_t.c:52
IP4_MAPT_ICMP_NEXT_DROP
@ IP4_MAPT_ICMP_NEXT_DROP
Definition: ip4_map_t.c:35
u32
unsigned int u32
Definition: types.h:88
IP4_MAPT_FRAGMENTED_NEXT_DROP
@ IP4_MAPT_FRAGMENTED_NEXT_DROP
Definition: ip4_map_t.c:53
IP4_MAPT_TCP_UDP_NEXT_DROP
@ IP4_MAPT_TCP_UDP_NEXT_DROP
Definition: ip4_map_t.c:44
IP4_MAPT_ICMP_N_NEXT
@ IP4_MAPT_ICMP_N_NEXT
Definition: ip4_map_t.c:36
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
format_map_trace
u8 * format_map_trace(u8 *s, va_list *args)
Definition: map.c:1204