Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 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_icmp6_h |
| 16 | #define included_vnet_icmp6_h |
| 17 | |
Neale Ranns | e403113 | 2020-10-26 13:00:06 +0000 | [diff] [blame^] | 18 | #include <vnet/ip/icmp46_packet.h> |
| 19 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 20 | #define foreach_icmp6_error \ |
| 21 | _ (NONE, "valid packets") \ |
| 22 | _ (UNKNOWN_TYPE, "unknown type") \ |
| 23 | _ (INVALID_CODE_FOR_TYPE, "invalid code for type") \ |
| 24 | _ (INVALID_HOP_LIMIT_FOR_TYPE, "hop_limit != 255") \ |
| 25 | _ (LENGTH_TOO_SMALL_FOR_TYPE, "payload length too small for type") \ |
| 26 | _ (OPTIONS_WITH_ODD_LENGTH, \ |
| 27 | "total option length not multiple of 8 bytes") \ |
| 28 | _ (OPTION_WITH_ZERO_LENGTH, "option has zero length") \ |
| 29 | _ (ECHO_REPLIES_SENT, "echo replies sent") \ |
| 30 | _ (NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK, \ |
| 31 | "neighbor solicitations from source not on link") \ |
| 32 | _ (NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN, \ |
| 33 | "neighbor solicitations for unknown targets") \ |
| 34 | _ (NEIGHBOR_ADVERTISEMENTS_TX, "neighbor advertisements sent") \ |
| 35 | _ (NEIGHBOR_ADVERTISEMENTS_RX, "neighbor advertisements received") \ |
| 36 | _ (ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK, \ |
| 37 | "router solicitations from source not on link") \ |
| 38 | _ (ROUTER_SOLICITATION_UNSUPPORTED_INTF, \ |
| 39 | "neighbor discovery unsupported interface") \ |
| 40 | _ (ROUTER_SOLICITATION_RADV_NOT_CONFIG, \ |
| 41 | "neighbor discovery not configured") \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 42 | _ (ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL, \ |
| 43 | "router advertisement source not link local") \ |
| 44 | _ (ROUTER_ADVERTISEMENTS_TX, "router advertisements sent") \ |
| 45 | _ (ROUTER_ADVERTISEMENTS_RX, "router advertisements received") \ |
| 46 | _ (DST_LOOKUP_MISS, "icmp6 dst address lookup misses") \ |
Ole Troan | cda9482 | 2016-01-07 14:37:25 +0100 | [diff] [blame] | 47 | _ (DEST_UNREACH_SENT, "destination unreachable response sent") \ |
| 48 | _ (PACKET_TOO_BIG_SENT, "packet too big response sent") \ |
| 49 | _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \ |
Klement Sekera | 75e7d13 | 2017-09-20 08:26:30 +0200 | [diff] [blame] | 50 | _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \ |
Dave Barach | 3a63fc5 | 2019-01-07 09:15:47 -0500 | [diff] [blame] | 51 | _ (DROP, "error message dropped") \ |
| 52 | _ (ALLOC_FAILURE, "buffer allocation failure") |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 53 | |
| 54 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 55 | typedef enum |
| 56 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 57 | #define _(f,s) ICMP6_ERROR_##f, |
| 58 | foreach_icmp6_error |
| 59 | #undef _ |
| 60 | } icmp6_error_t; |
| 61 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 62 | typedef struct |
| 63 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 64 | u8 packet_data[64]; |
| 65 | } icmp6_input_trace_t; |
| 66 | |
| 67 | format_function_t format_icmp6_input_trace; |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 68 | void icmp6_register_type (vlib_main_t * vm, icmp6_type_t type, |
| 69 | u32 node_index); |
| 70 | void icmp6_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code, |
| 71 | u32 data); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 72 | |
| 73 | extern vlib_node_registration_t ip6_icmp_input_node; |
| 74 | |
| 75 | #endif /* included_vnet_icmp6_h */ |
| 76 | |
| 77 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 78 | |
| 79 | /* |
| 80 | * fd.io coding-style-patch-verification: ON |
| 81 | * |
| 82 | * Local Variables: |
| 83 | * eval: (c-set-style "gnu") |
| 84 | * End: |
| 85 | */ |