summaryrefslogtreecommitdiff
path: root/rpcapd/rpcapd.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't leak thread handles.Guy Harris2017-11-101-0/+3
| | | | | These threads just run in the background; we don't need to wait for them to finish, so close the handle as soon as we've gotten it.
* Include <process.h> as needed.Guy Harris2017-11-101-8/+10
|
* Use pcap_snprintf in rpcapd.Guy Harris2017-11-101-6/+6
| | | | That way, we get the same semantics on Windows and UN*X.
* Use native Windows threads directly on Windows.Guy Harris2017-11-101-52/+42
| | | | | That's one fewer tool you have to go run out and get in order to assemble the motorocycle engine you picked up from Ikea.
* Fix "sleep forever" and "sleep for N seconds".Guy Harris2017-11-011-2/+8
| | | | | | | | To block a thread forever (or, on UN*X, until a signal), use Sleep(INFINITE) on Windows and pause() on UN*X. To block a thread for N seconds, use Sleep(N*1000) on Windows and sleep(N) on UN*X.
* Fix a couple more rpcap_senderror() calls.Guy Harris2017-10-311-2/+2
|
* Redo the message processing in the client, add protocol version negotiation.Guy Harris2017-10-311-1/+1
| | | | | | Currently, we only have one protocol version, but the code should be able to handle multiple versions in the future - and to be able to work with older code that doesn't do negotiation.
* Remove trailing white space.Guy Harris2017-10-291-41/+41
|
* Fix "warning: ISO C90 forbids mixed declarations and code"Francois-Xavier Le Bail2017-10-211-2/+2
|
* Bounds-check an array index before using the index.Guy Harris2017-10-101-1/+1
| | | | Fixes Coverity CID 1419001.
* socket() and accept() return INVALID_SOCKET on errors.Guy Harris2017-10-071-3/+3
| | | | | | | | | | On Windows, you're supposed to check against INVALID_SOCKET. On UN*X, you're supposed to check against -1, but, on UN*X, we define INVALID_SOCKET to be -1 so you can compare against INVALID_SOCKET on both platforms. That means that sock_open() should return INVALID_SOCKET on errors as well.
* Free the address list when we return from main_active().Guy Harris2017-10-071-0/+2
| | | | This fixes Coverity CID 1419002.
* Don't leak sockets.Guy Harris2017-10-071-3/+10
| | | | | | | | In the daemon main loop, if we get an error after we've allocated the control socket, close the control socket before continuing. Also, report the error to the client. Fixes Coverity CID 1419020.
* Separated flags from arguments with a spaceAli Abdulkadir2017-10-051-6/+6
|
* Prettified printusage() outputAli Abdulkadir2017-10-051-22/+26
|
* Fix usage message.Guy Harris2017-10-011-1/+1
| | | | The option is -4, for IPv4-only, not -6.
* Put rpcap protocol routines common to client and server in rpcap-protocol.cGuy Harris2017-09-301-1/+0
| | | | | That way, rpcapd doesn't depend on them being exported from libpcap (which they shouldn't be).
* Make sure sockutils.h is included before portability.h.Guy Harris2017-09-031-1/+1
| | | | | | | | sockutils.h may include <crtdbg.h> on Windows, and portability.h expects that, if <crtdbg.h> is going to be included, it'll be included before portability.h, so that, if __STDC__ is 0, strdup will have been defined by <crtdbg.h>, and portability.h won't define it only to have a later include of <crtdbg.h> redefine it and provoke warnings.
* Always include <config.h> rather than "config.h".Guy Harris2017-08-181-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Define more feature test macros and do so in a separate header file.Guy Harris2017-03-201-1/+4
| | | | | | | On Linux, define _GNU_SOURCE to get as much stuff declared as possible. Define the feature test macros in ftmacros.h, and include that befoe including any header files other than config.h.
* Force strtok_r() to be declared if it's present.Guy Harris2017-03-201-2/+1
|
* Fix call to SOCK_ASSERT().Gisle Vanem2017-03-141-1/+1
|
* Rename the rpcap directory to rpcapd.Guy Harris2017-03-131-0/+713
Everything in that directory is part of rpcapd. That matches the source layout of WinPcap.