dunnel

An experimental DTLS proxy

git clone https://git.8pit.net/dunnel.git

 1/**
 2 * DTLS session declared in `dunnel.c`.
 3 */
 4extern session_t dsess;
 5
 6/**
 7 * session_t for the socket client, defined in `dunnel.c`.
 8 */
 9extern session_t csess;
10
11/**
12 * DTLS callback declared in `dtls.c`.
13 */
14extern dtls_handler_t dtlscb;
15
16/**
17 * Command line argument from `dunnel.c`.
18 */
19extern int smode;
20
21/**
22 * Struct use for the application data in the dtls_context_t.
23 */
24struct dctx {
25	int ufd; /* FD of the UDP socket. */
26	int dfd; /* FD of the DTLS socket. */
27
28	unsigned char *id, *key;
29};
30
31/**
32 * Enum used to specify which operation should be performed on the usock.
33 */
34typedef enum {
35	SOCK_CONN,
36	SOCK_BIND,
37} sockop;