4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _LIBINETUTIL_IMPL_H
28 #define _LIBINETUTIL_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Contains implementation-specific definitions for libinetutil.
40 #include <netinet/inetutil.h>
41 #include <sys/types.h>
42 #include <sys/socket.h>
43 #include <netinet/in.h>
50 * timer queue implementation-specific artifacts which may change. A
51 * `iu_tq_t' is an incomplete type as far as the consumer of timer queues
55 typedef struct iu_timer_node
{
57 struct iu_timer_node
*iutn_prev
;
58 struct iu_timer_node
*iutn_next
;
59 struct iu_timer_node
*iutn_expire_next
;
60 hrtime_t iutn_abs_timeout
;
61 iu_timer_id_t iutn_timer_id
;
62 iu_tq_callback_t
*iutn_callback
;
64 int iutn_pending_delete
;
68 struct iu_timer_queue
{
69 iu_timer_id_t iutq_next_timer_id
;
70 iu_timer_node_t
*iutq_head
; /* in order of time-to-fire */
71 int iutq_in_expire
; /* nonzero if in the expire function */
72 uchar_t iutq_timer_id_map
[(IU_TIMER_ID_MAX
+ CHAR_BIT
) /
77 * event handler implementation-specific artifacts which may change. An
78 * `iu_eh_t' is an incomplete type as far as the consumer of event handlers is
82 typedef struct iu_event_node
{
84 iu_eh_callback_t
*iuen_callback
; /* callback to call */
86 void *iuen_arg
; /* argument to pass to the */
90 typedef struct iu_eh_sig_info
{
92 boolean_t iues_pending
; /* signal is currently */
95 iu_eh_sighandler_t
*iues_handler
; /* handler for a given signal */
97 void *iues_data
; /* data to pass back to the */
101 struct iu_event_handler
{
103 struct pollfd
*iueh_pollfds
; /* array of pollfds */
105 iu_event_node_t
*iueh_events
; /* corresponding pollfd info */
107 unsigned int iueh_num_fds
; /* number of pollfds/events */
109 boolean_t iueh_stop
; /* true when done */
111 unsigned int iueh_reason
; /* if stop is true, reason */
113 sigset_t iueh_sig_regset
; /* registered signal */
116 iu_eh_sig_info_t iueh_sig_info
[NSIG
]; /* signal handler */
119 iu_eh_shutdown_t
*iueh_shutdown
; /* shutdown callback */
121 void *iueh_shutdown_arg
; /* data for shutdown */
129 #endif /* !_LIBINETUTIL_IMPL_H */