|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef included_pnat_node_h
17 #define included_pnat_node_h
20 #include <pnat/pnat.api_enum.h>
52 return PNAT_ERROR_REWRITE;
71 if (
ip->checksum == 0xffff)
75 u16 plen = clib_net_to_host_u16(
ip->length);
79 return PNAT_ERROR_NONE;
82 if (
ip->protocol == IP_PROTOCOL_TCP) {
85 return PNAT_ERROR_TOOSHORT;
92 tcp->dst_port = clib_net_to_host_u16(t->
post_dp);
97 tcp->src_port = clib_net_to_host_u16(t->
post_sp);
101 }
else if (
ip->protocol == IP_PROTOCOL_UDP) {
103 return PNAT_ERROR_TOOSHORT;
125 return PNAT_ERROR_TOOSHORT;
140 return PNAT_ERROR_NONE;
175 interface = pnat_interface_by_sw_if_index(sw_if_index0);
184 if (clib_bihash_search_16_8(&pm->
flowhash, &kv, &
value) == 0) {
209 for (
i = 0;
i <
frame->n_vectors;
i++) {
210 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED) {
230 return frame->n_vectors;
static u8 * format_pnat_trace(u8 *s, va_list *args)
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
struct _tcp_header tcp_header_t
vlib_get_buffers(vm, from, b, n_left_from)
vlib_main_t vlib_node_runtime_t * node
pnat_rewrite_tuple_t rewrite
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static u32 pnat_rewrite_ip4(u32 pool_index, ip4_header_t *ip)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
@ PNAT_INSTR_DESTINATION_PORT
static int ip4_is_fragment(const ip4_header_t *i)
pnat_rewrite_tuple_t rewrite
static_always_inline void vnet_feature_next_u16(u16 *next0, vlib_buffer_t *b0)
pnat_translation_t * translations
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
u8 * format_pnat_rewrite_tuple(u8 *s, va_list *args)
pnat_mask_fast_t lookup_mask_fast[PNAT_ATTACHMENT_POINT_MAX]
static_always_inline uword pnat_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, pnat_attachment_point_t attachment, int dir)
static ip_csum_t ip_csum_sub_even(ip_csum_t c, ip_csum_t x)
description fragment has unexpected format
pnat_instructions_t instructions
clib_bihash_16_8_t flowhash
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u16 ip4_header_checksum(ip4_header_t *i)
@ PNAT_INSTR_DESTINATION_ADDRESS
u16 nexts[VLIB_FRAME_SIZE]
static void pnat_calc_key(u32 sw_if_index, pnat_attachment_point_t attachment, ip4_address_t src, ip4_address_t dst, u8 protocol, u16 sport, u16 dport, pnat_mask_fast_t mask, clib_bihash_kv_16_8_t *kv)
@ PNAT_INSTR_SOURCE_ADDRESS
u8 * format_pnat_match_tuple(u8 *s, va_list *args)
static ip_csum_t ip_csum_add_even(ip_csum_t c, ip_csum_t x)
static u16 ip_csum_fold(ip_csum_t c)
vl_api_pnat_attachment_point_t pnat_attachment_point_t
static void * ip4_next_header(ip4_header_t *i)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags