update session finite state machine & add tcp init -> opening test case
This commit is contained in:
@@ -124,6 +124,11 @@ static inline const uint8_t *ipv4_hdr_get_opt_ptr(const struct ip *hdr)
|
||||
return (const uint8_t *)hdr + sizeof(struct ip);
|
||||
}
|
||||
|
||||
static inline void ipv4_hdr_set_ipid(struct ip *hdr, uint16_t ipid)
|
||||
{
|
||||
hdr->ip_id = htons(ipid);
|
||||
}
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,7 @@ extern "C"
|
||||
|
||||
struct metadata
|
||||
{
|
||||
char data[64];
|
||||
// TODO
|
||||
};
|
||||
|
||||
@@ -120,6 +121,7 @@ static inline struct packet *packet_dup(const struct packet *pkt)
|
||||
pkt_dup->layers[i].pld_ptr = pkt_dup->data_ptr + pkt->layers[i].hdr_offset + pkt->layers[i].hdr_len;
|
||||
}
|
||||
}
|
||||
packet_set0_metadata(pkt_dup, metadata_dup(packet_get0_metadata(pkt)));
|
||||
|
||||
return pkt_dup;
|
||||
}
|
||||
@@ -128,6 +130,9 @@ static inline void packet_free(struct packet *pkt)
|
||||
{
|
||||
if (pkt)
|
||||
{
|
||||
metadata_free((struct metadata *)packet_get0_metadata(pkt));
|
||||
packet_set0_metadata(pkt, NULL);
|
||||
|
||||
if (pkt->data_ptr)
|
||||
{
|
||||
free((char *)pkt->data_ptr);
|
||||
|
||||
Reference in New Issue
Block a user