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]
22 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
24 /* Copyright (c) 1990 Mentat Inc. */
35 #include <sys/types.h>
36 #include <sys/netstack.h>
38 #include <netinet/in.h>
39 #include <netinet/icmp6.h>
40 #include <netinet/ip6.h>
42 #include <inet/common.h>
44 #include <inet/optcom.h>
45 #include <inet/tunables.h>
48 * ICMP stack instances
51 netstack_t
*is_netstack
; /* Common netstack */
52 void *is_head
; /* Head for list of open icmps */
53 mod_prop_info_t
*is_propinfo_tbl
; /* holds the icmp tunables */
54 kstat_t
*is_ksp
; /* kstats */
55 mib2_rawip_t is_rawip_mib
; /* SNMP fixed size info */
56 ldi_ident_t is_ldi_ident
;
59 typedef struct icmp_stack icmp_stack_t
;
61 /* Internal icmp control structure, one per open stream */
62 typedef struct icmp_s
{
64 * The addresses and ports in the conn_t and icmp_state are protected by
65 * conn_lock. conn_lock also protects the content of icmp_t.
67 uint_t icmp_state
; /* TPI state */
69 /* Written to only once at the time of opening the endpoint */
73 icmp_hdrincl
: 1, /* IP_HDRINCL option + RAW and IGMP */
75 icmp_pad_to_bit_31
: 31;
77 icmp6_filter_t
*icmp_filter
; /* ICMP6_FILTER option */
79 /* Set at open time and never changed */
80 icmp_stack_t
*icmp_is
; /* Stack instance */
82 int icmp_delayed_error
;
83 kmutex_t icmp_recv_lock
;
84 mblk_t
*icmp_fallback_queue_head
;
85 mblk_t
*icmp_fallback_queue_tail
;
86 struct sockaddr_storage icmp_delayed_addr
;
90 * Object to represent database of options to search passed to
91 * {sock,tpi}optcom_req() interface routine to take care of option
92 * management and associated methods.
94 extern optdb_obj_t icmp_opt_obj
;
95 extern uint_t icmp_max_optsize
;
97 extern int icmp_opt_default(queue_t
*, t_scalar_t
, t_scalar_t
, uchar_t
*);
98 extern int icmp_tpi_opt_get(queue_t
*, t_scalar_t
, t_scalar_t
, uchar_t
*);
99 extern int icmp_tpi_opt_set(queue_t
*, uint_t
, int, int, uint_t
, uchar_t
*,
100 uint_t
*, uchar_t
*, void *, cred_t
*);
101 extern mblk_t
*icmp_snmp_get(queue_t
*q
, mblk_t
*mpctl
);
103 extern void icmp_ddi_g_init(void);
104 extern void icmp_ddi_g_destroy(void);
106 extern sock_lower_handle_t
rawip_create(int, int, int, sock_downcalls_t
**,
107 uint_t
*, int *, int, cred_t
*);
108 extern int rawip_fallback(sock_lower_handle_t
, queue_t
*, boolean_t
,
109 so_proto_quiesced_cb_t
, sock_quiesce_arg_t
*);
111 extern sock_downcalls_t sock_rawip_downcalls
;
119 #endif /* _RAWIP_IMPL_H */