Date: Mon, 19 Nov 2012 15:24:20 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243281 - stable/9/tools/tools/netmap Message-ID: <201211191524.qAJFOKjN082890@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Mon Nov 19 15:24:19 2012 New Revision: 243281 URL: http://svnweb.freebsd.org/changeset/base/243281 Log: MFC r237729: Fix ioctl type for compiling with clang MFC r241169: Clean up compiler warnings. MFC r241464: Make local function static. Sponsored by: ADARA Networks Modified: stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pcap.c Directory Properties: stable/9/tools/tools/netmap/ (props changed) Modified: stable/9/tools/tools/netmap/bridge.c ============================================================================== --- stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:24:19 2012 (r243281) @@ -79,7 +79,7 @@ sigint_h(__unused int sig) static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -98,7 +98,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl error %d", what); + D("ioctl error 0x%lx", what); return error; } switch (what) { Modified: stable/9/tools/tools/netmap/pcap.c ============================================================================== --- stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:24:19 2012 (r243281) @@ -38,7 +38,7 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) -char *version = "$Id$"; +const char *version = "$Id$"; int verbose = 0; /* debug support */ @@ -49,7 +49,7 @@ int verbose = 0; __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) -inline void prefetch (const void *x) +static inline void prefetch (const void *x) { __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } @@ -135,13 +135,12 @@ typedef enum { PCAP_D_OUT } pcap_direction_t; +struct bpf_program; typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes); -char errbuf[PCAP_ERRBUF_SIZE]; - pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf); @@ -155,6 +154,24 @@ char *pcap_lookupdev(char *errbuf); int pcap_inject(pcap_t *p, const void *buf, size_t size); int pcap_fileno(pcap_t *p); const char *pcap_lib_version(void); +void pcap_freealldevs(pcap_if_t *); +pcap_t *pcap_create(const char *, char *); +int pcap_activate(pcap_t *); +int pcap_can_set_rfmon(pcap_t *); +int pcap_set_snaplen(pcap_t *, int); +int pcap_snapshot(pcap_t *); +int pcap_lookupnet(const char *, uint32_t *, uint32_t *, char *); +int pcap_set_promisc(pcap_t *, int); +int pcap_set_timeout(pcap_t *, int); +int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, + uint32_t); +int pcap_setfilter(pcap_t *, struct bpf_program *); +int pcap_datalink(pcap_t *); +const char *pcap_datalink_val_to_name(int); +const char *pcap_datalink_val_to_description(int); +int pcap_stats(pcap_t *, struct pcap_stat *); +int pcap_loop(pcap_t *, int, pcap_handler, u_char *); +char *pcap_geterr(pcap_t *); struct eproto { @@ -201,7 +218,7 @@ struct my_ring { static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -221,7 +238,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl 0x%x error %d", what, error); + D("ioctl 0x%lx error %d", what, error); return error; } switch (what) { @@ -739,7 +756,8 @@ pcap_loop(pcap_t *p, int cnt, pcap_handl #endif /* __PIC__ */ #ifndef __PIC__ -void do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) +static void +do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) { pcap_inject((pcap_t *)user, buf, h->caplen); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211191524.qAJFOKjN082890>