Add test case for tunnel
This commit is contained in:
@@ -149,8 +149,8 @@ static inline const char *layer_proto_to_str(enum layer_proto proto)
|
||||
return "ICMP6";
|
||||
case LAYER_PROTO_VXLAN:
|
||||
return "VXLAN";
|
||||
case LAYER_PROTO_GTPV1_U:
|
||||
return "GTPV1";
|
||||
case LAYER_PROTO_GTP:
|
||||
return "GTP";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
@@ -1041,7 +1041,7 @@ static inline const char *parse_gtpv1_u(struct packet *pkt, const char *data, ui
|
||||
uint16_t hdr_len = get_gtp_hdr_len(data, len);
|
||||
if (unlikely(hdr_len == 0 || hdr_len > len))
|
||||
{
|
||||
PACKET_LOG_DATA_INSUFFICIENCY(pkt, LAYER_PROTO_GTPV1_U);
|
||||
PACKET_LOG_DATA_INSUFFICIENCY(pkt, LAYER_PROTO_GTP);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1051,7 +1051,7 @@ static inline const char *parse_gtpv1_u(struct packet *pkt, const char *data, ui
|
||||
return data;
|
||||
}
|
||||
uint8_t next_proto = (((const uint8_t *)(data + hdr_len))[0]) >> 4;
|
||||
SET_LAYER(pkt, layer, LAYER_PROTO_GTPV1_U, hdr_len, data, len, 0);
|
||||
SET_LAYER(pkt, layer, LAYER_PROTO_GTP, hdr_len, data, len, 0);
|
||||
|
||||
switch (next_proto)
|
||||
{
|
||||
@@ -1060,7 +1060,7 @@ static inline const char *parse_gtpv1_u(struct packet *pkt, const char *data, ui
|
||||
case 6:
|
||||
return parse_ipv6(pkt, layer->pld_ptr, layer->pld_len);
|
||||
default:
|
||||
PACKET_LOG_UNSUPPORT_PROTO(pkt, LAYER_PROTO_GTPV1_U, next_proto);
|
||||
PACKET_LOG_UNSUPPORT_PROTO(pkt, LAYER_PROTO_GTP, next_proto);
|
||||
return layer->pld_ptr;
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ const char *packet_parse(struct packet *pkt, const char *data, uint16_t len)
|
||||
return parse_ether(pkt, data, len);
|
||||
}
|
||||
|
||||
void packet_print_str(const struct packet *pkt)
|
||||
void packet_print(const struct packet *pkt)
|
||||
{
|
||||
if (pkt == NULL)
|
||||
{
|
||||
@@ -1197,7 +1197,7 @@ void packet_print_str(const struct packet *pkt)
|
||||
case LAYER_PROTO_VXLAN:
|
||||
used = vxlan_hdr_to_str((const struct vxlan_hdr *)layer->hdr_ptr, buffer, sizeof(buffer));
|
||||
break;
|
||||
case LAYER_PROTO_GTPV1_U:
|
||||
case LAYER_PROTO_GTP:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user