aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/icmp4.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-10-09 18:35:16 +0200
committerDamjan Marion <dmarion@me.com>2019-10-14 22:44:35 +0000
commit26c7a4b0b6488423688f4a7f3c8aacf0d1b9c742 (patch)
treed6a38e691f0952717a034c101339a25ee660e2e7 /src/vnet/ip/icmp4.h
parentddc9eb48e6ef5b60c261d857fb3f574c3fa38f4e (diff)
ping: Move to plugin
Type: refactor Change-Id: I51d5bf54dfd408aa0c406cbdf0f4be10ef19d10d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/ip/icmp4.h')
-rw-r--r--src/vnet/ip/icmp4.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vnet/ip/icmp4.h b/src/vnet/ip/icmp4.h
index ae805148c89..73bd1f40efd 100644
--- a/src/vnet/ip/icmp4.h
+++ b/src/vnet/ip/icmp4.h
@@ -26,9 +26,9 @@
_ (OPTION_WITH_ZERO_LENGTH, "option has zero length") \
_ (ECHO_REPLIES_SENT, "echo replies sent") \
_ (DST_LOOKUP_MISS, "icmp6 dst address lookup misses") \
- _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
- _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
- _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \
+ _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
+ _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
+ _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \
_ (DROP, "error message dropped")
typedef enum
@@ -46,8 +46,14 @@ typedef struct
format_function_t format_icmp4_input_trace;
void ip4_icmp_register_type (vlib_main_t * vm, icmp4_type_t type,
u32 node_index);
-void icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code,
- u32 data);
+
+static_always_inline void
+icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code, u32 data)
+{
+ vnet_buffer (b)->ip.icmp.type = type;
+ vnet_buffer (b)->ip.icmp.code = code;
+ vnet_buffer (b)->ip.icmp.data = data;
+}
#endif /* included_vnet_icmp4_h */