blob: 6f161422ce09de44b2845a428032c14ceb8d9acf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <netinet/ip.h>
#include <netinet/udp.h>
#include "proto.h"
static int l4_udp_pkt_size(const uint8_t *pkt, uint32_t dataoff)
{
return sizeof(struct udphdr);
}
static int l4_udp_pkt_no_data(const uint8_t *pkt)
{
/* UDP has no control packets. */
return 1;
}
static struct proto_l4_helper udp = {
.l4protonum = IPPROTO_UDP,
.l4pkt_size = l4_udp_pkt_size,
.l4pkt_no_data = l4_udp_pkt_no_data,
};
void l4_udp_init(void)
{
proto_l4_helper_register(&udp);
}
|