Changeset 91ea76c
- Timestamp:
- 05/28/12 14:07:07 (10 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:
- 16c598d
- Parents:
- b3edbe9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_helper.c
r3787331 r91ea76c 266 266 io_t *io=wandio_create(trace->uridata); 267 267 if (!io) { 268 trace_set_err(trace,errno,"Unable to open %s",trace->uridata); 268 if (errno != 0) { 269 trace_set_err(trace,errno,"Unable to open %s",trace->uridata); 270 } else { 271 trace_set_err(trace,TRACE_ERR_UNSUPPORTED_COMPRESS,"Unsupported compression error: %s", trace->uridata); 272 } 269 273 } 270 274 return io; -
lib/libtrace.h.in
rf440dc0 r91ea76c 226 226 TRACE_ERR_BAD_FILTER = -9, 227 227 /** RT communication breakdown */ 228 TRACE_ERR_RT_FAILURE = -10 228 TRACE_ERR_RT_FAILURE = -10, 229 /** Compression format unsupported */ 230 TRACE_ERR_UNSUPPORTED_COMPRESS = -11 229 231 }; 230 232 … … 744 746 LT_BITFIELD32 to_ds:1; /**< Packet to Distribution Service */ 745 747 #endif 748 746 749 uint16_t duration; /**< Duration value for NAV calculation */ 747 750 uint8_t mac1[6]; /**< MAC Address 1 */ -
libwandio/wandio.c
r60f3c4c r91ea76c 141 141 return NULL; 142 142 len = wandio_peek(io, buffer, sizeof(buffer)); 143 #if HAVE_LIBZ144 143 /* Auto detect gzip compressed data */ 145 144 if (len>=2 && buffer[0] == '\037' && buffer[1] == '\213') { 145 #if HAVE_LIBZ 146 146 DEBUG_PIPELINE("zlib"); 147 147 io = zlib_open(io); 148 #else 149 fprintf(stderr, "File %s is gzip compressed but libtrace has not been built with zlib support!\n", filename); 150 return NULL; 151 #endif 148 152 } 149 153 /* Auto detect compress(1) compressed data (gzip can read this) */ 150 154 if (len>=2 && buffer[0] == '\037' && buffer[1] == '\235') { 155 #if HAVE_LIBZ 151 156 DEBUG_PIPELINE("zlib"); 152 157 io = zlib_open(io); 153 } 154 #endif 155 #if HAVE_LIBBZ2 158 #else 159 fprintf(stderr, "File %s is compress(1) compressed but libtrace has not been built with zlib support!\n", filename); 160 return NULL; 161 #endif 162 } 163 156 164 /* Auto detect bzip compressed data */ 157 165 if (len>=3 && buffer[0] == 'B' && buffer[1] == 'Z' && buffer[2] == 'h') { 166 #if HAVE_LIBBZ2 158 167 DEBUG_PIPELINE("bzip"); 159 168 io = bz_open(io); 160 } 161 #endif 169 #else 170 fprintf(stderr, "File %s is bzip compressed but libtrace has not been built with bzip2 support!\n", filename); 171 return NULL; 172 #endif 173 } 162 174 163 175 /* Now open a threaded, peekable reader using the appropriate module … … 218 230 DLLEXPORT void wandio_destroy(io_t *io) 219 231 { 232 if (!io) 233 return; 234 220 235 if (keep_stats) 221 236 fprintf(stderr,"LIBTRACEIO STATS: %"PRIu64" blocks on read\n", read_waits);
Note: See TracChangeset
for help on using the changeset viewer.