routes/route_interface.c

Go to the documentation of this file.
00001 #include "route_interface.h"
00002 #include <string.h>
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 
00006 //#define DEBUG
00007 
00008 extern GlobalVars       Globals;
00009 
00010 /*********************************
00011 * Route based on interface IDs
00012 **********************************/
00013 int RouteInterface(int PacketSlot){
00014         PacketRec*      p;
00015         
00016 #ifdef DEBUGPATH
00017         printf("In RouteInterface\n");
00018 #endif
00019 
00020         p=&Globals.Packets[PacketSlot];
00021         
00022         /*testing*/
00023         if (p->InterfaceNum==2) p->TargetInterface=0;
00024         /*end testing*/
00025 
00026         return ROUTE_RESULT_CONTINUE;
00027 }
00028 
00029 /*********************************
00030 * Turn on Interface Routing
00031 **********************************/
00032 int RouteInterfaceAddNode(int RouteID, char* Args){
00033 #ifdef DEBUGPATH
00034         printf("In RouteInterfaceAddNode\n");
00035 #endif
00036 
00037         return TRUE;
00038 }
00039 
00040 /*********************************
00041 * Set up interface routing
00042 **********************************/
00043 int InitRouteInterface(){
00044         int RouteID;
00045 #ifdef DEBUGPATH
00046         printf("In InitRouteInterface\n");
00047 #endif  
00048         
00049         if ( (RouteID=CreateRoute("Interface"))==ROUTE_NONE){
00050                 printf("Couldn't create route Interface\n");
00051                 return FALSE;
00052         }
00053         
00054         Globals.Routes[RouteID].RouteFunc=RouteInterface;
00055         Globals.Routes[RouteID].AddNode=RouteInterfaceAddNode;
00056         
00057         return TRUE;
00058 }
00059 

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