1 0 stevel /* 2 0 stevel * CDDL HEADER START 3 0 stevel * 4 0 stevel * The contents of this file are subject to the terms of the 5 1676 jpk * Common Development and Distribution License (the "License"). 6 1676 jpk * You may not use this file except in compliance with the License. 7 0 stevel * 8 0 stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 0 stevel * or http://www.opensolaris.org/os/licensing. 10 0 stevel * See the License for the specific language governing permissions 11 0 stevel * and limitations under the License. 12 0 stevel * 13 0 stevel * When distributing Covered Code, include this CDDL HEADER in each 14 0 stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 0 stevel * If applicable, add the following below this CDDL HEADER, with the 16 0 stevel * fields enclosed by brackets "[]" replaced with your own identifying 17 0 stevel * information: Portions Copyright [yyyy] [name of copyright owner] 18 0 stevel * 19 0 stevel * CDDL HEADER END 20 0 stevel */ 21 0 stevel /* 22 8485 Peter * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 0 stevel * Use is subject to license terms. 24 0 stevel */ 25 0 stevel /* Copyright (c) 1990 Mentat Inc. */ 26 0 stevel 27 0 stevel #ifndef _INET_IP_IF_H 28 0 stevel #define _INET_IP_IF_H 29 1676 jpk 30 1676 jpk #include <net/route.h> 31 0 stevel 32 0 stevel #ifdef __cplusplus 33 0 stevel extern "C" { 34 0 stevel #endif 35 0 stevel 36 0 stevel #define PREFIX_INFINITY 0xffffffffUL 37 0 stevel #define IP_MAX_HW_LEN 40 38 0 stevel 39 0 stevel #define IP_LOOPBACK_MTU (8*1024) 40 0 stevel 41 0 stevel #ifdef _KERNEL 42 0 stevel /* 43 0 stevel * Interface flags actually represent the state/properties of 3 different 44 0 stevel * abstractions of interfaces in IP. Interface flags are set using 45 0 stevel * SIOCS[L]IFFLAGS ioctl. The three abstractions are : 46 0 stevel * 47 0 stevel * 1) Physical interface (phyint) : There is one phyint allocated common 48 0 stevel * to both IPv4 and IPv6 physical interface instance. 49 0 stevel * 50 0 stevel * 2) Physical interface instance (ill) : This encompasses all the state 51 0 stevel * that is common across all IP addresses assigned to a physical 52 0 stevel * interface but different between the IPv4 and IPv6 instance. 53 0 stevel * 54 0 stevel * 3) Logical interface (ipif) : This has state about a single IP address. 55 0 stevel * 56 0 stevel * Values for the various states are derived from the same name space 57 0 stevel * as applications querying the state using SIOCGIFFLAGS/SIOCGLIFFLAGS 58 0 stevel * see only one state returned in lifr_flags which is a union of all 59 0 stevel * the above states/properties. Thus deriving the values from the common 60 0 stevel * name space makes implementation easier. All these values are stored in 61 0 stevel * uint64_t and any other structure/code using these flags should use 62 0 stevel * uint64_ts. 63 0 stevel * 64 0 stevel * As we maintain the interface flags in 3 different flags namely 65 0 stevel * phyint_flags, ill_flags, ipif_flags we define the following flag values 66 0 stevel * to be used within the kernel to reduce potential errors. The ones 67 0 stevel * starting with PHYI_ are supposed to be used with phyint_flags, the ones 68 0 stevel * starting with ILLF_ are supposed to be used with ill_flags and the ones 69 0 stevel * starting with IPIF_ are supposed to be used with ipif_flags. If you see 70 0 stevel * any code with a mismatch i.e phyint_flags & IPIF_UP - it is wrong. Only 71 0 stevel * PHYI_XXX can be used with phyint_flags. 72 0 stevel * 73 0 stevel * NOTE : For EVERY FLAG in if.h, there should be a corresponding value 74 0 stevel * defined HERE and this is the one that should be USED within IP. We 75 0 stevel * use IFF_ flags within IP only when we examine lifr_flags. 76 0 stevel */ 77 0 stevel #define IFF_PHYINT_FLAGS (IFF_LOOPBACK|IFF_RUNNING|IFF_PROMISC| \ 78 0 stevel IFF_ALLMULTI|IFF_INTELLIGENT|IFF_MULTI_BCAST|IFF_FAILED|IFF_STANDBY| \ 79 8485 Peter IFF_INACTIVE|IFF_OFFLINE|IFF_VIRTUAL|IFF_IPMP) 80 0 stevel 81 0 stevel #define IFF_PHYINTINST_FLAGS (IFF_DEBUG|IFF_NOTRAILERS|IFF_NOARP| \ 82 0 stevel IFF_MULTICAST|IFF_ROUTER|IFF_NONUD|IFF_NORTEXCH|IFF_IPV4|IFF_IPV6| \ 83 11076 Cathy IFF_COS_ENABLED|IFF_FIXEDMTU|IFF_VRRP|IFF_NOACCEPT) 84 0 stevel 85 0 stevel #define IFF_LOGINT_FLAGS (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT| \ 86 0 stevel IFF_UNNUMBERED|IFF_DHCPRUNNING|IFF_PRIVATE|IFF_NOXMIT|IFF_NOLOCAL| \ 87 4823 seb IFF_DEPRECATED|IFF_ADDRCONF|IFF_ANYCAST|IFF_NOFAILOVER| \ 88 11042 Erik IFF_PREFERRED|IFF_TEMPORARY|IFF_DUPLICATE) 89 0 stevel 90 0 stevel #define PHYI_LOOPBACK IFF_LOOPBACK /* is a loopback net */ 91 0 stevel #define PHYI_RUNNING IFF_RUNNING /* resources allocated */ 92 0 stevel #define PHYI_PROMISC IFF_PROMISC /* receive all packets */ 93 0 stevel #define PHYI_ALLMULTI IFF_ALLMULTI /* receive all multi packets */ 94 0 stevel #define PHYI_INTELLIGENT IFF_INTELLIGENT /* protocol code on board */ 95 0 stevel #define PHYI_MULTI_BCAST IFF_MULTI_BCAST /* multicast using broadcast */ 96 0 stevel #define PHYI_FAILED IFF_FAILED /* NIC has failed */ 97 0 stevel #define PHYI_STANDBY IFF_STANDBY /* Standby NIC */ 98 0 stevel #define PHYI_INACTIVE IFF_INACTIVE /* Standby active or not ? */ 99 0 stevel #define PHYI_OFFLINE IFF_OFFLINE /* NIC has been offlined */ 100 0 stevel #define PHYI_VIRTUAL IFF_VIRTUAL /* Will not send or recv pkts */ 101 8485 Peter #define PHYI_IPMP IFF_IPMP /* IPMP meta-interface */ 102 0 stevel 103 0 stevel #define ILLF_DEBUG IFF_DEBUG /* turn on debugging */ 104 0 stevel #define ILLF_NOTRAILERS IFF_NOTRAILERS /* avoid use of trailers */ 105 0 stevel #define ILLF_NOARP IFF_NOARP /* no ARP for this interface */ 106 0 stevel #define ILLF_MULTICAST IFF_MULTICAST /* supports multicast */ 107 0 stevel #define ILLF_ROUTER IFF_ROUTER /* router on this interface */ 108 0 stevel #define ILLF_NONUD IFF_NONUD /* No NUD on this interface */ 109 0 stevel #define ILLF_NORTEXCH IFF_NORTEXCH /* No routing info exchange */ 110 0 stevel #define ILLF_IPV4 IFF_IPV4 /* IPv4 interface */ 111 0 stevel #define ILLF_IPV6 IFF_IPV6 /* IPv6 interface */ 112 0 stevel #define ILLF_COS_ENABLED IFF_COS_ENABLED /* Is CoS marking supported */ 113 11042 Erik #define ILLF_FIXEDMTU IFF_FIXEDMTU /* set with SIOCSLIFMTU */ 114 11076 Cathy #define ILLF_VRRP IFF_VRRP /* managed by VRRP */ 115 11076 Cathy #define ILLF_NOACCEPT IFF_NOACCEPT /* accept only ND messagees */ 116 0 stevel 117 0 stevel #define IPIF_UP IFF_UP /* interface is up */ 118 0 stevel #define IPIF_BROADCAST IFF_BROADCAST /* broadcast address valid */ 119 0 stevel #define IPIF_POINTOPOINT IFF_POINTOPOINT /* point-to-point link */ 120 0 stevel #define IPIF_UNNUMBERED IFF_UNNUMBERED /* non-unique address */ 121 0 stevel #define IPIF_DHCPRUNNING IFF_DHCPRUNNING /* DHCP controlled interface */ 122 0 stevel #define IPIF_PRIVATE IFF_PRIVATE /* do not advertise */ 123 0 stevel #define IPIF_NOXMIT IFF_NOXMIT /* Do not transmit packets */ 124 0 stevel #define IPIF_NOLOCAL IFF_NOLOCAL /* Just on-link subnet */ 125 0 stevel #define IPIF_DEPRECATED IFF_DEPRECATED /* address deprecated */ 126 0 stevel #define IPIF_ADDRCONF IFF_ADDRCONF /* stateless addrconf */ 127 0 stevel #define IPIF_ANYCAST IFF_ANYCAST /* Anycast address */ 128 0 stevel #define IPIF_NOFAILOVER IFF_NOFAILOVER /* No failover on NIC failure */ 129 0 stevel #define IPIF_PREFERRED IFF_PREFERRED /* Prefer as source address */ 130 0 stevel #define IPIF_TEMPORARY IFF_TEMPORARY /* RFC3041 */ 131 2546 carlsonj #define IPIF_DUPLICATE IFF_DUPLICATE /* address is in use */ 132 0 stevel 133 8275 Eric #ifdef DEBUG 134 8275 Eric #define ILL_MAC_PERIM_HELD(ill) ill_mac_perim_held(ill) 135 8275 Eric #else 136 8275 Eric #define ILL_MAC_PERIM_HELD(ill) 137 8275 Eric #endif 138 11042 Erik 139 11042 Erik /* 140 11042 Erik * match flags for ipif_lookup_addr_common* functions 141 11042 Erik */ 142 11042 Erik #define IPIF_MATCH_ILLGRP 0x00000001 143 11042 Erik #define IPIF_MATCH_NONDUP 0x00000002 144 8275 Eric 145 2546 carlsonj /* for ipif_resolver_up */ 146 2546 carlsonj enum ip_resolver_action { 147 2546 carlsonj Res_act_initial, /* initial address establishment */ 148 8485 Peter Res_act_rebind, /* IPMP address rebind (new hwaddr) */ 149 8485 Peter Res_act_defend, /* address defense */ 150 8485 Peter Res_act_none /* do nothing */ 151 2546 carlsonj }; 152 2546 carlsonj 153 11042 Erik extern int ill_add_ires(ill_t *); 154 11042 Erik extern void ill_delete_ires(ill_t *); 155 11042 Erik extern void ill_dlpi_done(ill_t *, t_uscalar_t); 156 8485 Peter extern boolean_t ill_dlpi_pending(ill_t *, t_uscalar_t); 157 11042 Erik extern void ill_dlpi_dispatch(ill_t *, mblk_t *); 158 0 stevel extern void ill_dlpi_send(ill_t *, mblk_t *); 159 4360 meem extern void ill_dlpi_send_deferred(ill_t *); 160 11042 Erik extern void ill_dlpi_queue(ill_t *, mblk_t *); 161 11042 Erik extern void ill_dlpi_send_queued(ill_t *); 162 11042 Erik extern void ill_mcast_queue(ill_t *, mblk_t *); 163 11042 Erik extern void ill_mcast_send_queued(ill_t *); 164 11042 Erik extern void ill_mcast_timer_start(ip_stack_t *); 165 8275 Eric extern void ill_capability_done(ill_t *); 166 4360 meem 167 0 stevel extern mblk_t *ill_dlur_gen(uchar_t *, uint_t, t_uscalar_t, t_scalar_t); 168 3448 dh155122 /* NOTE: Keep unmodified ill_lookup_on_ifindex for ipp for now */ 169 11042 Erik extern ill_t *ill_lookup_on_ifindex_global_instance(uint_t, boolean_t); 170 11042 Erik extern ill_t *ill_lookup_on_ifindex(uint_t, boolean_t, ip_stack_t *); 171 11042 Erik extern ill_t *ill_lookup_on_ifindex_zoneid(uint_t, zoneid_t, boolean_t, 172 11042 Erik ip_stack_t *); 173 0 stevel extern ill_t *ill_lookup_on_name(char *, boolean_t, 174 11042 Erik boolean_t, boolean_t *, ip_stack_t *); 175 11042 Erik extern boolean_t ip_ifindex_valid(uint_t, boolean_t, ip_stack_t *); 176 3448 dh155122 extern uint_t ill_get_next_ifindex(uint_t, boolean_t, ip_stack_t *); 177 3448 dh155122 extern uint_t ill_get_ifindex_by_name(char *, ip_stack_t *); 178 11042 Erik extern uint_t ill_get_upper_ifindex(const ill_t *); 179 0 stevel extern void ill_delete(ill_t *); 180 0 stevel extern void ill_delete_tail(ill_t *); 181 0 stevel extern int ill_dl_phys(ill_t *, ipif_t *, mblk_t *, queue_t *); 182 11042 Erik extern int ill_dls_info(struct sockaddr_dl *, const ill_t *); 183 0 stevel extern void ill_fastpath_ack(ill_t *, mblk_t *); 184 0 stevel extern int ill_fastpath_probe(ill_t *, mblk_t *); 185 4360 meem extern int ill_forward_set(ill_t *, boolean_t); 186 0 stevel extern void ill_frag_prune(ill_t *, uint_t); 187 0 stevel extern void ill_frag_free_pkts(ill_t *, ipfb_t *, ipf_t *, int); 188 0 stevel extern time_t ill_frag_timeout(ill_t *, time_t); 189 0 stevel extern int ill_init(queue_t *, ill_t *); 190 8485 Peter extern void ill_restart_dad(ill_t *, boolean_t); 191 10616 Sebastien extern void ill_setdefaulttoken(ill_t *); 192 10616 Sebastien extern void ill_setdesttoken(ill_t *); 193 11042 Erik extern void ill_set_inputfn(ill_t *); 194 11042 Erik extern void ill_set_inputfn_all(ip_stack_t *); 195 3340 meem extern int ill_set_phys_addr(ill_t *, mblk_t *); 196 9073 Cathy extern int ill_replumb(ill_t *, mblk_t *); 197 3340 meem extern void ill_set_ndmp(ill_t *, mblk_t *, uint_t, uint_t); 198 0 stevel 199 6255 sowmini extern boolean_t ill_is_freeable(ill_t *ill); 200 0 stevel extern void ill_refhold(ill_t *); 201 0 stevel extern void ill_refhold_locked(ill_t *); 202 11042 Erik extern boolean_t ill_check_and_refhold(ill_t *); 203 0 stevel extern void ill_refrele(ill_t *); 204 0 stevel extern boolean_t ill_waiter_inc(ill_t *); 205 0 stevel extern void ill_waiter_dcr(ill_t *); 206 0 stevel extern void ill_trace_ref(ill_t *); 207 0 stevel extern void ill_untrace_ref(ill_t *); 208 11042 Erik extern void ill_downi(ire_t *, char *); 209 11042 Erik extern void ill_downi_if_clone(ire_t *, char *); 210 0 stevel extern boolean_t ill_down_start(queue_t *, mblk_t *); 211 11042 Erik extern ill_t *ill_lookup_group_v4(ipaddr_t, zoneid_t, 212 11042 Erik ip_stack_t *, boolean_t *, ipaddr_t *); 213 3448 dh155122 extern ill_t *ill_lookup_group_v6(const in6_addr_t *, zoneid_t, 214 11042 Erik ip_stack_t *, boolean_t *, in6_addr_t *); 215 8275 Eric 216 0 stevel extern void ill_capability_ack(ill_t *, mblk_t *); 217 0 stevel extern void ill_capability_probe(ill_t *); 218 8275 Eric extern void ill_capability_reset(ill_t *, boolean_t); 219 8275 Eric extern void ill_taskq_dispatch(ip_stack_t *); 220 8275 Eric 221 11042 Erik extern void ill_get_name(const ill_t *, char *, int); 222 11042 Erik extern void ill_group_cleanup(ill_t *); 223 8485 Peter extern int ill_up_ipifs(ill_t *, queue_t *, mblk_t *); 224 11042 Erik extern void ip_update_source_selection(ip_stack_t *); 225 8485 Peter extern uint_t ill_appaddr_cnt(const ill_t *); 226 8485 Peter extern uint_t ill_ptpaddr_cnt(const ill_t *); 227 11042 Erik extern uint_t ill_admupaddr_cnt(const ill_t *); 228 11042 Erik 229 11042 Erik extern ill_t *ill_lookup_multicast(ip_stack_t *, zoneid_t, boolean_t); 230 11042 Erik extern void ill_save_ire(ill_t *, ire_t *); 231 11042 Erik extern void ill_remove_saved_ire(ill_t *, ire_t *); 232 11042 Erik extern int ill_recover_saved_ire(ill_t *); 233 0 stevel 234 10649 Peter extern void ip_interface_cleanup(ip_stack_t *); 235 4972 meem extern void ipif_get_name(const ipif_t *, char *, int); 236 3448 dh155122 extern ipif_t *ipif_getby_indexes(uint_t, uint_t, boolean_t, ip_stack_t *); 237 3448 dh155122 extern void ipif_init(ip_stack_t *); 238 11042 Erik extern ipif_t *ipif_lookup_addr(ipaddr_t, ill_t *, zoneid_t, ip_stack_t *); 239 11042 Erik extern ipif_t *ipif_lookup_addr_exact(ipaddr_t, ill_t *, ip_stack_t *); 240 11042 Erik extern ipif_t *ipif_lookup_addr_nondup(ipaddr_t, ill_t *, zoneid_t, 241 11042 Erik ip_stack_t *); 242 0 stevel extern ipif_t *ipif_lookup_addr_v6(const in6_addr_t *, ill_t *, zoneid_t, 243 8485 Peter ip_stack_t *); 244 8485 Peter extern ipif_t *ipif_lookup_addr_exact_v6(const in6_addr_t *, ill_t *, 245 8348 Eric ip_stack_t *); 246 11042 Erik extern ipif_t *ipif_lookup_addr_nondup_v6(const in6_addr_t *, ill_t *, 247 11042 Erik zoneid_t, ip_stack_t *); 248 3448 dh155122 extern zoneid_t ipif_lookup_addr_zoneid(ipaddr_t, ill_t *, ip_stack_t *); 249 3448 dh155122 extern zoneid_t ipif_lookup_addr_zoneid_v6(const in6_addr_t *, ill_t *, 250 3448 dh155122 ip_stack_t *); 251 11042 Erik extern ipif_t *ipif_lookup_interface(ipaddr_t, ipaddr_t, ip_stack_t *); 252 0 stevel extern ipif_t *ipif_lookup_remote(ill_t *, ipaddr_t, zoneid_t); 253 11042 Erik extern boolean_t ipif_lookup_testaddr_v6(ill_t *, const in6_addr_t *, 254 11042 Erik ipif_t **); 255 11042 Erik extern boolean_t ipif_lookup_testaddr_v4(ill_t *, const in_addr_t *, 256 11042 Erik ipif_t **); 257 11042 Erik extern ipif_t *ipif_select_source_v4(ill_t *, ipaddr_t, zoneid_t, boolean_t, 258 11042 Erik boolean_t *); 259 11042 Erik extern boolean_t ipif_zone_avail(uint_t, boolean_t, zoneid_t, ip_stack_t *); 260 11042 Erik extern ipif_t *ipif_good_addr(ill_t *, zoneid_t); 261 11042 Erik extern int ip_select_source_v4(ill_t *, ipaddr_t, ipaddr_t, ipaddr_t, 262 11042 Erik zoneid_t, ip_stack_t *, ipaddr_t *, uint32_t *, uint64_t *); 263 0 stevel extern void ipif_refhold(ipif_t *); 264 0 stevel extern void ipif_refhold_locked(ipif_t *); 265 8485 Peter extern void ipif_refrele(ipif_t *); 266 0 stevel extern void ipif_all_down_tail(ipsq_t *, queue_t *, mblk_t *, void *); 267 2546 carlsonj extern int ipif_resolver_up(ipif_t *, enum ip_resolver_action); 268 0 stevel extern int ipif_down(ipif_t *, queue_t *, mblk_t *); 269 11042 Erik extern int ipif_down_tail(ipif_t *); 270 8485 Peter extern void ipif_multicast_down(ipif_t *); 271 0 stevel extern void ipif_multicast_up(ipif_t *); 272 0 stevel extern void ipif_ndp_down(ipif_t *); 273 8485 Peter extern int ipif_ndp_up(ipif_t *, boolean_t); 274 0 stevel extern int ipif_up_done(ipif_t *); 275 0 stevel extern int ipif_up_done_v6(ipif_t *); 276 8023 Phil extern void ipif_up_notify(ipif_t *); 277 8485 Peter extern ipif_t *ipif_select_source_v6(ill_t *, const in6_addr_t *, boolean_t, 278 11042 Erik uint32_t, zoneid_t, boolean_t, boolean_t *); 279 11042 Erik extern int ip_select_source_v6(ill_t *, const in6_addr_t *, 280 11042 Erik const in6_addr_t *, zoneid_t, ip_stack_t *, uint_t, uint32_t, in6_addr_t *, 281 11042 Erik uint32_t *, uint64_t *); 282 0 stevel extern boolean_t ipif_cant_setlinklocal(ipif_t *); 283 10616 Sebastien extern void ipif_setlinklocal(ipif_t *); 284 10616 Sebastien extern void ipif_setdestlinklocal(ipif_t *); 285 11042 Erik extern ipif_t *ipif_lookup_on_ifindex(uint_t, boolean_t, zoneid_t, 286 11042 Erik ip_stack_t *); 287 0 stevel extern ipif_t *ipif_get_next_ipif(ipif_t *curr, ill_t *ill); 288 0 stevel extern void ipif_ill_refrele_tail(ill_t *ill); 289 11042 Erik extern void ipif_nce_down(ipif_t *ipif); 290 11042 Erik extern int ipif_arp_down(ipif_t *ipif); 291 2546 carlsonj extern void ipif_mask_reply(ipif_t *); 292 8485 Peter extern int ipif_up(ipif_t *, queue_t *, mblk_t *); 293 0 stevel 294 3340 meem extern void ipsq_current_start(ipsq_t *, ipif_t *, int); 295 3340 meem extern void ipsq_current_finish(ipsq_t *); 296 0 stevel extern void ipsq_enq(ipsq_t *, queue_t *, mblk_t *, ipsq_func_t, int, 297 0 stevel ill_t *); 298 8275 Eric extern boolean_t ipsq_enter(ill_t *, boolean_t, int); 299 0 stevel extern ipsq_t *ipsq_try_enter(ipif_t *, ill_t *, queue_t *, mblk_t *, 300 0 stevel ipsq_func_t, int, boolean_t); 301 7098 meem extern void ipsq_exit(ipsq_t *); 302 8275 Eric extern boolean_t ill_mac_perim_held(ill_t *); 303 0 stevel extern mblk_t *ipsq_pending_mp_get(ipsq_t *, conn_t **); 304 0 stevel extern boolean_t ipsq_pending_mp_add(conn_t *, ipif_t *, queue_t *, 305 0 stevel mblk_t *, int); 306 4360 meem extern void qwriter_ip(ill_t *, queue_t *, mblk_t *, ipsq_func_t, int, 307 4360 meem boolean_t); 308 0 stevel 309 4972 meem typedef int ip_extract_func_t(queue_t *, mblk_t *, const ip_ioctl_cmd_t *, 310 11042 Erik cmd_info_t *); 311 4972 meem 312 4972 meem extern ip_extract_func_t ip_extract_arpreq, ip_extract_lifreq; 313 4972 meem 314 4972 meem extern int ip_addr_availability_check(ipif_t *); 315 0 stevel extern void ip_ll_subnet_defaults(ill_t *, mblk_t *); 316 11076 Cathy extern void ill_capability_send(ill_t *, mblk_t *); 317 1676 jpk 318 0 stevel extern int ip_rt_add(ipaddr_t, ipaddr_t, ipaddr_t, ipaddr_t, int, 319 11042 Erik ill_t *, ire_t **, boolean_t, struct rtsa_s *, ip_stack_t *, zoneid_t); 320 0 stevel extern int ip_rt_add_v6(const in6_addr_t *, const in6_addr_t *, 321 11042 Erik const in6_addr_t *, const in6_addr_t *, int, ill_t *, ire_t **, 322 11042 Erik struct rtsa_s *, ip_stack_t *, zoneid_t); 323 0 stevel extern int ip_rt_delete(ipaddr_t, ipaddr_t, ipaddr_t, uint_t, int, 324 11042 Erik ill_t *, boolean_t, ip_stack_t *, zoneid_t); 325 0 stevel extern int ip_rt_delete_v6(const in6_addr_t *, const in6_addr_t *, 326 11042 Erik const in6_addr_t *, uint_t, int, ill_t *, ip_stack_t *, zoneid_t); 327 0 stevel extern int ip_siocdelndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *, 328 0 stevel ip_ioctl_cmd_t *, void *); 329 0 stevel extern int ip_siocqueryndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *, 330 0 stevel ip_ioctl_cmd_t *, void *); 331 0 stevel extern int ip_siocsetndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *, 332 0 stevel ip_ioctl_cmd_t *, void *); 333 0 stevel 334 0 stevel extern int ip_siocaddrt(ipif_t *, sin_t *, queue_t *, mblk_t *, 335 0 stevel ip_ioctl_cmd_t *, void *); 336 0 stevel extern int ip_siocdelrt(ipif_t *, sin_t *, queue_t *, mblk_t *, 337 0 stevel ip_ioctl_cmd_t *, void *); 338 0 stevel 339 0 stevel extern int ip_sioctl_addr(ipif_t *, sin_t *, queue_t *, mblk_t *, 340 0 stevel ip_ioctl_cmd_t *, void *); 341 0 stevel extern int ip_sioctl_addr_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 342 0 stevel ip_ioctl_cmd_t *, void *); 343 0 stevel extern int ip_sioctl_get_addr(ipif_t *, sin_t *, queue_t *, mblk_t *, 344 0 stevel ip_ioctl_cmd_t *, void *); 345 0 stevel 346 0 stevel extern int ip_sioctl_dstaddr(ipif_t *, sin_t *, queue_t *, mblk_t *, 347 0 stevel ip_ioctl_cmd_t *, void *); 348 0 stevel extern int ip_sioctl_dstaddr_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 349 0 stevel ip_ioctl_cmd_t *, void *); 350 0 stevel extern int ip_sioctl_get_dstaddr(ipif_t *, sin_t *, queue_t *, mblk_t *, 351 0 stevel ip_ioctl_cmd_t *, void *); 352 0 stevel 353 0 stevel extern int ip_sioctl_flags(ipif_t *, sin_t *, queue_t *, mblk_t *, 354 0 stevel ip_ioctl_cmd_t *, void *); 355 0 stevel extern int ip_sioctl_flags_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 356 0 stevel ip_ioctl_cmd_t *, void *); 357 0 stevel extern int ip_sioctl_get_flags(ipif_t *, sin_t *, queue_t *, mblk_t *, 358 0 stevel ip_ioctl_cmd_t *, void *); 359 0 stevel 360 0 stevel extern int ip_sioctl_mtu(ipif_t *, sin_t *, queue_t *, mblk_t *, 361 0 stevel ip_ioctl_cmd_t *, void *); 362 0 stevel extern int ip_sioctl_get_mtu(ipif_t *, sin_t *, queue_t *, mblk_t *, 363 0 stevel ip_ioctl_cmd_t *, void *); 364 0 stevel 365 0 stevel extern int ip_sioctl_get_ifconf(ipif_t *, sin_t *, queue_t *, mblk_t *, 366 0 stevel ip_ioctl_cmd_t *, void *); 367 0 stevel extern int ip_sioctl_get_lifconf(ipif_t *, sin_t *, queue_t *, mblk_t *, 368 0 stevel ip_ioctl_cmd_t *, void *); 369 0 stevel extern int ip_sioctl_get_ifnum(ipif_t *, sin_t *, queue_t *, mblk_t *, 370 0 stevel ip_ioctl_cmd_t *, void *); 371 0 stevel extern int ip_sioctl_get_lifnum(ipif_t *, sin_t *, queue_t *, mblk_t *, 372 0 stevel ip_ioctl_cmd_t *, void *); 373 0 stevel 374 0 stevel extern int ip_sioctl_token(ipif_t *, sin_t *, queue_t *, mblk_t *, 375 0 stevel ip_ioctl_cmd_t *, void *); 376 0 stevel extern int ip_sioctl_get_token(ipif_t *, sin_t *, queue_t *, mblk_t *, 377 0 stevel ip_ioctl_cmd_t *, void *); 378 0 stevel 379 0 stevel extern int if_unitsel(ipif_t *, sin_t *, queue_t *, mblk_t *, 380 0 stevel ip_ioctl_cmd_t *, void *); 381 0 stevel extern int if_unitsel_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 382 0 stevel ip_ioctl_cmd_t *, void *); 383 0 stevel 384 0 stevel extern int ip_sioctl_sifname(ipif_t *, sin_t *, queue_t *, mblk_t *, 385 0 stevel ip_ioctl_cmd_t *, void *); 386 0 stevel 387 0 stevel extern int ip_sioctl_slifname(ipif_t *, sin_t *, queue_t *, mblk_t *, 388 0 stevel ip_ioctl_cmd_t *, void *); 389 0 stevel extern int ip_sioctl_slifname_restart(ipif_t *, sin_t *, queue_t *, 390 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 391 0 stevel 392 0 stevel extern int ip_sioctl_slifindex(ipif_t *, sin_t *, queue_t *, mblk_t *, 393 0 stevel ip_ioctl_cmd_t *, void *); 394 0 stevel extern int ip_sioctl_get_lifindex(ipif_t *, sin_t *, queue_t *, mblk_t *, 395 0 stevel ip_ioctl_cmd_t *, void *); 396 0 stevel 397 0 stevel extern int ip_sioctl_brdaddr(ipif_t *, sin_t *, queue_t *, mblk_t *, 398 0 stevel ip_ioctl_cmd_t *, void *); 399 0 stevel extern int ip_sioctl_get_brdaddr(ipif_t *, sin_t *, queue_t *, mblk_t *, 400 0 stevel ip_ioctl_cmd_t *, void *); 401 0 stevel 402 0 stevel extern int ip_sioctl_get_muxid(ipif_t *, sin_t *, queue_t *, mblk_t *, 403 0 stevel ip_ioctl_cmd_t *, void *); 404 0 stevel extern int ip_sioctl_muxid(ipif_t *, sin_t *, queue_t *, mblk_t *, 405 0 stevel ip_ioctl_cmd_t *, void *); 406 0 stevel 407 0 stevel extern int ip_sioctl_netmask(ipif_t *, sin_t *, queue_t *, mblk_t *, 408 0 stevel ip_ioctl_cmd_t *, void *); 409 0 stevel extern int ip_sioctl_get_netmask(ipif_t *, sin_t *, queue_t *, mblk_t *, 410 0 stevel ip_ioctl_cmd_t *, void *); 411 0 stevel extern int ip_sioctl_netmask_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 412 0 stevel ip_ioctl_cmd_t *, void *); 413 0 stevel 414 0 stevel extern int ip_sioctl_subnet(ipif_t *, sin_t *, queue_t *, mblk_t *, 415 0 stevel ip_ioctl_cmd_t *, void *); 416 0 stevel extern int ip_sioctl_subnet_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 417 0 stevel ip_ioctl_cmd_t *, void *); 418 0 stevel extern int ip_sioctl_get_subnet(ipif_t *, sin_t *, queue_t *, mblk_t *, 419 0 stevel ip_ioctl_cmd_t *, void *); 420 0 stevel 421 0 stevel extern int ip_sioctl_lnkinfo(ipif_t *, sin_t *, queue_t *, mblk_t *, 422 0 stevel ip_ioctl_cmd_t *, void *); 423 0 stevel extern int ip_sioctl_get_lnkinfo(ipif_t *, sin_t *, queue_t *, mblk_t *, 424 0 stevel ip_ioctl_cmd_t *, void *); 425 0 stevel 426 0 stevel extern int ip_sioctl_metric(ipif_t *, sin_t *, queue_t *, mblk_t *, 427 0 stevel ip_ioctl_cmd_t *, void *); 428 0 stevel extern int ip_sioctl_get_metric(ipif_t *, sin_t *, queue_t *, mblk_t *, 429 0 stevel ip_ioctl_cmd_t *, void *); 430 0 stevel 431 0 stevel extern int ip_sioctl_arp(ipif_t *, sin_t *, queue_t *, mblk_t *, 432 0 stevel ip_ioctl_cmd_t *, void *); 433 0 stevel 434 0 stevel extern int ip_sioctl_addif(ipif_t *, sin_t *, queue_t *, mblk_t *, 435 0 stevel ip_ioctl_cmd_t *, void *); 436 0 stevel extern int ip_sioctl_removeif(ipif_t *, sin_t *, queue_t *, mblk_t *, 437 0 stevel ip_ioctl_cmd_t *, void *); 438 0 stevel extern int ip_sioctl_removeif_restart(ipif_t *, sin_t *, queue_t *, mblk_t *, 439 0 stevel ip_ioctl_cmd_t *, void *); 440 0 stevel 441 0 stevel extern int ip_sioctl_tonlink(ipif_t *, sin_t *, queue_t *, mblk_t *, 442 0 stevel ip_ioctl_cmd_t *, void *); 443 0 stevel extern int ip_sioctl_tmysite(ipif_t *, sin_t *, queue_t *, mblk_t *, 444 0 stevel ip_ioctl_cmd_t *, void *); 445 0 stevel extern int ip_sioctl_tmyaddr(ipif_t *, sin_t *, queue_t *, mblk_t *, 446 0 stevel ip_ioctl_cmd_t *, void *); 447 0 stevel 448 8485 Peter extern int ip_sioctl_get_binding(ipif_t *, sin_t *, queue_t *, 449 8485 Peter mblk_t *, ip_ioctl_cmd_t *, void *); 450 0 stevel extern int ip_sioctl_groupname(ipif_t *, sin_t *, queue_t *, 451 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 452 0 stevel extern int ip_sioctl_get_groupname(ipif_t *, sin_t *, queue_t *, 453 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 454 8485 Peter extern int ip_sioctl_groupinfo(ipif_t *, sin_t *, queue_t *, 455 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 456 0 stevel 457 0 stevel extern int ip_sioctl_get_lifzone(ipif_t *, sin_t *, queue_t *, 458 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 459 0 stevel extern int ip_sioctl_slifzone(ipif_t *, sin_t *, queue_t *, 460 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 461 0 stevel extern int ip_sioctl_slifzone_restart(ipif_t *, sin_t *, queue_t *, 462 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 463 0 stevel 464 0 stevel extern int ip_sioctl_get_lifusesrc(ipif_t *, sin_t *, queue_t *, 465 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 466 0 stevel extern int ip_sioctl_slifusesrc(ipif_t *, sin_t *, queue_t *, 467 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 468 0 stevel extern int ip_sioctl_get_lifsrcof(ipif_t *, sin_t *, queue_t *, 469 0 stevel mblk_t *, ip_ioctl_cmd_t *, void *); 470 0 stevel 471 0 stevel extern void ip_sioctl_copyin_resume(ipsq_t *, queue_t *, mblk_t *, void *); 472 0 stevel extern void ip_sioctl_copyin_setup(queue_t *, mblk_t *); 473 0 stevel extern ip_ioctl_cmd_t *ip_sioctl_lookup(int); 474 11042 Erik extern void ipif_delete_ires_v4(ipif_t *); 475 11042 Erik extern void ipif_delete_ires_v6(ipif_t *); 476 11042 Erik extern int ipif_arp_up(ipif_t *, enum ip_resolver_action, boolean_t); 477 11042 Erik extern void ipif_dup_recovery(void *); 478 11042 Erik extern void ipif_do_recovery(ipif_t *); 479 0 stevel 480 4136 nordmark /* 481 4136 nordmark * Notes on reference tracing on ill, ipif, ire, nce data structures: 482 4136 nordmark * 483 4136 nordmark * The current model of references on an ipif or ill is purely based on threads 484 4136 nordmark * acquiring a reference by doing a lookup on the ill or ipif or by calling a 485 4136 nordmark * refhold function on the ill or ipif. In particular any data structure that 486 4136 nordmark * points to an ipif or ill does not explicitly contribute to a reference on the 487 4136 nordmark * ill or ipif. More details may be seen in the block comment above ipif_down(). 488 4136 nordmark * Thus in the quiescent state an ill or ipif has a refcnt of zero. Similarly 489 4136 nordmark * when a thread exits, there can't be any references on the ipif or ill due to 490 4136 nordmark * the exiting thread. 491 4136 nordmark * 492 4136 nordmark * As a debugging aid, the refhold and refrele functions call into tracing 493 4136 nordmark * functions that record the stack trace of the caller and the references 494 5023 carlsonj * acquired or released by the calling thread, hashed by the structure address 495 5023 carlsonj * in thread-specific-data (TSD). On thread exit, ip_thread_exit destroys the 496 5023 carlsonj * hash, and the destructor for the hash entries (th_trace_free) verifies that 497 5023 carlsonj * there are no outstanding references to the ipif or ill from the exiting 498 5023 carlsonj * thread. 499 4136 nordmark * 500 4136 nordmark * In the case of ires and nces, the model is slightly different. Typically each 501 4136 nordmark * ire pointing to an nce contributes to the nce_refcnt. Similarly a conn_t 502 4136 nordmark * pointing to an ire also contributes to the ire_refcnt. Excluding the above 503 4136 nordmark * special cases, the tracing behavior is similar to the tracing on ipif / ill. 504 4136 nordmark * Traces are neither recorded nor verified in the exception cases, and the code 505 4136 nordmark * is careful to use the right refhold and refrele functions. On thread exit 506 4136 nordmark * ire_thread_exit, nce_thread_exit does the verification that are no 507 4136 nordmark * outstanding references on the ire / nce from the exiting thread. 508 4136 nordmark * 509 5023 carlsonj * The reference verification is driven from the TSD destructor which calls 510 5023 carlsonj * into IP's verification function ip_thread_exit. This debugging aid may be 511 5023 carlsonj * helpful in tracing missing refrele's on a debug kernel. On a non-debug 512 5023 carlsonj * kernel, these missing refrele's are noticeable only when an interface is 513 5023 carlsonj * being unplumbed, and the unplumb hangs, long after the missing refrele. On a 514 5023 carlsonj * debug kernel, the traces (th_trace_t) which contain the stack backtraces can 515 5023 carlsonj * be examined on a crash dump to locate the missing refrele. 516 4136 nordmark */ 517 4136 nordmark 518 0 stevel #endif /* _KERNEL */ 519 0 stevel 520 0 stevel #ifdef __cplusplus 521 0 stevel } 522 0 stevel #endif 523 0 stevel 524 0 stevel #endif /* _INET_IP_IF_H */ 525