21 #include <vpp/app/version.h> 55 #define _(sym,string) string, 75 s =
format (s,
"sw_if_index %u next-index %u",
89 s =
format (s,
"sw_if_index %u next-index %u",
103 s =
format (s,
"sw_if_index %u next-input %u",
115 u32 n_left_from, *from, *to_next;
119 error = IGMP_ERROR_NONE;
126 while (n_left_from > 0)
132 while (n_left_from > 0 && n_left_to_next > 0)
152 if (ip->
protocol != IP_PROTOCOL_IGMP)
154 error = IGMP_ERROR_INVALID_PROTOCOL;
166 clib_net_to_host_u16 (ip->
length) -
170 if (checksum != csum)
172 error = IGMP_ERROR_BAD_CHECKSUM;
178 error = IGMP_ERROR_NOT_ENABLED;
186 case IGMP_TYPE_membership_query:
189 case IGMP_TYPE_membership_report_v3:
193 error = IGMP_ERROR_UNKNOWN_TYPE;
211 n_left_to_next, bi, next);
223 .name =
"igmp-input",
224 .vector_size =
sizeof (
u32),
245 u32 n_left_from, *from, *to_next;
252 while (n_left_from > 0)
258 while (n_left_from > 0 && n_left_to_next > 0)
303 (
u8 *) args,
sizeof (*args) + len);
311 n_left_to_next, bi, next);
323 .name =
"igmp-parse-query",
324 .vector_size =
sizeof (
u32),
343 u32 n_left_from, *from, *to_next;
353 while (n_left_from > 0)
359 while (n_left_from > 0 && n_left_to_next > 0)
377 error = IGMP_ERROR_NONE;
409 (
u8 *) args,
sizeof (*args) + len);
417 n_left_to_next, bi, next);
429 .name =
"igmp-parse-report",
430 .vector_size =
sizeof (
u32),
A copy of the query message sent from the worker to the main thread.
void igmp_handle_report(const igmp_report_args_t *args)
static u32 igmp_membership_query_v3_length(const igmp_membership_query_v3_t *q)
static clib_error_t * igmp_init(vlib_main_t *vm)
igmp initialization
void ip4_register_protocol(u32 protocol, u32 node_index)
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define VLIB_INIT_FUNCTION(x)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
#define vlib_call_init_function(vm, x)
igmp_config_t * igmp_config_lookup(u32 sw_if_index)
igmp config lookup
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
A copy of the report message sent from the worker to the main thread.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_REGISTER_NODE(x,...)
#define foreach_igmp_error
static ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#define clib_memcpy(a, b, c)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
void igmp_handle_query(const igmp_query_args_t *args)
Called from the main thread on reception of a Query message.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static u32 igmp_membership_report_v3_length(const igmp_membership_report_v3_t *r)
u16 flags
Copy of main node flags.
static int ip4_header_bytes(const ip4_header_t *i)
#define VLIB_NODE_FLAG_TRACE
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip_csum_fold(ip_csum_t c)