xref: /minix3/external/bsd/dhcp/dist/dhcpctl/dhcpctl.h (revision 83ee113ee0d94f3844d44065af2311604e9a30ad)
1*83ee113eSDavid van Moolenbroek /*	$NetBSD: dhcpctl.h,v 1.1.1.4 2014/07/12 11:57:51 spz Exp $	*/
2*83ee113eSDavid van Moolenbroek /* Id: dhcpctl.h,v 1.18 2009/11/24 02:06:56 sar Exp
3*83ee113eSDavid van Moolenbroek 
4*83ee113eSDavid van Moolenbroek    Subroutines providing general support for objects. */
5*83ee113eSDavid van Moolenbroek 
6*83ee113eSDavid van Moolenbroek /*
7*83ee113eSDavid van Moolenbroek  * Copyright (c) 2004,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
8*83ee113eSDavid van Moolenbroek  * Copyright (c) 1999-2003 by Internet Software Consortium
9*83ee113eSDavid van Moolenbroek  *
10*83ee113eSDavid van Moolenbroek  * Permission to use, copy, modify, and distribute this software for any
11*83ee113eSDavid van Moolenbroek  * purpose with or without fee is hereby granted, provided that the above
12*83ee113eSDavid van Moolenbroek  * copyright notice and this permission notice appear in all copies.
13*83ee113eSDavid van Moolenbroek  *
14*83ee113eSDavid van Moolenbroek  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
15*83ee113eSDavid van Moolenbroek  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16*83ee113eSDavid van Moolenbroek  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
17*83ee113eSDavid van Moolenbroek  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18*83ee113eSDavid van Moolenbroek  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19*83ee113eSDavid van Moolenbroek  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20*83ee113eSDavid van Moolenbroek  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21*83ee113eSDavid van Moolenbroek  *
22*83ee113eSDavid van Moolenbroek  *   Internet Systems Consortium, Inc.
23*83ee113eSDavid van Moolenbroek  *   950 Charter Street
24*83ee113eSDavid van Moolenbroek  *   Redwood City, CA 94063
25*83ee113eSDavid van Moolenbroek  *   <info@isc.org>
26*83ee113eSDavid van Moolenbroek  *   https://www.isc.org/
27*83ee113eSDavid van Moolenbroek  *
28*83ee113eSDavid van Moolenbroek  */
29*83ee113eSDavid van Moolenbroek 
30*83ee113eSDavid van Moolenbroek #ifndef _DHCPCTL_H_
31*83ee113eSDavid van Moolenbroek #define _DHCPCTL_H_
32*83ee113eSDavid van Moolenbroek 
33*83ee113eSDavid van Moolenbroek #include <omapip/omapip.h>
34*83ee113eSDavid van Moolenbroek 
35*83ee113eSDavid van Moolenbroek typedef isc_result_t dhcpctl_status;
36*83ee113eSDavid van Moolenbroek typedef omapi_object_t *dhcpctl_handle;
37*83ee113eSDavid van Moolenbroek typedef omapi_data_string_t *dhcpctl_data_string;
38*83ee113eSDavid van Moolenbroek 
39*83ee113eSDavid van Moolenbroek #define dhcpctl_null_handle ((dhcpctl_handle) 0)
40*83ee113eSDavid van Moolenbroek 
41*83ee113eSDavid van Moolenbroek #define DHCPCTL_CREATE		OMAPI_CREATE
42*83ee113eSDavid van Moolenbroek #define DHCPCTL_UPDATE		OMAPI_UPDATE
43*83ee113eSDavid van Moolenbroek #define DHCPCTL_EXCL		OMAPI_EXCL
44*83ee113eSDavid van Moolenbroek 
45*83ee113eSDavid van Moolenbroek typedef struct {
46*83ee113eSDavid van Moolenbroek 	OMAPI_OBJECT_PREAMBLE;
47*83ee113eSDavid van Moolenbroek 	omapi_object_t *object;
48*83ee113eSDavid van Moolenbroek 	void *data;
49*83ee113eSDavid van Moolenbroek 	void (*callback) (dhcpctl_handle, dhcpctl_status, void *);
50*83ee113eSDavid van Moolenbroek } dhcpctl_callback_object_t;
51*83ee113eSDavid van Moolenbroek 
52*83ee113eSDavid van Moolenbroek typedef struct {
53*83ee113eSDavid van Moolenbroek 	OMAPI_OBJECT_PREAMBLE;
54*83ee113eSDavid van Moolenbroek 	omapi_typed_data_t *rtype;
55*83ee113eSDavid van Moolenbroek 	isc_result_t waitstatus;
56*83ee113eSDavid van Moolenbroek 	omapi_typed_data_t *message;
57*83ee113eSDavid van Moolenbroek 	omapi_handle_t remote_handle;
58*83ee113eSDavid van Moolenbroek } dhcpctl_remote_object_t;
59*83ee113eSDavid van Moolenbroek 
60*83ee113eSDavid van Moolenbroek extern omapi_object_type_t *dhcpctl_callback_type;
61*83ee113eSDavid van Moolenbroek extern omapi_object_type_t *dhcpctl_remote_type;
62*83ee113eSDavid van Moolenbroek 
63*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_initialize (void);
64*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_connect (dhcpctl_handle *,
65*83ee113eSDavid van Moolenbroek 				const char *, int, dhcpctl_handle);
66*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_wait_for_completion (dhcpctl_handle, dhcpctl_status *);
67*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_get_value (dhcpctl_data_string *,
68*83ee113eSDavid van Moolenbroek 				  dhcpctl_handle, const char *);
69*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_get_boolean (int *, dhcpctl_handle, const char *);
70*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_value (dhcpctl_handle,
71*83ee113eSDavid van Moolenbroek 				  dhcpctl_data_string, const char *);
72*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_string_value (dhcpctl_handle, const char *,
73*83ee113eSDavid van Moolenbroek 					 const char *);
74*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_data_value (dhcpctl_handle,
75*83ee113eSDavid van Moolenbroek 				       const char *, unsigned, const char *);
76*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_null_value (dhcpctl_handle, const char *);
77*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_boolean_value (dhcpctl_handle, int, const char *);
78*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_int_value (dhcpctl_handle, int, const char *);
79*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_object_update (dhcpctl_handle, dhcpctl_handle);
80*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_object_refresh (dhcpctl_handle, dhcpctl_handle);
81*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_object_remove (dhcpctl_handle, dhcpctl_handle);
82*83ee113eSDavid van Moolenbroek 
83*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_set_callback (dhcpctl_handle, void *,
84*83ee113eSDavid van Moolenbroek 				     void (*) (dhcpctl_handle,
85*83ee113eSDavid van Moolenbroek 					       dhcpctl_status, void *));
86*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_callback_set_value  (omapi_object_t *, omapi_object_t *,
87*83ee113eSDavid van Moolenbroek 					  omapi_data_string_t *,
88*83ee113eSDavid van Moolenbroek 					  omapi_typed_data_t *);
89*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_callback_get_value (omapi_object_t *, omapi_object_t *,
90*83ee113eSDavid van Moolenbroek 					 omapi_data_string_t *,
91*83ee113eSDavid van Moolenbroek 					 omapi_value_t **);
92*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_callback_destroy (omapi_object_t *, const char *, int);
93*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_callback_signal_handler (omapi_object_t *,
94*83ee113eSDavid van Moolenbroek 					      const char *, va_list);
95*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_callback_stuff_values (omapi_object_t *,
96*83ee113eSDavid van Moolenbroek 					    omapi_object_t *,
97*83ee113eSDavid van Moolenbroek 					    omapi_object_t *);
98*83ee113eSDavid van Moolenbroek 
99*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_new_authenticator (dhcpctl_handle *,
100*83ee113eSDavid van Moolenbroek 					  const char *, const char *,
101*83ee113eSDavid van Moolenbroek 					  const unsigned char *, unsigned);
102*83ee113eSDavid van Moolenbroek 
103*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_open_object (dhcpctl_handle, dhcpctl_handle, int);
104*83ee113eSDavid van Moolenbroek dhcpctl_status dhcpctl_new_object (dhcpctl_handle *,
105*83ee113eSDavid van Moolenbroek 				   dhcpctl_handle, const char *);
106*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_remote_set_value  (omapi_object_t *, omapi_object_t *,
107*83ee113eSDavid van Moolenbroek 					omapi_data_string_t *,
108*83ee113eSDavid van Moolenbroek 					omapi_typed_data_t *);
109*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_remote_get_value (omapi_object_t *, omapi_object_t *,
110*83ee113eSDavid van Moolenbroek 				       omapi_data_string_t *,
111*83ee113eSDavid van Moolenbroek 				       omapi_value_t **);
112*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_remote_destroy (omapi_object_t *, const char *, int);
113*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_remote_signal_handler (omapi_object_t *,
114*83ee113eSDavid van Moolenbroek 					    const char *, va_list);
115*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_remote_stuff_values (omapi_object_t *,
116*83ee113eSDavid van Moolenbroek 					  omapi_object_t *,
117*83ee113eSDavid van Moolenbroek 					  omapi_object_t *);
118*83ee113eSDavid van Moolenbroek isc_result_t dhcpctl_data_string_dereference (dhcpctl_data_string *,
119*83ee113eSDavid van Moolenbroek 					      const char *, int);
120*83ee113eSDavid van Moolenbroek #endif /* _DHCPCTL_H_ */
121