-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added configuration and documentation for the SocketInterface
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Configuring SocketInterface | ||
|
||
If you want to run cjdns on a system where you are not able to access a TUN device, | ||
you can use SocketInterface to make the packets available to yourself through a | ||
UNIX socket rather than through the TUN device. | ||
|
||
If you create the socket before cjdns starts up, it will connect to it, otherwise it | ||
will create the socket for you unless `socketAttemptToCreate` is set to 0 or is absent. | ||
|
||
In order to handle packets from the socket, you need to know about the header types: | ||
|
||
## SocketWrapper_TYPE_TUN_PACKET | ||
This type of packet starts with 1 byte `0` and is followed by 4 bytes big endian | ||
length of the packet and then the packet. | ||
|
||
## SocketWrapper_TYPE_CONF_ADD_IPV6_ADDRESS | ||
This type of packet starts with 1 byte `1` and is followed by a 16 byte IP address | ||
which the cjdns node wants to configure. After receiving this message, you know which | ||
source address you should use when crafting a packet to send to the network. | ||
NOTE: cjdns will drop packets with an unexpected source address. | ||
|
||
## SocketWrapper_TYPE_CONF_SET_MTU | ||
This type of packet starts with 1 byte `2` and is followed by a 4 byte MTU, cjdns | ||
does not want you to send any packets to this interface which are larger than that | ||
size. | ||
|
||
## Sending a packet | ||
When you are sending a packet to the SocketInterface, you must prefix the packet with | ||
1 byte `0` followed by a 4 byte length in big endian (as per the `SocketWrapper_TYPE_TUN_PACKET` | ||
definition). |