summaryrefslogtreecommitdiff
path: root/netlib.c
Commit message (Collapse)AuthorAgeFilesLines
* LICENSE: Update licenses for consistency. No functional changes.Gary E. Miller2018-11-191-1/+1
|
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* Clean up C and Python code-checker warnings.Eric S. Raymond2017-09-061-3/+3
|
* Windows libgps supportRobert Norris2017-02-171-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Windows versions for network functions and disable unused features. Add detection of various headers and functions that aren't available in Windows. Note that netlib_localsocket() has no functional implementation on Windows, but it isn't to be used on that platform and it's not part of libgps anyway. Using send() rather than write() seems to work on Windows. For Windows need to ensure networking is initialised on opening of sockets (and then correspondingly shutdown upon closing). Note that within gpsd.h the termios structures and serial related functions are removed from the Windows build. These are only accessed in serial.c by gpsd, so since the Windows build is only generating libgps there is currently no need to modify serial.c. And for os_compat.h, daemon() is simply disabled under Windows as it's not used within libgps. TESTED: Confirmed compiles under a cross compiler. Manual build and run of test_libgps on Windows which successfully connects to a host running GPSD Manual build DLL version and link with a Windows version of a program (Viking) that then successfully connects and monitors positions from GPSD Otherwise no effect on current supported systems. 'scons build-all check' - passes. Signed-off-by: Fred Wright <fw@fwright.net>
* Fixes broken OpenBSD build.Fred Wright2016-09-221-3/+0
| | | | | | | | | | | | | This removes a flag tweak which is commented as being needed by FreeBSD, but that doesn't seem to be the case in FreeBSD 10.1, anyway. TESTED: Ran "scons build-all check" on OSX 10.5, 10.9, and 10.11, as well asl Ubuntu 14, CentOS 7, FreeBSD 10.1, OpenBSD 5.6 (32 and 64), and NetBSD 6.1.5. Signed-off-by: Gary E. Miller <gem@rellim.com>
* for INADDR_LOOPBACK() FreeBSD wants __BSD_VISIBLEGary E. Miller2016-08-161-0/+4
| | | | Oh what a tangled web...
* Fix build on OS/X < 10.6Fred Wright2016-01-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | OSX versions earlier than 10.6 fail to define IPV6_TCLASS, causing the compile of gpsd.c to fail. There is already a fallback definition for Gnu/Hurd. The attached patch: 1) Extends the existing Gnu/Hurd fallback definition to include a case for OSX. This is currently based on _APPLE_. Basing it on Darwin might be more appropriate, but that would need to be tested. 2) Duplicates this fallback setup in netlib.c, where it was missing. 3) Adds an ifdef to gpsd.c so that other cases that fail to define IPV6_TCLASS will simply omit the IPTOS_LOWDELAY setup, rather than failing to build. It's not entirely clear that sweeping the problem under the rug is preferable to getting an error and having the builder figure out what to do, but it is consistent with netlib.c, which includes a similar ifdef. The patch is originally from jeremyhu@macports.org, updated for 3.14 by ryandesign@macports.org, and then updated by me for 3.16.
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-20/+1
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Yet more: Line expects to suppress X error, found 0 errorsGary E. Miller2015-03-251-1/+1
|
* Minor port fix.Eric S. Raymond2014-08-231-1/+1
|
* splint/cppcheck/coverity cleanup.Eric S. Raymond2014-08-211-1/+1
|
* netlib: correctly enable IPTOS_LOWDELAYDave Taht2014-01-041-1/+5
| | | | | | | | netlib.c has long had code to support IPTOS_LOWDELAY but lacking the appropriate include never compiled it in. It was also wrong for ipv6 packets. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* cppcheck and Coverity cleanup (not yet complete).Eric S. Raymond2013-11-061-5/+2
| | | | All regression tests pass. PPS is live.
* Add some more error logging to chrony socket openingGary E. Miller2013-10-251-1/+1
|
* More cppcheck cleanup.Eric S. Raymond2013-09-171-0/+1
|
* Explain some magic.Eric S. Raymond2013-01-091-1/+8
|
* Lose the assumption that socket_t is an integer.Eric S. Raymond2012-09-221-0/+1
|
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-3/+3
|
* Un-break the regression tests while we figure out how to reapply.Eric S. Raymond2012-09-071-1/+1
|
* Use strerror() rather than a generic error message.ukyg9e5r6k7gubiekd62012-09-071-1/+1
| | | | | | | Not thread-safe, but at least it has a chance of being useful in problem diagnosis. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Complete change from int to socket_t for sockets.Eric S. Raymond2012-09-071-1/+1
|
* Suppress compiler warnings and do splint cleanup. All regression tests pass.Eric S. Raymond2012-04-201-1/+1
|
* Removed duplicate code.Michael Tatarinov2011-06-271-2/+2
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* netlib_localsocket(): close the socket if connect() failedMichael Tatarinov2011-06-271-0/+1
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Factor out a function we'll probably reuse.Eric S. Raymond2011-06-261-0/+27
|
* Guard a potentially fatal call better. All regression tests pass.Eric S. Raymond2011-02-021-2/+3
|
* More deheader testing. All regression tests pass.Eric S. Raymond2011-01-131-1/+0
|
* More header portability audting with a new version of deheader.Eric S. Raymond2010-12-221-2/+2
|
* Abolish gpsd_report.c. No more hardwired logging from the client libraries.Eric S. Raymond2010-12-161-4/+1
| | | | Only the daemon now uses this function.
* Refactor to turf all uses of gpsd_report() out of netlib.cEric S. Raymond2010-12-161-3/+0
| | | | | | A recent bug report makes it clear that all such uses have to be removed from the client libraries. Otherwise a GUI client might dummp log messages uselessly in the X session error log. This is a start.
* Splint cleanup.Eric S. Raymond2010-12-151-3/+1
|
* Remove duplicate header.Eric S. Raymond2010-12-151-1/+0
|
* Lift some buried #includes. All regression tests pass.Eric S. Raymond2010-12-151-0/+11
|
* Partial splint cleanup. All regression tests pass.Eric S. Raymond2010-12-151-3/+3
|
* missing headers for openbsdChris Kuethe2010-12-141-0/+1
|
* Taking SuS seriously some more.Eric S. Raymond2010-12-141-31/+2
|
* Unused-header removals by deheader. All regression tests pass.Eric S. Raymond2010-12-011-1/+0
|
* splint cleanup. All regression tests pass.Eric S. Raymond2010-09-161-1/+1
|
* Switch TCP socket sources to nonblocking mode.Eric S. Raymond2010-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This follows a suggestion from Christian Eddie Dost <ecd@brainaid.de>, who had this to say: However, gpsd hangs when used with a tcp:// device, if you start the device without waiting for clients (-n option), there will never be a client connection accepted. If you start gpsd without -n option one client will be accepted and receive data, but when closing the client connection there will be no new connection possible. The problem is gpsd hangs inside consume_packets() or more exactly inside a blocking read() on the tcp socket a few functions further down. consume_packets() never returns to the main select() loop. The following patch configures sockets to non blocking, this fixes the problem and gpsd works fine for me with tcp:// devices. Using this patch should allow the special udp handling at the end of the function consume_packets() to be removed. I applied the suggested patch and also removed the special UDP handing. All regressions test pass (including the UDP one), and gpsd -N tcp://data.aishub.net:4006 reads AIS data as expected.
* Prevent an unlikely (but possible) fd leak. All regression tests pass, code ↵Eric S. Raymond2010-04-281-4/+5
| | | | splints clean.
* A long step towards reading UDP packets.Eric S. Raymond2010-04-281-3/+18
|
* Reindent the network support. All regression tests pass.Eric S. Raymond2010-04-141-34/+46
|
* Add all our info on the spin bug to TODO, and instrument all opens/closes.Eric S. Raymond2010-04-061-1/+5
|
* Add configure switch to enable/disable IPv6 support.Eric S. Raymond2010-03-271-2/+2
| | | | | | Patch by Signed-off-by: esr@thyrsus.com
* Vanish away Id and Rev $ keywords, git won't expand them to anything useful.Eric S. Raymond2010-03-131-2/+1
|
* Copyright stamps everywhere. No code changes.Eric S. Raymond2010-03-111-1/+5
|
* Na,espace cleanup. All regression tests pass, codebase splints clean.Eric S. Raymond2010-01-131-1/+1
|
* splint cleanup of IPv6 support.Eric S. Raymond2010-01-121-8/+20
|
* Internal IPv6 support, derived from a support patch by Olivier Mehani.Eric S. Raymond2010-01-121-35/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | The patch original is at: https://lists.berlios.de/pipermail/gpsd-dev/attachments/20100111/85ad4e15/attachment.bin This revision changes netlib_connectsock() to take a first argument that is an address family and can specify IPv4, IPv6, or either. It also changes gpsd.c to open two client sockets, one IPv4 and one IPv6, and listen on both. As a required cleanup, a number of defaults to "127.0.0.1" become defaults to "localhost" so we're not hardwiring in IPv4 assumptions anymore. I've omitted a significant portion of the Mehani patch that changed the interface of the client library in an incompatible way. Currently there is no way to make gpsd listen to IPv4 or IPv6 only, and no way to make a client query over IPV4 or IPv6 only. Also, we'd really like to be able to condition out IPv6 or (someday) IPv4 support for a leaner runtime, and there's no way to do that yet, either. Under IPv4, regression tests pass; live operation with a GPS mouse and the aishub feed both work. However, the resulting code does not splint clean; this will need to be fixed, and that's going to be tricky due to the new sockaddr_t struct.
* David Ludlow's housekeeping and type-cleanup patch.Eric S. Raymond2010-01-021-3/+7
| | | | All regression tests pass,