ISC DHCP  4.3.6
A reference DHCPv4 and DHCPv6 implementation
omshell.c
Go to the documentation of this file.
1 /* omshell.c
2 
3  Examine and modify omapi objects. */
4 
5 /*
6  * Copyright (c) 2009-2011,2013-2015 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
8  * Copyright (c) 2001-2003 by Internet Software Consortium
9  *
10  * Permission to use, copy, modify, and distribute this software for any
11  * purpose with or without fee is hereby granted, provided that the above
12  * copyright notice and this permission notice appear in all copies.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
15  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
17  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  * Internet Systems Consortium, Inc.
23  * 950 Charter Street
24  * Redwood City, CA 94063
25  * <info@isc.org>
26  * https://www.isc.org/
27  *
28  */
29 
30 #include "config.h"
31 
32 #include <time.h>
33 #include <sys/time.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <stdarg.h>
37 #include <string.h>
38 //#include "result.h"
39 #include <syslog.h>
40 #include "dhcpctl.h"
41 #include "dhcpd.h"
42 #include <isc/file.h>
43 
44 /* Fixups */
45 isc_result_t find_class (struct class **c, const char *n, const char *f, int l)
46 {
47  return 0;
48 }
49 int parse_allow_deny (struct option_cache **oc, struct parse *cfile, int flag)
50 {
51  return 0;
52 }
53 void dhcp (struct packet *packet) { }
54 void bootp (struct packet *packet) { }
55 
56 #ifdef DHCPv6
57 /* XXX: should we warn or something here? */
58 void dhcpv6(struct packet *packet) { }
59 #endif /* DHCPv6 */
60 
61 int check_collection (struct packet *p, struct lease *l, struct collection *c)
62 {
63  return 0;
64 }
65 void classify (struct packet *packet, struct class *class) { }
66 
67 static void usage (const char *s) {
68  fprintf (stderr, "Usage: %s\n", s);
69  exit (1);
70 }
71 
72 static void check (isc_result_t status, const char *func) {
73  if (status != ISC_R_SUCCESS) {
74  fprintf (stderr, "%s: %s\n", func, isc_result_totext (status));
75  exit (1);
76  }
77 }
78 
79 int
80 main(int argc, char **argv) {
81  isc_result_t status, waitstatus;
82  dhcpctl_handle connection;
83  dhcpctl_handle authenticator;
84  dhcpctl_handle oh;
85  struct data_string secret;
86  const char *name = 0, *algorithm = "hmac-md5";
87  int i;
88  int port = 7911;
89  const char *server = "127.0.0.1";
90  struct parse *cfile;
91  enum dhcp_token token;
92  const char *val;
93  char *s;
94  char buf[1024];
95  char s1[1024];
96  int connected = 0;
97  char hex_buf[1025];
98  char *progname;
99 
100 #ifdef OLD_LOG_NAME
101  progname = "omshell";
102 #else
103  progname = argv[0];
104 #endif
105 
106  for (i = 1; i < argc; i++) {
107  usage(isc_file_basename(progname));
108  }
109 
110  /* Initially, log errors to stderr as well as to syslogd. */
111  openlog (isc_file_basename(progname),
113  status = dhcpctl_initialize ();
114  if (status != ISC_R_SUCCESS) {
115  fprintf (stderr, "dhcpctl_initialize: %s\n",
116  isc_result_totext (status));
117  exit (1);
118  }
119 
120  memset (&oh, 0, sizeof oh);
121 
122  do {
123  if (!connected) {
124  } else if (oh == NULL) {
125  printf ("obj: <null>\n");
126  } else {
129  (omapi_generic_object_t *)(r -> inner);
130 
131  printf ("obj: ");
132 
133  if (r -> rtype -> type != omapi_datatype_string) {
134  printf ("?\n");
135  } else {
136  printf ("%.*s\n",
137  (int)(r -> rtype -> u . buffer . len),
138  r -> rtype -> u . buffer . value);
139  }
140 
141  for (i = 0; i < g -> nvalues; i++) {
142  omapi_value_t *v = g -> values [i];
143 
144  if (!g -> values [i])
145  continue;
146 
147  printf ("%.*s = ", (int)v -> name -> len,
148  v -> name -> value);
149 
150  if (!v -> value) {
151  printf ("<null>\n");
152  continue;
153  }
154  switch (v -> value -> type) {
155  case omapi_datatype_int:
156  printf ("%d\n",
157  v -> value -> u . integer);
158  break;
159 
161  printf ("\"%.*s\"\n",
162  (int) v -> value -> u.buffer.len,
163  v -> value -> u.buffer.value);
164  break;
165 
166  case omapi_datatype_data:
168  v->value->u.buffer.value,
169  sizeof(hex_buf), hex_buf);
170  printf("%s\n", hex_buf);
171  break;
172 
174  printf ("<obj>\n");
175  break;
176  }
177  }
178  }
179 
180  fputs ("> ", stdout);
181  fflush (stdout);
182  if (fgets (buf, sizeof(buf), stdin) == NULL)
183  break;
184 
185  status = new_parse (&cfile, -1, buf, strlen(buf), "<STDIN>", 1);
186  check(status, "new_parse()");
187 
188  token = next_token (&val, (unsigned *)0, cfile);
189  switch (token) {
190  default:
191  parse_warn (cfile, "unknown token: %s", val);
192  skip_to_semi (cfile);
193  break;
194 
195  case END_OF_FILE:
196  case ENDOFLINE: /* EOL: */
197  break;
198 
199  case TOKEN_HELP:
200  case QUESTIONMARK: /* '?': */
201  printf ("Commands:\n");
202  printf (" port <server omapi port>\n");
203  printf (" server <server address>\n");
204  printf (" key <key name> <key value>\n");
205  printf (" connect\n");
206  printf (" new <object-type>\n");
207  printf (" set <name> = <value>\n");
208  printf (" create\n");
209  printf (" open\n");
210  printf (" update\n");
211  printf (" unset <name>\n");
212  printf (" refresh\n");
213  printf (" remove\n");
214  skip_to_semi (cfile);
215  break;
216 
217  case PORT:
218  token = next_token (&val, (unsigned *)0, cfile);
219  if (is_identifier (token)) {
220  struct servent *se;
221  se = getservbyname (val, "tcp");
222  if (se)
223  port = ntohs (se -> s_port);
224  else {
225  printf ("unknown service name: %s\n", val);
226  break;
227  }
228  } else if (token == NUMBER) {
229  port = atoi (val);
230  } else {
231  skip_to_semi (cfile);
232  printf ("usage: port <port>\n");
233  break;
234  }
235  token = next_token (&val, (unsigned *)0, cfile);
236  if (token != END_OF_FILE && token != EOL) {
237  printf ("usage: port <server>\n");
238  skip_to_semi (cfile);
239  break;
240  }
241  break;
242 
243  case TOKEN_SERVER:
244  token = next_token (&val, (unsigned *)0, cfile);
245  if (token == NUMBER) {
246  int alen = (sizeof buf) - 1;
247  int len;
248 
249  s = &buf [0];
250  len = strlen (val);
251  if (len + 1 > alen) {
252  baddq:
253  printf ("usage: server <server>\n");
254  skip_to_semi (cfile);
255  break;
256  } strcpy (buf, val);
257  s += len;
258  token = next_token (&val, (unsigned *)0, cfile);
259  if (token != DOT)
260  goto baddq;
261  *s++ = '.';
262  token = next_token (&val, (unsigned *)0, cfile);
263  if (token != NUMBER)
264  goto baddq;
265  len = strlen (val);
266  if (len + 1 > alen)
267  goto baddq;
268  strcpy (s, val);
269  s += len;
270  token = next_token (&val, (unsigned *)0, cfile);
271  if (token != DOT)
272  goto baddq;
273  *s++ = '.';
274  token = next_token (&val, (unsigned *)0, cfile);
275  if (token != NUMBER)
276  goto baddq;
277  len = strlen (val);
278  if (len + 1 > alen)
279  goto baddq;
280  strcpy (s, val);
281  s += len;
282  token = next_token (&val, (unsigned *)0, cfile);
283  if (token != DOT)
284  goto baddq;
285  *s++ = '.';
286  token = next_token (&val, (unsigned *)0, cfile);
287  if (token != NUMBER)
288  goto baddq;
289  len = strlen (val);
290  if (len + 1 > alen)
291  goto baddq;
292  strcpy (s, val);
293  val = &buf [0];
294  } else if (is_identifier (token)) {
295  /* Use val directly. */
296  } else {
297  printf ("usage: server <server>\n");
298  skip_to_semi (cfile);
299  break;
300  }
301 
302  s = dmalloc (strlen (val) + 1, MDL);
303  if (!server) {
304  printf ("no memory to store server name.\n");
305  skip_to_semi (cfile);
306  break;
307  }
308  strcpy (s, val);
309  server = s;
310 
311  token = next_token (&val, (unsigned *)0, cfile);
312  if (token != END_OF_FILE && token != EOL) {
313  printf ("usage: server <server>\n");
314  skip_to_semi (cfile);
315  break;
316  }
317  break;
318 
319  case KEY_ALGORITHM:
320  /* Algorithm is optional */
321  token = next_token (&val, (unsigned *)0, cfile);
322  if (token != NAME || !is_identifier(token)) {
323  printf ("missing or invalid algorithm name\n");
324  printf ("usage: key-algoritm <algorithm name>\n");
325  skip_to_semi (cfile);
326  break;
327  }
328 
329  s = dmalloc (strlen (val) + 1, MDL);
330  if (!s) {
331  printf ("no memory for algorithm name.\n");
332  skip_to_semi (cfile);
333  break;
334  }
335 
336  strcpy (s, val);
337  algorithm = s;
338 
339  token = next_token (&val, (unsigned *)0, cfile);
340  if (token != END_OF_FILE && token != EOL) {
341  printf ("extra information after %s\n", algorithm);
342  printf ("usage: key-algorithm <algorithm name>\n");
343  skip_to_semi (cfile);
344  break;
345  }
346 
347  break;
348 
349  case KEY:
350  token = peek_token(&val, (unsigned *)0, cfile);
351  if (token == STRING) {
352  token = next_token (&val, (unsigned *)0, cfile);
353  if (!is_identifier (token)) {
354  printf ("usage: key <name> <value>\n");
355  skip_to_semi (cfile);
356  break;
357  }
358  s = dmalloc (strlen (val) + 1, MDL);
359  if (!s) {
360  printf ("no memory for key name.\n");
361  skip_to_semi (cfile);
362  break;
363  }
364  strcpy (s, val);
365  } else {
366  s = parse_host_name(cfile);
367  if (s == NULL) {
368  printf ("usage: key <name> <value>\n");
369  skip_to_semi(cfile);
370  break;
371  }
372  }
373  name = s;
374 
375  memset (&secret, 0, sizeof secret);
376  if (!parse_base64 (&secret, cfile)) {
377  skip_to_semi (cfile);
378  break;
379  }
380 
381  token = next_token (&val, (unsigned *)0, cfile);
382  if (token != END_OF_FILE && token != EOL) {
383  printf ("usage: key <name> <value> {algorithm}\n");
384  skip_to_semi (cfile);
385  break;
386  }
387 
388  break;
389 
390  case CONNECT:
391  token = next_token (&val, (unsigned *)0, cfile);
392  if (token != END_OF_FILE && token != EOL) {
393  printf ("usage: connect\n");
394  skip_to_semi (cfile);
395  break;
396  }
397 
398  authenticator = dhcpctl_null_handle;
399 
400  if (name) {
401  status = dhcpctl_new_authenticator (&authenticator,
402  name, algorithm,
403  secret.data,
404  secret.len);
405 
406  if (status != ISC_R_SUCCESS) {
407  fprintf (stderr,
408  "Cannot create authenticator: %s\n",
409  isc_result_totext (status));
410  break;
411  }
412  }
413 
414  memset (&connection, 0, sizeof connection);
415  status = dhcpctl_connect (&connection,
416  server, port, authenticator);
417  if (status != ISC_R_SUCCESS) {
418  fprintf (stderr, "dhcpctl_connect: %s\n",
419  isc_result_totext (status));
420  break;
421  }
422  connected = 1;
423  break;
424 
425  case TOKEN_NEW:
426  token = next_token (&val, (unsigned *)0, cfile);
427  if ((!is_identifier (token) && token != STRING)) {
428  printf ("usage: new <object-type>\n");
429  break;
430  }
431 
432  if (oh) {
433  printf ("an object is already open.\n");
434  skip_to_semi (cfile);
435  break;
436  }
437 
438  if (!connected) {
439  printf ("not connected.\n");
440  skip_to_semi (cfile);
441  break;
442  }
443 
444  status = dhcpctl_new_object (&oh, connection, val);
445  if (status != ISC_R_SUCCESS) {
446  printf ("can't create object: %s\n",
447  isc_result_totext (status));
448  break;
449  }
450 
451  token = next_token (&val, (unsigned *)0, cfile);
452  if (token != END_OF_FILE && token != EOL) {
453  printf ("usage: new <object-type>\n");
454  skip_to_semi (cfile);
455  break;
456  }
457  break;
458 
459  case TOKEN_CLOSE:
460  token = next_token (&val, (unsigned *)0, cfile);
461  if (token != END_OF_FILE && token != EOL) {
462  printf ("usage: close\n");
463  skip_to_semi (cfile);
464  break;
465  }
466 
467  if (!connected) {
468  printf ("not connected.\n");
469  skip_to_semi (cfile);
470  break;
471  }
472 
473  if (!oh) {
474  printf ("not open.\n");
475  skip_to_semi (cfile);
476  break;
477  }
479 
480  break;
481 
482  case TOKEN_SET:
483  token = next_token (&val, (unsigned *)0, cfile);
484 
485  if ((!is_identifier (token) && token != STRING)) {
486  set_usage:
487  printf ("usage: set <name> = <value>\n");
488  skip_to_semi (cfile);
489  break;
490  }
491 
492  if (oh == NULL) {
493  printf ("no open object.\n");
494  skip_to_semi (cfile);
495  break;
496  }
497 
498  if (!connected) {
499  printf ("not connected.\n");
500  skip_to_semi (cfile);
501  break;
502  }
503 
504 #ifdef HAVE_STRLCPY
505  strlcpy (s1, val, sizeof(s1));
506 #else
507  s1[0] = 0;
508  strncat (s1, val, sizeof(s1)-strlen(s1)-1);
509 #endif
510 
511  token = next_token (&val, (unsigned *)0, cfile);
512  if (token != EQUAL)
513  goto set_usage;
514 
515  token = next_token (&val, (unsigned *)0, cfile);
516  switch (token) {
517  case STRING:
518  dhcpctl_set_string_value (oh, val, s1);
519  token = next_token (&val, (unsigned *)0, cfile);
520  break;
521 
522  case NUMBER:
523  strcpy (buf, val);
524  token = peek_token (&val, (unsigned *)0, cfile);
525  /* Colon-separated hex list? */
526  if (token == COLON)
527  goto cshl;
528  else if (token == DOT) {
529  s = buf;
530  val = buf;
531  do {
532  int intval = atoi (val);
533  if (intval > 255) {
534  parse_warn (cfile,
535  "dotted octet > 255: %s",
536  val);
537  skip_to_semi (cfile);
538  goto badnum;
539  }
540  *s++ = intval;
541  token = next_token (&val,
542  (unsigned *)0, cfile);
543  if (token != DOT)
544  break;
545  /* DOT is zero. */
546  while ((token = next_token (&val,
547  (unsigned *)0, cfile)) == DOT)
548  *s++ = 0;
549  } while (token == NUMBER);
550  dhcpctl_set_data_value (oh, buf,
551  (unsigned)(s - buf),
552  s1);
553  break;
554  }
555  dhcpctl_set_int_value (oh, atoi (buf), s1);
556  token = next_token (&val, (unsigned *)0, cfile);
557  badnum:
558  break;
559 
560  case NUMBER_OR_NAME:
561  strcpy (buf, val);
562  cshl:
563  s = buf;
564  val = buf;
565  do {
566  convert_num (cfile, (unsigned char *)s,
567  val, 16, 8);
568  ++s;
569  token = next_token (&val,
570  (unsigned *)0, cfile);
571  if (token != COLON)
572  break;
573  token = next_token (&val,
574  (unsigned *)0, cfile);
575  } while (token == NUMBER ||
576  token == NUMBER_OR_NAME);
577  dhcpctl_set_data_value (oh, buf,
578  (unsigned)(s - buf), s1);
579  break;
580 
581  default:
582  printf ("invalid value.\n");
583  skip_to_semi (cfile);
584  }
585 
586  if (token != END_OF_FILE && token != EOL)
587  goto set_usage;
588  break;
589 
590  case UNSET:
591  token = next_token (&val, (unsigned *)0, cfile);
592 
593  if ((!is_identifier (token) && token != STRING)) {
594  unset_usage:
595  printf ("usage: unset <name>\n");
596  skip_to_semi (cfile);
597  break;
598  }
599 
600  if (!oh) {
601  printf ("no open object.\n");
602  skip_to_semi (cfile);
603  break;
604  }
605 
606  if (!connected) {
607  printf ("not connected.\n");
608  skip_to_semi (cfile);
609  break;
610  }
611 
612 #if HAVE_STRLCPY
613  strlcpy (s1, val, sizeof(s1));
614 #else
615  s1[0] = 0;
616  strncat (s1, val, sizeof(s1)-strlen(s1)-1);
617 #endif
618 
619  token = next_token (&val, (unsigned *)0, cfile);
620  if (token != END_OF_FILE && token != EOL)
621  goto unset_usage;
622 
623  dhcpctl_set_null_value (oh, s1);
624  break;
625 
626 
627  case TOKEN_CREATE:
628  case TOKEN_OPEN:
629  i = token;
630  token = next_token (&val, (unsigned *)0, cfile);
631  if (token != END_OF_FILE && token != EOL) {
632  printf ("usage: %s\n", val);
633  skip_to_semi (cfile);
634  break;
635  }
636 
637  if (!connected) {
638  printf ("not connected.\n");
639  skip_to_semi (cfile);
640  break;
641  }
642 
643  if (!oh) {
644  printf ("you must make a new object first!\n");
645  skip_to_semi (cfile);
646  break;
647  }
648 
649  if (i == TOKEN_CREATE)
651  else
652  i = 0;
653 
654  status = dhcpctl_open_object (oh, connection, i);
655  if (status == ISC_R_SUCCESS)
657  (oh, &waitstatus);
658  if (status == ISC_R_SUCCESS)
659  status = waitstatus;
660  if (status != ISC_R_SUCCESS) {
661  printf ("can't open object: %s\n",
662  isc_result_totext (status));
663  break;
664  }
665 
666  break;
667 
668  case UPDATE:
669  token = next_token (&val, (unsigned *)0, cfile);
670  if (token != END_OF_FILE && token != EOL) {
671  printf ("usage: %s\n", val);
672  skip_to_semi (cfile);
673  break;
674  }
675 
676  if (!connected) {
677  printf ("not connected.\n");
678  skip_to_semi (cfile);
679  break;
680  }
681 
682  if (!oh) {
683  printf ("you haven't opened an object yet!\n");
684  skip_to_semi (cfile);
685  break;
686  }
687 
688  status = dhcpctl_object_update(connection, oh);
689  if (status == ISC_R_SUCCESS)
691  (oh, &waitstatus);
692  if (status == ISC_R_SUCCESS)
693  status = waitstatus;
694  if (status != ISC_R_SUCCESS) {
695  printf ("can't update object: %s\n",
696  isc_result_totext (status));
697  break;
698  }
699 
700  break;
701 
702  case REMOVE:
703  token = next_token (&val, (unsigned *)0, cfile);
704  if (token != END_OF_FILE && token != EOL) {
705  printf ("usage: remove\n");
706  skip_to_semi (cfile);
707  break;
708  }
709 
710  if (!connected) {
711  printf ("not connected.\n");
712  break;
713  }
714 
715  if (!oh) {
716  printf ("no object.\n");
717  break;
718  }
719 
720  status = dhcpctl_object_remove(connection, oh);
721  if (status == ISC_R_SUCCESS)
723  (oh, &waitstatus);
724  if (status == ISC_R_SUCCESS)
725  status = waitstatus;
726  if (status != ISC_R_SUCCESS) {
727  printf ("can't destroy object: %s\n",
728  isc_result_totext (status));
729  break;
730  }
732  break;
733 
734  case REFRESH:
735  token = next_token (&val, (unsigned *)0, cfile);
736  if (token != END_OF_FILE && token != EOL) {
737  printf ("usage: refresh\n");
738  skip_to_semi (cfile);
739  break;
740  }
741 
742  if (!connected) {
743  printf ("not connected.\n");
744  break;
745  }
746 
747  if (!oh) {
748  printf ("no object.\n");
749  break;
750  }
751 
752  status = dhcpctl_object_refresh(connection, oh);
753  if (status == ISC_R_SUCCESS)
755  (oh, &waitstatus);
756  if (status == ISC_R_SUCCESS)
757  status = waitstatus;
758  if (status != ISC_R_SUCCESS) {
759  printf ("can't refresh object: %s\n",
760  isc_result_totext (status));
761  break;
762  }
763 
764  break;
765  }
766  end_parse (&cfile);
767  } while (1);
768 
769  exit (0);
770 }
771 
772 /* Sigh */
774  control_object_state_t newstate)
775 {
776  if (newstate != server_shutdown)
777  return ISC_R_SUCCESS;
778  exit (0);
779 }
Definition: dhcpd.h:557
unsigned len
Definition: tree.h:80
isc_result_t end_parse(struct parse **cfile)
Definition: conflex.c:103
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
Definition: omshell.c:773
dhcpctl_status dhcpctl_set_null_value(dhcpctl_handle h, const char *value_name)
Definition: dhcpctl.c:353
enum dhcp_token token
Definition: dhcpd.h:320
dhcpctl_status dhcpctl_connect(dhcpctl_handle *connection, const char *server_name, int port, dhcpctl_handle authinfo)
Definition: dhcpctl.c:96
int check_collection(struct packet *p, struct lease *l, struct collection *c)
Definition: omshell.c:61
#define MDL
Definition: omapip.h:568
omapi_typed_data_t * value
Definition: omapip.h:91
#define is_identifier(x)
Definition: dhctoken.h:382
#define DHCPCTL_CREATE
Definition: dhcpctl.h:40
dhcpctl_status dhcpctl_new_object(dhcpctl_handle *, dhcpctl_handle, const char *)
Definition: remote.c:106
Definition: dhctoken.h:67
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:443
dhcpctl_status dhcpctl_open_object(dhcpctl_handle, dhcpctl_handle, int)
Definition: remote.c:171
Definition: dhcpd.h:288
#define DHCP_LOG_OPTIONS
Definition: dhcpd.h:1603
void bootp(struct packet *packet)
Definition: omshell.c:54
dhcpctl_status dhcpctl_initialize()
Definition: dhcpctl.c:41
struct omapi_typed_data_t::@3::@4 buffer
int main(int argc, char **argv)
Definition: omshell.c:80
dhcpctl_status dhcpctl_wait_for_completion(dhcpctl_handle h, dhcpctl_status *s)
Definition: dhcpctl.c:138
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:369
#define DHCPD_LOG_FACILITY
Definition: dhcpd.h:1594
dhcpctl_status dhcpctl_set_data_value(dhcpctl_handle h, const char *value, unsigned len, const char *value_name)
Definition: dhcpctl.c:320
void convert_num(struct parse *cfile, unsigned char *buf, const char *str, int base, unsigned size)
Definition: parse.c:837
Definition: dhcpd.h:405
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
Definition: alloc.c:593
dhcpctl_status dhcpctl_set_int_value(dhcpctl_handle h, int value, const char *value_name)
Definition: dhcpctl.c:406
#define dhcpctl_null_handle
Definition: dhcpctl.h:38
union omapi_typed_data_t::@3 u
dhcpctl_status dhcpctl_object_remove(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:538
Definition: dhctoken.h:37
control_object_state_t
Definition: dhcpd.h:519
void skip_to_semi(struct parse *cfile)
Definition: parse.c:78
void * dmalloc(size_t, const char *, int)
Definition: alloc.c:57
char * parse_host_name(struct parse *cfile)
Definition: parse.c:193
dhcp_token
Definition: dhctoken.h:34
int parse_allow_deny(struct option_cache **oc, struct parse *cfile, int flag)
Definition: omshell.c:49
void dhcpv6(struct packet *)
#define EOL
Definition: dhcpd.h:88
int parse_base64(struct data_string *data, struct parse *cfile)
Definition: parse.c:1896
dhcpctl_status dhcpctl_object_refresh(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:485
char * progname
Definition: dhclient.c:113
Definition: tree.h:61
isc_result_t find_class(struct class **c, const char *n, const char *f, int l)
Definition: omshell.c:45
Definition: dhctoken.h:44
Definition: dhctoken.h:171
Definition: dhctoken.h:254
dhcpctl_status dhcpctl_new_authenticator(dhcpctl_handle *, const char *, const char *, const unsigned char *, unsigned)
Definition: remote.c:43
dhcpctl_status dhcpctl_set_string_value(dhcpctl_handle h, const char *value, const char *value_name)
Definition: dhcpctl.c:289
dhcpctl_status dhcpctl_object_update(dhcpctl_handle connection, dhcpctl_handle h)
Definition: dhcpctl.c:436
const unsigned char * data
Definition: tree.h:79
void classify(struct packet *packet, struct class *class)
Definition: omshell.c:65
Definition: dhctoken.h:36
#define DHCPCTL_EXCL
Definition: dhcpctl.h:42
int parse_warn(struct parse *cfile, const char *fmt,...)
Definition: parse.c:5617
void dhcp(struct packet *packet)
Definition: omshell.c:53
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
Definition: conflex.c:41