blob: a426512ea2f22738d25a897fa9c21b745e1aaad0 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
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_icmp6_h
16#define included_vnet_icmp6_h
17
18#define foreach_icmp6_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 _ (NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK, \
29 "neighbor solicitations from source not on link") \
30 _ (NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN, \
31 "neighbor solicitations for unknown targets") \
32 _ (NEIGHBOR_ADVERTISEMENTS_TX, "neighbor advertisements sent") \
33 _ (NEIGHBOR_ADVERTISEMENTS_RX, "neighbor advertisements received") \
34 _ (ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK, \
35 "router solicitations from source not on link") \
36 _ (ROUTER_SOLICITATION_UNSUPPORTED_INTF, \
37 "neighbor discovery unsupported interface") \
38 _ (ROUTER_SOLICITATION_RADV_NOT_CONFIG, \
39 "neighbor discovery not configured") \
40 _ (ROUTER_SOLICITATION_DEST_UNKNOWN, \
41 "router solicitations for unknown destination") \
42 _ (ROUTER_SOLICITATION_SOURCE_UNKNOWN, \
43 "router solicitations for unknown source") \
44 _ (ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL, \
45 "router advertisement source not link local") \
46 _ (ROUTER_ADVERTISEMENTS_TX, "router advertisements sent") \
47 _ (ROUTER_ADVERTISEMENTS_RX, "router advertisements received") \
48 _ (DST_LOOKUP_MISS, "icmp6 dst address lookup misses") \
Ole Troancda94822016-01-07 14:37:25 +010049 _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
50 _ (PACKET_TOO_BIG_SENT, "packet too big response sent") \
51 _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
52 _ (PARAM_PROBLEM_SENT, "parameter Pproblem response sent") \
53 _ (DROP, "error message dropped")
Ed Warnickecb9cada2015-12-08 15:45:58 -070054
55
Dave Barachd7cb1b52016-12-09 09:52:16 -050056typedef enum
57{
Ed Warnickecb9cada2015-12-08 15:45:58 -070058#define _(f,s) ICMP6_ERROR_##f,
59 foreach_icmp6_error
60#undef _
61} icmp6_error_t;
62
Dave Barachd7cb1b52016-12-09 09:52:16 -050063typedef struct
64{
Ed Warnickecb9cada2015-12-08 15:45:58 -070065 u8 packet_data[64];
66} icmp6_input_trace_t;
67
68format_function_t format_icmp6_input_trace;
Dave Barachd7cb1b52016-12-09 09:52:16 -050069void icmp6_register_type (vlib_main_t * vm, icmp6_type_t type,
70 u32 node_index);
71void icmp6_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code,
72 u32 data);
Ed Warnickecb9cada2015-12-08 15:45:58 -070073
74extern vlib_node_registration_t ip6_icmp_input_node;
75
76#endif /* included_vnet_icmp6_h */
77
78
Dave Barachd7cb1b52016-12-09 09:52:16 -050079
80/*
81 * fd.io coding-style-patch-verification: ON
82 *
83 * Local Variables:
84 * eval: (c-set-style "gnu")
85 * End:
86 */