nl_packets.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: nl_packets.h 923 2005-11-19 03:35:10Z aquamaniac $
00005     begin       : Sat Jan 24 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef GWEN_NL_PACKETS_H
00030 #define GWEN_NL_PACKETS_H
00031 
00032 #include <gwenhywfar/netlayer.h>
00033 
00034 #include <gwenhywfar/buffer.h>
00035 
00036 #define GWEN_NL_PACKETS_NAME "Packets"
00037 
00038 /*
00039  * This module sends and receives packets over any other NetLayer.
00040  */
00041 
00042 typedef enum {
00043   GWEN_NL_PacketStatus_New=0,
00044   GWEN_NL_PacketStatus_Enqueued,
00045   GWEN_NL_PacketStatus_StartReadMsg,
00046   GWEN_NL_PacketStatus_ReadMsg,
00047   GWEN_NL_PacketStatus_StartWriteMsg,
00048   GWEN_NL_PacketStatus_WriteMsg,
00049   GWEN_NL_PacketStatus_EndWriteMsg,
00050   GWEN_NL_PacketStatus_Finished,
00051   GWEN_NL_PacketStatus_Aborted
00052 } GWEN_NL_PACKET_STATUS;
00053 
00054 typedef struct GWEN_NL_PACKET GWEN_NL_PACKET;
00055 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_NL_PACKET, GWENHYWFAR_API)
00056 
00057 
00058 GWENHYWFAR_API
00059 GWEN_NL_PACKET *GWEN_NL_Packet_new();
00060 
00061 GWENHYWFAR_API
00062 void GWEN_NL_Packet_free(GWEN_NL_PACKET *pk);
00063 
00064 GWENHYWFAR_API
00065 void GWEN_NL_Packet_Attach(GWEN_NL_PACKET *pk);
00066 
00067 GWENHYWFAR_API
00068 GWEN_NL_PACKET_STATUS GWEN_NL_Packet_GetStatus(const GWEN_NL_PACKET *pk);
00069 
00070 GWENHYWFAR_API
00071 GWEN_BUFFER *GWEN_NL_Packet_GetBuffer(const GWEN_NL_PACKET *pk);
00072 
00073 GWENHYWFAR_API
00074 GWEN_BUFFER *GWEN_NL_Packet_TakeBuffer(GWEN_NL_PACKET *pk);
00075 
00076 GWENHYWFAR_API
00077 void GWEN_NL_Packet_SetBuffer(GWEN_NL_PACKET *pk, GWEN_BUFFER *buf);
00078 
00079 
00080 GWENHYWFAR_API
00081 GWEN_NETLAYER *GWEN_NetLayerPackets_new(GWEN_NETLAYER *baseLayer);
00082 
00083 GWENHYWFAR_API
00084 int GWEN_NetLayerPackets_SendPacket(GWEN_NETLAYER *nl,
00085                                     GWEN_NL_PACKET *packet);
00086 
00087 GWENHYWFAR_API
00088 int GWEN_NetLayerPackets_Flush(GWEN_NETLAYER *nl, int timeout);
00089 
00090 GWENHYWFAR_API
00091 int GWEN_NetLayerPackets_HasNextPacket(const GWEN_NETLAYER *nl);
00092 
00093 GWENHYWFAR_API
00094 GWEN_NL_PACKET *GWEN_NetLayerPackets_GetNextPacket(GWEN_NETLAYER *nl);
00095 
00096 GWENHYWFAR_API
00097 GWEN_NL_PACKET *GWEN_NetLayerPackets_GetNextPacket_Wait(GWEN_NETLAYER *nl,
00098                                                         int timeout);
00099 
00100 #endif /* GWEN_NL_PACKETS_P_H */
00101 
00102 

Generated on Thu Nov 9 22:06:49 2006 for gwenhywfar by  doxygen 1.5.1