Ole Troan | 92eade1 | 2016-01-13 20:17:08 +0100 | [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_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") \ |
Chris Luke | 816f3e1 | 2016-06-14 16:24:47 -0400 | [diff] [blame] | 31 | _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \ |
Ole Troan | 92eade1 | 2016-01-13 20:17:08 +0100 | [diff] [blame] | 32 | _ (DROP, "error message dropped") |
| 33 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 34 | typedef enum |
| 35 | { |
Ole Troan | 92eade1 | 2016-01-13 20:17:08 +0100 | [diff] [blame] | 36 | #define _(f,s) ICMP4_ERROR_##f, |
| 37 | foreach_icmp4_error |
| 38 | #undef _ |
| 39 | } icmp4_error_t; |
| 40 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 41 | typedef struct |
| 42 | { |
Ole Troan | 92eade1 | 2016-01-13 20:17:08 +0100 | [diff] [blame] | 43 | u8 packet_data[64]; |
| 44 | } icmp_input_trace_t; |
| 45 | |
| 46 | format_function_t format_icmp4_input_trace; |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 47 | void ip4_icmp_register_type (vlib_main_t * vm, icmp4_type_t type, |
| 48 | u32 node_index); |
| 49 | void icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code, |
| 50 | u32 data); |
Ole Troan | 92eade1 | 2016-01-13 20:17:08 +0100 | [diff] [blame] | 51 | |
| 52 | #endif /* included_vnet_icmp4_h */ |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 53 | |
| 54 | /* |
| 55 | * fd.io coding-style-patch-verification: ON |
| 56 | * |
| 57 | * Local Variables: |
| 58 | * eval: (c-set-style "gnu") |
| 59 | * End: |
| 60 | */ |