On Thu, May 30, 2002 at 02:18:19PM +0800, Iain McAleer wrote: > I'm having a few problems with a pcap callback function and I can't see what > is wrong with it! > > CC ERROR: > snoop.c:67: two or more data types in declaration of `process_packet'
... > snoop.c:182: conflicting types for `process_packet' > snoop.c:67: previous declaration of `process_packet' > > the relevant lines are as follows > > PROTOTYPE: > void process_packet(u_char *datav, const struct pcap_pkthdr* header, const > u_char *p); > > LOOP: > while(pcap_loop(fd, 0, (pcap_handler)process_packet, 0)); > > FUNCTION START: > void process_packet(u_char *datav, const struct pcap_pkthdr* header, const > u_char *p) { I suspect there's another line that's relevant. In fact, I suspect it's a line before line 67 of "snoop.c", and if it's not line 66 there are probably only blank lines between it and line 67 - there might be multiple tokens before that line that are interpreted as data types, as C code such as double float int main(int argc, char **argv); int main(int argc, char **argv) { return 0; } gets the errors % gcc -c bong.c bong.c:1: two or more data types in declaration of `main' bong.c:1: two or more data types in declaration of `main' bong.c:5: conflicting types for `main' bong.c:1: previous declaration of `main' so you probably have something like that. It might be a missing character (a missing semicolon, for example), or an error at the end of a header file included just before line 67, or something such as that. - This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe