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

rubicon_tcp.c

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*****************************************************************************/
00006 /*****************************************************************************/
00007 
00008 #include "../../main/protoplug.h"
00009 #include "../../main/types.h"
00010 #include "../../main/policy.h"
00011 #include "../../main/memory.h"
00012 
00013 #ifndef DEBUG_TCP
00014 #ifdef DEBUG
00015 #define DEBUG_TCP DEBUG
00016 #else
00017 #define DEBUG_TCP 0
00018 #endif
00019 #endif
00020 
00022 int (*Decode)(PACKET*, PROTO);
00023 
00024 PROTOPLUG *pp = (PROTOPLUG*)0;
00025 
00026 /****************************************************************************/
00039 /****************************************************************************/
00040 int pluginRegister(INPLUG **inp, ANPLUG **anp, PROTOPLUG **protop, OUTPLUG **outp,
00041                    int(*DecodeCallback)(PACKET*,PROTO)){
00042   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00043     printf("Enter pluginRegister(inp(%lx),anp(%lx),protop(%lx),outp(%lx),DecodeCallback(%lx))\n", inp, anp, protop, outp, DecodeCallback);
00044   }
00045 
00046   Decode = DecodeCallback;
00047   *inp = (INPLUG*)0;
00048   *anp = (ANPLUG*)0;
00049   *outp = (OUTPLUG*)0;
00050 /*   *protop = &pp; */
00051 
00052   if(!pp){
00053     (*protop) = (PROTOPLUG*)malloc_safe(sizeof(PROTOPLUG));
00054     if(!(*protop)){
00055       printf("ERR: Malloc failed when registering ethernet plugin\n");
00056     }
00057     else {
00058       (*protop)->name = strdup(PROTO_ETH_NAME);
00059       (*protop)->nProto = 1;
00060       (*protop)->version = 0x00010000;
00061       (*protop)->pProto = (PROTO*)malloc_safe(sizeof(PROTO));
00062       (*protop)->sProto = (char**)malloc_safe(sizeof(char*));
00063       if(!((*protop)->name) || !((*protop)->pProto) || !((*protop)->sProto)){
00064         printf("ERR: Malloc failed when registering ethernet plugin\n");
00065         (*protop) = (PROTOPLUG*)0;
00066       }
00067       else {
00068         ((*protop)->pProto)[0] = PROTO_ETH_NUM;
00069         ((*protop)->sProto)[0] = strdup_safe(PROTO_ETH_NAME);
00070       }
00071     }
00072     pp = *protop;
00073   }
00074   else *protop = pp;
00075 
00076   return 0;
00077 }
00078 
00079 /****************************************************************************/
00084 /****************************************************************************/
00085 int pluginInit(int ct, char **inits){
00086   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00087     printf("Enter pluginInit(int ct(%d),char**inits(%lx))\n", ct, inits);
00088   }
00089   
00090   if(pp) free_safe(pp);
00091   pp = (PROTOPLUG*)0;
00092 
00093   return 0;
00094 }
00095 
00096 /****************************************************************************/
00105 /****************************************************************************/
00106 int pluginCleanup(int reason){
00107   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00108     printf("Enter pluginCleanup(int reason(%d))\n", reason);
00109   }
00110   return 0;
00111 }
00112 
00113 /****************************************************************************/
00125 /****************************************************************************/
00126 int pluginDecode(PACKET *p, PROTO protocol){
00127   if(DEBUG_TCP>=DEBUG_DO_ENTRY_SOME){
00128     printf("Enter pluginDecode(PACKET*p(%lx),PROTO protocol(%lx))\n", p, protocol);
00129   }
00130   return 0;
00131 }
00132 
00133 /****************************************************************************/
00144 /****************************************************************************/
00145 int pluginTest(PACKET *p, char *arg, char *val){
00146   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00147     printf("Enter pluginTest(PACKET*p(%lx),char*arg(%s), char*val(%s))\n", p, arg, val);
00148   }
00149   return 0;
00150 }
00151 
00152 /****************************************************************************/
00166 /****************************************************************************/
00167 int pluginPrint(PACKET *p, char *args,
00168                 int(*print)(char *fmt, ...)){
00169   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00170     printf("Enter pluginPrint(PACKET*p(%lx),char*args(%s),print(%lx))\n", p, args, print);
00171   }
00172   return 0;
00173 }
00174 
00175 /****************************************************************************/
00189 /****************************************************************************/
00190 int pluginMkTest(PROTO p, char *val, char *test, char *field, POLICY_TEST *pTest){
00191   if(DEBUG_TCP>=DEBUG_DO_ENTRY_ALL){
00192     printf("Enter pluginMkTest(PROTO p(%lx),char*val(%s),char*test(%s),char*field(%s),POLICY_TEST*pTest(%lx))\n", p, val, test, field, pTest);
00193   }
00194 
00195   return 0;
00196 }

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