4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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.
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]
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
30 * Data-structures and functions related to the IP STREAMS queue that handles
31 * packets with the SAP set to 0x806 (ETHERTYPE_ARP).
38 #include <sys/types.h>
40 #include <inet/ip_ndp.h>
41 #include <sys/stream.h>
44 extern struct streamtab dummymodinfo
;
46 struct arl_ill_common_s
;
48 * The arl_s structure tracks the state of the associated ARP stream.
50 typedef struct arl_s
{
57 struct arl_ill_common_s
*arl_common
;
61 t_uscalar_t arl_sap_length
;
62 uint_t arl_phys_addr_length
;
65 t_uscalar_t arl_mactype
;
66 #define arl_first_mp_to_free arl_dlpi_deferred
67 mblk_t
*arl_dlpi_deferred
;
68 mblk_t
*arl_unbind_mp
;
69 mblk_t
*arl_detach_mp
;
70 #define arl_last_mp_to_free arl_detach_mp
71 uint_t arl_state_flags
;
78 t_uscalar_t arl_dlpi_pending
;
84 * The arl_ill_common_t structure is a super-structure that contains pointers
85 * to a pair of matching ill_t, arl_t structures. Given an arl_t (or
86 * ill_t) the corresponding ill_t (or arl_t) must be obtained by
87 * synchronizing on the ai_lock, and ensuring that the desired ill/arl
88 * pointer is non-null, not condemned. The arl_ill_common_t is allocated in
89 * arl_init() and freed only when both the ill_t and the arl_t structures
91 * Lock hierarchy: the ai_lock must be take before the ill_lock or arl_lock.
94 typedef struct arl_ill_common_s
{
98 kcondvar_t ai_ill_unplumb_done
; /* sent from ip_modclose() */
101 extern boolean_t arp_no_defense
;
103 extern struct module_info arp_mod_info
;
104 extern int arp_ll_up(ill_t
*);
105 extern int arp_ll_down(ill_t
*);
106 extern boolean_t
arp_announce(ncec_t
*);
107 extern boolean_t
arp_probe(ncec_t
*);
108 extern int arp_request(ncec_t
*, in_addr_t
, ill_t
*);
109 extern void arp_failure(mblk_t
*, ip_recv_attr_t
*);
110 extern int arl_wait_for_info_ack(arl_t
*);
111 extern int arl_init(queue_t
*, arl_t
*);
112 extern void arl_set_muxid(ill_t
*, int);
113 extern int arl_get_muxid(ill_t
*);
114 extern void arp_send_replumb_conf(ill_t
*);
115 extern void arp_unbind_complete(ill_t
*);
116 extern ill_t
*arl_to_ill(arl_t
*);
117 extern uint32_t arp_hw_type(t_uscalar_t
);
120 #define ARP_RETRANS_TIMER 500 /* time in milliseconds */
122 /* The following are arl_state_flags */
123 #define ARL_LL_SUBNET_PENDING 0x01 /* Waiting for DL_INFO_ACK from drv */
124 #define ARL_CONDEMNED 0x02 /* No more new ref's to the ILL */
125 #define ARL_DL_UNBIND_IN_PROGRESS 0x04 /* UNBIND_REQ is sent */
126 #define ARL_LL_BIND_PENDING 0x0020 /* BIND sent */
127 #define ARL_LL_UP 0x0040 /* BIND acked */
128 #define ARL_LL_DOWN 0x0080
129 #define ARL_LL_UNBOUND 0x0100 /* UNBIND acked */
130 #define ARL_LL_REPLUMBING 0x0200 /* replumb in progress */
136 #endif /* _IP_ARP_H */