17 lines
328 B
C++
17 lines
328 B
C++
#include "packet_priv.h"
|
|
#include "packet_utils.h"
|
|
|
|
int packet_get_layer_by_idx(const struct packet *pkt, int idx, struct layer *out)
|
|
{
|
|
const struct raw_layer *raw = packet_get_raw_layer(pkt, idx);
|
|
if (raw == NULL)
|
|
{
|
|
return -1;
|
|
}
|
|
else
|
|
{
|
|
layer_convert(raw, out);
|
|
return 0;
|
|
}
|
|
}
|