]> The Tcpdump Group git mirrors - libpcap/commitdiff
Rename the "private" member of a pcap_t to avoid C++ issues.
authorGuy Harris <[email protected]>
Wed, 7 Aug 2013 17:23:05 +0000 (10:23 -0700)
committerGuy Harris <[email protected]>
Wed, 7 Aug 2013 17:23:05 +0000 (10:23 -0700)
"private" is a C++ keyword; rename the "private" member of a pcap_t to
"priv" to avoid that, as per Gisle Vanem's suggestion.

24 files changed:
dlpisubs.c
pcap-bpf.c
pcap-bt-linux.c
pcap-can-linux.c
pcap-canusb-linux.c
pcap-dag.c
pcap-dbus.c
pcap-dlpi.c
pcap-dos.c
pcap-int.h
pcap-libdlpi.c
pcap-linux.c
pcap-netfilter-linux.c
pcap-nit.c
pcap-pf.c
pcap-septel.c
pcap-snf.c
pcap-snit.c
pcap-snoop.c
pcap-usb-linux.c
pcap-win32.c
pcap.c
sf-pcap-ng.c
sf-pcap.c

index b3b8fb1de55addd10f28ef6e59b1a7de6688aac2..5f1a9bfc5f75083027946634aa8a4fc4bc9ab395 100644 (file)
@@ -83,7 +83,7 @@ static void pcap_stream_err(const char *, int, char *);
 int
 pcap_stats_dlpi(pcap_t *p, struct pcap_stat *ps)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
 
        /*
         * "ps_recv" counts packets handed to the filter, not packets
@@ -125,7 +125,7 @@ int
 pcap_process_pkts(pcap_t *p, pcap_handler callback, u_char *user,
        int count, u_char *bufp, int len)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
        int n, caplen, origlen;
        u_char *ep, *pk;
        struct pcap_pkthdr pkthdr;
index 61cfbd7d84c0fcda4d6e989d3944898ea3ad132c..bc37639ebd07a9c449f7c535e99c777906a7c4b0 100644 (file)
@@ -241,7 +241,7 @@ static int
 pcap_getnonblock_bpf(pcap_t *p, char *errbuf)
 { 
 #ifdef HAVE_ZEROCOPY_BPF
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
 
        if (pb->zerocopy)
                return (pb->nonblock);
@@ -253,7 +253,7 @@ static int
 pcap_setnonblock_bpf(pcap_t *p, int nonblock, char *errbuf)
 {   
 #ifdef HAVE_ZEROCOPY_BPF
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
 
        if (pb->zerocopy) {
                pb->nonblock = nonblock;
@@ -276,7 +276,7 @@ pcap_setnonblock_bpf(pcap_t *p, int nonblock, char *errbuf)
 static int
 pcap_next_zbuf_shm(pcap_t *p, int *cc)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
        struct bpf_zbuf_header *bzh;
 
        if (pb->zbuffer == pb->zbuf2 || pb->zbuffer == NULL) {
@@ -314,7 +314,7 @@ pcap_next_zbuf_shm(pcap_t *p, int *cc)
 static int
 pcap_next_zbuf(pcap_t *p, int *cc)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
        struct bpf_zbuf bz;
        struct timeval tv;
        struct timespec cur;
@@ -412,7 +412,7 @@ pcap_next_zbuf(pcap_t *p, int *cc)
 static int
 pcap_ack_zbuf(pcap_t *p)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
 
        atomic_store_rel_int(&pb->bzh->bzh_user_gen,
            pb->bzh->bzh_kernel_gen);
@@ -823,7 +823,7 @@ pcap_stats_bpf(pcap_t *p, struct pcap_stat *ps)
 static int
 pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
        int cc;
        int n = 0;
        register u_char *bp, *ep;
@@ -1274,7 +1274,7 @@ bpf_load(char *errbuf)
 static void
 pcap_cleanup_bpf(pcap_t *p)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
 #ifdef HAVE_BSD_IEEE80211
        int sock;
        struct ifmediareq req;
@@ -1478,7 +1478,7 @@ check_setif_failure(pcap_t *p, int error)
 static int
 pcap_activate_bpf(pcap_t *p)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
        int status = 0;
        int fd;
 #ifdef LIFNAMSIZ
@@ -2291,7 +2291,7 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
 static int
 monitor_mode(pcap_t *p, int set)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
        int sock;
        struct ifmediareq req;
        int *media_list;
@@ -2606,7 +2606,7 @@ remove_802_11(pcap_t *p)
 static int
 pcap_setfilter_bpf(pcap_t *p, struct bpf_program *fp)
 {
-       struct pcap_bpf *pb = p->private;
+       struct pcap_bpf *pb = p->priv;
 
        /*
         * Free any user-mode filter we might happen to have installed.
index e2268b8e9bae8e68f9b268db4019279e725c492d..d84e3c7a2778767480fc039fbe767ae292852101 100644 (file)
@@ -187,7 +187,7 @@ bt_create(const char *device, char *ebuf, int *is_ours)
 static int
 bt_activate(pcap_t* handle)
 {
-       struct pcap_bt *handlep = handle->private;
+       struct pcap_bt *handlep = handle->priv;
        struct sockaddr_hci addr;
        int opt;
        int             dev_id;
@@ -382,7 +382,7 @@ bt_inject_linux(pcap_t *handle, const void *buf, size_t size)
 static int 
 bt_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_bt *handlep = handle->private;
+       struct pcap_bt *handlep = handle->priv;
        int ret;
        struct hci_dev_info dev_info;
        struct hci_dev_stats * s = &dev_info.stat;
index bee669b03eb26833618bc4d2e5a2df4e4aee26af..80fa41ccf148ac9a04d68836a0468c167afc8534 100644 (file)
@@ -143,7 +143,7 @@ can_create(const char *device, char *ebuf, int *is_ours)
 static int
 can_activate(pcap_t* handle)
 {
-       struct pcap_can *handlep = handle->private;
+       struct pcap_can *handlep = handle->priv;
        struct sockaddr_can addr;
        struct ifreq ifr;
 
index b04e8b6d0cfc74bbb1fa6ac481ce7e8f0322d5e5..a72f4697fa4d7a0972cc9ba56b973fd8b42220e1 100644 (file)
@@ -242,7 +242,7 @@ canusb_create(const char *device, char *ebuf, int *is_ours)
     if (p == NULL)
         return (NULL);
 
-    canusb = p->private;
+    canusb = p->priv;
     canusb->ctx = NULL;
     canusb->dev = NULL;
     canusb->rdpipe = -1;
@@ -317,7 +317,7 @@ static void canusb_clearbufs(struct pcap_canusb* this)
 
 static void canusb_close(pcap_t* handle)
 {
-    struct pcap_canusb *canusb = handle->private;
+    struct pcap_canusb *canusb = handle->priv;
 
     canusb->loop = 0;
     pthread_join(canusb->worker, NULL);
@@ -338,7 +338,7 @@ static void canusb_close(pcap_t* handle)
 
 static int canusb_activate(pcap_t* handle)
 {
-    struct pcap_canusb *canusb = handle->private;
+    struct pcap_canusb *canusb = handle->priv;
     char *serial;
 
     if (libusb_init(&canusb->ctx) != 0) {
index f101c8bb4e300a9b85629a31e460d03359f3938d..0d9fc7572906f4c29bb29500f5fcb1c82f9ae3c9 100644 (file)
@@ -148,7 +148,7 @@ dag_platform_cleanup(pcap_t *p)
        struct pcap_dag *pd;
 
        if (p != NULL) {
-               pd = p->private;
+               pd = p->priv;
 #ifdef HAVE_DAG_STREAMS_API
                if(dag_stop_stream(p->fd, pd->dag_stream) < 0)
                        fprintf(stderr,"dag_stop_stream: %s\n", strerror(errno));
@@ -245,7 +245,7 @@ dag_erf_ext_header_count(uint8_t * erf, size_t len)
 static int
 dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_dag *pd = p->private;
+       struct pcap_dag *pd = p->priv;
        unsigned int processed = 0;
        int flags = pd->dag_offset_flags;
        unsigned int nonblocking = flags & DAGF_NONBLOCK;
@@ -608,7 +608,7 @@ dag_inject(pcap_t *p, const void *buf _U_, size_t size _U_)
  */
 static int dag_activate(pcap_t* handle)
 {
-       struct pcap_dag *handlep = handle->private;
+       struct pcap_dag *handlep = handle->priv;
 #if 0
        char conf[30]; /* dag configure string */
 #endif
@@ -908,7 +908,7 @@ pcap_t *dag_create(const char *device, char *ebuf, int *is_ours)
 
 static int
 dag_stats(pcap_t *p, struct pcap_stat *ps) {
-       struct pcap_dag *pd = p->private;
+       struct pcap_dag *pd = p->priv;
 
        /* This needs to be filled out correctly.  Hopefully a dagapi call will
                 provide all necessary information.
@@ -1020,7 +1020,7 @@ dag_set_datalink(pcap_t *p, int dlt)
 static int
 dag_setnonblock(pcap_t *p, int nonblock, char *errbuf)
 {
-       struct pcap_dag *pd = p->private;
+       struct pcap_dag *pd = p->priv;
 
        /*
         * Set non-blocking mode on the FD.
@@ -1069,7 +1069,7 @@ dag_setnonblock(pcap_t *p, int nonblock, char *errbuf)
 static int
 dag_get_datalink(pcap_t *p)
 {
-       struct pcap_dag *pd = p->private;
+       struct pcap_dag *pd = p->priv;
        int index=0, dlt_index=0;
        uint8_t types[255];
 
index 3a54d444b35ac4e036dd3ad095931fed64c36256..eb856355857ee585f7ddea3d2af0a63c5d64ec37 100644 (file)
@@ -53,7 +53,7 @@ struct pcap_dbus {
 static int
 dbus_read(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
 {
-       struct pcap_dbus *handlep = handle->private;
+       struct pcap_dbus *handlep = handle->priv;
 
        struct pcap_pkthdr pkth;
        DBusMessage *message;
@@ -106,7 +106,7 @@ static int
 dbus_write(pcap_t *handle, const void *buf, size_t size)
 {
        /* XXX, not tested */
-       struct pcap_dbus *handlep = handle->private;
+       struct pcap_dbus *handlep = handle->priv;
 
        DBusError error = DBUS_ERROR_INIT;
        DBusMessage *msg;
@@ -127,7 +127,7 @@ dbus_write(pcap_t *handle, const void *buf, size_t size)
 static int
 dbus_stats(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_dbus *handlep = handle->private;
+       struct pcap_dbus *handlep = handle->priv;
 
        stats->ps_recv = handlep->packets_read;
        stats->ps_drop = 0;
@@ -138,7 +138,7 @@ dbus_stats(pcap_t *handle, struct pcap_stat *stats)
 static void
 dbus_cleanup(pcap_t *handle)
 {
-       struct pcap_dbus *handlep = handle->private;
+       struct pcap_dbus *handlep = handle->priv;
 
        dbus_connection_unref(handlep->conn);
 
@@ -159,7 +159,7 @@ dbus_activate(pcap_t *handle)
 
        #define N_RULES sizeof(rules)/sizeof(rules[0])
 
-       struct pcap_dbus *handlep = handle->private;
+       struct pcap_dbus *handlep = handle->priv;
        const char *dev = handle->opt.source;
 
        DBusError error = DBUS_ERROR_INIT;
index f11620a90402f1dab1a2b9a06c516d7c56f94652..899313434df57e6abd188b1af0dab67cc8bc000e 100644 (file)
@@ -246,7 +246,7 @@ static int
 pcap_inject_dlpi(pcap_t *p, const void *buf, size_t size)
 {
 #ifdef DL_HP_RAWDLS
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
 #endif
        int ret;
 
@@ -325,7 +325,7 @@ static void
 pcap_cleanup_dlpi(pcap_t *p)
 {
 #ifdef DL_HP_RAWDLS
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
 
        if (pd->send_fd >= 0) {
                close(pd->send_fd);
@@ -339,7 +339,7 @@ static int
 pcap_activate_dlpi(pcap_t *p)
 {
 #ifdef DL_HP_RAWDLS
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
 #endif
        register char *cp;
        int ppa;
@@ -1715,7 +1715,7 @@ pcap_create_interface(const char *device, char *ebuf)
                return (NULL);
 
 #ifdef DL_HP_RAWDLS
-       pd = p->private;
+       pd = p->priv;
        pd->send_fd = -1;       /* it hasn't been opened yet */
 #endif
 
index 3c24758e15a4da747226d789856d2f97523c55d6..15a9a6803b941e8a95510139a69ff2dd6c5842c5 100644 (file)
@@ -169,7 +169,7 @@ pcap_t *pcap_create_interface (const char *device, char *ebuf)
  */
 static int pcap_activate_dos (pcap_t *pcap)
 { 
-  struct pcap_dos *pcapd = pcap->private;
+  struct pcap_dos *pcapd = pcap->priv;
 
   if (pcap->opt.rfmon) {
     /*
@@ -220,7 +220,7 @@ static int pcap_activate_dos (pcap_t *pcap)
 static int
 pcap_read_one (pcap_t *p, pcap_handler callback, u_char *data)
 {
-  struct pcap_dos *pd = p->private;
+  struct pcap_dos *pd = p->priv;
   struct pcap_pkthdr pcap;
   struct timeval     now, expiry = { 0,0 };
   BYTE  *rx_buf;
@@ -332,7 +332,7 @@ pcap_read_one (pcap_t *p, pcap_handler callback, u_char *data)
 static int
 pcap_read_dos (pcap_t *p, int cnt, pcap_handler callback, u_char *data)
 {
-  struct pcap_dos *pd = p->private;
+  struct pcap_dos *pd = p->priv;
   int rc, num = 0;
 
   while (num <= cnt || (cnt < 0))
@@ -372,7 +372,7 @@ static int pcap_stats_dos (pcap_t *p, struct pcap_stat *ps)
 
   FLUSHK();
 
-  pd = p->private;
+  pd = p->priv;
   pd->stat.ps_recv   = stats->rx_packets;
   pd->stat.ps_drop  += stats->rx_missed_errors;
   pd->stat.ps_ifdrop = stats->rx_dropped +  /* queue full */
@@ -446,7 +446,7 @@ static void pcap_cleanup_dos (pcap_t *p)
 
   if (p && !exc_occured)
   {
-    pd = p->private;
+    pd = p->priv;
     if (pcap_stats(p,NULL) < 0)
        pd->stat.ps_drop = 0;
     if (!get_device(p->fd))
@@ -610,7 +610,7 @@ void pcap_set_wait (pcap_t *p, void (*yield)(void), int wait)
   struct pcap_dos *pd;
   if (p)
   {
-    pd                   = p->private;
+    pd                   = p->priv;
     pd->wait_proc        = yield;
     p->opt.timeout        = wait;
   }
index 585619f1a7e6572aa2444d7b12af93bd5a37c8bf..08bbcc3d8414c9fdb5c7f16b7164d18ca3078dd2 100644 (file)
@@ -147,7 +147,7 @@ struct pcap {
 
        int break_loop;         /* flag set to force break from packet-reading loop */
 
-       void *private;          /* private data for methods */
+       void *priv;             /* private data for methods */
 
        int swapped;
        FILE *rfile;            /* null if live capture, non-null if savefile */
index e5da8c6bac102abbd645c176fab3f8ade31d3b9c..5bc9374aba909c085d56cdaaf43a85147ad65ac7 100644 (file)
@@ -100,7 +100,7 @@ list_interfaces(const char *linkname, void *arg)
 static int
 pcap_activate_libdlpi(pcap_t *p)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
        int retv;
        dlpi_handle_t dh;
        dlpi_info_t dlinfo;
@@ -235,7 +235,7 @@ bad:
 static int
 dlpromiscon(pcap_t *p, bpf_u_int32 level)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
        int retv;
        int err;
 
@@ -301,7 +301,7 @@ done:
 static int
 pcap_read_libdlpi(pcap_t *p, int count, pcap_handler callback, u_char *user)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
        int len;
        u_char *bufp;
        size_t msglen;
@@ -353,7 +353,7 @@ process_pkts:
 static int
 pcap_inject_libdlpi(pcap_t *p, const void *buf, size_t size)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
        int retv;
 
        retv = dlpi_send(pd->dlpi_hd, NULL, 0, buf, size, NULL);
@@ -376,7 +376,7 @@ pcap_inject_libdlpi(pcap_t *p, const void *buf, size_t size)
 static void
 pcap_cleanup_libdlpi(pcap_t *p)
 {
-       struct pcap_dlpi *pd = p->private;
+       struct pcap_dlpi *pd = p->priv;
 
        if (pd->dlpi_hd != NULL) {
                dlpi_close(pd->dlpi_hd);
index 7c14821a0475b62ec185c1df61ce2780c1bbbcb9..8b82ca78ad7d90ac88a7459bfa868de0313eb5f2 100644 (file)
@@ -767,7 +767,7 @@ nla_put_failure:
 static int
 enter_rfmon_mode_mac80211(pcap_t *handle, int sock_fd, const char *device)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int ret;
        char phydev_path[PATH_MAX+1];
        struct nl80211_state nlstate;
@@ -1049,7 +1049,7 @@ linux_if_drops(const char * if_name)
 
 static void    pcap_cleanup_linux( pcap_t *handle )
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        struct ifreq    ifr;
 #ifdef HAVE_LIBNL
        struct nl80211_state nlstate;
@@ -1214,7 +1214,7 @@ static void       pcap_cleanup_linux( pcap_t *handle )
 static int
 pcap_activate_linux(pcap_t *handle)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        const char      *device;
        int             status = 0;
 
@@ -1398,7 +1398,7 @@ pcap_set_datalink_linux(pcap_t *handle, int dlt)
 static inline int
 linux_check_direction(const pcap_t *handle, const struct sockaddr_ll *sll)
 {
-       struct pcap_linux       *handlep = handle->private;
+       struct pcap_linux       *handlep = handle->priv;
 
        if (sll->sll_pkttype == PACKET_OUTGOING) {
                /*
@@ -1434,7 +1434,7 @@ linux_check_direction(const pcap_t *handle, const struct sockaddr_ll *sll)
 static int
 pcap_read_packet(pcap_t *handle, pcap_handler callback, u_char *userdata)
 {
-       struct pcap_linux       *handlep = handle->private;
+       struct pcap_linux       *handlep = handle->priv;
        u_char                  *bp;
        int                     offset;
 #ifdef HAVE_PF_PACKET_SOCKETS
@@ -1770,7 +1770,7 @@ pcap_read_packet(pcap_t *handle, pcap_handler callback, u_char *userdata)
 static int
 pcap_inject_linux(pcap_t *handle, const void *buf, size_t size)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int ret;
 
 #ifdef HAVE_PF_PACKET_SOCKETS
@@ -1822,7 +1822,7 @@ pcap_inject_linux(pcap_t *handle, const void *buf, size_t size)
 static int
 pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 #ifdef HAVE_TPACKET_STATS
        struct tpacket_stats kstats;
        socklen_t len = sizeof (struct tpacket_stats);
@@ -2337,7 +2337,7 @@ pcap_setfilter_linux_common(pcap_t *handle, struct bpf_program *filter,
                return -1;
        }
 
-       handlep = handle->private;
+       handlep = handle->priv;
 
        /* Make our private copy of the filter */
 
@@ -2495,7 +2495,7 @@ static int
 pcap_setdirection_linux(pcap_t *handle, pcap_direction_t d)
 {
 #ifdef HAVE_PF_PACKET_SOCKETS
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 
        if (!handlep->sock_packet) {
                handle->direction = d;
@@ -2953,7 +2953,7 @@ static int
 activate_new(pcap_t *handle)
 {
 #ifdef HAVE_PF_PACKET_SOCKETS
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        const char              *device = handle->opt.source;
        int                     is_any_device = (strcmp(device, "any") == 0);
        int                     sock_fd = -1, arptype;
@@ -3311,7 +3311,7 @@ activate_new(pcap_t *handle)
 static int 
 activate_mmap(pcap_t *handle, int *status)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int ret;
 
        /*
@@ -3390,7 +3390,7 @@ activate_mmap(pcap_t *handle _U_, int *status _U_)
 static int
 prepare_tpacket_socket(pcap_t *handle)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 #ifdef HAVE_TPACKET2
        socklen_t len;
        int val;
@@ -3454,7 +3454,7 @@ prepare_tpacket_socket(pcap_t *handle)
 static int
 create_ring(pcap_t *handle, int *status)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        unsigned i, j, frames_per_block;
        struct tpacket_req req;
        socklen_t len;
@@ -3773,7 +3773,7 @@ retry:
 static void
 destroy_ring(pcap_t *handle)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 
        /* tell the kernel to destroy the ring*/
        struct tpacket_req req;
@@ -3812,7 +3812,7 @@ pcap_oneshot_mmap(u_char *user, const struct pcap_pkthdr *h,
 {
        struct oneshot_userdata *sp = (struct oneshot_userdata *)user;
        pcap_t *handle = sp->pd;
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 
        *sp->hdr = *h;
        memcpy(handlep->oneshot_buffer, bytes, h->caplen);
@@ -3822,7 +3822,7 @@ pcap_oneshot_mmap(u_char *user, const struct pcap_pkthdr *h,
 static void
 pcap_cleanup_linux_mmap( pcap_t *handle )
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
 
        destroy_ring(handle);
        if (handlep->oneshot_buffer != NULL) {
@@ -3836,7 +3836,7 @@ pcap_cleanup_linux_mmap( pcap_t *handle )
 static int
 pcap_getnonblock_mmap(pcap_t *p, char *errbuf)
 {
-       struct pcap_linux *handlep = p->private;
+       struct pcap_linux *handlep = p->priv;
 
        /* use negative value of timeout to indicate non blocking ops */
        return (handlep->timeout<0);
@@ -3845,7 +3845,7 @@ pcap_getnonblock_mmap(pcap_t *p, char *errbuf)
 static int
 pcap_setnonblock_mmap(pcap_t *p, int nonblock, char *errbuf)
 {
-       struct pcap_linux *handlep = p->private;
+       struct pcap_linux *handlep = p->priv;
 
        /*
         * Map each value to their corresponding negation to
@@ -3870,7 +3870,7 @@ pcap_setnonblock_mmap(pcap_t *p, int nonblock, char *errbuf)
 static inline union thdr *
 pcap_get_ring_frame(pcap_t *handle, int status)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        union thdr h;
 
        h.raw = RING_GET_FRAME(handle);
@@ -3899,7 +3899,7 @@ static int
 pcap_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, 
                u_char *user)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int timeout;
        int pkts = 0;
        char c;
@@ -4173,7 +4173,7 @@ skip:
 static int 
 pcap_setfilter_linux_mmap(pcap_t *handle, struct bpf_program *filter)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int n, offset;
        int ret;
 
@@ -4410,7 +4410,7 @@ enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
         * value of -ENFILE.  (Return values are negative errnos.)  We
         * could probably use that to find an unused device.
         */
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int err;
        struct iwreq ireq;
        struct iw_priv_args *priv;
@@ -5128,7 +5128,7 @@ iface_get_offload(pcap_t *handle _U_)
 static int
 activate_old(pcap_t *handle)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        int             arptype;
        struct ifreq    ifr;
        const char      *device = handle->opt.source;
@@ -5411,7 +5411,7 @@ iface_get_arptype(int fd, const char *device, char *ebuf)
 static int
 fix_program(pcap_t *handle, struct sock_fprog *fcode, int is_mmapped)
 {
-       struct pcap_linux *handlep = handle->private;
+       struct pcap_linux *handlep = handle->priv;
        size_t prog_size;
        register int i;
        register struct bpf_insn *p;
index 35c677bc679eec086e86df9c4c2a9fefcd8ee1f4..30719d1bf589bf7793592a21ba18f81d46e39f11 100644 (file)
@@ -86,7 +86,7 @@ static int nfqueue_send_verdict(const pcap_t *handle, u_int16_t group_id, u_int3
 static int
 netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
 {
-       struct pcap_netfilter *handlep = handle->private;
+       struct pcap_netfilter *handlep = handle->priv;
        const unsigned char *buf;
        int count = 0;
        int len;
@@ -219,7 +219,7 @@ netfilter_set_datalink(pcap_t *handle, int dlt)
 static int
 netfilter_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_netfilter *handlep = handle->private;
+       struct pcap_netfilter *handlep = handle->priv;
 
        stats->ps_recv = handlep->packets_read;
        stats->ps_drop = 0;
index 5610b2931b1d3f2c337fdd300289dd40735ba5a9..60521a43adcb744eb8ba9a9266f98a70c004ab46 100644 (file)
@@ -81,7 +81,7 @@ struct pcap_nit {
 static int
 pcap_stats_nit(pcap_t *p, struct pcap_stat *ps)
 {
-       struct pcap_nit *pn = p->private;
+       struct pcap_nit *pn = p->priv;
 
        /*
         * "ps_recv" counts packets handed to the filter, not packets
@@ -106,7 +106,7 @@ pcap_stats_nit(pcap_t *p, struct pcap_stat *ps)
 static int
 pcap_read_nit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_nit *pn = p->private;
+       struct pcap_nit *pn = p->priv;
        register int cc, n;
        register u_char *bp, *cp, *ep;
        register struct nit_hdr *nh;
index 5eb36087a3d30f06f0a3aed1d63182cf82d305ac..9a79bdf5f48e51be6472cbfb7343d5f674003c4b 100644 (file)
--- a/pcap-pf.c
+++ b/pcap-pf.c
@@ -105,7 +105,7 @@ static int pcap_setfilter_pf(pcap_t *, struct bpf_program *);
 static int
 pcap_read_pf(pcap_t *pc, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_pf *pf = pc->private;
+       struct pcap_pf *pf = pc->priv;
        register u_char *p, *bp;
        register int cc, n, buflen, inc;
        register struct enstamp *sp;
@@ -247,7 +247,7 @@ pcap_inject_pf(pcap_t *p, const void *buf, size_t size)
 static int
 pcap_stats_pf(pcap_t *p, struct pcap_stat *ps)
 {
-       struct pcap_pf *pf = p->private;
+       struct pcap_pf *pf = p->priv;
 
        /*
         * If packet filtering is being done in the kernel:
@@ -302,7 +302,7 @@ pcap_stats_pf(pcap_t *p, struct pcap_stat *ps)
 static int
 pcap_activate_pf(pcap_t *p)
 {
-       struct pcap_pf *pf = p->private;
+       struct pcap_pf *pf = p->priv;
        short enmode;
        int backlog = -1;       /* request the most */
        struct enfilter Filter;
@@ -529,7 +529,7 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
 static int
 pcap_setfilter_pf(pcap_t *p, struct bpf_program *fp)
 {
-       struct pcap_pf *pf = p->private;
+       struct pcap_pf *pf = p->priv;
        struct bpf_version bv;
 
        /*
index 1210b7ce24128909dd1a301c5817b91349a537fb..4ca7a6056191b35dcd79881dd1b9a13bb44f98a3 100644 (file)
@@ -64,7 +64,7 @@ struct pcap_septel {
  */
 static int septel_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user) {
 
-  struct pcap_septel *ps = p->private;
+  struct pcap_septel *ps = p->priv;
   HDR *h;
   MSG *m;
   int processed = 0 ;
@@ -246,7 +246,7 @@ pcap_t *septel_create(const char *device, char *ebuf, int *is_ours) {
 }
 
 static int septel_stats(pcap_t *p, struct pcap_stat *ps) {
-  struct pcap_septel *handlep = p->private;
+  struct pcap_septel *handlep = p->priv;
   /*handlep->stat.ps_recv = 0;*/
   /*handlep->stat.ps_drop = 0;*/
   
index 6d215ea146078d749df451e7df1756ae46abef23..3709d01cd052574382235d42b79e42ecf37ef267 100644 (file)
@@ -57,7 +57,7 @@ snf_pcap_stats(pcap_t *p, struct pcap_stat *ps)
 static void
 snf_platform_cleanup(pcap_t *p)
 {
-       struct pcap_snf *ps = p->private;
+       struct pcap_snf *ps = p->priv;
 
        if (p == NULL)
                return;
@@ -70,7 +70,7 @@ snf_platform_cleanup(pcap_t *p)
 static int
 snf_getnonblock(pcap_t *p, char *errbuf)
 {
-       struct pcap_snf *ps = p->private;
+       struct pcap_snf *ps = p->priv;
 
        return (ps->snf_timeout == 0);
 }
@@ -78,7 +78,7 @@ snf_getnonblock(pcap_t *p, char *errbuf)
 static int
 snf_setnonblock(pcap_t *p, int nonblock, char *errbuf)
 {
-       struct pcap_snf *ps = p->private;
+       struct pcap_snf *ps = p->priv;
 
        if (nonblock)
                ps->snf_timeout = 0;
@@ -109,7 +109,7 @@ snf_timestamp_to_timeval(const int64_t ts_nanosec)
 static int
 snf_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_snf *ps = p->private;
+       struct pcap_snf *ps = p->priv;
        struct pcap_pkthdr hdr;
        int i, flags, err, caplen, n;
        struct snf_recv_req req;
@@ -191,7 +191,7 @@ snf_inject(pcap_t *p, const void *buf _U_, size_t size _U_)
 static int
 snf_activate(pcap_t* p)
 {
-       struct pcap_snf *ps = p->private;
+       struct pcap_snf *ps = p->priv;
        char *device = p->opt.source;
        const char *nr = NULL;
        int err;
@@ -322,7 +322,7 @@ snf_create(const char *device, char *ebuf, int *is_ours)
        p = pcap_create_common(device, ebuf, sizeof (struct pcap_snf));
        if (p == NULL)
                return NULL;
-       ps = p->private;
+       ps = p->priv;
 
        p->activate_op = snf_activate;
        ps->snf_boardnum = boardnum;
index 7ff41599a192e325eb983e10147913d7fba91333..08c587252c311a5f1b3935fa811933a2eeab89a4 100644 (file)
@@ -94,7 +94,7 @@ struct pcap_snit {
 static int
 pcap_stats_snit(pcap_t *p, struct pcap_stat *ps)
 {
-       struct pcap_snit *psn = p->private;
+       struct pcap_snit *psn = p->priv;
 
        /*
         * "ps_recv" counts packets handed to the filter, not packets
@@ -120,7 +120,7 @@ pcap_stats_snit(pcap_t *p, struct pcap_stat *ps)
 static int
 pcap_read_snit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_snit *psn = p->private;
+       struct pcap_snit *psn = p->priv;
        register int cc, n;
        register u_char *bp, *cp, *ep;
        register struct nit_bufhdr *hdrp;
index 7d0db139ade6e305dcbf3567718dd6455e0a1ef7..a49db87f030d1a965a1d71ad0918ba79e83f7677 100644 (file)
@@ -68,7 +68,7 @@ struct pcap_snoop {
 static int
 pcap_read_snoop(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_snoop *psn = p->private;
+       struct pcap_snoop *psn = p->priv;
        int cc;
        register struct snoopheader *sh;
        register u_int datalen;
@@ -164,7 +164,7 @@ pcap_inject_snoop(pcap_t *p, const void *buf, size_t size)
 static int
 pcap_stats_snoop(pcap_t *p, struct pcap_stat *ps)
 {
-       struct pcap_snoop *psn = p->private;
+       struct pcap_snoop *psn = p->priv;
        register struct rawstats *rs;
        struct rawstats rawstats;
 
index ff04baae1748082e131308b1312e71cb1850a52a..e5b76a6316672718bd62a8369dbfe3b25d7ea84f 100644 (file)
@@ -214,7 +214,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str)
 static 
 int usb_mmap(pcap_t* handle)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        int len = ioctl(handle->fd, MON_IOCQ_RING_SIZE);
        if (len < 0) 
                return 0;
@@ -340,7 +340,7 @@ usb_create(const char *device, char *ebuf, int *is_ours)
 static int
 usb_activate(pcap_t* handle)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        char            full_path[USB_LINE_LEN];
 
        /* Initialize some components of the pcap structure. */
@@ -468,7 +468,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
        * /usr/src/linux/Documentation/usb/usbmon.txt 
        * for message format
        */
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        unsigned timestamp;
        int tag, cnt, ep_num, dev_addr, dummy, ret, urb_len, data_len;
        char etype, pipeid1, pipeid2, status[16], urb_tag, line[USB_LINE_LEN];
@@ -670,7 +670,7 @@ usb_inject_linux(pcap_t *handle, const void *buf, size_t size)
 static int 
 usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        int dummy, ret, consumed, cnt;
        char string[USB_LINE_LEN];
        char token[USB_LINE_LEN];
@@ -754,7 +754,7 @@ usb_setdirection_linux(pcap_t *p, pcap_direction_t d)
 static int 
 usb_stats_linux_bin(pcap_t *handle, struct pcap_stat *stats)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        int ret;
        struct mon_bin_stats st;
        ret = ioctl(handle->fd, MON_IOCG_STATS, &st);
@@ -778,7 +778,7 @@ usb_stats_linux_bin(pcap_t *handle, struct pcap_stat *stats)
 static int
 usb_read_linux_bin(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        struct mon_bin_get info;
        int ret;
        struct pcap_pkthdr pkth;
@@ -837,7 +837,7 @@ usb_read_linux_bin(pcap_t *handle, int max_packets, pcap_handler callback, u_cha
 static int
 usb_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
        struct mon_bin_mfetch fetch;
        int32_t vec[VEC_SIZE];
        struct pcap_pkthdr pkth;
@@ -921,7 +921,7 @@ usb_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, u_ch
 static void
 usb_cleanup_linux_mmap(pcap_t* handle)
 {
-       struct pcap_usb_linux *handlep = handle->private;
+       struct pcap_usb_linux *handlep = handle->priv;
 
        /* if we have a memory-mapped buffer, unmap it */
        if (handlep->mmapbuf != NULL) {
index 72735566242951a369b4034aa123e760b0265050..5ea10c97ffbfd0da9bfc290a5341a89c939a1d13 100644 (file)
@@ -271,7 +271,7 @@ pcap_read_win32_npf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 static int
 pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 {
-       struct pcap_win *pw = p->private;
+       struct pcap_win *pw = p->priv;
        u_char *dp = NULL;
        int     packet_len = 0, caplen = 0;
        struct pcap_pkthdr      pcap_header;
@@ -476,7 +476,7 @@ pcap_cleanup_win32(pcap_t *p)
 static int
 pcap_activate_win32(pcap_t *p)
 {
-       struct pcap_win *pw = p->private;
+       struct pcap_win *pw = p->priv;
        NetType type;
 
        if (p->opt.rfmon) {
@@ -840,7 +840,7 @@ pcap_setfilter_win32_dag(pcap_t *p, struct bpf_program *fp) {
 static int
 pcap_getnonblock_win32(pcap_t *p, char *errbuf)
 {
-       struct pcap_win *pw = p->private;
+       struct pcap_win *pw = p->priv;
 
        /*
         * XXX - if there were a PacketGetReadTimeout() call, we
@@ -853,7 +853,7 @@ pcap_getnonblock_win32(pcap_t *p, char *errbuf)
 static int
 pcap_setnonblock_win32(pcap_t *p, int nonblock, char *errbuf)
 {
-       struct pcap_win *pw = p->private;
+       struct pcap_win *pw = p->priv;
        int newtimeout;
 
        if (nonblock) {
diff --git a/pcap.c b/pcap.c
index c2626bf4dd0f4f661ab9c0157eefe6adde1de135..a7c5e40456d3886eb7e90d55bd7cdba71e0951e5 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -510,13 +510,13 @@ pcap_alloc_pcap_t(char *ebuf, size_t size)
 
        if (size == 0) {
                /* No private data was requested. */
-               p->private = NULL;
+               p->priv = NULL;
        } else {
                /*
                 * Set the pointer to the private data; that's the structure
                 * of size "size" following the pcap_t.
                 */
-               p->private = (void *)(chunk + sizeof (pcap_t));
+               p->priv = (void *)(chunk + sizeof (pcap_t));
        }
 
        return (p);
index fcb419b5445efecd46549e9a83f923d93e5500a4..71fa057ee212337abd27b30012281e7584154bec 100644 (file)
@@ -524,7 +524,7 @@ add_interface(pcap_t *p, struct block_cursor *cursor, char *errbuf)
        u_int tsresol;
        u_int64_t tsoffset;
 
-       ps = p->private;
+       ps = p->priv;
 
        /*
         * Count this interface.
@@ -757,7 +757,7 @@ pcap_ng_check_header(bpf_u_int32 magic, FILE *fp, u_int precision, char *errbuf,
                return (NULL);
        }
        p->swapped = swapped;
-       ps = p->private;
+       ps = p->priv;
 
        /*
         * What precision does the user want?
@@ -930,7 +930,7 @@ fail:
 static void
 pcap_ng_cleanup(pcap_t *p)
 {
-       struct pcap_ng_sf *ps = p->private;
+       struct pcap_ng_sf *ps = p->priv;
 
        free(ps->ifaces);
        sf_cleanup(p);
@@ -944,7 +944,7 @@ pcap_ng_cleanup(pcap_t *p)
 static int
 pcap_ng_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data)
 {
-       struct pcap_ng_sf *ps = p->private;
+       struct pcap_ng_sf *ps = p->priv;
        struct block_cursor cursor;
        int status;
        struct enhanced_packet_block *epbp;
index 147245ae94b92d36676d9597653539d4f133010a..d129dc7b4d2e26ba4109ee75584d3fbf79edc68e 100644 (file)
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -237,7 +237,7 @@ pcap_check_header(bpf_u_int32 magic, FILE *fp, u_int precision, char *errbuf,
 
        p->next_packet_op = pcap_next_packet;
 
-       ps = p->private;
+       ps = p->priv;
 
        p->opt.tstamp_precision = precision;
 
@@ -396,7 +396,7 @@ pcap_check_header(bpf_u_int32 magic, FILE *fp, u_int precision, char *errbuf,
 static int
 pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data)
 {
-       struct pcap_sf *ps = p->private;
+       struct pcap_sf *ps = p->priv;
        struct pcap_sf_patched_pkthdr sf_hdr;
        FILE *fp = p->rfile;
        size_t amt_read;