1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +01:00

gnrc_sock: add dynamic port range

This commit is contained in:
smlng 2016-12-15 10:50:08 +01:00
parent 89edffa8cc
commit 2c5f07b62b

View File

@ -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