Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

net/prohandler.h

Go to the documentation of this file.
00001 
00016 #ifndef _NET_PROHAN_H_
00017 #define _NET_PROHAN_H_
00018 
00019 //Each handler has a protocol number,
00020 // an enqueue function, and a thread
00021 // function that will process that handlers'
00022 // packets
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 

Generated at Thu May 30 15:12:33 2002 for Freeagent by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001