Changeset 7fc01569


Ignore:
Timestamp:
04/25/06 20:19:56 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
b874684
Parents:
bf66333
Message:

Undo more iso cificationisms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h

    rbf66333 r7fc01569  
    210210{
    211211#if BYTE_ORDER == LITTLE_ENDIAN
    212     unsigned int ip_hl:4;               /**< header length */
    213     unsigned int ip_v:4;                /**< version */
     212    uint8_t ip_hl:4;            /**< header length */
     213    uint8_t ip_v:4;             /**< version */
    214214#elif BYTE_ORDER == BIG_ENDIAN
    215     unsigned int ip_v:4;                /**< version */
    216     unsigned int ip_hl:4;               /**< header length */
     215    uint8_t ip_v:4;             /**< version */
     216    uint8_t ip_hl:4;            /**< header length */
    217217#else
    218218#   error "Adjust your <bits/endian.h> defines"
     
    222222    int16_t  ip_id;                     /**< identification */
    223223#if BYTE_ORDER == LITTLE_ENDIAN
    224     unsigned int ip_off:12;             /**< fragment offset */
    225     unsigned int ip_mf:1;               /**< more fragments flag */
    226     unsigned int ip_df:1;               /**< dont fragment flag */
    227     unsigned int ip_rf:1;               /**< reserved fragment flag */
     224    uint16_t ip_off:12;         /**< fragment offset */
     225    uint16_t ip_mf:1;           /**< more fragments flag */
     226    uint16_t ip_df:1;           /**< dont fragment flag */
     227    uint16_t ip_rf:1;           /**< reserved fragment flag */
    228228#elif BYTE_ORDER == BIG_ENDIAN
    229     unsigned int ip_rf:1;
    230     unsigned int ip_df:1;
    231     unsigned int ip_mf:1;
    232     unsigned int ip_off:12;
     229    uint16_t ip_rf:1;
     230    uint16_t ip_df:1;
     231    uint16_t ip_mf:1;
     232    uint16_t ip_off:12;
    233233#else
    234234#   error "Adjust your <bits/endian.h> defines"
     
    266266    uint32_t ack_seq;           /**< Acknowledgement Number */
    267267#  if BYTE_ORDER == LITTLE_ENDIAN
    268     unsigned int res1:4;        /**< Reserved bits */
    269     unsigned int doff:4;        /**< data offset */     
    270     unsigned int fin:1;         /**< FIN */
    271     unsigned int syn:1;         /**< SYN flag */
    272     unsigned int rst:1;         /**< RST flag */
    273     unsigned int psh:1;         /**< PuSH flag */
    274     unsigned int ack:1;         /**< ACK flag */
    275     unsigned int urg:1;         /**< URG flag */
    276     unsigned int res2:2;        /**< Reserved */
     268    uint8_t res1:4;     /**< Reserved bits */
     269    uint8_t doff:4;     /**< data offset */     
     270    uint8_t fin:1;              /**< FIN */
     271    uint8_t syn:1;              /**< SYN flag */
     272    uint8_t rst:1;              /**< RST flag */
     273    uint8_t psh:1;              /**< PuSH flag */
     274    uint8_t ack:1;              /**< ACK flag */
     275    uint8_t urg:1;              /**< URG flag */
     276    uint8_t res2:2;     /**< Reserved */
    277277#  elif BYTE_ORDER == BIG_ENDIAN
    278     unsigned int doff:4;        /**< Data offset */
    279     unsigned int res1:4;        /**< Reserved bits */
    280     unsigned int res2:2;        /**< Reserved */
    281     unsigned int urg:1;         /**< URG flag */
    282     unsigned int ack:1;         /**< ACK flag */
    283     unsigned int psh:1;         /**< PuSH flag */
    284     unsigned int rst:1;         /**< RST flag */
    285     unsigned int syn:1;         /**< SYN flag */
    286     unsigned int fin:1;         /**< FIN flag */
     278    uint8_t doff:4;     /**< Data offset */
     279    uint8_t res1:4;     /**< Reserved bits */
     280    uint8_t res2:2;     /**< Reserved */
     281    uint8_t urg:1;              /**< URG flag */
     282    uint8_t ack:1;              /**< ACK flag */
     283    uint8_t psh:1;              /**< PuSH flag */
     284    uint8_t rst:1;              /**< RST flag */
     285    uint8_t syn:1;              /**< SYN flag */
     286    uint8_t fin:1;              /**< FIN flag */
    287287#  else
    288288#   error "Adjust your <bits/endian.h> defines"
     
    346346typedef struct libtrace_8021q
    347347{
    348   unsigned int vlan_pri:3;       /**< vlan user priority */
    349   unsigned int vlan_cfi:1;       /**< vlan format indicator,
     348  uint16_t vlan_pri:3;   /**< vlan user priority */
     349  uint16_t vlan_cfi:1;   /**< vlan format indicator,
    350350                                   * 0 for ethernet, 1 for token ring */
    351   unsigned int vlan_id:12;       /**< vlan id */
     351  uint16_t vlan_id:12;   /**< vlan id */
    352352  uint16_t vlan_ether_type;      /**< vlan sub-packet type ID field
    353353                                   * (next-header)*/
     
    357357typedef struct libtrace_atm_cell
    358358{
    359   unsigned int gfc:4;           /**< Generic Flow Control */
    360   uint8_t vpi;                  /**< Virtual Path Identifier */
    361   uint16_t vci;                 /**< Virtual Channel Identifier */
    362   unsigned int pt:3;            /**< Payload Type */
    363   unsigned int clp:1;           /**< Cell Loss Priority */
    364   uint8_t hec;                  /**< Header Error Control */
     359  uint32_t gfc:4;               /**< Generic Flow Control */
     360  uint32_t vpi:8;               /**< Virtual Path Identifier */
     361  uint32_t vci:8;               /**< Virtual Channel Identifier */
     362  uint32_t pt:3;                /**< Payload Type */
     363  uint32_t clp:1;               /**< Cell Loss Priority */
     364  uint32_t hec:8;               /**< Header Error Control */
    365365} PACKED libtrace_atm_cell_t;
    366366
     
    374374/** 802.11 header */
    375375typedef struct libtrace_80211_t {
    376         unsigned int      protocol:2;
    377         unsigned int      type:2;
    378         unsigned int      subtype:4;
    379         unsigned int      to_ds:1;              /**< Packet to Distribution Service */
    380         unsigned int      from_ds:1;            /**< Packet from Distribution Service */
    381         unsigned int      more_frag:1;          /**< Packet has more fragments */
    382         unsigned int      retry:1;              /**< Packet is a retry */
    383         unsigned int      power:1;
    384         unsigned int      more_data:1;
    385         unsigned int      wep:1;
    386         unsigned int      order:1;
    387         unsigned int     duration;
     376        uint16_t      protocol:2;
     377        uint16_t      type:2;
     378        uint16_t      subtype:4;
     379        uint16_t      to_ds:1;          /**< Packet to Distribution Service */
     380        uint16_t      from_ds:1;        /**< Packet from Distribution Service */
     381        uint16_t      more_frag:1;      /**< Packet has more fragments */
     382        uint16_t      retry:1;          /**< Packet is a retry */
     383        uint16_t      power:1;
     384        uint16_t      more_data:1;
     385        uint16_t      wep:1;
     386        uint16_t      order:1;
     387        uint16_t     duration;
    388388        uint8_t      mac1[6];
    389389        uint8_t      mac2[6];
Note: See TracChangeset for help on using the changeset viewer.