ISC DHCP  4.4.3
A reference DHCPv4 and DHCPv6 implementation
dhcpctl.c
Go to the documentation of this file.
1 /* dhcpctl.c
2 
3  Subroutines providing general support for objects. */
4 
5 /*
6  * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 1999-2003 by Internet Software Consortium
8  *
9  * This Source Code Form is subject to the terms of the Mozilla Public
10  * License, v. 2.0. If a copy of the MPL was not distributed with this
11  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  *
21  * Internet Systems Consortium, Inc.
22  * PO Box 360
23  * Newmarket, NH 03857 USA
24  * <info@isc.org>
25  * https://www.isc.org/
26  *
27  */
28 
29 #include "dhcpd.h"
30 #include <omapip/omapip_p.h>
31 #include "dhcpctl.h"
32 #include <sys/time.h>
33 
34 /* #define DEBUG_DHCPCTL 1 */
35 
38 
39 /* dhcpctl_initialize ()
40 
41  Must be called before any other dhcpctl function. */
42 
44 {
45  isc_result_t status;
46 
47  /* Set up the isc and dns library managers */
49  NULL, NULL);
50  if (status != ISC_R_SUCCESS)
51  return status;
52 
53  status = omapi_init();
54  if (status != ISC_R_SUCCESS)
55  return status;
56 
58  "dhcpctl-callback",
64  0, 0, 0, 0, 0, 0,
65  sizeof
67  RC_MISC);
68  if (status != ISC_R_SUCCESS)
69  return status;
70 
72  "dhcpctl-remote",
78  0, 0, 0, 0, 0, 0,
79  sizeof (dhcpctl_remote_object_t),
80  0, RC_MISC);
81  if (status != ISC_R_SUCCESS)
82  return status;
83 
84  return ISC_R_SUCCESS;
85 }
86 
87 /* dhcpctl_connect
88 
89  synchronous
90  returns nonzero status code if it didn't connect, zero otherwise
91  stores connection handle through connection, which can be used
92  for subsequent access to the specified server.
93  server_name is the name of the server, and port is the TCP
94  port on which it is listening.
95  authinfo is the handle to an object containing authentication
96  information. */
97 
99  const char *server_name, int port,
100  dhcpctl_handle authinfo)
101 {
102  isc_result_t status;
103 #ifdef DEBUG_DHCPCTL
104  log_debug("dhcpctl_connect(%s:%d)", server_name, port);
105 #endif
106 
107  status = omapi_generic_new (connection, MDL);
108  if (status != ISC_R_SUCCESS) {
109  return status;
110  }
111 
112  status = omapi_protocol_connect (*connection, server_name,
113  (unsigned)port, authinfo);
114  if (status == ISC_R_SUCCESS) {
115 #ifdef DEBUG_DHCPCTL
116  log_debug("dhcpctl_connect success");
117 #endif
118  return status;
119  }
120 
121  if (status != DHCP_R_INCOMPLETE) {
122  omapi_object_dereference (connection, MDL);
123 #ifdef DEBUG_DHCPCTL
124  log_debug("dhcpctl_connect failed:%s",
125  isc_result_totext (status));
126 #endif
127  return status;
128  }
129 
130  status = omapi_wait_for_completion (*connection, 0);
131  if (status != ISC_R_SUCCESS) {
132  omapi_object_dereference (connection, MDL);
133 #ifdef DEBUG_DHCPCTL
134  log_debug("dhcpctl_connect, wait failed:%s",
135  isc_result_totext (status));
136 #endif
137  return status;
138  }
139 
140 #ifdef DEBUG_DHCPCTL
141  log_debug("dhcpctl_connect success");
142 #endif
143  return status;
144 }
145 
146 /* dhcpctl_timed_connect
147 
148  synchronous
149  returns nonzero status code if it didn't connect, zero otherwise
150  stores connection handle through connection, which can be used
151  for subsequent access to the specified server.
152  server_name is the name of the server, and port is the TCP
153  port on which it is listening.
154  authinfo is the handle to an object containing authentication
155  information.
156  How long the function waits for the connection to complete is
157  dictated by the value of the parameter, t. If the value is nul,
158  it will wait indefinitely. Otherwise it will wait for the amount
159  of time specified by t (tv_sec:tv_usec). Values of zero for both
160  fields are valid but not recommended. */
162  const char *server_name, int port,
163  dhcpctl_handle authinfo,
164  struct timeval *t)
165 {
166  isc_result_t status;
167 #ifdef DEBUG_DHCPCTL
168  log_debug("dhcpctl_timed_connect(%s:%d)", server_name, port);
169 #endif
170  status = omapi_generic_new (connection, MDL);
171  if (status != ISC_R_SUCCESS) {
172  return status;
173  }
174 
175  status = omapi_protocol_connect (*connection, server_name,
176  (unsigned)port, authinfo);
177 
178  if (status == ISC_R_SUCCESS) {
179  return status;
180  }
181 
182  if (status == DHCP_R_INCOMPLETE) {
183  isc_result_t wait_status = ISC_R_SUCCESS;
184 
185  /* Wait for it to complete */
186  status = dhcpctl_timed_wait_for_completion(*connection,
187  &wait_status, t);
188  if (status == ISC_R_SUCCESS) {
189  status = wait_status;
190  }
191  }
192 
193  if (status != ISC_R_SUCCESS) {
194  omapi_object_dereference (connection, MDL);
195  }
196  return status;
197 }
198 
199 /* dhcpctl_wait_for_completion
200 
201  synchronous
202  returns zero if the callback completes, a nonzero status if
203  there was some problem relating to the wait operation. The
204  status of the queued request will be stored through s, and
205  will also be either zero for success or nonzero for some kind
206  of failure. Never returns until completion or until the
207  connection to the server is lost. This performs the same
208  function as dhcpctl_set_callback and the subsequent callback,
209  for programs that want to do inline execution instead of using
210  callbacks. */
211 
213  dhcpctl_status *s)
214 {
215 #ifdef DEBUG_DHCPCTL
216  log_debug("dhcpctl_wait_for_completion");
217 #endif
218  isc_result_t status;
219  status = omapi_wait_for_completion (h, 0);
220  if (status != ISC_R_SUCCESS) {
221  return status;
222  }
223  if (h -> type == dhcpctl_remote_type)
224  *s = ((dhcpctl_remote_object_t *)h) -> waitstatus;
225 
226  return ISC_R_SUCCESS;
227 }
228 
229 /* dhcpctl_timed_wait_for_completion
230 
231  synchronous
232  returns zero if the callback completes, a nonzero status if
233  there was some problem relating to the wait operation. The
234  status of the queued request will be stored through s, and
235  will also be either zero for success or nonzero for some kind
236  of failure. How long the function waits for a response is
237  dictated by the value of the parameter, t. If the value is nul,
238  it will wait indefinitely or until the connection is lost.
239  Otherwise it will wait for the amount of time specified by t
240  (tv_sec:tv_usec). Values of zero for both fields are valid
241  but not recommended. The result of the request as processed on the
242  server is returned via the parameter, s. This performs the same
243  function as dhcpctl_set_callback and the subsequent callback,
244  for programs that want to do inline execution instead of using
245  callbacks. */
246 
248  dhcpctl_status *s,
249  struct timeval *t)
250 {
251  isc_result_t status;
252  struct timeval adjusted_t;
253 
254 #ifdef DEBUG_DHCPCTL
255  if (t) {
256  log_debug ("dhcpctl_timed_wait_for_completion"
257  "(%u.%u secs.usecs)",
258  (unsigned int)(t->tv_sec),
259  (unsigned int)(t->tv_usec));
260  } else {
261  log_debug ("dhcpctl_timed_wait_for_completion(no timeout)");
262  }
263 #endif
264 
265  if (t) {
266  struct timeval now;
267  gettimeofday (&now, (struct timezone *)0);
268  adjusted_t.tv_sec = now.tv_sec + t->tv_sec;
269  adjusted_t.tv_usec = now.tv_usec + t->tv_usec;
270  }
271 
272  status = omapi_wait_for_completion (h, (t ? &adjusted_t : 0));
273  if (status != ISC_R_SUCCESS) {
274  return status;
275  }
276 
277  if (h->type == dhcpctl_remote_type) {
278  *s = ((dhcpctl_remote_object_t *)h)->waitstatus;
279  }
280 
281  return ISC_R_SUCCESS;
282 }
283 
284 
285 /* dhcpctl_get_value
286 
287  synchronous
288  returns zero if the call succeeded, a nonzero status code if
289  it didn't.
290  result is the address of an empty data string (initialized
291  with bzero or cleared with data_string_forget). On
292  successful completion, the addressed data string will contain
293  the value that was fetched.
294  dhcpctl_handle refers to some dhcpctl item
295  value_name refers to some value related to that item - e.g.,
296  for a handle associated with a completed host lookup, value
297  could be one of "hardware-address", "dhcp-client-identifier",
298  "known" or "client-hostname". */
299 
301  dhcpctl_handle h, const char *value_name)
302 {
303  isc_result_t status;
304  omapi_value_t *tv = (omapi_value_t *)0;
305  unsigned len;
306  int ip;
307 #ifdef DEBUG_DHCPCTL
308  log_debug("dhcpctl_get_value(%s)", value_name);
309 #endif
310 
311  status = omapi_get_value_str (h, (omapi_object_t *)0, value_name, &tv);
312  if (status != ISC_R_SUCCESS)
313  return status;
314 
315  switch (tv -> value -> type) {
316  case omapi_datatype_int:
317  len = sizeof (int);
318  break;
319 
321  case omapi_datatype_data:
322  len = tv -> value -> u.buffer.len;
323  break;
324 
326  len = sizeof (omapi_handle_t);
327  break;
328 
329  default:
331  return ISC_R_UNEXPECTED;
332  }
333 
334  status = omapi_data_string_new (result, len, MDL);
335  if (status != ISC_R_SUCCESS) {
337  return status;
338  }
339 
340  switch (tv -> value -> type) {
341  case omapi_datatype_int:
342  ip = htonl (tv -> value -> u.integer);
343  memcpy ((*result) -> value, &ip, sizeof ip);
344  break;
345 
347  case omapi_datatype_data:
348  memcpy ((*result) -> value,
349  tv -> value -> u.buffer.value,
350  tv -> value -> u.buffer.len);
351  break;
352 
354  ip = htonl (tv -> value -> u.object -> handle);
355  memcpy ((*result) -> value, &ip, sizeof ip);
356  break;
357  }
358 
360  return ISC_R_SUCCESS;
361 }
362 
363 /* dhcpctl_get_boolean
364 
365  like dhcpctl_get_value, but more convenient for boolean
366  values, since no data_string needs to be dealt with. */
367 
369  dhcpctl_handle h, const char *value_name)
370 {
371  isc_result_t status;
373  int rv;
374 
375 #ifdef DEBUG_DHCPCTL
376  log_debug("dhcpctl_get_boolean(%s)", value_name);
377 #endif
378 
379  status = dhcpctl_get_value (&data, h, value_name);
380  if (status != ISC_R_SUCCESS)
381  return status;
382  if (data -> len != sizeof rv) {
384  return ISC_R_UNEXPECTED;
385  }
386  memcpy (&rv, data -> value, sizeof rv);
387  *result = ntohl (rv);
389  return ISC_R_SUCCESS;
390 }
391 
392 /* dhcpctl_set_value
393 
394  Sets a value on an object referred to by a dhcpctl_handle.
395  The opposite of dhcpctl_get_value. Does not update the
396  server - just sets the value on the handle. */
397 
399  const char *value_name)
400 {
401  isc_result_t status;
404 #ifdef DEBUG_DHCPCTL
405  log_debug("dhcpctl_set_value(%s)", value_name);
406 #endif
407 
408  status = omapi_data_string_new (&name, strlen (value_name), MDL);
409  if (status != ISC_R_SUCCESS)
410  return status;
411  memcpy (name -> value, value_name, strlen (value_name));
412 
414  value -> len);
415  if (status != ISC_R_SUCCESS) {
417  return status;
418  }
419  memcpy (tv -> u.buffer.value, value -> value, value -> len);
420 
421  status = omapi_set_value (h, (omapi_object_t *)0, name, tv);
424  return status;
425 }
426 
427 /* dhcpctl_set_string_value
428 
429  Sets a NUL-terminated ASCII value on an object referred to by
430  a dhcpctl_handle. like dhcpctl_set_value, but saves the
431  trouble of creating a data_string for a NUL-terminated string.
432  Does not update the server - just sets the value on the handle. */
433 
435  const char *value_name)
436 {
437  isc_result_t status;
440 #ifdef DEBUG_DHCPCTL
441  log_debug("dhcpctl_set_string_value(%s)", value_name);
442 #endif
443 
444  status = omapi_data_string_new (&name, strlen (value_name), MDL);
445  if (status != ISC_R_SUCCESS)
446  return status;
447  memcpy (name -> value, value_name, strlen (value_name));
448 
450  if (status != ISC_R_SUCCESS) {
452  return status;
453  }
454 
455  status = omapi_set_value (h, (omapi_object_t *)0, name, tv);
458  return status;
459 }
460 
461 /* dhcpctl_set_buffer_value
462 
463  Sets a value on an object referred to by a dhcpctl_handle. like
464  dhcpctl_set_value, but saves the trouble of creating a data_string
465  for string for which we have a buffer and length. Does not update
466  the server - just sets the value on the handle. */
467 
469  const char *value, unsigned len,
470  const char *value_name)
471 {
472  isc_result_t status;
475  unsigned ll;
476 #ifdef DEBUG_DHCPCTL
477  log_debug("dhcpctl_set_data_value(%s)", value_name);
478 #endif
479 
480  ll = strlen (value_name);
481  status = omapi_data_string_new (&name, ll, MDL);
482  if (status != ISC_R_SUCCESS)
483  return status;
484  memcpy (name -> value, value_name, ll);
485 
486  status = omapi_typed_data_new (MDL, &tv,
487  omapi_datatype_data, len, value);
488  if (status != ISC_R_SUCCESS) {
490  return status;
491  }
492  memcpy (tv -> u.buffer.value, value, len);
493 
494  status = omapi_set_value (h, (omapi_object_t *)0, name, tv);
497  return status;
498 }
499 
500 /* dhcpctl_set_null_value
501 
502  Sets a null value on an object referred to by a dhcpctl_handle. */
503 
505  const char *value_name)
506 {
507  isc_result_t status;
509  unsigned ll;
510 #ifdef DEBUG_DHCPCTL
511  log_debug("dhcpctl_set_null_value(%s)", value_name);
512 #endif
513 
514  ll = strlen (value_name);
515  status = omapi_data_string_new (&name, ll, MDL);
516  if (status != ISC_R_SUCCESS)
517  return status;
518  memcpy (name -> value, value_name, ll);
519 
520  status = omapi_set_value (h, (omapi_object_t *)0, name,
521  (omapi_typed_data_t *)0);
523  return status;
524 }
525 
526 /* dhcpctl_set_boolean_value
527 
528  Sets a boolean value on an object - like dhcpctl_set_value,
529  only more convenient for booleans. */
530 
532  const char *value_name)
533 {
534  isc_result_t status;
537 #ifdef DEBUG_DHCPCTL
538  log_debug("dhcpctl_set_boolean_value(%s)", value_name);
539 #endif
540 
541  status = omapi_data_string_new (&name, strlen (value_name), MDL);
542  if (status != ISC_R_SUCCESS)
543  return status;
544  memcpy (name -> value, value_name, strlen (value_name));
545 
547  if (status != ISC_R_SUCCESS) {
549  return status;
550  }
551 
552  status = omapi_set_value (h, (omapi_object_t *)0, name, tv);
555  return status;
556 }
557 
558 /* dhcpctl_set_int_value
559 
560  Sets a boolean value on an object - like dhcpctl_set_value,
561  only more convenient for booleans. */
562 
564  const char *value_name)
565 {
566  isc_result_t status;
569 #ifdef DEBUG_DHCPCTL
570  log_debug("dhcpctl_set_int_value(%s)", value_name);
571 #endif
572 
573  status = omapi_data_string_new (&name, strlen (value_name), MDL);
574  if (status != ISC_R_SUCCESS)
575  return status;
576  memcpy (name -> value, value_name, strlen (value_name));
577 
579  if (status != ISC_R_SUCCESS) {
581  return status;
582  }
583 
584  status = omapi_set_value (h, (omapi_object_t *)0, name, tv);
587  return status;
588 }
589 
590 /* dhcpctl_object_update
591 
592  Queues an update on the object referenced by the handle (there
593  can't be any other work in progress on the handle). An
594  update means local parameters will be sent to the server. */
595 
597  dhcpctl_handle h)
598 {
599  isc_result_t status;
600  omapi_object_t *message = (omapi_object_t *)0;
602 #ifdef DEBUG_DHCPCTL
603  log_debug("dhcpctl_object_update");
604 #endif
605 
606  if (h -> type != dhcpctl_remote_type)
607  return DHCP_R_INVALIDARG;
608  ro = (dhcpctl_remote_object_t *)h;
609 
610  status = omapi_message_new (&message, MDL);
611  if (status != ISC_R_SUCCESS) {
612  omapi_object_dereference (&message, MDL);
613  return status;
614  }
615  status = omapi_set_int_value (message, (omapi_object_t *)0,
616  "op", OMAPI_OP_UPDATE);
617  if (status != ISC_R_SUCCESS) {
618  omapi_object_dereference (&message, MDL);
619  return status;
620  }
621 
622  status = omapi_set_object_value (message, (omapi_object_t *)0,
623  "object", h);
624  if (status != ISC_R_SUCCESS) {
625  omapi_object_dereference (&message, MDL);
626  return status;
627  }
628 
629  status = omapi_set_int_value (message, (omapi_object_t *)0, "handle",
630  (int)(ro -> remote_handle));
631  if (status != ISC_R_SUCCESS) {
632  omapi_object_dereference (&message, MDL);
633  return status;
634  }
635 
636  omapi_message_register (message);
637  status = omapi_protocol_send_message (connection -> outer,
638  (omapi_object_t *)0,
639  message, (omapi_object_t *)0);
640  omapi_object_dereference (&message, MDL);
641  return status;
642 }
643 
644 /* Requests a refresh on the object referenced by the handle (there
645  can't be any other work in progress on the handle). A
646  refresh means local parameters are updated from the server. */
647 
649  dhcpctl_handle h)
650 {
651  isc_result_t status;
652  omapi_object_t *message = (omapi_object_t *)0;
654 #ifdef DEBUG_DHCPCTL
655  log_debug("dhcpctl_object_refresh");
656 #endif
657 
658  if (h -> type != dhcpctl_remote_type)
659  return DHCP_R_INVALIDARG;
660  ro = (dhcpctl_remote_object_t *)h;
661 
662  status = omapi_message_new (&message, MDL);
663  if (status != ISC_R_SUCCESS) {
664  omapi_object_dereference (&message, MDL);
665  return status;
666  }
667  status = omapi_set_int_value (message, (omapi_object_t *)0,
668  "op", OMAPI_OP_REFRESH);
669  if (status != ISC_R_SUCCESS) {
670  omapi_object_dereference (&message, MDL);
671  return status;
672  }
673  status = omapi_set_int_value (message, (omapi_object_t *)0,
674  "handle", (int)(ro -> remote_handle));
675  if (status != ISC_R_SUCCESS) {
676  omapi_object_dereference (&message, MDL);
677  return status;
678  }
679 
680  omapi_message_register (message);
681  status = omapi_protocol_send_message (connection -> outer,
682  (omapi_object_t *)0,
683  message, (omapi_object_t *)0);
684 
685  /* We don't want to send the contents of the object down the
686  wire, but we do need to reference it so that we know what
687  to do with the update. */
688  status = omapi_set_object_value (message, (omapi_object_t *)0,
689  "object", h);
690  if (status != ISC_R_SUCCESS) {
691  omapi_object_dereference (&message, MDL);
692  return status;
693  }
694 
695  omapi_object_dereference (&message, MDL);
696  return status;
697 }
698 
699 /* Requests the removal of the object referenced by the handle (there
700  can't be any other work in progress on the handle). A
701  removal means that all searchable references to the object on the
702  server are deleted. */
703 
705  dhcpctl_handle h)
706 {
707  isc_result_t status;
708  omapi_object_t *message = (omapi_object_t *)0;
710 #ifdef DEBUG_DHCPCTL
711  log_debug("dhcpctl_object_remove");
712 #endif
713 
714  if (h -> type != dhcpctl_remote_type)
715  return DHCP_R_INVALIDARG;
716  ro = (dhcpctl_remote_object_t *)h;
717 
718  status = omapi_message_new (&message, MDL);
719  if (status != ISC_R_SUCCESS) {
720  omapi_object_dereference (&message, MDL);
721  return status;
722  }
723  status = omapi_set_int_value (message, (omapi_object_t *)0,
724  "op", OMAPI_OP_DELETE);
725  if (status != ISC_R_SUCCESS) {
726  omapi_object_dereference (&message, MDL);
727  return status;
728  }
729 
730  status = omapi_set_int_value (message, (omapi_object_t *)0, "handle",
731  (int)(ro -> remote_handle));
732  if (status != ISC_R_SUCCESS) {
733  omapi_object_dereference (&message, MDL);
734  return status;
735  }
736 
737  status = omapi_set_object_value (message, (omapi_object_t *)0,
738  "notify-object", h);
739  if (status != ISC_R_SUCCESS) {
740  omapi_object_dereference (&message, MDL);
741  return status;
742  }
743 
744  omapi_message_register (message);
745  status = omapi_protocol_send_message (connection -> outer,
746  (omapi_object_t *)0,
747  message, (omapi_object_t *)0);
748  omapi_object_dereference (&message, MDL);
749  return status;
750 }
751 
753  const char *file, int line)
754 {
755 #ifdef DEBUG_DHCPCTL
756  log_debug("dhcpctl_data_string_dereference");
757 #endif
759 }
760 
762  int force)
763 {
764  isc_result_t status;
765 #ifdef DEBUG_DHCPCTL
766  log_debug("dhcpctl_disconnect()");
767 #endif
768  if (!connection || !((*connection)->outer) ||
769  !((*connection)->outer->type) ||
770  ((*connection)->outer->type != omapi_type_protocol) ||
771  !((*connection)->outer->outer)) {
772  log_debug("dhcpctl_disconnect detected invalid arg");
773  return DHCP_R_INVALIDARG;
774  }
775 
776  status = omapi_disconnect ((*connection)->outer->outer, force);
777  if (status == ISC_R_SUCCESS) {
778 #ifdef DEBUG_DHCPCTL
779  log_debug("dhcpctl_disconnect success");
780 #endif
781  omapi_object_dereference (connection, MDL);
782  return status;
783  }
784 
785 #ifdef DEBUG_DHCPCTL
786  log_debug("dhcpctl_disconnect failed:%s",
787  isc_result_totext (status));
788 #endif
789  return status;
790 }
791 
#define RC_MISC
Definition: alloc.h:56
isc_result_t dhcpctl_callback_signal_handler(omapi_object_t *o, const char *name, va_list ap)
Definition: callback.c:103
isc_result_t dhcpctl_callback_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
Definition: callback.c:89
isc_result_t dhcpctl_callback_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *p)
Definition: callback.c:150
isc_result_t dhcpctl_callback_destroy(omapi_object_t *h, const char *file, int line)
Definition: callback.c:134
isc_result_t dhcpctl_callback_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
Definition: callback.c:75
dhcpctl_status dhcpctl_wait_for_completion(dhcpctl_handle h, dhcpctl_status *s)
Definition: dhcpctl.c:212
isc_result_t dhcpctl_data_string_dereference(dhcpctl_data_string *vp, const char *file, int line)
Definition: dhcpctl.c:752
dhcpctl_status dhcpctl_object_refresh(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:648
dhcpctl_status dhcpctl_connect(dhcpctl_handle *connection, const char *server_name, int port, dhcpctl_handle authinfo)
Definition: dhcpctl.c:98
dhcpctl_status dhcpctl_object_update(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:596
dhcpctl_status dhcpctl_timed_connect(dhcpctl_handle *connection, const char *server_name, int port, dhcpctl_handle authinfo, struct timeval *t)
Definition: dhcpctl.c:161
dhcpctl_status dhcpctl_set_int_value(dhcpctl_handle h, int value, const char *value_name)
Definition: dhcpctl.c:563
dhcpctl_status dhcpctl_disconnect(dhcpctl_handle *connection, int force)
Definition: dhcpctl.c:761
dhcpctl_status dhcpctl_object_remove(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:704
dhcpctl_status dhcpctl_set_value(dhcpctl_handle h, dhcpctl_data_string value, const char *value_name)
Definition: dhcpctl.c:398
dhcpctl_status dhcpctl_set_null_value(dhcpctl_handle h, const char *value_name)
Definition: dhcpctl.c:504
dhcpctl_status dhcpctl_timed_wait_for_completion(dhcpctl_handle h, dhcpctl_status *s, struct timeval *t)
Definition: dhcpctl.c:247
dhcpctl_status dhcpctl_initialize()
Definition: dhcpctl.c:43
dhcpctl_status dhcpctl_set_string_value(dhcpctl_handle h, const char *value, const char *value_name)
Definition: dhcpctl.c:434
omapi_object_type_t * dhcpctl_remote_type
Definition: dhcpctl.c:37
dhcpctl_status dhcpctl_set_data_value(dhcpctl_handle h, const char *value, unsigned len, const char *value_name)
Definition: dhcpctl.c:468
dhcpctl_status dhcpctl_get_value(dhcpctl_data_string *result, dhcpctl_handle h, const char *value_name)
Definition: dhcpctl.c:300
omapi_object_type_t * dhcpctl_callback_type
Definition: dhcpctl.c:36
dhcpctl_status dhcpctl_set_boolean_value(dhcpctl_handle h, int value, const char *value_name)
Definition: dhcpctl.c:531
dhcpctl_status dhcpctl_get_boolean(int *result, dhcpctl_handle h, const char *value_name)
Definition: dhcpctl.c:368
isc_result_t dhcpctl_remote_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: remote.c:343
isc_result_t dhcpctl_remote_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: remote.c:251
omapi_data_string_t * dhcpctl_data_string
Definition: dhcpctl.h:36
isc_result_t dhcpctl_remote_destroy(omapi_object_t *, const char *, int)
Definition: remote.c:324
isc_result_t dhcpctl_remote_signal_handler(omapi_object_t *, const char *, va_list)
Definition: remote.c:291
isc_result_t dhcpctl_remote_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: remote.c:277
isc_result_t dhcpctl_status
Definition: dhcpctl.h:34
const char int line
Definition: dhcpd.h:3802
const char * file
Definition: dhcpd.h:3802
isc_result_t dhcp_context_create(int flags, struct in_addr *local4, struct in6_addr *local6)
Definition: isclib.c:167
#define DHCP_CONTEXT_PRE_DB
Definition: isclib.h:134
#define DHCP_CONTEXT_POST_DB
Definition: isclib.h:135
#define ISC_R_SUCCESS
isc_result_t omapi_value_dereference(omapi_value_t **, const char *, int)
Definition: alloc.c:1060
isc_result_t omapi_protocol_connect(omapi_object_t *, const char *, unsigned, omapi_object_t *)
#define MDL
Definition: omapip.h:567
isc_result_t omapi_protocol_send_message(omapi_object_t *, omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: protocol.c:148
isc_result_t omapi_generic_new(omapi_object_t **, const char *, int)
isc_result_t omapi_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: support.c:303
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
Definition: alloc.c:593
isc_result_t omapi_set_object_value(omapi_object_t *, omapi_object_t *, const char *, omapi_object_t *)
Definition: support.c:419
isc_result_t omapi_data_string_new(omapi_data_string_t **, unsigned, const char *, int)
Definition: alloc.c:950
const char int
Definition: omapip.h:442
isc_result_t omapi_message_register(omapi_object_t *)
Definition: message.c:267
isc_result_t omapi_disconnect(omapi_object_t *, int)
Definition: connection.c:458
isc_result_t omapi_init(void)
Definition: support.c:61
isc_result_t omapi_object_type_register(omapi_object_type_t **, const char *, isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t *, const char *, va_list), isc_result_t(*)(omapi_object_t *, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t **, omapi_object_t *), isc_result_t(*)(omapi_object_t *, omapi_object_t *), isc_result_t(*)(omapi_object_t *, const char *, int), isc_result_t(*)(omapi_object_t **, const char *, int), isc_result_t(*)(size_t), size_t, isc_result_t(*)(omapi_object_t *, const char *, int), int)
Definition: support.c:193
@ omapi_datatype_string
Definition: omapip.h:43
@ omapi_datatype_object
Definition: omapip.h:45
@ omapi_datatype_int
Definition: omapip.h:42
@ omapi_datatype_data
Definition: omapip.h:44
isc_result_t omapi_typed_data_dereference(omapi_typed_data_t **, const char *, int)
Definition: alloc.c:901
isc_result_t omapi_wait_for_completion(omapi_object_t *, struct timeval *)
Definition: dispatch.c:424
omapi_object_type_t * omapi_type_protocol
Definition: support.c:38
isc_result_t omapi_data_string_dereference(omapi_data_string_t **, const char *, int)
Definition: alloc.c:988
unsigned int omapi_handle_t
Definition: omapip.h:36
isc_result_t omapi_typed_data_new(const char *, int, omapi_typed_data_t **, omapi_datatype_t,...)
Definition: alloc.c:803
isc_result_t omapi_get_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_value_t **)
Definition: support.c:482
isc_result_t omapi_message_new(omapi_object_t **, const char *, int)
isc_result_t omapi_set_int_value(omapi_object_t *, omapi_object_t *, const char *, int)
Definition: support.c:395
#define OMAPI_OP_UPDATE
Definition: omapip_p.h:93
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
#define OMAPI_OP_DELETE
Definition: omapip_p.h:96
#define OMAPI_OP_REFRESH
Definition: omapip_p.h:92
#define DHCP_R_INVALIDARG
Definition: result.h:49
#define DHCP_R_INCOMPLETE
Definition: result.h:58
Definition: data.h:289
Definition: ip.h:47
struct omapi_typed_data_t::@3::@4 buffer
Definition: data.h:205