|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_ip_main_h
41 #define included_ip_main_h
154 u32 first_buffer_offset,
158 u32 n_bytes_left = n_bytes_to_checksum;
171 if (n_bytes_left == 0)
186 u8 * iph,
u32 ip_header_size,
u8 * l4h)
189 u8 *data_this_buffer, length_odd;
190 u32 n_bytes_left, n_this_buffer, n_ip_bytes_this_buffer;
192 n_bytes_left = payload_length;
197 n_this_buffer = payload_length;
198 data_this_buffer = l4h;
206 n_this_buffer = payload_length;
207 data_this_buffer = iph + ip_header_size;
208 n_ip_bytes_this_buffer =
211 n_ip_bytes_this_buffer))
213 n_this_buffer = n_ip_bytes_this_buffer - ip_header_size;
225 n_this_buffer =
clib_min (n_this_buffer, n_bytes_left);
231 n_bytes_left -= n_this_buffer;
232 if (n_bytes_left == 0)
235 if (!(p0->
flags & VLIB_BUFFER_NEXT_PRESENT))
240 length_odd = (n_this_buffer & 1);
252 data_this_buffer[0] = 0;
288 void *feature_config,
289 u32 n_feature_config_bytes);
u32 next_buffer
Next buffer for this linked-list of buffers.
vnet_interface_main_t * im
void ip_table_delete(fib_protocol_t fproto, u32 table_id, u8 is_api)
void ip_copy(ip46_address_t *dst, ip46_address_t *src, u8 is_ip4)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
unformat_function_t * unformat_match
u8 ip6_is_local_host(ip6_address_t *ip6_address)
static ip_protocol_info_t * ip_get_protocol_info(ip_main_t *im, u32 protocol)
format_function_t * format_header
static ip_csum_t ip_incremental_checksum_buffer(vlib_main_t *vm, vlib_buffer_t *first_buffer, u32 first_buffer_offset, u32 n_bytes_to_checksum, ip_csum_t sum)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
ip_protocol_info_t * protocol_infos
u8 ip_is_local_host(ip46_address_t *ip46_address, u8 is_ip4)
static u16 ip_calculate_l4_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip_csum_t sum0, u32 payload_length, u8 *iph, u32 ip_header_size, u8 *l4h)
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
u32 ip_table_get_unused_id(fib_protocol_t fproto)
tcp_udp_port_info_t * port_infos
uword * protocol_info_by_protocol
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
uword * protocol_info_by_name
static u32 vlib_buffer_get_ip_fib_index(vlib_buffer_t *b, u8 is_ip4)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
u8 ip4_is_local_host(ip4_address_t *ip4_address)
format_function_t * format_header
vlib_node_registration_t ip4_inacl_node
(constructor) VLIB_REGISTER_NODE (ip4_inacl_node)
u8 ip_is_local(u32 fib_index, ip46_address_t *ip46_address, u8 is_ip4)
Checks that an ip is local to the requested fib.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static u32 vlib_buffer_get_ip6_fib_index(vlib_buffer_t *b)
clib_error_t * ip_main_init(vlib_main_t *vm)
struct _vlib_node_registration vlib_node_registration_t
u16 current_length
Nbytes between current data and the end of this buffer.
unformat_function_t * unformat_header
static tcp_udp_port_info_t * ip_get_tcp_udp_port_info(ip_main_t *im, u32 port)
void ip_feature_enable_disable(ip_address_family_t af, ip_sub_address_family_t safi, ip_feature_location_t loc, const char *feature, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
void ip_table_create(fib_protocol_t fproto, u32 table_id, u8 is_api, const u8 *name)
uword * port_info_by_port
vlib_node_registration_t ip6_inacl_node
(constructor) VLIB_REGISTER_NODE (ip6_inacl_node)
vl_api_address_family_t af
vl_api_ip_proto_t protocol
int ip_table_bind(fib_protocol_t fproto, u32 sw_if_index, u32 table_id, u8 is_api)
manual_print typedef u8 ip4_address[4]
manual_print typedef u8 ip6_address[16]
u8 ip_is_zero(ip46_address_t *ip46_address, u8 is_ip4)
enum ip_protocol ip_protocol_t
IP prefix management on interfaces.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
enum ip_sub_address_family_t_ ip_sub_address_family_t
unformat_function_t * unformat_pg_edit
enum ip_feature_location_t_ ip_feature_location_t
uword * port_info_by_name
vl_api_interface_index_t sw_if_index
static u32 vlib_buffer_get_ip4_fib_index(vlib_buffer_t *b)
static u16 ip_csum_fold(ip_csum_t c)
unformat_function_t * unformat_pg_edit
void ip_del_all_interface_addresses(vlib_main_t *vm, u32 sw_if_index)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
enum ip_address_family_t_ ip_address_family_t
VLIB buffer representation.