Main Page Modules Alphabetical List Data Structures File List Data Fields Globals # IxOsBuffMgt.h Go to the documentation of this file.
    00001
    00055 #ifndef IxOsBuffMgt_inc
    00056 #define IxOsBuffMgt_inc
    00057
    00058 #ifdef __vxworks
    00059
    00060 #include <vxWorks.h>
    00061 #include <net/mbuf.h>
    00062 #include <netBufLib.h>
    00063
    00064 #define m_net_pool m_pkthdr.rcvif
    00065
    00066 #define IX_MBUF M_BLK
    00067
    00068 #else
    00069
    00070 #include <linux/skbuff.h>
    00071
    00072 typedef struct __IX_MBUF
    00073 {
    00074   struct __IX_MBUF   *ix_next __attribute__ ((aligned(32)));  /* NPE offset 0  */
    00075   struct __IX_MBUF   *ix_nextPacket;
    00076   char             *ix_data;        /* NPE offset 8  */
    00077   int               ix_len;         /* NPE offset 12 */
    00078   unsigned char     ix_type;
    00079   unsigned char     ix_flags;       /* NPE offset 17 */
    00080   unsigned short    ix_reserved;
    00081
    00082   struct
    00083   {
    00084      unsigned int      ix_pool;
    00085      unsigned int      len;   /* NPE offset 24 */
    00086   } ix_pktHeader;
    00087
    00088   void              *priv;     /* make a 32 bytes structure */
    00089 } IX_MBUF;
    00090
    00091 #define m_next     ix_next
    00092 #define m_len      ix_len
    00093 #define m_data     ix_data
    00094 #define m_type     ix_type
    00095 #define m_flags    ix_flags
    00096 #define m_nextpkt  ix_nextPacket
    00097 #define m_act      ix_nextPacket
    00098 #define m_pkthdr   ix_pktHeader
    00099 #define m_net_pool ix_pktHeader.ix_pool
    00100
    00101 #define SIZEOF_IP_HEADER sizeof(struct iphdr)
    00102
    00103 /* This function sets the skb field in mbuf with the given skb pointer.
    00104  * If not NULL, mbuf data and length fields are set from the skb values.
    00105  * This function returns the previous value of mbuf->skb.
    00106  */
    00107 static inline struct sk_buff *mbuf_swap_skb(IX_MBUF *mbuf, struct sk_buff *skb)
    00108 {
    00109     struct sk_buff *res = mbuf->priv;
    00110     mbuf->priv = skb;
    00111
    00112     if (!skb)
    00113     return res;
    00114
    00115     mbuf->m_data = skb->data;
    00116     mbuf->ix_pktHeader.len = mbuf->m_len = skb->len;
    00117
    00118     return res;
    00119 }
    00120
    00121 #endif /* __vxworks */
    00122
    00123 /* common definitions */
    00124
    00130 #define IX_MBUF_MDATA(m_blk_ptr)           (m_blk_ptr)->m_data
    00131
    00137 #define IX_MBUF_MLEN(m_blk_ptr)            (m_blk_ptr)->m_len
    00138
    00144 #define IX_MBUF_TYPE(m_blk_ptr)            (m_blk_ptr)->m_type
    00145
    00151 #define IX_MBUF_NEXT_BUFFER_IN_PKT_PTR(m_blk_ptr)  (m_blk_ptr)->m_next
    00152
    00158 #define IX_MBUF_NEXT_PKT_IN_CHAIN_PTR(m_blk_ptr)   (m_blk_ptr)->m_nextpkt
    00159
    00165 #define IX_MBUF_ALLOCATED_BUFF_LEN(m_blk_ptr)      (m_blk_ptr)->m_len
    00166
    00172 #define IX_MBUF_PKT_LEN(m_blk_ptr)         (m_blk_ptr)->m_pkthdr.len
    00173
    00179 #define IX_MBUF_FLAGS(m_blk_ptr)           (m_blk_ptr)->m_flags
    00180
    00186 #if defined __vxworks
    00187 #define IX_MBUF_NET_POOL(m_blk_ptr)        (m_blk_ptr)->pClBlk->pNetPool
    00188 #elif defined __linux
    00189 #define IX_MBUF_NET_POOL(m_blk_ptr)        (m_blk_ptr)->m_net_pool
    00190 #endif
    00191
    00192 #endif /* ndef IxOsBuffMgt_inc */
Automatically generated from sources. © Intel Corp. 2003