FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
icmp4.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef included_vnet_icmp4_h
16 #define included_vnet_icmp4_h
17 
18 #define foreach_icmp4_error \
19  _ (NONE, "valid packets") \
20  _ (UNKNOWN_TYPE, "unknown type") \
21  _ (INVALID_CODE_FOR_TYPE, "invalid code for type") \
22  _ (INVALID_HOP_LIMIT_FOR_TYPE, "hop_limit != 255") \
23  _ (LENGTH_TOO_SMALL_FOR_TYPE, "payload length too small for type") \
24  _ (OPTIONS_WITH_ODD_LENGTH, \
25  "total option length not multiple of 8 bytes") \
26  _ (OPTION_WITH_ZERO_LENGTH, "option has zero length") \
27  _ (ECHO_REPLIES_SENT, "echo replies sent") \
28  _ (DST_LOOKUP_MISS, "icmp6 dst address lookup misses") \
29  _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
30  _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
31  _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \
32  _ (DROP, "error message dropped")
33 
34 typedef enum
35 {
36 #define _(f,s) ICMP4_ERROR_##f,
38 #undef _
40 
41 typedef struct
42 {
43  u8 packet_data[64];
45 
48  u32 node_index);
49 
52 {
53  vnet_buffer (b)->ip.icmp.type = type;
54  vnet_buffer (b)->ip.icmp.code = code;
55  vnet_buffer (b)->ip.icmp.data = data;
56 }
57 
59 
60 #endif /* included_vnet_icmp4_h */
61 
62 /*
63  * fd.io coding-style-patch-verification: ON
64  *
65  * Local Variables:
66  * eval: (c-set-style "gnu")
67  * End:
68  */
icmp_input_trace_t
Definition: icmp4.h:41
format_icmp4_input_trace
format_function_t format_icmp4_input_trace
Definition: icmp4.h:46
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
node_index
node node_index
Definition: interface_output.c:440
foreach_icmp4_error
#define foreach_icmp4_error
Definition: icmp4.h:18
ip4_icmp_register_type
void ip4_icmp_register_type(vlib_main_t *vm, icmp4_type_t type, u32 node_index)
Definition: icmp4.c:526
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
static_always_inline
#define static_always_inline
Definition: clib.h:112
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
icmp4_error_set_vnet_buffer
static_always_inline void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
Definition: icmp4.h:51
data
u8 data[128]
Definition: ipsec_types.api:95
format_function_t
u8 *() format_function_t(u8 *s, va_list *args)
Definition: format.h:48
u32
unsigned int u32
Definition: types.h:88
icmp4_error_t
icmp4_error_t
Definition: icmp4.h:34
vlib_main_t
Definition: main.h:102
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
ip4_icmp_input_node
vlib_node_registration_t ip4_icmp_input_node
(constructor) VLIB_REGISTER_NODE (ip4_icmp_input_node)
Definition: icmp4.c:210
icmp4_type_t
icmp4_type_t
Definition: icmp46_packet.h:162
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111