From: Miek Gieben Date: Mon, 6 Mar 2006 13:57:09 +0000 (+0000) Subject: usage added X-Git-Tag: release-1.1.0~327 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc04452bc8e94a97f4123cc4dd213337637fcfab;p=thirdparty%2Fldns.git usage added --- diff --git a/examples/ldns-cat-pcap.c b/examples/ldns-cat-pcap.c index 271d1723..2efab9ba 100644 --- a/examples/ldns-cat-pcap.c +++ b/examples/ldns-cat-pcap.c @@ -10,16 +10,17 @@ #endif -/** - * general layout - * - * read in a pcap file (tcpdumped) - * walk over the packets, dump them when pcap_dump() - * send packet to nameserver, ldns_send_udp - * which can handle raw buffers - * wait for an reply - * also write this with pcap_dump - */ +void +usage(FILE *fp, char *progname) +{ + fprintf(fp, "%s: [-a IP] [-p PORT} PCAP_FILE\n\n"); + fprintf(fp, " -a IP\tuse IP as nameserver\n"); + fprintf(fp, " -p PORT\tuse POTR as port\n"); + fprintf(fp, " PCAP_FILE\tuse this file as source\n"); + fprintf(fp, " If no file is given standard output is read\n\n"); + fprintf(fp, " if no address is given 127.0.0.1 port 53 is user\n"); +} + u_char * pcap2ldns_pkt_ip(const u_char *packet, struct pcap_pkthdr *h)