1.\" $OpenBSD: rtlabel_id2name.9,v 1.2 2014/03/18 15:01:07 mpi Exp $ 2.\" 3.\" Copyright (c) 2011 Bret S. Lambert <blambert@openbsd.org> 4.\" All rights reserved. 5.\" 6.\" Permission to use, copy, modify, and distribute this software for any 7.\" purpose with or without fee is hereby granted, provided that the above 8.\" copyright notice and this permission notice appear in all copies. 9.\" 10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17.\" 18.Dd $Mdocdate: March 18 2014 $ 19.Dt RTLABEL_ID2NAME 9 20.Os 21.Sh NAME 22.Nm rtlabel_id2name , 23.Nm rtlabel_id2sa , 24.Nm rtlabel_name2id , 25.Nm rtlabel_unref 26.Nd manipulate route labels 27.Sh SYNOPSIS 28.In net/route.h 29.Ft const char * 30.Fn rtlabel_id2name "u_int16_t id" 31.Ft struct sockaddr * 32.Fn rtlabel_id2sa "u_int16_t labelid" "struct sockaddr_rtlabel *sa_rl" 33.Ft u_int16_t 34.Fn rtlabel_name2id "char *name" 35.Ft void 36.Fn rtlabel_unref "u_int16_t id" 37.Sh DESCRIPTION 38Route labels are arbitrary data appended to routes and can be acted upon by 39.Xr pf 4 . 40.Bl -tag -width Ds 41.It Fn rtlabel_name2id "char *name" 42Return numerical ID of the route label named 43.Fa name , 44creating the label if it does not already exist. 45.It Fn rtlabel_id2name "u_int16_t id" 46Return the string name of the route label with ID 47.Fa id . 48.It Fn rtlabel_id2sa "u_int16_t labelid" "struct sockaddr_rtlabel *sa_rl" 49Populate 50.Fa sa_rl 51with the data from the route label specified by 52.Fa labelid . 53.It Fn rtlabel_unref "u_int16_t id" 54Remove a reference to the route label with ID 55.Fa id , 56freeing the label if the reference count drops to 0. 57.El 58.Sh RETURN VALUES 59.Fn rtlabel_name2id 60returns 61.Fa 0 62if it was unable to create a route label. 63.Sh SEE ALSO 64.Xr route 4 , 65.Xr route 9 66