optimizate: clean up unused code && code formatting
This commit is contained in:
@@ -106,7 +106,6 @@ enum packet_action packet_get_action(const struct packet *pkt)
|
||||
return pkt->meta.action;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* tuple uitls
|
||||
******************************************************************************/
|
||||
@@ -462,7 +461,7 @@ const char *packet_get_payload(const struct packet *pkt)
|
||||
|
||||
uint16_t packet_get_payload_len(const struct packet *pkt)
|
||||
{
|
||||
if (pkt==NULL || pkt->layers_used == 0)
|
||||
if (pkt == NULL || pkt->layers_used == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -471,7 +470,7 @@ uint16_t packet_get_payload_len(const struct packet *pkt)
|
||||
|
||||
struct packet *packet_new(uint16_t pkt_len)
|
||||
{
|
||||
struct packet *pkt = (struct packet *)malloc( sizeof(struct packet) + pkt_len);
|
||||
struct packet *pkt = (struct packet *)calloc(1, sizeof(struct packet) + pkt_len);
|
||||
if (pkt == NULL)
|
||||
{
|
||||
return NULL;
|
||||
@@ -549,7 +548,7 @@ void layer_convert(const struct raw_layer *in, struct layer *out)
|
||||
|
||||
void packet_set_user_data(struct packet *pkt, void *data)
|
||||
{
|
||||
pkt->user_data=data;
|
||||
pkt->user_data = data;
|
||||
}
|
||||
|
||||
void *packet_get_user_data(struct packet *pkt)
|
||||
|
||||
Reference in New Issue
Block a user