Commit Graph

36 Commits

Author SHA1 Message Date
Jeremy Lakeman
3049252c8a Poll netlink socket for interface changes on linux systems 2015-10-12 18:11:44 +10:30
Andrew Bettison
7d9a5faa4e Move if(config.debug.xxx) tests into DEBUGF()
Original DEBUG() and DEBUGF() macros renamed to _DEBUG() and _DEBUGF()
New DEBUG() and DEBUGF() macros, first argument is flagname
New DEBUGF2(foo, bar, ...) macro does if(config.debug.foo||config.debug.bar) test
Replace almost all config.debug.xxx references to IF_DEBUG(xxx)
2015-07-13 16:00:05 +09:30
gardners
ba4cd5e7b4 initialise length field in netmask_addr 2014-10-31 15:18:22 +10:30
gardners
45cffb4b2b fix missing netmask argument for openwrt compilation. 2014-10-31 15:10:03 +10:30
gardners
6dca9fe6bf ensure netmask is set when initialising an interface. 2014-10-31 15:01:22 +10:30
Jeremy Lakeman
81d349211a Remove spurius include of netinet/if_ether.h, fixes #76 2014-04-07 13:22:39 +09:30
Jeremy Lakeman
5f2c6e364a Refactor interface addresses to use new socket_address struct 2014-01-09 15:01:38 +10:30
Andrew Bettison
4af6cf9d6a Fix -Wsign-compare warnings: use size_t or unsigned for byte counts 2013-12-10 16:52:53 +10:30
Andrew Bettison
ba0ab14c69 Clean up inclusion of <netinet/in.h>
Make all #include <netinet/in.h> conditional upon HAVE_NETINET_IN_H

Remove unnecessary #include <netinet/in.h> from source files

Reformat include block in "serval.h" for readability
2013-11-12 11:39:06 +10:30
gardners
7248e01567 Implement flow of mavlink packets over serial connections
Replaces upper-7 bit slip encoding
Solves reliability of reading radio status messages
2013-09-10 13:07:52 +09:30
gardners
ccc37f7c4d fix header selection for lsif.c 2013-07-19 20:04:15 +09:30
Andrew Bettison
300ec986f1 Fix warnings from gcc 4.6.3 2013-03-18 16:48:15 +10:30
Andrew Bettison
5985df751d Overhaul debug flags
Replace debugflags_t and DEBUG_XXX bit masks with config schema "debug.xxx"
entries.

No more support for "debug.all".
2012-12-11 15:59:46 +10:30
Jeremy Lakeman
780daa3aa4 Prevent segfault for interfaces with no address 2012-11-01 14:00:18 +10:30
Jeremy Lakeman
fd111a4d1f Listen to INADDR_ANY on OSX, otherwise we can't hear broadcasts 2012-08-09 13:32:08 +09:30
Andrew Bettison
f37ec5af09 Reduce use of stderr in many places
serval_packetvisualise() is now replaced by DEBUG_packet_visualise() which uses
logging system not stderr (so now it will appear in Android log).

Replaced several fprintf(stderr,...) with DEBUGF(...).

Command line only prints a full help message on "help" command -- a command
parse failure simply informs the user about the "help" command.
2012-08-01 17:54:02 +09:30
Jeremy Lakeman
6e7c2196ba Close interfaces on socket errors or when not detected 2012-07-25 16:53:44 +09:30
Jeremy Lakeman
74095e5356 Correctly display interface ip addresses on android 2012-07-25 14:53:53 +09:30
Andrew Bettison
8020ea3b74 Merge branch 'eventscheduler' into master
Conflicts:
	commandline.c
	monitor.c
	overlay.c
	overlay_interface.c
	overlay_packetformats.c
	rhizome_fetch.c
	rhizome_http.c
	rhizome_packetformats.c
	serval.h
	server.c
	testdefs.sh
	testframework.sh
	tests/dnaprotocol
	tests/server
2012-07-03 10:26:22 +09:30
Jeremy Lakeman
89566e4d3d Refactor how functions are scheduled or file handes are watched 2012-07-02 13:19:54 +09:30
Andrew Bettison
a5ba1ecacd Clean up debugging code
Only use DEBUG inside "if (debug & DEBUG_BLAH)", not INFO or WARN or WHY!
INFO messages for starting/stopping servald server.
2012-06-28 15:37:36 +09:30
Jeremy Lakeman
926d4296c4 Added overall timer for main loop, minor tweaks to order and freq. of processes 2012-06-21 11:33:43 +09:30
Daniel O'Connor
86c5e6945f Don't force signedness for name in overlay_interface_register().
I can't see any point to forcing the signedness, it causes warnings on platforms with a signed-char by default.
2012-06-08 17:01:50 +09:30
Daniel O'Connor
9d8d6ed94f Pretty up doifaddrs() same as lsif(). 2012-06-08 17:00:50 +09:30
Daniel O'Connor
ea9993dc91 Fix detection on OSX and make detection smarter.
- Fix lsif() on OSX.
- Make lsif() smarter and avoid non-broadcast and no AF_INET addresses.
- Don't run multiple interface detectors, run one at a time until one works.
- Factor out HAVE_IFADDRS_H code into a separate function into lsif.c with the other interface detection routines.
- Prefer HAVE_IFADDRS_H (random bias..)
2012-06-08 16:36:33 +09:30
Daniel O'Connor
8882515d03 Fix compilation on OSX.
- /proc/net/route is Linux only.
- lsif() will work anywhere SIOCGIFCONF is defined.
- Abstract namespace UNIX domain sockets are Linux only.
- Rework code to reduce indent levels.
2012-05-28 15:00:54 +09:30
gardners
14f9d8001b and even better fix again, since this one builds on both linux and
android.
2012-05-11 08:18:58 +09:30
gardners
c70646039d better fix for redefined symbols 2012-05-11 08:17:37 +09:30
gardners
51966737a6 fix build problem on unbuntu (ifreq gets redefined) 2012-05-11 08:16:15 +09:30
Andrew Bettison
881576212c Fix all trivial compiler warnings 2012-05-10 18:08:59 +09:30
gardners
98ea86bde0 added new /proc/net/route method to find interfaces on android
(would you believe that using ifconfig to READ about interfaces
requires ROOT on android).
should also help for interfaces with multiple addresses.
2012-05-03 22:46:00 +09:30
gardners
6e933be9ec fixed bug on android with previous commit 2012-05-03 17:17:56 +09:30
gardners
82ca3dde5d impoved debugging and operation of interface detection
(since it has suddenly decided to fail)
2012-05-03 17:15:05 +09:30
gardners
ac5ce2b29a fixed file descriptor leak. 2012-04-28 14:24:57 +09:30
gardners
07768e27f7 fixed macro to select when to build lsif() 2012-04-28 12:32:02 +09:30
gardners
2ab32197a7 Put new linux-specific interface listing routine in that is needed
for android, where the portable method isn't easily available.
2012-04-28 12:25:19 +09:30