00001
00022 #ifndef _NET_IDS_H_
00023 #define _NET_IDS_H_
00024
00025
00026 #ifdef __cplusplus
00027 #undef __cplusplus //pcap.h mangles linkage if we leave this alone, so undef it for now
00028 #include <pcap.h>
00029 #define __cplusplus
00030 #else
00031 #include <pcap.h>
00032 #endif //__cplusplus
00033
00034 #define IFACE "eth0"
00035 #define SNAPLEN 1600
00036
00037 #define PROMISC 0
00038 #define TIMEOUT 1000
00039 #define COUNT 50
00040
00041 #include "prohandler.h"
00042
00053 class netIDS
00054 {
00055 public:
00056 netIDS();
00057 ~netIDS();
00058 int startSniffer(void *device);
00059
00060 int stopSniffer();
00061 int loadProtocolHandler(proHan *pro_handler);
00062 int unloadProtocolHandler(int pro);
00063 private:
00064 pcap_t *open(char *pcap_device);
00066 unsigned int protocols_loaded;
00068 pcap_t *pcap_structure;
00070 char pcap_error[10000];
00072 void *protocol[];
00073
00074 };
00075
00076
00077
00078
00079 #endif