Changeset 91db67b
- Timestamp:
- 04/24/06 18:42:43 (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:
- cee9e34
- Parents:
- 97c8d58
- Location:
- lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
r97c8d58 r91db67b 744 744 type=libtrace_to_erf_type(trace_get_link_type(packet)); 745 745 if (type==(char)-1) { 746 trace_set_err_out(libtrace,TRACE_ERR_ BAD_PACKET,746 trace_set_err_out(libtrace,TRACE_ERR_NO_CONVERSION, 747 747 "No erf type for packet"); 748 748 return -1; -
lib/format_pcap.c
re4e95499 r91db67b 175 175 return 0; 176 176 #else 177 trace_set_err_out(libtrace,TRACE_ERR_ NO_INIT_OUT,177 trace_set_err_out(libtrace,TRACE_ERR_UNSUPPORTED, 178 178 "writing not supported by this version of pcap"); 179 179 return -1; -
lib/format_pcapfile.c
r114b8d6 r91db67b 102 102 103 103 if (swapl(libtrace,DATA(libtrace)->header.magic_number) != 0xa1b2c3d4) { 104 trace_set_err(libtrace,TRACE_ERR_ BAD_PACKET,"Not a pcap tracefile\n");104 trace_set_err(libtrace,TRACE_ERR_INIT_FAILED,"Not a pcap tracefile\n"); 105 105 return -1; /* Not a pcap file */ 106 106 } … … 108 108 if (swaps(libtrace,DATA(libtrace)->header.version_major)!=2 109 109 && swaps(libtrace,DATA(libtrace)->header.version_minor)!=4) { 110 trace_set_err(libtrace,TRACE_ERR_ BAD_PACKET,"Unknown pcap tracefile version %d.%d\n",110 trace_set_err(libtrace,TRACE_ERR_INIT_FAILED,"Unknown pcap tracefile version %d.%d\n", 111 111 swaps(libtrace, 112 112 DATA(libtrace)->header.version_major), -
lib/format_rt.c
r671566a r91db67b 324 324 325 325 perror("recv"); 326 trace_set_err(libtrace, TRACE_ERR_RECV_FAILED,326 trace_set_err(libtrace, errno, 327 327 "Failed to read data into rt recv buffer"); 328 328 return -1; -
lib/libtrace.h
r12778c2 r91db67b 167 167 /** Enumeration of error codes */ 168 168 enum { 169 /** No Error has occured.... yet. */ 169 170 TRACE_ERR_NOERROR = 0, 171 /** The URI passed to trace_create() is unsupported, or badly formed */ 170 172 TRACE_ERR_BAD_FORMAT = -1, 171 TRACE_ERR_NO_INIT = -2, 172 TRACE_ERR_NO_INIT_OUT = -3, 173 TRACE_ERR_URI_LONG = -4, 174 TRACE_ERR_URI_NOCOLON = -5, 175 TRACE_ERR_INIT_FAILED = -6, 176 TRACE_ERR_UNKNOWN_OPTION= -7, 177 TRACE_ERR_NO_CONVERSION = -8, 178 TRACE_ERR_BAD_PACKET = -9, 179 TRACE_ERR_OPTION_UNAVAIL= -10, 180 TRACE_ERR_RECV_FAILED = -11 173 /** The trace failed to initialise */ 174 TRACE_ERR_INIT_FAILED = -2, 175 /** Unknown config option */ 176 TRACE_ERR_UNKNOWN_OPTION= -3, 177 /** Option known, but unsupported by this format */ 178 TRACE_ERR_OPTION_UNAVAIL= -6, 179 /** This output uri cannot write packets of this type */ 180 TRACE_ERR_NO_CONVERSION = -4, 181 /** This packet is corrupt, or unusable for the action required */ 182 TRACE_ERR_BAD_PACKET = -5, 183 /** This feature is unsupported */ 184 TRACE_ERR_UNSUPPORTED = -7 181 185 }; 182 186 … … 342 346 typedef struct libtrace_8021q 343 347 { 344 uint8_t ether_dhost[6]; /**< destination eth addr */345 uint8_t ether_shost[6]; /**< source ether addr */346 uint16_t ether_type; /**< packet type ID field , 0x8100 for VLAN */347 348 unsigned int vlan_pri:3; /**< vlan user priority */ 348 349 unsigned int vlan_cfi:1; /**< vlan format indicator, -
lib/trace.c
re4e95499 r91db67b 343 343 } 344 344 } else { 345 trace_set_err(libtrace,TRACE_ERR_ NO_INIT,345 trace_set_err(libtrace,TRACE_ERR_UNSUPPORTED, 346 346 "Format does not support input (%s)",scan); 347 347 return libtrace; … … 471 471 } 472 472 } else { 473 trace_set_err_out(libtrace,TRACE_ERR_ NO_INIT_OUT,473 trace_set_err_out(libtrace,TRACE_ERR_UNSUPPORTED, 474 474 "Format does not support writing (%s)",scan); 475 475 return libtrace; … … 682 682 } while(1); 683 683 } 684 trace_set_err(libtrace,TRACE_ERR_ BAD_FORMAT,"This format does not support reading packets\n");684 trace_set_err(libtrace,TRACE_ERR_UNSUPPORTED,"This format does not support reading packets\n"); 685 685 packet->size=-1; 686 686 return -1;
Note: See TracChangeset
for help on using the changeset viewer.