xref: /titanic_44/usr/src/cmd/cmd-inet/sbin/dhcpagent/ipc_action.h (revision 45405cce0657d01714b3d014a0facf3bdce45736)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	IPC_ACTION_H
27 #define	IPC_ACTION_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 #include <netinet/in.h>
33 #include <netinet/dhcp.h>
34 #include <dhcpagent_ipc.h>
35 #include <libinetutil.h>
36 
37 #include "common.h"
38 
39 /*
40  * ipc_action.[ch] make up the interface used to control the current
41  * pending interprocess communication transaction taking place.  see
42  * ipc_action.c for documentation on how to use the exported functions.
43  */
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 typedef struct ipc_action {
50 	dhcp_ipc_type_t		ia_cmd;		/* command/action requested  */
51 	int			ia_fd;		/* ipc channel descriptor */
52 	iu_timer_id_t		ia_tid;		/* ipc timer id */
53 	iu_event_id_t		ia_eid;		/* ipc event ID */
54 	dhcp_ipc_request_t	*ia_request;	/* ipc request pointer */
55 } ipc_action_t;
56 
57 void		ipc_action_init(ipc_action_t *);
58 boolean_t	ipc_action_start(dhcp_smach_t *, ipc_action_t *);
59 void		ipc_action_finish(dhcp_smach_t *, int);
60 void		send_error_reply(ipc_action_t *, int);
61 void		send_ok_reply(ipc_action_t *);
62 void		send_data_reply(ipc_action_t *, int, dhcp_data_type_t,
63 		    const void *, size_t);
64 
65 #ifdef	__cplusplus
66 }
67 #endif
68 
69 #endif	/* IPC_ACTION_H */
70