aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/ip/face_ip_node.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/faces/ip/face_ip_node.c')
-rw-r--r--hicn-plugin/src/faces/ip/face_ip_node.c56
1 files changed, 44 insertions, 12 deletions
diff --git a/hicn-plugin/src/faces/ip/face_ip_node.c b/hicn-plugin/src/faces/ip/face_ip_node.c
index b3577f65f..f0408860e 100644
--- a/hicn-plugin/src/faces/ip/face_ip_node.c
+++ b/hicn-plugin/src/faces/ip/face_ip_node.c
@@ -56,7 +56,9 @@ typedef struct
u32 next_index;
u32 sw_if_index;
u8 pkt_type;
-} hicn_face_ip4_input_trace_t;
+ u8 packet_data[128 - 1 * sizeof (u32)];
+}
+hicn_face_ip4_input_trace_t;
typedef enum
{
@@ -72,7 +74,9 @@ typedef struct
u32 next_index;
u32 sw_if_index;
u8 pkt_type;
-} hicn_face_ip6_input_trace_t;
+ u8 packet_data[128 - 1 * sizeof (u32)];
+}
+hicn_face_ip6_input_trace_t;
typedef enum
{
@@ -157,6 +161,9 @@ typedef enum
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
t->next_index = next0; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b0), \
+ sizeof (t->packet_data)); \
} \
\
\
@@ -245,6 +252,9 @@ typedef enum
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
t->next_index = next0; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b0), \
+ sizeof (t->packet_data)); \
} \
\
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && \
@@ -255,6 +265,9 @@ typedef enum
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b1)->sw_if_index[VLIB_RX]; \
t->next_index = next1; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b1), \
+ sizeof (t->packet_data)); \
} \
\
\
@@ -310,8 +323,9 @@ hicn_face_ip4_input_format_trace (u8 * s, va_list * args)
hicn_face_ip4_input_trace_t *t =
va_arg (*args, hicn_face_ip4_input_trace_t *);
- s = format (s, "FACE_IP4_INPUT: pkt: %d, sw_if_index %d, next index %d",
- (int) t->pkt_type, t->sw_if_index, t->next_index);
+ s = format (s, "FACE_IP4_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U",
+ (int) t->pkt_type, t->sw_if_index, t->next_index,
+ format_ip4_header, t->packet_data, sizeof (t->packet_data));
return (s);
}
@@ -389,8 +403,9 @@ hicn_face_ip6_input_format_trace (u8 * s, va_list * args)
hicn_face_ip6_input_trace_t *t =
va_arg (*args, hicn_face_ip6_input_trace_t *);
- s = format (s, "FACE_IP6_INPUT: pkt: %d, sw_if_index %d, next index %d",
- (int) t->pkt_type, t->sw_if_index, t->next_index);
+ s = format (s, "FACE_IP6_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U",
+ (int) t->pkt_type, t->sw_if_index, t->next_index,
+ format_ip6_header, t->packet_data, sizeof (t->packet_data));
return (s);
}
@@ -468,7 +483,9 @@ typedef struct
u32 next_index;
u32 sw_if_index;
u8 pkt_type;
-} hicn_face_ip4_output_trace_t;
+ u8 packet_data[128 - 1 * sizeof (u32)];
+}
+hicn_face_ip4_output_trace_t;
/* Trace context struct */
typedef struct
@@ -476,7 +493,9 @@ typedef struct
u32 next_index;
u32 sw_if_index;
u8 pkt_type;
-} hicn_face_ip6_output_trace_t;
+ u8 packet_data[128 - 1 * sizeof (u32)];
+}
+hicn_face_ip6_output_trace_t;
#define TRACE_OUTPUT_PKT_IP4 hicn_face_ip4_output_trace_t
#define TRACE_OUTPUT_PKT_IP6 hicn_face_ip6_output_trace_t
@@ -524,6 +543,9 @@ typedef struct
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
t->next_index = next0; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b0), \
+ sizeof (t->packet_data)); \
} \
\
\
@@ -591,6 +613,9 @@ typedef struct
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
t->next_index = next0; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b0), \
+ sizeof (t->packet_data)); \
} \
\
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && \
@@ -601,6 +626,9 @@ typedef struct
t->pkt_type = HICN_PKT_TYPE_INTEREST; \
t->sw_if_index = vnet_buffer (b1)->sw_if_index[VLIB_RX]; \
t->next_index = next1; \
+ clib_memcpy_fast (t->packet_data, \
+ vlib_buffer_get_current (b1), \
+ sizeof (t->packet_data)); \
} \
\
\
@@ -657,8 +685,10 @@ hicn_face_ip4_output_format_trace (u8 * s, va_list * args)
hicn_face_ip4_output_trace_t *t =
va_arg (*args, hicn_face_ip4_output_trace_t *);
- s = format (s, "FACE_IP4_OUTPUT: pkt: %d, sw_if_index %d, next index %d",
- (int) t->pkt_type, t->sw_if_index, t->next_index);
+ s =
+ format (s, "FACE_IP4_OUTPUT: pkt: %d, sw_if_index %d, next index %d\n%U",
+ (int) t->pkt_type, t->sw_if_index, t->next_index,
+ format_ip4_header, t->packet_data, sizeof (t->packet_data));
return (s);
}
@@ -728,8 +758,10 @@ hicn_face_ip6_output_format_trace (u8 * s, va_list * args)
hicn_face_ip6_output_trace_t *t =
va_arg (*args, hicn_face_ip6_output_trace_t *);
- s = format (s, "FACE_IP6_OUTPUT: pkt: %d, sw_if_index %d, next index %d",
- (int) t->pkt_type, t->sw_if_index, t->next_index);
+ s =
+ format (s, "FACE_IP6_OUTPUT: pkt: %d, sw_if_index %d, next index %d\n%U",
+ (int) t->pkt_type, t->sw_if_index, t->next_index,
+ format_ip6_header, t->packet_data, sizeof (t->packet_data));
return (s);
}