1*37328428Smpi.\" $OpenBSD: rtlabel_id2name.9,v 1.4 2014/10/15 11:58:13 mpi Exp $ 2351af3c2Smpi.\" 3351af3c2Smpi.\" Copyright (c) 2011 Bret S. Lambert <blambert@openbsd.org> 4351af3c2Smpi.\" All rights reserved. 5351af3c2Smpi.\" 6351af3c2Smpi.\" Permission to use, copy, modify, and distribute this software for any 7351af3c2Smpi.\" purpose with or without fee is hereby granted, provided that the above 8351af3c2Smpi.\" copyright notice and this permission notice appear in all copies. 9351af3c2Smpi.\" 10351af3c2Smpi.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11351af3c2Smpi.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12351af3c2Smpi.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13351af3c2Smpi.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14351af3c2Smpi.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15351af3c2Smpi.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16351af3c2Smpi.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17351af3c2Smpi.\" 18*37328428Smpi.Dd $Mdocdate: October 15 2014 $ 19351af3c2Smpi.Dt RTLABEL_ID2NAME 9 20351af3c2Smpi.Os 21351af3c2Smpi.Sh NAME 22351af3c2Smpi.Nm rtlabel_id2name , 23351af3c2Smpi.Nm rtlabel_id2sa , 24351af3c2Smpi.Nm rtlabel_name2id , 25351af3c2Smpi.Nm rtlabel_unref 26351af3c2Smpi.Nd manipulate route labels 27351af3c2Smpi.Sh SYNOPSIS 28*37328428Smpi.In sys/types.h 29*37328428Smpi.In sys/socket.h 30351af3c2Smpi.In net/route.h 31341ac37cSmpi.Ft const char * 32351af3c2Smpi.Fn rtlabel_id2name "u_int16_t id" 33351af3c2Smpi.Ft struct sockaddr * 34351af3c2Smpi.Fn rtlabel_id2sa "u_int16_t labelid" "struct sockaddr_rtlabel *sa_rl" 35351af3c2Smpi.Ft u_int16_t 36351af3c2Smpi.Fn rtlabel_name2id "char *name" 37351af3c2Smpi.Ft void 38351af3c2Smpi.Fn rtlabel_unref "u_int16_t id" 39351af3c2Smpi.Sh DESCRIPTION 40*37328428SmpiRoute labels are arbitrary data appended to route entries and can be acted 41*37328428Smpiupon by 42351af3c2Smpi.Xr pf 4 . 43351af3c2Smpi.Bl -tag -width Ds 44351af3c2Smpi.It Fn rtlabel_name2id "char *name" 45351af3c2SmpiReturn numerical ID of the route label named 46351af3c2Smpi.Fa name , 47351af3c2Smpicreating the label if it does not already exist. 48351af3c2Smpi.It Fn rtlabel_id2name "u_int16_t id" 49351af3c2SmpiReturn the string name of the route label with ID 50351af3c2Smpi.Fa id . 51351af3c2Smpi.It Fn rtlabel_id2sa "u_int16_t labelid" "struct sockaddr_rtlabel *sa_rl" 52351af3c2SmpiPopulate 53351af3c2Smpi.Fa sa_rl 54351af3c2Smpiwith the data from the route label specified by 55351af3c2Smpi.Fa labelid . 56351af3c2Smpi.It Fn rtlabel_unref "u_int16_t id" 57351af3c2SmpiRemove a reference to the route label with ID 58351af3c2Smpi.Fa id , 59351af3c2Smpifreeing the label if the reference count drops to 0. 60351af3c2Smpi.El 6144275a43Smpi.Sh CONTEXT 6244275a43Smpi.Fn rtlabel_id2name , 6344275a43Smpi.Fn rtlabel_id2sa , 6444275a43Smpi.Fn rtlabel_name2id , 6544275a43Smpiand 6644275a43Smpi.Fn rtlabel_unref 6744275a43Smpican be called during autoconf, from process context, or from interrupt context. 68351af3c2Smpi.Sh RETURN VALUES 69351af3c2Smpi.Fn rtlabel_name2id 70351af3c2Smpireturns 71351af3c2Smpi.Fa 0 72351af3c2Smpiif it was unable to create a route label. 73351af3c2Smpi.Sh SEE ALSO 74351af3c2Smpi.Xr route 4 , 75351af3c2Smpi.Xr route 9 76