Changeset 9e2a109 for lib/libtrace_int.h


Ignore:
Timestamp:
08/04/05 15:37:08 (16 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
ef55d05
Parents:
fe43699
Message:

moved format.h to libtrace_int.h

pulled out all the format-specific libtrace_t stuff into an opaque pointer which is defined inside each format_*.o file, for both input and output

This seems to work, it compiles at least, and wag and erf both work

rtclient input is currently broken, I suspect it's not stepping over the status properly

File:
1 moved

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    rdd22d84 r9e2a109  
    2929 */
    3030
    31 #ifndef FORMAT_H
    32 #define FORMAT_H
     31#ifndef LIBTRACE_INT_H
     32#define LIBTRACE_INT_H
    3333
    3434#ifdef __cplusplus
     
    7575#define RP_BUFSIZE 65536
    7676
    77 /** The information about traces that are open
    78  * @internal
    79  */
    80 struct libtrace_t {
    81         struct format_t *format; /**< format driver pointer */
    82         source_t sourcetype;    /**< The type (device,file, etc */
     77struct libtrace_format_data_t;
    8378
    84         union {
    85                 /** Information about rtclients */
    86                 struct {
    87                         char *hostname;
    88                         short port;
    89                 } rt;
    90                 char *path;             /**< information for local sockets */
    91                 char *interface;        /**< intormation for reading of network
    92                                              interfaces */
    93         } conn_info;
    94         /** Information about the current state of the input device */
    95         union {
    96                 int fd;
    97 #if HAVE_ZLIB
    98                 gzFile *file;
    99 #else   
    100                 FILE *file;
    101 #endif
    102 #if HAVE_PCAP
    103                 pcap_t *pcap;
    104 #endif
    105         } input;
    106 
    107         struct fifo_t *fifo;   
    108         struct {
    109                 void *buf;
    110                 unsigned bottom;
    111                 unsigned top;
    112                 unsigned diff;
    113                 unsigned curr;
    114                 unsigned offset;
    115         } dag;
     79struct libtrace_event_t {
    11680        struct {
    11781                void *buffer;
     
    12791};
    12892
     93/** The information about traces that are open
     94 * @internal
     95 */
     96struct libtrace_t {
     97        struct libtrace_format_t *format; /**< format driver pointer */
     98        struct libtrace_format_data_t *format_data; /**<format data pointer */
     99        source_t sourcetype;    /**< The type (device,file, etc */
     100
     101        struct libtrace_event_t event;
     102        char *uridata;
     103        struct fifo_t *fifo;   
     104
     105};
     106
    129107struct libtrace_out_t {
    130         struct format_t * format;
     108        struct libtrace_format_t *format;
     109        struct libtrace_format_data_out_t *format_data;
    131110
    132111        char *uridata;
    133         union {
    134                 struct {
    135                         char *hostname;
    136                         short port;
    137                 } rt;
    138                 char *path;
    139                 char *interface;
    140         } conn_info;
    141 
    142         union {
    143                 struct {
    144                         int level;
    145                 } erf;
    146                
    147         } options;
    148        
    149         union {
    150                 int fd;
    151                 struct rtserver_t * rtserver;
    152 #if HAVE_ZLIB
    153                 gzFile *file;
    154 #else
    155                 FILE *file;
    156 #endif
    157 #if HAVE_PCAP
    158                 pcap_t *pcap;
    159 #endif
    160         } output;
    161 
    162112        struct fifo_t *fifo;
    163 
    164 
    165113};
    166114
     
    195143};
    196144
    197 struct format_t {
     145struct libtrace_format_t {
    198146        char *name;
    199147        char *version;
     
    219167};
    220168
    221 extern struct format_t *form;
     169extern struct libtrace_format_t *form;
    222170
    223 void register_format(struct format_t *format);
     171void register_format(struct libtrace_format_t *format);
    224172       
    225173#ifdef __cplusplus
     
    227175#endif
    228176
    229 #endif // FORMAT_H
     177#endif // LIBTRACE_INT_H
Note: See TracChangeset for help on using the changeset viewer.