packetbuf.h

来自「ipsec PNE 3.3 source code, running at mo」· C头文件 代码 · 共 167 行

H
167
字号
/* packetBuf.h - WindNet IPsec and IKE resizeable packet routines *//*  * Copyright (c) 2000-2005 Wind River Systems, Inc.  *  * The right to copy, distribute, modify or otherwise make use  * of this software may be licensed only pursuant to the terms  * of an applicable Wind River license agreement.  *//* Copyright 2005 Wind River Systems, Inc. *//*modification history--------------------14nov05,rlm  Creation (adapted from RWOS packet routines) */#ifndef __PACKETBUF_H#define __PACKETBUF_H#if defined(__cplusplus) || defined(c_plusplus)extern "C" {#endif/*DESCRIPTIONINCLUDE FILES:*//* includes */#ifdef VIRTUAL_STACK  #include <netinet/vsData.h>  #include <netinet/vsNetCore.h>  /* for _pNetDpool */#else  #include <net/mbuf.h>  /* for _pNetDpool */#endif/* defines *//* typedefs */typedef struct _packetBuf{  BOOL (*fpPacketBufDestroy) (struct _packetBuf * pPacket);    unsigned char   * pBuffer;  unsigned int      bufSize;  unsigned int      reservedHdrSize;  unsigned int      dataLength;  BOOL              isFromMBuf;  struct mbuf     * pMBuf;} PACKETBUF;/* public functions */PACKETBUF *packetBufCreate    (    UINT bufSize,    UINT reservedHdrSize     );BOOL packetBufDestroy    (    PACKETBUF * pPacketBuf    );PACKETBUF * packetBufClone    (    PACKETBUF * pOrigPacketBuf    );unsigned char * packetBufWritableHeaderGet    (    PACKETBUF * pPacketBuf,    UINT        requestedSize    );unsigned char * packetBufWritableTrailerGet    (    PACKETBUF * pPacketBuf,    UINT        requestedSize    );BOOL packetBufExtendFront    (    PACKETBUF * pPacketBuf,    UINT        amount    );BOOL packetBufReduceFront    (    PACKETBUF * pPacketBuf,    UINT        amount    );BOOL packetBufExtendBack    (    PACKETBUF * pPacketBuf,    UINT        amount    );BOOL packetBufReduceBack    (    PACKETBUF * pPacketBuf,    UINT        amount    );unsigned char * packetBufDataGet    (    PACKETBUF * pPacketBuf    );UINT packetBufDataSizeGet    (    PACKETBUF * pPacketBuf    );UINT packetBufBufferSizeGet    (    PACKETBUF * pPacketBuf    );UINT packetBufMaxWritableHeaderSizeGet    (    PACKETBUF * pPacketBuf    );BOOL packetBufIsBuiltFromMBuf    (    PACKETBUF * pPacketBuf    );void packetMBufDestruct    (    PACKETBUF ** ppMBufPacket    );PACKETBUF * packetBufCreateFromMBuf    (    struct mbuf * pMBuf    );struct mbuf * packetMBufExtract    (    PACKETBUF * pMBufPacket    );struct mbuf* packetMBufCreate    (    struct mbuf *pSourcePacket    );UINT packetBufReservedHeaderSizeGet(void);#if defined(__cplusplus) || defined(c_plusplus)}#endif /* __cplusplus */#endif /* __PACKETBUF_H *//* EOF */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?