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

rubicon_net.c

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*****************************************************************************/
00006 /*****************************************************************************/
00007 
00008 #include "../../main/outplug.h"
00009 #include "../../main/packet.h"
00010 #include "../../main/memory.h"
00011 
00012 #ifndef DEBUG_NET
00013 #ifdef DEBUG
00014 #define DEBUG_NET DEBUG
00015 #else
00016 #define DEBUG_NET 0
00017 #endif
00018 #endif
00019 
00021 int (*Decode)(PACKET*, PROTO);
00022 
00023 OUTPLUG *op = (OUTPLUG*)0;
00024 
00025 /****************************************************************************/
00038 /****************************************************************************/
00039 int pluginRegister(INPLUG **inp, ANPLUG **anp, PROTOPLUG **protop, OUTPLUG **outp,
00040                    int(*DecodeCallback)(PACKET*,PROTO)){
00041   if(DEBUG_NET>=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   *inp = (INPLUG*)0;
00047   *anp = (ANPLUG*)0;
00048 /*   *outp = &op; */
00049   *protop = (PROTOPLUG*)0;
00050 
00051   if(!op){
00052     op = (OUTPLUG*)malloc(sizeof(OUTPLUG));
00053     if(!op){
00054       printf("ERR: plugin register for OUTPLUG failed\n");
00055       op = (OUTPLUG*)0;
00056     }
00057     else {
00058       op->name = strdup_safe("NET");
00059       op->version = 0x00010000;
00060     }
00061   }
00062   *outp = op;
00063 
00064   return 0;
00065 }
00066 
00067 /****************************************************************************/
00072 /****************************************************************************/
00073 int pluginInit(int ct, char **inits){
00074   if(DEBUG_NET>=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_NET>=DEBUG_DO_ENTRY_ALL){
00092     printf("Enter pluginCleanup(int reason(%d))\n", reason);
00093   }
00094 
00095   if(op){
00096     free_safe(op->name);
00097     free_safe(op);
00098   }
00099   op = (OUTPLUG*)0;
00100 
00101   return 0;
00102 }
00103 
00104 /****************************************************************************/
00111 /****************************************************************************/
00112 int pluginOutput(PACKET *p, char *args){
00113   if(DEBUG_NET>=DEBUG_DO_ENTRY_ALL){
00114     printf("Enter pluginOutput(PACKET*p(%lx),char*args(%s))\n",p,args);
00115   }
00116   return 0;
00117 }

Generated at Mon Jul 8 15:16:50 2002 for RUBICON by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000