From f40eabb01163f383e2471942da45f32361031e39 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 14 May 2012 13:14:14 +0200 Subject: add pkt_buff and protocol helper functions Signed-off-by: Pablo Neira Ayuso --- src/internal.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/internal.h') diff --git a/src/internal.h b/src/internal.h index 3a88d1a..477dc70 100644 --- a/src/internal.h +++ b/src/internal.h @@ -9,4 +9,24 @@ # define EXPORT_SYMBOL #endif +struct iphdr; +struct ip6_hdr; + +uint16_t checksum(uint32_t sum, uint16_t *buf, int size); +uint16_t checksum_tcpudp_ipv4(struct iphdr *iph); +uint16_t checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr); + +struct pkt_buff { + uint8_t *mac_header; + uint8_t *network_header; + uint8_t *transport_header; + + uint8_t *head; + uint8_t *data; + uint8_t *tail; + + uint32_t len; + uint32_t data_len; +}; + #endif -- cgit v1.2.3