Print this page
fixup .text where possible
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/mac/plugins/mac_6to4.c
+++ new/usr/src/uts/common/io/mac/plugins/mac_6to4.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 /*
27 27 * DL_6TO4 MAC Type plugin for the Nemo mac module
28 28 */
29 29
30 30 #include <sys/modctl.h>
31 31 #include <sys/dlpi.h>
32 32 #include <inet/ip.h>
33 33 #include <sys/mac.h>
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
34 34 #include <sys/mac_6to4.h>
35 35 #include <sys/mac_ipv4_impl.h>
36 36
37 37 static struct modlmisc mac_6to4_modlmisc = {
38 38 &mod_miscops,
39 39 "6to4 tunneling MAC plugin"
40 40 };
41 41
42 42 static struct modlinkage mac_6to4_modlinkage = {
43 43 MODREV_1,
44 - &mac_6to4_modlmisc,
45 - NULL
44 + { &mac_6to4_modlmisc,
45 + NULL }
46 46 };
47 47
48 48 static mactype_ops_t mac_6to4_type_ops;
49 49
50 50 int
51 51 _init(void)
52 52 {
53 53 mactype_register_t *mtrp;
54 54 int err;
55 55
56 56 if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
57 57 return (ENOTSUP);
58 58 mtrp->mtr_ident = MAC_PLUGIN_IDENT_6TO4;
59 59 mtrp->mtr_ops = &mac_6to4_type_ops;
60 60 mtrp->mtr_mactype = DL_6TO4;
61 61 mtrp->mtr_nativetype = DL_6TO4;
62 62 mtrp->mtr_addrlen = sizeof (ipaddr_t);
63 63 if ((err = mactype_register(mtrp)) == 0) {
64 64 if ((err = mod_install(&mac_6to4_modlinkage)) != 0)
65 65 (void) mactype_unregister(MAC_PLUGIN_IDENT_6TO4);
66 66 }
67 67 mactype_free(mtrp);
68 68 return (err);
69 69 }
70 70
71 71 int
72 72 _fini(void)
73 73 {
74 74 int err;
75 75 if ((err = mactype_unregister(MAC_PLUGIN_IDENT_6TO4)) != 0)
76 76 return (err);
77 77 return (mod_remove(&mac_6to4_modlinkage));
78 78 }
79 79
80 80 int
81 81 _info(struct modinfo *modinfop)
82 82 {
83 83 return (mod_info(&mac_6to4_modlinkage, modinfop));
84 84 }
85 85
86 86 /*
87 87 * MAC Type plugin operations. Note that because 6to4 is a form of
88 88 * tunneling over IPv4, this plugin is able to steal most of its operations
89 89 * from the IPv4 plugin.
90 90 */
91 91
92 92 /*
93 93 * Check the legality of a 6to4 tunnel SAP value. The only acceptable
94 94 * values are IPPROTO_IPV6 (IPv6 in IPv4 tunneling) and 0 (for snoop).
95 95 */
96 96 /* ARGSUSED */
97 97 boolean_t
98 98 mac_6to4_sap_verify(uint32_t sap, uint32_t *bind_sap, void *pdata)
99 99 {
100 100 if (sap == IPPROTO_IPV6 || sap == 0) {
101 101 if (bind_sap != NULL)
102 102 *bind_sap = sap;
103 103 return (B_TRUE);
104 104 }
105 105 return (B_FALSE);
106 106 }
107 107
108 108 static mactype_ops_t mac_6to4_type_ops = {
109 109 MTOPS_PDATA_VERIFY,
110 110 mac_ipv4_unicst_verify,
111 111 mac_ipv4_multicst_verify,
112 112 mac_6to4_sap_verify,
113 113 mac_ipv4_header,
114 114 mac_ipv4_header_info,
115 115 mac_ipv4_pdata_verify,
116 116 NULL,
117 117 NULL,
118 118 NULL
119 119 };
↓ open down ↓ |
64 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX