rename struct layer_private to struct layer_internal
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
* Static API
|
||||
******************************************************************************/
|
||||
|
||||
static inline struct layer_private *get_free_layer(struct packet *pkt);
|
||||
static inline struct layer_internal *get_free_layer(struct packet *pkt);
|
||||
|
||||
// 数据链路层
|
||||
static inline const char *parse_ether(struct packet *pkt, const char *data, uint16_t len);
|
||||
@@ -78,7 +78,7 @@ static inline const char *parse_l4(struct packet *pkt, uint8_t next_proto, const
|
||||
* Private API -- Utils
|
||||
******************************************************************************/
|
||||
|
||||
static inline struct layer_private *get_free_layer(struct packet *pkt)
|
||||
static inline struct layer_internal *get_free_layer(struct packet *pkt)
|
||||
{
|
||||
if (pkt->layers_used >= pkt->layers_size)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ static inline const char *parse_ether(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -143,7 +143,7 @@ static inline const char *parse_pweth(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -214,7 +214,7 @@ static inline const char *parse_ppp(struct packet *pkt, const char *data, uint16
|
||||
|
||||
uint16_t hdr_len = 0;
|
||||
uint16_t next_proto = 0;
|
||||
struct layer_private *layer = NULL;
|
||||
struct layer_internal *layer = NULL;
|
||||
|
||||
// ppp header 1 byte
|
||||
next_proto = *((uint8_t *)data);
|
||||
@@ -264,7 +264,7 @@ static inline const char *parse_l2tpv2_over_udp(struct packet *pkt, const char *
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -292,7 +292,7 @@ static inline const char *parse_l2tpv3_over_udp(struct packet *pkt, const char *
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -321,7 +321,7 @@ static inline const char *parse_l2tpv3_over_ip(struct packet *pkt, const char *d
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -349,7 +349,7 @@ static inline const char *parse_vlan(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -368,7 +368,7 @@ static inline const char *parse_pppoe_ses(struct packet *pkt, const char *data,
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -386,7 +386,7 @@ static inline const char *parse_mpls(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -435,7 +435,7 @@ static inline const char *parse_ipv4(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -509,7 +509,7 @@ static inline const char *parse_ipv6(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -621,7 +621,7 @@ static inline const char *parse_auth(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -640,7 +640,7 @@ static inline const char *parse_gre(struct packet *pkt, const char *data, uint16
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -659,7 +659,7 @@ static inline const char *parse_udp(struct packet *pkt, const char *data, uint16
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -733,7 +733,7 @@ static inline const char *parse_tcp(struct packet *pkt, const char *data, uint16
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -757,7 +757,7 @@ static inline const char *parse_icmp(struct packet *pkt, const char *data, uint1
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -775,7 +775,7 @@ static inline const char *parse_icmp6(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -793,7 +793,7 @@ static inline const char *parse_vxlan(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -822,7 +822,7 @@ static inline const char *parse_gtp_u(struct packet *pkt, const char *data, uint
|
||||
if (hdr_len == len)
|
||||
{
|
||||
// only GTP-U header, no payload
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -839,7 +839,7 @@ static inline const char *parse_gtp_u(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
@@ -869,7 +869,7 @@ static inline const char *parse_gtp_c(struct packet *pkt, const char *data, uint
|
||||
return data;
|
||||
}
|
||||
|
||||
struct layer_private *layer = get_free_layer(pkt);
|
||||
struct layer_internal *layer = get_free_layer(pkt);
|
||||
if (unlikely(layer == NULL))
|
||||
{
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user