summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-06-14 10:48:11 +0800
committerluwenpeng <[email protected]>2024-06-14 10:58:40 +0800
commit1f78881cbb42f35e2be64b89dc7847e247af38b3 (patch)
treef6278020df859f4b5498654cc3fb9ed63ee07974 /include
parent020c8303c6e21a8960f4f0678dce8cb132c07075 (diff)
rename struct packet_layer to struct raw_layer
Diffstat (limited to 'include')
-rw-r--r--include/stellar/packet.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/stellar/packet.h b/include/stellar/packet.h
index 87d9ad6..09d0726 100644
--- a/include/stellar/packet.h
+++ b/include/stellar/packet.h
@@ -48,7 +48,7 @@ enum layer_proto
LAYER_PROTO_GTPV1_U = 62,
};
-struct packet_layer
+struct raw_layer
{
enum layer_proto type;
const char *hdr_ptr; // header pointer
@@ -81,8 +81,8 @@ enum packet_direction packet_get_direction(const struct packet *pkt);
uint64_t packet_get_session_id(const struct packet *pkt);
void packet_prepend_sid_list(struct packet *pkt, const struct sid_list *list);
-int8_t packet_get_layer_count(const struct packet *pkt);
-const struct packet_layer *packet_get_layer(const struct packet *pkt, int8_t idx);
+int packet_get_layer_count(const struct packet *pkt);
+const struct raw_layer *packet_get_raw_layer(const struct packet *pkt, int idx);
const char *packet_get_data(const struct packet *pkt);
uint16_t packet_get_len(const struct packet *pkt);
@@ -107,11 +107,11 @@ static inline int packet_get_addr(const struct packet *pkt, struct address *src_
{
const struct ip *ip4_hdr = NULL;
const struct ip6_hdr *ip6_hdr = NULL;
- const struct packet_layer *layer = NULL;
- int8_t num = packet_get_layer_count(pkt);
- for (int8_t i = num - 1; i >= 0; i--)
+ const struct raw_layer *layer = NULL;
+ int num = packet_get_layer_count(pkt);
+ for (int i = num - 1; i >= 0; i--)
{
- layer = packet_get_layer(pkt, i);
+ layer = packet_get_raw_layer(pkt, i);
if (layer->type == LAYER_PROTO_IPV4)
{
ip4_hdr = (const struct ip *)layer->hdr_ptr;
@@ -151,11 +151,11 @@ static inline int packet_get_port(const struct packet *pkt, uint16_t *src_port,
{
const struct tcphdr *tcp_hdr = NULL;
const struct udphdr *udp_hdr = NULL;
- const struct packet_layer *layer = NULL;
- int8_t num = packet_get_layer_count(pkt);
- for (int8_t i = num - 1; i >= 0; i--)
+ const struct raw_layer *layer = NULL;
+ int num = packet_get_layer_count(pkt);
+ for (int i = num - 1; i >= 0; i--)
{
- layer = packet_get_layer(pkt, i);
+ layer = packet_get_raw_layer(pkt, i);
if (layer->type == LAYER_PROTO_TCP)
{
tcp_hdr = (const struct tcphdr *)layer->hdr_ptr;