[OpenBSD]

Manual Page Search Parameters

RTLABEL_ID2NAME(9) Kernel Developer's Manual RTLABEL_ID2NAME(9)

rtlabel_id2name, rtlabel_id2sa, rtlabel_name2id, rtlabel_unref
manipulate route labels

#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);

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.

rtlabel_id2name(), rtlabel_id2sa(), rtlabel_name2id(), and rtlabel_unref() can be called during autoconf, from process context, or from interrupt context.

rtlabel_name2id() returns 0 if it was unable to create a route label.

route(4), route(9)
October 15, 2014 OpenBSD-current