more boilerplate

pull/1/head
Jon Titor 7 years ago
parent 624fb834cf
commit 781637bbf4
No known key found for this signature in database
GPG Key ID: DFEA3A904352EFF7

6
.gitignore vendored

@ -1,2 +1,8 @@
*~
*\#*
*.a
*.o
*.plist
sarpd

@ -0,0 +1,34 @@
REPO := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
EXE = $(REPO)/sarpd
LIB = sarp
STATIC_LIB = $(REPO)/lib$(LIB).a
STATIC_SRC = $(wildcard $(REPO)/libsarp/*.c)
STATIC_OBJ = $(STATIC_SRC:.c=.o)
DAEMON_SRC = $(wildcard $(REPO)/daemon/*.c)
DAEMON_OBJ = $(DAEMON_SRC:.c=.o)
PKG = pkg-config
PKGS = libsodium
REQUIRED_CFLAGS = $(CFLAGS) $(shell $(PKG) --cflags $(PKGS)) -I $(REPO)/include -std=c99
REQUIRED_LDFLAGS = $(LDFLAGS) $(shell $(PKG) --libs $(PKGS))
all: build
build: $(EXE)
$(EXE): $(DAEMON_OBJ) $(STATIC_LIB)
$(CC) $(REQUIRED_CFLAGS) $(REQUIRED_LDFLAGS) -o $(EXE) $(DAEMON_OBJ) $(STATIC_LIB)
$(STATIC_LIB): $(STATIC_OBJ)
$(AR) -r $(STATIC_LIB) $(STATIC_OBJ)
%.o: %.c
$(CC) $(REQUIRED_CFLAGS) -c $^ -o $@
clean:
$(RM) $(DAEMON_OBJ) $(EXE) $(STATIC_OBJ) $(STATIC_LIB)

@ -0,0 +1,6 @@
int main(int argc, char * argv[])
{
return 0;
}

@ -47,7 +47,13 @@ BD(x) is bittorrent decode x
invisible wire protocol version 1:
TODO
inbound handshake:
outbound handshake:
---
@ -65,13 +71,20 @@ address info (AI)
p: port_uint16
}
Exit Info (XI)
{
a: "<16 bytes big endian ipv6 address>",
b: "<16 bytes big endian ipv6 netmask>"
}
router contact (RC)
{
a: [ one, or, many, AI, here ... ],
e: "<32 bytes public encryption key>",
k: "<32 bytes public sigining key>",
x: seconds_since_epoch_contact_expiration_uint64,
x: [ Exit, Infos ],
z: "<64 bytes signature using signing key>"
}
@ -123,7 +136,7 @@ k as symettric key for encryption and decryption.
{
a: "c",
c: "<32 byte public signing key used for canceling path>"
c: "<32 byte public signing key used for further communication>",
i: "<32 byte public kad key of next hop>",
k: "<32 byte symmettric key>",
p: path_id_uint64,
@ -173,7 +186,7 @@ new_y = y ^ new_z[0:8]
a: "u",
p: path_id_uint64,
y: "<insert 8 bytes nounce here>",
z: "<insert 1240 bytes payload here>"
z: "<insert N bytes payload here>"
}
link relay downstream message (LRDM)
@ -189,7 +202,7 @@ new_z = SE(k, new_y, z)
a: "d",
p: path_id_uint64,
y: "<insert 8 bytes nounce here>",
z: "<insert 1240 bytes payload here>"
z: "<insert N bytes payload here>"
}
link relay exit message (LRXM)
@ -229,7 +242,7 @@ replies are sent down the path that messages originate from.
{
A: "A",
I: "<32 bytes signing public key for future communication>",
X: lifetime_of_address_mapping_in_seconds_uint64
X: lifetime_of_address_mapping_in_seconds_uint64,
}
grant exit address messsage (GXAM)
@ -254,6 +267,32 @@ reject exit address message (RXAM)
Z: "<64 bytes signature signed by exit>"
}
transfer data fragment message (TDFM)
variant 1 (with path id):
transfer data to another path with id P on the local router place Y and X values into
y and z values in LRDM message respectively.
{
A: "T",
P: path_id_uint64,
X: "<N bytes payload>",
Y: "<8 bytes nounce>"
}
variant 2 (no path id):
transfer ip traffic for exit
{
A: "T",
Y: "<N bytes ipv6 packet>",
Z: "<64 bytes signature of previously provided signing key>"
}
find service address message (FSAM)
{

@ -0,0 +1,4 @@
#ifndef SARP_H_
#define SARP_H_
#include <sarp/router.h>
#endif

@ -0,0 +1,5 @@
#ifndef SARP_ROUTER_H_
#define SARP_ROUTER_H_
#endif
Loading…
Cancel
Save