diff options
author | Nicolas Thill <nico@openwrt.org> | 2006-01-09 15:46:03 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2006-01-09 15:46:03 +0000 |
commit | db7d9885a7ce804bd6d03e8ee6694bcb733656c2 (patch) | |
tree | 9b330c512b2283192477662011b1eb4b7dc9e812 /package/pipacs/src/parser.h | |
parent | d841620e1a935dabeb92889392e6c0ecba8f93c0 (diff) | |
download | master-187ad058-db7d9885a7ce804bd6d03e8ee6694bcb733656c2.tar.gz master-187ad058-db7d9885a7ce804bd6d03e8ee6694bcb733656c2.tar.bz2 master-187ad058-db7d9885a7ce804bd6d03e8ee6694bcb733656c2.zip |
add pipacs package (thanks to Janos)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@2865 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/pipacs/src/parser.h')
-rw-r--r-- | package/pipacs/src/parser.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/package/pipacs/src/parser.h b/package/pipacs/src/parser.h new file mode 100644 index 0000000000..aac609acb9 --- /dev/null +++ b/package/pipacs/src/parser.h @@ -0,0 +1,60 @@ +#define LINUX 1
+#ifdef LINUX
+#include <ctype.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#define BYTE unsigned char
+#define DWORD unsigned long
+#define BOOL char
+#define TRUE 1
+#define FALSE 0
+#define WSADATA int
+#define SOCKET int
+#define SOCKADDR struct sockaddr
+#define SOCKADDR_IN struct sockaddr_in
+typedef struct _WSABUF {
+ unsigned long len;
+ unsigned char *buf;
+} WSABUF;
+#define SIO_RCVALL 0
+#define SIO_RCVALL_IGMPMCAST 0
+#define SIO_RCVALL_MCAST 0
+#define ETH_P_ALL 0x0003
+#else // WINDOWS
+
+#include <winsock2.h>
+#include <windows.h>
+
+#endif
+
+#ifndef _RCVALL_H_
+#define _RCVALL_H_
+
+
+#define MAX_IP_SIZE 65535
+#define MIN_IP_HDR_SIZE 20
+
+#define HI_WORD(byte) (((byte) >> 4) & 0x0F)
+#define LO_WORD(byte) ((byte) & 0x0F)
+
+extern char *szProto[];
+
+
+
+void PrintRawBytes (BYTE *ptr, DWORD len);
+int DecodeIGMPHeader(WSABUF *wsabuf, DWORD iphdrlen);
+int DecodeUDPHeader (WSABUF *wsabuf, DWORD iphdrlen);
+int DecodeTCPHeader (WSABUF *wsabuf, DWORD iphdrlenz);
+int DecodeIPHeader (WSABUF *wasbuf, unsigned int srcaddr, unsigned short srcport, unsigned long srcnet,
+ unsigned int destaddr, unsigned short destport, unsigned long destnet, DWORD bytesret,
+ unsigned short xport, unsigned int xip, unsigned long xnet);
+
+#endif
|