00001
00016 #ifndef _NET_PROHAN_H_
00017 #define _NET_PROHAN_H_
00018
00019
00020
00021
00022
00029 typedef struct proHan
00030 {
00032 int protocol;
00034 int * (*_Enqueue) (char*, int);
00036 void * (*_EntryPoint)(void*);
00037 };
00038
00042 typedef struct pronode_t
00043 {
00044 pronode_t *prev;
00045 char *payload;
00046 pronode_t *next;
00047 };
00048
00060 class protocolHandler
00061 {
00062 public:
00063 protocolHandler();
00064 virtual ~protocolHandler();
00065 int add(char *pkt);
00066 virtual void threadEntryPoint(void *arg);
00067 protected:
00068 bool hasNext(void);
00069 char *next(void);
00071 int myPro;
00072 private:
00074 pronode_t *top,
00076 *bottom;
00078 unsigned int packets;
00079 };
00080
00082 #define MKPROHANDLER(x,y,pro) proHan x; x.protocol = pro; x._Enqueue = y->add; \
00083 x._EntryPoint = y->threadEntrypPoint;
00084
00085
00086 #endif
00087
00088