xref: /openbsd/share/man/man9/rtable_add.9 (revision 264ca280)
1.\"     $OpenBSD: rtable_add.9,v 1.7 2015/12/11 16:08:30 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: December 11 2015 $
19.Dt RTABLE_ADD 9
20.Os
21.Sh NAME
22.Nm rtable_add ,
23.Nm rtable_exists ,
24.Nm rtable_l2 ,
25.Nm rtable_l2set
26.Nd routing tables and routing domains interface
27.Sh SYNOPSIS
28.In net/rtable.h
29.Ft int
30.Fn rtable_add "unsigned int id"
31.Ft int
32.Fn rtable_exists "unsigned int id"
33.Ft unsigned int
34.Fn rtable_l2 "unsigned int id"
35.Ft void
36.Fn rtable_l2set "unsigned int id" "unsigned int rdomain"
37.Sh DESCRIPTION
38Routing tables contain layer 2 and 3 forwarding information.
39Each address family in use will have its own routing table.
40Routing domains are a way of logically segmenting a router among multiple
41networks and may contain more than one routing table.
42.Bl -tag -width Ds
43.It Fn rtable_add "unsigned int id"
44Add routing table with ID of
45.Fa id
46to routing domain
47.Fa 0 .
48.It Fn rtable_exists "unsigned int id"
49Return
50.Fa 1
51if routing table with ID
52.Fa id
53exists,
54.Fa 0
55otherwise.
56.It Fn rtable_l2 "unsigned int id"
57Get the routing domain of routing table with ID of
58.Fa id .
59.It Fn rtable_l2set "unsigned int id" "unsigned int rdomain"
60Place routing table with ID of
61.Fa id
62under the routing domain with ID of
63.Fa rdomain .
64.El
65.Sh CONTEXT
66.Fn rtable_add ,
67.Fn rtable_exists ,
68.Fn rtable_l2 ,
69and
70.Fn task_l2set
71can be called during autoconf, from process context, or from interrupt context.
72.Sh RETURN VALUES
73.Fn rtable_add
74may fail with:
75.Pp
76.Bl -tag -width Er -compact
77.It Bq Er EEXIST
78A routing table with ID of
79.Fa id
80already exists.
81.It Bq Er ENOMEM
82Memory could not be allocated to extend the list of routing domains.
83.El
84.Sh SEE ALSO
85.Xr route 4 ,
86.Xr route 8
87