Commit Graph

24 Commits

Author SHA1 Message Date
Nate Bargmann
4595f77f99 Touch up rigctld.c and rotctld.c with astyle
Prior reformat had only been a reindent with Emacs.  Now use astyle.
2016-02-14 18:05:55 -06:00
Nate Bargmann
9b45fce776 Reformat rigctld.c and rotctld.c
Several lines in each file benefitted from formatting so just reformat
the entire files into Linux C Style.
2016-02-12 20:46:38 -06:00
Bill Somerville
e4e17ce862 Improve IPv6 portability and consistency
After  discussions with  Greg  N1DAM  I have  changed  the dual  stack
support to  explicitly allow IPv4  connections mapped to IPv6  for any
AF_INET6 address  since BSD  as well as  Windows defaults  this socket
option to on (disallowed).

IPv4 mapped to IPv6 makes sense  for Hamlib servers since starting two
servers  one  for each  protocol  family  (the  other option)  is  not
possible  since there  is only  a single  rig/rotator which  cannot be
shared between two servers.
2016-02-12 20:20:25 -06:00
Bill Somerville
04c545b9b9 Only use IPv6 features on Windows versions that support it (>=XP) 2016-02-12 15:30:41 +00:00
Bill Somerville
6061cae8df Proper IPv6 and dual stack networking for rotator net daemon
This means that rigctl & rigctld  now work with default arguments on a
modern Windows  machine with dual  stack and localhost being  [::1] as
the first interface returned by getaddrinfo().

Try all the interfaces return by DNS lookups to establish a connection
or listening  port. Handle  Windows network  errors correctly  so that
meaningful messages are printed.

The rigctl program now accepts  IPv6 numeric addresses in the portname
field like [<addr>}:<port> for example  the IPv6 loopback on port 4531
would be [::1]:4531.
2015-11-27 19:41:04 +00:00
Nate Bargmann
36f5f4cf6a Revert to previous handling of getaddrinfo()
Use the system gettaddrinfo function when possible as before.  Tested on
GNU, Cygwin, MinGW on Linux, and MinGW on Windows.  Under MinGW the
replacement getaddrinfo is used.  Perhaps this is an area for
investigation to be certain MinGW really doesn't supply getaddrinfo.
This reverts some of the patches from Remi Chateauneu in commit
60019c9.  This fixes build issues encountered building the Windows
binary daily snapshots.

Enabled static library build by default at configure time.

Fixed pthread library linking for the ars backend on MinGW.
2013-09-15 19:47:49 -05:00
Remi Chateauneu
60019c9444 Monolitic libraries. 2013-09-08 14:56:28 +01:00
Nate Bargmann
b9ff04abf0 Fix W2k 'freeaddrinfo' error
Trying to run the pthread enabled binaries on W2k resulted in an error
dialog with the text, "The procedure entry point freeaddrinfo could not be
located in ws2_32.dll".  A Microsoft support page
(http://support.microsoft.com/kb/955045) hints that when 'ws2tcpip.h' is
included that 'wspiapi.h' should be included as well.  Since MinGw
includes both files, this patch corrects the runtime error on W2k
2013-05-18 07:31:40 -05:00
Nate Bargmann
7e9f628648 rigctld/rotctld: Remove -e|--end-marker option
Remove support for deprecated "End Marker" protocol in rigctld and
rotctld.
2013-02-05 14:40:41 -06:00
Nate Bargmann
1229a0a42a Assure NULL terminated strings in tests programs.
Various strncpy operations could result in a port pathname that is not a
NULL terminated string as the allowed string length is the same size as
the buffer per the strncpy manual page.  This is corrected by assuring
that the allowed length is FILPATHLEN - 1.
2012-01-07 20:36:50 -06:00
Nate Bargmann
0882cd696d Update GPL/LGPL header in tests source files.
TNX to Lucian Laga, YO6PLB, for the notification.
2011-08-22 21:38:37 -05:00
Stephane Fillod
07bc66e7ab Port rigctld/rotctld to Mingw32
Sockets under Windows require specific startup and cleanup calls.
Besides, the standard fdopen() does no work on socket descriptors,
and has to be worked around thanks to _open_osfhandle().
2011-03-27 19:13:22 +02:00
Stéphane Fillod, F8CFE
8690fb0594 Implement exit status according to manual page:
1 if there was an invalid command line option or argument;
  2 if an error was returned by Hamlib.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@3009 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-12-01 21:41:55 +00:00
Stéphane Fillod, F8CFE
6ee58f0bff get ready for IPv6
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2883 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-16 20:50:14 +00:00
Stéphane Fillod, F8CFE
5be226561b fix mixup
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2844 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-03-03 08:34:00 +00:00
Nate Bargmann, N0NB
e6f311cdd0 Really set rotctl/rotctld to follow debug level set on command line.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2835 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 23:58:54 +00:00
Nate Bargmann, N0NB
121f4a996b Implement and document Extended Response Protocol for rotctld
New test program, testrotctld.pl for rotctld
Implemented locator.c functions in rotctl and rotctld



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2831 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 22:18:00 +00:00
Stéphane Fillod, F8CFE
025c1f4dd1 flexible command termination for send_cmd
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2557 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-04 14:49:17 +00:00
Stéphane Fillod, F8CFE
c436bdcd46 exit in case of socket creation error
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2455 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-11-02 12:39:36 +00:00
Stéphane Fillod, F8CFE
f541b221fe new netrigctl/netrotctl protocol with return value
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2428 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-10-27 22:23:36 +00:00
Stéphane Fillod, F8CFE
f7e6d60341 restrict listening IP address
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2399 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-21 20:32:08 +00:00
Stéphane Fillod, F8CFE
22beda2e28 create threads in detached state in order to prevent zombies
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2389 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-17 20:36:34 +00:00
Stéphane Fillod, F8CFE
591f77e271 fix thread-leak and pthread_create error code checking
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2388 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-17 18:56:13 +00:00
Stéphane Fillod, F8CFE
4cbfe38c1d initial rotctld release (same idea as rigctld)
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2382 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-12 22:55:10 +00:00