routes/route_simple_bridge.c

Go to the documentation of this file.
00001 #include "route_simple_bridge.h"
00002 #include <string.h>
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include "../packets/packet.h"
00006 #include "../engine/num_list.h"
00007 
00008 int                     EthernetDecoderID;
00009 
00010 //#define DEBUG
00011 
00012 extern GlobalVars       Globals;
00013 
00014 /*********************************
00015 * Send it out the other interface
00016 **********************************/
00017 int RouteSBridge(int PacketSlot){
00018         PacketRec*      p;
00019 #ifdef DEBUGPATH
00020         printf("In RouteSBridge\n");
00021 #endif
00022 
00023         p=&Globals.Packets[PacketSlot];
00024 
00025         p->TargetInterface=!p->InterfaceNum;
00026         return ROUTE_RESULT_CONTINUE;
00027 }
00028 
00029 /*********************************
00030 * Specify the interfaces to bridge
00031 * TODO: make this actually work
00032 **********************************/
00033 int RouteSBridgeAddNode(int RouteID, char* Args){
00034 #ifdef DEBUGPATH
00035         printf("In RouteSBridgeAddNode\n");
00036 #endif
00037 
00038         return TRUE;
00039 }
00040 
00041 /*********************************
00042 * Set up everything to do simple bridging
00043 **********************************/
00044 int InitSBridge(){
00045         int RouteID;
00046 #ifdef DEBUGPATH
00047         printf("In InitSBridge\n");
00048 #endif  
00049         
00050         if ( (RouteID=CreateRoute("SBridge"))==ROUTE_NONE){
00051                 printf("Couldn't create route SBridge\n");
00052                 return FALSE;
00053         }
00054         
00055         Globals.Routes[RouteID].RouteFunc=RouteSBridge;
00056         Globals.Routes[RouteID].AddNode=RouteSBridgeAddNode;
00057         
00058         return TRUE;
00059 }
00060 

Generated on Sat Jul 7 23:33:10 2007 for HLBR by  doxygen 1.5.2