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

Packets.h

Go to the documentation of this file.
00001 /******************************************************************
00002         ANet_Daemon/Common/Memory.h
00003         Utility functions for AIPs and commands in the ANet deamon.
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_PACKETS
00011 #define ANET_PACKETS
00012 
00013 #include "ANetCommon.h"
00014 #include "Memory.h"
00015 
00016 /* AIPs:
00017 UInt32 totalSize;
00018 UInt8  headerSize;
00019 UInt8  type;
00020 UInt16 service;
00021 UInt32 originDest;
00022 
00023 Then, you have the rest of the header and packet data.
00024 Assumptions:
00025 12 <= totalSize
00026 12 <= headerSize <= totalSize
00027 
00028 originDest is either an origin or a destination, which is
00029 a cluster or connection ID, depending on the module.
00030 
00031 Remember: place a NULL value of 2 bytes at the beginning of the
00032 data to identify untransformed data.
00033 */
00034 
00035 typedef UInt16 FormatTag; // For data transformation modules
00036 
00037 UInt32 GetNthPacket(UInt8 *ptr, UInt32 n, ANetMemoryTag outBuffer);
00038 UInt32 GetPacketTotalSize(UInt8 *ptr);
00039 UInt8  GetPacketHeaderSize(UInt8 *ptr);
00040 UInt8  GetPacketType(UInt8 *ptr);
00041 UInt16 GetPacketService(UInt8 *ptr);
00042 UInt32 ValidatePacket(UInt8 *ptr);
00043 
00044 UInt32 AIPtoAEP(UInt8 *inPtr, ANetMemoryTag *out);
00045 UInt32 AEPtoAIP(UInt8 *inPtr, ANetMemoryTag *out);
00046 // out can be resized. If out is NULL, a new tag is generated.
00047 
00048 /* Commands:
00049 UInt32 totalCommandSize
00050 UInt16 command
00051 
00052 Then, the rest of the command data follows.
00053 Assumptions:
00054 6 <= totalCommandSize
00055 */
00056 enum {
00057   kRegisterServiceCommand = 1,
00058   kUnregisterServiceCommand,
00059   kSendPacketCommand,
00060   kGetStatus,
00061   kGetStatusStartPolling,
00062   kGetStatusStopPolling,
00063   kGetStaticData,
00064   kSetStaticData,
00065   kDeleteStaticData,
00066   kOpenTWDT,
00067   kReadTWDT,
00068   kWriteTWDT,
00069   kCloseTWDT,
00070   kGetConfig,
00071   kSetConfig
00072 };
00073   
00074 
00075 #endif

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