usr.sbin/makefs/ffs: Remove m_buf::b_is_hammer2
[dragonfly.git] / sys / netproto / mpls / mpls_proto.c
blob1219e7ef65fd20042c840f1d569a631d8d2f05a7
1 /*
2 * Copyright (c) 2007 The DragonFly Project. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 * 3. Neither the name of The DragonFly Project nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific, prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
32 #include <sys/domain.h>
33 #include <sys/kernel.h> /* SYSINIT via DOMAIN_SET */
34 #include <sys/protosw.h>
35 #include <sys/socket.h>
36 #include <sys/globaldata.h>
37 #include <sys/thread.h>
39 #include <net/radix.h> /* rn_inithead */
41 #include <netproto/mpls/mpls.h>
42 #include <netproto/mpls/mpls_var.h>
44 /* forward declarations */
45 static struct domain mplsdomain;
46 static struct pr_usrreqs nousrreqs; /* XXX use this for something */
48 struct protosw mplssw[] = {
50 .pr_type = 0,
51 .pr_domain = &mplsdomain,
53 .pr_init = mpls_init,
54 .pr_usrreqs = &nousrreqs
57 .pr_type = SOCK_RAW,
58 .pr_domain = &mplsdomain,
59 .pr_protocol = 0,
60 .pr_flags = PR_ATOMIC|PR_ADDR,
62 .pr_usrreqs = &nousrreqs
66 static int
67 mpls_inithead(void **head, int off)
69 return rn_inithead(head, rn_cpumaskhead(mycpuid), off);
72 static struct domain mplsdomain = {
73 AF_MPLS, /* dom_family */
74 "mpls", /* dom_name */
75 NULL, /* dom_init */
76 NULL, /* dom_externalize */
77 NULL, /* dom_dispose */
78 mplssw, /* dom_protosw */
79 &mplssw[NELEM(mplssw)],
80 /* dom_protoswNPROTOSW */
81 SLIST_ENTRY_INITIALIZER, /* dom_next */
82 mpls_inithead, /* dom_rtattach */
83 32, /* dom_rtoffset */
84 sizeof(struct sockaddr_mpls), /* dom_maxrtkey */
85 NULL, /* dom_ifattach */
86 NULL /* dom_ifdetach */
89 DOMAIN_SET(mpls);
91 #if 0
92 SYSCTL_NODE(_net, PF_MPLS, mpls, CTLFLAG_RW, 0,
93 "MPLS Family");
94 #endif