]> The Tcpdump Group git mirrors - libpcap/commitdiff
Remove trailing white space.
authorGuy Harris <[email protected]>
Sun, 29 Oct 2017 21:00:27 +0000 (14:00 -0700)
committerGuy Harris <[email protected]>
Sun, 29 Oct 2017 21:00:39 +0000 (14:00 -0700)
15 files changed:
pcap-dag.c
pcap.c
pcap/dlt.h
rpcap-protocol.h
rpcapd/daemon.c
rpcapd/daemon.h
rpcapd/fileconf.c
rpcapd/fileconf.h
rpcapd/rpcapd.c
rpcapd/rpcapd.h
rpcapd/utils.h
rpcapd/win32-svc.c
rpcapd/win32-svc.h
sf-pcap-ng.c
sockutils.c

index 47db766d3f1c33e1f87d5226b4f76fa1cc9d67e1..24bf31a54cd45dd94cdcc462f42f151765769260 100644 (file)
@@ -1085,7 +1085,7 @@ dag_findalldevs(pcap_if_list_t *devlistp, char *errbuf)
                        for(stream=0;stream<DAG_STREAM_MAX;stream+=2) {
                                if (0 == dag_attach_stream(dagfd, stream, 0, 0)) {
                                        dag_detach_stream(dagfd, stream);
-                                       
+
                                        pcap_snprintf(name,  10, "dag%d:%d", c, stream);
                                        if (add_dev(devlistp, name, 0, description, errbuf) == NULL) {
                                                /*
@@ -1093,7 +1093,7 @@ dag_findalldevs(pcap_if_list_t *devlistp, char *errbuf)
                                                 */
                                                ret = -1;
                                        }
-                                       
+
                                        rxstreams--;
                                        if(rxstreams <= 0) {
                                                break;
@@ -1102,7 +1102,7 @@ dag_findalldevs(pcap_if_list_t *devlistp, char *errbuf)
                        }
                        dag_close(dagfd);
                }
-               
+
        }
        return (ret);
 }
@@ -1296,7 +1296,7 @@ dag_get_datalink(pcap_t *p)
                        if(!p->linktype)
                                p->linktype = DLT_RAW;
                        break;
-                       
+
                case ERF_TYPE_IPV6:
                        if (p->dlt_list != NULL) {
                                p->dlt_list[dlt_index++] = DLT_RAW;
diff --git a/pcap.c b/pcap.c
index 768f39881b6e57bf4321ffa5a5ddcc833e13a8fe..73bb31266469a952f3772565e65e8d90d7330058 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -1529,7 +1529,7 @@ pcap_parse_source(const char *source, char **schemep, char **userinfop,
        }
        memcpy(scheme, source, scheme_len);
        scheme[scheme_len] = '\0';
-        
+
        /*
         * Treat file: specially - take everything after file:// as
         * the pathname.
index 8dbe34b8fffdc549b591803c2043f3600c4e8ac1..164e582616a6519da1c4654118b7bc6b55332cea 100644 (file)
  */
 #define DLT_NORDIC_BLE         272
 
-/* 
+/*
  * Excentis DOCSIS 3.1 RF sniffer (XRA-31)
  *   per: bruno.verstuyft at excentis.com
  */
index be6cf2f1af00030f6d5aec04e9aa8edffbc3cae0..6c6f13ba5ac6c3f1c135e4d04634563a94fbd47f 100644 (file)
@@ -100,7 +100,7 @@ struct rpcap_findalldevs_if
  *
  * Do *NOT* use struct sockaddr_storage, as the layout for that is
  * machine-dependent.
- * 
+ *
  * RFC 2553 gives two sample layouts, both of which are 128 bytes long,
  * both of which are aligned on an 8-byte boundary, and both of which
  * have 2 bytes before the address data.
@@ -324,7 +324,7 @@ struct rpcap_sampling
  * Routines used by the rpcap client and rpcap daemon    *
  *                                                       *
  *********************************************************/
+
 #include "sockutils.h"
 
 extern int rpcap_checkver(SOCKET sock, struct rpcap_header *header, char *errbuf);
index 3d061983df69e1ac2fc7c4d07d39d136dd5e438f..51a5e9d2b8cdc4c4eb169520ecacb13261ed992a 100755 (executable)
@@ -2,30 +2,30 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
@@ -76,7 +76,7 @@ static int daemon_AuthUserPwd(char *username, char *password, char *errbuf);
 static int daemon_findalldevs(SOCKET sockctrl, char *errbuf);
 
 static int daemon_opensource(SOCKET sockctrl, char *source, int srclen, uint32 plen, char *errbuf);
-static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddata, char *source, int active, 
+static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddata, char *source, int active,
     struct rpcap_sampling *samp_param, uint32 plen, char *errbuf);
 static int daemon_endcapture(struct session *session, pthread_t *threaddata, char *errbuf);
 
@@ -84,7 +84,7 @@ static int daemon_updatefilter(struct session *session, uint32 plen);
 static int daemon_unpackapplyfilter(struct session *session, uint32 *totread, uint32 *plen, char *errbuf);
 
 static int daemon_getstats(struct session *session);
-static int daemon_getstatsnopcap(SOCKET sockctrl, unsigned int ifdrops, unsigned int ifrecv, 
+static int daemon_getstatsnopcap(SOCKET sockctrl, unsigned int ifdrops, unsigned int ifrecv,
                                                  unsigned int krnldrop, unsigned int svrcapt, char *errbuf);
 
 static int daemon_setsampling(SOCKET sockctrl, struct rpcap_sampling *samp_param, int plen, char *errbuf);
@@ -99,7 +99,7 @@ static void *daemon_thrdatamain(void *ptr);
 
        \param ptr: a void pointer that keeps the reference of the 'pthread_chain'
        value corrisponding to this thread. This variable is casted into a 'pthread_chain'
-       value in order to retrieve the socket we're currently using, the thread ID, and 
+       value in order to retrieve the socket we're currently using, the thread ID, and
        some pointers to the previous and next elements into this struct.
 
        \return None.
@@ -124,7 +124,7 @@ void daemon_serviceloop(void *ptr)
        int retval;                             // select() return value
 
        pars = (struct daemon_slpars *) ptr;
-       
+
        *errbuf = 0;    // Initialize errbuf
 
        // If we're in active mode, this is not a separate thread
@@ -145,7 +145,7 @@ auth_again:
                // We do not have to block here
                tv.tv_sec = RPCAP_TIMEOUT_INIT;
                tv.tv_usec = 0;
-               
+
                FD_SET(pars->sockctrl, &rfds);
 
                retval = select(pars->sockctrl + 1, &rfds, NULL, NULL, &tv);
@@ -172,7 +172,7 @@ auth_again:
                // the other user requested to close the connection
                // It can be also the case of 'active mode', in which this host is not
                // allowed to connect to the other peer; in that case, it drops down the connection
-               if (retval == -3) 
+               if (retval == -3)
                        goto end;
 
                // It can be an authentication failure or an unrecoverable error
@@ -224,7 +224,7 @@ auth_again:
                        // We do not have to block here
                        tv.tv_sec = RPCAP_TIMEOUT_RUNTIME;
                        tv.tv_usec = 0;
-                       
+
                        FD_SET(pars->sockctrl, &rfds);
 
                        retval = select(pars->sockctrl + 1, &rfds, NULL, NULL, &tv);
@@ -394,7 +394,7 @@ auth_again:
                        {
                                // signal to the main that the user closed the control connection
                                // This is used only in case of active mode
-                               pars->activeclose = 1;  
+                               pars->activeclose = 1;
                                SOCK_ASSERT("The other end system asked to close the connection.", 1);
                                goto end;
                                break;
@@ -444,7 +444,7 @@ end:
        {
                if (pars->sockctrl)
                        sock_close(pars->sockctrl, NULL, 0);
-               
+
                free(pars);
 #ifdef _WIN32
                pthread_exit(0);
@@ -456,11 +456,11 @@ end:
        \brief It checks if the authentication credentials supplied by the user are valid.
 
        This function is called each time the rpcap daemon starts a new serving thread.
-       It reads the authentication message from the network and it checks that the 
+       It reads the authentication message from the network and it checks that the
        user information are valid.
 
        \param sockctrl: the socket if of the control connection.
-       
+
        \param nullAuthAllowed: '1' if the NULL authentication is allowed.
 
        \param errbuf: a user-allocated buffer in which the error message (if one) has to be written.
@@ -513,7 +513,7 @@ int daemon_checkauth(SOCKET sockctrl, int nullAuthAllowed, char *errbuf)
                                {
                                        if (sock_discard(sockctrl, ntohl(header.plen), NULL, 0))
                                                return -1;
-                               }               
+                               }
                                return -3;
                        };
 
@@ -793,7 +793,7 @@ int daemon_findalldevs(SOCKET sockctrl, char *errbuf)
                rpcap_senderror(sockctrl,
                        "No interfaces found! Make sure libpcap/WinPcap is properly installed"
                        " and you have the right to access to the remote device.",
-                       PCAP_ERR_NOREMOTEIF, 
+                       PCAP_ERR_NOREMOTEIF,
                        errbuf);
                return -1;
        }
@@ -831,7 +831,7 @@ int daemon_findalldevs(SOCKET sockctrl, char *errbuf)
        }
 
        // RPCAP findalldevs command
-       if (sock_bufferize(NULL, sizeof(struct rpcap_header), NULL, 
+       if (sock_bufferize(NULL, sizeof(struct rpcap_header), NULL,
                &sendbufidx, RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, errbuf, PCAP_ERRBUF_SIZE) == -1)
                return -1;
 
@@ -879,7 +879,7 @@ int daemon_findalldevs(SOCKET sockctrl, char *errbuf)
                }
                findalldevs_if->naddr = htons(findalldevs_if->naddr);
 
-               if (sock_bufferize(d->name, lname, sendbuf, &sendbufidx, 
+               if (sock_bufferize(d->name, lname, sendbuf, &sendbufidx,
                        RPCAP_NETBUF_SIZE, SOCKBUF_BUFFERIZE, errbuf, PCAP_ERRBUF_SIZE) == -1)
                        return -1;
 
@@ -902,13 +902,13 @@ int daemon_findalldevs(SOCKET sockctrl, char *errbuf)
                        case AF_INET6:
 #endif
                                sockaddr = (struct rpcap_sockaddr *) &sendbuf[sendbufidx];
-                               if (sock_bufferize(NULL, sizeof(struct rpcap_sockaddr), NULL, 
+                               if (sock_bufferize(NULL, sizeof(struct rpcap_sockaddr), NULL,
                                        &sendbufidx, RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, errbuf, PCAP_ERRBUF_SIZE) == -1)
                                        return -1;
                                daemon_seraddr((struct sockaddr_storage *) address->addr, sockaddr);
 
                                sockaddr = (struct rpcap_sockaddr *) &sendbuf[sendbufidx];
-                               if (sock_bufferize(NULL, sizeof(struct rpcap_sockaddr), NULL, 
+                               if (sock_bufferize(NULL, sizeof(struct rpcap_sockaddr), NULL,
                                        &sendbufidx, RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, errbuf, PCAP_ERRBUF_SIZE) == -1)
                                        return -1;
                                daemon_seraddr((struct sockaddr_storage *) address->netmask, sockaddr);
@@ -979,9 +979,9 @@ static int daemon_opensource(SOCKET sockctrl, char *source, int srclen, uint32 p
 
        // Open the selected device
        // This is a fake open, since we do that only to get the needed parameters, then we close the device again
-       if ((fp = pcap_open_live(source, 
+       if ((fp = pcap_open_live(source,
                        1500 /* fake snaplen */,
-                       0 /* no promis */, 
+                       0 /* no promis */,
                        1000 /* fake timeout */,
                        errbuf)) == NULL)
        {
@@ -998,8 +998,8 @@ static int daemon_opensource(SOCKET sockctrl, char *source, int srclen, uint32 p
        rpcap_createhdr((struct rpcap_header *) sendbuf, RPCAP_MSG_OPEN_REPLY, 0, sizeof(struct rpcap_openreply));
 
        openreply = (struct rpcap_openreply *) &sendbuf[sendbufidx];
-       
-       if (sock_bufferize(NULL, sizeof(struct rpcap_openreply), NULL, &sendbufidx, 
+
+       if (sock_bufferize(NULL, sizeof(struct rpcap_openreply), NULL, &sendbufidx,
                RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, errbuf, PCAP_ERRBUF_SIZE) == -1)
                goto error;
 
@@ -1077,9 +1077,9 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
        }
 
        // Open the selected device
-       if ((session->fp = pcap_open(source, 
+       if ((session->fp = pcap_open(source,
                        ntohl(startcapreq.snaplen),
-                       (startcapreq.flags & RPCAP_STARTCAPREQ_FLAG_PROMISC) ? PCAP_OPENFLAG_PROMISCUOUS : 0 /* local device, other flags not needed */, 
+                       (startcapreq.flags & RPCAP_STARTCAPREQ_FLAG_PROMISC) ? PCAP_OPENFLAG_PROMISCUOUS : 0 /* local device, other flags not needed */,
                        ntohl(startcapreq.read_timeout),
                        NULL /* local device, so no auth */,
                        errbuf)) == NULL)
@@ -1108,9 +1108,9 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
        Gets the sockaddr structure referred to the other peer in the ctrl connection
 
        We need that because:
-       - if we're in passive mode, we need to know the address family we want to use 
+       - if we're in passive mode, we need to know the address family we want to use
        (the same used for the ctrl socket)
-       - if we're in active mode, we need to know the network address of the other host 
+       - if we're in active mode, we need to know the network address of the other host
        we want to connect to
        */
        saddrlen = sizeof(struct sockaddr_storage);
@@ -1130,7 +1130,7 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
                sprintf(portdata, "%d", ntohs(startcapreq.portdata));
 
                // Get the name of the other peer (needed to connect to that specific network address)
-               if (getnameinfo((struct sockaddr *) &saddr, saddrlen, peerhost, 
+               if (getnameinfo((struct sockaddr *) &saddr, saddrlen, peerhost,
                                sizeof(peerhost), NULL, 0, NI_NUMERICHOST))
                {
                        sock_geterror("getnameinfo(): ", errbuf, PCAP_ERRBUF_SIZE);
@@ -1163,7 +1163,7 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
                }
 
                // Get the local port the system picked up
-               if (getnameinfo((struct sockaddr *) &saddr, saddrlen, NULL, 
+               if (getnameinfo((struct sockaddr *) &saddr, saddrlen, NULL,
                                0, portdata, sizeof(portdata), NI_NUMERICSERV))
                {
                        sock_geterror("getnameinfo(): ", errbuf, PCAP_ERRBUF_SIZE);
@@ -1190,7 +1190,7 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
        rpcap_createhdr((struct rpcap_header *) sendbuf, RPCAP_MSG_STARTCAP_REPLY, 0, sizeof(struct rpcap_startcapreply));
 
        startcapreply = (struct rpcap_startcapreply *) &sendbuf[sendbufidx];
-       
+
        if (sock_bufferize(NULL, sizeof(struct rpcap_startcapreply), NULL,
                &sendbufidx, RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, errbuf, PCAP_ERRBUF_SIZE) == -1)
                goto error;
@@ -1215,7 +1215,7 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
                saddrlen = sizeof(struct sockaddr_storage);
 
                socktemp = accept(sockdata, (struct sockaddr *) &saddr, &saddrlen);
-               
+
                if (socktemp == INVALID_SOCKET)
                {
                        sock_geterror("accept(): ", errbuf, PCAP_ERRBUF_SIZE);
@@ -1231,9 +1231,9 @@ static struct session *daemon_startcapture(SOCKET sockctrl, pthread_t *threaddat
 
        /* GV we need this to create the thread as detached. */
        /* GV otherwise, the thread handle is not destroyed  */
-       pthread_attr_init(&detachedAttribute); 
+       pthread_attr_init(&detachedAttribute);
        pthread_attr_setdetachstate(&detachedAttribute, PTHREAD_CREATE_DETACHED);
-       
+
        // Now we have to create a new thread to receive packets
        if (pthread_create(threaddata, &detachedAttribute, daemon_thrdatamain, (void *) session))
        {
@@ -1295,7 +1295,7 @@ static int daemon_endcapture(struct session *session, pthread_t *threaddata, cha
 
        if (sock_send(session->sockctrl, (char *) &header, sizeof(struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -1338,7 +1338,7 @@ static int daemon_unpackapplyfilter(struct session *session, uint32 *totread, ui
 
        for (i = 0; i < bf_prog.bf_len; i++)
        {
-               nread = sock_recv(session->sockctrl, (char *) &insn, 
+               nread = sock_recv(session->sockctrl, (char *) &insn,
                    sizeof(struct rpcap_filterbpf_insn), SOCK_RECEIVEALL_YES,
                    errbuf, PCAP_ERRBUF_SIZE);
                if (nread == -1)
@@ -1415,11 +1415,11 @@ int daemon_setsampling(SOCKET sockctrl, struct rpcap_sampling *samp_param, int p
        struct rpcap_sampling rpcap_samp;
        int nread;                                      // number of bytes of the payload read from the socket
 
-       if ((nread = sock_recv(sockctrl, (char *) &rpcap_samp, sizeof(struct rpcap_sampling), 
+       if ((nread = sock_recv(sockctrl, (char *) &rpcap_samp, sizeof(struct rpcap_sampling),
                        SOCK_RECEIVEALL_YES, errbuf, PCAP_ERRBUF_SIZE)) == -1)
                goto error;
 
-       // Save these settings in the pcap_t 
+       // Save these settings in the pcap_t
        samp_param->method = rpcap_samp.method;
        samp_param->value = ntohl(rpcap_samp.value);
 
@@ -1450,7 +1450,7 @@ int daemon_getstats(struct session *session)
        struct pcap_stat stats;                         // local statistics
        struct rpcap_stats *netstats;           // statistics sent on the network
 
-       if (sock_bufferize(NULL, sizeof(struct rpcap_header), NULL, 
+       if (sock_bufferize(NULL, sizeof(struct rpcap_header), NULL,
                &sendbufidx, RPCAP_NETBUF_SIZE, SOCKBUF_CHECKONLY, pcap_geterr(session->fp), PCAP_ERRBUF_SIZE) == -1)
                goto error;
 
@@ -1481,7 +1481,7 @@ error:
        return -1;
 }
 
-int daemon_getstatsnopcap(SOCKET sockctrl, unsigned int ifdrops, unsigned int ifrecv, 
+int daemon_getstatsnopcap(SOCKET sockctrl, unsigned int ifdrops, unsigned int ifrecv,
                                                  unsigned int krnldrop, unsigned int svrcapt, char *errbuf)
 {
        char sendbuf[RPCAP_NETBUF_SIZE];        // temporary buffer in which data to be sent is buffered
@@ -1691,7 +1691,7 @@ void pthread_suspend(int msec)
        pthread_cond_init(&cond, NULL);
 
        gettimeofday(&now, NULL);
-       
+
        abstime.tv_sec = now.tv_sec + msec/1000;
        abstime.tv_nsec = now.tv_usec * 1000 + (msec%1000) * 1000 * 1000;
 
index 9c96c96b7d09c39da12efd47836bf9580ce79550..bbdd2bde9166e40e2197f5d3fc281a2a040d5b42 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 #ifndef __DAEMON_H__
index 80fe645f29d58a2717b9c57bc5042af84b9fb80d..20de52055373dc74e856866204601fddefd4fb47 100755 (executable)
@@ -121,7 +121,7 @@ void fileconf_read(int sign)
                        }
                }
 
-               // clear the remaining fields of the active list 
+               // clear the remaining fields of the active list
                while (i < MAX_ACTIVE_LIST)
                {
                        activelist[i].address[0] = 0;
@@ -158,7 +158,7 @@ int fileconf_save(const char *savefile)
 
                strncpy(temphostlist, hostlist, MAX_HOST_LIST);
                temphostlist[MAX_HOST_LIST] = 0;
-       
+
                token = pcap_strtok_r(temphostlist, RPCAP_HOSTLIST_SEP, &lasts);
                while(token != NULL)
                {
index 7c8dbf30d35a413ae718350025d147ac483d91f4..ca748143484733e18acfc6873df3a41a34dd69d3 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 #ifndef __FILECONF_H__
index 0eef6ab730005c284b9d2423d326987af4f42446..4a57740a1376d29df0a3ce3df199f1f2d7e482b9 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 #ifdef HAVE_CONFIG_H
@@ -103,7 +103,7 @@ static void printusage(void)
        "                  Default: use both IPv4 and IPv6 waiting sockets\n\n"
        "  -l <host_list>  a file that contains a list of hosts that are allowed\n"
        "                  to connect to this server (if more than one, list them one per line).\n"
-       "                  We suggest to use literal names (instead of numeric ones) in\n" 
+       "                  We suggest to use literal names (instead of numeric ones) in\n"
        "                  order to avoid problems with different address families.\n\n"
        "  -n              permit NULL authentication (usually used with '-l')\n\n"
        "  -a <host,port>  run in active mode when connecting to 'host' on port 'port'\n"
@@ -197,7 +197,7 @@ int main(int argc, char *argv[], char *envp[])
                                        tmpport = pcap_strtok_r(NULL, RPCAP_HOSTLIST_SEP, &lasts);
 
                                        strlcpy(activelist[i].address, tmpaddress, MAX_LINE);
-                                       
+
                                        if ((tmpport == NULL) || (strcmp(tmpport, "DEFAULT") == 0)) // the user choose a custom port
                                                strlcpy(activelist[i].port, RPCAP_DEFAULT_NETPORT_ACTIVE, MAX_LINE);
                                        else
@@ -207,7 +207,7 @@ int main(int argc, char *argv[], char *envp[])
 
                                        i++;
                                }
-                               
+
                                if (i > MAX_ACTIVE_LIST)
                                        SOCK_ASSERT("Only MAX_ACTIVE_LIST active connections are currently supported.", 1);
 
@@ -258,7 +258,7 @@ int main(int argc, char *argv[], char *envp[])
                // First child continues
                // Set daemon mode
                setsid();
-               
+
                // generated under unix with 'kill -HUP', needed to reload the configuration
                signal(SIGHUP, fileconf_read);
 
@@ -327,11 +327,11 @@ void main_startup(void)
        while ((i < MAX_ACTIVE_LIST) && (activelist[i].address[0] != 0))
        {
                activelist[i].ai_family = mainhints.ai_family;
-               
+
 #ifdef USE_THREADS
                /* GV we need this to create the thread as detached. */
                /* GV otherwise, the thread handle is not destroyed  */
-               pthread_attr_init(&detachedAttribute); 
+               pthread_attr_init(&detachedAttribute);
                pthread_attr_setdetachstate(&detachedAttribute, PTHREAD_CREATE_DETACHED);
 
                if (pthread_create(&threadId, &detachedAttribute, (void *) &main_active, (void *) &activelist[i]))
@@ -399,7 +399,7 @@ void main_startup(void)
 #ifdef USE_THREADS
                        /* GV we need this to create the thread as detached. */
                        /* GV otherwise, the thread handle is not destroyed  */
-                       pthread_attr_init(&detachedAttribute); 
+                       pthread_attr_init(&detachedAttribute);
                        pthread_attr_setdetachstate(&detachedAttribute, PTHREAD_CREATE_DETACHED);
 
                        if (pthread_create(&threadId, &detachedAttribute, (void *) &main_passive, (void *) socktemp))
@@ -440,7 +440,7 @@ void main_startup(void)
        It is not called when we are running as a daemon on UNIX, since
        we do not define a signal in order to terminate gracefully the daemon.
 
-       This function makes a fast cleanup (it does not clean everything, as 
+       This function makes a fast cleanup (it does not clean everything, as
        you can see from the fact that it uses kill() on UNIX), closes
        the main socket, free winsock resources (on Win32) and exits the
        program.
@@ -456,7 +456,7 @@ void main_cleanup(int sign)
        SOCK_ASSERT(PROGRAM_NAME " is closing.\n", 1);
 
        // FULVIO (bug)
-       // Here we close only the latest 'sockmain' created; if we opened more than one waiting sockets, 
+       // Here we close only the latest 'sockmain' created; if we opened more than one waiting sockets,
        // only the latest one is closed correctly.
        if (sockmain)
                closesocket(sockmain);
@@ -464,9 +464,9 @@ void main_cleanup(int sign)
 
        /*
                This code is executed under the following conditions:
-               - SIGTERM: we're under UNIX, and the user kills us with 'kill -15' 
+               - SIGTERM: we're under UNIX, and the user kills us with 'kill -15'
                (no matter is we're a daemon or in a console mode)
-               - SIGINT: we're in console mode and the user sends us a Ctrl+C 
+               - SIGINT: we're in console mode and the user sends us a Ctrl+C
                (SIGINT signal), no matter if we're UNIX or Win32
 
                In all these cases, we have to terminate the program.
@@ -503,7 +503,7 @@ static void main_cleanup_childs(int sign)
        It must be in a separate function because:
        - if we're in 'console' mode, we have to put the main thread waiting for a Ctrl+C
        (in order to be able to stop everything)
-       - if we're in daemon mode, the main program must terminate and a new child must be 
+       - if we're in daemon mode, the main program must terminate and a new child must be
        created in order to create the daemon
 
        \param ptr: it keeps the main socket handler (what's called 'sockmain' in the main()), that
@@ -545,7 +545,7 @@ static void main_passive(void *ptr)
                fromlen = sizeof(struct sockaddr_storage);
 
                sockctrl = accept(sockmain, (struct sockaddr *) &from, &fromlen);
-               
+
                if (sockctrl == INVALID_SOCKET)
                {
                        // The accept() call can return this error when a signal is catched
@@ -558,7 +558,7 @@ static void main_passive(void *ptr)
 #endif
                                continue;
 
-                       // Don't check for errors here, since the error can be due to the fact that the thread 
+                       // Don't check for errors here, since the error can be due to the fact that the thread
                        // has been killed
                        sock_geterror("accept(): ", errbuf, PCAP_ERRBUF_SIZE);
                        SOCK_ASSERT(errbuf, 1);
@@ -592,7 +592,7 @@ static void main_passive(void *ptr)
 
                /* GV we need this to create the thread as detached. */
                /* GV otherwise, the thread handle is not destroyed  */
-               pthread_attr_init(&detachedAttribute); 
+               pthread_attr_init(&detachedAttribute);
                pthread_attr_setdetachstate(&detachedAttribute, PTHREAD_CREATE_DETACHED);
                pthread_error = pthread_create(&threadId, &detachedAttribute, (void *) &daemon_serviceloop, (void *) pars);
                if (pthread_error != 0)
@@ -660,13 +660,13 @@ static void main_active(void *ptr)
 
        // Prepare to open a new server socket
        memset(&hints, 0, sizeof(struct addrinfo));
-                                               // WARNING Currently it supports only ONE socket family among IPv4 and IPv6 
+                                               // WARNING Currently it supports only ONE socket family among IPv4 and IPv6
        hints.ai_family = AF_INET;              // PF_UNSPEC to have both IPv4 and IPv6 server
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = activepars->ai_family;
 
        snprintf(errbuf, PCAP_ERRBUF_SIZE, "Connecting to host %s, port %s, using protocol %s",
-                       activepars->address, activepars->port, (hints.ai_family == AF_INET) ? "IPv4": 
+                       activepars->address, activepars->port, (hints.ai_family == AF_INET) ? "IPv4":
                        (hints.ai_family == AF_INET6) ? "IPv6" : "Unspecified");
        SOCK_ASSERT(errbuf, 1);
 
@@ -689,7 +689,7 @@ static void main_active(void *ptr)
                        SOCK_ASSERT(errbuf, 1);
 
                        snprintf(errbuf, PCAP_ERRBUF_SIZE, "Error connecting to host %s, port %s, using protocol %s",
-                                       activepars->address, activepars->port, (hints.ai_family == AF_INET) ? "IPv4": 
+                                       activepars->address, activepars->port, (hints.ai_family == AF_INET) ? "IPv4":
                                        (hints.ai_family == AF_INET6) ? "IPv6" : "Unspecified");
 
                        SOCK_ASSERT(errbuf, 1);
index 0de35da0ae6e07c080026d5da446517e9ed9d8db..6059a12187ffe8c191a09804e036cc2af65ec6ad 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 #ifndef __RPCAPD_H__
index 8a16b37700f047535174ca95d245499039922cde..4908f243bfe702ccbc7ab67ea89d4ace3a0d650f 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 #ifndef __UTILS_H__
index 902bf93c0371bfebc85bc7fcdb449bb0699f48fa..2799737d8b39007a2472d3749c5f8c7afdfb8c33 100755 (executable)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 
@@ -89,9 +89,9 @@ void WINAPI svc_control_handler(DWORD Opcode)
                        service_status.dwCurrentState = SERVICE_STOPPED;
 
                        /*
-                               Uses ABORT to clean up the service. To be really honest, only the main socket and 
+                               Uses ABORT to clean up the service. To be really honest, only the main socket and
                                such these stuffs are cleared; however the thread which are running are not stopped.
-                               This can be seen by placing a breakpoint at the end of svc_main(), in which you will 
+                               This can be seen by placing a breakpoint at the end of svc_main(), in which you will
                                see that is never reached. However, as soon as you set the service status to "stopped",
                                the StartServiceCtrlDispatcher() returns and the main thread ends. Then, Win32 has a good
                                automatic cleanup, so that all the threads which are still running are stopped
@@ -116,7 +116,7 @@ void WINAPI svc_control_handler(DWORD Opcode)
                        service_status.dwCurrentState = SERVICE_PAUSED;
                        SetServiceStatus(service_status_handle, &service_status);
                        break;
-               
+
                case SERVICE_CONTROL_CONTINUE:
                        service_status.dwCurrentState = SERVICE_RUNNING;
                        SetServiceStatus(service_status_handle, &service_status);
index 6999c7daf8089d7198433fec87b7594c6288a484..3f511d2c5587282e0e7ec8741bdd86f6eabd0e91 100644 (file)
@@ -2,32 +2,32 @@
  * Copyright (c) 2002 - 2003
  * NetGroup, Politecnico di Torino (Italy)
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
  * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright 
+ *
+ * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright 
- * notice, this list of conditions and the following disclaimer in the 
- * documentation and/or other materials provided with the distribution. 
- * 3. Neither the name of the Politecnico di Torino nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 
 int svc_start(void);
index 7f57b7184da9d7075bd91883bcec608a16344360..526131238aa8886afb368208933fe6e0d89191c7 100644 (file)
@@ -232,7 +232,7 @@ struct pcap_ng_sf {
 
 /*
  * Maximum block size for a given maximum snapshot length; we calculate
- * this based 
+ * this based
  *
  * We define it as the size of an EPB with a max_snaplen-sized
  * packet and 128KB of options.
index ecce0c71b644005b9377d3bd56170f47a62e0ca1..0766e9b4415d78b40fd926c5ffb7ddf81b3c79f4 100644 (file)
@@ -710,7 +710,7 @@ int sock_bufferize(const char *buffer, int size, char *tempbuf, int *offset, int
  * On MSVC, there *is* no ssize_t, and it returns an int.
  * MinGW has ssize_t. It and returns either an int (32 bit)
  * or a long long (64 bit).
- * Define ssize_t as int only on MSVC and on those that don't define 
+ * Define ssize_t as int only on MSVC and on those that don't define
  * _SSIZE_T_DEFINED so we can use it as the return value from recv().
  */
 #if defined(_WIN32) && !defined(_SSIZE_T_DEFINED)