… | |
… | |
97 | |
97 | |
98 | #define MAC_DIGEST ENABLE_HMAC |
98 | #define MAC_DIGEST ENABLE_HMAC |
99 | #define MAC_KEYSIZE HASH_SIZE (ENABLE_HMAC) // number of bits used for the HMAC key |
99 | #define MAC_KEYSIZE HASH_SIZE (ENABLE_HMAC) // number of bits used for the HMAC key |
100 | #define MAC_IKMSIZE (MAC_KEYSIZE * 3 / 2) // randomness in rsa challenge |
100 | #define MAC_IKMSIZE (MAC_KEYSIZE * 3 / 2) // randomness in rsa challenge |
101 | |
101 | |
102 | #define WINDOWSIZE 512 // sliding window size |
102 | #define WINDOWSIZE 65536 // sliding window size |
103 | #define MAX_SEQNO (0xfffffff0U - WINDOWSIZE * 8) |
103 | #define MAX_SEQNO (0xfffffff0U - WINDOWSIZE * 8) |
104 | |
104 | |
105 | // hdr seq len hmac MAC MAC |
105 | // hdr seq len hmac MAC MAC |
106 | #define VPE_OVERHEAD (4 + 4 + 4 + HMACLENGTH - 6 - 6) |
106 | #define VPE_OVERHEAD (4 + 4 + 4 + HMACLENGTH - 6 - 6) |
107 | #define IP_OVERHEAD 20 // size of a (normal) ip header |
107 | #define IP_OVERHEAD 20 // size of a (normal) ip header |
… | |
… | |
111 | #define TCP_OVERHEAD (IP_OVERHEAD + 22) // size of a (normal) ip + tcp header + packetlength |
111 | #define TCP_OVERHEAD (IP_OVERHEAD + 22) // size of a (normal) ip + tcp header + packetlength |
112 | #define MAX_OVERHEAD UDP_OVERHEAD // the max. overhead of any protocol (ok, tcp doesn't count) |
112 | #define MAX_OVERHEAD UDP_OVERHEAD // the max. overhead of any protocol (ok, tcp doesn't count) |
113 | #define ETH_OVERHEAD 14 // the size of an ethernet header |
113 | #define ETH_OVERHEAD 14 // the size of an ethernet header |
114 | #define MAXSIZE (MAX_MTU + IP_OVERHEAD) // slightly too large, but who cares |
114 | #define MAXSIZE (MAX_MTU + IP_OVERHEAD) // slightly too large, but who cares |
115 | |
115 | |
116 | #define PKTCACHESIZE 16 // the size of the memory pool for packets |
116 | #define PKTCACHESIZE 128 // the size of the memory pool for packets |
117 | |
117 | |
118 | extern char *confbase; // directory in which all config files are |
118 | extern char *confbase; // directory in which all config files are |
119 | extern char *thisnode; // config for current node (TODO: remove) |
119 | extern char *thisnode; // config for current node (TODO: remove) |
120 | |
120 | |
121 | template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } |
121 | template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } |