Changeset ce0d2cc


Ignore:
Timestamp:
04/08/06 16:47:55 (16 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:
e7bc155
Parents:
689c220
Message:

More windows fixes merged

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_helper.c

    r23971d0 rce0d2cc  
    3939#include <string.h>
    4040#include <errno.h>
    41 #include  "format_helper.h"
    42 
    43 #include <sys/ioctl.h>
     41#include "format_helper.h"
     42
    4443#include <assert.h>
    4544#include <stdarg.h>
  • lib/libtrace.h

    r23971d0 rce0d2cc  
    5858#include <sys/types.h>
    5959#include <netinet/in.h>
    60 #include <stdbool.h>
     60#ifdef _MSC_VER
     61    /* define the following from MSVC's internal types */
     62    typedef             __int8  int8_t;
     63    typedef             __int16 int16_t;
     64    typedef             __int32 int32_t;
     65    typedef             __int64 int64_t;
     66    typedef unsigned    __int8  uint8_t;
     67    typedef unsigned    __int16 uint16_t;
     68    typedef unsigned    __int32 uint32_t;
     69    typedef unsigned    __int64 uint64_t;
     70#endif
     71
     72#ifdef WIN32
     73#   include <winsock2.h>
     74#   include <ws2tcpip.h>
     75    typedef short sa_family_t;
     76    /* Make up for a lack of stdbool.h */
     77#    define bool signed char
     78#    define false 0
     79#    define true 1
     80#else
     81#    include <netinet/in.h>
     82#    include <stdbool.h>
     83#endif
     84
    6185/** API version as 2 byte hex digits, eg 0xXXYYZZ */
    6286#define LIBTRACE_API_VERSION 0x030000  /* 3.0.00 */
     
    146170 */
    147171
     172#ifdef WIN32
     173#pragma pack(push)
     174#pragma pack(1)
     175#endif
     176
    148177/** Structure for dealing with IP packets */
    149 typedef PACKED struct libtrace_ip
     178typedef struct libtrace_ip
    150179{
    151180#if BYTE_ORDER == LITTLE_ENDIAN
     
    158187#   error "Adjust your <bits/endian.h> defines"
    159188#endif
    160     u_int8_t ip_tos;                    /**< type of service */
    161     u_short ip_len;                     /**< total length */
    162     u_short ip_id;                      /**< identification */
     189    uint8_t ip_tos;                    /**< type of service */
     190    uint16_t ip_len;                    /**< total length */
     191    int16_t ip_id;                     /**< identification */
    163192#if BYTE_ORDER == LITTLE_ENDIAN
    164193    unsigned int ip_off:12;             /**< fragment offset */
     
    174203#   error "Adjust your <bits/endian.h> defines"
    175204#endif
    176     u_int8_t ip_ttl;                    /**< time to live */
    177     u_int8_t ip_p;                      /**< protocol */
    178     u_short ip_sum;                     /**< checksum */
     205    uint8_t ip_ttl;                    /**< time to live */
     206    uint8_t ip_p;                      /**< protocol */
     207    uint16_t ip_sum;                    /**< checksum */
    179208    struct in_addr ip_src;              /**< source address */
    180209    struct in_addr ip_dst;              /**< dest address */
    181 } libtrace_ip_t;
    182 
    183 typedef PACKED struct libtrace_ip6_ext
     210} PACKED libtrace_ip_t;
     211
     212typedef struct libtrace_ip6_ext
    184213{
    185214        uint8_t nxt;
    186215        uint8_t len;
    187 } libtrace_ip6_ext_t;
     216} PACKED libtrace_ip6_ext_t;
    188217
    189218/** IPv6 header structure */
Note: See TracChangeset for help on using the changeset viewer.