Commit Graph

3573 Commits

Author SHA1 Message Date
gardners
8bd0153b0f Modified MDP ping code to set source address correctly. 2012-03-27 19:45:52 +10:30
gardners
5c4918f5bd Added code to verify source address when sending MDP frames. 2012-03-27 19:45:39 +10:30
gardners
aa543e1766 Various fixes and work towards MDP ping working.
MDP clients can now request the set of local addresses.
Framework is improved to avoid info leaks by sending more bytes
in an MDP frame than are necessary, but without having to bzero
almost 2KB each time.
2012-03-27 19:25:38 +10:30
gardners
d1bb637cba Fixed bug with sending of broadcast frames (nexthop was not being
set for broadcast frames).
2012-03-27 08:24:27 +10:30
Andrew Bettison
4e29cb1eb3 Fix some dodgy code and remove the #warning message pointing to it 2012-03-26 15:03:57 +10:30
Andrew Bettison
84b24b9918 Remove use of (struct sockaddr_un).sun_len field (BSDism only available on Apple) 2012-03-26 15:02:42 +10:30
gardners
6759a26720 Cleaned out some debugging output after tracking down and fixing
memory corruption bug.  Next challenge is to find out why broadcast
MDP packets are not getting dispatched properly (is trying to treat
broadcast address as unicast address it seems).
2012-03-23 07:06:57 +10:30
gardners
bd999138cf Added note about inscrutable frame construction. 2012-03-22 17:16:04 +10:30
gardners
3e0e1bf7e3 Disabled extra verbose malloc debug stuff. 2012-03-22 17:15:51 +10:30
gardners
2b42f77ccf Fixed some bounds checking, and added some fairly rigorous memory
handling debug aids. No known memory corruption bugs remain, I
think.
2012-03-22 17:10:27 +10:30
gardners
13d1d3084e Various fixes to track down memory handling bugs.
Fixed one free-before-time bug with queuing MDP frames.
Some heap corruption bug seems to remain.
2012-03-22 16:33:25 +10:30
gardners
c7dd475d50 Further work on MDP, including dispatching low-priority data when
it can fit in frames.  A nasty bug in queue code needs fixing.
Also, we only send tick frames at present, and need to add code
for dispatching packets at other times (bandwidth allowance permitting).
So the whole bandwidth management code needs to get finished.
2012-03-22 08:26:19 +10:30
gardners
76ef948455 Added back rather vital line that was mistakenly removed during a debugging
cleanout.
2012-03-21 15:26:07 +10:30
gardners
2d63e91c96 More work on preparing packet payloads for enqueing MDP frames.
Also errors for unimplemented crypto modes.
2012-03-21 13:08:08 +10:30
gardners
d8f7f27bad Removed a debug statement. 2012-03-21 13:00:24 +10:30
gardners
30e2540470 Various fixes and work towards sending MDP frames.
Broadcast and unicast addresses are accepted.  Some frame headers
are set.  Payload is yet to be set, and ciphered &/or signed as required,
and queueing is not yet verified.
2012-03-21 12:57:24 +10:30
gardners
c71ddbbd18 MDP ping getting closer: ping loop showing server-returned error
messages now works.  Server currently reports error when trying to
send MDP_TX frames (since it is not yet implemented), which the
client successfully displays. Onto making the server handle the
MDP_TX frames.
2012-03-21 03:55:13 +10:30
gardners
6e3fe903d9 Improved shutdown behaviour to properly handle client mode (don't
delete server socket if you are a client).  Also added main MDP
ping loop of sending packets.  Reading returned packets not yet
implemented.  Server handling of MDP_TX packets also not yet
implemented.
2012-03-21 03:27:47 +10:30
gardners
9d4e9f80ed Modified overlay_mdp_dispatch() to return reply MDP frame. 2012-03-21 03:07:29 +10:30
gardners
7ee72b3cba Further work on MDP. Client now receives server replies. So we
can actually bind an MDP port.  Next step is to make use of it to
send a packet.
2012-03-21 03:00:39 +10:30
gardners
2bfb6eb569 Added verification that replies come from MDP server
(including dealing with when the server is referenced via a
symlink, and verification by inode/dev is required)
2012-03-21 02:44:36 +10:30
gardners
67c4577b55 MDP replies almost working, and thus port binding almost working.
Just need to add sender verification check, i.e., that it was the
MDP server that replied, and interpret the reply.
2012-03-21 01:36:52 +10:30
gardners
8e6f6ee925 Work towards getting MDP working. Still some fun and games with
getting unix domain sockets to play nicely.  Some superfluous debug
code is present while working this through.
2012-03-20 17:11:58 +10:30
gardners
5fe959f033 Fixed reading of unix domain socket connections to provide a large
enough buffer to get the full socket name of the sending party.
2012-03-20 09:15:08 +10:30
gardners
8884339e31 MDP client socket gets bound to name before sending frame, and
socket file gets deleted when exiting.  MDP server doesn't seem
to be able to reply to packets yet -- that's next on the queue to
fix.
2012-03-19 16:35:49 +10:30
gardners
3991c3eff4 MDP Server now begins to look at received packets, and send error
message back to client if required.
2012-03-19 16:23:05 +10:30
gardners
70497df7b5 More work on MDP. Removed some debug fluff.
Added framework for MDP ping, and some work towards MDP port binding
and sending packets with option to wait for reply.  MDP server
doesn't yet support port binding, and client doesn't yet support
reading replies.
2012-03-19 16:06:34 +10:30
gardners
302c9e70fb Added "set var value" command line option. 2012-03-19 14:26:14 +10:30
gardners
f43143bd0f Added code to remove stale unix domain socket files on startup and
shutdown.
2012-03-19 09:43:11 +10:30
gardners
9a957dbda7 Added initial code towards adding mdp ping command to new command
line framework.  Will use this to test MDP.
2012-03-19 09:27:06 +10:30
gardners
8711c957a4 Added overlay_mdp to android.mk 2012-03-19 09:26:52 +10:30
gardners
46599269d7 fixed socket type from TCP to UDP. 2012-03-17 22:31:48 +10:30
gardners
f384e6ea79 Further preparatory work for MDP. Next stop is actually checking
for inbound MDP connection requests on the unix domain sockets.
2012-03-17 13:02:09 +10:30
gardners
c59318cbab Added not implemented flags to some functions. 2012-03-17 13:01:43 +10:30
gardners
fc4f7f8f0b Updated nacl-gcc-prep call to run in nacl directory where the
script now lives.
2012-03-17 09:37:00 +10:30
gardners
4cc2890637 Added warning for handling of sid in a function that appears to violate
some previous assumptions in the code.  To be examined.
2012-03-17 09:28:49 +10:30
gardners
872c14df3f Added initial hook to handle MDP frames. 2012-03-17 09:28:49 +10:30
gardners
6a1f0a7033 Fixed return types of functions. 2012-03-17 09:28:49 +10:30
gardners
b8d66bf19b Improved instance path handling so that there is a simple function
to get the current instance path, regardless of how it was determined.
2012-03-17 09:28:49 +10:30
gardners
348c5ebcf3 Added Mesh Datagram Protocol (MDP) source file and initial work.
Added overlay_mdp.c to Makefile.in, and also trans_cache.c which
had not yet been added.
2012-03-17 09:28:48 +10:30
gardners
ac072c22d0 Removed Makefile (which is generated from Makefile.in) 2012-03-17 09:28:48 +10:30
gardners
081a9f496b Put back a pile of files needed for building on osx, and also required
for building on other platforms (i.e., configure framework, including
the .in files that are needed to build configure and Makefile, and the
sqlite code that is required for stand-alone building without external
dependencies, e.g., on non-android platforms, and looking ahead to
symbian where we will need a single self-contained binary as we cannot
assume the presence of an sqlite3 library as we can on android).
Any further changes to the build environment should not be committed
until it has been verified that building from a clean checkout on osx,
followed by configure and make actually works.
2012-03-15 10:57:38 +10:30
gardners
9fb94fc877 More work on dna identity cache. 2012-03-15 10:57:38 +10:30
gardners
5b7c3c5bb8 Improved signal handling so that pressing ^C results in a clean
shutdown.
2012-03-15 10:57:38 +10:30
gardners
c9478659db Added hint in startup message to show where rhizome database size limit
is set.
2012-03-15 10:57:37 +10:30
gardners
ec8a81c206 Rhizome now uses serval.conf to get rhizome database size limit. 2012-03-15 10:57:37 +10:30
gardners
2a2e520ef5 Various fixes and additions to enable "dna node start" and "dna node stop"
command line options to work.
2012-03-15 10:57:37 +10:30
Andrew Bettison
738b70b513 Test and fix ACTION_CREATEHLR idempotency code:
- refactor hlrSid() to not return pointer to static buffer, take 3rd arg instead
 - introduce SID_STRLEN macro constant, use it everywhere
 - reformat some code for readability
2012-03-14 12:00:54 +10:30
Andrew Bettison
cc4835e169 Fix minor bug in export HLR function:
- treat ascii 127 (del) as not printable
2012-03-14 12:00:54 +10:30
Andrew Bettison
6d8089031b ACTION_CREATEHLR does not create new SID if DID already created 2012-03-13 16:35:15 +10:30