Browse Source

gnrc_sock: add dynamic port range

pr/spi.typo
smlng 6 years ago
parent
commit
2c5f07b62b
  1. 17
      sys/net/gnrc/sock/include/gnrc_sock_internal.h

17
sys/net/gnrc/sock/include/gnrc_sock_internal.h

@ -28,6 +28,7 @@
#include "net/af.h"
#include "net/gnrc.h"
#include "net/gnrc/netreg.h"
#include "net/iana.h"
#include "net/sock/ip.h"
#include "sock_types.h"
@ -36,6 +37,22 @@
extern "C" {
#endif
/**
* @brief Default port range for dynamic source port allocation
*/
#define GNRC_SOCK_DYN_PORTRANGE_MIN (IANA_DYNAMIC_PORTRANGE_MIN)
#define GNRC_SOCK_DYN_PORTRANGE_MAX (IANA_DYNAMIC_PORTRANGE_MAX)
#define GNRC_SOCK_DYN_PORTRANGE_NUM (GNRC_SOCK_DYN_PORTRANGE_MAX - GNRC_SOCK_DYN_PORTRANGE_MIN + 1)
#define GNRC_SOCK_DYN_PORTRANGE_ERR (0)
/**
* @brief Offset for next dynamic port
*
* Currently set to a static (prime) offset, but could be random, too
* see https://tools.ietf.org/html/rfc6056#section-3.3.3
*/
#define GNRC_SOCK_DYN_PORTRANGE_OFF (17U)
/**
* @brief Internal helper functions for GNRC
* @internal

Loading…
Cancel
Save