hlswmaster/netpkt.h

29 lines
852 B
C
Raw Normal View History

2006-02-02 16:24:06 +01:00
#ifndef _NETPKT_H
#define _NETPKT_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
2006-11-24 21:53:25 +01:00
#include "list.h"
2006-02-02 16:24:06 +01:00
struct net_pkt {
2006-11-24 21:53:25 +01:00
struct list_head list;
2006-02-02 16:24:06 +01:00
struct sockaddr_in addr;
unsigned int size;
unsigned char buf[0];
};
2006-11-24 21:53:25 +01:00
int pkt_memcmp(struct net_pkt *pkt, unsigned int offset, char *search, unsigned int size);
int pkt_memmem(struct net_pkt *pkt, unsigned int offset, char *search, unsigned int size);
struct net_pkt * pkt_merge(struct net_pkt *pkt1, struct net_pkt *pkt2);
char * pkt_ntoa(struct net_pkt *pkt);
unsigned short pkt_getport(struct net_pkt *pkt);
int pkt_sameaddr(struct net_pkt *pkt1, struct net_pkt *pkt2);
int pkt_parse_int(struct net_pkt *pkt, unsigned int offset, int *val);
int pkt_parse_ip(struct net_pkt *pkt, int offset, struct in_addr *ip);
char * pkt_print(struct net_pkt *pkt);
#endif /* _NETPKT_H */