ip_impl.h revision 6e91bba0d6c6bdabbba62cefae583715a4a58e2a
/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _INET_IP_IMPL_H
#define _INET_IP_IMPL_H
/*
* IP implementation private declarations. These interfaces are
* used to build the IP module and are not meant to be accessed
* by any modules except IP itself. They are undocumented and are
* subject to change without notice.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#include <inet/tunables.h>
#define IP_MOD_ID 5701
#define INET_NAME "ip"
#ifdef _BIG_ENDIAN
#define IP_HDR_CSUM_TTL_ADJUST 256
#define IP_TCP_CSUM_COMP IPPROTO_TCP
#define IP_UDP_CSUM_COMP IPPROTO_UDP
#define IP_ICMPV6_CSUM_COMP IPPROTO_ICMPV6
#else
#define IP_HDR_CSUM_TTL_ADJUST 1
#endif
#define TCP_CHECKSUM_OFFSET 16
#define TCP_CHECKSUM_SIZE 2
#define UDP_CHECKSUM_OFFSET 6
#define UDP_CHECKSUM_SIZE 2
#define ICMPV6_CHECKSUM_OFFSET 2
#define ICMPV6_CHECKSUM_SIZE 2
#define ILL_HCKSUM_CAPABLE(ill) \
/*
* Macro to adjust a given checksum value depending on any prepended
* or postpended data on the packet. It expects the start offset to
* begin at an even boundary and that the packet consists of at most
* two mblks.
*/
/* \
* Prepended extraneous data; adjust checksum. \
*/ \
if ((len) > 0) \
else \
(adj) = 0; \
/* \
* len is now the total length of mblk(s) \
*/ \
else \
/* \
* Postpended extraneous data; adjust checksum. \
*/ \
\
/* \
* If the postpended extraneous data was odd \
* byte aligned, swap resulting checksum bytes. \
*/ \
else \
} \
}
#define IS_SIMPLE_IPH(ipha) \
/*
* Currently supported flags for LSO.
*/
#define ILL_LSO_CAPABLE(ill) \
#define ILL_LSO_USABLE(ill) \
(ILL_LSO_CAPABLE(ill) && \
#define ILL_LSO_TCP_IPV4_USABLE(ill) \
(ILL_LSO_USABLE(ill) && \
#define ILL_LSO_TCP_IPV6_USABLE(ill) \
(ILL_LSO_USABLE(ill) && \
#define ILL_ZCOPY_CAPABLE(ill) \
#define ILL_ZCOPY_USABLE(ill) \
/* Macro that follows definitions of flags for mac_tx() (see mac_client.h) */
#define ILL_DIRECT_CAPABLE(ill) \
/* This macro is used by the mac layer */
/*
* In non-global zone exclusive IP stacks, data structures such as IRE
* entries pretend that they're in the global zone. The following
* macro evaluates to the real zoneid instead of a pretend
* GLOBAL_ZONEID.
*/
(((zoneid) == GLOBAL_ZONEID) ? \
(zoneid))
extern void ill_flow_enable(void *, ip_mac_tx_cookie_t);
zoneid_t);
ip_recv_attr_t *, zoneid_t);
extern void conn_ire_revalidate(conn_t *, void *);
extern void ip_ire_unbind_walker(ire_t *, void *);
extern void ip_ire_rebind_walker(ire_t *, void *);
/*
* flag passed in by IP based protocols to get a private ip stream with
* no conn_t. Note this flag has the same value as SO_FALLBACK
*/
#define IP_HELPER_STR SO_FALLBACK
#define IP_MOD_MINPSZ 1
#define IP_MOD_MAXPSZ INFPSZ
#define IP_MOD_HIWAT 65536
#define IP_MOD_LOWAT 1024
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _INET_IP_IMPL_H */