/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* DL_IPV6 MAC Type plugin for the Nemo mac module
*/
#include <sys/mac_ipv6.h>
#include <sys/mac_ipv4_impl.h>
#include <sys/byteorder.h>
"IPv6 tunneling MAC plugin"
};
};
int
_init(void)
{
int err;
return (EINVAL);
(void) mactype_unregister(MAC_PLUGIN_IDENT_IPV6);
}
return (err);
}
int
_fini(void)
{
int err;
return (err);
return (mod_remove(&mac_ipv6_modlinkage));
}
int
{
}
/*
* MAC Type plugin operations
*/
/* ARGSUSED */
int
{
if (IN6_IS_ADDR_UNSPECIFIED(in6addr) ||
return (EINVAL);
}
return (0);
}
/*
* Build an IPv6 link-layer header for tunneling. If provided, the
* template header provided by the driver supplies the traffic class, flow
* label, hop limit, and potential options. The template's payload length
* must either be 0 if there are no extension headers, or reflect the size
* of the extension headers if present. The template's next header value
* must either be IPPROTO_NONE if no extension headers are present, or
* reflect the type of extension header that follows (the same is true for
* the field values of the extension headers themselves.)
*/
/* ARGSUSED */
mblk_t *
{
return (NULL);
if (tmpl_ip6hp != NULL)
return (NULL);
if (tmpl_ip6hp != NULL) {
} else {
}
if (*nxt_proto != IPPROTO_NONE) {
while (*nxt_proto != IPPROTO_NONE) {
}
}
return (mp);
}
/* ARGSUSED */
int
{
return (EINVAL);
/*
* IPv6 tunnels don't have a concept of link-layer multicast since
* they have fixed unicast endpoints.
*/
return (EINVAL);
return (EINVAL);
return (EINVAL);
}
hdr_info->mhi_pktsize = 0;
return (0);
}
/*
* This plugin's MAC plugin data is a template IPv6 header followed by
* optional extension headers. The chain of headers must be terminated by
* a header with a next header value of IPPROTO_NONE. The payload length
* of the IPv6 header must be 0 if there are no extension headers, or must
* reflect the total size of extension headers present.
*/
{
/*
* Since the plugin does not require plugin data, it is acceptable
* for drivers to pass in NULL plugin data as long as the plugin
* data size is consistent.
*/
return (pdata_size == 0);
/* First verify that we have enough data to hold an IPv6 header. */
if (pdata_size < sizeof (ip6_t))
return (B_FALSE);
/* Make sure that pdata_size is consistent with the payload length. */
return (B_FALSE);
/*
* Make sure that the header chain is terminated by a header with a
* next header value of IPPROTO_NONE.
*/
if (nexthdr == IPPROTO_NONE)
/* make sure we're pointing at a complete header */
break;
}
}
mac_ipv4_multicst_verify, /* neither plugin supports multicast */
mac_ipv4_sap_verify, /* same set of legal SAP values */
NULL,
NULL,
};