Changeset ffc8c8d for lib/format_pcap.c
- Timestamp:
- 08/11/05 11:30:41 (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:
- 4d5a9a7
- Parents:
- a8ba977
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_pcap.c
r72bfe20 rffc8c8d 34 34 #include "libtrace_int.h" 35 35 #include "format_helper.h" 36 #include <inttypes.h> 36 37 #ifdef HAVE_INTTYPES_H 38 # include <inttypes.h> 39 #else 40 # error "Can't find inttypes.h - this needs to be fixed" 41 #endif 42 37 43 #include <sys/types.h> 38 44 #include <sys/stat.h> … … 114 120 } 115 121 } 116 fprintf(stderr, 117 "Unsupported scheme (%s) for format pcap\n", 118 CONNINFO.path); 119 return 0; 122 //fprintf(stderr, "Unsupported scheme (%s) for format pcap\n", 123 // CONNINFO.path); 124 return 1; 120 125 121 126 } … … 136 141 return 0; 137 142 } 138 143 return 1; 139 144 } 140 145 … … 153 158 154 159 packet->size = numbytes + sizeof(struct pcap_pkthdr); 155 156 } 160 } 161 157 162 static int pcap_read_packet(struct libtrace_t *libtrace, struct libtrace_packet_t *packet) { 158 163 const u_char *pcappkt; 159 164 int pcapbytes = 0; 160 165 161 while ((pcapbytes = pcap_dispatch(INPUT.pcap,166 pcapbytes = pcap_dispatch(INPUT.pcap, 162 167 1, /* number of packets */ 163 168 &trace_pcap_handler, 164 (u_char *)packet) ) == 0);165 166 if (pcapbytes < 0) {167 return -1;169 (u_char *)packet); 170 171 if (pcapbytes <= 0) { 172 return pcapbytes; 168 173 } 169 174 return (packet->size - sizeof(struct pcap_pkthdr));
Note: See TracChangeset
for help on using the changeset viewer.