00001
00002
00006
00007
00008 #include "../../main/inplug.h"
00009 #include "../../main/packet.h"
00010 #include "../../main/memory.h"
00011
00012 #ifndef DEBUG_IPQ
00013 #ifdef DEBUG
00014 #define DEBUG_IPQ DEBUG
00015 #else
00016 #define DEBUG_IPQ 0
00017 #endif
00018 #endif
00019
00021 int (*Decode)(PACKET*, PROTO);
00022
00023 INPLUG *ip = (INPLUG*)0;
00024
00025
00038
00039 int pluginRegister(INPLUG **inp, ANPLUG **anp, PROTOPLUG **protop, OUTPLUG **outp,
00040 int(*DecodeCallback)(PACKET*,PROTO)){
00041 if(DEBUG_IPQ>=DEBUG_DO_ENTRY_ALL){
00042 printf("Enter pluginRegister(inp(%lx),anp(%lx),protop(%lx),outp(%lx),DecodeCallback(%lx))\n", inp, anp, protop, outp, DecodeCallback);
00043 }
00044
00045 Decode = DecodeCallback;
00046
00047 *anp = (ANPLUG*)0;
00048 *outp = (OUTPLUG*)0;
00049 *protop = (PROTOPLUG*)0;
00050
00051 if(!ip){
00052 ip = (INPLUG*)malloc(sizeof(INPLUG));
00053 if(!ip){
00054 printf("ERR: plugin register for OUTPLUG failed\n");
00055 ip = (INPLUG*)0;
00056 }
00057 else {
00058 ip->name = strdup_safe("IPQ");
00059 ip->version = 0x00010000;
00060 }
00061 }
00062 *inp = ip;
00063
00064 return 0;
00065 }
00066
00067
00072
00073 int pluginInit(int ct, char **inits){
00074 if(DEBUG_IPQ>=DEBUG_DO_ENTRY_ALL){
00075 printf("Enter pluginInit(int ct(%d),char**inits(%lx))\n", ct, inits);
00076 }
00077 return 0;
00078 }
00079
00080
00089
00090 int pluginCleanup(int reason){
00091 if(DEBUG_IPQ>=DEBUG_DO_ENTRY_ALL){
00092 printf("Enter pluginCleanup(int reason(%d))\n", reason);
00093 }
00094
00095 if(ip){
00096 free_safe(ip->name);
00097 free_safe(ip);
00098 }
00099 ip = (INPLUG*)0;
00100
00101 return 0;
00102 }
00103
00104
00115
00116 int pluginGetPacket(int iSrc, char *sSrc, PACKET **p){
00117 if(DEBUG_IPQ>=DEBUG_DO_ENTRY_ALL){
00118 printf("Enter pluginGetPacket(int iSrc(%d),char*sSrc(%s),PACKET**p(%lx))\n",iSrc, sSrc, p);
00119 }
00120 return 0;
00121 }