Changeset 5a67294


Ignore:
Timestamp:
11/03/05 01:01:19 (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:
49ce177
Parents:
40dd3f8
Message:

Add typedef's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h

    r40dd3f8 r5a67294  
    7979       
    8080/** Opaque structure holding information about an output trace */
    81 struct libtrace_out_t;
     81typedef struct libtrace_out_t libtrace_out_t;
    8282       
    8383/** Opaque structure holding information about a trace */
    84 struct libtrace_t;
     84typedef struct libtrace_t libtrace_t;
    8585       
    8686/** Opaque structure holding information about a bpf filter */
    87 struct libtrace_filter_t;
     87typedef struct libtrace_filter_t libtrace_filter_t;
    8888
    8989/** Structure holding information about a packet */
    9090#define LIBTRACE_PACKET_BUFSIZE 65536
    91 struct libtrace_packet_t {
     91typedef struct libtrace_packet_t {
    9292        struct libtrace_t *trace;
    9393        //void *buffer;
     
    9999                uint16_t message;
    100100        } status;
    101 } __attribute__ ((packed));
     101} __attribute__ ((packed)) libtrace_packet_t;
    102102                     
    103103
     
    106106
    107107/** Structure for dealing with IP packets */
    108 struct libtrace_ip
     108typedef struct libtrace_ip
    109109{
    110110#if BYTE_ORDER == LITTLE_ENDIAN
     
    130130    struct in_addr ip_src;              /**< source address */
    131131    struct in_addr ip_dst;              /**< dest address */
    132 } __attribute__ ((packed));
     132} __attribute__ ((packed)) libtrace_ip_t
     133;
    133134
    134135/** Structure for dealing with TCP packets */
    135 struct libtrace_tcp
     136typedef struct libtrace_tcp
    136137  {
    137138    u_int16_t source;           /**< Source Port */
     
    165166    u_int16_t check;            /**< Checksum */
    166167    u_int16_t urg_ptr;          /**< Urgent Pointer */
    167 } __attribute__ ((packed));
     168} __attribute__ ((packed)) libtrace_tcp_t;
    168169
    169170/** UDP Header for dealing with UDP packets */
    170 struct libtrace_udp {
     171typedef struct libtrace_udp {
    171172  u_int16_t     source;         /**< Source port */
    172173  u_int16_t     dest;           /**< Destination port */
    173174  u_int16_t     len;            /**< Length */
    174175  u_int16_t     check;          /**< Checksum */
    175 } __attribute__ ((packed));
     176} __attribute__ ((packed)) libtrace_udp_t;
    176177
    177178/** ICMP Header for dealing with icmp packets */
    178 struct libtrace_icmp
     179typedef struct libtrace_icmp
    179180{
    180181  u_int8_t type;                /**< message type */
     
    195196    } frag;                     /**< path mtu discovery */
    196197  } un;                         /**< Union for payloads of various icmp codes */
    197 } __attribute__ ((packed));
     198} __attribute__ ((packed)) libtrace_icmp_t;
    198199
    199200/** 802.3 frame */
     
    203204  u_int8_t ether_shost[6];      /* source ether addr */
    204205  u_int16_t ether_type;         /* packet type ID field (next-header) */
    205 } __attribute__ ((packed));
     206} __attribute__ ((packed)) libtrace_ether_t;
    206207
    207208/** 802.1Q frame */
     
    215216  u_int16_t vlan_id:12;          /* vlan id */
    216217  u_int16_t vlan_ether_type;     /* vlan sub-packet type ID field (next-header)*/
    217 } __attribute__ ((packed));
     218} __attribute__ ((packed)) libtrace_8021q_t;
    218219
    219220/** ATM cell */
    220 struct libtrace_atm_cell
     221typedef struct libtrace_atm_cell
    221222{
    222223  u_int8_t gfc:4;
     
    227228  u_int8_t hec;
    228229  u_int16_t ether_type;
    229 };
     230} __attribute__ ((packed)) libtrace_atm_cell;
    230231
    231232/** POS header */
    232 struct libtrace_pos
     233typedef struct libtrace_pos
    233234{
    234235 u_int16_t header;
    235236 u_int16_t ether_type;
    236 };
     237} __attribute__ ((packed)) libtrace_pos;
    237238
    238239/** Prints help information for libtrace
Note: See TracChangeset for help on using the changeset viewer.