Browse Source

Merge pull request #337 from Logan007/mvDef

moved some #DEFs to central n2n_define.h
pull/342/head
Luca Deri 4 years ago
committed by GitHub
parent
commit
c8bbc251e0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      include/n2n_define.h
  2. 6
      src/n2n.c
  3. 3
      src/random_numbers.c

8
include/n2n_define.h

@ -46,6 +46,14 @@
#define IP4_MIN_SIZE 20
#define UDP_SIZE 8
/* parameters for replay protection */
#define TIME_STAMP_FRAME 0x0000001000000000LL /* clocks of different computers are allowed +/- 16 seconds to be off */
#define TIME_STAMP_JITTER 0x0000000027100000LL /* we allow a packet to arrive 160 ms (== 0x27100 us) before another
* set to 0x0000000000000000LL if increasing (or equal) time stamps allowed only */
/* parameter for random number generation */
#define RND_RETRIES 1000 /* syscall and inquiring random number from hardware generators might fail, so we will retry */
/* N2N compression indicators. */
/* Compression is disabled by default for outgoing packets if no cli
* option is given. All edges are built with decompression support so

6
src/n2n.c

@ -23,12 +23,6 @@
#include <assert.h>
#define PURGE_REGISTRATION_FREQUENCY 30
#define REGISTRATION_TIMEOUT 60
#define TIME_STAMP_FRAME 0x0000001000000000LL /* clocks of different computers are allowed +/- 16 seconds to be off */
#define TIME_STAMP_JITTER 0x0000000027100000LL /* we allow a packet to arrive 160 ms (== 0x27100 us) before another
* set to 0x0000000000000000LL if increasing (or equal) time stamps allowed only */
static const uint8_t broadcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
static const uint8_t multicast_addr[6] = { 0x01, 0x00, 0x5E, 0x00, 0x00, 0x00 }; /* First 3 bytes are meaningful */
static const uint8_t ipv6_multicast_addr[6] = { 0x33, 0x33, 0x00, 0x00, 0x00, 0x00 }; /* First 2 bytes are meaningful */

3
src/random_numbers.c

@ -22,9 +22,6 @@
#include "n2n.h"
// syscall and inquiring random number from hardware generators might fail, so we will retry
#define RND_RETRIES 1000
/* The following code offers an alterate pseudo random number generator
namely XORSHIFT128+ to use instead of C's rand(). Its performance is

Loading…
Cancel
Save