NAME
rtlabel_id2name
,
rtlabel_id2sa
,
rtlabel_name2id
,
rtlabel_unref
—
manipulate route labels
SYNOPSIS
#include
<sys/types.h>
#include <sys/socket.h>
#include <net/route.h>
const char *
rtlabel_id2name
(u_int16_t
id);
struct sockaddr *
rtlabel_id2sa
(u_int16_t
labelid, struct
sockaddr_rtlabel *sa_rl);
u_int16_t
rtlabel_name2id
(char
*name);
void
rtlabel_unref
(u_int16_t
id);
DESCRIPTION
Route labels are arbitrary data appended to route entries and can be acted upon by pf(4).rtlabel_name2id
(char *name)- Return numerical ID of the route label named name, creating the label if it does not already exist.
rtlabel_id2name
(u_int16_t id)- Return the string name of the route label with ID id.
rtlabel_id2sa
(u_int16_t labelid, struct sockaddr_rtlabel *sa_rl)- Populate sa_rl with the data from the route label specified by labelid.
rtlabel_unref
(u_int16_t id)- Remove a reference to the route label with ID id, freeing the label if the reference count drops to 0.
CONTEXT
rtlabel_id2name
(),
rtlabel_id2sa
(),
rtlabel_name2id
(), and
rtlabel_unref
() can be called during autoconf, from
process context, or from interrupt context.
RETURN VALUES
rtlabel_name2id
() returns
0 if it was unable to create a route label.