IPV6_FLOWLABEL_MGR
allows to
request flow label manager to allocate new flow label, to reuse
already allocated one or to delete old flow label.
Its argument is struct
in6_flowlabel_req
:
struct in6_flowlabel_req { struct in6_addr flr_dst; __u32 flr_label; __u8 flr_action; __u8 flr_share; __u16 flr_flags; __u16 flr_expires; __u16 flr_linger; __u32 __flr_reserved; /* Options in format of IPV6_PKTOPTIONS */ };
dst
is IPv6 destination address associated with the label.
label
is flow label value in network byte order. If it is zero,
kernel will allocate new pseudo-random number. Otherwise, kernel will try
to lease flow label ordered by user. In this case, it is user task to provide
necessary flow label randomness.
action
is requested operation. Currently, only three operations
are defined:
#define IPV6_FL_A_GET 0 /* Get flow label */ #define IPV6_FL_A_PUT 1 /* Release flow label */ #define IPV6_FL_A_RENEW 2 /* Update expire time */
flags
are optional modifiers. Currently
only IPV6_FL_A_GET
has modifiers:
#define IPV6_FL_F_CREATE 1 /* Allowed to create new label */ #define IPV6_FL_F_EXCL 2 /* Do not create new label */
share
defines who is allowed to reuse the same flow label.
#define IPV6_FL_S_NONE 0 /* Not defined */ #define IPV6_FL_S_EXCL 1 /* Label is private */ #define IPV6_FL_S_PROCESS 2 /* May be reused by this process */ #define IPV6_FL_S_USER 3 /* May be reused by this user */ #define IPV6_FL_S_ANY 255 /* Anyone may reuse it */
linger
is time in seconds. After the last user releases flow
label, it will not be reused with different destination and options at least
during this time. If share
is not IPV6_FL_S_EXCL
the label
still can be shared by another sockets. Current implementation does not allow
unprivileged user to set linger longer than 60 sec.
expires
is time in seconds. Flow label will be kept at least
for this time, but it will not be destroyed before user released it explicitly
or closed all the sockets using it. Current implementation does not allow
unprivileged user to set timeout longer than 60 sec. Proviledged applications
MAY set longer lifetimes, but in this case they MUST save allocated
labels at stable storage and restore them back after reboot before the first
application allocates new flow.
This structure is followed by optional extension headers associated
with this flow label in format of IPV6_PKTOPTIONS
. Only
IPV6_HOPOPTS
, IPV6_RTHDR
and, if IPV6_RTHDR
presents,
IPV6_DSTOPTS
are allowed.