decoders/decode_interface.c

Go to the documentation of this file.
00001 #include "decode_interface.h"
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 
00005 //#define DEBUG
00006 
00007 extern GlobalVars       Globals;
00008 
00009 /***************************************
00010 * Apply the interface decoding (none)
00011 ****************************************/
00012 void* DecodeInterface(int PacketSlot){
00013         InterfaceData*  data;
00014         PacketRec*              p;
00015         
00016         DEBUGPATH;
00017 
00018         p=&Globals.Packets[PacketSlot];
00019 
00020         /*do the decoding*/
00021 
00022         data=(InterfaceData*)malloc(sizeof(InterfaceData));
00023         data->r=&Globals.Interfaces[p->InterfaceNum];
00024 
00025         return data;
00026 }
00027 
00028 /*************************************
00029 * Set up the decoder
00030 *************************************/
00031 int InitDecoderInterface(){
00032         int DecoderID;
00033 
00034         DEBUGPATH;
00035         
00036         if ((DecoderID=CreateDecoder("Interface"))==DECODER_NONE){
00037 #ifdef DEBUG
00038                 printf("Couldn't Allocate Decoder Interface\n");
00039 #endif  
00040                 return FALSE;
00041         }
00042         
00043         Globals.Decoders[DecoderID].DecodeFunc=DecodeInterface;
00044 
00045         return TRUE;
00046 }

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