Changeset 85a79b0 for lib/trace.c
- Timestamp:
- 08/25/06 15:47:43 (16 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:
- e283596
- Parents:
- e373992
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
r4dfa44e r85a79b0 637 637 free(packet->buffer); 638 638 } 639 packet->buf_control='\0'; /* an "bad" value to force an assert 640 * if this packet is ever reused 641 */ 639 packet->buf_control=(buf_control_t)'\0'; 640 /* an "bad" value to force an assert 641 * if this packet is ever reused 642 */ 642 643 free(packet); 643 644 } … … 685 686 } 686 687 trace_set_err(libtrace,TRACE_ERR_UNSUPPORTED,"This format does not support reading packets\n"); 687 packet->size= -1;688 return -1;688 packet->size=~0U; 689 return ~0U; 689 690 } 690 691 … … 832 833 return packet->trace->format->get_capture_length(packet); 833 834 } 834 return -1;835 return ~0U; 835 836 } 836 837 … … 850 851 return packet->trace->format->get_wire_length(packet); 851 852 } 852 return -1;853 return ~0U; 853 854 854 855 } … … 867 868 return packet->trace->format->get_framing_length(packet); 868 869 } 869 return -1;870 return ~0U; 870 871 } 871 872 … … 975 976 return -1; 976 977 } 977 if (libtrace_to_pcap_dlt(linktype) == ~0U) {978 if (libtrace_to_pcap_dlt(linktype) == -1) { 978 979 trace_set_err(packet->trace,TRACE_ERR_BAD_PACKET, 979 980 "Unknown pcap equivilent linktype"); … … 1024 1025 1025 1026 assert(filter->flag); 1026 return bpf_filter(filter->filter.bf_insns, linkptr, clen,clen);1027 return bpf_filter(filter->filter.bf_insns,(u_char*)linkptr,clen,clen); 1027 1028 #else 1028 1029 fprintf(stderr,"This version of libtrace does not have bpf filter support\n"); … … 1044 1045 return packet->trace->format->set_direction(packet,direction); 1045 1046 } 1046 return -1;1047 return (libtrace_direction_t)~0U; 1047 1048 } 1048 1049 … … 1063 1064 return packet->trace->format->get_direction(packet); 1064 1065 } 1065 return -1;1066 return (libtrace_direction_t)~0U; 1066 1067 } 1067 1068 … … 1079 1080 * @param dest the TCP or UDP destination port 1080 1081 * @returns a hint as to which port is the server port 1081 * @author Daniel Lawson 1082 */ 1083 DLLEXPORT int8_t trace_get_server_port(uint8_t protocol UNUSED, uint16_t source, uint16_t dest) { 1082 */ 1083 DLLEXPORT int8_t trace_get_server_port(UNUSED uint8_t protocol, 1084 uint16_t source, uint16_t dest) 1085 { 1084 1086 /* 1085 1087 * * If the ports are equal, return DEST … … 1203 1205 } 1204 1206 1205 return -1;1207 return ~0U; 1206 1208 } 1207 1209
Note: See TracChangeset
for help on using the changeset viewer.