Make setthetime() static per the prototype.
[dragonfly.git] / contrib / isc-dhcp / dhcpctl / dhcpctl.h
1 /* dhcpctl.h
2
3    Subroutines providing general support for objects. */
4
5 /*
6  * Copyright (c) 1999-2002 Internet Software Consortium.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. Neither the name of The Internet Software Consortium nor the names
19  *    of its contributors may be used to endorse or promote products derived
20  *    from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23  * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  * This software has been written for the Internet Software Consortium
37  * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
38  * To learn more about the Internet Software Consortium, see
39  * ``http://www.isc.org/''.  To learn more about Vixie Enterprises,
40  * see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
41  * ``http://www.nominum.com''.
42  */
43
44 #ifndef _DHCPCTL_H_
45 #define _DHCPCTL_H_
46
47 #include <omapip/omapip.h>
48
49 typedef isc_result_t dhcpctl_status;
50 typedef omapi_object_t *dhcpctl_handle;
51 typedef omapi_data_string_t *dhcpctl_data_string;
52
53 #define dhcpctl_null_handle ((dhcpctl_handle) 0)
54
55 #define DHCPCTL_CREATE          OMAPI_CREATE
56 #define DHCPCTL_UPDATE          OMAPI_UPDATE
57 #define DHCPCTL_EXCL            OMAPI_EXCL
58
59 typedef struct {
60         OMAPI_OBJECT_PREAMBLE;
61         omapi_object_t *object;
62         void *data;
63         void (*callback) (dhcpctl_handle, dhcpctl_status, void *);
64 } dhcpctl_callback_object_t;
65
66 typedef struct {
67         OMAPI_OBJECT_PREAMBLE;
68         omapi_typed_data_t *rtype;
69         isc_result_t waitstatus;
70         omapi_typed_data_t *message;
71         omapi_handle_t remote_handle;
72 } dhcpctl_remote_object_t;
73
74 extern omapi_object_type_t *dhcpctl_callback_type;
75 extern omapi_object_type_t *dhcpctl_remote_type;
76
77 dhcpctl_status dhcpctl_initialize (void);
78 dhcpctl_status dhcpctl_connect (dhcpctl_handle *,
79                                 const char *, int, dhcpctl_handle);
80 dhcpctl_status dhcpctl_wait_for_completion (dhcpctl_handle, dhcpctl_status *);
81 dhcpctl_status dhcpctl_get_value (dhcpctl_data_string *,
82                                   dhcpctl_handle, const char *);
83 dhcpctl_status dhcpctl_get_boolean (int *, dhcpctl_handle, const char *);
84 dhcpctl_status dhcpctl_set_value (dhcpctl_handle,
85                                   dhcpctl_data_string, const char *);
86 dhcpctl_status dhcpctl_set_string_value (dhcpctl_handle, const char *,
87                                          const char *);
88 dhcpctl_status dhcpctl_set_data_value (dhcpctl_handle,
89                                        const char *, unsigned, const char *);
90 dhcpctl_status dhcpctl_set_null_value (dhcpctl_handle, const char *);
91 dhcpctl_status dhcpctl_set_boolean_value (dhcpctl_handle, int, const char *);
92 dhcpctl_status dhcpctl_set_int_value (dhcpctl_handle, int, const char *);
93 dhcpctl_status dhcpctl_object_update (dhcpctl_handle, dhcpctl_handle);
94 dhcpctl_status dhcpctl_object_refresh (dhcpctl_handle, dhcpctl_handle);
95 dhcpctl_status dhcpctl_object_remove (dhcpctl_handle, dhcpctl_handle);
96
97 dhcpctl_status dhcpctl_set_callback (dhcpctl_handle, void *,
98                                      void (*) (dhcpctl_handle,
99                                                dhcpctl_status, void *));
100 isc_result_t dhcpctl_callback_set_value  (omapi_object_t *, omapi_object_t *,
101                                           omapi_data_string_t *,
102                                           omapi_typed_data_t *);
103 isc_result_t dhcpctl_callback_get_value (omapi_object_t *, omapi_object_t *,
104                                          omapi_data_string_t *,
105                                          omapi_value_t **); 
106 isc_result_t dhcpctl_callback_destroy (omapi_object_t *, const char *, int);
107 isc_result_t dhcpctl_callback_signal_handler (omapi_object_t *,
108                                               const char *, va_list);
109 isc_result_t dhcpctl_callback_stuff_values (omapi_object_t *,
110                                             omapi_object_t *,
111                                             omapi_object_t *);
112
113 dhcpctl_status dhcpctl_new_authenticator (dhcpctl_handle *,
114                                           const char *, const char *,
115                                           const unsigned char *, unsigned);
116
117 dhcpctl_status dhcpctl_open_object (dhcpctl_handle, dhcpctl_handle, int);
118 dhcpctl_status dhcpctl_new_object (dhcpctl_handle *,
119                                    dhcpctl_handle, const char *);
120 isc_result_t dhcpctl_remote_set_value  (omapi_object_t *, omapi_object_t *,
121                                         omapi_data_string_t *,
122                                         omapi_typed_data_t *);
123 isc_result_t dhcpctl_remote_get_value (omapi_object_t *, omapi_object_t *,
124                                        omapi_data_string_t *,
125                                        omapi_value_t **); 
126 isc_result_t dhcpctl_remote_destroy (omapi_object_t *, const char *, int);
127 isc_result_t dhcpctl_remote_signal_handler (omapi_object_t *,
128                                             const char *, va_list);
129 isc_result_t dhcpctl_remote_stuff_values (omapi_object_t *,
130                                           omapi_object_t *,
131                                           omapi_object_t *);
132 isc_result_t dhcpctl_data_string_dereference (dhcpctl_data_string *,
133                                               const char *, int);
134 #endif /* _DHCPCTL_H_ */