5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1990 Mentat Inc.
  24  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  25  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  26  * Copyright 2017 Nexenta Systems, Inc.
  27  * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
  28  */
  29 
  30 #ifndef _INET_IP_H
  31 #define _INET_IP_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <sys/isa_defs.h>
  38 #include <sys/types.h>
  39 #include <inet/mib2.h>
  40 #include <inet/nd.h>
  41 #include <sys/atomic.h>
  42 #include <net/if_dl.h>
  43 #include <net/if.h>
  44 #include <netinet/ip.h>
  45 #include <netinet/igmp.h>
  46 #include <sys/neti.h>
  47 #include <sys/hook.h>
 
1691 
1692                 ill_replumbing : 1,
1693                 ill_arl_dlpi_pending : 1,
1694                 ill_grp_pending : 1,
1695 
1696                 ill_pad_to_bit_31 : 17;
1697 
1698         /* Following bit fields protected by ill_lock */
1699         uint_t
1700                 ill_fragtimer_executing : 1,
1701                 ill_fragtimer_needrestart : 1,
1702                 ill_manual_token : 1,   /* system won't override ill_token */
1703                 /*
1704                  * ill_manual_linklocal : system will not change the
1705                  * linklocal whenever ill_token changes.
1706                  */
1707                 ill_manual_linklocal : 1,
1708 
1709                 ill_manual_dst_linklocal : 1, /* same for pt-pt dst linklocal */
1710 
1711                 ill_pad_bit_31 : 27;
1712 
1713         /*
1714          * Used in SIOCSIFMUXID and SIOCGIFMUXID for 'ifconfig unplumb'.
1715          */
1716         int     ill_muxid;              /* muxid returned from plink */
1717 
1718         /* Used for IP frag reassembly throttling on a per ILL basis.  */
1719         uint_t  ill_ipf_gen;            /* Generation of next fragment queue */
1720         uint_t  ill_frag_count;         /* Count of all reassembly mblk bytes */
1721         uint_t  ill_frag_free_num_pkts;  /* num of fragmented packets to free */
1722         clock_t ill_last_frag_clean_time; /* time when frag's were pruned */
1723         int     ill_type;               /* From <net/if_types.h> */
1724         uint_t  ill_dlpi_multicast_state;       /* See below IDS_* */
1725         uint_t  ill_dlpi_fastpath_state;        /* See below IDS_* */
1726 
1727         /*
1728          * Capabilities related fields.
1729          */
1730         uint_t  ill_dlpi_capab_state;   /* State of capability query, IDCS_* */
1731         uint_t  ill_capab_pending_cnt;
 
 
1753 
1754         kmutex_t        ill_lock;       /* Please see table below */
1755         /*
1756          * The ill_nd_lla* fields handle the link layer address option
1757          * from neighbor discovery. This is used for external IPv6
1758          * address resolution.
1759          */
1760         mblk_t          *ill_nd_lla_mp; /* mblk which holds ill_nd_lla */
1761         uint8_t         *ill_nd_lla;    /* Link Layer Address */
1762         uint_t          ill_nd_lla_len; /* Link Layer Address length */
1763         /*
1764          * We have 4 phys_addr_req's sent down. This field keeps track
1765          * of which one is pending.
1766          */
1767         t_uscalar_t     ill_phys_addr_pend; /* which dl_phys_addr_req pending */
1768         /*
1769          * Used to save errors that occur during plumbing
1770          */
1771         uint_t          ill_ifname_pending_err;
1772         avl_node_t      ill_avl_byppa; /* avl node based on ppa */
1773         list_t          ill_nce; /* pointer to nce_s list */
1774         uint_t          ill_refcnt;     /* active refcnt by threads */
1775         uint_t          ill_ire_cnt;    /* ires associated with this ill */
1776         kcondvar_t      ill_cv;
1777         uint_t          ill_ncec_cnt;   /* ncecs associated with this ill */
1778         uint_t          ill_nce_cnt;    /* nces associated with this ill */
1779         uint_t          ill_waiters;    /* threads waiting in ipsq_enter */
1780         /*
1781          * Contains the upper read queue pointer of the module immediately
1782          * beneath IP.  This field allows IP to validate sub-capability
1783          * acknowledgments coming up from downstream.
1784          */
1785         queue_t         *ill_lmod_rq;   /* read queue pointer of module below */
1786         uint_t          ill_lmod_cnt;   /* number of modules beneath IP */
1787         ip_m_t          *ill_media;     /* media specific params/functions */
1788         t_uscalar_t     ill_dlpi_pending; /* Last DLPI primitive issued */
1789         uint_t          ill_usesrc_ifindex; /* use src addr from this ILL */
1790         struct ill_s    *ill_usesrc_grp_next; /* Next ILL in the usesrc group */
1791         boolean_t       ill_trace_disable;      /* True when alloc fails */
1792         zoneid_t        ill_zoneid;
 
 
1923  * ill_token                    ipsq + ill_lock         ill_lock
1924  * ill_token_length             ipsq + ill_lock         ill_lock
1925  * ill_dest_token               ipsq + down ill         only when ill is up
1926  * ill_xmit_count               ipsq + down ill         write once
1927  * ill_ip6_mib                  ipsq + down ill         only when ill is up
1928  * ill_icmp6_mib                ipsq + down ill         only when ill is up
1929  *
1930  * ill_phyint                   ipsq, ill_g_lock, ill_lock      Any of them
1931  * ill_flags                    ill_lock                ill_lock
1932  * ill_nd_lla_mp                ipsq + down ill         only when ill is up
1933  * ill_nd_lla                   ipsq + down ill         only when ill is up
1934  * ill_nd_lla_len               ipsq + down ill         only when ill is up
1935  * ill_phys_addr_pend           ipsq + down ill         only when ill is up
1936  * ill_ifname_pending_err       ipsq                    ipsq
1937  * ill_avl_byppa                ipsq, ill_g_lock        write once
1938  *
1939  * ill_fastpath_list            ill_lock                ill_lock
1940  * ill_refcnt                   ill_lock                ill_lock
1941  * ill_ire_cnt                  ill_lock                ill_lock
1942  * ill_cv                       ill_lock                ill_lock
1943  * ill_ncec_cnt                 ill_lock                ill_lock
1944  * ill_nce_cnt                  ill_lock                ill_lock
1945  * ill_ilm_cnt                  ill_lock                ill_lock
1946  * ill_src_ipif                 ill_g_lock              ill_g_lock
1947  * ill_trace                    ill_lock                ill_lock
1948  * ill_usesrc_grp_next          ill_g_usesrc_lock       ill_g_usesrc_lock
1949  * ill_dhcpinit                 atomics                 atomics
1950  * ill_flownotify_mh            write once              write once
1951  * ill_capab_pending_cnt        ipsq                    ipsq
1952  * ill_ipallmulti_cnt           ill_lock                ill_lock
1953  * ill_ipallmulti_ilm           ill_lock                ill_lock
1954  * ill_saved_ire_mp             ill_saved_ire_lock      ill_saved_ire_lock
1955  * ill_saved_ire_cnt            ill_saved_ire_lock      ill_saved_ire_lock
1956  * ill_arl                      ???                     ???
1957  * ill_ire_multicast            ipsq + quiescent        none
1958  * ill_bound_ipif               ipsq                    ipsq
1959  * ill_actnode                  ipsq + ipmp_lock        ipsq OR ipmp_lock
1960  * ill_grpnode                  ipsq + ill_g_lock       ipsq OR ill_g_lock
1961  * ill_src_ipif                 ill_g_lock              ill_g_lock
1962  * ill_move_ipif                ipsq                    ipsq
  
 | 
 
 
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1990 Mentat Inc.
  24  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  25  * Copyright 2017 Nexenta Systems, Inc.
  26  * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
  27  * Copyright 2019, Joyent, Inc.
  28  */
  29 
  30 #ifndef _INET_IP_H
  31 #define _INET_IP_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <sys/isa_defs.h>
  38 #include <sys/types.h>
  39 #include <inet/mib2.h>
  40 #include <inet/nd.h>
  41 #include <sys/atomic.h>
  42 #include <net/if_dl.h>
  43 #include <net/if.h>
  44 #include <netinet/ip.h>
  45 #include <netinet/igmp.h>
  46 #include <sys/neti.h>
  47 #include <sys/hook.h>
 
1691 
1692                 ill_replumbing : 1,
1693                 ill_arl_dlpi_pending : 1,
1694                 ill_grp_pending : 1,
1695 
1696                 ill_pad_to_bit_31 : 17;
1697 
1698         /* Following bit fields protected by ill_lock */
1699         uint_t
1700                 ill_fragtimer_executing : 1,
1701                 ill_fragtimer_needrestart : 1,
1702                 ill_manual_token : 1,   /* system won't override ill_token */
1703                 /*
1704                  * ill_manual_linklocal : system will not change the
1705                  * linklocal whenever ill_token changes.
1706                  */
1707                 ill_manual_linklocal : 1,
1708 
1709                 ill_manual_dst_linklocal : 1, /* same for pt-pt dst linklocal */
1710 
1711                 ill_mcast_ncec_cleanup : 1,     /* Reaping mcast ncecs. */
1712                 ill_pad_bit_31 : 26;
1713 
1714         /*
1715          * Used in SIOCSIFMUXID and SIOCGIFMUXID for 'ifconfig unplumb'.
1716          */
1717         int     ill_muxid;              /* muxid returned from plink */
1718 
1719         /* Used for IP frag reassembly throttling on a per ILL basis.  */
1720         uint_t  ill_ipf_gen;            /* Generation of next fragment queue */
1721         uint_t  ill_frag_count;         /* Count of all reassembly mblk bytes */
1722         uint_t  ill_frag_free_num_pkts;  /* num of fragmented packets to free */
1723         clock_t ill_last_frag_clean_time; /* time when frag's were pruned */
1724         int     ill_type;               /* From <net/if_types.h> */
1725         uint_t  ill_dlpi_multicast_state;       /* See below IDS_* */
1726         uint_t  ill_dlpi_fastpath_state;        /* See below IDS_* */
1727 
1728         /*
1729          * Capabilities related fields.
1730          */
1731         uint_t  ill_dlpi_capab_state;   /* State of capability query, IDCS_* */
1732         uint_t  ill_capab_pending_cnt;
 
 
1754 
1755         kmutex_t        ill_lock;       /* Please see table below */
1756         /*
1757          * The ill_nd_lla* fields handle the link layer address option
1758          * from neighbor discovery. This is used for external IPv6
1759          * address resolution.
1760          */
1761         mblk_t          *ill_nd_lla_mp; /* mblk which holds ill_nd_lla */
1762         uint8_t         *ill_nd_lla;    /* Link Layer Address */
1763         uint_t          ill_nd_lla_len; /* Link Layer Address length */
1764         /*
1765          * We have 4 phys_addr_req's sent down. This field keeps track
1766          * of which one is pending.
1767          */
1768         t_uscalar_t     ill_phys_addr_pend; /* which dl_phys_addr_req pending */
1769         /*
1770          * Used to save errors that occur during plumbing
1771          */
1772         uint_t          ill_ifname_pending_err;
1773         avl_node_t      ill_avl_byppa; /* avl node based on ppa */
1774         uint_t          ill_mcast_nces; /* Number of NCEs that are multicast. */
1775         list_t          ill_nce; /* pointer to nce_s list */
1776         uint_t          ill_refcnt;     /* active refcnt by threads */
1777         uint_t          ill_ire_cnt;    /* ires associated with this ill */
1778         kcondvar_t      ill_cv;
1779         uint_t          ill_ncec_cnt;   /* ncecs associated with this ill */
1780         uint_t          ill_nce_cnt;    /* nces associated with this ill */
1781         uint_t          ill_waiters;    /* threads waiting in ipsq_enter */
1782         /*
1783          * Contains the upper read queue pointer of the module immediately
1784          * beneath IP.  This field allows IP to validate sub-capability
1785          * acknowledgments coming up from downstream.
1786          */
1787         queue_t         *ill_lmod_rq;   /* read queue pointer of module below */
1788         uint_t          ill_lmod_cnt;   /* number of modules beneath IP */
1789         ip_m_t          *ill_media;     /* media specific params/functions */
1790         t_uscalar_t     ill_dlpi_pending; /* Last DLPI primitive issued */
1791         uint_t          ill_usesrc_ifindex; /* use src addr from this ILL */
1792         struct ill_s    *ill_usesrc_grp_next; /* Next ILL in the usesrc group */
1793         boolean_t       ill_trace_disable;      /* True when alloc fails */
1794         zoneid_t        ill_zoneid;
 
 
1925  * ill_token                    ipsq + ill_lock         ill_lock
1926  * ill_token_length             ipsq + ill_lock         ill_lock
1927  * ill_dest_token               ipsq + down ill         only when ill is up
1928  * ill_xmit_count               ipsq + down ill         write once
1929  * ill_ip6_mib                  ipsq + down ill         only when ill is up
1930  * ill_icmp6_mib                ipsq + down ill         only when ill is up
1931  *
1932  * ill_phyint                   ipsq, ill_g_lock, ill_lock      Any of them
1933  * ill_flags                    ill_lock                ill_lock
1934  * ill_nd_lla_mp                ipsq + down ill         only when ill is up
1935  * ill_nd_lla                   ipsq + down ill         only when ill is up
1936  * ill_nd_lla_len               ipsq + down ill         only when ill is up
1937  * ill_phys_addr_pend           ipsq + down ill         only when ill is up
1938  * ill_ifname_pending_err       ipsq                    ipsq
1939  * ill_avl_byppa                ipsq, ill_g_lock        write once
1940  *
1941  * ill_fastpath_list            ill_lock                ill_lock
1942  * ill_refcnt                   ill_lock                ill_lock
1943  * ill_ire_cnt                  ill_lock                ill_lock
1944  * ill_cv                       ill_lock                ill_lock
1945  * ill_mcast_nces               ill_lock                ill_lock
1946  * ill_ncec_cnt                 ill_lock                ill_lock
1947  * ill_nce_cnt                  ill_lock                ill_lock
1948  * ill_ilm_cnt                  ill_lock                ill_lock
1949  * ill_src_ipif                 ill_g_lock              ill_g_lock
1950  * ill_trace                    ill_lock                ill_lock
1951  * ill_usesrc_grp_next          ill_g_usesrc_lock       ill_g_usesrc_lock
1952  * ill_dhcpinit                 atomics                 atomics
1953  * ill_flownotify_mh            write once              write once
1954  * ill_capab_pending_cnt        ipsq                    ipsq
1955  * ill_ipallmulti_cnt           ill_lock                ill_lock
1956  * ill_ipallmulti_ilm           ill_lock                ill_lock
1957  * ill_saved_ire_mp             ill_saved_ire_lock      ill_saved_ire_lock
1958  * ill_saved_ire_cnt            ill_saved_ire_lock      ill_saved_ire_lock
1959  * ill_arl                      ???                     ???
1960  * ill_ire_multicast            ipsq + quiescent        none
1961  * ill_bound_ipif               ipsq                    ipsq
1962  * ill_actnode                  ipsq + ipmp_lock        ipsq OR ipmp_lock
1963  * ill_grpnode                  ipsq + ill_g_lock       ipsq OR ill_g_lock
1964  * ill_src_ipif                 ill_g_lock              ill_g_lock
1965  * ill_move_ipif                ipsq                    ipsq
  
 |