… | |
… | |
28 | #include "conf.h" |
28 | #include "conf.h" |
29 | #include "iom.h" |
29 | #include "iom.h" |
30 | #include "util.h" |
30 | #include "util.h" |
31 | #include "device.h" |
31 | #include "device.h" |
32 | |
32 | |
33 | /* Protocol version. Different versions are incompatible, |
33 | /* Protocol version. Different major versions are incompatible, |
34 | incompatible version have different protocols. |
34 | * different minor versions probably are compatible ;) |
35 | */ |
35 | */ |
36 | |
36 | |
37 | #define PROTOCOL_MAJOR 1 |
37 | #define PROTOCOL_MAJOR 0 |
38 | #define PROTOCOL_MINOR 0 |
38 | #define PROTOCOL_MINOR 0 |
39 | |
39 | |
40 | struct vpn; |
40 | struct vpn; |
41 | struct vpn_packet; |
41 | struct vpn_packet; |
42 | |
42 | |
… | |
… | |
44 | u8 id[RSA_IDLEN]; // the challenge id |
44 | u8 id[RSA_IDLEN]; // the challenge id |
45 | }; |
45 | }; |
46 | |
46 | |
47 | typedef u8 rsachallenge[RSA_KEYLEN - RSA_OVERHEAD]; // challenge data; |
47 | typedef u8 rsachallenge[RSA_KEYLEN - RSA_OVERHEAD]; // challenge data; |
48 | typedef u8 rsaencrdata[RSA_KEYLEN]; // encrypted challenge |
48 | typedef u8 rsaencrdata[RSA_KEYLEN]; // encrypted challenge |
49 | typedef u8 rsaresponse[RSA_HASHLEN]; // the ripemd160(!) hash of the challenge |
49 | typedef u8 rsaresponse[RSA_RESLEN]; // the encrypted ripemd160 hash |
50 | |
50 | |
51 | struct crypto_ctx; |
51 | struct crypto_ctx; |
52 | |
52 | |
53 | // a very simple fifo pkt-queue |
53 | // a very simple fifo pkt-queue |
54 | class pkt_queue |
54 | class pkt_queue |
… | |
… | |
81 | pkt_queue queue; |
81 | pkt_queue queue; |
82 | |
82 | |
83 | crypto_ctx *octx, *ictx; |
83 | crypto_ctx *octx, *ictx; |
84 | |
84 | |
85 | enum conf_node::connectmode connectmode; |
85 | enum conf_node::connectmode connectmode; |
|
|
86 | u8 prot_minor; // minor number of other side |
86 | |
87 | |
87 | void reset_dstaddr (); |
88 | void reset_dstaddr (); |
88 | |
89 | |
89 | void shutdown (); |
90 | void shutdown (); |
90 | void reset_connection (); |
91 | void reset_connection (); |