xref: /openbsd/sys/netmpls/mpls_proto.c (revision 7eb8d89d)
1*7eb8d89dSguenther /*	$OpenBSD: mpls_proto.c,v 1.20 2022/02/22 01:15:02 guenther Exp $	*/
2d90b9793Snorby 
3d90b9793Snorby /*
4d90b9793Snorby  * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project.
5d90b9793Snorby  * All rights reserved.
6d90b9793Snorby  *
7d90b9793Snorby  * Redistribution and use in source and binary forms, with or without
8d90b9793Snorby  * modification, are permitted provided that the following conditions
9d90b9793Snorby  * are met:
10d90b9793Snorby  *
11d90b9793Snorby  * 1. Redistributions of source code must retain the above copyright
12d90b9793Snorby  *    notice, this list of conditions and the following disclaimer.
13d90b9793Snorby  * 2. Redistributions in binary form must reproduce the above copyright
14d90b9793Snorby  *    notice, this list of conditions and the following disclaimer in the
15d90b9793Snorby  *    documentation and/or other materials provided with the distribution.
16d90b9793Snorby  * 3. Neither the name of the project nor the names of its contributors
17d90b9793Snorby  *    may be used to endorse or promote products derived from this software
18d90b9793Snorby  *    without specific prior written permission.
19d90b9793Snorby  *
20d90b9793Snorby  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21d90b9793Snorby  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22d90b9793Snorby  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23d90b9793Snorby  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24d90b9793Snorby  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25d90b9793Snorby  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26d90b9793Snorby  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27d90b9793Snorby  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28d90b9793Snorby  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29d90b9793Snorby  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30d90b9793Snorby  * SUCH DAMAGE.
31d90b9793Snorby  */
32d90b9793Snorby 
33d90b9793Snorby #include <sys/param.h>
34d90b9793Snorby #include <sys/socket.h>
35d90b9793Snorby #include <sys/domain.h>
36d90b9793Snorby #include <sys/mbuf.h>
37d90b9793Snorby 
38d90b9793Snorby #include <net/if.h>
390deb6685Smpi #include <net/if_var.h>
4055df0a74Smpi #include <net/rtable.h>
41d90b9793Snorby 
42d90b9793Snorby #include <netmpls/mpls.h>
43d90b9793Snorby 
44d90b9793Snorby /*
452b751374Sclaudio  * MPLS address family: needed for the routing table
46d90b9793Snorby  */
47c90e7dccSbluhm const struct domain mplsdomain = {
4857e8cdb9Smpi   .dom_family = AF_MPLS,
4957e8cdb9Smpi   .dom_name = "mpls",
50ff10691eSclaudio   .dom_sasize = sizeof(struct sockaddr_mpls),
5157e8cdb9Smpi   .dom_rtoffset = offsetof(struct sockaddr_mpls, smpls_label),
5257e8cdb9Smpi   .dom_maxplen = 32
53d90b9793Snorby };
54