30 #include <sys/types.h>
31 #include <sys/modctl.h>
32 #include <sys/dlpi.h>
33 #include <sys/mac.h>
34 #include <sys/mac_ipv4.h>
35 #include <sys/byteorder.h>
36 #include <sys/strsun.h>
37 #include <netinet/in.h>
38 #include <netinet/ip.h>
39 #include <inet/common.h>
40 #include <inet/ip.h>
41 #include <inet/iptun.h>
42
43 static struct modlmisc mac_ipv4_modlmisc = {
44 &mod_miscops,
45 "IPv4 tunneling MAC plugin"
46 };
47
48 static struct modlinkage mac_ipv4_modlinkage = {
49 MODREV_1,
50 &mac_ipv4_modlmisc,
51 NULL
52 };
53
54 static mactype_ops_t mac_ipv4_type_ops;
55
56 int
57 _init(void)
58 {
59 mactype_register_t *mtrp;
60 int err;
61
62 if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
63 return (ENOTSUP);
64 mtrp->mtr_ident = MAC_PLUGIN_IDENT_IPV4;
65 mtrp->mtr_ops = &mac_ipv4_type_ops;
66 mtrp->mtr_mactype = DL_IPV4;
67 mtrp->mtr_nativetype = DL_IPV4;
68 mtrp->mtr_addrlen = sizeof (ipaddr_t);
69 if ((err = mactype_register(mtrp)) == 0) {
70 if ((err = mod_install(&mac_ipv4_modlinkage)) != 0)
71 (void) mactype_unregister(MAC_PLUGIN_IDENT_IPV4);
|
30 #include <sys/types.h>
31 #include <sys/modctl.h>
32 #include <sys/dlpi.h>
33 #include <sys/mac.h>
34 #include <sys/mac_ipv4.h>
35 #include <sys/byteorder.h>
36 #include <sys/strsun.h>
37 #include <netinet/in.h>
38 #include <netinet/ip.h>
39 #include <inet/common.h>
40 #include <inet/ip.h>
41 #include <inet/iptun.h>
42
43 static struct modlmisc mac_ipv4_modlmisc = {
44 &mod_miscops,
45 "IPv4 tunneling MAC plugin"
46 };
47
48 static struct modlinkage mac_ipv4_modlinkage = {
49 MODREV_1,
50 { &mac_ipv4_modlmisc,
51 NULL }
52 };
53
54 static mactype_ops_t mac_ipv4_type_ops;
55
56 int
57 _init(void)
58 {
59 mactype_register_t *mtrp;
60 int err;
61
62 if ((mtrp = mactype_alloc(MACTYPE_VERSION)) == NULL)
63 return (ENOTSUP);
64 mtrp->mtr_ident = MAC_PLUGIN_IDENT_IPV4;
65 mtrp->mtr_ops = &mac_ipv4_type_ops;
66 mtrp->mtr_mactype = DL_IPV4;
67 mtrp->mtr_nativetype = DL_IPV4;
68 mtrp->mtr_addrlen = sizeof (ipaddr_t);
69 if ((err = mactype_register(mtrp)) == 0) {
70 if ((err = mod_install(&mac_ipv4_modlinkage)) != 0)
71 (void) mactype_unregister(MAC_PLUGIN_IDENT_IPV4);
|