Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Modules.h

Go to the documentation of this file.
00001 /******************************************************************
00002         ANet_Daemon/Common/Modules.h
00003         Declarations necessary to allow module linking.
00004         
00005         Part of the run-time wrapper of the ANet project.
00006         
00007         Distributed under GPL: http://www.gnu.org/copyleft/gpl.html
00008 ******************************************************************/
00009 
00010 #ifndef ANET_MODULES
00011 #define ANET_MODULES
00012 
00024 #include "ANetCommon.h"
00025 #include "Memory.h"
00026 #include "Packets.h"
00027 #include "XMLCommon.h"
00028 #include "LinkedLists.h"
00029 
00030 typedef struct ANetFunctionMap {
00031   char *name; 
00032   UInt32 ID;  
00033   void *funcPtr; 
00034 } ANetFunctionMap;
00035 
00037 enum {
00038   kUndefined = 0, 
00039   
00040   kModuleCreateInstance = 1, 
00041   kModuleDestroyInstance = 2, 
00042   
00043   kClientConnectionMain = 3, 
00044   
00045   kDataTransMain = 4, 
00046   kDataTransGetSupportedTags = 12, 
00047   
00048   kClusterGroupMain = 5, 
00049   
00050   kClusterFilterMain = 6, 
00051   kClusterFilterForced = 13, 
00052   
00053   kHansdhakingProtocolMain = 7, 
00054   
00055   kPacketProtocolMain = 8, 
00056   kPacketProtocolStatus = 14, 
00057   
00058   kConnectionProtocolMain = 9, 
00059   kConnectionProtocolStatus = 15, 
00060   
00061   kBandwidthManagerMain = 10, 
00062   
00063   kCoreModuleMain = 11, 
00064 
00065   kStubMain = 50, 
00066   kStubFunc1 = 51, 
00067   kStubFunc2 = 52 
00068 };
00069 
00070 typedef struct {
00071   UInt32 nbrNames;
00072   char **names;
00073   UInt32 nbrFunctions;
00074   ANetFunctionMap *functionMaps;
00075 } ANetModuleInfo;
00076 
00077 typedef UInt32(*ANetModuleLoadFuncPtr)(ANetModuleInfo *modInfo);
00078 
00079 // Those are helper functions to help changing the ANetModuleInfo struct
00080 UInt32 ANetAddModuleName(ANetModuleInfo *modInfo, char *moduleName);
00081 UInt32 ANetAddFunctionMap(ANetModuleInfo *modInfo, ANetFunctionMap *funcMap);
00082 
00083 typedef UInt32(*ANetModuleCreateInstanceFuncPtr)(ANetTagID tag, ANetMemoryTag *g);
00084 typedef UInt32(*ANetModuleDestroyInstanceFuncPtr)(ANetMemoryTag g);
00085 
00086 typedef UInt32(*ANetClientConnectionMainFuncPtr)(ANetMemoryTag commands, UInt32 nbrPackets,
00087                UInt8 *packets, UInt8 **packetIndex);
00088 
00089 typedef UInt32(*ANetDataTransMainFuncPtr)(UInt8 dir, UInt32 nbrPackets,
00090                UInt8 *packets, UInt8 **packetIndex);
00091 typedef UInt32(*ANetDataTransGetSupportedTagsFuncPtr)(ANetMemoryTag *tagList,
00092                ANetMemoryTag *humanReadableList);
00093 
00094 typedef UInt32(*ANetClusterGroupMainFuncPtr)(char *name, UInt32 nbrPackets,
00095                UInt8 *packets, ANetMemoryTag clusterBuffers);
00096 /* clusterBuffers is an array of
00097    {UInt32 nbrPackets;
00098    UInt32 clusterID;
00099    ANetMemoryTag buffer}, where buffer is an array of AIPs */
00100 
00101 typedef UInt32(*ANetClusterFilterMainFuncPtr)(UInt32 nbrPackets, UInt8 *packets,
00102                ANetMemoryTag packetsToDelete, ANetMemoryTag connectionsToDelete);
00103 typedef UInt32(*ANetClusterFilterForcedFuncPtr)(UInt32 nbrPackets, UInt8 *packets,
00104                UInt32 maxBytes, ANetMemoryTag packetsToDelete,
00105                ANetMemoryTag connectionsToDelete);
00106 
00107 typedef UInt32(*ANetHandshakingProtocolMainFuncPtr)(UInt32 nbrConnections,
00108                UInt32 *connectionIDs, ANetMemoryTag *inBuffers,
00109                ANetMemoryTag *outBuffers);
00110 
00111 typedef UInt32(*ANetPacketProtocolMainFuncPtr)(UInt8 *inAEPs, ANetMemoryTag outAEPs);
00112 typedef UInt32(*ANetPacketProtocolStatusFuncPtr)(UInt32 *status);
00113 // Return the connection status. Used when trying to destroy the connection.
00114 
00115 typedef UInt32(*ANetConnectionProtocolMainFuncPtr)();
00116 // Input and output buffers are in the parsed XML
00117 // No other modules should use those attributes
00118 
00119 typedef UInt32(*ANetConnectionProtocolStatusFuncPtr)(UInt32 *status);
00120 
00121 typedef UInt32(*ANetBandwidthManagerMainFuncPtr)(ANetMemoryTag in, ANetMemoryTag out);
00122 
00123 typedef UInt32(*ANetCoreModuleMainFuncPtr)(UInt32 nbrPackets, UInt8 *packets,
00124                ANetMemoryTag commands);
00125 // Output buffers are in the parsed XML.
00126 
00127 typedef UInt32(*ANetStubMainFuncPtr)(UInt32 val);
00128 typedef UInt32(*ANetStubFunc1Ptr)(UInt32 val);
00129 typedef UInt32(*ANetStubFunc2Ptr)(UInt32 val);
00130 
00131 ANetMemoryTag ANetGetGlobals();
00132 // This is to get the "g" value of set up at instantiation
00133 
00134 #endif
00135 

Generated on Sun Dec 23 15:20:37 2001 for ANet by doxygen 1.2.12 written by Dimitri van Heesch, © 1997-2001

SourceForge
Logo