32 #include <sys/dlpi.h>
33 #include <sys/mac.h>
34 #include <sys/mac_ipv6.h>
35 #include <sys/mac_ipv4_impl.h>
36 #include <sys/byteorder.h>
37 #include <sys/strsun.h>
38 #include <netinet/ip6.h>
39 #include <inet/common.h>
40 #include <inet/mib2.h>
41 #include <inet/ip.h>
42 #include <inet/ip6.h>
43 #include <inet/iptun.h>
44
45 static struct modlmisc mac_ipv6_modlmisc = {
46 &mod_miscops,
47 "IPv6 tunneling MAC plugin"
48 };
49
50 static struct modlinkage mac_ipv6_modlinkage = {
51 MODREV_1,
52 &mac_ipv6_modlmisc,
53 NULL
54 };
55
56 static mactype_ops_t mac_ipv6_type_ops;
57
58 int
59 _init(void)
60 {
61 mactype_register_t *mtrp;
62 int err;
63
64 if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
65 return (EINVAL);
66 mtrp->mtr_ident = MAC_PLUGIN_IDENT_IPV6;
67 mtrp->mtr_ops = &mac_ipv6_type_ops;
68 mtrp->mtr_mactype = DL_IPV6;
69 mtrp->mtr_nativetype = DL_IPV6;
70 mtrp->mtr_addrlen = sizeof (in6_addr_t);
71 if ((err = mactype_register(mtrp)) == 0) {
72 if ((err = mod_install(&mac_ipv6_modlinkage)) != 0)
73 (void) mactype_unregister(MAC_PLUGIN_IDENT_IPV6);
|
32 #include <sys/dlpi.h>
33 #include <sys/mac.h>
34 #include <sys/mac_ipv6.h>
35 #include <sys/mac_ipv4_impl.h>
36 #include <sys/byteorder.h>
37 #include <sys/strsun.h>
38 #include <netinet/ip6.h>
39 #include <inet/common.h>
40 #include <inet/mib2.h>
41 #include <inet/ip.h>
42 #include <inet/ip6.h>
43 #include <inet/iptun.h>
44
45 static struct modlmisc mac_ipv6_modlmisc = {
46 &mod_miscops,
47 "IPv6 tunneling MAC plugin"
48 };
49
50 static struct modlinkage mac_ipv6_modlinkage = {
51 MODREV_1,
52 { &mac_ipv6_modlmisc,
53 NULL }
54 };
55
56 static mactype_ops_t mac_ipv6_type_ops;
57
58 int
59 _init(void)
60 {
61 mactype_register_t *mtrp;
62 int err;
63
64 if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
65 return (EINVAL);
66 mtrp->mtr_ident = MAC_PLUGIN_IDENT_IPV6;
67 mtrp->mtr_ops = &mac_ipv6_type_ops;
68 mtrp->mtr_mactype = DL_IPV6;
69 mtrp->mtr_nativetype = DL_IPV6;
70 mtrp->mtr_addrlen = sizeof (in6_addr_t);
71 if ((err = mactype_register(mtrp)) == 0) {
72 if ((err = mod_install(&mac_ipv6_modlinkage)) != 0)
73 (void) mactype_unregister(MAC_PLUGIN_IDENT_IPV6);
|