xref: /titanic_44/usr/src/cmd/cmd-inet/sbin/dhcpagent/async.h (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	ASYNC_H
28 #define	ASYNC_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <libinetutil.h>
34 #include <dhcpagent_ipc.h>
35 
36 /*
37  * async.[ch] comprise the interface used to handle asynchronous DHCP
38  * commands.  see ipc_event() in agent.c for more documentation on
39  * the treatment of asynchronous DHCP commands.  see async.c for
40  * documentation on how to use the exported functions.
41  */
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 struct ifslist;					/* forward declaration */
48 
49 struct async_action {
50 
51 	dhcp_ipc_type_t		as_cmd;		/* command/action in progress */
52 	iu_timer_id_t		as_tid;		/* async timer id */
53 	boolean_t		as_user;	/* user-generated async cmd */
54 };
55 
56 #define	DHCP_ASYNC_WAIT		60		/* seconds */
57 
58 boolean_t	async_pending(struct ifslist *);
59 int		async_start(struct ifslist *, dhcp_ipc_type_t, boolean_t);
60 void		async_finish(struct ifslist *);
61 int		async_cancel(struct ifslist *);
62 
63 #ifdef	__cplusplus
64 }
65 #endif
66 
67 #endif	/* ASYNC_H */
68