dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libinetutil / common / libinetutil_impl.h
blob268d584d1b90d1ca998a8c65a425a86e9909113e
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
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.
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #include <netinet/inetutil.h>
41 #include <sys/types.h>
42 #include <sys/socket.h>
43 #include <netinet/in.h>
44 #include <net/if.h>
45 #include <sys/poll.h>
46 #include <signal.h>
47 #include <limits.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
52 * is concerned.
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;
63 void *iutn_arg;
64 int iutn_pending_delete;
66 } iu_timer_node_t;
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) /
73 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
79 * concerned.
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 */
87 /* callback */
88 } iu_event_node_t;
90 typedef struct iu_eh_sig_info {
92 boolean_t iues_pending; /* signal is currently */
93 /* pending */
95 iu_eh_sighandler_t *iues_handler; /* handler for a given signal */
97 void *iues_data; /* data to pass back to the */
98 /* handler */
99 } iu_eh_sig_info_t;
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 */
114 /* set */
116 iu_eh_sig_info_t iueh_sig_info[NSIG]; /* signal handler */
117 /* information */
119 iu_eh_shutdown_t *iueh_shutdown; /* shutdown callback */
121 void *iueh_shutdown_arg; /* data for shutdown */
122 /* callback */
125 #ifdef __cplusplus
127 #endif
129 #endif /* !_LIBINETUTIL_IMPL_H */