rename struct layer_private to struct layer_internal
This commit is contained in:
@@ -141,14 +141,14 @@ static void calculate_length_and_checksum(const struct packet *origin_pkt, int l
|
||||
struct gtp2_hdr *gtp2 = NULL;
|
||||
struct gre0_hdr *gre0 = NULL;
|
||||
struct gre1_hdr *gre1 = NULL;
|
||||
struct layer_private *curr_layer = NULL;
|
||||
struct layer_private *last_layer = NULL;
|
||||
struct layer_internal *curr_layer = NULL;
|
||||
struct layer_internal *last_layer = NULL;
|
||||
struct fingerprint finger = {};
|
||||
calc_packet_fingerprint(&finger);
|
||||
for (int i = layer_count - 1; i >= 0; i--)
|
||||
{
|
||||
curr_layer = (struct layer_private *)packet_get_layer(origin_pkt, i);
|
||||
last_layer = (struct layer_private *)packet_get_layer(origin_pkt, i + 1);
|
||||
curr_layer = (struct layer_internal *)packet_get_layer(origin_pkt, i);
|
||||
last_layer = (struct layer_internal *)packet_get_layer(origin_pkt, i + 1);
|
||||
curr_hdr_ptr = new_pkt_data + curr_layer->hdr_offset;
|
||||
last_hdr_ptr = last_layer ? new_pkt_data + last_layer->hdr_offset : NULL;
|
||||
switch (curr_layer->proto)
|
||||
@@ -261,7 +261,7 @@ struct packet *packet_build_tcp(const struct packet *origin_pkt, uint32_t tcp_se
|
||||
|
||||
// check the innermost layer of the original packet
|
||||
int layer_count = packet_get_layer_count(origin_pkt);
|
||||
const struct layer_private *tcp_layer = packet_get_layer(origin_pkt, layer_count - 1);
|
||||
const struct layer_internal *tcp_layer = packet_get_layer(origin_pkt, layer_count - 1);
|
||||
if (tcp_layer == NULL || tcp_layer->proto != LAYER_PROTO_TCP)
|
||||
{
|
||||
PACKET_BUILD_LOG_ERROR("build TCP packet failed, the innermost layer of the original packet is not TCP");
|
||||
@@ -320,7 +320,7 @@ struct packet *packet_build_udp(const struct packet *origin_pkt, const char *udp
|
||||
|
||||
// check the innermost layer of the original packet
|
||||
int layer_count = packet_get_layer_count(origin_pkt);
|
||||
const struct layer_private *udp_layer = packet_get_layer(origin_pkt, layer_count - 1);
|
||||
const struct layer_internal *udp_layer = packet_get_layer(origin_pkt, layer_count - 1);
|
||||
if (udp_layer == NULL || udp_layer->proto != LAYER_PROTO_UDP)
|
||||
{
|
||||
PACKET_BUILD_LOG_ERROR("build UDP packet failed, the innermost layer of the original packet is not UDP");
|
||||
@@ -369,7 +369,7 @@ struct packet *packet_build_l3(const struct packet *origin_pkt, uint8_t ip_proto
|
||||
|
||||
int i = 0;
|
||||
int layers = packet_get_layer_count(origin_pkt);
|
||||
const struct layer_private *l3_layer = NULL;
|
||||
const struct layer_internal *l3_layer = NULL;
|
||||
for (i = layers - 1; i >= 0; i--)
|
||||
{
|
||||
l3_layer = packet_get_layer(origin_pkt, i);
|
||||
|
||||
Reference in New Issue
Block a user