• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

libtrace.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of libtrace
00003  *
00004  * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton, 
00005  * New Zealand.
00006  *
00007  * Authors: Daniel Lawson 
00008  *          Perry Lorier
00009  *          Shane Alcock 
00010  *          
00011  * All rights reserved.
00012  *
00013  * This code has been developed by the University of Waikato WAND 
00014  * research group. For further information please see http://www.wand.net.nz/
00015  *
00016  * libtrace is free software; you can redistribute it and/or modify
00017  * it under the terms of the GNU General Public License as published by
00018  * the Free Software Foundation; either version 2 of the License, or
00019  * (at your option) any later version.
00020  *
00021  * libtrace is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024  * GNU General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU General Public License
00027  * along with libtrace; if not, write to the Free Software
00028  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029  *
00030  * $Id: libtrace.h.in 1752 2012-03-05 21:18:59Z salcock $
00031  *
00032  */
00033 
00034 #ifndef LIBTRACE_H
00035 #define LIBTRACE_H
00036 
00064 #include <sys/types.h>
00065 #ifndef WIN32
00066 #include <sys/time.h>
00067 #endif
00068 
00069 #ifdef _MSC_VER
00070     /* define the following from MSVC's internal types */
00071     typedef             __int8  int8_t;
00072     typedef             __int16 int16_t;
00073     typedef             __int32 int32_t;
00074     typedef             __int64 int64_t;
00075     typedef unsigned    __int8  uint8_t;
00076     typedef unsigned    __int16 uint16_t;
00077     typedef unsigned    __int32 uint32_t;
00078     typedef unsigned    __int64 uint64_t;
00079     #ifdef LT_BUILDING_DLL
00080         #define DLLEXPORT __declspec(dllexport)
00081     #else
00082         #define DLLEXPORT __declspec(dllimport)
00083     #endif
00084     #define DLLLOCAL
00085     /* Windows pads bitfields out to to the size of their parent type
00086      * however gcc warns that this doesn't meet with the iso C specification
00087      * so produces warnings for this behaviour.  sigh.
00088      */
00089     #define LT_BITFIELD8        uint8_t
00090     #define LT_BITFIELD16       uint16_t
00091     #define LT_BITFIELD32       uint32_t
00092     #define LT_BITFIELD64       uint64_t
00093 #else
00094     #ifdef HAVE_STDINT_H
00095         #   include <stdint.h>
00096     #endif
00097     #if __GNUC__ >= 4
00098         #ifdef LT_BUILDING_DLL
00099                 #define DLLEXPORT __attribute__ ((visibility("default")))
00100                 #define DLLLOCAL __attribute__ ((visibility("hidden")))
00101         #else
00102                 #define DLLEXPORT
00103                 #define DLLLOCAL
00104         #endif
00105     #else
00106         #define DLLEXPORT
00107         #define DLLLOCAL
00108     #endif
00109     /* GCC warns if the bitfield type is not "unsigned int", however windows
00110      * generates incorrect code for this (see above), so we define these
00111      * macros.  How Hideous.  So much for C's portability.
00112      */
00113     #define LT_BITFIELD8        unsigned int
00114     #define LT_BITFIELD16       unsigned int
00115     #define LT_BITFIELD32       unsigned int
00116     #define LT_BITFIELD64       unsigned int
00117 #endif
00118 
00119 #ifdef WIN32
00120 #   include <winsock2.h>
00121 #   include <ws2tcpip.h>
00122     typedef short sa_family_t;
00123     /* Make up for a lack of stdbool.h */
00124 #    define bool signed char
00125 #    define false 0
00126 #    define true 1
00127 #    if !defined(ssize_t)
00128      /* XXX: Not 64-bit safe! */
00129 #    define ssize_t int
00130 #    endif    
00131 #else
00132 #    include <netinet/in.h>
00133 
00134 #ifndef __cplusplus
00135 #    include <stdbool.h>
00136 #endif
00137 
00138 #    include <sys/types.h>
00139 #    include <sys/socket.h>
00140 #endif
00141 
00143 #define LIBTRACE_API_VERSION \
00144             ((3<<16)|(0<<8)|(14))
00145 
00148 #define LIBTRACE_SVN_REVISION 0
00149 
00151 #define DAG_DRIVER_V ""
00152     
00153 #ifdef __cplusplus 
00154 extern "C" { 
00155 #endif
00156 
00157 /* Function does not depend on anything but its
00158  * parameters, used to hint gcc's optimisations
00159  */
00160 #if __GNUC__ >= 3 
00161 #  define DEPRECATED __attribute__((deprecated))
00162 #  define SIMPLE_FUNCTION __attribute__((pure))
00163 #  define UNUSED __attribute__((unused))
00164 #  define PACKED __attribute__((packed))
00165 #  define PRINTF(formatpos,argpos) __attribute__((format(printf,formatpos,argpos)))
00166 #else
00167 #  define DEPRECATED
00168 #  define SIMPLE_FUNCTION
00169 #  define UNUSED
00170 #  define PACKED 
00171 #  define PRINTF(formatpos,argpos) 
00172 #endif
00173         
00175 typedef struct libtrace_out_t libtrace_out_t;
00176         
00178 typedef struct libtrace_t libtrace_t;
00179         
00181 typedef struct libtrace_filter_t libtrace_filter_t;
00182 
00191 typedef enum {
00192         TRACE_CTRL_PACKET='p',  
00193         TRACE_CTRL_EXTERNAL='e' 
00194 } buf_control_t;
00195 
00197 #define LIBTRACE_PACKET_BUFSIZE 65536
00198 
00200 typedef struct trace_err_t{
00201         int err_num;            
00202         char problem[255];      
00203 } libtrace_err_t;
00204 
00206 enum {
00208         TRACE_ERR_NOERROR       = 0,
00210         TRACE_ERR_BAD_FORMAT    = -1,
00212         TRACE_ERR_INIT_FAILED   = -2,
00214         TRACE_ERR_UNKNOWN_OPTION= -3,
00216         TRACE_ERR_NO_CONVERSION = -4,
00218         TRACE_ERR_BAD_PACKET    = -5,
00220         TRACE_ERR_OPTION_UNAVAIL= -6,
00222         TRACE_ERR_UNSUPPORTED   = -7,
00224         TRACE_ERR_BAD_STATE     = -8,
00226         TRACE_ERR_BAD_FILTER    = -9,
00228         TRACE_ERR_RT_FAILURE    = -10
00229 };
00230 
00233 typedef enum {
00237         TRACE_DLT_NULL = 0, 
00238         TRACE_DLT_EN10MB = 1,
00239         TRACE_DLT_PPP = 9,
00240         TRACE_DLT_ATM_RFC1483 = 11,
00241         
00246 #ifdef __OpenBSD__
00247         TRACE_DLT_RAW = 14,     
00248 #else
00249         TRACE_DLT_RAW = 12,
00250 #endif
00251         TRACE_DLT_PPP_SERIAL = 50,
00252         TRACE_DLT_LINKTYPE_RAW = 101, 
00253         TRACE_DLT_C_HDLC = 104,
00254         TRACE_DLT_IEEE802_11 = 105,
00255         TRACE_DLT_LINUX_SLL = 113,
00256         TRACE_DLT_PFLOG = 117,
00257         TRACE_DLT_IEEE802_11_RADIO = 127 
00258 } libtrace_dlt_t ;
00259 
00261 typedef enum { 
00262     /* TRACE_TYPE_LEGACY = 0            Obsolete */
00263        TRACE_TYPE_HDLC_POS = 1,         
00264        TRACE_TYPE_ETH = 2,              
00265        TRACE_TYPE_ATM = 3,              
00266        TRACE_TYPE_80211 = 4,            
00267        TRACE_TYPE_NONE = 5,             
00268        TRACE_TYPE_LINUX_SLL = 6,        
00269        TRACE_TYPE_PFLOG = 7,            
00270     /* TRACE_TYPE_LEGACY_DEFAULT        Obsolete */
00271        TRACE_TYPE_POS = 9,              
00272     /* TRACE_TYPE_LEGACY_ATM            Obsolete */
00273     /* TRACE_TYPE_LEGACY_ETH            Obsolete */
00274        TRACE_TYPE_80211_PRISM = 12,     
00275        TRACE_TYPE_AAL5 = 13,            
00276        TRACE_TYPE_DUCK = 14,         
00277        TRACE_TYPE_80211_RADIO = 15,  
00278        TRACE_TYPE_LLCSNAP = 16,      
00279        TRACE_TYPE_PPP = 17,          
00280        TRACE_TYPE_METADATA = 18,        
00281        TRACE_TYPE_NONDATA = 19          
00282 } libtrace_linktype_t;
00283 
00288 enum base_format_t {
00289         TRACE_FORMAT_ERF          =1,   
00290         TRACE_FORMAT_PCAP         =2,   
00291         TRACE_FORMAT_PCAPFILE     =3,   
00292         TRACE_FORMAT_WAG          =4,   
00293         TRACE_FORMAT_RT           =5,   
00294         TRACE_FORMAT_LEGACY_ATM   =6,   
00295         TRACE_FORMAT_LEGACY_POS   =7,   
00296         TRACE_FORMAT_LEGACY_ETH   =8,   
00297         TRACE_FORMAT_LINUX_NATIVE =9,   
00298         TRACE_FORMAT_DUCK         =10,  
00299         TRACE_FORMAT_BPF          =11,  
00300         TRACE_FORMAT_TSH          =12,  
00301         TRACE_FORMAT_ATMHDR       =13,  
00302         TRACE_FORMAT_LEGACY_NZIX  =14   
00303 };
00304 
00306 typedef enum {
00307         TRACE_RT_HELLO          =1, 
00308         TRACE_RT_START          =2, 
00310         TRACE_RT_ACK            =3, 
00311         TRACE_RT_STATUS         =4, 
00312         TRACE_RT_DUCK           =5, 
00313         TRACE_RT_END_DATA       =6, 
00314         TRACE_RT_CLOSE          =7, 
00315         TRACE_RT_DENY_CONN      =8, 
00316         TRACE_RT_PAUSE          =9, 
00318         TRACE_RT_PAUSE_ACK      =10,
00319         TRACE_RT_OPTION         =11,
00320         TRACE_RT_KEYCHANGE      =12,
00321         TRACE_RT_DUCK_2_4       =13,
00322         TRACE_RT_DUCK_2_5       =14,
00323         TRACE_RT_LOSTCONN       =15,
00324         TRACE_RT_SERVERSTART    =16,
00325         TRACE_RT_CLIENTDROP     =17,
00326         TRACE_RT_METADATA       =18,
00329         TRACE_RT_DATA_SIMPLE    = 1000, 
00330         
00332         TRACE_RT_DATA_ERF       =TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_ERF, 
00334         TRACE_RT_DATA_WAG       =TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_WAG, 
00336         TRACE_RT_DATA_LEGACY_ATM=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_LEGACY_ATM, 
00338         TRACE_RT_DATA_LEGACY_POS=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_LEGACY_POS, 
00340         TRACE_RT_DATA_LEGACY_ETH=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_LEGACY_ETH, 
00342         TRACE_RT_DATA_LINUX_NATIVE=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_LINUX_NATIVE,
00344         TRACE_RT_DATA_BPF       =TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_BPF,
00346         TRACE_RT_DATA_TSH       =TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_TSH,
00348         TRACE_RT_DATA_ATMHDR = TRACE_RT_DATA_SIMPLE + TRACE_FORMAT_ATMHDR,
00350         TRACE_RT_DATA_LEGACY_NZIX=TRACE_RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_NZIX,
00351 
00355         TRACE_RT_DATA_DLT               = 2000, 
00357         TRACE_RT_DLT_NULL               =TRACE_RT_DATA_DLT+TRACE_DLT_NULL,
00360         TRACE_RT_DLT_EN10MB             =TRACE_RT_DATA_DLT+TRACE_DLT_EN10MB,
00363         TRACE_RT_DLT_IEEE802_11         =TRACE_RT_DATA_DLT+TRACE_DLT_IEEE802_11,
00366         TRACE_RT_DLT_LINUX_SLL          =TRACE_RT_DATA_DLT+TRACE_DLT_LINUX_SLL,
00368         TRACE_RT_DLT_PFLOG              =TRACE_RT_DATA_DLT+TRACE_DLT_PFLOG,
00370         TRACE_RT_DLT_ATM_RFC1483        =TRACE_RT_DATA_DLT+TRACE_DLT_ATM_RFC1483,
00373         TRACE_RT_DATA_DLT_END           = 2999,
00376         TRACE_RT_LAST                   = (2<<31)
00377 } libtrace_rt_types_t;
00378 
00380 typedef enum {
00381         TRACE_IPPROTO_IP        = 0,    
00382         TRACE_IPPROTO_ICMP      = 1,    
00383         TRACE_IPPROTO_IGMP      = 2,    
00384         TRACE_IPPROTO_IPIP      = 4,    
00385         TRACE_IPPROTO_TCP       = 6,    
00386         TRACE_IPPROTO_UDP       = 17,   
00387         TRACE_IPPROTO_IPV6      = 41,   
00388         TRACE_IPPROTO_ROUTING   = 43,   
00389         TRACE_IPPROTO_FRAGMENT  = 44,   
00390         TRACE_IPPROTO_RSVP      = 46,   
00391         TRACE_IPPROTO_GRE       = 47,   
00392         TRACE_IPPROTO_ESP       = 50,   
00393         TRACE_IPPROTO_AH        = 51,   
00394         TRACE_IPPROTO_ICMPV6    = 58,   
00395         TRACE_IPPROTO_NONE      = 59,   
00396         TRACE_IPPROTO_DSTOPTS   = 60,   
00397         TRACE_IPPROTO_OSPF      = 89,   
00398         TRACE_IPPROTO_PIM       = 103,  
00399         TRACE_IPPROTO_SCTP      = 132   
00400 } libtrace_ipproto_t;
00401 
00403 typedef enum {
00404         /* Numbers <=1500 are of course, LLC/SNAP */
00405         TRACE_ETHERTYPE_IP      = 0x0800,       
00406         TRACE_ETHERTYPE_ARP     = 0x0806,       
00407         TRACE_ETHERTYPE_RARP    = 0x8035,       
00408         TRACE_ETHERTYPE_8021Q   = 0x8100,       
00409         TRACE_ETHERTYPE_IPV6    = 0x86DD,       
00410         TRACE_ETHERTYPE_MPLS    = 0x8847,       
00411         TRACE_ETHERTYPE_MPLS_MC = 0x8848,       
00412         TRACE_ETHERTYPE_PPP_DISC= 0x8863,       
00413         TRACE_ETHERTYPE_PPP_SES = 0x8864        
00414 } libtrace_ethertype_t;
00415 
00419 typedef struct libtrace_packet_t {
00420         struct libtrace_t *trace;       
00421         void *header;                   
00422         void *payload;                  
00423         void *buffer;                   
00424         libtrace_rt_types_t  type;      
00425         buf_control_t buf_control;      
00426         int capture_length;             
00427         int wire_length;                
00428         int payload_length;             
00429         void *l2_header;                
00430         libtrace_linktype_t link_type;  
00431         uint32_t l2_remaining;          
00432         void *l3_header;                
00433         uint16_t l3_ethertype;          
00434         uint32_t l3_remaining;          
00435         void *l4_header;                
00436         uint8_t transport_proto;        
00437         uint32_t l4_remaining;          
00438 } libtrace_packet_t;
00439 
00440 
00446 typedef enum {
00447         TRACE_DIR_OUTGOING = 0,         
00448         TRACE_DIR_INCOMING = 1,         
00449         TRACE_DIR_OTHER    = 2          
00450 } libtrace_direction_t;
00451 
00453 typedef enum {
00454     TRACE_RADIOTAP_TSFT = 0, 
00455     TRACE_RADIOTAP_FLAGS = 1, 
00456     TRACE_RADIOTAP_RATE = 2, 
00457     TRACE_RADIOTAP_CHANNEL = 3, 
00458     TRACE_RADIOTAP_FHSS = 4, 
00459     TRACE_RADIOTAP_DBM_ANTSIGNAL = 5, 
00460     TRACE_RADIOTAP_DBM_ANTNOISE = 6, 
00461     TRACE_RADIOTAP_LOCK_QUALITY = 7, 
00462     TRACE_RADIOTAP_TX_ATTENUATION = 8, 
00463     TRACE_RADIOTAP_DB_TX_ATTENUATION = 9, 
00464     TRACE_RADIOTAP_DBM_TX_POWER = 10, 
00465     TRACE_RADIOTAP_ANTENNA = 11, 
00466     TRACE_RADIOTAP_DB_ANTSIGNAL = 12, 
00467     TRACE_RADIOTAP_DB_ANTNOISE = 13, 
00468     TRACE_RADIOTAP_RX_FLAGS = 14, 
00469     TRACE_RADIOTAP_TX_FLAGS = 15, 
00470     TRACE_RADIOTAP_RTS_RETRIES = 16, 
00471     TRACE_RADIOTAP_DATA_RETRIES = 17, 
00472     TRACE_RADIOTAP_EXT = 31
00473 } libtrace_radiotap_field_t;
00474 
00475 
00482 #ifdef WIN32
00483 #pragma pack(push)
00484 #pragma pack(1)
00485 #endif
00486 
00488 typedef struct libtrace_ip
00489 {
00490 #if BYTE_ORDER == LITTLE_ENDIAN
00491     LT_BITFIELD8 ip_hl:4;               
00492     LT_BITFIELD8 ip_v:4;                
00493 #elif BYTE_ORDER == BIG_ENDIAN
00494     LT_BITFIELD8 ip_v:4;                
00495     LT_BITFIELD8 ip_hl:4;               
00496 #else
00497 #   error "Adjust your <bits/endian.h> defines"
00498 #endif
00499     uint8_t  ip_tos;                    
00500     uint16_t ip_len;                    
00501     int16_t  ip_id;                     
00502     uint16_t ip_off;                    
00503     uint8_t  ip_ttl;                    
00504     uint8_t  ip_p;                      
00505     uint16_t ip_sum;                    
00506     struct in_addr ip_src;              
00507     struct in_addr ip_dst;              
00508 } PACKED libtrace_ip_t;
00509 
00511 typedef struct libtrace_ip6_ext
00512 {
00513         uint8_t nxt;    
00514         uint8_t len;    
00515 } PACKED libtrace_ip6_ext_t;
00516 
00517 typedef struct libtrace_ip6_frag 
00518 {
00519         uint8_t nxt;    
00520         uint8_t res;    
00521         uint16_t frag_off;      
00522         uint32_t ident; 
00523 } PACKED libtrace_ip6_frag_t;
00524 
00530 typedef struct libtrace_ip6
00531 { 
00532     uint32_t flow;                      
00533     uint16_t plen;                      
00534     uint8_t nxt;                        
00535     uint8_t hlim;                       
00536     struct in6_addr ip_src;             
00537     struct in6_addr ip_dst;             
00538 } PACKED libtrace_ip6_t;
00539 
00541 typedef struct libtrace_tcp
00542   {
00543     uint16_t source;            
00544     uint16_t dest;              
00545     uint32_t seq;               
00546     uint32_t ack_seq;           
00547 #  if BYTE_ORDER == LITTLE_ENDIAN
00548     LT_BITFIELD8 ecn_ns:1;      
00549     LT_BITFIELD8 res1:3;        
00550     LT_BITFIELD8 doff:4;        
00551     LT_BITFIELD8 fin:1;         
00552     LT_BITFIELD8 syn:1;         
00553     LT_BITFIELD8 rst:1;         
00554     LT_BITFIELD8 psh:1;         
00555     LT_BITFIELD8 ack:1;         
00556     LT_BITFIELD8 urg:1;         
00557     LT_BITFIELD8 ece:1;         
00558     LT_BITFIELD8 cwr:1;         
00559 #  elif BYTE_ORDER == BIG_ENDIAN
00560     LT_BITFIELD8 doff:4;        
00561     LT_BITFIELD8 res1:3;        
00562     LT_BITFIELD8 ecn_ns:1;      
00563     LT_BITFIELD8 cwr:1;         
00564     LT_BITFIELD8 ece:1;         
00565     LT_BITFIELD8 urg:1;         
00566     LT_BITFIELD8 ack:1;         
00567     LT_BITFIELD8 psh:1;         
00568     LT_BITFIELD8 rst:1;         
00569     LT_BITFIELD8 syn:1;         
00570     LT_BITFIELD8 fin:1;         
00571 #  else
00572 #   error "Adjust your <bits/endian.h> defines"
00573 #  endif
00574     uint16_t window;            
00575     uint16_t check;             
00576     uint16_t urg_ptr;           
00577 } PACKED libtrace_tcp_t;
00578 
00580 typedef struct libtrace_udp {
00581   uint16_t      source;         
00582   uint16_t      dest;           
00583   uint16_t      len;            
00584   uint16_t      check;          
00585 } PACKED libtrace_udp_t;
00586 
00588 typedef struct libtrace_icmp
00589 {
00590   uint8_t type;         
00591   uint8_t code;         
00592   uint16_t checksum;            
00593   union
00594   {
00595     struct
00596     {
00597       uint16_t  id;             
00598       uint16_t  sequence;       
00599     } echo;                     
00600     uint32_t    gateway;        
00601     struct
00602     {
00603       uint16_t  unused;         
00604       uint16_t  mtu;            
00605     } frag;                     
00606   } un;                         
00607 } PACKED libtrace_icmp_t;
00608 
00610 typedef struct libtrace_llcsnap
00611 {
00612 /* LLC */
00613   uint8_t dsap;                 
00614   uint8_t ssap;                 
00615   uint8_t control;              
00616 /* SNAP */
00617   LT_BITFIELD32 oui:24;         
00618   uint16_t type;                
00619 } PACKED libtrace_llcsnap_t;
00620 
00622 typedef struct libtrace_ether
00623 {
00624   uint8_t ether_dhost[6];       
00625   uint8_t ether_shost[6];       
00626   uint16_t ether_type;          
00627 } PACKED libtrace_ether_t;
00628 
00630 typedef struct libtrace_8021q 
00631 {
00632   LT_BITFIELD16 vlan_pri:3;      
00633   LT_BITFIELD16 vlan_cfi:1;      
00635   LT_BITFIELD16 vlan_id:12;      
00636   uint16_t vlan_ether_type;      
00638 } PACKED libtrace_8021q_t;
00639 
00641 typedef struct libtrace_atm_cell
00642 {
00643   LT_BITFIELD32 gfc:4;          
00644   LT_BITFIELD32 vpi:8;          
00645   LT_BITFIELD32 vci:16;         
00646   LT_BITFIELD32 pt:3;           
00647   LT_BITFIELD32 clp:1;          
00648   LT_BITFIELD32 hec:8;          
00649 } PACKED libtrace_atm_cell_t;
00650 
00652 typedef struct libtrace_atm_nni_cell
00653 {
00654   LT_BITFIELD32 vpi:12;         
00655   LT_BITFIELD32 vci:16;         
00656   LT_BITFIELD32 pt:3;           
00657   LT_BITFIELD32 clp:1;          
00658   LT_BITFIELD32 hec:8;          
00659 } PACKED libtrace_atm_nni_cell_t;
00660 
00668 typedef struct libtrace_atm_capture_cell
00669 {
00670   LT_BITFIELD32 gfc:4;          
00671   LT_BITFIELD32 vpi:8;          
00672   LT_BITFIELD32 vci:16;         
00673   LT_BITFIELD32 pt:3;           
00674   LT_BITFIELD32 clp:1;          
00675 } PACKED libtrace_atm_capture_cell_t;
00676 
00684 typedef struct libtrace_atm_nni_capture_cell
00685 {
00686   LT_BITFIELD32 vpi:12;         
00687   LT_BITFIELD32 vci:16;         
00688   LT_BITFIELD32 pt:3;           
00689   LT_BITFIELD32 clp:1;          
00690   LT_BITFIELD32 hec:8;          
00691 } PACKED libtrace_atm_nni_capture_cell_t;
00692 
00694 typedef struct libtrace_ppp
00695 {
00696  /* I can't figure out where the hell these two variables come from. They're
00697   * definitely not in RFC 1661 which defines PPP. Probably some weird thing
00698   * relating to the lack of distinction between PPP, HDLC and CHDLC */
00699         
00700 /* uint8_t address; */          
00701 /* uint8_t header;  */          
00702  uint16_t protocol;             
00703 } PACKED libtrace_ppp_t;
00704 
00706 typedef struct libtrace_pppoe
00707 {
00708  LT_BITFIELD8 version:4;        
00709  LT_BITFIELD8 type:4;           
00710  uint8_t code;                  
00711  uint16_t session_id;           
00712  uint16_t length;               
00713 } PACKED libtrace_pppoe_t;
00714 
00716 typedef struct libtrace_80211_t {
00717 #if BYTE_ORDER == LITTLE_ENDIAN
00718         LT_BITFIELD32      protocol:2;  
00719         LT_BITFIELD32      type:2;      
00720         LT_BITFIELD32      subtype:4;   
00721 #else
00722         LT_BITFIELD32      subtype:4;   
00723         LT_BITFIELD32      type:2;      
00724         LT_BITFIELD32      protocol:2;  
00725 #endif
00726 
00727 #if BYTE_ORDER == LITTLE_ENDIAN
00728         LT_BITFIELD32      to_ds:1;     
00729         LT_BITFIELD32      from_ds:1;   
00730         LT_BITFIELD32      more_frag:1; 
00731         LT_BITFIELD32      retry:1;     
00732         LT_BITFIELD32      power:1;     
00733         LT_BITFIELD32      more_data:1; 
00734         LT_BITFIELD32      wep:1;       
00735         LT_BITFIELD32      order:1;     
00736 #else
00737         LT_BITFIELD32      order:1;     
00738         LT_BITFIELD32      wep:1;       
00739         LT_BITFIELD32      more_data:1; 
00740         LT_BITFIELD32      power:1;     
00741         LT_BITFIELD32      retry:1;     
00742         LT_BITFIELD32      more_frag:1; 
00743         LT_BITFIELD32      from_ds:1;   
00744         LT_BITFIELD32      to_ds:1;     
00745 #endif
00746         uint16_t     duration;  
00747         uint8_t      mac1[6];   
00748         uint8_t      mac2[6];   
00749         uint8_t      mac3[6];   
00750         uint16_t     SeqCtl;    
00751         uint8_t      mac4[6];   
00752 } PACKED libtrace_80211_t;
00753 
00761 typedef struct libtrace_radiotap_t {
00762     uint8_t     it_version; 
00763     uint8_t     it_pad; 
00764     uint16_t    it_len; 
00765     uint32_t    it_present; 
00766 } PACKED libtrace_radiotap_t;
00767 
00769 typedef struct libtrace_ospf_v2_t
00770 {
00771         uint8_t ospf_v;         
00772         uint8_t type;           
00773         uint16_t len;           
00774         struct in_addr router;  
00775         struct in_addr area;    
00776         uint16_t sum;           
00777         uint16_t au_type;       
00778         uint16_t zero;          
00779         uint8_t au_key_id;      
00780         uint8_t au_data_len;    
00781         uint32_t au_seq_num;    
00782 } PACKED libtrace_ospf_v2_t;
00783 
00785 typedef struct libtrace_ospf_options_t {
00786 #if BYTE_ORDER == LITTLE_ENDIAN
00787         LT_BITFIELD8 unused1:1;
00788         LT_BITFIELD8 e_bit:1;
00789         LT_BITFIELD8 mc_bit:1;
00790         LT_BITFIELD8 np_bit:1;
00791         LT_BITFIELD8 ea_bit:1;
00792         LT_BITFIELD8 dc_bit:1;
00793         LT_BITFIELD8 unused2:2;
00794 #elif BYTE_ORDER == BIG_ENDIAN
00795         LT_BITFIELD8 unused2:2;
00796         LT_BITFIELD8 dc_bit:1;
00797         LT_BITFIELD8 ea_bit:1;
00798         LT_BITFIELD8 np_bit:1;
00799         LT_BITFIELD8 mc_bit:1;
00800         LT_BITFIELD8 e_bit:1;
00801         LT_BITFIELD8 unused1:1;
00802 #endif
00803 } PACKED libtrace_ospf_options_t;
00804 
00806 typedef struct libtrace_ospf_lsa_v2_t
00807 {
00808         uint16_t age;           
00809         libtrace_ospf_options_t lsa_options;    
00810         uint8_t lsa_type;       
00811         struct in_addr ls_id;   
00812         struct in_addr adv_router; 
00813         uint32_t seq;           
00814         uint16_t checksum;      
00815         uint16_t length;        
00816 } PACKED libtrace_ospf_lsa_v2_t;
00817 
00819 typedef struct libtrace_ospf_hello_v2_t
00820 {
00821         struct in_addr mask;    
00822         uint16_t interval;      
00823         libtrace_ospf_options_t hello_options;  
00824         uint8_t priority;       
00825         uint32_t deadint;       
00826         struct in_addr designated;      
00827         struct in_addr backup;  
00831 } PACKED libtrace_ospf_hello_v2_t;
00832 
00834 typedef struct libtrace_ospf_db_desc_v2_t
00835 {
00836         uint16_t mtu;           
00837         libtrace_ospf_options_t db_desc_options;        
00838 #if BYTE_ORDER == LITTLE_ENDIAN
00839         LT_BITFIELD8 db_desc_ms:1;      
00840         LT_BITFIELD8 db_desc_m:1;       
00841         LT_BITFIELD8 db_desc_i:1;       
00842         LT_BITFIELD8 zero:5;
00843 #elif BYTE_ORDER == BIG_ENDIAN
00844         LT_BITFIELD8 zero:5;
00845         LT_BITFIELD8 db_desc_i:1;       
00846         LT_BITFIELD8 db_desc_m:1;       
00847         LT_BITFIELD8 db_desc_ms:1;      
00848 #endif
00849         uint32_t seq;           
00850 } PACKED libtrace_ospf_db_desc_v2_t;
00851 
00853 typedef struct libtrace_ospf_ls_req_t
00854 {
00855         uint32_t ls_type;       
00856         uint32_t ls_id;         
00857         uint32_t advertising_router;    
00858 } PACKED libtrace_ospf_ls_req_t;
00859 
00861 typedef struct libtrace_ospf_ls_update_t
00862 {
00863         uint32_t ls_num_adv;    
00865         /* Followed by LSAs, use API functions to access these */
00866 } PACKED libtrace_ospf_ls_update_t;
00867 
00869 typedef struct libtrace_ospf_as_external_lsa_t
00870 {
00871         struct in_addr netmask; 
00872 #if BYTE_ORDER == LITTLE_ENDIAN
00873         LT_BITFIELD8 tos:7;
00874         LT_BITFIELD8 e:1;       
00875 #elif BYTE_ORDER == BIG_ENDIAN
00876         LT_BITFIELD8 e:1;       
00877         LT_BITFIELD8 tos:7;
00878 #endif
00879         uint8_t metric_a;       
00880         uint8_t metric_b;       
00881         uint8_t metric_c;       
00882         struct in_addr forwarding;      
00883         uint32_t external_tag;          
00884 } PACKED libtrace_ospf_as_external_lsa_v2_t;
00885 
00887 typedef struct libtrace_ospf_summary_lsa
00888 {
00889         struct in_addr netmask; 
00890         uint8_t zero;           
00891         uint8_t metric_a;       
00892         uint8_t metric_b;       
00893         uint8_t metric_c;       
00895 } PACKED libtrace_ospf_summary_lsa_v2_t;
00896 
00898 typedef struct libtrace_ospf_network_lsa_t
00899 {
00900         struct in_addr netmask; 
00901         /* Followed by IDs of attached routers */
00902 } PACKED libtrace_ospf_network_lsa_v2_t;
00903 
00905 typedef struct libtrace_ospf_link_t
00906 {
00907         struct in_addr link_id;         
00908         struct in_addr link_data;       
00909         uint8_t type;                   
00910         uint8_t num_tos;                
00911         uint16_t tos_metric;            
00912 } PACKED libtrace_ospf_link_v2_t;
00913 
00915 typedef struct libtrace_ospf_router_lsa_t
00916 {
00917 #if BYTE_ORDER == LITTLE_ENDIAN
00918         LT_BITFIELD8 b:1;       
00919         LT_BITFIELD8 e:1;       
00920         LT_BITFIELD8 v:1;       
00921         LT_BITFIELD8 zero:5;
00922 #elif BYTE_ORDER == BIG_ENDIAN
00923         LT_BITFIELD8 zero:5;
00924         LT_BITFIELD8 v:1;       
00925         LT_BITFIELD8 e:1;       
00926         LT_BITFIELD8 b:1;       
00927 #endif
00928         uint8_t zero2;          
00929         uint16_t num_links;     
00930 } PACKED libtrace_ospf_router_lsa_v2_t;
00931 
00932 typedef enum {
00933         TRACE_OSPF_HELLO = 1,           
00934         TRACE_OSPF_DATADESC = 2,        
00935         TRACE_OSPF_LSREQ = 3,           
00936         TRACE_OSPF_LSUPDATE = 4,        
00937         TRACE_OSPF_LSACK = 5            
00938 } libtrace_ospf_types_t;
00939 
00940 typedef enum {
00941         TRACE_OSPF_LS_ROUTER = 1,       
00942         TRACE_OSPF_LS_NETWORK = 2,      
00943         TRACE_OSPF_LS_SUMMARY = 3,      
00944         TRACE_OSPF_LS_ASBR_SUMMARY = 4, 
00945         TRACE_OSPF_LS_EXTERNAL = 5      
00946 } libtrace_ospf_ls_types_t;
00947 
00948 
00949 #ifdef WIN32
00950 #pragma pack(pop)
00951 #endif
00952 
00953 
00961 DLLEXPORT void trace_help(void);
00962 
00978 DLLEXPORT void trace_interrupt(void); 
00979 
00998 DLLEXPORT const char *trace_parse_uri(const char *uri, char **format);
00999 
01020 DLLEXPORT libtrace_t *trace_create(const char *uri);
01021 
01035 DLLEXPORT libtrace_t *trace_create_dead(const char *uri);
01036 
01050 DLLEXPORT libtrace_out_t *trace_create_output(const char *uri);
01051 
01061 DLLEXPORT int trace_start(libtrace_t *libtrace);
01062 
01072 DLLEXPORT int trace_pause(libtrace_t *libtrace);
01073 
01081 DLLEXPORT int trace_start_output(libtrace_out_t *libtrace);
01082 
01084 typedef enum {
01086         TRACE_OPTION_SNAPLEN,   
01087 
01089         TRACE_OPTION_PROMISC,   
01090 
01092         TRACE_OPTION_FILTER,    
01093 
01095         TRACE_OPTION_META_FREQ, 
01096 
01099         TRACE_OPTION_EVENT_REALTIME
01100 } trace_option_t;
01101 
01109 DLLEXPORT int trace_config(libtrace_t *libtrace,
01110                 trace_option_t option,
01111                 void *value);
01112 
01116 typedef enum {
01117         TRACE_OPTION_COMPRESSTYPE_NONE = 0, 
01118         TRACE_OPTION_COMPRESSTYPE_ZLIB = 1, 
01119         TRACE_OPTION_COMPRESSTYPE_BZ2  = 2, 
01120         TRACE_OPTION_COMPRESSTYPE_LZO  = 3  
01121 } trace_option_compresstype_t;
01122 
01124 typedef enum {
01126         TRACE_OPTION_OUTPUT_FILEFLAGS,
01129         TRACE_OPTION_OUTPUT_COMPRESS,
01131         TRACE_OPTION_OUTPUT_COMPRESSTYPE
01132 } trace_option_output_t;
01133 
01143 DLLEXPORT int trace_config_output(libtrace_out_t *libtrace, 
01144                 trace_option_output_t option,
01145                 void *value
01146                 );
01147 
01153 DLLEXPORT void trace_destroy(libtrace_t *trace);
01154 
01158 DLLEXPORT void trace_destroy_dead(libtrace_t *trace);
01159 
01163 DLLEXPORT void trace_destroy_output(libtrace_out_t *trace);
01164 
01172 DLLEXPORT libtrace_err_t trace_get_err(libtrace_t *trace);
01173 
01180 DLLEXPORT bool trace_is_err(libtrace_t *trace);
01181 
01189 DLLEXPORT void trace_perror(libtrace_t *trace, const char *msg,...) PRINTF(2,3);
01190 
01198 DLLEXPORT libtrace_err_t trace_get_err_output(libtrace_out_t *trace);
01199 
01206 DLLEXPORT bool trace_is_err_output(libtrace_out_t *trace);
01207 
01214 DLLEXPORT void trace_perror_output(libtrace_out_t *trace, const char *msg,...)
01215         PRINTF(2,3);
01216 
01226 DLLEXPORT
01227 uint64_t trace_get_received_packets(libtrace_t *trace);
01228 
01237 DLLEXPORT
01238 uint64_t trace_get_filtered_packets(libtrace_t *trace);
01239 
01248 DLLEXPORT
01249 uint64_t trace_get_dropped_packets(libtrace_t *trace);
01250 
01259 DLLEXPORT
01260 uint64_t trace_get_accepted_packets(libtrace_t *trace);
01261 
01262 
01275 DLLEXPORT libtrace_packet_t *trace_create_packet(void);
01276 
01289 DLLEXPORT libtrace_packet_t *trace_copy_packet(const libtrace_packet_t *packet);
01290 
01295 DLLEXPORT void trace_destroy_packet(libtrace_packet_t *packet);
01296 
01297 
01315 DLLEXPORT int trace_read_packet(libtrace_t *trace, libtrace_packet_t *packet);
01316 
01320 typedef enum {
01321         TRACE_EVENT_IOWAIT,     
01322         TRACE_EVENT_SLEEP,      
01323         TRACE_EVENT_PACKET,     
01324         TRACE_EVENT_TERMINATE   
01325 } libtrace_event_t;
01326 
01328 typedef struct libtrace_eventobj_t {
01329         libtrace_event_t type; 
01332         int fd;                
01334         double seconds;        
01336         int size; 
01337 } libtrace_eventobj_t;
01338 
01350 DLLEXPORT libtrace_eventobj_t trace_event(libtrace_t *trace,
01351                 libtrace_packet_t *packet);
01352 
01353 
01360 DLLEXPORT int trace_write_packet(libtrace_out_t *trace, libtrace_packet_t *packet);
01361 
01370 DLLEXPORT 
01371 enum base_format_t trace_get_format(struct libtrace_packet_t *packet);
01372 
01385 DLLEXPORT
01386 void trace_construct_packet(libtrace_packet_t *packet,
01387                 libtrace_linktype_t linktype, const void *data, uint16_t len);
01388 
01435 DLLEXPORT void *trace_get_packet_buffer(const libtrace_packet_t *packet,
01436                 libtrace_linktype_t *linktype, uint32_t *remaining);
01437 
01448 DLLEXPORT SIMPLE_FUNCTION DEPRECATED
01449 void *trace_get_link(const libtrace_packet_t *packet);
01450 
01461 DLLEXPORT SIMPLE_FUNCTION
01462 libtrace_ip_t *trace_get_ip(libtrace_packet_t *packet);
01463 
01474 DLLEXPORT SIMPLE_FUNCTION
01475 libtrace_ip6_t *trace_get_ip6(libtrace_packet_t *packet);
01476 
01499 DLLEXPORT void *trace_get_packet_meta(const libtrace_packet_t *packet,
01500                 libtrace_linktype_t *linktype,
01501                 uint32_t *remaining);
01502 
01540 DLLEXPORT void *trace_get_payload_from_meta(const void *meta,
01541                 libtrace_linktype_t *linktype,
01542                 uint32_t *remaining);
01543 
01544 
01561 DLLEXPORT void *trace_get_layer2(const libtrace_packet_t *packet,
01562                 libtrace_linktype_t *linktype,
01563                 uint32_t *remaining);
01564 
01588 DLLEXPORT void *trace_get_payload_from_layer2(void *l2,
01589                 libtrace_linktype_t linktype,
01590                 uint16_t *ethertype,
01591                 uint32_t *remaining);
01592 
01593 
01607 DLLEXPORT 
01608 void *trace_get_layer3(const libtrace_packet_t *packet,
01609                 uint16_t *ethertype, uint32_t *remaining);
01610 
01627 DLLEXPORT void *trace_get_transport(const libtrace_packet_t *packet, 
01628                 uint8_t *proto, uint32_t *remaining);
01629 
01653 DLLEXPORT void *trace_get_payload_from_ip(libtrace_ip_t *ip, uint8_t *proto,
01654                 uint32_t *remaining);
01655 
01678 DLLEXPORT void *trace_get_payload_from_ip6(libtrace_ip6_t *ipptr,
01679                 uint8_t *proto, uint32_t *remaining);
01680 
01699 DLLEXPORT void *trace_get_payload_from_link(void *linkptr,
01700                 libtrace_linktype_t linktype, 
01701                 uint16_t *type, uint32_t *remaining);
01702 
01726 DLLEXPORT void *trace_get_payload_from_vlan(
01727                 void *vlan, uint16_t *type, uint32_t *remaining);
01728 
01758 DLLEXPORT void *trace_get_payload_from_mpls(
01759                 void *mpls, uint16_t *type, uint32_t *remaining);
01760 
01787 DLLEXPORT void *trace_get_payload_from_pppoe(
01788                 void *pppoe, uint16_t *type, uint32_t *remaining);
01789 
01808 DLLEXPORT void *trace_get_payload_from_tcp(libtrace_tcp_t *tcp, 
01809                 uint32_t *remaining);
01810 
01829 DLLEXPORT void *trace_get_payload_from_udp(libtrace_udp_t *udp, uint32_t *remaining);
01830 
01853 DLLEXPORT void *trace_get_payload_from_icmp(libtrace_icmp_t *icmp, 
01854                 uint32_t *remaining);
01855 
01869 DLLEXPORT SIMPLE_FUNCTION
01870 libtrace_tcp_t *trace_get_tcp(libtrace_packet_t *packet);
01871 
01896 DLLEXPORT SIMPLE_FUNCTION
01897 libtrace_tcp_t *trace_get_tcp_from_ip(libtrace_ip_t *ip, uint32_t *remaining);
01898 
01912 DLLEXPORT SIMPLE_FUNCTION
01913 libtrace_udp_t *trace_get_udp(libtrace_packet_t *packet);
01914 
01939 DLLEXPORT SIMPLE_FUNCTION
01940 libtrace_udp_t *trace_get_udp_from_ip(libtrace_ip_t *ip,uint32_t *remaining);
01941 
01955 DLLEXPORT SIMPLE_FUNCTION
01956 libtrace_icmp_t *trace_get_icmp(libtrace_packet_t *packet);
01957 
01982 DLLEXPORT SIMPLE_FUNCTION
01983 libtrace_icmp_t *trace_get_icmp_from_ip(libtrace_ip_t *ip,uint32_t *remaining);
01984 
02007 DLLEXPORT SIMPLE_FUNCTION
02008 void *trace_get_ospf_header(libtrace_packet_t *packet, uint8_t *version,
02009                 uint32_t *remaining);
02010 
02035 DLLEXPORT SIMPLE_FUNCTION
02036 void *trace_get_ospf_contents_v2(libtrace_ospf_v2_t *header,
02037                 uint8_t *ospf_type, uint32_t *remaining);
02038 
02057 DLLEXPORT SIMPLE_FUNCTION 
02058 unsigned char *trace_get_first_ospf_lsa_from_update_v2(
02059                 libtrace_ospf_ls_update_t *ls_update,
02060                 uint32_t *remaining);
02061 
02080 DLLEXPORT SIMPLE_FUNCTION 
02081 unsigned char *trace_get_first_ospf_lsa_from_db_desc_v2(
02082                 libtrace_ospf_db_desc_v2_t *db_desc,
02083                 uint32_t *remaining);
02084 
02104 DLLEXPORT SIMPLE_FUNCTION
02105 unsigned char *trace_get_first_ospf_link_from_router_lsa_v2(
02106                 libtrace_ospf_router_lsa_v2_t *lsa,
02107                 uint32_t *remaining);
02108 
02138 DLLEXPORT SIMPLE_FUNCTION
02139 int trace_get_next_ospf_link_v2(unsigned char **current,
02140                 libtrace_ospf_link_v2_t **link,
02141                 uint32_t *remaining,
02142                 uint32_t *link_len);
02143 
02185 DLLEXPORT SIMPLE_FUNCTION
02186 int trace_get_next_ospf_lsa_v2(unsigned char **current,
02187                 libtrace_ospf_lsa_v2_t **lsa_hdr,
02188                 unsigned char **lsa_body,
02189                 uint32_t *remaining,
02190                 uint8_t *lsa_type,
02191                 uint16_t *lsa_length);
02192 
02228 DLLEXPORT SIMPLE_FUNCTION
02229 int trace_get_next_ospf_lsa_header_v2(unsigned char **current,
02230                 libtrace_ospf_lsa_v2_t **lsa_hdr,
02231                 uint32_t *remaining,
02232                 uint8_t *lsa_type,
02233                 uint16_t *lsa_length); 
02234 
02244 DLLEXPORT SIMPLE_FUNCTION
02245 uint32_t trace_get_ospf_metric_from_as_external_lsa_v2(
02246                 libtrace_ospf_as_external_lsa_v2_t *as_lsa);
02247 
02257 DLLEXPORT SIMPLE_FUNCTION
02258 uint32_t trace_get_ospf_metric_from_summary_lsa_v2(
02259                 libtrace_ospf_summary_lsa_v2_t *sum_lsa);
02260 
02261 
02272 DLLEXPORT SIMPLE_FUNCTION
02273 uint8_t *trace_get_destination_mac(libtrace_packet_t *packet);
02274 
02285 DLLEXPORT SIMPLE_FUNCTION
02286 uint8_t *trace_get_source_mac(libtrace_packet_t *packet);
02287 
02301 DLLEXPORT SIMPLE_FUNCTION
02302 struct sockaddr *trace_get_source_address(const libtrace_packet_t *packet,
02303                 struct sockaddr *addr);
02304 
02318 DLLEXPORT SIMPLE_FUNCTION
02319 struct sockaddr *trace_get_destination_address(const libtrace_packet_t *packet,
02320                 struct sockaddr *addr);
02321 
02322 
02340 DLLEXPORT int trace_get_next_option(unsigned char **ptr,int *len,
02341                         unsigned char *type,
02342                         unsigned char *optlen,
02343                         unsigned char **data);
02344 
02359 DLLEXPORT SIMPLE_FUNCTION
02360 uint64_t trace_get_erf_timestamp(const libtrace_packet_t *packet);
02361 
02367 DLLEXPORT SIMPLE_FUNCTION
02368 struct timeval trace_get_timeval(const libtrace_packet_t *packet);
02369 
02375 DLLEXPORT SIMPLE_FUNCTION
02376 struct timespec trace_get_timespec(const libtrace_packet_t *packet);
02377 
02384 DLLEXPORT SIMPLE_FUNCTION
02385 double trace_get_seconds(const libtrace_packet_t *packet);
02386 
02403 DLLEXPORT int trace_seek_seconds(libtrace_t *trace, double seconds);
02404 
02418 DLLEXPORT int trace_seek_timeval(libtrace_t *trace, struct timeval tv);
02419 
02437 DLLEXPORT int trace_seek_erf_timestamp(libtrace_t *trace, uint64_t ts);
02438 
02467 DLLEXPORT SIMPLE_FUNCTION
02468 size_t trace_get_capture_length(const libtrace_packet_t *packet);
02469 
02486 DLLEXPORT SIMPLE_FUNCTION
02487 size_t trace_get_wire_length(const libtrace_packet_t *packet);
02488 
02497 DLLEXPORT SIMPLE_FUNCTION
02498 size_t trace_get_framing_length(const libtrace_packet_t *packet);
02499 
02514 DLLEXPORT SIMPLE_FUNCTION
02515 size_t trace_get_payload_length(const libtrace_packet_t *packet);
02516 
02531 DLLEXPORT size_t trace_set_capture_length(libtrace_packet_t *packet, size_t size);
02532 
02541 DLLEXPORT SIMPLE_FUNCTION
02542 libtrace_linktype_t trace_get_link_type(const libtrace_packet_t *packet);
02543 
02554 DLLEXPORT libtrace_direction_t trace_set_direction(libtrace_packet_t *packet, libtrace_direction_t direction);
02555 
02571 DLLEXPORT SIMPLE_FUNCTION
02572 libtrace_direction_t trace_get_direction(const libtrace_packet_t *packet);
02573 
02587 DLLEXPORT SIMPLE_FUNCTION
02588 libtrace_filter_t *trace_create_filter(const char *filterstring);
02589 
02599 DLLEXPORT libtrace_filter_t *
02600 trace_create_filter_from_bytecode(void *bf_insns, unsigned int bf_len);
02601 
02613 DLLEXPORT int trace_apply_filter(libtrace_filter_t *filter,
02614                 const libtrace_packet_t *packet);
02615 
02621 DLLEXPORT void trace_destroy_filter(libtrace_filter_t *filter);
02647 DLLEXPORT char *trace_ether_ntoa(const uint8_t *addr, char *buf);
02648 
02666 DLLEXPORT uint8_t *trace_ether_aton(const char *buf, uint8_t *addr);
02667 
02678 typedef enum {
02679         USE_DEST,       
02680         USE_SOURCE      
02681 } serverport_t;
02682 
02696 DLLEXPORT SIMPLE_FUNCTION
02697 uint16_t trace_get_source_port(const libtrace_packet_t *packet);
02698 
02714 DLLEXPORT SIMPLE_FUNCTION
02715 uint16_t trace_get_destination_port(const libtrace_packet_t *packet);
02716 
02733 DLLEXPORT SIMPLE_FUNCTION
02734 int8_t trace_get_server_port(uint8_t protocol, uint16_t source, uint16_t dest);
02735 
02755 #ifndef ARPHRD_80211_RADIOTAP
02756 
02757 #define ARPHRD_80211_RADIOTAP 803
02758 #endif
02759 
02771 DLLEXPORT bool trace_get_wireless_tsft(void *linkptr,
02772         libtrace_linktype_t linktype, uint64_t *tsft);
02773 
02781 DLLEXPORT bool trace_get_wireless_rate(void *linkptr,
02782         libtrace_linktype_t linktype, uint8_t *rate);
02783 
02791 DLLEXPORT bool trace_get_wireless_freq(void *linkptr,
02792         libtrace_linktype_t linktype, uint16_t *freq);
02793 
02801 DLLEXPORT bool trace_get_wireless_signal_strength_dbm(void *linkptr,
02802         libtrace_linktype_t linktype, int8_t *strength);
02803 
02811 DLLEXPORT bool trace_get_wireless_noise_strength_dbm(void *linkptr,
02812         libtrace_linktype_t linktype, int8_t *strength);
02813 
02821 DLLEXPORT bool trace_get_wireless_signal_strength_db(void *linkptr,
02822         libtrace_linktype_t linktype, uint8_t *strength);
02823 
02831 DLLEXPORT bool trace_get_wireless_noise_strength_db(void *linkptr,
02832         libtrace_linktype_t linktype, uint8_t *strength);
02833 
02842 DLLEXPORT bool trace_get_wireless_tx_attenuation(void *linkptr,
02843         libtrace_linktype_t linktype, uint16_t *attenuation);
02844 
02852 DLLEXPORT bool trace_get_wireless_tx_attenuation_db(void *linkptr,
02853         libtrace_linktype_t linktype, uint16_t *attenuation);
02854 
02862 DLLEXPORT bool trace_get_wireless_tx_power_dbm(void *linkptr, 
02863                 libtrace_linktype_t linktype, int8_t *txpower);
02864 
02872 DLLEXPORT bool trace_get_wireless_antenna(void *linkptr,
02873         libtrace_linktype_t linktype, uint8_t *antenna);
02874 
02877 #ifdef __cplusplus
02878 } /* extern "C" */
02879 #endif /* #ifdef __cplusplus */
02880 #endif /* LIBTRACE_H_ */

Generated on Tue Mar 6 2012 14:15:35 for WAND Trace processing by  doxygen 1.7.1