2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBINETUTIL_IMPL_H
2N/A#define _LIBINETUTIL_IMPL_H
2N/A
2N/A/*
2N/A * Contains implementation-specific definitions for libinetutil.
2N/A */
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <netinet/inetutil.h>
2N/A#include <sys/types.h>
2N/A#include <sys/socket.h>
2N/A#include <netinet/in.h>
2N/A#include <net/if.h>
2N/A#include <sys/poll.h>
2N/A#include <signal.h>
2N/A#include <limits.h>
2N/A
2N/A/*
2N/A * timer queue implementation-specific artifacts which may change. A
2N/A * `iu_tq_t' is an incomplete type as far as the consumer of timer queues
2N/A * is concerned.
2N/A */
2N/A
2N/Atypedef struct iu_timer_node {
2N/A
2N/A struct iu_timer_node *iutn_prev;
2N/A struct iu_timer_node *iutn_next;
2N/A struct iu_timer_node *iutn_expire_next;
2N/A hrtime_t iutn_abs_timeout;
2N/A iu_timer_id_t iutn_timer_id;
2N/A iu_tq_callback_t *iutn_callback;
2N/A void *iutn_arg;
2N/A int iutn_pending_delete;
2N/A
2N/A} iu_timer_node_t;
2N/A
2N/Astruct iu_timer_queue {
2N/A iu_timer_id_t iutq_next_timer_id;
2N/A iu_timer_node_t *iutq_head; /* in order of time-to-fire */
2N/A int iutq_in_expire; /* nonzero if in the expire function */
2N/A uchar_t iutq_timer_id_map[(IU_TIMER_ID_MAX + CHAR_BIT) /
2N/A CHAR_BIT];
2N/A iu_timer_node_t *iutq_pending_delete_chain;
2N/A};
2N/A
2N/A/*
2N/A * event handler implementation-specific artifacts which may change. An
2N/A * `iu_eh_t' is an incomplete type as far as the consumer of event handlers is
2N/A * concerned.
2N/A */
2N/A
2N/Atypedef struct iu_event_node {
2N/A
2N/A iu_eh_callback_t *iuen_callback; /* callback to call */
2N/A
2N/A void *iuen_arg; /* argument to pass to the */
2N/A /* callback */
2N/A} iu_event_node_t;
2N/A
2N/Atypedef struct iu_eh_sig_info {
2N/A
2N/A boolean_t iues_pending; /* signal is currently */
2N/A /* pending */
2N/A
2N/A iu_eh_sighandler_t *iues_handler; /* handler for a given signal */
2N/A
2N/A void *iues_data; /* data to pass back to the */
2N/A /* handler */
2N/A} iu_eh_sig_info_t;
2N/A
2N/Astruct iu_event_handler {
2N/A
2N/A struct pollfd *iueh_pollfds; /* array of pollfds */
2N/A
2N/A iu_event_node_t *iueh_events; /* corresponding pollfd info */
2N/A
2N/A unsigned int iueh_num_fds; /* number of pollfds/events */
2N/A
2N/A boolean_t iueh_stop; /* true when done */
2N/A
2N/A unsigned int iueh_reason; /* if stop is true, reason */
2N/A
2N/A sigset_t iueh_sig_regset; /* registered signal */
2N/A /* set */
2N/A
2N/A iu_eh_sig_info_t iueh_sig_info[NSIG]; /* signal handler */
2N/A /* information */
2N/A
2N/A iu_eh_shutdown_t *iueh_shutdown; /* shutdown callback */
2N/A
2N/A void *iueh_shutdown_arg; /* data for shutdown */
2N/A /* callback */
2N/A};
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* !_LIBINETUTIL_IMPL_H */