events.h revision f6da83d4178694e7113b71d1e452f15b296f73d8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _EVENTS_H
#define _EVENTS_H
#include <door.h>
#include <libsysevent.h>
#include <libuutil.h>
#include <pthread.h>
#include <ucontext.h>
#include <libnwam.h>
#include <libnwam_priv.h>
struct nwamd_object;
typedef struct nwamd_object *nwamd_object_t;
#include "ncp.h"
/* Define internal-to-nwamd events here */
#define NEXT_FEW_SECONDS 5
/*
* Forward definition.
*/
/*
* Wrapper structure for libnwam event (nwam_events_msg_t), containing
* event id (used to uniquely identify events on the event queue),
* associated object (if any), and uu_list_node.
*/
typedef struct nwamd_event {
struct timespec event_time;
char event_object[NWAM_MAX_NAME_LEN];
} *nwamd_event_t;
typedef struct nwamd_event_method {
void (*event_method)(nwamd_event_t);
extern sysevent_handle_t *shp;
extern void nwamd_routing_events_init(void);
extern void nwamd_routing_events_fini(void);
extern void nwamd_sysevent_events_init(void);
extern void nwamd_sysevent_events_fini(void);
/* Event init/enqueueing */
extern void nwamd_event_queue_init(void);
extern void nwamd_event_queue_fini(void);
extern void nwamd_event_sources_init(void);
extern void nwamd_event_sources_fini(void);
const char *);
extern void nwamd_event_do_not_send(nwamd_event_t);
const char *, const char *, nwam_action_t);
const char *, nwam_state_t, nwam_aux_state_t);
nwam_wlan_t *, uint_t);
extern nwamd_event_t nwamd_event_init_ncu_check(void);
extern nwamd_event_t nwamd_event_init_init(void);
extern nwamd_event_t nwamd_event_init_shutdown(void);
extern void nwamd_event_enqueue(nwamd_event_t);
extern void nwamd_event_enqueue_timed(nwamd_event_t, int);
extern void nwamd_event_enqueue_expired_events(void);
const char *);
extern void nwamd_event_send(nwam_event_t);
extern void nwamd_event_fini(nwamd_event_t);
extern void nwamd_event_handler(void);
#endif /* _EVENTS_H */