ff550d0e264b51131fb34e9e83163b348d916640masputra * CDDL HEADER START
ff550d0e264b51131fb34e9e83163b348d916640masputra * The contents of this file are subject to the terms of the
592d29ab7326015d0a5b56899a233e7f15dd4dffja * Common Development and Distribution License (the "License").
592d29ab7326015d0a5b56899a233e7f15dd4dffja * You may not use this file except in compliance with the License.
ff550d0e264b51131fb34e9e83163b348d916640masputra * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ff550d0e264b51131fb34e9e83163b348d916640masputra * See the License for the specific language governing permissions
ff550d0e264b51131fb34e9e83163b348d916640masputra * and limitations under the License.
ff550d0e264b51131fb34e9e83163b348d916640masputra * When distributing Covered Code, include this CDDL HEADER in each
ff550d0e264b51131fb34e9e83163b348d916640masputra * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ff550d0e264b51131fb34e9e83163b348d916640masputra * If applicable, add the following below this CDDL HEADER, with the
ff550d0e264b51131fb34e9e83163b348d916640masputra * fields enclosed by brackets "[]" replaced with your own identifying
ff550d0e264b51131fb34e9e83163b348d916640masputra * information: Portions Copyright [yyyy] [name of copyright owner]
ff550d0e264b51131fb34e9e83163b348d916640masputra * CDDL HEADER END
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
ff550d0e264b51131fb34e9e83163b348d916640masputra * Use is subject to license terms.
ff550d0e264b51131fb34e9e83163b348d916640masputra * IP implementation private declarations. These interfaces are
ff550d0e264b51131fb34e9e83163b348d916640masputra * used to build the IP module and are not meant to be accessed
ff550d0e264b51131fb34e9e83163b348d916640masputra * by any modules except IP itself. They are undocumented and are
ff550d0e264b51131fb34e9e83163b348d916640masputra * subject to change without notice.
ff550d0e264b51131fb34e9e83163b348d916640masputraextern "C" {
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark#define IP_ICMPV6_CSUM_COMP (IPPROTO_ICMPV6 << 8)
ff550d0e264b51131fb34e9e83163b348d916640masputra ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + TCP_CHECKSUM_OFFSET)))
ff550d0e264b51131fb34e9e83163b348d916640masputra ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + UDP_CHECKSUM_OFFSET)))
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + ICMPV6_CHECKSUM_OFFSET)))
ff550d0e264b51131fb34e9e83163b348d916640masputra (((ill)->ill_capabilities & ILL_CAPAB_HCKSUM) != 0)
ff550d0e264b51131fb34e9e83163b348d916640masputra * Macro to adjust a given checksum value depending on any prepended
ff550d0e264b51131fb34e9e83163b348d916640masputra * or postpended data on the packet. It expects the start offset to
ff550d0e264b51131fb34e9e83163b348d916640masputra * begin at an even boundary and that the packet consists of at most
ff550d0e264b51131fb34e9e83163b348d916640masputra * two mblks.
ff550d0e264b51131fb34e9e83163b348d916640masputra#define IP_ADJCKSUM_PARTIAL(cksum_start, mp, mp1, len, adj) { \
ff550d0e264b51131fb34e9e83163b348d916640masputra * Prepended extraneous data; adjust checksum. \
ff550d0e264b51131fb34e9e83163b348d916640masputra if ((len) > 0) \
ff550d0e264b51131fb34e9e83163b348d916640masputra * len is now the total length of mblk(s) \
ff550d0e264b51131fb34e9e83163b348d916640masputra * Postpended extraneous data; adjust checksum. \
ff550d0e264b51131fb34e9e83163b348d916640masputra * If the postpended extraneous data was odd \
ff550d0e264b51131fb34e9e83163b348d916640masputra * byte aligned, swap resulting checksum bytes. \
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark ((ipha)->ipha_version_and_hdr_length == IP_SIMPLE_HDR_VERSION)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark * Currently supported flags for LSO.
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark#define LSO_BASIC_TCP_IPV4 DLD_LSO_BASIC_TCP_IPV4
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark#define LSO_BASIC_TCP_IPV6 DLD_LSO_BASIC_TCP_IPV6
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark (((ill)->ill_capabilities & ILL_CAPAB_LSO) != 0)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark ill->ill_lso_capab->ill_lso_flags & LSO_BASIC_TCP_IPV4)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark ill->ill_lso_capab->ill_lso_flags & LSO_BASIC_TCP_IPV6)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark (((ill)->ill_capabilities & ILL_CAPAB_ZEROCOPY) != 0)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark (ILL_ZCOPY_CAPABLE(ill) && (ill->ill_zerocopy_capab != NULL) && \
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark (ill->ill_zerocopy_capab->ill_zerocopy_flags != 0))
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng/* Macro that follows definitions of flags for mac_tx() (see mac_client.h) */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define IP_DROP_ON_NO_DESC 0x01 /* Equivalent to MAC_DROP_ON_NO_DESC */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng (((ill)->ill_capabilities & ILL_CAPAB_DLD_DIRECT) != 0)
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmark/* This macro is used by the mac layer */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng (DB_TYPE(mp) != M_DATA || DB_REF(mp) != 1 || !OK_32PTR(ipha) || \
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng (((uchar_t *)ipha + IP_SIMPLE_HDR_LENGTH) >= (mp)->b_wptr))
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirk * In non-global zone exclusive IP stacks, data structures such as IRE
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirk * entries pretend that they're in the global zone. The following
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirk * macro evaluates to the real zoneid instead of a pretend
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirk * GLOBAL_ZONEID.
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirk netstackid_to_zoneid((ipst)->ips_netstack->netstack_stackid) : \
da14cebe459d3275048785f25bd869cb09b5307fEric Chengextern void ill_flow_enable(void *, ip_mac_tx_cookie_t);
bd670b35a010421b6e1a5536c34453a827007c81Erik Nordmarkextern zoneid_t ip_get_zoneid_v4(ipaddr_t, mblk_t *, ip_recv_attr_t *,
b127ac411761a3d8d642d9342d9cac2785e1faaaPhilip Kirkextern zoneid_t ip_get_zoneid_v6(in6_addr_t *, mblk_t *, const ill_t *,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailextern void conn_ire_revalidate(conn_t *, void *);
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailextern void ip_ire_unbind_walker(ire_t *, void *);
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailextern void ip_ire_rebind_walker(ire_t *, void *);
0f1702c5201310f0529cd5abb77652e5e9b241b6Yu Xiangning * flag passed in by IP based protocols to get a private ip stream with
0f1702c5201310f0529cd5abb77652e5e9b241b6Yu Xiangning * no conn_t. Note this flag has the same value as SO_FALLBACK
ff550d0e264b51131fb34e9e83163b348d916640masputra#endif /* _KERNEL */
ff550d0e264b51131fb34e9e83163b348d916640masputra#endif /* _INET_IP_IMPL_H */