xref: /illumos-gate/usr/src/cmd/cmd-inet/sbin/dhcpagent/ipc_action.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	IPC_ACTION_H
28 #define	IPC_ACTION_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <netinet/in.h>
34 #include <netinet/dhcp.h>
35 #include <dhcpagent_ipc.h>
36 #include <libinetutil.h>
37 
38 #include "agent.h"
39 
40 /*
41  * ipc_action.[ch] make up the interface used to control the current
42  * pending interprocess communication transaction taking place.  see
43  * ipc_action.c for documentation on how to use the exported functions.
44  */
45 
46 #ifdef	__cplusplus
47 extern "C" {
48 #endif
49 
50 struct ifslist;					/* forward declaration */
51 
52 void		ipc_action_init(struct ifslist *);
53 int		ipc_action_start(struct ifslist *, dhcp_ipc_request_t *, int);
54 void		ipc_action_finish(struct ifslist *, int);
55 boolean_t	ipc_action_pending(struct ifslist *);
56 void		ipc_action_cancel_timer(struct ifslist *);
57 
58 
59 struct ipc_action {
60 
61 	dhcp_ipc_type_t		ia_cmd;		/* command/action requested  */
62 	int			ia_fd;		/* ipc channel descriptor */
63 	iu_timer_id_t		ia_tid;		/* ipc timer id */
64 	dhcp_ipc_request_t	*ia_request;	/* ipc request pointer */
65 };
66 
67 #ifdef	__cplusplus
68 }
69 #endif
70 
71 #endif	/* IPC_ACTION_H */
72