Changeset ab4cb04 for lib/format_legacy.c
- Timestamp:
- 02/27/06 14:31:09 (15 years ago)
- 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:
- d5879cc
- Parents:
- afd0b73
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_legacy.c
rafd0b73 rab4cb04 75 75 static struct libtrace_format_t legacyatm; 76 76 77 #define INPUT libtrace->format_data->input 78 #define OUTPUT libtrace->format_data->output 77 #define DATA(x) ((struct legacy_format_data_t *)x->format_data) 78 79 #define INPUT DATA(libtrace)->input 79 80 #if HAVE_DAG 80 #define DAG libtrace->format_data->dag81 #define DAG DATA(libtrace)->dag 81 82 #endif 82 #define OPTIONS libtrace->format_data->options 83 struct libtrace_format_data_t { 84 union { 85 struct { 86 char *hostname; 87 short port; 88 } rt; 89 char *path; 90 } conn_info; 83 84 struct legacy_format_data_t { 91 85 union { 92 86 int fd; … … 100 94 }; 101 95 102 struct libtrace_format_data_out_t {103 union {104 struct {105 char *hostname;106 short port;107 } rt;108 char *path;109 } conn_info;110 };111 112 113 96 static int legacyeth_get_framing_length(const struct libtrace_packet_t *packet UNUSED) 114 97 { … … 128 111 static int erf_init_input(struct libtrace_t *libtrace) 129 112 { 130 libtrace->format_data = (struct libtrace_format_data_t *) 131 malloc(sizeof(struct libtrace_format_data_t)); 132 133 libtrace->format_data->input.file = trace_open_file(libtrace); 134 135 if (libtrace->format_data->input.file) 136 return 1; 113 libtrace->format_data = malloc(sizeof(struct legacy_format_data_t)); 137 114 138 115 return 0; 139 116 } 117 118 static int erf_start_input(libtrace_t *libtrace) 119 { 120 DATA(libtrace)->input.file = trace_open_file(libtrace); 121 122 if (DATA(libtrace)->input.file) 123 return 0; 124 125 return -1; 140 126 } 141 127 … … 258 244 erf_init_input, /* init_input */ 259 245 NULL, /* config_input */ 260 NULL,/* start_input */246 erf_start_input, /* start_input */ 261 247 NULL, /* pause_input */ 262 248 NULL, /* init_output */ … … 291 277 erf_init_input, /* init_input */ 292 278 NULL, /* config_input */ 293 NULL,/* start_input */279 erf_start_input, /* start_input */ 294 280 NULL, /* pause_input */ 295 281 NULL, /* init_output */ … … 324 310 erf_init_input, /* init_input */ 325 311 NULL, /* config_input */ 326 NULL,/* start_input */312 erf_start_input, /* start_input */ 327 313 NULL, /* pause_input */ 328 314 NULL, /* init_output */
Note: See TracChangeset
for help on using the changeset viewer.