ISC DHCP  4.4.2-P1
A reference DHCPv4 and DHCPv6 implementation
dhcpd.h
Go to the documentation of this file.
1 /* dhcpd.h
2 
3  Definitions for dhcpd... */
4 
5 /*
6  * Copyright (c) 2004-2019 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 1996-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  * 950 Charter Street
23  * Redwood City, CA 94063
24  * <info@isc.org>
25  * https://www.isc.org/
26  *
27  */
28 
31 #include "config.h"
32 
33 #ifndef __CYGWIN32__
34 #include <sys/types.h>
35 #include <netinet/in.h>
36 #include <sys/socket.h>
37 #include <sys/un.h>
38 #include <arpa/inet.h>
39 #include <errno.h>
40 
41 #include <netdb.h>
42 #else
43 #define fd_set cygwin_fd_set
44 #include <sys/types.h>
45 #endif
46 #include <stddef.h>
47 #include <fcntl.h>
48 #include <stdio.h>
49 #include <unistd.h>
50 #include <string.h>
51 #include <stdlib.h>
52 #include <sys/stat.h>
53 #include <sys/mman.h>
54 #include <ctype.h>
55 #include <time.h>
56 
57 #include <net/if.h>
58 #undef FDDI
59 #include <net/route.h>
60 #include <net/if_arp.h>
61 #if HAVE_NET_IF_DL_H
62 # include <net/if_dl.h>
63 #endif
64 
65 #include <setjmp.h>
66 
67 #include "cdefs.h"
68 #include "osdep.h"
69 
70 #include "arpa/nameser.h"
71 
72 #include "ns_name.h"
73 
74 struct hash_table;
75 typedef struct hash_table group_hash_t;
76 typedef struct hash_table universe_hash_t;
77 typedef struct hash_table option_name_hash_t;
78 typedef struct hash_table option_code_hash_t;
79 typedef struct hash_table dns_zone_hash_t;
80 typedef struct hash_table lease_ip_hash_t;
81 typedef struct hash_table lease_id_hash_t;
82 typedef struct hash_table host_hash_t;
83 typedef struct hash_table class_hash_t;
84 
85 typedef time_t TIME;
86 
87 #ifndef EOL
88 #define EOL '\n'
89 #endif
90 
91 #include <omapip/isclib.h>
92 #include <omapip/result.h>
93 
94 #include "dhcp.h"
95 #include "dhcp6.h"
96 #include "statement.h"
97 #include "tree.h"
98 #include "inet.h"
99 #include "dhctoken.h"
100 
101 #include <omapip/omapip_p.h>
102 
103 #if defined(LDAP_CONFIGURATION)
104 # include <ldap.h>
105 # include <sys/utsname.h> /* for uname() */
106 #endif
107 
108 #if !defined (BYTE_NAME_HASH_SIZE)
109 # define BYTE_NAME_HASH_SIZE 401 /* Default would be ridiculous. */
110 #endif
111 #if !defined (BYTE_CODE_HASH_SIZE)
112 # define BYTE_CODE_HASH_SIZE 254 /* Default would be ridiculous. */
113 #endif
114 
115 /* Although it is highly improbable that a 16-bit option space might
116  * actually use 2^16 actual defined options, it is the worst case
117  * scenario we must prepare for. Having 4 options per bucket in this
118  * case is pretty reasonable.
119  */
120 #if !defined (WORD_NAME_HASH_SIZE)
121 # define WORD_NAME_HASH_SIZE 20479
122 #endif
123 #if !defined (WORD_CODE_HASH_SIZE)
124 # define WORD_CODE_HASH_SIZE 16384
125 #endif
126 
127 /* Not only is it improbable that the 32-bit spaces might actually use 2^32
128  * defined options, it is infeasible. It would be best for this kind of
129  * space to be dynamically sized. Instead we size it at the word hash's
130  * level.
131  */
132 #if !defined (QUAD_NAME_HASH_SIZE)
133 # define QUAD_NAME_HASH_SIZE WORD_NAME_HASH_SIZE
134 #endif
135 #if !defined (QUAD_CODE_HASH_SIZE)
136 # define QUAD_CODE_HASH_SIZE WORD_CODE_HASH_SIZE
137 #endif
138 
139 #if !defined (DNS_HASH_SIZE)
140 # define DNS_HASH_SIZE 0 /* Default. */
141 #endif
142 
143 /* Default size to use for name/code hashes on user-defined option spaces. */
144 #if !defined (DEFAULT_SPACE_HASH_SIZE)
145 # define DEFAULT_SPACE_HASH_SIZE 11
146 #endif
147 
148 #if !defined (NWIP_HASH_SIZE)
149 # define NWIP_HASH_SIZE 17 /* A really small table. */
150 #endif
151 
152 #if !defined (FQDN_HASH_SIZE)
153 # define FQDN_HASH_SIZE 13 /* A ridiculously small table. */
154 #endif
155 
156 /* I really doubt a given installation is going to have more than a few
157  * hundred vendors involved.
158  */
159 #if !defined (VIVCO_HASH_SIZE)
160 # define VIVCO_HASH_SIZE 127
161 #endif
162 
163 #if !defined (VIVSO_HASH_SIZE)
164 # define VIVSO_HASH_SIZE VIVCO_HASH_SIZE
165 #endif
166 
167 #if !defined (VSIO_HASH_SIZE)
168 # define VSIO_HASH_SIZE VIVCO_HASH_SIZE
169 #endif
170 
171 #if !defined (VIV_ISC_HASH_SIZE)
172 # define VIV_ISC_HASH_SIZE 3 /* An incredulously small table. */
173 #endif
174 
175 #if !defined (UNIVERSE_HASH_SIZE)
176 # define UNIVERSE_HASH_SIZE 13 /* A really small table. */
177 #endif
178 
179 #if !defined (GROUP_HASH_SIZE)
180 # define GROUP_HASH_SIZE 0 /* Default. */
181 #endif
182 
183 /* At least one person has indicated they use ~20k host records.
184  */
185 #if !defined (HOST_HASH_SIZE)
186 # define HOST_HASH_SIZE 22501
187 #endif
188 
189 /* We have user reports of use of ISC DHCP numbering leases in the 200k's.
190  *
191  * We also have reports of folks using 10.0/8 as a dynamic range. The
192  * following is something of a compromise between the two. At the ~2-3
193  * hundred thousand leases, there's ~2-3 leases to search in each bucket.
194  */
195 #if !defined (LEASE_HASH_SIZE)
196 # define LEASE_HASH_SIZE 100003
197 #endif
198 
199 /* It is not known what the worst case subclass hash size is. We estimate
200  * high, I think.
201  */
202 #if !defined (SCLASS_HASH_SIZE)
203 # define SCLASS_HASH_SIZE 12007
204 #endif
205 
206 #if !defined (AGENT_HASH_SIZE)
207 # define AGENT_HASH_SIZE 11 /* A really small table. */
208 #endif
209 
210 /* The server hash size is used for both names and codes. There aren't
211  * many (roughly 50 at the moment), so we use a smaller table. If we
212  * use a 1:1 table size, then we get name collisions due to poor name
213  * hashing. So we use double the space we need, which drastically
214  * reduces collisions.
215  */
216 #if !defined (SERVER_HASH_SIZE)
217 # define SERVER_HASH_SIZE (2*(sizeof(server_options) / sizeof(struct option)))
218 #endif
219 
220 
221 /* How many options are likely to appear in a single packet? */
222 #if !defined (OPTION_HASH_SIZE)
223 # define OPTION_HASH_SIZE 17
224 # define OPTION_HASH_PTWO 32 /* Next power of two above option hash. */
225 # define OPTION_HASH_EXP 5 /* The exponent for that power of two. */
226 #endif
227 
228 #define compute_option_hash(x) \
229  (((x) & (OPTION_HASH_PTWO - 1)) + \
230  (((x) >> OPTION_HASH_EXP) & \
231  (OPTION_HASH_PTWO - 1))) % OPTION_HASH_SIZE;
232 
233 /* Lease queue information. We have two ways of storing leases.
234  * The original is a linear linked list which is slower but uses
235  * less memory while the other adds a binary array on top of that
236  * list to make insertions faster. We define several macros
237  * based on which is in use to allow the code to be cleaner by
238  * avoiding #ifdefs.
239  *
240  * POOL_DESTROYP is used for cleanup
241  */
242 
243 #if !defined (BINARY_LEASES)
244 #define LEASE_STRUCT struct lease *
245 #define LEASE_STRUCT_PTR struct lease **
246 #define LEASE_GET_FIRST(LQ) LQ
247 #define LEASE_GET_FIRSTP(LQ) *(LQ)
248 #define LEASE_GET_NEXT(LQ, LEASE) LEASE->next
249 #define LEASE_GET_NEXTP(LQ, LEASE) LEASE->next
250 #define LEASE_INSERTP(LQ, LEASE) lease_insert(LQ, LEASE)
251 #define LEASE_REMOVEP(LQ, LEASE) lease_remove(LQ, LEASE)
252 #define LEASE_NOT_EMPTY(LQ) LQ
253 #define LEASE_NOT_EMPTYP(LQ) *LQ
254 #define POOL_DESTROYP(LQ) lease_remove_all(LQ)
255 #else
256 #define LEASE_STRUCT struct leasechain
257 #define LEASE_STRUCT_PTR struct leasechain *
258 #define LEASE_GET_FIRST(LQ) lc_get_first_lease(&LQ)
259 #define LEASE_GET_FIRSTP(LQ) lc_get_first_lease(LQ)
260 #define LEASE_GET_NEXT(LQ, LEASE) lc_get_next(&LQ, LEASE)
261 #define LEASE_GET_NEXTP(LQ, LEASE) lc_get_next(LQ, LEASE)
262 #define LEASE_INSERTP(LQ, LEASE) lc_add_sorted_lease(LQ, LEASE)
263 #define LEASE_REMOVEP(LQ, LEASE) lc_unlink_lease(LQ, LEASE)
264 #define LEASE_NOT_EMPTY(LQ) lc_not_empty(&LQ)
265 #define LEASE_NOT_EMPTYP(LQ) lc_not_empty(LQ)
266 #define POOL_DESTROYP(LQ) lc_delete_all(LQ)
267 #endif
268 
275 };
276 
277 /* Client FQDN option, failover FQDN option, etc. */
278 typedef struct {
279  u_int8_t codes [2];
280  unsigned length;
281  u_int8_t *data;
282 } ddns_fqdn_t;
283 
284 #include "failover.h"
285 
286 /* A parsing context. */
287 
288 struct parse {
289  int lexline;
290  int lexchar;
291  char *token_line;
292  char *prev_line;
293  char *cur_line;
294  const char *tlname;
296 
297  /*
298  * In order to give nice output when we have a parsing error
299  * in our file, we keep track of where we are in the line so
300  * that we can show the user.
301  *
302  * We need to keep track of two lines, because we can look
303  * ahead, via the "peek" function, to the next line sometimes.
304  *
305  * The "line1" and "line2" variables act as buffers for this
306  * information. The "lpos" variable tells us where we are in the
307  * line.
308  *
309  * When we "put back" a character from the parsing context, we
310  * do not want to have the character appear twice in the error
311  * output. So, we set a flag, the "ugflag", which the
312  * get_char() function uses to check for this condition.
313  */
314  char line1 [81];
315  char line2 [81];
316  int lpos;
317  int line;
318  int tlpos;
319  int tline;
320  enum dhcp_token token;
321  int ugflag;
322  char *tval;
323  int tlen;
324  char tokbuf [1500];
325 
327  int file;
328  char *inbuf;
329  size_t bufix, buflen;
330  size_t bufsiz;
331 
333 
334 #if defined(LDAP_CONFIGURATION)
335  /*
336  * LDAP configuration uses a call-back to iteratively read config
337  * off of the LDAP repository.
338  * XXX: The token stream can not be rewound reliably, so this must
339  * be addressed for DHCPv6 support.
340  */
341  int (*read_function)(struct parse *);
342 #endif
343 };
344 
345 /* Variable-length array of data. */
346 
347 struct string_list {
348  struct string_list *next;
349  char string [1];
350 };
351 
352 /* A name server, from /etc/resolv.conf. */
353 struct name_server {
354  struct name_server *next;
355  struct sockaddr_in addr;
357 };
358 
359 /* A domain search list element. */
362  char *domain;
364 };
365 
366 /* Option tag structures are used to build chains of option tags, for
367  when we're sure we're not going to have enough of them to justify
368  maintaining an array. */
369 
370 struct option_tag {
371  struct option_tag *next;
372  u_int8_t data [1];
373 };
374 
375 /* An agent option structure. We need a special structure for the
376  Relay Agent Information option because if more than one appears in
377  a message, we have to keep them separate. */
378 
381  int length;
382  struct option_tag *first;
383 };
384 
385 struct option_cache {
386  int refcnt;
389  struct option *option;
390  struct data_string data;
391 
392  #define OPTION_HAD_NULLS 0x00000001
393  u_int32_t flags;
394 };
395 
396 struct option_state {
397  int refcnt;
401  void *universes [1];
402 };
403 
404 /* A dhcp packet and the pointers to its option values. */
405 struct packet {
406  struct dhcp_packet *raw;
407  int refcnt;
408  unsigned packet_length;
410 
411  unsigned char dhcpv6_msg_type; /* DHCPv6 message type */
412 
413  /* DHCPv6 transaction ID */
414  unsigned char dhcpv6_transaction_id[3];
415 
416  /* DHCPv6 relay information */
417  unsigned char dhcpv6_hop_count;
418  struct in6_addr dhcpv6_link_address;
419  struct in6_addr dhcpv6_peer_address;
420 
421  /* DHCPv6 packet containing this one, or NULL if none */
423 
424  /* DHCPv4-over-DHCPv6 flags */
425  unsigned char dhcp4o6_flags[3];
426 
427  /* DHCPv4-over-DHCPv6 response, or NULL */
429 
432  struct iaddr client_addr;
433  struct interface_info *interface; /* Interface on which packet
434  was received. */
435  struct hardware *haddr; /* Physical link address
436  of local sender (maybe gateway). */
437 
438  /* Information for relay agent options (see
439  draft-ietf-dhc-agent-options-xx.txt). */
440  u_int8_t *circuit_id; /* Circuit ID of client connection. */
442  u_int8_t *remote_id; /* Remote ID of client. */
444 
445  int got_requested_address; /* True if client sent the
446  dhcp-requested-address option. */
447 
450 
451 #if !defined (PACKET_MAX_CLASSES)
452 # define PACKET_MAX_CLASSES 5
453 #endif
456 
457  int known;
459 
460  /* If we stash agent options onto the packet option state, to pretend
461  * options we got in a previous exchange were still there, we need
462  * to signal this in a reliable way.
463  */
465 
466  /*
467  * ISC_TRUE if packet received unicast (as opposed to multicast).
468  * Only used in DHCPv6.
469  */
471 
472  /* Propagates server value SV_ECHO_CLIENT_ID so it is available
473  * in cons_options() */
475 
476  /* Relay port check */
478 };
479 
480 /*
481  * A network interface's MAC address.
482  * 20 bytes for the hardware address
483  * and 1 byte for the type tag
484  */
485 
486 #define HARDWARE_ADDR_LEN 20
487 
488 /* ioctl limits hardware addresses to 8 bytes */
489 #define HARDWARE_ADDR_LEN_IOCTL 8
490 
491 struct hardware {
492  u_int8_t hlen;
493  u_int8_t hbuf[HARDWARE_ADDR_LEN + 1];
494 };
495 
496 #if defined(LDAP_CONFIGURATION)
497 # define LDAP_BUFFER_SIZE 8192
498 # define LDAP_METHOD_STATIC 0
499 # define LDAP_METHOD_DYNAMIC 1
500 #if defined (LDAP_USE_SSL)
501 # define LDAP_SSL_OFF 0
502 # define LDAP_SSL_ON 1
503 # define LDAP_SSL_TLS 2
504 # define LDAP_SSL_LDAPS 3
505 #endif
506 
507 /* This is a tree of the current configuration we are building from LDAP */
508 struct ldap_config_stack {
509  LDAPMessage * res; /* Pointer returned from ldap_search */
510  LDAPMessage * ldent; /* Current item in LDAP that we're processing.
511  in res */
512  int close_brace; /* Put a closing } after we're through with
513  this item */
514  int processed; /* We set this flag if this base item has been
515  processed. After this base item is processed,
516  we can start processing the children */
517  struct ldap_config_stack *children;
518  struct ldap_config_stack *next;
519 };
520 #endif
521 
522 typedef enum {
530 
531 typedef struct {
535 
536 /* Lease states: */
537 #define FTS_FREE 1
538 #define FTS_ACTIVE 2
539 #define FTS_EXPIRED 3
540 #define FTS_RELEASED 4
541 #define FTS_ABANDONED 5
542 #define FTS_RESET 6
543 #define FTS_BACKUP 7
544 typedef u_int8_t binding_state_t;
545 
546 /* FTS_LAST is the highest value that is valid for a lease binding state. */
547 #define FTS_LAST FTS_BACKUP
548 
549 /*
550  * A block for the on statements so we can share the structure
551  * between v4 and v6
552  */
553 struct on_star {
557 };
558 
559 /* A dhcp lease declaration structure. */
560 struct lease {
562  struct lease *next;
563 #if defined (BINARY_LEASES)
564  struct lease *prev;
565  struct leasechain *lc;
566 #endif
567  struct lease *n_uid, *n_hw;
568 
569  struct iaddr ip_addr;
571 #if defined (BINARY_LEASES)
572  long int sort_tiebreaker;
573 #endif
576  struct host_decl *host;
577  struct subnet *subnet;
578  struct pool *pool;
581 
582  /* insert the structure directly */
583  struct on_star on_star;
584 
585  unsigned char *uid;
586  unsigned short uid_len;
587  unsigned short uid_max;
588  unsigned char uid_buf [7];
589  struct hardware hardware_addr;
590 
591  u_int8_t flags;
592 # define STATIC_LEASE 1
593 # define BOOTP_LEASE 2
594 # define RESERVED_LEASE 4
595 # define MS_NULL_TERMINATION 8
596 # define ON_UPDATE_QUEUE 16
597 # define ON_ACK_QUEUE 32
598 # define ON_QUEUE (ON_UPDATE_QUEUE | ON_ACK_QUEUE)
599 # define UNICAST_BROADCAST_HACK 64
600 # define ON_DEFERRED_QUEUE 128
601 
602 /* Persistent flags are to be preserved on a given lease structure. */
603 # define PERSISTENT_FLAGS (ON_ACK_QUEUE | ON_UPDATE_QUEUE)
604 /* Ephemeral flags are to be preserved on a given lease (copied etc). */
605 # define EPHEMERAL_FLAGS (MS_NULL_TERMINATION | \
606  UNICAST_BROADCAST_HACK | \
607  RESERVED_LEASE | \
608  BOOTP_LEASE)
609 
610  /*
611  * The lease's binding state is its current state. The next binding
612  * state is the next state this lease will move into by expiration,
613  * or timers in general. The desired binding state is used on lease
614  * updates; the caller is attempting to move the lease to the desired
615  * binding state (and this may either succeed or fail, so the binding
616  * state must be preserved).
617  *
618  * The 'rewind' binding state is used in failover processing. It
619  * is used for an optimization when out of communications; it allows
620  * the server to "rewind" a lease to the previous state acknowledged
621  * by the peer, and progress forward from that point.
622  */
627 
629 
630  /*
631  * 'tsfp' is more of an 'effective' tsfp. It may be calculated from
632  * stos+mclt for example if it's an expired lease and the server is
633  * in partner-down state. 'atsfp' is zeroed whenever a lease is
634  * updated - and only set when the peer acknowledges it. This
635  * ensures every state change is transmitted.
636  */
637  TIME tstp; /* Time sent to partner. */
638  TIME tsfp; /* Time sent from partner. */
639  TIME atsfp; /* Actual time sent from partner. */
640  TIME cltt; /* Client last transaction time. */
641  u_int32_t last_xid; /* XID we sent in this lease's BNDUPD */
643 
644  /*
645  * A pointer to the state of the ddns update for this lease.
646  * It should be set while the update is in progress and cleared
647  * when the update finishes. It can be used to cancel the
648  * update if we want to do a different update.
649  */
651 
652  /* Set when a lease has been disqualified for cache-threshold reuse */
653  unsigned short cannot_reuse;
654 };
655 
656 struct lease_state {
657  struct lease_state *next;
658 
660 
661  struct packet *packet; /* The incoming packet. */
662 
664 
668  unsigned char expiry[4], renewal[4], rebind[4];
669  struct data_string filename, server_name;
672  struct shared_network *shared_network; /* Shared network of interface
673  on which request arrived. */
674 
675  u_int32_t xid;
676  u_int16_t secs;
677  u_int16_t bootp_flags;
678  struct in_addr ciaddr;
679  struct in_addr siaddr;
680  struct in_addr giaddr;
681  u_int8_t hops;
682  u_int8_t offer;
683  struct iaddr from;
684 };
685 
686 #define ROOT_GROUP 0
687 #define HOST_DECL 1
688 #define SHARED_NET_DECL 2
689 #define SUBNET_DECL 3
690 #define CLASS_DECL 4
691 #define GROUP_DECL 5
692 #define POOL_DECL 6
693 
694 /* Possible modes in which discover_interfaces can run. */
695 
696 #define DISCOVER_RUNNING 0
697 #define DISCOVER_SERVER 1
698 #define DISCOVER_UNCONFIGURED 2
699 #define DISCOVER_RELAY 3
700 #define DISCOVER_SERVER46 4
701 #define DISCOVER_REQUESTED 5
702 
703 /* DDNS_UPDATE_STYLE enumerations. */
704 #define DDNS_UPDATE_STYLE_NONE 0
705 #define DDNS_UPDATE_STYLE_AD_HOC 1
706 #define DDNS_UPDATE_STYLE_INTERIM 2
707 #define DDNS_UPDATE_STYLE_STANDARD 3
708 
709 /* Server option names. */
710 
711 #define SV_DEFAULT_LEASE_TIME 1
712 #define SV_MAX_LEASE_TIME 2
713 #define SV_MIN_LEASE_TIME 3
714 #define SV_BOOTP_LEASE_CUTOFF 4
715 #define SV_BOOTP_LEASE_LENGTH 5
716 #define SV_BOOT_UNKNOWN_CLIENTS 6
717 #define SV_DYNAMIC_BOOTP 7
718 #define SV_ALLOW_BOOTP 8
719 #define SV_ALLOW_BOOTING 9
720 #define SV_ONE_LEASE_PER_CLIENT 10
721 #define SV_GET_LEASE_HOSTNAMES 11
722 #define SV_USE_HOST_DECL_NAMES 12
723 #define SV_USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 13
724 #define SV_MIN_SECS 14
725 #define SV_FILENAME 15
726 #define SV_SERVER_NAME 16
727 #define SV_NEXT_SERVER 17
728 #define SV_AUTHORITATIVE 18
729 #define SV_VENDOR_OPTION_SPACE 19
730 #define SV_ALWAYS_REPLY_RFC1048 20
731 #define SV_SITE_OPTION_SPACE 21
732 #define SV_ALWAYS_BROADCAST 22
733 #define SV_DDNS_DOMAIN_NAME 23
734 #define SV_DDNS_HOST_NAME 24
735 #define SV_DDNS_REV_DOMAIN_NAME 25
736 #define SV_LEASE_FILE_NAME 26
737 #define SV_PID_FILE_NAME 27
738 #define SV_DUPLICATES 28
739 #define SV_DECLINES 29
740 #define SV_DDNS_UPDATES 30
741 #define SV_OMAPI_PORT 31
742 #define SV_LOCAL_PORT 32
743 #define SV_LIMITED_BROADCAST_ADDRESS 33
744 #define SV_REMOTE_PORT 34
745 #define SV_LOCAL_ADDRESS 35
746 #define SV_OMAPI_KEY 36
747 #define SV_STASH_AGENT_OPTIONS 37
748 #define SV_DDNS_TTL 38
749 #define SV_DDNS_UPDATE_STYLE 39
750 #define SV_CLIENT_UPDATES 40
751 #define SV_UPDATE_OPTIMIZATION 41
752 #define SV_PING_CHECKS 42
753 #define SV_UPDATE_STATIC_LEASES 43
754 #define SV_LOG_FACILITY 44
755 #define SV_DO_FORWARD_UPDATES 45
756 #define SV_PING_TIMEOUT 46
757 #define SV_RESERVE_INFINITE 47
758 #define SV_DDNS_CONFLICT_DETECT 48
759 #define SV_LEASEQUERY 49
760 #define SV_ADAPTIVE_LEASE_TIME_THRESHOLD 50
761 #define SV_DO_REVERSE_UPDATES 51
762 #define SV_FQDN_REPLY 52
763 #define SV_PREFER_LIFETIME 53
764 #define SV_DHCPV6_LEASE_FILE_NAME 54
765 #define SV_DHCPV6_PID_FILE_NAME 55
766 #define SV_LIMIT_ADDRS_PER_IA 56
767 #define SV_LIMIT_PREFS_PER_IA 57
768 #define SV_DELAYED_ACK 58
769 #define SV_MAX_ACK_DELAY 59
770 #if defined(LDAP_CONFIGURATION)
771 # define SV_LDAP_SERVER 60
772 # define SV_LDAP_PORT 61
773 # define SV_LDAP_USERNAME 62
774 # define SV_LDAP_PASSWORD 63
775 # define SV_LDAP_BASE_DN 64
776 # define SV_LDAP_METHOD 65
777 # define SV_LDAP_DEBUG_FILE 66
778 # define SV_LDAP_DHCP_SERVER_CN 67
779 # define SV_LDAP_REFERRALS 68
780 #if defined (LDAP_USE_SSL)
781 # define SV_LDAP_SSL 69
782 # define SV_LDAP_TLS_REQCERT 70
783 # define SV_LDAP_TLS_CA_FILE 71
784 # define SV_LDAP_TLS_CA_DIR 72
785 # define SV_LDAP_TLS_CERT 73
786 # define SV_LDAP_TLS_KEY 74
787 # define SV_LDAP_TLS_CRLCHECK 75
788 # define SV_LDAP_TLS_CIPHERS 76
789 # define SV_LDAP_TLS_RANDFILE 77
790 #endif
791 # define SV_LDAP_INIT_RETRY 178
792 #if defined (LDAP_USE_GSSAPI)
793 # define SV_LDAP_GSSAPI_KEYTAB 179
794 # define SV_LDAP_GSSAPI_PRINCIPAL 180
795 #endif
796 #endif
797 #define SV_CACHE_THRESHOLD 78
798 #define SV_DONT_USE_FSYNC 79
799 #define SV_DDNS_LOCAL_ADDRESS4 80
800 #define SV_DDNS_LOCAL_ADDRESS6 81
801 #define SV_IGNORE_CLIENT_UIDS 82
802 #define SV_LOG_THRESHOLD_LOW 83
803 #define SV_LOG_THRESHOLD_HIGH 84
804 #define SV_ECHO_CLIENT_ID 85
805 #define SV_SERVER_ID_CHECK 86
806 #define SV_PREFIX_LEN_MODE 87
807 #define SV_DHCPV6_SET_TEE_TIMES 88
808 #define SV_ABANDON_LEASE_TIME 89
809 #ifdef EUI_64
810 #define SV_USE_EUI_64 90
811 #define SV_PERSIST_EUI_64_LEASES 91
812 #endif
813 #if defined (FAILOVER_PROTOCOL)
814 #define SV_CHECK_SECS_BYTE_ORDER 92
815 #endif
816 #define SV_DDNS_DUAL_STACK_MIXED_MODE 93
817 #define SV_DDNS_GUARD_ID_MUST_MATCH 94
818 #define SV_DDNS_OTHER_GUARD_IS_DYNAMIC 95
819 #define SV_RELEASE_ON_ROAM 96
820 #define SV_LOCAL_ADDRESS6 97
821 #define SV_BIND_LOCAL_ADDRESS6 98
822 #define SV_PING_CLTT_SECS 99
823 #define SV_PING_TIMEOUT_MS 100
824 
825 #if !defined (DEFAULT_PING_TIMEOUT)
826 # define DEFAULT_PING_TIMEOUT 1
827 #endif
828 
829 #if !defined (DEFAULT_PING_TIMEOUT_MS)
830 # define DEFAULT_PING_TIMEOUT_MS 0
831 #endif
832 
833 #if !defined (DEFAULT_PING_CLTT_SECS)
834 # define DEFAULT_PING_CLTT_SECS 60 /* in seconds */
835 #endif
836 
837 #if !defined (DEFAULT_DELAYED_ACK)
838 # define DEFAULT_DELAYED_ACK 0 /* default 0 disables delayed acking */
839 #endif
840 
841 #if !defined (DEFAULT_ACK_DELAY_SECS)
842 # define DEFAULT_ACK_DELAY_SECS 0
843 #endif
844 
845 #if !defined (DEFAULT_ACK_DELAY_USECS)
846 # define DEFAULT_ACK_DELAY_USECS 250000 /* 1/4 of a second */
847 #endif
848 
849 #if !defined (DEFAULT_MIN_ACK_DELAY_USECS)
850 # define DEFAULT_MIN_ACK_DELAY_USECS 10000 /* 1/100 second */
851 #endif
852 
853 #if !defined (DEFAULT_CACHE_THRESHOLD)
854 # define DEFAULT_CACHE_THRESHOLD 25
855 #endif
856 
857 #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
858 # define DEFAULT_DEFAULT_LEASE_TIME 43200
859 #endif
860 
861 #if !defined (DEFAULT_MIN_LEASE_TIME)
862 # define DEFAULT_MIN_LEASE_TIME 300
863 #endif
864 
865 #if !defined (DEFAULT_MAX_LEASE_TIME)
866 # define DEFAULT_MAX_LEASE_TIME 86400
867 #endif
868 
869 #if !defined (DEFAULT_DDNS_TTL)
870 # define DEFAULT_DDNS_TTL 3600
871 #endif
872 #if !defined (MAX_DEFAULT_DDNS_TTL)
873 # define MAX_DEFAULT_DDNS_TTL 3600
874 #endif
875 
876 #if !defined (MIN_LEASE_WRITE)
877 # define MIN_LEASE_WRITE 15
878 #endif
879 
880 #if !defined (DEFAULT_ABANDON_LEASE_TIME)
881 # define DEFAULT_ABANDON_LEASE_TIME 86400
882 #endif
883 
884 #define PLM_IGNORE 0
885 #define PLM_PREFER 1
886 #define PLM_EXACT 2
887 #define PLM_MINIMUM 3
888 #define PLM_MAXIMUM 4
889 
890 /* Client option names */
891 
892 #define CL_TIMEOUT 1
893 #define CL_SELECT_INTERVAL 2
894 #define CL_REBOOT_TIMEOUT 3
895 #define CL_RETRY_INTERVAL 4
896 #define CL_BACKOFF_CUTOFF 5
897 #define CL_INITIAL_INTERVAL 6
898 #define CL_BOOTP_POLICY 7
899 #define CL_SCRIPT_NAME 8
900 #define CL_REQUESTED_OPTIONS 9
901 #define CL_REQUESTED_LEASE_TIME 10
902 #define CL_SEND_OPTIONS 11
903 #define CL_MEDIA 12
904 #define CL_REJECT_LIST 13
905 
906 #ifndef CL_DEFAULT_TIMEOUT
907 # define CL_DEFAULT_TIMEOUT 60
908 #endif
909 
910 #ifndef CL_DEFAULT_SELECT_INTERVAL
911 # define CL_DEFAULT_SELECT_INTERVAL 0
912 #endif
913 
914 #ifndef CL_DEFAULT_REBOOT_TIMEOUT
915 # define CL_DEFAULT_REBOOT_TIMEOUT 10
916 #endif
917 
918 #ifndef CL_DEFAULT_RETRY_INTERVAL
919 # define CL_DEFAULT_RETRY_INTERVAL 300
920 #endif
921 
922 #ifndef CL_DEFAULT_BACKOFF_CUTOFF
923 # define CL_DEFAULT_BACKOFF_CUTOFF 120
924 #endif
925 
926 #ifndef CL_DEFAULT_INITIAL_INTERVAL
927 # define CL_DEFAULT_INITIAL_INTERVAL 10
928 #endif
929 
930 #ifndef CL_DEFAULT_BOOTP_POLICY
931 # define CL_DEFAULT_BOOTP_POLICY P_ACCEPT
932 #endif
933 
934 #ifndef CL_DEFAULT_REQUESTED_OPTIONS
935 # define CL_DEFAULT_REQUESTED_OPTIONS \
936  { DHO_SUBNET_MASK, \
937  DHO_BROADCAST_ADDRESS, \
938  DHO_TIME_OFFSET, \
939  DHO_ROUTERS, \
940  DHO_DOMAIN_NAME, \
941  DHO_DOMAIN_NAME_SERVERS, \
942  DHO_HOST_NAME }
943 #endif
944 
945 struct group_object {
947 
949  struct group *group;
950  char *name;
951  int flags;
952 #define GROUP_OBJECT_DELETED 1
953 #define GROUP_OBJECT_DYNAMIC 2
954 #define GROUP_OBJECT_STATIC 4
955 };
956 
957 /* Group of declarations that share common parameters. */
958 struct group {
959  struct group *next;
960 
961  int refcnt;
963  struct subnet *subnet;
967 };
968 
969 /* A dhcp host declaration structure. */
970 struct host_decl {
974  char *name;
975  struct hardware interface;
978  struct data_string host_id;
979  /* XXXSK: fixed_addr should be an array of iaddr values,
980  not an option_cache, but it's referenced in a lot of
981  places, so we'll leave it for now. */
984  struct group *group;
986  struct data_string auth_key_id;
987  int flags;
988 #define HOST_DECL_DELETED 1
989 #define HOST_DECL_DYNAMIC 2
990 #define HOST_DECL_STATIC 4
991  /* For v6 the host-identifer option can specify which relay
992  to use when trying to look up an option. We store the
993  value here. */
994  int relays;
995 };
996 
997 struct permit {
998  struct permit *next;
999  enum {
1007  permit_after
1008  } type;
1009  struct class *class;
1010  TIME after; /* date after which this clause applies */
1011 };
1012 
1013 #if defined (BINARY_LEASES)
1014 struct leasechain {
1015  struct lease **list; /* lease list */
1016  size_t total; /* max number of elements in this list,
1017  * including free pointers at the end if any */
1018  size_t nelem; /* the number of elements, also the next index to use */
1019  size_t growth; /* the growth factor to use when increase an array
1020  * this is set after parsing the pools and before
1021  * creatin an array. */
1022 };
1023 #endif
1024 
1025 struct pool {
1027  struct pool *next;
1028  struct group *group;
1042  int index;
1043  TIME valid_from; /* deny pool use before this date */
1044  TIME valid_until; /* deny pool use after this date */
1045 
1046 #if defined (FAILOVER_PROTOCOL)
1047  dhcp_failover_state_t *failover_peer;
1048 #endif
1049  int logged; /* already logged a message */
1050  int low_threshold; /* low threshold to restart logging */
1051 };
1052 
1056  char *name;
1057 
1058 #define SHARED_IMPLICIT 1 /* This network was synthesized. */
1059  int flags;
1060 
1061  struct subnet *subnets;
1063  struct pool *pools;
1065  struct group *group;
1066 #if defined (FAILOVER_PROTOCOL)
1067  dhcp_failover_state_t *failover_peer;
1068 #endif
1069 };
1070 
1071 struct subnet {
1077  struct iaddr interface_address;
1078  struct iaddr net;
1079  struct iaddr netmask;
1080  int prefix_len; /* XXX: currently for IPv6 only */
1081  struct group *group;
1082 };
1083 
1084 struct collection {
1085  struct collection *next;
1086 
1087  const char *name;
1088  struct class *classes;
1089 };
1090 
1091 /* Used as an argument to parse_clasS_decl() */
1092 #define CLASS_TYPE_VENDOR 0
1093 #define CLASS_TYPE_USER 1
1094 #define CLASS_TYPE_CLASS 2
1095 #define CLASS_TYPE_SUBCLASS 3
1096 
1097 /* XXX classes must be reference-counted. */
1098 struct class {
1100  struct class *nic; /* Next in collection. */
1101  struct class *superclass; /* Set for spawned classes only. */
1102  char *name; /* Not set for spawned classes. */
1103 
1104  /* A class may be configured to permit a limited number of leases. */
1108 
1109  /* If nonzero, class has not been saved since it was last
1110  modified. */
1111  int dirty;
1112 
1113  /* Hash table containing subclasses. */
1115  struct data_string hash_string;
1116 
1117  /* Expression used to match class. */
1118  struct expression *expr;
1119 
1120  /* Expression used to compute subclass identifiers for spawning
1121  and to do subclass matching. */
1124 
1125  struct group *group;
1126 
1127  /* Statements to execute if class matches. */
1129 
1130 #define CLASS_DECL_DELETED 1
1131 #define CLASS_DECL_DYNAMIC 2
1132 #define CLASS_DECL_STATIC 4
1133 #define CLASS_DECL_SUBCLASS 8
1134 
1135  int flags;
1136 };
1137 
1138 /* DHCP client lease structure... */
1140  struct client_lease *next; /* Next lease in list. */
1141  TIME expiry, renewal, rebind; /* Lease timeouts. */
1142  struct iaddr address; /* Address being leased. */
1143  char *server_name; /* Name of boot server. */
1144  char *filename; /* Name of file we're supposed to boot. */
1145  struct string_list *medium; /* Network medium. */
1146  struct auth_key *key; /* Key used in basic DHCP authentication. */
1147 
1148  unsigned int is_static : 1; /* If set, lease is from config file. */
1149  unsigned int is_bootp: 1; /* If set, lease was acquired with BOOTP. */
1150 
1151  struct option_state *options; /* Options supplied with lease. */
1152  struct iaddr next_srv_addr; /* Address of the next server to use */
1153 };
1154 
1155 /* DHCPv6 lease structures */
1156 struct dhc6_addr {
1157  struct dhc6_addr *next;
1158  struct iaddr address;
1159  u_int8_t plen;
1160 
1161  /* Address state flags. */
1162  #define DHC6_ADDR_DEPREFFED 0x01
1163  #define DHC6_ADDR_EXPIRED 0x02
1164  #define DHC6_ADDR_DECLINED 0x04
1165  u_int8_t flags;
1166 
1168  u_int32_t preferred_life;
1169  u_int32_t max_life;
1170 
1172 };
1173 
1174 struct dhc6_ia {
1175  struct dhc6_ia *next;
1176  unsigned char iaid[4];
1177  u_int16_t ia_type;
1178 
1180  u_int32_t renew;
1181  u_int32_t rebind;
1182  struct dhc6_addr *addrs;
1183 
1185 };
1186 
1187 struct dhc6_lease {
1188  struct dhc6_lease *next;
1189  struct data_string server_id;
1190 
1192  int score;
1193  u_int8_t pref;
1194 
1195  unsigned char dhcpv6_transaction_id[3];
1197 
1199 };
1200 
1201 /* Possible states in which the client can be. */
1204  S_INIT = 2,
1207  S_BOUND = 5,
1211  S_STOPPED = 9
1212 };
1213 
1214 /* Possible pending client operations. */
1216  P_NONE = 0,
1218  P_RELEASE = 2
1219 };
1220 
1221 /* Authentication and BOOTP policy possibilities (not all values work
1222  for each). */
1224 
1225 /* Configuration information from the config file... */
1227  /*
1228  * When a message has been received, run these statements
1229  * over it.
1230  */
1232 
1233  /*
1234  * When a message is sent, run these statements.
1235  */
1237 
1238  struct option **required_options; /* Options that MUST be present. */
1239  struct option **requested_options; /* Options to request (ORO/PRL). */
1240 
1241  TIME timeout; /* Start to panic if we don't get a
1242  lease in this time period when
1243  SELECTING. */
1244  TIME initial_delay; /* Set initial delay before first
1245  transmission. */
1246  TIME initial_interval; /* All exponential backoff intervals
1247  start here. */
1248  TIME retry_interval; /* If the protocol failed to produce
1249  an address before the timeout,
1250  try the protocol again after this
1251  many seconds. */
1252  TIME select_interval; /* Wait this many seconds from the
1253  first DHCPDISCOVER before
1254  picking an offered lease. */
1255  TIME reboot_timeout; /* When in INIT-REBOOT, wait this
1256  long before giving up and going
1257  to INIT. */
1258  TIME backoff_cutoff; /* When doing exponential backoff,
1259  never back off to an interval
1260  longer than this amount. */
1261  u_int32_t requested_lease; /* Requested lease time, if user
1262  doesn't configure one. */
1263  struct string_list *media; /* Possible network media values. */
1264  char *script_name; /* Name of config script. */
1265  char *vendor_space_name; /* Name of config script. */
1266  enum policy bootp_policy;
1267  /* Ignore, accept or prefer BOOTP
1268  responses. */
1269  enum policy auth_policy;
1270  /* Require authentication, prefer
1271  authentication, or don't try to
1272  authenticate. */
1273  struct string_list *medium; /* Current network medium. */
1274 
1275  struct iaddrmatchlist *reject_list; /* Servers to reject. */
1276 
1277  int omapi_port; /* port on which to accept OMAPI
1278  connections, or -1 for no
1279  listener. */
1280  int do_forward_update; /* If nonzero, and if we have the
1281  information we need, update the
1282  A record for the address we get. */
1283 
1284  int lease_id_format; /* format for IDs in lease file,
1285  TOKEN_OCTAL or TOKEN_HEX */
1286 
1287  int bootp_broadcast_always; /* If nonzero, always set the BOOTP_BROADCAST
1288  flag in requests */
1289 };
1290 
1291 /* Per-interface state used in the dhcp client... */
1292 /* XXX: consider union {}'ing this for v4/v6. */
1296  char *name;
1297 
1298  /* Common values. */
1299  struct client_config *config; /* Client configuration. */
1300  struct string_list *env; /* Client script environment. */
1301  int envc; /* Number of entries in environment. */
1302  struct option_state *sent_options; /* Options we sent. */
1303  enum dhcp_state state; /* Current state for this interface. */
1304  TIME last_write; /* Last time this state was written. */
1305  enum dhcp_pending pending; /* Current pending operation. */
1306 
1307  /* DHCPv4 values. */
1308  struct client_lease *active; /* Currently active lease. */
1309  struct client_lease *new; /* New lease. */
1310  struct client_lease *offered_leases; /* Leases offered to us. */
1311  struct client_lease *leases; /* Leases we currently hold. */
1312  struct client_lease *alias; /* Alias lease. */
1313 
1314  struct iaddr destination; /* Where to send packet. */
1315  u_int32_t xid; /* Transaction ID. */
1316  u_int16_t secs; /* secs value from DHCPDISCOVER. */
1317  TIME first_sending; /* When was first copy sent? */
1318  TIME interval; /* What's the current resend interval? */
1319  struct string_list *medium; /* Last media type tried. */
1320  struct dhcp_packet packet; /* Outgoing DHCP packet. */
1321  unsigned packet_length; /* Actual length of generated packet. */
1322 
1323  struct iaddr requested_address; /* Address we would like to get. */
1324 
1325  /* DHCPv6 values. */
1326  unsigned char dhcpv6_transaction_id[3];
1327  u_int8_t refresh_type;
1328 
1334 
1335  struct timeval start_time;
1336  u_int16_t elapsed;
1337  int txcount;
1338 
1339  /* See RFC3315 section 14. */
1340  TIME RT; /* In hundredths of seconds. */
1341  TIME IRT; /* In hundredths of seconds. */
1342  TIME MRC; /* Count. */
1343  TIME MRT; /* In hundredths of seconds. */
1344  TIME MRD; /* In seconds, relative. */
1345  TIME next_MRD; /* In seconds, absolute. */
1346 
1347  /* Rather than a state, we use a function that shifts around
1348  * depending what stage of life the v6 state machine is in.
1349  * This is where incoming packets are dispatched to (sometimes
1350  * a no-op).
1351  */
1352  void (*v6_handler)(struct packet *, struct client_state *);
1353 
1354  /*
1355  * A pointer to the state of the ddns update for this lease.
1356  * It should be set while the update is in progress and cleared
1357  * when the update finishes. It can be used to cancel the
1358  * update if we want to do a different update.
1359  */
1361 };
1362 
1365  const char *prefix;
1366 };
1367 
1370  struct iaddr address;
1372 };
1373 
1374 /* Information about each network interface. */
1375 
1378  struct interface_info *next; /* Next interface in list... */
1380  /* Networks connected to this interface. */
1381  struct hardware hw_address; /* Its physical address. */
1382  u_int8_t bcast_addr[20]; /* Infiniband broadcast address */
1383  struct in_addr *addresses; /* Addresses associated with this
1384  * interface.
1385  */
1386  int address_count; /* Number of addresses stored. */
1387  int address_max; /* Size of addresses buffer. */
1388  struct in6_addr *v6addresses; /* IPv6 addresses associated with
1389  this interface. */
1390  int v6address_count; /* Number of IPv6 addresses associated
1391  with this interface. */
1392  int v6address_max; /* Maximum number of IPv6 addresses
1393  we can store in current buffer. */
1394 
1395  u_int8_t *circuit_id; /* Circuit ID associated with this
1396  interface. */
1397  unsigned circuit_id_len; /* Length of Circuit ID, if there
1398  is one. */
1399  u_int8_t *remote_id; /* Remote ID associated with this
1400  interface (if any). */
1401  unsigned remote_id_len; /* Length of Remote ID. */
1402 
1403  char name [IFNAMSIZ]; /* Its name... */
1404 
1405  int index; /* Its if_nametoindex(). */
1406  int rfdesc; /* Its read file descriptor. */
1407  int wfdesc; /* Its write file descriptor, if
1408  different. */
1409  unsigned char *rbuf; /* Read buffer, if required. */
1410  unsigned int rbuf_max; /* Size of read buffer. */
1411  size_t rbuf_offset; /* Current offset into buffer. */
1412  size_t rbuf_len; /* Length of data in buffer. */
1413 
1414  struct ifreq *ifp; /* Pointer to ifreq struct. */
1415  int configured; /* If set to 1, interface has at least
1416  * one valid IP address.
1417  */
1418  u_int32_t flags; /* Control flags... */
1419 #define INTERFACE_REQUESTED 1
1420 #define INTERFACE_AUTOMATIC 2
1421 #define INTERFACE_RUNNING 4
1422 #define INTERFACE_DOWNSTREAM 8
1423 #define INTERFACE_UPSTREAM 16
1424 #define INTERFACE_STREAMS (INTERFACE_DOWNSTREAM | INTERFACE_UPSTREAM)
1425 
1426  /* Only used by DHCP client code. */
1428 # if defined(USE_DLPI_SEND) || defined(USE_DLPI_RECEIVE) || \
1429  defined(USE_DLPI_HWADDR)
1430  int dlpi_sap_length;
1431  struct hardware dlpi_broadcast_addr;
1432 # endif /* DLPI_SEND || DLPI_RECEIVE */
1433  struct hardware anycast_mac_addr;
1434 };
1435 
1438  char name [IFNAMSIZ];
1439  struct hardware address;
1440 };
1441 
1442 struct leasequeue {
1443  struct leasequeue *prev;
1444  struct leasequeue *next;
1445  struct lease *lease;
1446 };
1447 
1448 typedef void (*tvref_t)(void *, void *, const char *, int);
1449 typedef void (*tvunref_t)(void *, const char *, int);
1450 struct timeout {
1451  struct timeout *next;
1452  struct timeval when;
1453  void (*func) (void *);
1454  void *what;
1457  isc_timer_t *isc_timeout;
1458 };
1459 
1460 struct eventqueue {
1461  struct eventqueue *next;
1462  void (*handler)(void *);
1463 };
1464 
1465 struct protocol {
1466  struct protocol *next;
1467  int fd;
1468  void (*handler) (struct protocol *);
1469  void *local;
1470 };
1471 
1472 struct dns_query; /* forward */
1473 
1474 struct dns_wakeup {
1475  struct dns_wakeup *next; /* Next wakeup in chain. */
1476  void (*func) (struct dns_query *);
1477 };
1478 
1480  u_int16_t type; /* Type of query. */
1481  u_int16_t class; /* Class of query. */
1482  unsigned char data [1]; /* Query data. */
1483 };
1484 
1485 struct dns_answer {
1486  u_int16_t type; /* Type of answer. */
1487  u_int16_t class; /* Class of answer. */
1488  int count; /* Number of answers. */
1489  unsigned char *answers[1]; /* Pointers to answers. */
1490 };
1491 
1492 struct dns_query {
1493  struct dns_query *next; /* Next query in hash bucket. */
1494  u_int32_t hash; /* Hash bucket index. */
1495  TIME expiry; /* Query expiry time (zero if not yet
1496  answered. */
1497  u_int16_t id; /* Query ID (also hash table index) */
1498  caddr_t waiters; /* Pointer to list of things waiting
1499  on this query. */
1500 
1501  struct dns_question *question; /* Question, internal format. */
1502  struct dns_answer *answer; /* Answer, internal format. */
1503 
1504  unsigned char *query; /* Query formatted for DNS server. */
1505  unsigned len; /* Length of entire query. */
1506  int sent; /* The query has been sent. */
1507  struct dns_wakeup *wakeups; /* Wakeups to call if this query is
1508  answered. */
1509  struct name_server *next_server; /* Next server to try. */
1510  int backoff; /* Current backoff, in seconds. */
1511 };
1512 
1513 #define DNS_ZONE_ACTIVE 0
1514 #define DNS_ZONE_INACTIVE 1
1515 struct dns_zone {
1516  int refcnt;
1518  char *name;
1523  struct auth_key *key;
1524  u_int16_t flags;
1525 };
1526 
1527 struct icmp_state {
1529  int socket;
1530  void (*icmp_handler) (struct iaddr, u_int8_t *, int);
1531 };
1532 
1533 #include "ctrace.h"
1534 
1535 /* Bitmask of dhcp option codes. */
1536 typedef unsigned char option_mask [16];
1537 
1538 /* DHCP Option mask manipulation macros... */
1539 #define OPTION_ZERO(mask) (memset (mask, 0, 16))
1540 #define OPTION_SET(mask, bit) (mask [bit >> 8] |= (1 << (bit & 7)))
1541 #define OPTION_CLR(mask, bit) (mask [bit >> 8] &= ~(1 << (bit & 7)))
1542 #define OPTION_ISSET(mask, bit) (mask [bit >> 8] & (1 << (bit & 7)))
1543 #define OPTION_ISCLR(mask, bit) (!OPTION_ISSET (mask, bit))
1544 
1545 /* An option occupies its length plus two header bytes (code and
1546  length) for every 255 bytes that must be stored. */
1547 #define OPTION_SPACE(x) ((x) + 2 * ((x) / 255 + 1))
1548 
1549 /* Default path to dhcpd config file. */
1550 #ifdef DEBUG
1551 #undef _PATH_DHCPD_CONF
1552 #define _PATH_DHCPD_CONF "dhcpd.conf"
1553 #undef _PATH_DHCPD_DB
1554 #define _PATH_DHCPD_DB "dhcpd.leases"
1555 #undef _PATH_DHCPD6_DB
1556 #define _PATH_DHCPD6_DB "dhcpd6.leases"
1557 #undef _PATH_DHCPD_PID
1558 #define _PATH_DHCPD_PID "dhcpd.pid"
1559 #undef _PATH_DHCPD6_PID
1560 #define _PATH_DHCPD6_PID "dhcpd6.pid"
1561 #else /* !DEBUG */
1562 
1563 #ifndef _PATH_DHCPD_CONF
1564 #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
1565 #endif /* DEBUG */
1566 
1567 #ifndef _PATH_DHCPD_DB
1568 #define _PATH_DHCPD_DB LOCALSTATEDIR"/db/dhcpd.leases"
1569 #endif
1570 
1571 #ifndef _PATH_DHCPD6_DB
1572 #define _PATH_DHCPD6_DB LOCALSTATEDIR"/db/dhcpd6.leases"
1573 #endif
1574 
1575 #ifndef _PATH_DHCPD_PID
1576 #define _PATH_DHCPD_PID LOCALSTATEDIR"/run/dhcpd.pid"
1577 #endif
1578 
1579 #ifndef _PATH_DHCPD6_PID
1580 #define _PATH_DHCPD6_PID LOCALSTATEDIR"/run/dhcpd6.pid"
1581 #endif
1582 
1583 #endif /* DEBUG */
1584 
1585 #ifndef _PATH_DHCLIENT_CONF
1586 #define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
1587 #endif
1588 
1589 #ifndef _PATH_DHCLIENT_SCRIPT
1590 #define _PATH_DHCLIENT_SCRIPT "/usr/sbin/dhclient-script"
1591 #endif
1592 
1593 #ifndef _PATH_DHCLIENT_PID
1594 #define _PATH_DHCLIENT_PID LOCALSTATEDIR"/run/dhclient.pid"
1595 #endif
1596 
1597 #ifndef _PATH_DHCLIENT6_PID
1598 #define _PATH_DHCLIENT6_PID LOCALSTATEDIR"/run/dhclient6.pid"
1599 #endif
1600 
1601 #ifndef _PATH_DHCLIENT_DB
1602 #define _PATH_DHCLIENT_DB LOCALSTATEDIR"/db/dhclient.leases"
1603 #endif
1604 
1605 #ifndef _PATH_DHCLIENT6_DB
1606 #define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/db/dhclient6.leases"
1607 #endif
1608 
1609 #ifndef _PATH_RESOLV_CONF
1610 #define _PATH_RESOLV_CONF "/etc/resolv.conf"
1611 #endif
1612 
1613 #ifndef _PATH_DHCRELAY_PID
1614 #define _PATH_DHCRELAY_PID LOCALSTATEDIR"/run/dhcrelay.pid"
1615 #endif
1616 
1617 #ifndef _PATH_DHCRELAY6_PID
1618 #define _PATH_DHCRELAY6_PID LOCALSTATEDIR"/run/dhcrelay6.pid"
1619 #endif
1620 
1621 #ifndef DHCPD_LOG_FACILITY
1622 #define DHCPD_LOG_FACILITY LOG_DAEMON
1623 #endif
1624 
1625 #define INFINITE_TIME 0xffffffff
1626 #define MAX_TIME 0x7fffffff
1627 #define MIN_TIME 0
1628 
1629 #ifdef USE_LOG_PID
1630 /* include the pid in the syslog messages */
1631 #define DHCP_LOG_OPTIONS LOG_NDELAY | LOG_PID
1632 #else
1633 #define DHCP_LOG_OPTIONS LOG_NDELAY
1634 #endif
1635  /* these are referenced */
1636 typedef struct hash_table ia_hash_t;
1637 typedef struct hash_table iasubopt_hash_t;
1638 
1639  /* IAADDR/IAPREFIX lease */
1640 
1641 struct iasubopt {
1642  int refcnt; /* reference count */
1643  struct in6_addr addr; /* IPv6 address/prefix */
1644  u_int8_t plen; /* iaprefix prefix length */
1645  binding_state_t state; /* state */
1646  struct binding_scope *scope; /* "set var = value;" */
1647  time_t hard_lifetime_end_time; /* time address expires */
1648  time_t soft_lifetime_end_time; /* time ephemeral expires */
1649  u_int32_t prefer; /* cached preferred lifetime */
1650  u_int32_t valid; /* cached valid lifetime */
1651  struct ia_xx *ia; /* IA for this lease */
1652  struct ipv6_pool *ipv6_pool; /* pool for this lease */
1653 /*
1654  * For now, just pick an arbitrary time to keep old hard leases
1655  * around (value in seconds).
1656  */
1657 #define EXPIRED_IPV6_CLEANUP_TIME (60*60)
1658 
1659  /* index into heaps, or -1 (internal use only) */
1662 
1663  /*
1664  * A pointer to the state of the ddns update for this lease.
1665  * It should be set while the update is in progress and cleared
1666  * when the update finishes. It can be used to cancel the
1667  * update if we want to do a different update.
1668  */
1670 
1671  /* space for the on * executable statements */
1672  struct on_star on_star;
1674 };
1675 
1676 struct ia_xx {
1677  int refcnt; /* reference count */
1678  struct data_string iaid_duid; /* from the client */
1679  u_int16_t ia_type; /* IA_XX */
1680  int num_iasubopt; /* number of IAADDR/PREFIX */
1681  int max_iasubopt; /* space available for IAADDR/PREFIX */
1682  time_t cltt; /* client last transaction time */
1683  struct iasubopt **iasubopt; /* pointers to the IAADDR/IAPREFIXs */
1684 };
1685 
1686 extern ia_hash_t *ia_na_active;
1687 extern ia_hash_t *ia_ta_active;
1688 extern ia_hash_t *ia_pd_active;
1689 
1710 struct ipv6_pool {
1711  int refcnt; /* reference count */
1712  u_int16_t pool_type; /* IA_xx */
1713  struct in6_addr start_addr; /* first IPv6 address */
1714  int bits; /* number of bits, CIDR style */
1715  int units; /* allocation unit in bits */
1716  iasubopt_hash_t *leases; /* non-free leases */
1717  isc_uint64_t num_active; /* count of active leases */
1718  isc_uint64_t num_abandoned; /* count of abandoned leases */
1719  isc_heap_t *active_timeouts; /* timeouts for active leases */
1720  int num_inactive; /* count of inactive leases */
1721  isc_heap_t *inactive_timeouts; /* timeouts for expired or
1722  released leases */
1723  struct shared_network *shared_network; /* shared_network for
1724  this pool */
1725  struct subnet *subnet; /* subnet for this pool */
1726  struct ipv6_pond *ipv6_pond; /* pond for this pool */
1727 };
1728 
1740 struct ipv6_pond {
1741  int refcnt;
1742  struct ipv6_pond *next;
1743  struct group *group;
1744  struct shared_network *shared_network; /* backpointer to the enclosing
1745  shared network */
1746  struct permit *permit_list; /* allow clients from this list */
1747  struct permit *prohibit_list; /* deny clients from this list */
1748  TIME valid_from; /* deny pool use before this date */
1749  TIME valid_until; /* deny pool use after this date */
1750 
1751  struct ipv6_pool **ipv6_pools; /* NULL-terminated array */
1752  int last_ipv6_pool; /* offset of last IPv6 pool
1753  used to issue a lease */
1754  isc_uint64_t num_total; /* Total number of elements in the pond */
1755  isc_uint64_t num_active; /* Number of elements in the pond in use */
1756  isc_uint64_t num_abandoned; /* count of abandoned leases */
1757  int logged; /* already logged a message */
1758  isc_uint64_t low_threshold; /* low threshold to restart logging */
1760 #ifdef EUI_64
1761  int use_eui_64; /* use EUI-64 address assignment when true */
1762 #endif
1763 };
1764 
1765 /*
1766  * Max addresses in a pond that can be supported by log threshold
1767  * Currently based on max value supported by isc_uint64_t.
1768 */
1769 #define POND_TRACK_MAX ISC_UINT64_MAX
1770 
1771 /* Flags for dhcp_ddns_cb_t */
1772 #define DDNS_UPDATE_ADDR 0x0001
1773 #define DDNS_UPDATE_PTR 0x0002
1774 #define DDNS_INCLUDE_RRSET 0x0004
1775 #define DDNS_CONFLICT_DETECTION 0x0008
1776 #define DDNS_CLIENT_DID_UPDATE 0x0010
1777 #define DDNS_EXECUTE_NEXT 0x0020
1778 #define DDNS_ABORT 0x0040
1779 #define DDNS_STATIC_LEASE 0x0080
1780 #define DDNS_ACTIVE_LEASE 0x0100
1781 #define DDNS_DUAL_STACK_MIXED_MODE 0x0200
1782 #define DDNS_GUARD_ID_MUST_MATCH 0x0400
1783 #define DDNS_OTHER_GUARD_IS_DYNAMIC 0x0800
1784 
1785 #define CONFLICT_BITS (DDNS_CONFLICT_DETECTION|\
1786  DDNS_DUAL_STACK_MIXED_MODE|\
1787  DDNS_GUARD_ID_MUST_MATCH|\
1788  DDNS_OTHER_GUARD_IS_DYNAMIC)
1789 
1790 /* States for dhcp_ddns_cb_t */
1791 #define DDNS_STATE_CLEANUP 0 /* startup or the previous step failed, cleanup */
1792 
1793 #define DDNS_STATE_ADD_FW_NXDOMAIN 1
1794 #define DDNS_STATE_ADD_FW_YXDHCID 2
1795 #define DDNS_STATE_ADD_PTR 3
1796 #define DDNS_STATE_DSMM_FW_ADD3 4
1797 
1798 #define DDNS_STATE_REM_FW_YXDHCID 17
1799 #define DDNS_STATE_REM_FW_NXRR 18
1800 #define DDNS_STATE_REM_PTR 19
1801 #define DDNS_STATE_REM_FW_DSMM_OTHER 20
1802 
1803 /*
1804  * Flags for the dns print function
1805  */
1806 #define DDNS_PRINT_INBOUND 1
1807 #define DDNS_PRINT_OUTBOUND 0
1808 
1809 struct dhcp_ddns_cb;
1810 
1811 typedef void (*ddns_action_t)(struct dhcp_ddns_cb *ddns_cb,
1812  isc_result_t result);
1813 
1814 typedef struct dhcp_ddns_cb {
1815  struct data_string fwd_name;
1816  struct data_string rev_name;
1817  struct data_string dhcid;
1818  struct iaddr address;
1820 
1821  unsigned long ttl;
1822 
1823  unsigned char zone_name[DHCP_MAXDNS_WIRE];
1824  isc_sockaddrlist_t zone_server_list;
1825  isc_sockaddr_t zone_addrs[DHCP_MAXNS];
1827  struct dns_zone *zone;
1828 
1829  u_int16_t flags;
1831  int state;
1833 
1835 
1836  /* Lease or client state that triggered the ddns operation */
1837  void *lease;
1839 
1841  void *dataspace;
1842 
1843  dns_rdataclass_t dhcid_class;
1844  dns_rdataclass_t other_dhcid_class;
1845  char *lease_tag;
1846  struct ia_xx *fixed6_ia;
1848 
1849 extern struct ipv6_pool **pools;
1850 
1851 
1852 /* External definitions... */
1853 
1854 HASH_FUNCTIONS_DECL (group, const char *, struct group_object, group_hash_t)
1855 HASH_FUNCTIONS_DECL (universe, const char *, struct universe, universe_hash_t)
1856 HASH_FUNCTIONS_DECL (option_name, const char *, struct option,
1858 HASH_FUNCTIONS_DECL (option_code, const unsigned *, struct option,
1860 HASH_FUNCTIONS_DECL (dns_zone, const char *, struct dns_zone, dns_zone_hash_t)
1861 HASH_FUNCTIONS_DECL(lease_ip, const unsigned char *, struct lease,
1863 HASH_FUNCTIONS_DECL(lease_id, const unsigned char *, struct lease,
1865 HASH_FUNCTIONS_DECL (host, const unsigned char *, struct host_decl, host_hash_t)
1866 HASH_FUNCTIONS_DECL (class, const char *, struct class, class_hash_t)
1867 
1868 /* options.c */
1869 
1870 extern struct option *vendor_cfg_option;
1871 int parse_options (struct packet *);
1872 int parse_option_buffer (struct option_state *, const unsigned char *,
1873  unsigned, struct universe *);
1874 struct universe *find_option_universe (struct option *, const char *);
1875 int parse_encapsulated_suboptions (struct option_state *, struct option *,
1876  const unsigned char *, unsigned,
1877  struct universe *, const char *);
1878 int cons_options (struct packet *, struct dhcp_packet *, struct lease *,
1879  struct client_state *,
1880  int, struct option_state *, struct option_state *,
1881  struct binding_scope **,
1882  int, int, int, struct data_string *, const char *);
1883 int fqdn_universe_decode (struct option_state *,
1884  const unsigned char *, unsigned, struct universe *);
1885 struct option_cache *
1886 lookup_fqdn6_option(struct universe *universe, struct option_state *options,
1887  unsigned code);
1888 void
1889 save_fqdn6_option(struct universe *universe, struct option_state *options,
1890  struct option_cache *oc, isc_boolean_t appendp);
1891 void
1892 delete_fqdn6_option(struct universe *universe, struct option_state *options,
1893  int code);
1894 void
1896  struct client_state *client_state,
1897  struct option_state *in_options,
1898  struct option_state *cfg_options,
1899  struct binding_scope **scope,
1900  struct universe *u, void *stuff,
1901  void (*func)(struct option_cache *,
1902  struct packet *,
1903  struct lease *,
1904  struct client_state *,
1905  struct option_state *,
1906  struct option_state *,
1907  struct binding_scope **,
1908  struct universe *, void *));
1909 int
1911  struct packet *packet, struct lease *lease,
1912  struct client_state *client_state,
1913  struct option_state *in_options,
1914  struct option_state *cfg_options,
1915  struct binding_scope **scope,
1916  struct universe *universe);
1917 int
1918 fqdn6_universe_decode(struct option_state *options,
1919  const unsigned char *buffer, unsigned length,
1920  struct universe *u);
1921 int append_option(struct data_string *dst, struct universe *universe,
1922  struct option *option, struct data_string *src);
1923 int
1924 store_options(int *ocount,
1925  unsigned char *buffer, unsigned buflen, unsigned index,
1926  struct packet *packet, struct lease *lease,
1927  struct client_state *client_state,
1928  struct option_state *in_options,
1929  struct option_state *cfg_options,
1930  struct binding_scope **scope,
1931  unsigned *priority_list, int priority_len,
1932  unsigned first_cutoff, int second_cutoff, int terminate,
1933  const char *vuname);
1934 int store_options6(char *, int, struct option_state *, struct packet *,
1935  const int *, struct data_string *);
1936 int format_has_text(const char *);
1937 int format_min_length(const char *, struct option_cache *);
1938 const char *pretty_print_option (struct option *, const unsigned char *,
1939  unsigned, int, int);
1940 int pretty_escape(char **, char *, const unsigned char **,
1941  const unsigned char *);
1942 int get_option (struct data_string *, struct universe *,
1943  struct packet *, struct lease *, struct client_state *,
1944  struct option_state *, struct option_state *,
1945  struct option_state *, struct binding_scope **, unsigned,
1946  const char *, int);
1947 int get_option_int (int *, struct universe *,
1948  struct packet *, struct lease *, struct client_state *,
1949  struct option_state *, struct option_state *,
1950  struct option_state *, struct binding_scope **, unsigned,
1951  const char *, int);
1952 void set_option (struct universe *, struct option_state *,
1953  struct option_cache *, enum statement_op);
1954 struct option_cache *lookup_option (struct universe *,
1955  struct option_state *, unsigned);
1956 struct option_cache *lookup_hashed_option (struct universe *,
1957  struct option_state *,
1958  unsigned);
1960  struct option_state *,
1961  struct option_cache *);
1962 int save_option_buffer (struct universe *, struct option_state *,
1963  struct buffer *, unsigned char *, unsigned,
1964  unsigned, int);
1965 int append_option_buffer(struct universe *, struct option_state *,
1966  struct buffer *, unsigned char *, unsigned,
1967  unsigned, int);
1968 void build_server_oro(struct data_string *, struct option_state *,
1969  const char *, int);
1970 void save_option(struct universe *, struct option_state *,
1971  struct option_cache *);
1972 void also_save_option(struct universe *, struct option_state *,
1973  struct option_cache *);
1974 void save_hashed_option(struct universe *, struct option_state *,
1975  struct option_cache *, isc_boolean_t appendp);
1976 void delete_option (struct universe *, struct option_state *, int);
1977 void delete_hashed_option (struct universe *,
1978  struct option_state *, int);
1979 int option_cache_dereference (struct option_cache **,
1980  const char *, int);
1982  struct option_state *,
1983  const char *, int);
1984 int store_option (struct data_string *,
1985  struct universe *, struct packet *, struct lease *,
1986  struct client_state *,
1987  struct option_state *, struct option_state *,
1988  struct binding_scope **, struct option_cache *);
1990  struct packet *, struct lease *,
1991  struct client_state *,
1992  struct option_state *,
1993  struct option_state *,
1994  struct binding_scope **,
1995  struct data_string *);
1997  struct packet *, struct lease *,
1998  struct client_state *,
1999  struct option_state *,
2000  struct option_state *,
2001  struct binding_scope **,
2002  struct universe *);
2004  struct packet *, struct lease *,
2005  struct client_state *,
2006  struct option_state *,
2007  struct option_state *,
2008  struct binding_scope **,
2009  struct universe *);
2011  struct packet *, struct lease *,
2012  struct client_state *,
2013  struct option_state *,
2014  struct option_state *,
2015  struct binding_scope **,
2016  struct universe *);
2017 void suboption_foreach (struct packet *, struct lease *, struct client_state *,
2018  struct option_state *, struct option_state *,
2019  struct binding_scope **, struct universe *, void *,
2020  void (*) (struct option_cache *, struct packet *,
2021  struct lease *, struct client_state *,
2022  struct option_state *, struct option_state *,
2023  struct binding_scope **,
2024  struct universe *, void *),
2025  struct option_cache *, const char *);
2026 void option_space_foreach (struct packet *, struct lease *,
2027  struct client_state *,
2028  struct option_state *,
2029  struct option_state *,
2030  struct binding_scope **,
2031  struct universe *, void *,
2032  void (*) (struct option_cache *,
2033  struct packet *,
2034  struct lease *, struct client_state *,
2035  struct option_state *,
2036  struct option_state *,
2037  struct binding_scope **,
2038  struct universe *, void *));
2039 void hashed_option_space_foreach (struct packet *, struct lease *,
2040  struct client_state *,
2041  struct option_state *,
2042  struct option_state *,
2043  struct binding_scope **,
2044  struct universe *, void *,
2045  void (*) (struct option_cache *,
2046  struct packet *,
2047  struct lease *,
2048  struct client_state *,
2049  struct option_state *,
2050  struct option_state *,
2051  struct binding_scope **,
2052  struct universe *, void *));
2053 int linked_option_get (struct data_string *, struct universe *,
2054  struct packet *, struct lease *,
2055  struct client_state *,
2056  struct option_state *, struct option_state *,
2057  struct option_state *, struct binding_scope **,
2058  unsigned);
2060  struct option_state *,
2061  const char *, int);
2062 void save_linked_option(struct universe *, struct option_state *,
2063  struct option_cache *, isc_boolean_t appendp);
2064 void linked_option_space_foreach (struct packet *, struct lease *,
2065  struct client_state *,
2066  struct option_state *,
2067  struct option_state *,
2068  struct binding_scope **,
2069  struct universe *, void *,
2070  void (*) (struct option_cache *,
2071  struct packet *,
2072  struct lease *,
2073  struct client_state *,
2074  struct option_state *,
2075  struct option_state *,
2076  struct binding_scope **,
2077  struct universe *, void *));
2078 int linked_option_space_encapsulate (struct data_string *, struct packet *,
2079  struct lease *, struct client_state *,
2080  struct option_state *,
2081  struct option_state *,
2082  struct binding_scope **,
2083  struct universe *);
2084 void delete_linked_option (struct universe *, struct option_state *, int);
2085 struct option_cache *lookup_linked_option (struct universe *,
2086  struct option_state *, unsigned);
2087 void do_packet (struct interface_info *,
2088  struct dhcp_packet *, unsigned,
2089  unsigned int, struct iaddr, struct hardware *);
2090 void do_packet6(struct interface_info *, const char *,
2091  int, int, const struct iaddr *, isc_boolean_t);
2092 int packet6_len_okay(const char *, int);
2093 
2094 int validate_packet(struct packet *);
2095 
2096 int add_option(struct option_state *options,
2097  unsigned int option_num,
2098  void *data,
2099  unsigned int data_len);
2100 
2101 void parse_vendor_option(struct packet *packet,
2102  struct lease *lease,
2103  struct client_state *client_state,
2104  struct option_state *in_options,
2105  struct option_state *out_options,
2106  struct binding_scope **scope);
2107 
2108 /* dhcp4o6.c */
2109 #if defined(DHCP4o6)
2110 extern int dhcp4o6_fd;
2111 extern omapi_object_t *dhcp4o6_object;
2112 extern omapi_object_type_t *dhcp4o6_type;
2113 extern void dhcp4o6_setup(u_int16_t);
2114 
2115 /* dependency */
2116 extern isc_result_t dhcpv4o6_handler(omapi_object_t *);
2117 
2118 #endif
2119 /* dhcpd.c */
2120 extern struct timeval cur_tv;
2121 #define cur_time cur_tv.tv_sec
2122 
2123 extern int ddns_update_style;
2124 #if defined (NSUPDATE)
2125 extern u_int16_t ddns_conflict_mask;
2126 #endif
2127 extern int dont_use_fsync;
2128 extern int server_id_check;
2129 
2130 #ifdef EUI_64
2131 extern int persist_eui64;
2132 #endif
2133 
2134 #ifdef DHCPv6
2135 extern int prefix_length_mode;
2136 extern int do_release_on_roam;
2137 #endif
2138 
2139 extern int authoring_byte_order;
2140 extern int lease_id_format;
2141 extern u_int32_t abandon_lease_time;
2142 
2143 extern const char *path_dhcpd_conf;
2144 extern const char *path_dhcpd_db;
2145 extern const char *path_dhcpd_pid;
2146 
2148 extern struct eventqueue *rw_queue_empty;
2149 
2150 #if defined (PARANOIA)
2151 extern uid_t set_uid;
2152 extern gid_t set_gid;
2153 #endif
2154 
2155 int main(int, char **);
2156 void postconf_initialization(int);
2157 void postdb_startup(void);
2158 void cleanup (void);
2159 void lease_pinged (struct iaddr, u_int8_t *, int);
2160 void lease_ping_timeout (void *);
2161 int dhcpd_interface_setup_hook (struct interface_info *ip, struct iaddr *ia);
2163 isc_result_t dhcp_io_shutdown (omapi_object_t *, void *);
2164 isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
2165  control_object_state_t newstate);
2166 
2167 #if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
2168 void relinquish_ackqueue(void);
2169 #endif
2170 
2171 /* conflex.c */
2172 isc_result_t new_parse (struct parse **, int,
2173  char *, unsigned, const char *, int);
2174 isc_result_t end_parse (struct parse **);
2175 isc_result_t save_parse_state(struct parse *cfile);
2176 isc_result_t restore_parse_state(struct parse *cfile);
2177 enum dhcp_token next_token (const char **, unsigned *, struct parse *);
2178 enum dhcp_token peek_token (const char **, unsigned *, struct parse *);
2179 enum dhcp_token next_raw_token(const char **rval, unsigned *rlen,
2180  struct parse *cfile);
2181 enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen,
2182  struct parse *cfile);
2183 /*
2184  * Use skip_token when we are skipping a token we have previously
2185  * used peek_token on as we know what the result will be in this case.
2186  */
2187 #define skip_token(a,b,c) ((void) next_token((a),(b),(c)))
2188 
2189 
2190 /* confpars.c */
2191 void parse_trace_setup (void);
2192 isc_result_t readconf (void);
2193 isc_result_t read_conf_file (const char *, struct group *, int, int);
2194 #if defined (TRACING)
2195 void trace_conf_input (trace_type_t *, unsigned, char *);
2197 #endif
2198 isc_result_t conf_file_subparse (struct parse *, struct group *, int);
2199 isc_result_t lease_file_subparse (struct parse *);
2200 int parse_statement (struct parse *, struct group *, int,
2201  struct host_decl *, int);
2202 #if defined (FAILOVER_PROTOCOL)
2203 void parse_failover_peer (struct parse *, struct group *, int);
2205  dhcp_failover_state_t *);
2207  enum failover_state *, TIME *);
2208 #endif
2209 int permit_list_match (struct permit *, struct permit *);
2210 void parse_pool_statement (struct parse *, struct group *, int);
2211 int parse_lbrace (struct parse *);
2212 void parse_host_declaration (struct parse *, struct group *);
2213 int parse_class_declaration (struct class **, struct parse *,
2214  struct group *, int);
2215 void parse_shared_net_declaration (struct parse *, struct group *);
2216 void parse_subnet_declaration (struct parse *,
2217  struct shared_network *);
2218 void parse_subnet6_declaration (struct parse *,
2219  struct shared_network *);
2220 void parse_group_declaration (struct parse *, struct group *);
2221 int parse_fixed_addr_param (struct option_cache **,
2222  struct parse *, enum dhcp_token);
2223 int parse_lease_declaration (struct lease **, struct parse *);
2224 int parse_ip6_addr(struct parse *, struct iaddr *);
2225 int parse_ip6_addr_expr(struct expression **, struct parse *);
2226 int parse_ip6_prefix(struct parse *, struct iaddr *, u_int8_t *);
2227 void parse_address_range (struct parse *, struct group *, int,
2228  struct pool *, struct lease **);
2229 void parse_address_range6(struct parse *cfile, struct group *group,
2230  struct ipv6_pond *);
2231 void parse_prefix6(struct parse *cfile, struct group *group,
2232  struct ipv6_pond *);
2233 void parse_fixed_prefix6(struct parse *cfile, struct host_decl *host_decl);
2234 void parse_ia_na_declaration(struct parse *);
2235 void parse_ia_ta_declaration(struct parse *);
2236 void parse_ia_pd_declaration(struct parse *);
2237 void parse_server_duid(struct parse *cfile);
2238 void parse_server_duid_conf(struct parse *cfile);
2239 void parse_pool6_statement (struct parse *, struct group *, int);
2240 uint32_t parse_byte_order_uint32(const void *source);
2241 
2242 /* ddns.c */
2243 int ddns_updates(struct packet *, struct lease *, struct lease *,
2244  struct iasubopt *, struct iasubopt *, struct option_state *);
2245 isc_result_t ddns_removals(struct lease *, struct iasubopt *,
2246  struct dhcp_ddns_cb *, isc_boolean_t);
2247 u_int16_t get_conflict_mask(struct option_state *input_options);
2248 #if defined (TRACING)
2249 void trace_ddns_init(void);
2250 #endif
2251 
2252 /* parse.c */
2253 void add_enumeration (struct enumeration *);
2254 struct enumeration *find_enumeration (const char *, int);
2255 struct enumeration_value *find_enumeration_value (const char *, int,
2256  unsigned *,
2257  const char *);
2258 void skip_to_semi (struct parse *);
2259 void skip_to_rbrace (struct parse *, int);
2260 int parse_semi (struct parse *);
2261 int parse_string (struct parse *, char **, unsigned *);
2262 char *parse_host_name (struct parse *);
2263 int parse_ip_addr_or_hostname (struct expression **,
2264  struct parse *, int);
2265 void parse_hardware_param (struct parse *, struct hardware *);
2266 void parse_lease_time (struct parse *, TIME *);
2267 unsigned char *parse_numeric_aggregate (struct parse *,
2268  unsigned char *, unsigned *,
2269  int, int, unsigned);
2270 void convert_num (struct parse *, unsigned char *, const char *,
2271  int, unsigned);
2272 TIME parse_date (struct parse *);
2273 TIME parse_date_core(struct parse *);
2274 isc_result_t parse_option_name (struct parse *, int, int *,
2275  struct option **);
2276 void parse_option_space_decl (struct parse *);
2277 int parse_option_code_definition (struct parse *, struct option *);
2278 int parse_base64 (struct data_string *, struct parse *);
2279 int parse_cshl (struct data_string *, struct parse *);
2281  struct parse *, int *,
2282  enum expression_context);
2284  struct parse *, int *,
2285  enum expression_context);
2286 int parse_zone (struct dns_zone *, struct parse *);
2287 int parse_key (struct parse *);
2289  struct parse *, int *);
2291  struct parse *, int *);
2293  struct parse *, int *,
2294  enum expression_context);
2296  struct parse *, int *);
2297 int parse_boolean_expression (struct expression **,
2298  struct parse *, int *);
2299 int parse_boolean (struct parse *);
2300 int parse_data_expression (struct expression **,
2301  struct parse *, int *);
2302 int parse_numeric_expression (struct expression **,
2303  struct parse *, int *);
2304 int parse_dns_expression (struct expression **, struct parse *, int *);
2305 int parse_non_binary (struct expression **, struct parse *, int *,
2306  enum expression_context);
2307 int parse_expression (struct expression **, struct parse *, int *,
2308  enum expression_context,
2309  struct expression **, enum expr_op);
2310 int parse_option_data(struct expression **expr, struct parse *cfile,
2311  int lookups, struct option *option);
2313  struct parse *, int,
2314  struct option *, enum statement_op);
2315 int parse_option_token (struct expression **, struct parse *,
2316  const char **, struct expression *, int, int);
2317 int parse_allow_deny (struct option_cache **, struct parse *, int);
2318 int parse_auth_key (struct data_string *, struct parse *);
2319 int parse_warn (struct parse *, const char *, ...)
2320  __attribute__((__format__(__printf__,2,3)));
2321 struct expression *parse_domain_list(struct parse *cfile, int);
2322 struct expression *parse_domain_name(struct parse *cfile);
2323 
2324 /* tree.c */
2325 extern struct binding_scope *global_scope;
2326 pair cons (caddr_t, pair);
2327 int make_const_option_cache (struct option_cache **, struct buffer **,
2328  u_int8_t *, unsigned, struct option *,
2329  const char *, int);
2330 int make_host_lookup (struct expression **, const char *);
2331 int enter_dns_host (struct dns_host_entry **, const char *);
2332 int make_const_data (struct expression **,
2333  const unsigned char *, unsigned, int, int,
2334  const char *, int);
2335 int make_const_int (struct expression **, unsigned long);
2336 int make_concat (struct expression **,
2337  struct expression *, struct expression *);
2338 int make_encapsulation (struct expression **, struct data_string *);
2339 int make_substring (struct expression **, struct expression *,
2340  struct expression *, struct expression *);
2341 int make_limit (struct expression **, struct expression *, int);
2342 int make_let (struct executable_statement **, const char *);
2343 int option_cache (struct option_cache **, struct data_string *,
2344  struct expression *, struct option *,
2345  const char *, int);
2346 int evaluate_expression (struct binding_value **, struct packet *,
2347  struct lease *, struct client_state *,
2348  struct option_state *, struct option_state *,
2349  struct binding_scope **, struct expression *,
2350  const char *, int);
2351 int binding_value_dereference (struct binding_value **, const char *, int);
2352 int evaluate_boolean_expression (int *,
2353  struct packet *, struct lease *,
2354  struct client_state *,
2355  struct option_state *,
2356  struct option_state *,
2357  struct binding_scope **,
2358  struct expression *);
2360  struct packet *, struct lease *,
2361  struct client_state *,
2362  struct option_state *,
2363  struct option_state *,
2364  struct binding_scope **,
2365  struct expression *,
2366  const char *, int);
2367 int evaluate_numeric_expression (unsigned long *, struct packet *,
2368  struct lease *, struct client_state *,
2369  struct option_state *, struct option_state *,
2370  struct binding_scope **,
2371  struct expression *);
2372 int evaluate_option_cache (struct data_string *,
2373  struct packet *, struct lease *,
2374  struct client_state *,
2375  struct option_state *, struct option_state *,
2376  struct binding_scope **,
2377  struct option_cache *,
2378  const char *, int);
2380  struct packet *, struct lease *,
2381  struct client_state *,
2382  struct option_state *,
2383  struct option_state *,
2384  struct binding_scope **,
2385  struct option_cache *,
2386  const char *, int);
2388  struct packet *, struct lease *,
2389  struct client_state *,
2390  struct option_state *,
2391  struct option_state *,
2392  struct binding_scope **,
2393  struct expression *);
2394 void expression_dereference (struct expression **, const char *, int);
2396 int is_boolean_expression (struct expression *);
2397 int is_data_expression (struct expression *);
2398 int is_numeric_expression (struct expression *);
2399 int is_compound_expression (struct expression *);
2400 int op_precedence (enum expr_op, enum expr_op);
2403 int write_expression (FILE *, struct expression *, int, int, int);
2404 struct binding *find_binding (struct binding_scope *, const char *);
2405 int free_bindings (struct binding_scope *, const char *, int);
2407  const char *, int);
2408 int fundef_dereference (struct fundef **, const char *, int);
2411 struct binding *create_binding (struct binding_scope **, const char *);
2412 int bind_ds_value (struct binding_scope **,
2413  const char *, struct data_string *);
2414 int find_bound_string (struct data_string *,
2415  struct binding_scope *, const char *);
2416 int unset (struct binding_scope *, const char *);
2417 int data_string_sprintfa(struct data_string *ds, const char *fmt, ...);
2418 int concat_dclists (struct data_string *, struct data_string *,
2419  struct data_string *);
2420 
2421 /* dhcp.c */
2422 extern int outstanding_pings;
2423 extern int max_outstanding_acks;
2424 extern int max_ack_delay_secs;
2425 extern int max_ack_delay_usecs;
2426 
2427 void dhcp (struct packet *);
2428 void dhcpdiscover (struct packet *, int);
2429 void dhcprequest (struct packet *, int, struct lease *);
2430 void dhcprelease (struct packet *, int);
2431 void dhcpdecline (struct packet *, int);
2432 void dhcpinform (struct packet *, int);
2433 void nak_lease (struct packet *, struct iaddr *cip, struct group*);
2434 void ack_lease (struct packet *, struct lease *,
2435  unsigned int, TIME, char *, int, struct host_decl *);
2436 void echo_client_id(struct packet*, struct lease*, struct option_state*,
2437  struct option_state*);
2438 
2439 void dhcp_reply (struct lease *);
2440 int find_lease (struct lease **, struct packet *,
2441  struct shared_network *, int *, int *, struct lease *,
2442  const char *, int);
2443 int mockup_lease (struct lease **, struct packet *,
2444  struct shared_network *,
2445  struct host_decl *);
2446 void static_lease_dereference (struct lease *, const char *, int);
2447 
2448 int allocate_lease (struct lease **, struct packet *,
2449  struct pool *, int *);
2450 int permitted (struct packet *, struct permit *);
2451 int locate_network (struct packet *);
2452 int parse_agent_information_option (struct packet *, int, u_int8_t *);
2453 unsigned cons_agent_information_options (struct option_state *,
2454  struct dhcp_packet *,
2455  unsigned, unsigned);
2456 void get_server_source_address(struct in_addr *from,
2457  struct option_state *options,
2458  struct option_state *out_options,
2459  struct packet *packet);
2460 
2461 void eval_network_statements(struct option_state **options,
2462  struct packet *packet,
2463  struct group *network_group);
2464 
2466 
2467 /* dhcpleasequery.c */
2468 void dhcpleasequery (struct packet *, int);
2469 void dhcpv6_leasequery (struct data_string *, struct packet *);
2470 
2471 /* dhcpv6.c */
2473 void copy_server_duid(struct data_string *ds, const char *file, int line);
2474 void set_server_duid(struct data_string *new_duid);
2475 isc_result_t set_server_duid_from_option(void);
2476 void set_server_duid_type(int type);
2477 isc_result_t generate_new_server_duid(void);
2478 isc_result_t get_client_id(struct packet *, struct data_string *);
2479 void dhcpv6(struct packet *);
2480 
2481 /* bootp.c */
2482 void bootp(struct packet *);
2483 void use_host_decl_name(struct packet *, struct lease* , struct option_state *);
2484 
2485 /* memory.c */
2486 extern int (*group_write_hook) (struct group_object *);
2487 extern struct group *root_group;
2489 isc_result_t delete_group (struct group_object *, int);
2490 isc_result_t supersede_group (struct group_object *, int);
2491 int clone_group (struct group **, struct group *, const char *, int);
2492 int write_group (struct group_object *);
2493 
2494 /* salloc.c */
2496 struct lease *new_leases (unsigned, const char *, int);
2497 #if defined (DEBUG_MEMORY_LEAKAGE) || \
2498  defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
2499 void relinquish_free_lease_states (void);
2500 #endif
2502 OMAPI_OBJECT_ALLOC_DECL (class, struct class, dhcp_type_class)
2503 OMAPI_OBJECT_ALLOC_DECL (subclass, struct class, dhcp_type_subclass)
2506 
2507 /* alloc.c */
2512 OMAPI_OBJECT_ALLOC_DECL (dhcp_control,
2514 
2515 #if defined (DEBUG_MEMORY_LEAKAGE) || \
2516  defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
2517 void relinquish_free_pairs (void);
2518 void relinquish_free_expressions (void);
2519 void relinquish_free_binding_values (void);
2520 void relinquish_free_option_caches (void);
2521 void relinquish_free_packets (void);
2522 #endif
2523 
2525  const char *, int);
2527  struct option_chain_head *,
2528  const char *, int);
2530  const char *, int);
2531 int group_allocate (struct group **, const char *, int);
2532 int group_reference (struct group **, struct group *, const char *, int);
2533 int group_dereference (struct group **, const char *, int);
2534 struct dhcp_packet *new_dhcp_packet (const char *, int);
2535 struct protocol *new_protocol (const char *, int);
2536 struct lease_state *new_lease_state (const char *, int);
2537 struct domain_search_list *new_domain_search_list (const char *, int);
2538 struct name_server *new_name_server (const char *, int);
2539 void free_name_server (struct name_server *, const char *, int);
2540 struct option *new_option (const char *, const char *, int);
2541 int option_reference(struct option **dest, struct option *src,
2542  const char * file, int line);
2543 int option_dereference(struct option **dest, const char *file, int line);
2544 struct universe *new_universe (const char *, int);
2545 void free_universe (struct universe *, const char *, int);
2547  const char *, int);
2548 void free_lease_state (struct lease_state *, const char *, int);
2549 void free_protocol (struct protocol *, const char *, int);
2550 void free_dhcp_packet (struct dhcp_packet *, const char *, int);
2551 struct client_lease *new_client_lease (const char *, int);
2552 void free_client_lease (struct client_lease *, const char *, int);
2553 struct permit *new_permit (const char *, int);
2554 void free_permit (struct permit *, const char *, int);
2555 pair new_pair (const char *, int);
2556 void free_pair (pair, const char *, int);
2557 int expression_allocate (struct expression **, const char *, int);
2558 int expression_reference (struct expression **,
2559  struct expression *, const char *, int);
2560 void free_expression (struct expression *, const char *, int);
2561 int binding_value_allocate (struct binding_value **,
2562  const char *, int);
2563 int binding_value_reference (struct binding_value **,
2564  struct binding_value *,
2565  const char *, int);
2566 void free_binding_value (struct binding_value *, const char *, int);
2567 int fundef_allocate (struct fundef **, const char *, int);
2568 int fundef_reference (struct fundef **,
2569  struct fundef *, const char *, int);
2570 int option_cache_allocate (struct option_cache **, const char *, int);
2571 int option_cache_reference (struct option_cache **,
2572  struct option_cache *, const char *, int);
2573 int buffer_allocate (struct buffer **, unsigned, const char *, int);
2574 int buffer_reference (struct buffer **, struct buffer *,
2575  const char *, int);
2576 int buffer_dereference (struct buffer **, const char *, int);
2578  const char *, const char *, int);
2580  struct dns_host_entry *,
2581  const char *, int);
2583  const char *, int);
2584 int option_state_allocate (struct option_state **, const char *, int);
2585 int option_state_reference (struct option_state **,
2586  struct option_state *, const char *, int);
2587 int option_state_dereference (struct option_state **,
2588  const char *, int);
2589 int data_string_new(struct data_string *, const char *, unsigned int,
2590  const char *, int);
2591 void data_string_copy(struct data_string *, const struct data_string *,
2592  const char *, int);
2593 void data_string_forget (struct data_string *, const char *, int);
2594 void data_string_truncate (struct data_string *, int);
2595 int data_string_terminate (struct data_string *, const char *, int);
2597  const char *, int);
2599  struct executable_statement *,
2600  const char *, int);
2601 int packet_allocate (struct packet **, const char *, int);
2602 int packet_reference (struct packet **,
2603  struct packet *, const char *, int);
2604 int packet_dereference (struct packet **, const char *, int);
2605 int binding_scope_allocate (struct binding_scope **,
2606  const char *, int);
2607 int binding_scope_reference (struct binding_scope **,
2608  struct binding_scope *,
2609  const char *, int);
2610 int dns_zone_allocate (struct dns_zone **, const char *, int);
2611 int dns_zone_reference (struct dns_zone **,
2612  struct dns_zone *, const char *, int);
2613 /* print.c */
2614 #define DEFAULT_TIME_FORMAT 0
2615 #define LOCAL_TIME_FORMAT 1
2616 extern int db_time_format;
2617 char *quotify_string (const char *, const char *, int);
2618 char *quotify_buf (const unsigned char *, unsigned, const char,
2619  const char *, int);
2620 char *print_base64 (const unsigned char *, unsigned, const char *, int);
2621 char *print_hw_addr (const int, const int, const unsigned char *);
2622 void print_lease (struct lease *);
2623 void dump_raw (const unsigned char *, unsigned);
2624 void dump_packet_option (struct option_cache *, struct packet *,
2625  struct lease *, struct client_state *,
2626  struct option_state *, struct option_state *,
2627  struct binding_scope **, struct universe *, void *);
2628 void dump_packet (struct packet *);
2629 void hash_dump (struct hash_table *);
2630 char *print_hex (unsigned, const u_int8_t *, unsigned, unsigned);
2631 void print_hex_only (unsigned, const u_int8_t *, unsigned, char *);
2632 void print_hex_or_string (unsigned, const u_int8_t *, unsigned, char *);
2633 #define print_hex_1(len, data, limit) print_hex(len, data, limit, 0)
2634 #define print_hex_2(len, data, limit) print_hex(len, data, limit, 1)
2635 #define print_hex_3(len, data, limit) print_hex(len, data, limit, 2)
2636 char *print_dotted_quads (unsigned, const u_int8_t *);
2637 char *print_dec_1 (unsigned long);
2638 char *print_dec_2 (unsigned long);
2639 void print_expression (const char *, struct expression *);
2640 int token_print_indent_concat (FILE *, int, int,
2641  const char *, const char *, ...);
2642 int token_indent_data_string (FILE *, int, int, const char *, const char *,
2643  struct data_string *);
2644 int token_print_indent (FILE *, int, int,
2645  const char *, const char *, const char *);
2646 void indent_spaces (FILE *, int);
2647 #if defined (NSUPDATE)
2648 void print_dns_status (int, struct dhcp_ddns_cb *, isc_result_t);
2649 #endif
2650 const char *print_time(TIME);
2651 
2652 
2653 void get_hw_addr(struct interface_info *info);
2654 void try_hw_addr(struct interface_info *info);
2655 isc_result_t get_hw_addr2(struct interface_info *info);
2656 char *buf_to_hex (const unsigned char *s, unsigned len,
2657  const char *file, int line);
2658 char *format_lease_id(const unsigned char *s, unsigned len, int format,
2659  const char *file, int line);
2660 char *absolute_path(const char *orgpath);
2661 /* socket.c */
2662 #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \
2663  || defined (USE_SOCKET_FALLBACK)
2664 int if_register_socket(struct interface_info *, int, int *, struct in6_addr *);
2665 
2666 void set_multicast_hop_limit(struct interface_info* info, int hop_limit);
2667 #endif
2668 
2669 #if defined (USE_SOCKET_FALLBACK) && !defined (USE_SOCKET_SEND)
2672 ssize_t send_fallback (struct interface_info *,
2673  struct packet *, struct dhcp_packet *, size_t,
2674  struct in_addr,
2675  struct sockaddr_in *, struct hardware *);
2676 ssize_t send_fallback6(struct interface_info *, struct packet *,
2677  struct dhcp_packet *, size_t, struct in6_addr *,
2678  struct sockaddr_in6 *, struct hardware *);
2679 #endif
2680 
2681 #ifdef USE_SOCKET_SEND
2682 void if_reinitialize_send (struct interface_info *);
2683 void if_register_send (struct interface_info *);
2684 void if_deregister_send (struct interface_info *);
2685 ssize_t send_packet (struct interface_info *,
2686  struct packet *, struct dhcp_packet *, size_t,
2687  struct in_addr,
2688  struct sockaddr_in *, struct hardware *);
2689 #endif
2690 ssize_t send_packet6(struct interface_info *, const unsigned char *, size_t,
2691  struct sockaddr_in6 *);
2692 #ifdef USE_SOCKET_RECEIVE
2693 void if_reinitialize_receive (struct interface_info *);
2694 void if_register_receive (struct interface_info *);
2695 void if_deregister_receive (struct interface_info *);
2696 ssize_t receive_packet (struct interface_info *,
2697  unsigned char *, size_t,
2698  struct sockaddr_in *, struct hardware *);
2699 #endif
2700 
2701 #if defined (USE_SOCKET_FALLBACK)
2703 #endif
2704 
2705 #if defined (USE_SOCKET_SEND)
2709 void maybe_setup_fallback (void);
2710 #endif
2711 
2712 void if_register6(struct interface_info *info, int do_multicast);
2714 ssize_t receive_packet6(struct interface_info *interface,
2715  unsigned char *buf, size_t len,
2716  struct sockaddr_in6 *from, struct in6_addr *to_addr,
2717  unsigned int *if_index);
2718 void if_deregister6(struct interface_info *info);
2719 
2720 
2721 /* bpf.c */
2722 #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE)
2723 int if_register_bpf (struct interface_info *);
2724 #endif
2725 #ifdef USE_BPF_SEND
2726 void if_reinitialize_send (struct interface_info *);
2727 void if_register_send (struct interface_info *);
2728 void if_deregister_send (struct interface_info *);
2729 ssize_t send_packet (struct interface_info *,
2730  struct packet *, struct dhcp_packet *, size_t,
2731  struct in_addr,
2732  struct sockaddr_in *, struct hardware *);
2733 #endif
2734 #ifdef USE_BPF_RECEIVE
2735 void if_reinitialize_receive (struct interface_info *);
2736 void if_register_receive (struct interface_info *);
2737 void if_deregister_receive (struct interface_info *);
2738 ssize_t receive_packet (struct interface_info *,
2739  unsigned char *, size_t,
2740  struct sockaddr_in *, struct hardware *);
2741 #endif
2742 #if defined (USE_BPF_SEND)
2746 void maybe_setup_fallback (void);
2747 #endif
2748 
2749 /* lpf.c */
2750 #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
2752 #endif
2753 #ifdef USE_LPF_SEND
2757 ssize_t send_packet (struct interface_info *,
2758  struct packet *, struct dhcp_packet *, size_t,
2759  struct in_addr,
2760  struct sockaddr_in *, struct hardware *);
2761 #endif
2762 #ifdef USE_LPF_RECEIVE
2766 ssize_t receive_packet (struct interface_info *,
2767  unsigned char *, size_t,
2768  struct sockaddr_in *, struct hardware *);
2769 #endif
2770 #if defined (USE_LPF_SEND)
2775 #endif
2776 
2777 /* nit.c */
2778 #if defined (USE_NIT_SEND) || defined (USE_NIT_RECEIVE)
2779 int if_register_nit (struct interface_info *);
2780 #endif
2781 
2782 #ifdef USE_NIT_SEND
2783 void if_reinitialize_send (struct interface_info *);
2784 void if_register_send (struct interface_info *);
2785 void if_deregister_send (struct interface_info *);
2786 ssize_t send_packet (struct interface_info *,
2787  struct packet *, struct dhcp_packet *, size_t,
2788  struct in_addr,
2789  struct sockaddr_in *, struct hardware *);
2790 #endif
2791 #ifdef USE_NIT_RECEIVE
2792 void if_reinitialize_receive (struct interface_info *);
2793 void if_register_receive (struct interface_info *);
2794 void if_deregister_receive (struct interface_info *);
2795 ssize_t receive_packet (struct interface_info *,
2796  unsigned char *, size_t,
2797  struct sockaddr_in *, struct hardware *);
2798 #endif
2799 #if defined (USE_NIT_SEND)
2803 void maybe_setup_fallback (void);
2804 #endif
2805 
2806 /* dlpi.c */
2807 #if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
2808 int if_register_dlpi (struct interface_info *);
2809 #endif
2810 
2811 #ifdef USE_DLPI_SEND
2814 void if_reinitialize_send (struct interface_info *);
2815 void if_register_send (struct interface_info *);
2816 void if_deregister_send (struct interface_info *);
2817 ssize_t send_packet (struct interface_info *,
2818  struct packet *, struct dhcp_packet *, size_t,
2819  struct in_addr,
2820  struct sockaddr_in *, struct hardware *);
2822 void maybe_setup_fallback (void);
2823 #endif
2824 #ifdef USE_DLPI_RECEIVE
2825 void if_reinitialize_receive (struct interface_info *);
2826 void if_register_receive (struct interface_info *);
2827 void if_deregister_receive (struct interface_info *);
2828 ssize_t receive_packet (struct interface_info *,
2829  unsigned char *, size_t,
2830  struct sockaddr_in *, struct hardware *);
2831 #endif
2832 
2833 
2834 /* raw.c */
2835 #ifdef USE_RAW_SEND
2836 void if_reinitialize_send (struct interface_info *);
2837 void if_register_send (struct interface_info *);
2838 void if_deregister_send (struct interface_info *);
2839 ssize_t send_packet (struct interface_info *, struct packet *,
2840  struct dhcp_packet *, size_t, struct in_addr,
2841  struct sockaddr_in *, struct hardware *);
2845 void maybe_setup_fallback (void);
2846 #endif
2847 
2848 /* discover.c */
2849 extern struct interface_info *interfaces,
2851 extern struct protocol *protocols;
2852 extern int quiet_interface_discovery;
2853 isc_result_t interface_setup (void);
2855 
2856 extern struct in_addr limited_broadcast;
2857 extern int local_family;
2858 extern struct in_addr local_address;
2859 extern struct in6_addr local_address6;
2860 extern int bind_local_address6;
2861 
2862 extern u_int16_t local_port;
2863 extern u_int16_t remote_port;
2864 extern u_int16_t relay_port;
2865 extern int dhcpv4_over_dhcpv6;
2866 extern int (*dhcp_interface_setup_hook) (struct interface_info *,
2867  struct iaddr *);
2868 extern int (*dhcp_interface_discovery_hook) (struct interface_info *);
2869 extern isc_result_t (*dhcp_interface_startup_hook) (struct interface_info *);
2870 
2871 extern void (*bootp_packet_handler) (struct interface_info *,
2872  struct dhcp_packet *, unsigned,
2873  unsigned int,
2874  struct iaddr, struct hardware *);
2875 extern void (*dhcpv6_packet_handler)(struct interface_info *,
2876  const char *, int,
2877  int, const struct iaddr *, isc_boolean_t);
2878 extern struct timeout *timeouts;
2880 #if defined (TRACING)
2884 #endif
2885 extern struct interface_info **interface_vector;
2886 extern int interface_count;
2887 extern int interface_max;
2888 isc_result_t interface_initialize(omapi_object_t *, const char *, int);
2889 void discover_interfaces(int);
2890 int setup_fallback (struct interface_info **, const char *, int);
2892 void reinitialize_interfaces (void);
2893 
2894 /* dispatch.c */
2895 void set_time(TIME);
2896 struct timeval *process_outstanding_timeouts (struct timeval *);
2897 void dispatch (void);
2898 isc_result_t got_one(omapi_object_t *);
2899 isc_result_t got_one_v6(omapi_object_t *);
2904 isc_result_t interface_destroy (omapi_object_t *, const char *, int);
2906  const char *, va_list);
2908  omapi_object_t *,
2909  omapi_object_t *);
2910 
2911 void add_timeout (struct timeval *, void (*) (void *), void *,
2912  tvref_t, tvunref_t);
2913 void cancel_timeout (void (*) (void *), void *);
2916 
2919 
2920 /* tables.c */
2921 extern char *default_option_format;
2922 extern struct universe dhcp_universe;
2923 extern struct universe dhcpv6_universe;
2924 extern struct universe nwip_universe;
2925 extern struct universe fqdn_universe;
2926 extern struct universe vsio_universe;
2927 extern int dhcp_option_default_priority_list [];
2929 extern const char *hardware_types [256];
2931 extern struct universe **universes;
2934 extern struct universe *config_universe;
2935 
2936 /* stables.c */
2937 #if defined (FAILOVER_PROTOCOL)
2938 extern failover_option_t null_failover_option;
2939 extern failover_option_t skip_failover_option;
2940 extern struct failover_option_info ft_options [];
2941 extern u_int32_t fto_allowed [];
2942 extern int ft_sizes [];
2943 extern const char *dhcp_flink_state_names [];
2944 #endif
2945 extern const char *binding_state_names [];
2946 
2947 extern struct universe agent_universe;
2948 extern struct universe server_universe;
2949 
2950 extern struct enumeration ddns_styles;
2951 extern struct enumeration syslog_enum;
2953 
2954 extern struct enumeration prefix_length_modes;
2955 
2956 /* inet.c */
2957 struct iaddr subnet_number (struct iaddr, struct iaddr);
2958 struct iaddr ip_addr (struct iaddr, struct iaddr, u_int32_t);
2959 struct iaddr broadcast_addr (struct iaddr, struct iaddr);
2960 u_int32_t host_addr (struct iaddr, struct iaddr);
2961 int addr_eq (struct iaddr, struct iaddr);
2962 int addr_match(struct iaddr *, struct iaddrmatch *);
2963 int addr_cmp(const struct iaddr *a1, const struct iaddr *a2);
2964 int addr_or(struct iaddr *result,
2965  const struct iaddr *a1, const struct iaddr *a2);
2966 int addr_and(struct iaddr *result,
2967  const struct iaddr *a1, const struct iaddr *a2);
2968 isc_boolean_t is_cidr_mask_valid(const struct iaddr *addr, int bits);
2969 isc_result_t range2cidr(struct iaddrcidrnetlist **result,
2970  const struct iaddr *lo, const struct iaddr *hi);
2971 isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result);
2972 const char *piaddr (struct iaddr);
2973 const char *pdestdesc (struct iaddr);
2974 char *piaddrmask(struct iaddr *, struct iaddr *);
2975 char *piaddrcidr(const struct iaddr *, unsigned int);
2976 u_int16_t validate_port(char *);
2977 u_int16_t validate_port_pair(char *);
2978 #if defined(DHCPv6)
2979 const char *pin6_addr (const struct in6_addr*);
2980 #endif
2981 
2982 /* dhclient.c */
2983 extern int nowait;
2984 
2985 extern int wanted_ia_na;
2986 extern int wanted_ia_ta;
2987 extern int wanted_ia_pd;
2988 extern int require_all_ias;
2989 
2990 extern const char *path_dhclient_conf;
2991 extern const char *path_dhclient_db;
2992 extern const char *path_dhclient_pid;
2993 extern char *path_dhclient_script;
2994 extern int interfaces_requested;
2995 extern struct data_string default_duid;
2996 extern int duid_type;
2997 extern const char *path_dhclient_duid;
2998 
2999 extern struct client_config top_level_config;
3000 
3001 void dhcpoffer (struct packet *);
3002 void dhcpack (struct packet *);
3003 void dhcpnak (struct packet *);
3004 
3005 void send_discover (void *);
3006 void send_request (void *);
3007 void send_release (void *);
3008 void send_decline (void *);
3009 
3010 void state_reboot (void *);
3011 void state_init (void *);
3012 void state_selecting (void *);
3013 void state_requesting (void *);
3014 void state_bound (void *);
3015 void state_stop (void *);
3016 void state_panic (void *);
3017 
3018 void bind_lease (struct client_state *);
3019 
3020 void make_client_options (struct client_state *,
3021  struct client_lease *, u_int8_t *,
3022  struct option_cache *, struct iaddr *,
3023  struct option **, struct option_state **);
3024 void make_discover (struct client_state *, struct client_lease *);
3025 void make_request (struct client_state *, struct client_lease *);
3026 void make_decline (struct client_state *, struct client_lease *);
3027 void make_release (struct client_state *, struct client_lease *);
3028 
3029 void destroy_client_lease (struct client_lease *);
3030 void rewrite_client_leases (void);
3031 void write_lease_option (struct option_cache *, struct packet *,
3032  struct lease *, struct client_state *,
3033  struct option_state *, struct option_state *,
3034  struct binding_scope **, struct universe *, void *);
3035 int write_client_lease (struct client_state *, struct client_lease *, int, int);
3036 isc_result_t write_client6_lease(struct client_state *client,
3037  struct dhc6_lease *lease,
3038  int rewrite, int sync);
3039 int dhcp_option_ev_name (char *, size_t, struct option *);
3040 
3041 void script_init (struct client_state *, const char *,
3042  struct string_list *);
3043 void client_option_envadd (struct option_cache *, struct packet *,
3044  struct lease *, struct client_state *,
3045  struct option_state *, struct option_state *,
3046  struct binding_scope **, struct universe *, void *);
3047 void script_write_params (struct client_state *, const char *,
3048  struct client_lease *);
3049 void script_write_requested (struct client_state *);
3050 int script_go (struct client_state *);
3052  const char *, const char *, const char *, ...)
3053  __attribute__((__format__(__printf__,4,5)));
3054 
3055 struct client_lease *packet_to_lease (struct packet *, struct client_state *);
3056 void finish (char);
3057 void detach (void);
3058 void write_client_pid_file (void);
3059 void client_location_changed (void);
3060 void do_release (struct client_state *);
3063 isc_result_t dhclient_interface_startup_hook (struct interface_info *);
3065  struct iaddr *addr, int offset);
3067 isc_result_t client_dns_update(struct client_state *client,
3068  dhcp_ddns_cb_t *ddns_cb);
3069 void client_dns_remove(struct client_state *client, struct iaddr *addr);
3070 
3071 void dhcpv4_client_assignments(void);
3073 isc_result_t form_duid(struct data_string *duid, const char *file, int line);
3074 
3075 void dhcp4o6_start(void);
3076 
3077 /* dhc6.c */
3078 void dhc6_lease_destroy(struct dhc6_lease **src, const char *file, int line);
3079 void start_init6(struct client_state *client);
3080 void start_info_request6(struct client_state *client);
3081 void start_confirm6(struct client_state *client);
3082 void start_release6(struct client_state *client);
3083 void start_selecting6(struct client_state *client);
3084 void unconfigure6(struct client_state *client, const char *reason);
3085 
3086 /* db.c */
3087 int write_lease (struct lease *);
3088 int write_host (struct host_decl *);
3090 #if defined (FAILOVER_PROTOCOL)
3091 int write_failover_state (dhcp_failover_state_t *);
3092 #endif
3093 int db_printable (const unsigned char *);
3094 int db_printable_len (const unsigned char *, unsigned);
3095 isc_result_t write_named_billing_class(const void *, unsigned, void *);
3096 void write_billing_classes (void);
3097 int write_billing_class (struct class *);
3098 void commit_leases_timeout (void *);
3099 int commit_leases (void);
3100 int commit_leases_timed (void);
3101 void db_startup (int);
3102 int new_lease_file (int test_mode);
3103 int group_writer (struct group_object *);
3104 int write_ia(const struct ia_xx *);
3105 
3106 /* packet.c */
3107 u_int32_t checksum (unsigned char *, unsigned, u_int32_t);
3108 u_int32_t wrapsum (u_int32_t);
3109 void assemble_hw_header (struct interface_info *, unsigned char *,
3110  unsigned *, struct hardware *);
3111 void assemble_udp_ip_header (struct interface_info *, unsigned char *,
3112  unsigned *, u_int32_t, u_int32_t,
3113  u_int32_t, unsigned char *, unsigned);
3114 ssize_t decode_hw_header (struct interface_info *, unsigned char *,
3115  unsigned, struct hardware *);
3116 ssize_t decode_udp_ip_header (struct interface_info *, unsigned char *,
3117  unsigned, struct sockaddr_in *,
3118  unsigned, unsigned *, int);
3119 
3120 /* ethernet.c */
3121 void assemble_ethernet_header (struct interface_info *, unsigned char *,
3122  unsigned *, struct hardware *);
3124  unsigned char *,
3125  unsigned, struct hardware *);
3126 
3127 /* tr.c */
3128 void assemble_tr_header (struct interface_info *, unsigned char *,
3129  unsigned *, struct hardware *);
3131  unsigned char *,
3132  unsigned, struct hardware *);
3133 
3134 /* dhxpxlt.c */
3135 void convert_statement (struct parse *);
3140 void convert_lease_time (struct parse *, jrefproto, char *);
3154 void convert_date (struct parse *, jrefproto, char *);
3155 void convert_numeric_aggregate (struct parse *, jrefproto, int, int, int, int);
3156 void indent (int);
3157 
3158 /* route.c */
3159 void add_route_direct (struct interface_info *, struct in_addr);
3160 void add_route_net (struct interface_info *, struct in_addr, struct in_addr);
3161 void add_route_default_gateway (struct interface_info *, struct in_addr);
3162 void remove_routes (struct in_addr);
3163 void remove_if_route (struct interface_info *, struct in_addr);
3165 void set_netmask (struct interface_info *, struct in_addr);
3166 void set_broadcast_addr (struct interface_info *, struct in_addr);
3167 void set_ip_address (struct interface_info *, struct in_addr);
3168 
3169 /* clparse.c */
3170 isc_result_t read_client_conf (void);
3171 int read_client_conf_file (const char *,
3172  struct interface_info *, struct client_config *);
3173 void read_client_leases (void);
3174 void read_client_duid (void);
3175 void parse_client_statement (struct parse *, struct interface_info *,
3176  struct client_config *);
3177 int parse_X (struct parse *, u_int8_t *, unsigned);
3178 int parse_option_list (struct parse *, struct option ***);
3179 void parse_interface_declaration (struct parse *,
3180  struct client_config *, char *);
3181 int interface_or_dummy (struct interface_info **, const char *);
3182 void make_client_state (struct client_state **);
3183 void make_client_config (struct client_state *, struct client_config *);
3184 void parse_client_lease_statement (struct parse *, int);
3185 void parse_client_lease_declaration (struct parse *,
3186  struct client_lease *,
3187  struct interface_info **,
3188  struct client_state **);
3189 int parse_option_decl (struct option_cache **, struct parse *);
3190 void parse_string_list (struct parse *, struct string_list **, int);
3191 int parse_ip_addr (struct parse *, struct iaddr *);
3192 int parse_destination_descriptor (struct parse *, struct iaddr *);
3193 int parse_ip_addr_with_subnet(struct parse *, struct iaddrmatch *);
3194 void parse_reject_statement (struct parse *, struct client_config *);
3195 
3196 /* icmp.c */
3197 OMAPI_OBJECT_ALLOC_DECL (icmp_state, struct icmp_state, dhcp_type_icmp)
3198 extern struct icmp_state *icmp_state;
3199 void icmp_startup (int, void (*) (struct iaddr, u_int8_t *, int));
3201 int icmp_echorequest (struct iaddr *);
3202 isc_result_t icmp_echoreply (omapi_object_t *);
3203 
3204 /* dns.c */
3205 isc_result_t enter_dns_zone (struct dns_zone *);
3206 isc_result_t dns_zone_lookup (struct dns_zone **, const char *);
3207 int dns_zone_dereference (struct dns_zone **, const char *, int);
3208 #if defined (NSUPDATE)
3209 #define FIND_FORWARD 0
3210 #define FIND_REVERSE 1
3211 isc_result_t find_cached_zone (dhcp_ddns_cb_t *, int);
3212 void forget_zone (struct dns_zone **);
3213 void repudiate_zone (struct dns_zone **);
3214 int get_dhcid (dhcp_ddns_cb_t *, int, const u_int8_t *, unsigned);
3215 void dhcid_tolease (struct data_string *, struct data_string *);
3216 isc_result_t dhcid_fromlease (struct data_string *, struct data_string *);
3217 isc_result_t ddns_update_fwd(struct data_string *, struct iaddr,
3218  struct data_string *, unsigned long, unsigned,
3219  unsigned);
3220 isc_result_t ddns_remove_fwd(struct data_string *,
3221  struct iaddr, struct data_string *);
3222 char *ddns_state_name(int state);
3223 #endif /* NSUPDATE */
3224 
3226 void ddns_cb_free (dhcp_ddns_cb_t *ddns_cb, const char *file, int line);
3228 isc_result_t
3229 ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line);
3230 isc_result_t
3231 ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line);
3232 void
3233 ddns_cancel(dhcp_ddns_cb_t *ddns_cb, const char *file, int line);
3234 
3235 /* resolv.c */
3236 extern char path_resolv_conf [];
3237 extern struct name_server *name_servers;
3238 extern struct domain_search_list *domains;
3239 
3240 void read_resolv_conf (TIME);
3241 struct name_server *first_name_server (void);
3242 
3243 /* inet_addr.c */
3244 #ifdef NEED_INET_ATON
3245 int inet_aton (const char *, struct in_addr *);
3246 #endif
3247 
3248 /* class.c */
3249 extern int have_billing_classes;
3250 extern struct class unknown_class;
3251 extern struct class known_class;
3252 extern struct collection default_collection;
3253 extern struct collection *collections;
3255 
3256 void classification_setup (void);
3257 void classify_client (struct packet *);
3258 int check_collection (struct packet *, struct lease *, struct collection *);
3259 void classify (struct packet *, struct class *);
3260 isc_result_t unlink_class (struct class **class);
3261 isc_result_t find_class (struct class **, const char *,
3262  const char *, int);
3263 void unbill_class (struct lease *);
3264 int bill_class (struct lease *, struct class *);
3265 
3266 /* execute.c */
3267 int execute_statements (struct binding_value **result,
3268  struct packet *, struct lease *,
3269  struct client_state *,
3270  struct option_state *, struct option_state *,
3271  struct binding_scope **,
3272  struct executable_statement *,
3273  struct on_star *);
3274 void execute_statements_in_scope (struct binding_value **result,
3275  struct packet *, struct lease *,
3276  struct client_state *,
3277  struct option_state *,
3278  struct option_state *,
3279  struct binding_scope **,
3280  struct group *, struct group *,
3281  struct on_star *);
3283  const char *, int);
3284 void write_statements (FILE *, struct executable_statement *, int);
3286  struct packet *, struct lease *, struct client_state *,
3287  struct option_state *, struct option_state *,
3288  struct binding_scope **,
3289  struct expression *, struct executable_statement *);
3291  int (*) (struct executable_statement *,
3292  void *, int), void *, int);
3293 
3294 /* comapi.c */
3300 
3302 
3305  omapi_typed_data_t *);
3308  omapi_value_t **);
3309 isc_result_t dhcp_group_destroy (omapi_object_t *, const char *, int);
3311  const char *, va_list);
3312 isc_result_t dhcp_group_stuff_values (omapi_object_t *,
3313  omapi_object_t *,
3314  omapi_object_t *);
3315 isc_result_t dhcp_group_lookup (omapi_object_t **,
3317 isc_result_t dhcp_group_create (omapi_object_t **,
3318  omapi_object_t *);
3319 isc_result_t dhcp_group_remove (omapi_object_t *,
3320  omapi_object_t *);
3321 
3324  omapi_typed_data_t *);
3327  omapi_value_t **);
3328 isc_result_t dhcp_control_destroy (omapi_object_t *, const char *, int);
3330  const char *, va_list);
3332  omapi_object_t *,
3333  omapi_object_t *);
3334 isc_result_t dhcp_control_lookup (omapi_object_t **,
3336 isc_result_t dhcp_control_create (omapi_object_t **,
3337  omapi_object_t *);
3338 isc_result_t dhcp_control_remove (omapi_object_t *,
3339  omapi_object_t *);
3340 
3343  omapi_typed_data_t *);
3346  omapi_value_t **);
3347 isc_result_t dhcp_subnet_destroy (omapi_object_t *, const char *, int);
3349  const char *, va_list);
3351  omapi_object_t *,
3352  omapi_object_t *);
3353 isc_result_t dhcp_subnet_lookup (omapi_object_t **,
3355 isc_result_t dhcp_subnet_create (omapi_object_t **,
3356  omapi_object_t *);
3357 isc_result_t dhcp_subnet_remove (omapi_object_t *,
3358  omapi_object_t *);
3359 
3361  omapi_object_t *,
3363  omapi_typed_data_t *);
3365  omapi_object_t *,
3367  omapi_value_t **);
3368 isc_result_t dhcp_shared_network_destroy (omapi_object_t *, const char *, int);
3370  const char *, va_list);
3372  omapi_object_t *,
3373  omapi_object_t *);
3377  omapi_object_t *);
3379  omapi_object_t *);
3380 
3381 /* omapi.c */
3382 extern int (*dhcp_interface_shutdown_hook) (struct interface_info *);
3383 
3388 
3389 #if defined (FAILOVER_PROTOCOL)
3393 #endif
3394 
3395 void dhcp_db_objects_setup (void);
3396 
3399  omapi_typed_data_t *);
3402  omapi_value_t **);
3403 isc_result_t dhcp_lease_destroy (omapi_object_t *, const char *, int);
3405  const char *, va_list);
3406 isc_result_t dhcp_lease_stuff_values (omapi_object_t *,
3407  omapi_object_t *,
3408  omapi_object_t *);
3409 isc_result_t dhcp_lease_lookup (omapi_object_t **,
3411 isc_result_t dhcp_lease_create (omapi_object_t **,
3412  omapi_object_t *);
3413 isc_result_t dhcp_lease_remove (omapi_object_t *,
3414  omapi_object_t *);
3417  omapi_typed_data_t *);
3420  omapi_value_t **);
3421 isc_result_t dhcp_host_destroy (omapi_object_t *, const char *, int);
3423  const char *, va_list);
3424 isc_result_t dhcp_host_stuff_values (omapi_object_t *,
3425  omapi_object_t *,
3426  omapi_object_t *);
3427 isc_result_t dhcp_host_lookup (omapi_object_t **,
3429 isc_result_t dhcp_host_create (omapi_object_t **,
3430  omapi_object_t *);
3431 isc_result_t dhcp_host_remove (omapi_object_t *,
3432  omapi_object_t *);
3435  omapi_typed_data_t *);
3438  omapi_value_t **);
3439 isc_result_t dhcp_pool_destroy (omapi_object_t *, const char *, int);
3441  const char *, va_list);
3442 isc_result_t dhcp_pool_stuff_values (omapi_object_t *,
3443  omapi_object_t *,
3444  omapi_object_t *);
3445 isc_result_t dhcp_pool_lookup (omapi_object_t **,
3447 isc_result_t dhcp_pool_create (omapi_object_t **,
3448  omapi_object_t *);
3449 isc_result_t dhcp_pool_remove (omapi_object_t *,
3450  omapi_object_t *);
3453  omapi_typed_data_t *);
3456  omapi_value_t **);
3457 isc_result_t dhcp_class_destroy (omapi_object_t *, const char *, int);
3459  const char *, va_list);
3460 isc_result_t dhcp_class_stuff_values (omapi_object_t *,
3461  omapi_object_t *,
3462  omapi_object_t *);
3463 isc_result_t dhcp_class_lookup (omapi_object_t **,
3465 isc_result_t dhcp_class_create (omapi_object_t **,
3466  omapi_object_t *);
3467 isc_result_t dhcp_class_remove (omapi_object_t *,
3468  omapi_object_t *);
3471  omapi_typed_data_t *);
3474  omapi_value_t **);
3475 isc_result_t dhcp_subclass_destroy (omapi_object_t *, const char *, int);
3477  const char *, va_list);
3479  omapi_object_t *,
3480  omapi_object_t *);
3481 isc_result_t dhcp_subclass_lookup (omapi_object_t **,
3483 isc_result_t dhcp_subclass_create (omapi_object_t **,
3484  omapi_object_t *);
3485 isc_result_t dhcp_subclass_remove (omapi_object_t *,
3486  omapi_object_t *);
3488  omapi_object_t *,
3490  omapi_typed_data_t *);
3492  omapi_object_t *,
3494  omapi_value_t **);
3495 isc_result_t dhcp_interface_destroy (omapi_object_t *,
3496  const char *, int);
3498  const char *,
3499  va_list ap);
3501  omapi_object_t *,
3502  omapi_object_t *);
3503 isc_result_t dhcp_interface_lookup (omapi_object_t **,
3504  omapi_object_t *,
3505  omapi_object_t *);
3506 isc_result_t dhcp_interface_create (omapi_object_t **,
3507  omapi_object_t *);
3508 isc_result_t dhcp_interface_remove (omapi_object_t *,
3509  omapi_object_t *);
3510 void interface_stash (struct interface_info *);
3511 void interface_snorf (struct interface_info *, int);
3512 
3513 isc_result_t binding_scope_set_value (struct binding_scope *, int,
3515  omapi_typed_data_t *);
3516 isc_result_t binding_scope_get_value (omapi_value_t **,
3517  struct binding_scope *,
3520  struct binding_scope *);
3521 
3522 void register_eventhandler(struct eventqueue **, void (*handler)(void *));
3523 void unregister_eventhandler(struct eventqueue **, void (*handler)(void *));
3524 void trigger_event(struct eventqueue **);
3525 
3526 /* mdb.c */
3527 
3528 extern struct subnet *subnets;
3529 extern struct shared_network *shared_networks;
3531 extern host_hash_t *host_uid_hash;
3532 extern host_hash_t *host_name_hash;
3536 
3538 
3539 extern int numclasseswritten;
3540 
3541 
3542 isc_result_t enter_class (struct class *, int, int);
3543 isc_result_t delete_class (struct class *, int);
3544 isc_result_t enter_host (struct host_decl *, int, int);
3545 isc_result_t delete_host (struct host_decl *, int);
3546 void change_host_uid(struct host_decl *host, const char *data, int len);
3547 int find_hosts_by_haddr (struct host_decl **, int,
3548  const unsigned char *, unsigned,
3549  const char *, int);
3550 int find_hosts_by_uid (struct host_decl **, const unsigned char *,
3551  unsigned, const char *, int);
3552 int find_hosts_by_option(struct host_decl **, struct packet *,
3553  struct option_state *, const char *, int);
3554 int find_host_for_network (struct subnet **, struct host_decl **,
3555  struct iaddr *, struct shared_network *);
3556 
3557 void new_address_range (struct parse *, struct iaddr, struct iaddr,
3558  struct subnet *, struct pool *,
3559  struct lease **);
3560 isc_result_t dhcp_lease_free (omapi_object_t *, const char *, int);
3561 isc_result_t dhcp_lease_get (omapi_object_t **, const char *, int);
3562 int find_grouped_subnet (struct subnet **, struct shared_network *,
3563  struct iaddr, const char *, int);
3564 int find_subnet(struct subnet **, struct iaddr, const char *, int);
3565 void enter_shared_network (struct shared_network *);
3566 void new_shared_network_interface (struct parse *,
3567  struct shared_network *,
3568  const char *);
3569 int subnet_inner_than(const struct subnet *, const struct subnet *, int);
3570 void enter_subnet (struct subnet *);
3571 void enter_lease (struct lease *);
3572 int supersede_lease (struct lease *, struct lease *, int, int, int, int);
3573 void make_binding_state_transition (struct lease *);
3574 int lease_copy (struct lease **, struct lease *, const char *, int);
3575 void release_lease (struct lease *, struct packet *);
3576 void abandon_lease (struct lease *, const char *);
3577 #if 0
3578 /* this appears to be unused and I plan to remove it SAR */
3579 void dissociate_lease (struct lease *);
3580 #endif
3581 void pool_timer (void *);
3582 int find_lease_by_uid (struct lease **, const unsigned char *,
3583  unsigned, const char *, int);
3584 int find_lease_by_hw_addr (struct lease **, const unsigned char *,
3585  unsigned, const char *, int);
3586 int find_lease_by_ip_addr (struct lease **, struct iaddr,
3587  const char *, int);
3588 void uid_hash_add (struct lease *);
3589 void uid_hash_delete (struct lease *);
3590 void hw_hash_add (struct lease *);
3591 void hw_hash_delete (struct lease *);
3592 int write_leases (void);
3593 int write_leases6(void);
3594 #if !defined(BINARY_LEASES)
3595 void lease_insert(struct lease **, struct lease *);
3596 void lease_remove(struct lease **, struct lease *);
3597 void lease_remove_all(struct lease **);
3598 #endif
3599 int lease_enqueue (struct lease *);
3600 isc_result_t lease_instantiate(const void *, unsigned, void *);
3601 void expire_all_pools (void);
3602 void dump_subnets (void);
3603 #if defined (DEBUG_MEMORY_LEAKAGE) || \
3604  defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
3605 void free_everything (void);
3606 #endif
3607 
3608 /* failover.c */
3609 #if defined (FAILOVER_PROTOCOL)
3610 extern dhcp_failover_state_t *failover_states;
3614 isc_result_t enter_failover_peer (dhcp_failover_state_t *);
3615 isc_result_t find_failover_peer (dhcp_failover_state_t **,
3616  const char *, const char *, int);
3619  const char *, va_list);
3621  omapi_object_t *,
3623  omapi_typed_data_t *);
3625  omapi_object_t *,
3627  omapi_value_t **);
3629  const char *, int);
3631  omapi_object_t *,
3632  omapi_object_t *);
3634 
3636  const char *,
3637  va_list);
3639  omapi_object_t *,
3641  omapi_typed_data_t *);
3643  omapi_object_t *,
3645  omapi_value_t **);
3647  const char *, int);
3649  omapi_object_t *,
3650  omapi_object_t *);
3653  const char *, va_list);
3654 isc_result_t dhcp_failover_state_transition (dhcp_failover_state_t *,
3655  const char *);
3656 isc_result_t dhcp_failover_set_service_state (dhcp_failover_state_t *state);
3657 void dhcp_failover_rescind_updates (dhcp_failover_state_t *);
3658 isc_result_t dhcp_failover_set_state (dhcp_failover_state_t *,
3659  enum failover_state);
3660 isc_result_t dhcp_failover_peer_state_changed (dhcp_failover_state_t *,
3661  failover_message_t *);
3664 int dhcp_failover_state_pool_check (dhcp_failover_state_t *);
3667 isc_result_t dhcp_failover_send_state (dhcp_failover_state_t *);
3668 isc_result_t dhcp_failover_send_updates (dhcp_failover_state_t *);
3669 int dhcp_failover_queue_update (struct lease *, int);
3670 int dhcp_failover_send_acks (dhcp_failover_state_t *);
3672 int dhcp_failover_queue_ack (dhcp_failover_state_t *, failover_message_t *msg);
3673 void dhcp_failover_ack_queue_remove (dhcp_failover_state_t *, struct lease *);
3675  omapi_object_t *,
3677  omapi_typed_data_t *);
3685  omapi_object_t *,
3687  omapi_value_t **);
3689  const char *, int);
3691  omapi_object_t *,
3692  omapi_object_t *);
3694  omapi_object_t *,
3695  omapi_object_t *);
3697  omapi_object_t *);
3699  omapi_object_t *);
3700 int dhcp_failover_state_match (dhcp_failover_state_t *, u_int8_t *, unsigned);
3701 int dhcp_failover_state_match_by_name(dhcp_failover_state_t *,
3702  failover_option_t *);
3705 const char *dhcp_failover_message_name (unsigned);
3706 const char *dhcp_failover_option_name (unsigned);
3707 failover_option_t *dhcp_failover_option_printf (unsigned, char *,
3708  unsigned *,
3709  unsigned,
3710  const char *, ...)
3711  __attribute__((__format__(__printf__,5,6)));
3712 failover_option_t *dhcp_failover_make_option (unsigned, char *,
3713  unsigned *, unsigned, ...);
3714 isc_result_t dhcp_failover_put_message (dhcp_failover_link_t *,
3715  omapi_object_t *, int, u_int32_t, ...);
3718  dhcp_failover_state_t *,
3719  int, const char *);
3721  int, const char *);
3722 isc_result_t dhcp_failover_send_bind_update (dhcp_failover_state_t *,
3723  struct lease *);
3724 isc_result_t dhcp_failover_send_bind_ack (dhcp_failover_state_t *,
3725  failover_message_t *,
3726  int, const char *);
3727 isc_result_t dhcp_failover_send_poolreq (dhcp_failover_state_t *);
3728 isc_result_t dhcp_failover_send_poolresp (dhcp_failover_state_t *, int);
3729 isc_result_t dhcp_failover_send_update_request (dhcp_failover_state_t *);
3730 isc_result_t dhcp_failover_send_update_request_all (dhcp_failover_state_t *);
3731 isc_result_t dhcp_failover_send_update_done (dhcp_failover_state_t *);
3732 isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *,
3733  failover_message_t *);
3734 isc_result_t dhcp_failover_process_bind_ack (dhcp_failover_state_t *,
3735  failover_message_t *);
3736 isc_result_t dhcp_failover_generate_update_queue (dhcp_failover_state_t *,
3737  int);
3738 isc_result_t dhcp_failover_process_update_request (dhcp_failover_state_t *,
3739  failover_message_t *);
3740 isc_result_t dhcp_failover_process_update_request_all (dhcp_failover_state_t *,
3741  failover_message_t *);
3742 isc_result_t dhcp_failover_process_update_done (dhcp_failover_state_t *,
3743  failover_message_t *);
3744 void ia_remove_all_lease(struct ia_xx *ia, const char *file, int line);
3746 void failover_print (char *, unsigned *, unsigned, const char *);
3747 void update_partner (struct lease *);
3748 int load_balance_mine (struct packet *, dhcp_failover_state_t *);
3749 int peer_wants_lease (struct lease *);
3751  dhcp_failover_state_t *,
3753  u_int32_t);
3756  dhcp_failover_state_t *,
3757  binding_state_t, u_int32_t);
3759 
3760 OMAPI_OBJECT_ALLOC_DECL (dhcp_failover_state, dhcp_failover_state_t,
3764 OMAPI_OBJECT_ALLOC_DECL (dhcp_failover_link, dhcp_failover_link_t,
3766 #endif /* FAILOVER_PROTOCOL */
3767 
3768 const char *binding_state_print (enum failover_state);
3769 
3770 /* ldap.c */
3771 #if defined(LDAP_CONFIGURATION)
3772 extern struct enumeration ldap_methods;
3773 #if defined (LDAP_USE_SSL)
3774 extern struct enumeration ldap_ssl_usage_enum;
3775 extern struct enumeration ldap_tls_reqcert_enum;
3776 extern struct enumeration ldap_tls_crlcheck_enum;
3777 #endif
3778 isc_result_t ldap_read_config (void);
3779 int find_haddr_in_ldap (struct host_decl **, int, unsigned,
3780  const unsigned char *, const char *, int);
3781 int find_subclass_in_ldap (struct class *, struct class **,
3782  struct data_string *);
3783 int find_client_in_ldap (struct host_decl **, struct packet*,
3784  struct option_state *, const char *, int);
3785 #endif
3786 
3787 /* mdb6.c */
3788 HASH_FUNCTIONS_DECL(ia, unsigned char *, struct ia_xx, ia_hash_t)
3789 HASH_FUNCTIONS_DECL(iasubopt, struct in6_addr *, struct iasubopt,
3791 
3792 isc_result_t iasubopt_allocate(struct iasubopt **iasubopt,
3793  const char *file, int line);
3794 isc_result_t iasubopt_reference(struct iasubopt **iasubopt,
3795  struct iasubopt *src,
3796  const char *file, int line);
3797 isc_result_t iasubopt_dereference(struct iasubopt **iasubopt,
3798  const char *file, int line);
3799 
3800 isc_result_t ia_make_key(struct data_string *key, u_int32_t iaid,
3801  const char *duid, unsigned int duid_len,
3802  const char *file, int line);
3803 isc_result_t ia_allocate(struct ia_xx **ia, u_int32_t iaid,
3804  const char *duid, unsigned int duid_len,
3805  const char *file, int line);
3806 isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src,
3807  const char *file, int line);
3808 isc_result_t ia_dereference(struct ia_xx **ia,
3809  const char *file, int line);
3810 isc_result_t ia_add_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt,
3811  const char *file, int line);
3812 void ia_remove_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt,
3813  const char *file, int line);
3814 isc_boolean_t ia_equal(const struct ia_xx *a, const struct ia_xx *b);
3815 
3816 isc_result_t ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type,
3817  const struct in6_addr *start_addr,
3818  int bits, int units,
3819  const char *file, int line);
3820 isc_result_t ipv6_pool_reference(struct ipv6_pool **pool,
3821  struct ipv6_pool *src,
3822  const char *file, int line);
3823 isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool,
3824  const char *file, int line);
3825 isc_result_t create_lease6(struct ipv6_pool *pool,
3826  struct iasubopt **addr,
3827  unsigned int *attempts,
3828  const struct data_string *uid,
3829  time_t soft_lifetime_end_time);
3830 #ifdef EUI_64
3831 int valid_eui_64_duid(const struct data_string* uid, int duid_beg);
3832 int valid_for_eui_64_pool(struct ipv6_pool*, struct data_string* uid,
3833  int duid_beg, struct in6_addr* ia_addr);
3834 isc_result_t create_lease6_eui_64(struct ipv6_pool *pool,
3835  struct iasubopt **addr,
3836  const struct data_string *iaid_uid,
3837  time_t soft_lifetime_end_time);
3838 #endif
3839 isc_result_t add_lease6(struct ipv6_pool *pool,
3840  struct iasubopt *lease,
3841  time_t valid_lifetime_end_time);
3842 isc_result_t renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease);
3843 isc_result_t expire_lease6(struct iasubopt **leasep,
3844  struct ipv6_pool *pool, time_t now);
3845 isc_result_t release_lease6(struct ipv6_pool *pool, struct iasubopt *lease);
3846 isc_result_t decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease);
3848  const struct in6_addr *addr);
3850 isc_result_t cleanup_lease6(ia_hash_t *ia_table,
3851  struct ipv6_pool *pool,
3852  struct iasubopt *lease,
3853  struct ia_xx *ia);
3854 isc_result_t mark_lease_unavailble(struct ipv6_pool *pool,
3855  const struct in6_addr *addr);
3856 isc_result_t create_prefix6(struct ipv6_pool *pool,
3857  struct iasubopt **pref,
3858  unsigned int *attempts,
3859  const struct data_string *uid,
3860  time_t soft_lifetime_end_time);
3862  const struct in6_addr *pref, u_int8_t plen);
3863 
3864 isc_result_t add_ipv6_pool(struct ipv6_pool *pool);
3865 isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type,
3866  const struct in6_addr *addr);
3867 isc_boolean_t ipv6_in_pool(const struct in6_addr *addr,
3868  const struct ipv6_pool *pool);
3869 isc_result_t ipv6_pond_allocate(struct ipv6_pond **pond,
3870  const char *file, int line);
3871 isc_result_t ipv6_pond_reference(struct ipv6_pond **pond,
3872  struct ipv6_pond *src,
3873  const char *file, int line);
3874 isc_result_t ipv6_pond_dereference(struct ipv6_pond **pond,
3875  const char *file, int line);
3876 
3877 isc_result_t renew_leases(struct ia_xx *ia);
3878 isc_result_t release_leases(struct ia_xx *ia);
3879 isc_result_t decline_leases(struct ia_xx *ia);
3880 void schedule_lease_timeout(struct ipv6_pool *pool);
3882 
3883 void mark_hosts_unavailable(void);
3884 void mark_phosts_unavailable(void);
3885 void mark_interfaces_unavailable(void);
3886 void report_jumbo_ranges();
3887 
3888 #if defined(DHCPv6)
3889 int find_hosts6(struct host_decl** host, struct packet* packet,
3890  const struct data_string* client_id, char* file, int line);
3891 #endif
3892 
3893 #if defined (BINARY_LEASES)
3894 /* leasechain.c */
3895 int lc_not_empty(struct leasechain *lc);
3896 void lc_add_sorted_lease(struct leasechain *lc, struct lease *lp);
3897 void lc_unlink_lease(struct leasechain *lc, struct lease *lp);
3899 struct lease *lc_get_next(struct leasechain *lc, struct lease *lp);
3900 void lc_init_growth(struct leasechain *lc, size_t growth);
3902 #endif /* BINARY_LEASES */
3903 
3904 #define MAX_ADDRESS_STRING_LEN \
3905  (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"))
3906 
3907 /* Find the percentage of count. We need to try two different
3908  * ways to avoid rounding mistakes.
3909  */
3910 #define FIND_PERCENT(count, percent) \
3911  ((count) > (INT_MAX / 100) ? \
3912  ((count) / 100) * (percent) : ((count) * (percent)) / 100)
3913 
3914 #define FIND_POND6_PERCENT(count, percent) \
3915  ((count) > (POND_TRACK_MAX / 100) ? \
3916  ((count) / 100) * (percent) : ((count) * (percent)) / 100)
3917 
isc_boolean_t
Definition: data.h:150
void mark_hosts_unavailable(void)
Definition: mdb6.c:2471
int find_subnet(struct subnet **, struct iaddr, const char *, int)
Definition: dhclient.c:1552
isc_result_t new_parse(struct parse **, int, char *, unsigned, const char *, int)
Definition: conflex.c:41
int dhclient_interface_discovery_hook(struct interface_info *)
Definition: dhclient.c:5274
int write_billing_class(struct class *)
Definition: db.c:991
isc_result_t dhcp_control_signal_handler(omapi_object_t *, const char *, va_list)
Definition: comapi.c:504
int dhcp_option_default_priority_list[]
struct interface_info * dummy_interfaces
Definition: dhcpd.h:2850
int parse_option_list(struct parse *, struct option ***)
Definition: clparse.c:915
isc_result_t dhcp_failover_link_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
void parse_failover_peer(struct parse *, struct group *, int)
void dhcp_failover_startup_timeout(void *)
void if_reinitialize_receive(struct interface_info *)
u_int16_t relay_port
Definition: discover.c:50
int write_host(struct host_decl *)
Definition: dhclient.c:2115
isc_result_t dhcp_failover_process_update_request(dhcp_failover_state_t *, failover_message_t *)
void add_timeout(struct timeval *, void(*)(void *), void *, tvref_t, tvunref_t)
Definition: dispatch.c:206
void repudiate_zone(struct dns_zone **)
failover_option_t null_failover_option
void dump_raw(const unsigned char *, unsigned)
void maybe_setup_fallback(void)
binding_state_t normal_binding_state_transition_check(struct lease *, dhcp_failover_state_t *, binding_state_t, u_int32_t)
void cancel_all_timeouts(void)
dhcp_failover_state_t * failover_states
isc_result_t ipv6_pond_reference(struct ipv6_pond **pond, struct ipv6_pond *src, const char *file, int line)
reference an IPv6 pond structure.
Definition: mdb6.c:2613
enum dhcp_token next_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:380
void state_reboot(void *)
Definition: dhclient.c:1610
void dhcprelease(struct packet *, int)
Definition: dhcp.c:810
int token_print_indent(FILE *, int, int, const char *, const char *, const char *)
Definition: print.c:1262
isc_result_t dhcp_lease_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: omapi.c:391
int option_cache_reference(struct option_cache **, struct option_cache *, const char *, int)
Definition: alloc.c:651
void delete_fqdn6_option(struct universe *universe, struct option_state *options, int code)
Definition: options.c:3555
isc_result_t dhcp_group_destroy(omapi_object_t *, const char *, int)
Definition: comapi.c:226
isc_result_t dhcp_shared_network_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: comapi.c:747
isc_result_t delete_class(struct class *, int)
Definition: mdb.c:458
host_hash_t * host_hw_addr_hash
Definition: mdb.c:34
int write_server_duid(void)
isc_result_t ddns_update_fwd(struct data_string *, struct iaddr, struct data_string *, unsigned long, unsigned, unsigned)
int token_indent_data_string(FILE *, int, int, const char *, const char *, struct data_string *)
Definition: print.c:1219
u_int16_t dhcp_check_relayport(struct packet *packet)
int op_precedence(enum expr_op, enum expr_op)
Definition: tree.c:3200
void free_dhcp_packet(struct dhcp_packet *, const char *, int)
Definition: alloc.c:353
void do_packet6(struct interface_info *, const char *, int, int, const struct iaddr *, isc_boolean_t)
trace_type_t * inpacket_trace
isc_result_t enter_dns_zone(struct dns_zone *)
Definition: dns.c:640
struct enumeration prefix_length_modes
Definition: stables.c:378
int linked_option_get(struct data_string *, struct universe *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct option_state *, struct binding_scope **, unsigned)
void send_release(void *)
Definition: dhclient.c:3378
isc_result_t range2cidr(struct iaddrcidrnetlist **result, const struct iaddr *lo, const struct iaddr *hi)
Definition: inet.c:360
void icmp_startup(int, void(*)(struct iaddr, u_int8_t *, int))
void hw_hash_add(struct lease *)
Definition: mdb.c:2251
isc_result_t dhcp_lease_free(omapi_object_t *, const char *, int)
isc_result_t dhcp_host_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1266
int option_state_reference(struct option_state **, struct option_state *, const char *, int)
Definition: alloc.c:883
isc_result_t dhcp_group_create(omapi_object_t **, omapi_object_t *)
Definition: comapi.c:398
const char * dhcp_failover_option_name(unsigned)
void convert_statement(struct parse *)
isc_result_t dhcp_interface_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: discover.c:1369
isc_result_t dhcp_host_create(omapi_object_t **, omapi_object_t *)
Definition: omapi.c:1576
void convert_class_decl(struct parse *, jrefproto)
isc_result_t dhcp_interface_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: discover.c:1335
void parse_server_duid(struct parse *cfile)
void add_route_direct(struct interface_info *, struct in_addr)
void free_expression(struct expression *, const char *, int)
Definition: alloc.c:474
struct option_cache * next_hashed_option(struct universe *, struct option_state *, struct option_cache *)
OMAPI_OBJECT_ALLOC_DECL(shared_network, struct shared_network, dhcp_type_shared_network) OMAPI_OBJECT_ALLOC_DECL(dhcp_control
isc_result_t dhcp_interface_remove(omapi_object_t *, omapi_object_t *)
Definition: discover.c:1469
void script_write_params(struct client_state *, const char *, struct client_lease *)
Adds parameters to environment variables for a script.
Definition: dhclient.c:4764
void fqdn6_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
Definition: options.c:3569
int pretty_escape(char **, char *, const unsigned char **, const unsigned char *)
Definition: options.c:4287
struct interface_info * fallback_interface
Definition: dhcpd.h:2850
void unconfigure6(struct client_state *client, const char *reason)
int fqdn_universe_decode(struct option_state *, const unsigned char *, unsigned, struct universe *)
Definition: options.c:366
void trace_conf_stop(trace_type_t *ttype)
void script_write_requested(struct client_state *)
Write out the environent variable the client requested. Write out the environment variables for the o...
Definition: dhclient.c:4887
int make_const_int(struct expression **, unsigned long)
Definition: tree.c:254
isc_result_t dhcp_pool_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: omapi.c:1632
void(* tvunref_t)(void *, const char *, int)
Definition: dhcpd.h:1449
void execute_statements_in_scope(struct binding_value **result, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct group *, struct group *, struct on_star *)
Definition: execute.c:570
struct name_server * name_servers
Definition: resolv.c:31
pair cons(caddr_t, pair)
Definition: tree.c:137
int bill_class(struct lease *, struct class *)
Definition: class.c:296
HASH_FUNCTIONS_DECL(option_name, const char *, struct option, option_name_hash_t) HASH_FUNCTIONS_DECL(option_code
void interface_trace_setup(void)
u_int16_t validate_port_pair(char *)
Definition: inet.c:685
struct lease * lc_get_first_lease(struct leasechain *lc)
isc_result_t ia_add_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
Definition: mdb6.c:439
isc_result_t interface_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
void suboption_foreach(struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *, void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *), struct option_cache *, const char *)
Definition: options.c:3808
int executable_statement_allocate(struct executable_statement **, const char *, int)
Definition: alloc.c:958
void make_binding_state_transition(struct lease *)
Definition: mdb.c:1503
isc_result_t enter_class(struct class *, int, int)
Definition: mdb.c:72
void convert_ip_addr_or_hostname(struct parse *, jrefproto, int)
void parse_hardware_param(struct parse *, struct hardware *)
Definition: parse.c:615
isc_result_t dhcp_control_remove(omapi_object_t *, omapi_object_t *)
Definition: comapi.c:595
isc_result_t dhcp_interface_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: discover.c:1262
control_object_state_t
Definition: dhcpd.h:522
@ server_time_changed
Definition: dhcpd.h:528
@ server_awaken
Definition: dhcpd.h:527
@ server_startup
Definition: dhcpd.h:523
@ server_shutdown
Definition: dhcpd.h:525
@ server_hibernate
Definition: dhcpd.h:526
@ server_running
Definition: dhcpd.h:524
struct enumeration ddns_styles
Definition: stables.c:363
void bootp(struct packet *)
Definition: dhclient.c:2126
int write_failover_state(dhcp_failover_state_t *)
void dhcpv4_client_assignments(void)
Definition: dhclient.c:5863
isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result)
Definition: inet.c:503
isc_result_t ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *start_addr, int bits, int units, const char *file, int line)
Create a new IPv6 lease pool structure.
Definition: mdb6.c:640
enum dhcp_token next_token(const char **, unsigned *, struct parse *)
Definition: conflex.c:369
int make_encapsulation(struct expression **, struct data_string *)
Definition: tree.c:298
struct client_lease * new_client_lease(const char *, int)
isc_result_t icmp_echoreply(omapi_object_t *)
Definition: icmp.c:204
void dhcpv6_leasequery(struct data_string *, struct packet *)
isc_result_t interface_initialize(omapi_object_t *, const char *, int)
Definition: discover.c:133
struct binding * find_binding(struct binding_scope *, const char *)
Definition: tree.c:3755
isc_result_t dhcp_failover_listen(omapi_object_t *)
void parse_server_duid_conf(struct parse *cfile)
Definition: confparse.c:3790
isc_result_t dhcp_failover_generate_update_queue(dhcp_failover_state_t *, int)
void dhcp_failover_sanity_check(void)
struct iaddr broadcast_addr(struct iaddr, struct iaddr)
Definition: inet.c:112
void relinquish_timeouts(void)
struct expression * parse_domain_name(struct parse *cfile)
Definition: parse.c:5785
isc_result_t dhcp_pool_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1765
dhcp_pending
Definition: dhcpd.h:1215
@ P_NONE
Definition: dhcpd.h:1216
@ P_RELEASE
Definition: dhcpd.h:1218
@ P_REBOOT
Definition: dhcpd.h:1217
void unregister_eventhandler(struct eventqueue **, void(*handler)(void *))
Definition: dispatch.c:70
int binding_value_reference(struct binding_value **, struct binding_value *, const char *, int)
Definition: alloc.c:520
int local_family
Definition: discover.c:59
void uid_hash_add(struct lease *)
Definition: mdb.c:2134
isc_result_t mark_lease_unavailble(struct ipv6_pool *pool, const struct in6_addr *addr)
isc_boolean_t ipv6_in_pool(const struct in6_addr *addr, const struct ipv6_pool *pool)
Definition: mdb6.c:2273
int struct expression * parse_domain_list(struct parse *cfile, int)
Definition: parse.c:5704
int db_printable(const unsigned char *)
dhcp_control_object_t
Definition: dhcpd.h:2513
int wanted_ia_pd
Definition: dhclient.c:111
void parse_shared_net_declaration(struct parse *, struct group *)
Definition: confpars.c:2606
int option_space_encapsulate(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct data_string *)
Definition: options.c:3161
const char * dhcp_flink_state_names[]
struct collection default_collection
Definition: parse.c:33
char * parse_host_name(struct parse *)
Definition: parse.c:196
isc_result_t get_client_id(struct packet *, struct data_string *)
int linked_option_state_dereference(struct universe *, struct option_state *, const char *, int)
Definition: options.c:4003
ia_hash_t * ia_na_active
void free_protocol(struct protocol *, const char *, int)
Definition: alloc.c:345
isc_result_t dhcp_failover_state_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
void add_route_net(struct interface_info *, struct in_addr, struct in_addr)
TIME parse_date(struct parse *)
Definition: parse.c:1188
struct domain_search_list * new_domain_search_list(const char *, int)
pair new_pair(const char *, int)
isc_result_t find_failover_peer(dhcp_failover_state_t **, const char *, const char *, int)
int data_string_terminate(struct data_string *, const char *, int)
Definition: alloc.c:1382
isc_result_t dhcp_subnet_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:698
int option_chain_head_reference(struct option_chain_head **, struct option_chain_head *, const char *, int)
Definition: alloc.c:67
void make_client_options(struct client_state *, struct client_lease *, u_int8_t *, struct option_cache *, struct iaddr *, struct option **, struct option_state **)
Definition: dhclient.c:3618
int is_boolean_expression(struct expression *)
Definition: tree.c:3031
char * print_hw_addr(const int, const int, const unsigned char *)
isc_result_t end_parse(struct parse **)
Definition: conflex.c:103
int write_group(struct group_object *)
Definition: db.c:449
isc_result_t dhcp_lease_destroy(omapi_object_t *, const char *, int)
Definition: omapi.c:467
void convert_host_statement(struct parse *, jrefproto)
isc_result_t dhcp_class_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2246
void dhcpdiscover(struct packet *, int)
Definition: dhcp.c:330
void send_decline(void *)
Definition: dhclient.c:3336
u_int32_t fto_allowed[]
void data_string_copy(struct data_string *, const struct data_string *, const char *, int)
Definition: alloc.c:1323
void free_permit(struct permit *, const char *, int)
Definition: salloc.c:245
struct collection * collections
Definition: parse.c:34
int binding_scope_dereference(struct binding_scope **, const char *, int)
Definition: tree.c:3786
isc_result_t dhcp_failover_link_signal(omapi_object_t *, const char *, va_list)
int supports_multiple_interfaces(struct interface_info *)
char * print_dotted_quads(unsigned, const u_int8_t *)
Definition: print.c:493
omapi_object_type_t * dhcp_type_subnet
void dhc6_lease_destroy(struct dhc6_lease **src, const char *file, int line)
void convert_servername_decl(struct parse *, jrefproto)
int write_client_lease(struct client_state *, struct client_lease *, int, int)
Definition: dhclient.c:4514
void reinitialize_interfaces(void)
Definition: discover.c:1078
struct interface_info * interfaces
Definition: discover.c:42
int unset(struct binding_scope *, const char *)
Definition: tree.c:4134
u_int32_t checksum(unsigned char *, unsigned, u_int32_t)
Definition: packet.c:44
isc_result_t dhcp_failover_register(omapi_object_t *)
void hash_dump(struct hash_table *)
Definition: print.c:344
omapi_object_type_t * dhcp_type_group
void lc_add_sorted_lease(struct leasechain *lc, struct lease *lp)
isc_result_t dhcp_lease_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:200
int option_chain_head_dereference(struct option_chain_head **, const char *, int)
Definition: alloc.c:95
int main(int, char **)
Definition: dhclient.c:240
isc_result_t dhcp_subnet_remove(omapi_object_t *, omapi_object_t *)
Definition: comapi.c:741
int parse_executable_statements(struct executable_statement **, struct parse *, int *, enum expression_context)
Definition: parse.c:2117
void if_deregister_send(struct interface_info *)
isc_boolean_t is_cidr_mask_valid(const struct iaddr *addr, int bits)
Definition: inet.c:303
omapi_object_type_t * dhcp_type_failover_listener
lease_id_hash_t * lease_hw_addr_hash
Definition: mdb.c:39
uint32_t parse_byte_order_uint32(const void *source)
#define HARDWARE_ADDR_LEN
Definition: dhcpd.h:486
void hashed_option_space_foreach(struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *, void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
Definition: options.c:3832
void classification_setup(void)
Definition: class.c:37
void read_client_duid(void)
Definition: clparse.c:333
void start_info_request6(struct client_state *client)
isc_boolean_t ia_equal(const struct ia_xx *a, const struct ia_xx *b)
Definition: mdb6.c:518
struct universe agent_universe
Definition: stables.c:165
void use_host_decl_name(struct packet *, struct lease *, struct option_state *)
Adds hostname option when use-host-decl-names is enabled.
Definition: dhcp.c:5732
enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:454
omapi_object_type_t * dhcp_type_control
void delete_linked_option(struct universe *, struct option_state *, int)
Definition: options.c:3949
unsigned cons_agent_information_options(struct option_state *, struct dhcp_packet *, unsigned, unsigned)
Definition: dhclient.c:5379
isc_result_t dhcp_group_remove(omapi_object_t *, omapi_object_t *)
Definition: comapi.c:414
isc_result_t delete_host(struct host_decl *, int)
Definition: mdb.c:490
ssize_t decode_ethernet_header(struct interface_info *, unsigned char *, unsigned, struct hardware *)
isc_result_t dhcp_failover_peer_state_changed(dhcp_failover_state_t *, failover_message_t *)
void client_location_changed(void)
Definition: dhclient.c:5155
void print_expression(const char *, struct expression *)
int interfaces_requested
Definition: dhclient.c:71
void make_decline(struct client_state *, struct client_lease *)
Definition: dhclient.c:3923
isc_result_t dhcp_failover_listener_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
struct in_addr limited_broadcast
Definition: discover.c:57
trace_type_t * outpacket_trace
void initialize_common_option_spaces(void)
Definition: tables.c:1058
int script_go(struct client_state *)
Calls external script.
Definition: dhclient.c:4917
int peer_wants_lease(struct lease *)
isc_result_t find_cached_zone(dhcp_ddns_cb_t *, int)
time_t TIME
Definition: dhcpd.h:85
void convert_hardware_decl(struct parse *, jrefproto)
omapi_object_type_t * dhcp_type_lease
Definition: omapi.c:46
void update_partner(struct lease *)
int permit_list_match(struct permit *, struct permit *)
Definition: confpars.c:1688
isc_result_t iasubopt_reference(struct iasubopt **iasubopt, struct iasubopt *src, const char *file, int line)
Definition: mdb6.c:234
int icmp_echorequest(struct iaddr *)
Definition: icmp.c:128
isc_result_t ddns_remove_fwd(struct data_string *, struct iaddr, struct data_string *)
struct shared_network * shared_networks
Definition: mdb.c:33
u_int32_t wrapsum(u_int32_t)
Definition: packet.c:83
int dont_use_fsync
Definition: dhcpd.c:85
void dhcp_failover_startup(void)
void indent(int)
isc_result_t add_ipv6_pool(struct ipv6_pool *pool)
Definition: mdb6.c:2024
int expression_allocate(struct expression **, const char *, int)
Definition: alloc.c:426
char * quotify_string(const char *, const char *, int)
Definition: print.c:33
isc_result_t generate_new_server_duid(void)
void free_lease_state(struct lease_state *, const char *, int)
Definition: salloc.c:198
int dhcp_option_default_priority_list_count
struct universe fqdn_universe
Definition: tables.c:315
void assemble_hw_header(struct interface_info *, unsigned char *, unsigned *, struct hardware *)
int expr_valid_for_context(struct expression *, enum expression_context)
void parse_address_range(struct parse *, struct group *, int, struct pool *, struct lease **)
Definition: confpars.c:3787
int parse_numeric_expression(struct expression **, struct parse *, int *)
Definition: parse.c:3569
void parse_trace_setup(void)
struct timeval cur_tv
Definition: dispatch.c:35
int parse_switch_statement(struct executable_statement **, struct parse *, int *)
Definition: parse.c:3224
int find_hosts6(struct host_decl **host, struct packet *packet, const struct data_string *client_id, char *file, int line)
Definition: mdb6.c:3015
void parse_client_statement(struct parse *, struct interface_info *, struct client_config *)
Definition: clparse.c:438
const char * hardware_types[256]
Definition: tables.c:713
void destroy_client_lease(struct client_lease *)
Definition: dhclient.c:4040
int find_hosts_by_haddr(struct host_decl **, int, const unsigned char *, unsigned, const char *, int)
Definition: mdb.c:632
isc_result_t dhcp_class_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2146
int packet_reference(struct packet **, struct packet *, const char *, int)
Definition: alloc.c:1053
struct dhcp_ddns_cb dhcp_ddns_cb_t
void make_discover(struct client_state *, struct client_lease *)
Definition: dhclient.c:3768
void option_space_foreach(struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *, void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
Definition: options.c:3789
void dump_packet_option(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)
struct domain_search_list * domains
Definition: resolv.c:32
isc_result_t dhcp_shared_network_remove(omapi_object_t *, omapi_object_t *)
Definition: comapi.c:902
isc_result_t dhcp_subnet_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: comapi.c:603
void dhcid_tolease(struct data_string *, struct data_string *)
int parse_on_statement(struct executable_statement **, struct parse *, int *)
Definition: parse.c:3144
dhcp_control_object_t * dhcp_control_object
struct failover_option_info ft_options[]
isc_result_t dhcp_failover_send_update_request(dhcp_failover_state_t *)
int wanted_ia_ta
Definition: dhclient.c:110
ia_hash_t * ia_ta_active
int enter_dns_host(struct dns_host_entry **, const char *)
Definition: tree.c:204
void try_hw_addr(struct interface_info *info)
void ddns_cancel(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
struct universe * find_option_universe(struct option *, const char *)
Definition: options.c:292
void parse_host_declaration(struct parse *, struct group *)
Definition: confpars.c:1959
const char * piaddr(struct iaddr)
Definition: inet.c:579
void dhcp_failover_ack_queue_remove(dhcp_failover_state_t *, struct lease *)
const char * pin6_addr(const struct in6_addr *)
int interface_or_dummy(struct interface_info **, const char *)
Definition: clparse.c:1052
void make_client_state(struct client_state **)
Definition: clparse.c:1106
isc_result_t dhcp_subclass_remove(omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2378
void(* tvref_t)(void *, void *, const char *, int)
Definition: dhcpd.h:1448
void parse_prefix6(struct parse *cfile, struct group *group, struct ipv6_pond *)
u_int32_t abandon_lease_time
Definition: dhcpd.c:99
isc_result_t dhcp_subclass_signal_handler(omapi_object_t *, const char *, va_list)
Definition: omapi.c:2324
int binding_scope_reference(struct binding_scope **, struct binding_scope *, const char *, int)
Definition: alloc.c:1227
ssize_t decode_udp_ip_header(struct interface_info *, unsigned char *, unsigned, struct sockaddr_in *, unsigned, unsigned *, int)
omapi_object_type_t * dhcp_type_failover_state
void dhcpnak(struct packet *)
Definition: dhclient.c:2707
isc_result_t dhcp_shared_network_signal_handler(omapi_object_t *, const char *, va_list)
Definition: comapi.c:835
char * print_dec_2(unsigned long)
Definition: print.c:532
int find_bound_string(struct data_string *, struct binding_scope *, const char *)
Definition: tree.c:4103
isc_result_t dhcp_shared_network_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:883
void start_selecting6(struct client_state *client)
isc_result_t dhcp_interface_destroy(omapi_object_t *, const char *, int)
Definition: discover.c:1270
void lc_delete_all(struct leasechain *lc)
struct option_cache * lookup_fqdn6_option(struct universe *universe, struct option_state *options, unsigned code)
Definition: options.c:3534
struct universe * config_universe
Definition: tables.c:979
int buffer_reference(struct buffer **, struct buffer *, const char *, int)
Definition: alloc.c:698
isc_result_t dhcp_failover_send_connect(omapi_object_t *)
isc_result_t dhcp_class_destroy(omapi_object_t *, const char *, int)
Definition: omapi.c:1984
void convert_filename_decl(struct parse *, jrefproto)
int ft_sizes[]
char * print_base64(const unsigned char *, unsigned, const char *, int)
Definition: print.c:121
failover_option_t failover_option_t * dhcp_failover_make_option(unsigned, char *, unsigned *, unsigned,...)
isc_result_t decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
Definition: mdb6.c:1776
int dhcp_failover_send_acks(dhcp_failover_state_t *)
isc_boolean_t lease6_usable(struct iasubopt *lease)
Check if address is available to a lease.
Definition: mdb6.c:1554
isc_result_t interface_destroy(omapi_object_t *, const char *, int)
isc_result_t dhcp_class_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: omapi.c:1959
int data_string_new(struct data_string *, const char *, unsigned int, const char *, int)
Constructs a null-terminated data_string from a char* and length.
Definition: alloc.c:1272
int dhcp_max_agent_option_packet_length
Definition: dhclient.c:69
void free_pair(pair, const char *, int)
Definition: alloc.c:400
int dhcpv4_over_dhcpv6
Definition: discover.c:51
int validate_packet(struct packet *)
Definition: options.c:4531
struct subnet * subnets
Definition: mdb.c:32
void dhcp_common_objects_setup(void)
int dhcp_failover_state_pool_check(dhcp_failover_state_t *)
void dump_packet(struct packet *)
int(* dhcp_interface_discovery_hook)(struct interface_info *)
Definition: discover.c:53
void dhcpack(struct packet *)
Definition: dhclient.c:1774
struct option_cache * lookup_linked_option(struct universe *, struct option_state *, unsigned)
Definition: options.c:3978
void convert_address_range(struct parse *, jrefproto)
void uid_hash_delete(struct lease *)
Definition: mdb.c:2201
isc_result_t dhcp_failover_process_bind_update(dhcp_failover_state_t *, failover_message_t *)
lease_id_hash_t extern struct option * vendor_cfg_option
Definition: dhcpd.h:1870
u_int16_t validate_port(char *)
Definition: inet.c:659
void if_reinitialize_send(struct interface_info *)
void set_server_duid(struct data_string *new_duid)
isc_result_t ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
void data_string_truncate(struct data_string *, int)
Definition: alloc.c:1352
isc_result_t dhcp_subnet_signal_handler(omapi_object_t *, const char *, va_list)
Definition: comapi.c:675
void expire_all_pools(void)
Definition: mdb.c:2835
void free_universe(struct universe *, const char *, int)
Definition: alloc.c:329
int find_lease_by_uid(struct lease **, const unsigned char *, unsigned, const char *, int)
Definition: mdb.c:2059
isc_result_t fallback_discard(omapi_object_t *)
void abandon_lease(struct lease *, const char *)
Definition: mdb.c:1830
int parse_expression(struct expression **, struct parse *, int *, enum expression_context, struct expression **, enum expr_op)
Definition: parse.c:4501
void print_hex_only(unsigned, const u_int8_t *, unsigned, char *)
Definition: print.c:380
void if_reinitialize_fallback(struct interface_info *)
int quiet_interface_discovery
Definition: discover.c:47
int parse_agent_information_option(struct packet *, int, u_int8_t *)
Definition: dhclient.c:5369
int(* dhcp_interface_setup_hook)(struct interface_info *, struct iaddr *)
Definition: discover.c:52
struct option * new_option(const char *, const char *, int)
int format_min_length(const char *, struct option_cache *)
isc_result_t dhcp_failover_listener_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
void copy_server_duid(struct data_string *ds, const char *file, int line)
isc_result_t dhcp_lease_signal_handler(omapi_object_t *, const char *, va_list)
Definition: omapi.c:541
int binding_value_allocate(struct binding_value **, const char *, int)
Definition: alloc.c:500
int packet_dereference(struct packet **, const char *, int)
Definition: alloc.c:1081
void delete_hashed_option(struct universe *, struct option_state *, int)
Definition: options.c:2918
const char * path_dhcpd_db
Definition: dhcpd.c:102
int do_release_on_roam
isc_result_t dhcp_lease_get(omapi_object_t **, const char *, int)
void trace_conf_input(trace_type_t *, unsigned, char *)
isc_result_t dhcp_interface_create(omapi_object_t **, omapi_object_t *)
Definition: discover.c:1453
isc_result_t ia_allocate(struct ia_xx **ia, u_int32_t iaid, const char *duid, unsigned int duid_len, const char *file, int line)
Definition: mdb6.c:339
void dispatch(void)
Definition: dispatch.c:109
int require_all_ias
Definition: dhclient.c:112
struct ipv6_pool ** pools
lease_id_hash_t * lease_uid_hash
Definition: mdb.c:37
isc_result_t dhcp_failover_listener_destroy(omapi_object_t *, const char *, int)
isc_result_t dhcp_failover_state_stuff(omapi_object_t *, omapi_object_t *, omapi_object_t *)
void trigger_event(struct eventqueue **)
Definition: dispatch.c:91
int parse_X(struct parse *, u_int8_t *, unsigned)
Definition: parse.c:5593
int addr_or(struct iaddr *result, const struct iaddr *a1, const struct iaddr *a2)
Definition: inet.c:238
void dhcpleasequery(struct packet *, int)
isc_result_t ipv6_pond_dereference(struct ipv6_pond **pond, const char *file, int line)
de-reference an IPv6 pond structure.
Definition: mdb6.c:2653
int data_string_sprintfa(struct data_string *ds, const char *fmt,...)
Definition: tree.c:56
void schedule_lease_timeout(struct ipv6_pool *pool)
Definition: mdb6.c:2165
int binding_value_dereference(struct binding_value **, const char *, int)
Definition: tree.c:652
isc_result_t binding_scope_get_value(omapi_value_t **, struct binding_scope *, omapi_data_string_t *)
Definition: omapi.c:2471
int make_limit(struct expression **, struct expression *, int)
Definition: tree.c:331
ssize_t send_packet(struct interface_info *, struct packet *, struct dhcp_packet *, size_t, struct in_addr, struct sockaddr_in *, struct hardware *)
int outstanding_pings
Definition: dhcp.c:49
isc_result_t dhcp_shared_network_create(omapi_object_t **, omapi_object_t *)
Definition: comapi.c:896
int find_matching_case(struct executable_statement **, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *, struct executable_statement *)
Definition: execute.c:1042
void assemble_udp_ip_header(struct interface_info *, unsigned char *, unsigned *, u_int32_t, u_int32_t, u_int32_t, unsigned char *, unsigned)
int lease_copy(struct lease **, struct lease *, const char *, int)
Definition: mdb.c:1681
void parse_ia_na_declaration(struct parse *)
Definition: confpars.c:4752
unsigned char option_mask[16]
Definition: dhcpd.h:1536
int max_ack_delay_secs
void parse_subnet6_declaration(struct parse *, struct shared_network *)
Definition: confpars.c:2852
struct interface_info ** interface_vector
Definition: discover.c:89
struct permit * new_permit(const char *, int)
void state_selecting(void *)
Definition: dhclient.c:1689
int parse_zone(struct dns_zone *, struct parse *)
Definition: parse.c:2816
void convert_fixed_addr_decl(struct parse *, jrefproto)
void nak_lease(struct packet *, struct iaddr *cip, struct group *)
Constructs and sends a DHCP Nak.
Definition: dhcp.c:1810
int if_register_lpf(struct interface_info *)
void convert_shared_net_statement(struct parse *, jrefproto)
isc_result_t dhcp_class_create(omapi_object_t **, omapi_object_t *)
Definition: omapi.c:2252
void convert_lease_statement(struct parse *, jrefproto)
void also_save_option(struct universe *, struct option_state *, struct option_cache *)
Definition: options.c:2829
void state_panic(void *)
Definition: dhclient.c:3009
int parse_ip6_addr(struct parse *, struct iaddr *)
Definition: parse.c:405
int parse_statement(struct parse *, struct group *, int, struct host_decl *, int)
Definition: confpars.c:364
void parse_ia_pd_declaration(struct parse *)
Definition: confpars.c:5637
struct iaddr subnet_number(struct iaddr, struct iaddr)
Definition: inet.c:34
void discover_interfaces(int)
Definition: discover.c:571
isc_result_t enter_failover_peer(dhcp_failover_state_t *)
int parse_dns_expression(struct expression **, struct parse *, int *)
int binding_scope_allocate(struct binding_scope **, const char *, int)
Definition: alloc.c:1194
void read_resolv_conf(TIME)
Definition: resolv.c:35
void dhcp_failover_auto_partner_down(void *vs)
int dhcp_failover_state_match(dhcp_failover_state_t *, u_int8_t *, unsigned)
void static_lease_dereference(struct lease *, const char *, int)
int addr_eq(struct iaddr, struct iaddr)
Definition: inet.c:166
isc_result_t create_prefix6(struct ipv6_pool *pool, struct iasubopt **pref, unsigned int *attempts, const struct data_string *uid, time_t soft_lifetime_end_time)
Definition: mdb6.c:1894
struct group * root_group
Definition: memory.c:31
isc_result_t dhcp_subnet_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: comapi.c:629
dhcp_shutdown_state
Definition: dhcpd.h:269
@ shutdown_done
Definition: dhcpd.h:274
@ shutdown_drop_omapi_connections
Definition: dhcpd.h:272
@ shutdown_omapi_connections
Definition: dhcpd.h:271
@ shutdown_listeners
Definition: dhcpd.h:270
@ shutdown_dhcp
Definition: dhcpd.h:273
void dhcp_failover_pool_check(struct pool *)
isc_result_t dhcp_lease_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:748
int parse_boolean_expression(struct expression **, struct parse *, int *)
Definition: parse.c:3475
int make_substring(struct expression **, struct expression *, struct expression *, struct expression *)
Definition: tree.c:313
void parse_lease_time(struct parse *, TIME *)
Definition: parse.c:690
isc_result_t dhcp_group_signal_handler(omapi_object_t *, const char *, va_list)
Definition: comapi.c:256
void mark_phosts_unavailable(void)
Definition: mdb6.c:2521
int make_host_lookup(struct expression **, const char *)
Definition: tree.c:188
omapi_object_type_t * dhcp_type_pool
Definition: omapi.c:47
int allocate_lease(struct lease **, struct packet *, struct pool *, int *)
Definition: dhcp.c:5019
int find_hosts_by_uid(struct host_decl **, const unsigned char *, unsigned, const char *, int)
Definition: mdb.c:652
void convert_lease_time(struct parse *, jrefproto, char *)
int supersede_lease(struct lease *, struct lease *, int, int, int, int)
Definition: mdb.c:1155
struct dhcp_packet * new_dhcp_packet(const char *, int)
int data_subexpression_length(int *, struct expression *)
struct enumeration_value * find_enumeration_value(const char *, int, unsigned *, const char *)
Definition: parse.c:58
void save_option(struct universe *, struct option_state *, struct option_cache *)
Definition: options.c:2818
isc_result_t dhcp_failover_state_destroy(omapi_object_t *, const char *, int)
void save_linked_option(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t appendp)
Definition: options.c:3869
isc_result_t dhcp_subclass_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2351
int find_grouped_subnet(struct subnet **, struct shared_network *, struct iaddr, const char *, int)
Definition: mdb.c:953
void dhcp_failover_toack_queue_timeout(void *)
isc_result_t supersede_group(struct group_object *, int)
Definition: memory.c:74
int parse_ip_addr_with_subnet(struct parse *, struct iaddrmatch *)
Definition: parse.c:522
void set_server_duid_type(int type)
isc_result_t dhcp_lease_remove(omapi_object_t *, omapi_object_t *)
Definition: omapi.c:920
isc_result_t enter_host(struct host_decl *, int, int)
Definition: mdb.c:221
int addr_cmp(const struct iaddr *a1, const struct iaddr *a2)
Definition: inet.c:211
isc_result_t lease_instantiate(const void *, unsigned, void *)
Definition: mdb.c:2765
isc_result_t read_client_conf(void)
Definition: clparse.c:58
int dhcpd_interface_setup_hook(struct interface_info *ip, struct iaddr *ia)
Definition: dhcpd.c:1578
isc_result_t dhcp_subnet_create(omapi_object_t **, omapi_object_t *)
Definition: comapi.c:735
void pool_timer(void *)
Definition: mdb.c:1914
void new_shared_network_interface(struct parse *, struct shared_network *, const char *)
Definition: mdb.c:1066
host_hash_t * host_name_hash
Definition: mdb.c:36
int prefix_length_mode
int parse_case_statement(struct executable_statement **, struct parse *, int *, enum expression_context)
Definition: parse.c:3292
u_int16_t get_conflict_mask(struct option_state *input_options)
void start_release6(struct client_state *client)
void dhcpdecline(struct packet *, int)
Definition: dhcp.c:964
int store_options6(char *, int, struct option_state *, struct packet *, const int *, struct data_string *)
Definition: options.c:1048
const char * path_dhclient_duid
Definition: dhclient.c:62
void bind_lease(struct client_state *)
Definition: dhclient.c:1945
isc_result_t dhcp_failover_set_service_state(dhcp_failover_state_t *state)
void remove_routes(struct in_addr)
void echo_client_id(struct packet *, struct lease *, struct option_state *, struct option_state *)
Adds a dhcp-client-id option to a set of options Given a set of input options, it searches for echo-c...
Definition: dhcp.c:2058
int dhcp_failover_queue_update(struct lease *, int)
int group_allocate(struct group **, const char *, int)
Definition: alloc.c:145
void assemble_tr_header(struct interface_info *, unsigned char *, unsigned *, struct hardware *)
int find_lease_by_hw_addr(struct lease **, const unsigned char *, unsigned, const char *, int)
Definition: mdb.c:2067
void set_time(TIME)
Definition: dispatch.c:36
void convert_host_decl(struct parse *, jrefproto)
struct universe nwip_universe
Definition: tables.c:287
void client_dns_remove(struct client_state *client, struct iaddr *addr)
isc_result_t write_client6_lease(struct client_state *client, struct dhc6_lease *lease, int rewrite, int sync)
Definition: dhclient.c:4360
int parse_encapsulated_suboptions(struct option_state *, struct option *, const unsigned char *, unsigned, struct universe *, const char *)
Definition: options.c:337
void convert_num(struct parse *, unsigned char *, const char *, int, unsigned)
Definition: parse.c:840
dhcp_state
Definition: dhcpd.h:1202
@ S_REBOOTING
Definition: dhcpd.h:1203
@ S_BOUND
Definition: dhcpd.h:1207
@ S_RENEWING
Definition: dhcpd.h:1208
@ S_STOPPED
Definition: dhcpd.h:1211
@ S_REBINDING
Definition: dhcpd.h:1209
@ S_SELECTING
Definition: dhcpd.h:1205
@ S_REQUESTING
Definition: dhcpd.h:1206
@ S_DECLINING
Definition: dhcpd.h:1210
@ S_INIT
Definition: dhcpd.h:1204
int parse_ip6_prefix(struct parse *, struct iaddr *, u_int8_t *)
Definition: parse.c:479
int addr_match(struct iaddr *, struct iaddrmatch *)
Definition: inet.c:184
void if_register_linklocal6(struct interface_info *info)
void struct client_lease * packet_to_lease(struct packet *, struct client_state *)
Definition: dhclient.c:2584
const char * path_dhcpd_conf
Definition: dhcpd.c:101
void if_deregister6(struct interface_info *info)
void free_client_lease(struct client_lease *, const char *, int)
Definition: alloc.c:369
isc_result_t dhcp_control_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: comapi.c:469
char * quotify_buf(const unsigned char *, unsigned, const char, const char *, int)
Definition: print.c:71
int packet_allocate(struct packet **, const char *, int)
Definition: alloc.c:1015
isc_result_t dhcp_failover_state_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
void change_host_uid(struct host_decl *host, const char *data, int len)
Definition: mdb.c:184
void schedule_all_ipv6_lease_timeouts()
Definition: mdb6.c:2208
isc_result_t dhcp_failover_send_poolreq(dhcp_failover_state_t *)
int nwip_option_space_encapsulate(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
Definition: options.c:3292
int make_const_option_cache(struct option_cache **, struct buffer **, u_int8_t *, unsigned, struct option *, const char *, int)
Definition: tree.c:149
host_hash_t * host_uid_hash
Definition: mdb.c:35
isc_result_t dhcp_failover_send_connectack(omapi_object_t *, dhcp_failover_state_t *, int, const char *)
void lc_init_growth(struct leasechain *lc, size_t growth)
int dhcp_failover_state_match_by_name(dhcp_failover_state_t *, failover_option_t *)
u_int16_t remote_port
Definition: dhclient.c:97
void write_statements(FILE *, struct executable_statement *, int)
Definition: execute.c:759
int ddns_updates(struct packet *, struct lease *, struct lease *, struct iasubopt *, struct iasubopt *, struct option_state *)
void dhcp_failover_recover_done(void *)
void convert_host_name(struct parse *, jrefproto)
void dhcp_db_objects_setup(void)
Definition: omapi.c:57
void parse_failover_state_declaration(struct parse *, dhcp_failover_state_t *)
isc_result_t dhcid_fromlease(struct data_string *, struct data_string *)
int lease_id_format
Definition: dhcpd.c:98
void enter_lease(struct lease *)
Definition: mdb.c:1112
void(* bootp_packet_handler)(struct interface_info *, struct dhcp_packet *, unsigned, unsigned int, struct iaddr, struct hardware *)
Definition: discover.c:70
int server_id_check
Definition: dhcpd.c:86
int parse_option_decl(struct option_cache **, struct parse *)
Definition: parse.c:5290
void free_domain_search_list(struct domain_search_list *, const char *, int)
Definition: alloc.c:337
int expression_reference(struct expression **, struct expression *, const char *, int)
Definition: alloc.c:446
void skip_to_semi(struct parse *)
Definition: parse.c:81
int commit_leases_timed(void)
Definition: db.c:1064
isc_result_t ipv6_pond_allocate(struct ipv6_pond **pond, const char *file, int line)
Create a new IPv6 pond structure.
Definition: mdb6.c:2570
int evaluate_boolean_expression(int *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *)
Definition: tree.c:694
isc_result_t dhcp_control_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: comapi.c:434
int can_receive_unicast_unconfigured(struct interface_info *)
int mockup_lease(struct lease **, struct packet *, struct shared_network *, struct host_decl *)
Definition: dhcp.c:4969
failover_option_t skip_failover_option
char path_resolv_conf[]
Definition: resolv.c:33
ssize_t receive_packet(struct interface_info *, unsigned char *, size_t, struct sockaddr_in *, struct hardware *)
int dhcp_failover_write_all_states(void)
void convert_numeric_aggregate(struct parse *, jrefproto, int, int, int, int)
int execute_statements(struct binding_value **result, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct executable_statement *, struct on_star *)
Definition: execute.c:35
isc_result_t interface_signal_handler(omapi_object_t *, const char *, va_list)
struct binding_scope * global_scope
Definition: tree.c:38
int dns_zone_reference(struct dns_zone **, struct dns_zone *, const char *, int)
Definition: alloc.c:1166
void rewrite_client_leases(void)
Definition: dhclient.c:4054
int make_let(struct executable_statement **, const char *)
Definition: tree.c:377
isc_result_t dhcp_pool_remove(omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1783
void client_envadd(struct client_state *, const char *, const char *, const char *,...) __attribute__((__format__(__printf__
void get_hw_addr(struct interface_info *info)
enum dhcp_shutdown_state shutdown_state
Definition: dhcpd.c:1638
dhcp_type_control int option_chain_head_allocate(struct option_chain_head **, const char *, int)
Definition: alloc.c:35
int make_const_data(struct expression **, const unsigned char *, unsigned, int, int, const char *, int)
Definition: tree.c:219
isc_result_t interface_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
int max_outstanding_acks
int evaluate_boolean_option_cache(int *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct option_cache *, const char *, int)
Definition: tree.c:2733
isc_result_t dhcp_subclass_create(omapi_object_t **, omapi_object_t *)
Definition: omapi.c:2360
void convert_class_statement(struct parse *, jrefproto, int)
u_int16_t local_port
Definition: dhclient.c:96
u_int8_t binding_state_t
Definition: dhcpd.h:544
struct name_server * first_name_server(void)
Definition: resolv.c:169
isc_result_t dhcp_control_create(omapi_object_t **, omapi_object_t *)
Definition: comapi.c:588
void lease_pinged(struct iaddr, u_int8_t *, int)
Definition: dhcpd.c:1506
int fundef_allocate(struct fundef **, const char *, int)
Definition: alloc.c:572
void ddns_cb_forget_zone(dhcp_ddns_cb_t *ddns_cb)
int write_lease(struct lease *)
Definition: dhclient.c:2109
struct timeout * timeouts
Definition: dispatch.c:33
struct universe server_universe
Definition: stables.c:176
isc_result_t dhcp_failover_state_create(omapi_object_t **, omapi_object_t *)
int have_billing_classes
Definition: class.c:33
int parse_boolean(struct parse *)
Definition: parse.c:3498
isc_result_t dhcp_failover_send_updates(dhcp_failover_state_t *)
struct executable_statement * default_classification_rules
Definition: class.c:31
struct eventqueue * rw_queue_empty
Definition: dispatch.c:37
isc_result_t delete_group(struct group_object *, int)
Definition: memory.c:35
ssize_t send_fallback6(struct interface_info *, struct packet *, struct dhcp_packet *, size_t, struct in6_addr *, struct sockaddr_in6 *, struct hardware *)
int linked_option_space_encapsulate(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
Definition: options.c:3913
isc_result_t dhcp_control_destroy(omapi_object_t *, const char *, int)
Definition: comapi.c:494
void enter_shared_network(struct shared_network *)
Definition: mdb.c:1055
struct universe vsio_universe
Definition: tables.c:698
void parse_fixed_prefix6(struct parse *cfile, struct host_decl *host_decl)
isc_result_t dhcp_control_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:557
int max_ack_delay_usecs
isc_result_t set_server_duid_from_option(void)
isc_result_t ia_dereference(struct ia_xx **ia, const char *file, int line)
Definition: mdb6.c:403
void eval_network_statements(struct option_state **options, struct packet *packet, struct group *network_group)
Builds option set from statements at the global and network scope.
Definition: dhcp.c:5573
int token_print_indent_concat(FILE *, int, int, const char *, const char *,...)
Definition: print.c:1181
void parse_client_lease_statement(struct parse *, int)
Definition: clparse.c:1140
char * format_lease_id(const unsigned char *s, unsigned len, int format, const char *file, int line)
Definition: print.c:1427
gid_t set_gid
int group_writer(struct group_object *)
Definition: db.c:1280
int format_has_text(const char *)
int new_lease_file(int test_mode)
Definition: db.c:1133
void dhcp(struct packet *)
Definition: dhclient.c:2159
void do_packet(struct interface_info *, struct dhcp_packet *, unsigned, unsigned int, struct iaddr, struct hardware *)
Definition: options.c:4045
isc_result_t dhcp_shared_network_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:859
struct timeval * process_outstanding_timeouts(struct timeval *)
Definition: dispatch.c:46
#define PACKET_MAX_CLASSES
Definition: dhcpd.h:452
struct in_addr local_address
Definition: discover.c:60
int parse_string(struct parse *, char **, unsigned *)
Definition: parse.c:156
#define LEASE_STRUCT
Definition: dhcpd.h:256
void make_request(struct client_state *, struct client_lease *)
Definition: dhclient.c:3833
void dhclient_schedule_updates(struct client_state *client, struct iaddr *addr, int offset)
void data_string_forget(struct data_string *, const char *, int)
Definition: alloc.c:1339
void dhcpv6_client_assignments(void)
void dhcp4o6_start(void)
isc_result_t renew_leases(struct ia_xx *ia)
Definition: mdb6.c:2352
int dns_zone_dereference(struct dns_zone **, const char *, int)
Definition: dns.c:698
void make_client_config(struct client_state *, struct client_config *)
Definition: clparse.c:1115
struct icmp_state * icmp_state
Definition: icmp.c:34
struct universe dhcp_universe
void(* dhcpv6_packet_handler)(struct interface_info *, const char *, int, int, const struct iaddr *, isc_boolean_t)
int parse_option_token(struct expression **, struct parse *, const char **, struct expression *, int, int)
Definition: parse.c:4978
struct enumeration * find_enumeration(const char *, int)
Definition: parse.c:47
isc_result_t unlink_class(struct class **class)
Definition: class.c:210
const char * path_dhclient_db
Definition: dhclient.c:58
int is_data_expression(struct expression *)
Definition: tree.c:3048
int(* dhcp_interface_shutdown_hook)(struct interface_info *)
Definition: discover.c:55
int parse_cshl(struct data_string *, struct parse *)
Definition: parse.c:2040
isc_result_t expire_lease6(struct iasubopt **leasep, struct ipv6_pool *pool, time_t now)
Definition: mdb6.c:1742
isc_result_t dhcp_class_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:1948
void dhcp_failover_rescind_updates(dhcp_failover_state_t *)
isc_result_t ia_make_key(struct data_string *key, u_int32_t iaid, const char *duid, unsigned int duid_len, const char *file, int line)
Definition: mdb6.c:311
int setup_fallback(struct interface_info **, const char *, int)
Definition: discover.c:1059
isc_result_t dhcp_interface_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: discover.c:1225
struct in6_addr local_address6
int clone_group(struct group **, struct group *, const char *, int)
Definition: memory.c:130
isc_result_t binding_scope_stuff_values(omapi_object_t *, struct binding_scope *)
Definition: omapi.c:2541
isc_result_t interface_setup(void)
Definition: discover.c:95
int evaluate_boolean_expression_result(int *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *)
Definition: tree.c:2780
isc_result_t dhcp_subclass_destroy(omapi_object_t *, const char *, int)
void(* ddns_action_t)(struct dhcp_ddns_cb *ddns_cb, isc_result_t result)
Definition: dhcpd.h:1811
int parse_semi(struct parse *)
Definition: parse.c:139
isc_boolean_t lease6_exists(const struct ipv6_pool *pool, const struct in6_addr *addr)
Definition: mdb6.c:1526
enum expression_context op_context(enum expr_op)
Definition: tree.c:3217
int universe_count
Definition: tables.c:973
void trace_ddns_init(void)
const char * pretty_print_option(struct option *, const unsigned char *, unsigned, int, int)
Definition: options.c:1793
isc_result_t dhcp_host_signal_handler(omapi_object_t *, const char *, va_list)
Definition: omapi.c:1218
isc_result_t dhcp_failover_send_state(dhcp_failover_state_t *)
isc_result_t dhcp_interface_signal_handler(omapi_object_t *, const char *, va_list ap)
Definition: discover.c:1299
int commit_leases(void)
Definition: dhclient.c:2104
void dhcpoffer(struct packet *)
Definition: dhclient.c:2446
void dump_subnets(void)
Definition: mdb.c:2933
int fundef_reference(struct fundef **, struct fundef *, const char *, int)
Definition: alloc.c:586
void free_name_server(struct name_server *, const char *, int)
Definition: alloc.c:292
void set_netmask(struct interface_info *, struct in_addr)
void start_confirm6(struct client_state *client)
void dhcp_failover_send_contact(void *)
isc_result_t dhcp_subnet_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:722
isc_result_t parse_option_name(struct parse *, int, int *, struct option **)
Definition: parse.c:1208
isc_result_t create_lease6(struct ipv6_pool *pool, struct iasubopt **addr, unsigned int *attempts, const struct data_string *uid, time_t soft_lifetime_end_time)
Definition: mdb6.c:1032
int subnet_inner_than(const struct subnet *, const struct subnet *, int)
Definition: mdb.c:976
int find_hosts_by_option(struct host_decl **, struct packet *, struct option_state *, const char *, int)
Definition: mdb.c:660
isc_result_t renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
Renew a lease in the pool.
Definition: mdb6.c:1625
int parse_class_declaration(struct class **, struct parse *, struct group *, int)
Definition: confpars.c:2226
dhcp_failover_listener_t
Definition: dhcpd.h:3762
void if_register_receive(struct interface_info *)
isc_result_t find_class(struct class **, const char *, const char *, int)
Definition: dhclient.c:1527
int bind_ds_value(struct binding_scope **, const char *, struct data_string *)
Definition: tree.c:4080
int append_option(struct data_string *dst, struct universe *universe, struct option *option, struct data_string *src)
Definition: options.c:3041
int parse_auth_key(struct data_string *, struct parse *)
uid_t set_uid
const char * path_dhclient_conf
Definition: dhclient.c:57
int parse_ip_addr_or_hostname(struct expression **, struct parse *, int)
Definition: parse.c:268
void state_bound(void *)
Definition: dhclient.c:2038
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
Definition: dhclient.c:5467
struct name_server * new_name_server(const char *, int)
void if_register6(struct interface_info *info, int do_multicast)
int option_reference(struct option **dest, struct option *src, const char *file, int line)
Definition: tables.c:989
isc_result_t dhcp_failover_send_update_done(dhcp_failover_state_t *)
struct protocol * protocols
void set_option(struct universe *, struct option_state *, struct option_cache *, enum statement_op)
Definition: options.c:2403
void parse_group_declaration(struct parse *, struct group *)
Definition: confpars.c:2977
isc_result_t conf_file_subparse(struct parse *, struct group *, int)
Definition: confpars.c:250
int nowait
Definition: dhclient.c:107
int read_client_conf_file(const char *, struct interface_info *, struct client_config *)
Definition: clparse.c:294
void parse_reject_statement(struct parse *, struct client_config *)
Definition: clparse.c:2275
int evaluate_numeric_expression(unsigned long *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *)
Definition: tree.c:2229
isc_result_t release_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
Definition: mdb6.c:1801
struct option_cache * lookup_option(struct universe *, struct option_state *, unsigned)
Definition: options.c:2503
isc_result_t dhcp_failover_listener_signal(omapi_object_t *, const char *, va_list)
omapi_object_type_t * dhcp_type_subclass
Definition: omapi.c:49
int parse_ip6_addr_expr(struct expression **, struct parse *)
Definition: parse.c:465
int dhclient_interface_shutdown_hook(struct interface_info *)
Definition: dhclient.c:5267
isc_result_t dhcp_subnet_destroy(omapi_object_t *, const char *, int)
Definition: comapi.c:652
isc_result_t dhcp_failover_send_bind_update(dhcp_failover_state_t *, struct lease *)
const char * pdestdesc(struct iaddr)
Definition: inet.c:557
void remove_all_if_routes(struct interface_info *)
void register_eventhandler(struct eventqueue **, void(*handler)(void *))
int bind_local_address6
int write_leases6(void)
void state_stop(void *)
Definition: dhclient.c:2080
isc_result_t dhcp_lease_create(omapi_object_t **, omapi_object_t *)
Definition: omapi.c:914
isc_result_t dhcp_failover_link_initiate(omapi_object_t *)
void commit_leases_timeout(void *)
Definition: db.c:1024
void linked_option_space_foreach(struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *, void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
Definition: options.c:4014
isc_result_t dhcp_shared_network_destroy(omapi_object_t *, const char *, int)
Definition: comapi.c:797
isc_result_t dhcp_group_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: comapi.c:127
int group_dereference(struct group **, const char *, int)
Definition: alloc.c:205
isc_result_t dhcp_group_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: comapi.c:201
isc_result_t dhcp_pool_destroy(omapi_object_t *, const char *, int)
Definition: omapi.c:1654
void dhcp_failover_link_startup_timeout(void *)
isc_result_t dhcp_pool_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1719
isc_result_t dhcp_failover_set_state(dhcp_failover_state_t *, enum failover_state)
isc_result_t dhcp_failover_send_disconnect(omapi_object_t *, int, const char *)
ia_hash_t * ia_pd_active
struct enumeration syslog_enum
Definition: stables.c:448
char * piaddrmask(struct iaddr *, struct iaddr *)
Definition: inet.c:606
int check_collection(struct packet *, struct lease *, struct collection *)
Definition: dhclient.c:1533
void forget_zone(struct dns_zone **)
int executable_statement_foreach(struct executable_statement *, int(*)(struct executable_statement *, void *, int), void *, int)
Definition: execute.c:1120
int dns_host_entry_reference(struct dns_host_entry **, struct dns_host_entry *, const char *, int)
Definition: alloc.c:785
isc_result_t dhcp_group_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:333
int group_reference(struct group **, struct group *, const char *, int)
Definition: alloc.c:177
isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *addr)
Definition: mdb6.c:2291
void report_jumbo_ranges()
Definition: mdb6.c:2739
const char * dhcp_failover_reject_reason_print(int)
const char int line
Definition: dhcpd.h:3793
void dhcp_reply(struct lease *)
Definition: dhcp.c:3924
int is_dns_expression(struct expression *)
void lc_unlink_lease(struct leasechain *lc, struct lease *lp)
int if_register_socket(struct interface_info *, int, int *, struct in6_addr *)
int get_option(struct data_string *, struct universe *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct option_state *, struct binding_scope **, unsigned, const char *, int)
Definition: options.c:2323
unsigned char * parse_numeric_aggregate(struct parse *, unsigned char *, unsigned *, int, int, unsigned)
Definition: parse.c:734
void state_requesting(void *)
struct option_cache * lookup_hashed_option(struct universe *, struct option_state *, unsigned)
Definition: options.c:2518
isc_result_t dhcp_host_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:926
int find_lease_by_ip_addr(struct lease **, struct iaddr, const char *, int)
Definition: mdb.c:2052
void convert_subnet_decl(struct parse *, jrefproto)
void detach(void)
Definition: dhclient.c:5086
int concat_dclists(struct data_string *, struct data_string *, struct data_string *)
Adds two Dc-formatted lists into a single Dc-formatted list.
Definition: tree.c:4177
void dhcp_failover_keepalive(void *)
isc_result_t dhclient_interface_startup_hook(struct interface_info *)
Definition: dhclient.c:5317
int buffer_dereference(struct buffer **, const char *, int)
Definition: alloc.c:726
void parse_ia_ta_declaration(struct parse *)
Definition: confpars.c:5200
int(* group_write_hook)(struct group_object *)
Definition: memory.c:33
void convert_hardware_addr(struct parse *, jrefproto)
int packet6_len_okay(const char *, int)
Definition: options.c:4135
const char * dhcp_failover_state_name_print(enum failover_state)
int wanted_ia_na
Definition: dhclient.c:109
void ia_remove_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
Definition: mdb6.c:476
int lease_enqueue(struct lease *)
Definition: mdb.c:2679
omapi_object_type_t * dhcp_type_interface
Definition: discover.c:83
isc_result_t dhcp_subclass_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:2287
int interface_max
Definition: discover.c:91
u_int32_t host_addr(struct iaddr, struct iaddr)
Definition: inet.c:138
void interface_stash(struct interface_info *)
Definition: discover.c:1531
int parse_if_statement(struct executable_statement **, struct parse *, int *)
Definition: parse.c:3339
failover_option_t * dhcp_failover_option_printf(unsigned, char *, unsigned *, unsigned, const char *,...) __attribute__((__format__(__printf__
void initialize_server_option_spaces(void)
Definition: stables.c:454
isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool, const char *file, int line)
de-reference an IPv6 pool structure.
Definition: mdb6.c:777
void parse_client_lease_declaration(struct parse *, struct client_lease *, struct interface_info **, struct client_state **)
Definition: clparse.c:1258
int executable_statement_dereference(struct executable_statement **, const char *, int)
Definition: execute.c:630
void add_route_default_gateway(struct interface_info *, struct in_addr)
isc_result_t ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
int dhcp_failover_queue_ack(dhcp_failover_state_t *, failover_message_t *msg)
isc_result_t dhcp_host_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: omapi.c:1121
isc_result_t binding_scope_set_value(struct binding_scope *, int, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:2395
void dhcp_failover_pool_rebalance(void *)
int parse_option_buffer(struct option_state *, const unsigned char *, unsigned, struct universe *)
Definition: options.c:119
int write_ia(const struct ia_xx *)
Definition: db.c:518
ssize_t send_packet6(struct interface_info *, const unsigned char *, size_t, struct sockaddr_in6 *)
void parse_address_range6(struct parse *cfile, struct group *group, struct ipv6_pond *)
int fqdn_option_space_encapsulate(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
Definition: options.c:3417
isc_result_t dhcp_pool_signal_handler(omapi_object_t *, const char *, va_list)
Definition: omapi.c:1697
isc_result_t get_hw_addr2(struct interface_info *info)
isc_result_t dhcp_failover_process_bind_ack(dhcp_failover_state_t *, failover_message_t *)
void postdb_startup(void)
Definition: dhcpd.c:1488
struct binding * create_binding(struct binding_scope **, const char *)
Definition: tree.c:4049
void convert_date(struct parse *, jrefproto, char *)
isc_boolean_t server_duid_isset(void)
isc_result_t dhcp_lease_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:563
void write_client_pid_file(void)
Definition: dhclient.c:5128
int write_leases(void)
Definition: mdb.c:2434
isc_result_t dhcp_failover_link_destroy(omapi_object_t *, const char *, int)
void classify_client(struct packet *)
Definition: class.c:55
ssize_t send_fallback(struct interface_info *, struct packet *, struct dhcp_packet *, size_t, struct in_addr, struct sockaddr_in *, struct hardware *)
int free_bindings(struct binding_scope *, const char *, int)
Definition: tree.c:3770
isc_result_t dhcp_failover_link_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
struct client_config top_level_config
Definition: clparse.c:32
int is_numeric_expression(struct expression *)
Definition: tree.c:3078
void set_ip_address(struct interface_info *, struct in_addr)
void release_lease(struct lease *, struct packet *)
Definition: mdb.c:1755
char * ddns_state_name(int state)
void set_multicast_hop_limit(struct interface_info *info, int hop_limit)
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
Definition: mdb6.c:261
struct lease * new_leases(unsigned, const char *, int)
int hashed_option_space_encapsulate(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
Definition: options.c:3249
void ack_lease(struct packet *, struct lease *, unsigned int, TIME, char *, int, struct host_decl *)
Definition: dhcp.c:2201
void state_init(void *)
Definition: dhclient.c:1663
void client_option_envadd(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)
Definition: dhclient.c:4703
isc_boolean_t prefix6_exists(const struct ipv6_pool *pool, const struct in6_addr *pref, u_int8_t plen)
Definition: mdb6.c:1983
void dhcp_failover_listener_restart(void *)
int find_host_for_network(struct subnet **, struct host_decl **, struct iaddr *, struct shared_network *)
Definition: mdb.c:736
void enter_subnet(struct subnet *)
Definition: mdb.c:1008
void finish(char)
Definition: dhclient.c:5075
void build_server_oro(struct data_string *, struct option_state *, const char *, int)
Definition: options.c:2753
void write_billing_classes(void)
Definition: db.c:975
char * piaddrcidr(const struct iaddr *, unsigned int)
Definition: inet.c:637
void skip_to_rbrace(struct parse *, int)
Definition: parse.c:98
isc_result_t dns_zone_lookup(struct dns_zone **, const char *)
Definition: dns.c:665
char * buf_to_hex(const unsigned char *s, unsigned len, const char *file, int line)
Definition: print.c:1372
void dhcp_failover_reconnect(void *)
int executable_statement_reference(struct executable_statement **, struct executable_statement *, const char *, int)
Definition: alloc.c:972
const char * path_dhcpd_pid
Definition: dhcpd.c:103
void remove_if_route(struct interface_info *, struct in_addr)
struct class unknown_class
Definition: dhcpd.c:60
isc_result_t ddns_removals(struct lease *, struct iasubopt *, struct dhcp_ddns_cb *, isc_boolean_t)
isc_result_t readconf(void)
Definition: confpars.c:64
void dhcprequest(struct packet *, int, struct lease *)
Definition: dhcp.c:488
void print_dns_status(int, struct dhcp_ddns_cb *, isc_result_t)
char * absolute_path(const char *orgpath)
Definition: print.c:1453
isc_result_t dhcp_failover_state_transition(dhcp_failover_state_t *, const char *)
int can_unicast_without_arp(struct interface_info *)
void client_dns_update_timeout(void *cp)
const char * print_time(TIME)
Definition: print.c:1312
isc_result_t lease_file_subparse(struct parse *)
Definition: confpars.c:277
int fundef_dereference(struct fundef **, const char *, int)
Definition: tree.c:3829
void convert_option_decl(struct parse *, jrefproto)
int parse_warn(struct parse *, const char *,...) __attribute__((__format__(__printf__
void assemble_ethernet_header(struct interface_info *, unsigned char *, unsigned *, struct hardware *)
void new_address_range(struct parse *, struct iaddr, struct iaddr, struct subnet *, struct pool *, struct lease **)
Definition: mdb.c:782
void failover_print(char *, unsigned *, unsigned, const char *)
isc_result_t dhcp_failover_send_bind_ack(dhcp_failover_state_t *, failover_message_t *, int, const char *)
int make_concat(struct expression **, struct expression *, struct expression *)
Definition: tree.c:268
int option_cache_allocate(struct option_cache **, const char *, int)
Definition: alloc.c:630
isc_result_t read_conf_file(const char *, struct group *, int, int)
Definition: confpars.c:79
isc_result_t cleanup_lease6(ia_hash_t *ia_table, struct ipv6_pool *pool, struct iasubopt *lease, struct ia_xx *ia)
Cleans up leases when reading from a lease file.
Definition: mdb6.c:1306
void expression_dereference(struct expression **, const char *, int)
Definition: tree.c:2813
int dns_host_entry_dereference(struct dns_host_entry **, const char *, int)
Definition: alloc.c:813
int store_option(struct data_string *, struct universe *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct option_cache *)
Definition: options.c:3091
isc_result_t dhcp_class_remove(omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2271
int icmp_readsocket(omapi_object_t *)
Definition: icmp.c:119
isc_result_t dhcp_host_remove(omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1592
int add_option(struct option_state *options, unsigned int option_num, void *data, unsigned int data_len)
Definition: options.c:4480
int get_dhcid(dhcp_ddns_cb_t *, int, const u_int8_t *, unsigned)
isc_result_t client_dns_update(struct client_state *client, dhcp_ddns_cb_t *ddns_cb)
void parse_subnet_declaration(struct parse *, struct shared_network *)
Definition: confpars.c:2763
void write_lease_option(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)
Definition: dhclient.c:4116
struct protocol * new_protocol(const char *, int)
int interface_count
Definition: discover.c:90
isc_result_t dhcp_failover_state_remove(omapi_object_t *, omapi_object_t *)
isc_result_t dhcp_io_shutdown(omapi_object_t *, void *)
Definition: dhcpd.c:1640
int hashed_option_state_dereference(struct universe *, struct option_state *, const char *, int)
Definition: options.c:3003
void parse_pool6_statement(struct parse *, struct group *, int)
void start_init6(struct client_state *client)
int fqdn6_universe_decode(struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *u)
Definition: options.c:3690
void ia_remove_all_lease(struct ia_xx *ia, const char *file, int line)
Definition: mdb6.c:504
binding_state_t conflict_binding_state_transition_check(struct lease *, dhcp_failover_state_t *, binding_state_t, u_int32_t)
void parse_interface_declaration(struct parse *, struct client_config *, char *)
Definition: clparse.c:989
int if_readsocket(omapi_object_t *)
Definition: discover.c:1048
isc_result_t release_leases(struct ia_xx *ia)
Definition: mdb6.c:2360
void if_deregister_receive(struct interface_info *)
isc_result_t add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, time_t valid_lifetime_end_time)
Definition: mdb6.c:1416
const char * binding_state_names[]
Definition: stables.c:161
int permitted(struct packet *, struct permit *)
Definition: dhcp.c:5178
group_hash_t * group_name_hash
Definition: memory.c:32
policy
Definition: dhcpd.h:1223
@ P_DONT
Definition: dhcpd.h:1223
@ P_ACCEPT
Definition: dhcpd.h:1223
@ P_PREFER
Definition: dhcpd.h:1223
@ P_IGNORE
Definition: dhcpd.h:1223
@ P_REQUIRE
Definition: dhcpd.h:1223
void dhcp_failover_timeout(void *)
void parse_string_list(struct parse *, struct string_list **, int)
Definition: clparse.c:2225
int is_compound_expression(struct expression *)
Definition: tree.c:3097
int buffer_allocate(struct buffer **, unsigned, const char *, int)
Definition: alloc.c:679
isc_result_t dhcp_failover_state_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
ssize_t decode_tr_header(struct interface_info *, unsigned char *, unsigned, struct hardware *)
void dhcpv6(struct packet *)
void send_request(void *)
Definition: dhclient.c:3124
dhcp_ddns_cb_t * ddns_cb_alloc(const char *file, int line)
int parse_base64(struct data_string *, struct parse *)
Definition: parse.c:1899
int locate_network(struct packet *)
Definition: dhcp.c:5363
trace_type_t * interface_trace
void parse_failover_state(struct parse *, enum failover_state *, TIME *)
int db_time_format
Definition: print.c:31
int parse_lbrace(struct parse *)
Definition: confparse.c:1269
void delete_option(struct universe *, struct option_state *, int)
Definition: options.c:2906
int store_options(int *ocount, unsigned char *buffer, unsigned buflen, unsigned index, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, unsigned *priority_list, int priority_len, unsigned first_cutoff, int second_cutoff, int terminate, const char *vuname)
Definition: options.c:1236
int evaluate_data_expression(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *, const char *, int)
Definition: tree.c:1126
isc_result_t dhcp_pool_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
Definition: omapi.c:1607
void if_register_fallback(struct interface_info *)
isc_result_t dhcp_failover_listener_stuff(omapi_object_t *, omapi_object_t *, omapi_object_t *)
void lease_ping_timeout(void *)
Definition: dhcpd.c:1555
char * print_dec_1(unsigned long)
Definition: print.c:524
int parse_option_data(struct expression **expr, struct parse *cfile, int lookups, struct option *option)
Definition: parse.c:4812
struct lease_state * new_lease_state(const char *, int)
int find_lease(struct lease **, struct packet *, struct shared_network *, int *, int *, struct lease *, const char *, int)
Definition: dhcp.c:4213
int dns_zone_allocate(struct dns_zone **, const char *, int)
Definition: alloc.c:1134
int ddns_update_style
Definition: dhcpd.c:84
int lease_mine_to_reallocate(struct lease *)
void postconf_initialization(int)
Definition: dhcpd.c:1083
isc_result_t decline_leases(struct ia_xx *ia)
Definition: mdb6.c:2368
void classify(struct packet *, struct class *)
Definition: dhclient.c:1541
ssize_t receive_packet6(struct interface_info *interface, unsigned char *buf, size_t len, struct sockaddr_in6 *from, struct in6_addr *to_addr, unsigned int *if_index)
isc_result_t dhcp_failover_state_signal(omapi_object_t *, const char *, va_list)
int option_dereference(struct option **dest, const char *file, int line)
Definition: tables.c:1011
int fqdn6_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
Definition: options.c:3591
struct universe * new_universe(const char *, int)
void unbill_class(struct lease *)
Definition: dhclient.c:1547
int addr_and(struct iaddr *result, const struct iaddr *a1, const struct iaddr *a2)
Definition: inet.c:267
int dhcp_option_ev_name(char *, size_t, struct option *)
Definition: dhclient.c:5035
const char * dhcp_failover_message_name(unsigned)
int lc_not_empty(struct leasechain *lc)
int append_option_buffer(struct universe *, struct option_state *, struct buffer *, unsigned char *, unsigned, unsigned, int)
Definition: options.c:2569
int parse_option_code_definition(struct parse *, struct option *)
Definition: parse.c:1572
int load_balance_mine(struct packet *, dhcp_failover_state_t *)
isc_result_t ipv6_pool_reference(struct ipv6_pool **pool, struct ipv6_pool *src, const char *file, int line)
reference an IPv6 pool structure.
Definition: mdb6.c:706
int option_state_dereference(struct option_state **, const char *, int)
Definition: alloc.c:911
isc_result_t dhcp_pool_create(omapi_object_t **, omapi_object_t *)
Definition: omapi.c:1777
isc_result_t dhcp_failover_send_poolresp(dhcp_failover_state_t *, int)
void get_server_source_address(struct in_addr *from, struct option_state *options, struct option_state *out_options, struct packet *packet)
Definition: dhcp.c:5487
void set_broadcast_addr(struct interface_info *, struct in_addr)
char * print_hex(unsigned, const u_int8_t *, unsigned, unsigned)
Definition: print.c:456
isc_result_t write_named_billing_class(const void *, unsigned, void *)
Definition: db.c:879
void indent_spaces(FILE *, int)
Definition: print.c:1300
isc_result_t(* dhcp_interface_startup_hook)(struct interface_info *)
Definition: discover.c:54
universe_hash_t * universe_hash
Definition: tables.c:971
struct lease * lc_get_next(struct leasechain *lc, struct lease *lp)
isc_result_t dhcp_failover_link_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
int parse_data_expression(struct expression **, struct parse *, int *)
Definition: parse.c:3542
isc_result_t dhcp_host_destroy(omapi_object_t *, const char *, int)
Definition: omapi.c:1190
void add_enumeration(struct enumeration *)
Definition: parse.c:41
int parse_options(struct packet *)
Definition: options.c:49
void mark_interfaces_unavailable(void)
Definition: mdb6.c:2526
int parse_allow_deny(struct option_cache **, struct parse *, int)
Definition: clparse.c:2339
struct data_string default_duid
Definition: dhclient.c:78
int duid_type
Definition: dhclient.c:79
int db_printable_len(const unsigned char *, unsigned)
void ddns_cb_free(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
ssize_t decode_hw_header(struct interface_info *, unsigned char *, unsigned, struct hardware *)
int parse_non_binary(struct expression **, struct parse *, int *, enum expression_context)
Definition: parse.c:3592
int evaluate_option_cache(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct option_cache *, const char *, int)
Definition: tree.c:2699
omapi_object_type_t * dhcp_type_class
Definition: omapi.c:48
enum dhcp_token peek_token(const char **, unsigned *, struct parse *)
Definition: conflex.c:443
int parse_key(struct parse *)
Definition: parse.c:2996
isc_result_t form_duid(struct data_string *duid, const char *file, int line)
Definition: dhclient.c:4240
void cleanup(void)
isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src, const char *file, int line)
Definition: mdb6.c:377
isc_result_t dhcp_failover_process_update_done(dhcp_failover_state_t *, failover_message_t *)
omapi_object_type_t * dhcp_type_shared_network
int parse_ip_addr(struct parse *, struct iaddr *)
Definition: parse.c:336
void dhcpinform(struct packet *, int)
Definition: dhcp.c:1117
isc_result_t save_parse_state(struct parse *cfile)
Definition: conflex.c:128
int numclasseswritten
Definition: mdb.c:68
void save_fqdn6_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
Definition: options.c:3545
int parse_option_statement(struct executable_statement **, struct parse *, int, struct option *, enum statement_op)
Definition: parse.c:4919
omapi_object_type_t * dhcp_type_failover_link
void parse_vendor_option(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *out_options, struct binding_scope **scope)
Parse a vendor option (option 43)
Definition: options.c:4611
int parse_executable_statement(struct executable_statement **, struct parse *, int *, enum expression_context)
Definition: parse.c:2133
int option_state_allocate(struct option_state **, const char *, int)
Definition: alloc.c:846
const char * path_dhclient_pid
Definition: dhclient.c:59
const char * file
Definition: dhcpd.h:3793
void db_startup(int)
Definition: dhclient.c:2121
isc_result_t dhcp_failover_send_update_request_all(dhcp_failover_state_t *)
int cons_options(struct packet *, struct dhcp_packet *, struct lease *, struct client_state *, int, struct option_state *, struct option_state *, struct binding_scope **, int, int, int, struct data_string *, const char *)
Definition: options.c:538
int get_option_int(int *, struct universe *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct option_state *, struct binding_scope **, unsigned, const char *, int)
Definition: options.c:2358
struct universe dhcpv6_universe
Definition: tables.c:348
int write_expression(FILE *, struct expression *, int, int, int)
Definition: tree.c:3298
int authoring_byte_order
Definition: dhcpd.c:97
void read_client_leases(void)
Definition: clparse.c:369
lease_ip_hash_t * lease_ip_addr_hash
Definition: mdb.c:38
omapi_object_type_t * dhcp_type_host
Definition: mdb.c:70
void make_release(struct client_state *, struct client_lease *)
Definition: dhclient.c:3983
u_int16_t ddns_conflict_mask
isc_result_t dhcp_group_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:301
void print_hex_or_string(unsigned, const u_int8_t *, unsigned, char *)
Definition: print.c:419
int universe_max
Definition: dhcpd.h:2930
isc_result_t dhcp_class_signal_handler(omapi_object_t *, const char *, va_list)
Definition: omapi.c:2100
int save_option_buffer(struct universe *, struct option_state *, struct buffer *, unsigned char *, unsigned, unsigned, int)
Definition: options.c:2545
int evaluate_expression(struct binding_value **, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct expression *, const char *, int)
Definition: tree.c:500
isc_result_t dhcp_control_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: comapi.c:524
isc_result_t dhcp_subclass_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:2334
struct iaddr ip_addr(struct iaddr, struct iaddr, u_int32_t)
Definition: inet.c:63
int option_cache_dereference(struct option_cache **, const char *, int)
Definition: options.c:2953
void save_hashed_option(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t appendp)
Definition: options.c:2839
isc_result_t got_one(omapi_object_t *)
Definition: discover.c:1093
TIME parse_date_core(struct parse *)
Definition: parse.c:978
void script_init(struct client_state *, const char *, struct string_list *)
Initializes basic variables for a script.
Definition: dhclient.c:4670
void free_binding_value(struct binding_value *, const char *, int)
Definition: alloc.c:548
int parse_lease_declaration(struct lease **, struct parse *)
Definition: confpars.c:3141
void parse_pool_statement(struct parse *, struct group *, int)
Parse a pool statement.
Definition: confpars.c:1732
struct class known_class
Definition: dhcpd.c:61
void hw_hash_delete(struct lease *)
Definition: mdb.c:2331
void do_release(struct client_state *)
Definition: dhclient.c:5189
void interface_snorf(struct interface_info *, int)
Definition: discover.c:1574
isc_result_t dhcp_subclass_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: omapi.c:2299
void print_lease(struct lease *)
Definition: print.c:194
isc_result_t restore_parse_state(struct parse *cfile)
Definition: conflex.c:159
isc_result_t dhcp_host_lookup(omapi_object_t **, omapi_object_t *, omapi_object_t *)
Definition: omapi.c:1369
int parse_destination_descriptor(struct parse *, struct iaddr *)
Definition: parse.c:354
void if_register_send(struct interface_info *)
int parse_fixed_addr_param(struct option_cache **, struct parse *, enum dhcp_token)
Definition: confpars.c:3070
int dns_host_entry_allocate(struct dns_host_entry **, const char *, const char *, int)
Definition: alloc.c:768
void parse_option_space_decl(struct parse *)
Definition: parse.c:1349
isc_result_t dhcp_failover_put_message(dhcp_failover_link_t *, omapi_object_t *, int, u_int32_t,...)
void send_discover(void *)
Definition: dhclient.c:2786
isc_result_t interface_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
char * path_dhclient_script
Definition: dhclient.c:61
isc_result_t dhcp_shared_network_get_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_value_t **)
Definition: comapi.c:773
void cancel_timeout(void(*)(void *), void *)
Definition: dispatch.c:390
isc_result_t got_one_v6(omapi_object_t *)
void relinquish_lease_hunks(void)
struct universe ** universes
Definition: tables.c:972
isc_result_t dhcp_failover_process_update_request_all(dhcp_failover_state_t *, failover_message_t *)
void convert_subnet_statement(struct parse *, jrefproto)
const char * binding_state_print(enum failover_state state)
Definition: failover.c:6505
failover_state
Definition: failover.h:288
struct isc_heap isc_heap_t
Definition: heap.h:47
dhcp_token
Definition: dhctoken.h:34
#define DHCP_MAXNS
Definition: isclib.h:115
#define DHCP_MAXDNS_WIRE
Definition: isclib.h:114
void __attribute__((noreturn))
statement_op
Definition: keama.h:161
void lease_insert(struct lease **lq, struct lease *comp)
Definition: mdb.c:2619
void lease_remove_all(struct lease **lq)
Definition: mdb.c:2542
void lease_remove(struct lease **lq, struct lease *comp)
Definition: mdb.c:2581
const char int
Definition: omapip.h:442
#define jrefproto
Definition: osdep.h:203
Definition: tree.h:30
struct agent_options * next
Definition: dhcpd.h:380
int length
Definition: dhcpd.h:381
struct option_tag * first
Definition: dhcpd.h:382
Definition: tree.h:117
Definition: tree.h:60
Definition: dhcpd.h:1098
int leases_consumed
Definition: dhcpd.h:1106
int flags
Definition: dhcpd.h:1135
struct class * nic
Definition: dhcpd.h:1100
struct executable_statement * statements
Definition: dhcpd.h:1128
struct expression * submatch
Definition: dhcpd.h:1122
struct lease ** billed_leases
Definition: dhcpd.h:1107
struct group * group
Definition: dhcpd.h:1125
struct expression * expr
Definition: dhcpd.h:1118
struct class * superclass
Definition: dhcpd.h:1101
class_hash_t * hash
Definition: dhcpd.h:1114
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1099
int spawning
Definition: dhcpd.h:1123
struct data_string hash_string
Definition: dhcpd.h:1115
char * name
Definition: dhcpd.h:1102
int lease_limit
Definition: dhcpd.h:1105
int dirty
Definition: dhcpd.h:1111
TIME initial_interval
Definition: dhcpd.h:1246
TIME select_interval
Definition: dhcpd.h:1252
struct option ** required_options
Definition: dhcpd.h:1238
enum policy bootp_policy
Definition: dhcpd.h:1266
TIME timeout
Definition: dhcpd.h:1241
int bootp_broadcast_always
Definition: dhcpd.h:1287
struct group * on_transmission
Definition: dhcpd.h:1236
char * vendor_space_name
Definition: dhcpd.h:1265
u_int32_t requested_lease
Definition: dhcpd.h:1261
struct iaddrmatchlist * reject_list
Definition: dhcpd.h:1275
char * script_name
Definition: dhcpd.h:1264
struct option ** requested_options
Definition: dhcpd.h:1239
TIME reboot_timeout
Definition: dhcpd.h:1255
int omapi_port
Definition: dhcpd.h:1277
struct string_list * medium
Definition: dhcpd.h:1273
TIME initial_delay
Definition: dhcpd.h:1244
struct string_list * media
Definition: dhcpd.h:1263
TIME backoff_cutoff
Definition: dhcpd.h:1258
enum policy auth_policy
Definition: dhcpd.h:1269
struct group * on_receipt
Definition: dhcpd.h:1231
int lease_id_format
Definition: dhcpd.h:1284
int do_forward_update
Definition: dhcpd.h:1280
TIME retry_interval
Definition: dhcpd.h:1248
unsigned int is_static
Definition: dhcpd.h:1148
struct string_list * medium
Definition: dhcpd.h:1145
TIME renewal
Definition: dhcpd.h:1141
struct iaddr address
Definition: dhcpd.h:1142
char * filename
Definition: dhcpd.h:1144
char * server_name
Definition: dhcpd.h:1143
struct auth_key * key
Definition: dhcpd.h:1146
unsigned int is_bootp
Definition: dhcpd.h:1149
struct client_lease * next
Definition: dhcpd.h:1140
struct iaddr next_srv_addr
Definition: dhcpd.h:1152
struct option_state * options
Definition: dhcpd.h:1151
TIME rebind
Definition: dhcpd.h:1141
TIME expiry
Definition: dhcpd.h:1141
struct client_lease * alias
Definition: dhcpd.h:1312
char * name
Definition: dhcpd.h:1296
struct dhc6_lease * active_lease
Definition: dhcpd.h:1329
struct client_lease * active
Definition: dhcpd.h:1308
int txcount
Definition: dhcpd.h:1337
TIME IRT
Definition: dhcpd.h:1341
void(* v6_handler)(struct packet *, struct client_state *)
Definition: dhcpd.h:1352
struct client_config * config
Definition: dhcpd.h:1299
struct dhc6_lease * advertised_leases
Definition: dhcpd.h:1331
struct dhc6_lease * held_leases
Definition: dhcpd.h:1333
struct client_lease * leases
Definition: dhcpd.h:1311
int envc
Definition: dhcpd.h:1301
enum dhcp_state state
Definition: dhcpd.h:1303
struct dhc6_lease * selected_lease
Definition: dhcpd.h:1332
TIME RT
Definition: dhcpd.h:1340
struct dhcp_ddns_cb * ddns_cb
Definition: dhcpd.h:1360
TIME MRD
Definition: dhcpd.h:1344
struct interface_info * interface
Definition: dhcpd.h:1295
struct iaddr requested_address
Definition: dhcpd.h:1323
enum dhcp_pending pending
Definition: dhcpd.h:1305
struct client_state * next
Definition: dhcpd.h:1294
TIME last_write
Definition: dhcpd.h:1304
struct string_list * env
Definition: dhcpd.h:1300
struct iaddr destination
Definition: dhcpd.h:1314
TIME MRC
Definition: dhcpd.h:1342
u_int16_t elapsed
Definition: dhcpd.h:1336
u_int16_t secs
Definition: dhcpd.h:1316
u_int8_t refresh_type
Definition: dhcpd.h:1327
struct option_state * sent_options
Definition: dhcpd.h:1302
TIME MRT
Definition: dhcpd.h:1343
struct dhc6_lease * old_lease
Definition: dhcpd.h:1330
struct client_lease * offered_leases
Definition: dhcpd.h:1310
struct string_list * medium
Definition: dhcpd.h:1319
u_int32_t xid
Definition: dhcpd.h:1315
TIME next_MRD
Definition: dhcpd.h:1345
unsigned packet_length
Definition: dhcpd.h:1321
unsigned char dhcpv6_transaction_id[3]
Definition: dhcpd.h:1326
TIME interval
Definition: dhcpd.h:1318
TIME first_sending
Definition: dhcpd.h:1317
struct timeval start_time
Definition: dhcpd.h:1335
const char * name
Definition: dhcpd.h:1087
struct class * classes
Definition: dhcpd.h:1088
struct collection * next
Definition: dhcpd.h:1085
u_int8_t * data
Definition: dhcpd.h:281
unsigned length
Definition: dhcpd.h:280
u_int8_t plen
Definition: dhcpd.h:1159
u_int32_t preferred_life
Definition: dhcpd.h:1168
u_int32_t max_life
Definition: dhcpd.h:1169
TIME starts
Definition: dhcpd.h:1167
u_int8_t flags
Definition: dhcpd.h:1165
struct dhc6_addr * next
Definition: dhcpd.h:1157
struct iaddr address
Definition: dhcpd.h:1158
struct option_state * options
Definition: dhcpd.h:1171
struct option_state * options
Definition: dhcpd.h:1184
struct dhc6_ia * next
Definition: dhcpd.h:1175
u_int32_t renew
Definition: dhcpd.h:1180
struct dhc6_addr * addrs
Definition: dhcpd.h:1182
unsigned char iaid[4]
Definition: dhcpd.h:1176
u_int16_t ia_type
Definition: dhcpd.h:1177
TIME starts
Definition: dhcpd.h:1179
u_int32_t rebind
Definition: dhcpd.h:1181
unsigned char dhcpv6_transaction_id[3]
Definition: dhcpd.h:1195
u_int8_t pref
Definition: dhcpd.h:1193
struct dhc6_lease * next
Definition: dhcpd.h:1188
struct dhc6_ia * bindings
Definition: dhcpd.h:1196
isc_boolean_t released
Definition: dhcpd.h:1191
struct data_string server_id
Definition: dhcpd.h:1189
struct option_state * options
Definition: dhcpd.h:1198
int score
Definition: dhcpd.h:1192
control_object_state_t state
Definition: dhcpd.h:533
void * lease
Definition: dhcpd.h:1837
dns_rdataclass_t other_dhcid_class
Definition: dhcpd.h:1844
int state
Definition: dhcpd.h:1831
isc_sockaddr_t zone_addrs[DHCP_MAXNS]
Definition: dhcpd.h:1825
struct data_string fwd_name
Definition: dhcpd.h:1815
int zone_addr_count
Definition: dhcpd.h:1826
TIME timeout
Definition: dhcpd.h:1830
void * transaction
Definition: dhcpd.h:1840
u_int16_t flags
Definition: dhcpd.h:1829
char * lease_tag
Definition: dhcpd.h:1845
struct ia_xx * fixed6_ia
Definition: dhcpd.h:1846
dns_rdataclass_t dhcid_class
Definition: dhcpd.h:1843
struct dns_zone * zone
Definition: dhcpd.h:1827
ddns_action_t cur_func
Definition: dhcpd.h:1832
struct iaddr address
Definition: dhcpd.h:1818
struct data_string rev_name
Definition: dhcpd.h:1816
unsigned char zone_name[DHCP_MAXDNS_WIRE]
Definition: dhcpd.h:1823
unsigned long ttl
Definition: dhcpd.h:1821
struct dhcp_ddns_cb * next_op
Definition: dhcpd.h:1834
isc_sockaddrlist_t zone_server_list
Definition: dhcpd.h:1824
void * dataspace
Definition: dhcpd.h:1841
int address_type
Definition: dhcpd.h:1819
struct data_string dhcid
Definition: dhcpd.h:1817
struct binding_scope ** scope
Definition: dhcpd.h:1838
u_int16_t type
Definition: dhcpd.h:1486
int count
Definition: dhcpd.h:1488
unsigned char * answers[1]
Definition: dhcpd.h:1489
Definition: tree.h:287
struct dns_answer * answer
Definition: dhcpd.h:1502
TIME expiry
Definition: dhcpd.h:1495
int sent
Definition: dhcpd.h:1506
caddr_t waiters
Definition: dhcpd.h:1498
struct name_server * next_server
Definition: dhcpd.h:1509
u_int32_t hash
Definition: dhcpd.h:1494
struct dns_wakeup * wakeups
Definition: dhcpd.h:1507
u_int16_t id
Definition: dhcpd.h:1497
unsigned char * query
Definition: dhcpd.h:1504
struct dns_question * question
Definition: dhcpd.h:1501
int backoff
Definition: dhcpd.h:1510
struct dns_query * next
Definition: dhcpd.h:1493
unsigned len
Definition: dhcpd.h:1505
unsigned char data[1]
Definition: dhcpd.h:1482
u_int16_t type
Definition: dhcpd.h:1480
int dns_update_timeout
Definition: dhcpd.h:1371
struct iaddr address
Definition: dhcpd.h:1370
struct client_state * client
Definition: dhcpd.h:1369
struct dns_wakeup * next
Definition: dhcpd.h:1475
void(* func)(struct dns_query *)
Definition: dhcpd.h:1476
struct option_cache * secondary6
Definition: dhcpd.h:1522
struct auth_key * key
Definition: dhcpd.h:1523
int refcnt
Definition: dhcpd.h:1516
u_int16_t flags
Definition: dhcpd.h:1524
struct option_cache * secondary
Definition: dhcpd.h:1520
struct option_cache * primary
Definition: dhcpd.h:1519
struct option_cache * primary6
Definition: dhcpd.h:1521
char * name
Definition: dhcpd.h:1518
TIME timeout
Definition: dhcpd.h:1517
char * domain
Definition: dhcpd.h:362
struct domain_search_list * next
Definition: dhcpd.h:361
struct client_state * client
Definition: dhcpd.h:1364
const char * prefix
Definition: dhcpd.h:1365
struct eventqueue * next
Definition: dhcpd.h:1461
void(* handler)(void *)
Definition: dhcpd.h:1462
Definition: tree.h:93
struct group_object * n_dynamic
Definition: dhcpd.h:948
char * name
Definition: dhcpd.h:950
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:946
struct group * group
Definition: dhcpd.h:949
int flags
Definition: dhcpd.h:951
Definition: dhcpd.h:958
struct group_object * object
Definition: dhcpd.h:962
int authoritative
Definition: dhcpd.h:965
int refcnt
Definition: dhcpd.h:961
struct shared_network * shared_network
Definition: dhcpd.h:964
struct group * next
Definition: dhcpd.h:959
struct subnet * subnet
Definition: dhcpd.h:963
struct executable_statement * statements
Definition: dhcpd.h:966
u_int8_t hlen
Definition: dhcpd.h:492
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
Definition: dhcpd.h:493
struct iaddrcidrnetlist * fixed_prefix
Definition: dhcpd.h:983
char * name
Definition: dhcpd.h:974
struct option_cache * fixed_addr
Definition: dhcpd.h:982
struct data_string client_identifier
Definition: dhcpd.h:976
struct host_decl * n_dynamic
Definition: dhcpd.h:973
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:971
struct group_object * named_group
Definition: dhcpd.h:985
int relays
Definition: dhcpd.h:994
struct data_string host_id
Definition: dhcpd.h:978
struct option * host_id_option
Definition: dhcpd.h:977
int flags
Definition: dhcpd.h:987
struct group * group
Definition: dhcpd.h:984
struct host_decl * n_ipaddr
Definition: dhcpd.h:972
struct data_string auth_key_id
Definition: dhcpd.h:986
struct hardware interface
Definition: dhcpd.h:975
Definition: dhcpd.h:1676
int refcnt
Definition: dhcpd.h:1677
int num_iasubopt
Definition: dhcpd.h:1680
int max_iasubopt
Definition: dhcpd.h:1681
time_t cltt
Definition: dhcpd.h:1682
struct data_string iaid_duid
Definition: dhcpd.h:1678
struct iasubopt ** iasubopt
Definition: dhcpd.h:1683
u_int16_t ia_type
Definition: dhcpd.h:1679
Definition: inet.h:31
u_int8_t plen
Definition: dhcpd.h:1644
int static_lease
Definition: dhcpd.h:1673
binding_state_t state
Definition: dhcpd.h:1645
int active_index
Definition: dhcpd.h:1660
time_t hard_lifetime_end_time
Definition: dhcpd.h:1647
struct dhcp_ddns_cb * ddns_cb
Definition: dhcpd.h:1669
u_int32_t prefer
Definition: dhcpd.h:1649
int refcnt
Definition: dhcpd.h:1642
int inactive_index
Definition: dhcpd.h:1661
struct in6_addr addr
Definition: dhcpd.h:1643
u_int32_t valid
Definition: dhcpd.h:1650
struct ia_xx * ia
Definition: dhcpd.h:1651
struct binding_scope * scope
Definition: dhcpd.h:1646
struct ipv6_pool * ipv6_pool
Definition: dhcpd.h:1652
time_t soft_lifetime_end_time
Definition: dhcpd.h:1648
int socket
Definition: dhcpd.h:1529
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1528
void(* icmp_handler)(struct iaddr, u_int8_t *, int)
Definition: dhcpd.h:1530
char name[IFNAMSIZ]
Definition: dhcpd.h:1403
struct interface_info * next
Definition: dhcpd.h:1378
struct client_state * client
Definition: dhcpd.h:1427
struct in6_addr * v6addresses
Definition: dhcpd.h:1388
size_t rbuf_len
Definition: dhcpd.h:1412
struct hardware anycast_mac_addr
Definition: dhcpd.h:1433
unsigned circuit_id_len
Definition: dhcpd.h:1397
unsigned remote_id_len
Definition: dhcpd.h:1401
struct ifreq * ifp
Definition: dhcpd.h:1414
int address_count
Definition: dhcpd.h:1386
struct hardware hw_address
Definition: dhcpd.h:1381
struct shared_network * shared_network
Definition: dhcpd.h:1379
int address_max
Definition: dhcpd.h:1387
int configured
Definition: dhcpd.h:1415
unsigned int rbuf_max
Definition: dhcpd.h:1410
u_int32_t flags
Definition: dhcpd.h:1418
unsigned char * rbuf
Definition: dhcpd.h:1409
struct in_addr * addresses
Definition: dhcpd.h:1383
int v6address_count
Definition: dhcpd.h:1390
u_int8_t * remote_id
Definition: dhcpd.h:1399
int v6address_max
Definition: dhcpd.h:1392
size_t rbuf_offset
Definition: dhcpd.h:1411
u_int8_t bcast_addr[20]
Definition: dhcpd.h:1382
u_int8_t * circuit_id
Definition: dhcpd.h:1395
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1377
Definition: ip.h:47
ipv6_pond structure
Definition: dhcpd.h:1740
struct permit * permit_list
Definition: dhcpd.h:1746
struct shared_network * shared_network
Definition: dhcpd.h:1744
isc_uint64_t num_abandoned
Definition: dhcpd.h:1756
int logged
Definition: dhcpd.h:1757
int jumbo_range
Definition: dhcpd.h:1759
struct ipv6_pool ** ipv6_pools
Definition: dhcpd.h:1751
int refcnt
Definition: dhcpd.h:1741
TIME valid_from
Definition: dhcpd.h:1748
isc_uint64_t num_total
Definition: dhcpd.h:1754
struct group * group
Definition: dhcpd.h:1743
isc_uint64_t low_threshold
Definition: dhcpd.h:1758
TIME valid_until
Definition: dhcpd.h:1749
int last_ipv6_pool
Definition: dhcpd.h:1752
isc_uint64_t num_active
Definition: dhcpd.h:1755
struct permit * prohibit_list
Definition: dhcpd.h:1747
struct ipv6_pond * next
Definition: dhcpd.h:1742
ipv6_pool structure
Definition: dhcpd.h:1710
struct in6_addr start_addr
Definition: dhcpd.h:1713
struct subnet * subnet
Definition: dhcpd.h:1725
isc_uint64_t num_active
Definition: dhcpd.h:1717
struct ipv6_pond * ipv6_pond
Definition: dhcpd.h:1726
u_int16_t pool_type
Definition: dhcpd.h:1712
int refcnt
Definition: dhcpd.h:1711
isc_heap_t * inactive_timeouts
Definition: dhcpd.h:1721
int bits
Definition: dhcpd.h:1714
isc_uint64_t num_abandoned
Definition: dhcpd.h:1718
struct shared_network * shared_network
Definition: dhcpd.h:1723
int units
Definition: dhcpd.h:1715
iasubopt_hash_t * leases
Definition: dhcpd.h:1716
isc_heap_t * active_timeouts
Definition: dhcpd.h:1719
int num_inactive
Definition: dhcpd.h:1720
struct interface_info * ip
Definition: dhcpd.h:659
unsigned char rebind[4]
Definition: dhcpd.h:668
struct in_addr giaddr
Definition: dhcpd.h:680
unsigned char renewal[4]
Definition: dhcpd.h:668
struct in_addr ciaddr
Definition: dhcpd.h:678
unsigned char expiry[4]
Definition: dhcpd.h:668
struct packet * packet
Definition: dhcpd.h:661
struct lease_state * next
Definition: dhcpd.h:657
u_int8_t offer
Definition: dhcpd.h:682
struct shared_network * shared_network
Definition: dhcpd.h:672
int got_requested_address
Definition: dhcpd.h:670
u_int32_t xid
Definition: dhcpd.h:675
struct in_addr siaddr
Definition: dhcpd.h:679
struct option_state * options
Definition: dhcpd.h:665
struct iaddr from
Definition: dhcpd.h:683
u_int16_t secs
Definition: dhcpd.h:676
u_int8_t hops
Definition: dhcpd.h:681
int max_message_size
Definition: dhcpd.h:667
int got_server_identifier
Definition: dhcpd.h:671
struct data_string filename server_name
Definition: dhcpd.h:669
struct data_string parameter_request_list
Definition: dhcpd.h:666
TIME offered_expiry
Definition: dhcpd.h:663
u_int16_t bootp_flags
Definition: dhcpd.h:677
Definition: dhcpd.h:560
TIME atsfp
Definition: dhcpd.h:639
TIME ends
Definition: dhcpd.h:570
binding_state_t next_binding_state
Definition: dhcpd.h:624
struct lease_state * state
Definition: dhcpd.h:628
struct pool * pool
Definition: dhcpd.h:578
u_int8_t flags
Definition: dhcpd.h:591
struct lease * n_uid
Definition: dhcpd.h:567
TIME starts
Definition: dhcpd.h:570
struct dhcp_ddns_cb * ddns_cb
Definition: dhcpd.h:650
struct binding_scope * scope
Definition: dhcpd.h:575
char * client_hostname
Definition: dhcpd.h:574
unsigned short cannot_reuse
Definition: dhcpd.h:653
struct iaddr ip_addr
Definition: dhcpd.h:569
struct hardware hardware_addr
Definition: dhcpd.h:589
TIME sort_time
Definition: dhcpd.h:570
binding_state_t rewind_binding_state
Definition: dhcpd.h:626
unsigned char * uid
Definition: dhcpd.h:585
struct lease * next_pending
Definition: dhcpd.h:642
TIME tstp
Definition: dhcpd.h:637
binding_state_t desired_binding_state
Definition: dhcpd.h:625
u_int32_t last_xid
Definition: dhcpd.h:641
long int sort_tiebreaker
Definition: dhcpd.h:572
TIME tsfp
Definition: dhcpd.h:638
struct option_chain_head * agent_options
Definition: dhcpd.h:580
struct leasechain * lc
Definition: dhcpd.h:565
struct lease * next
Definition: dhcpd.h:562
struct subnet * subnet
Definition: dhcpd.h:577
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:561
struct lease * prev
Definition: dhcpd.h:564
unsigned char uid_buf[7]
Definition: dhcpd.h:588
struct class * billing_class
Definition: dhcpd.h:579
struct host_decl * host
Definition: dhcpd.h:576
unsigned short uid_max
Definition: dhcpd.h:587
binding_state_t binding_state
Definition: dhcpd.h:623
struct lease * n_hw
Definition: dhcpd.h:567
unsigned short uid_len
Definition: dhcpd.h:586
TIME cltt
Definition: dhcpd.h:640
size_t nelem
Definition: dhcpd.h:1018
size_t growth
Definition: dhcpd.h:1019
size_t total
Definition: dhcpd.h:1016
struct lease ** list
Definition: dhcpd.h:1015
struct leasequeue * next
Definition: dhcpd.h:1444
struct lease * lease
Definition: dhcpd.h:1445
struct leasequeue * prev
Definition: dhcpd.h:1443
TIME rcdate
Definition: dhcpd.h:356
struct name_server * next
Definition: dhcpd.h:354
struct sockaddr_in addr
Definition: dhcpd.h:355
Definition: dhcpd.h:553
struct executable_statement * on_commit
Definition: dhcpd.h:555
struct executable_statement * on_expiry
Definition: dhcpd.h:554
struct executable_statement * on_release
Definition: dhcpd.h:556
struct data_string data
Definition: dhcpd.h:390
struct option * option
Definition: dhcpd.h:389
struct option_cache * next
Definition: dhcpd.h:387
u_int32_t flags
Definition: dhcpd.h:393
int refcnt
Definition: dhcpd.h:386
struct expression * expression
Definition: dhcpd.h:388
int universe_count
Definition: dhcpd.h:398
void * universes[1]
Definition: dhcpd.h:401
int refcnt
Definition: dhcpd.h:397
int site_code_min
Definition: dhcpd.h:400
int site_universe
Definition: dhcpd.h:399
u_int8_t data[1]
Definition: dhcpd.h:372
struct option_tag * next
Definition: dhcpd.h:371
Definition: tree.h:345
Definition: dhcpd.h:405
struct hardware * haddr
Definition: dhcpd.h:435
isc_boolean_t agent_options_stashed
Definition: dhcpd.h:464
struct in6_addr dhcpv6_link_address
Definition: dhcpd.h:418
struct packet * dhcpv6_container_packet
Definition: dhcpd.h:422
struct shared_network * shared_network
Definition: dhcpd.h:448
int client_port
Definition: dhcpd.h:431
struct dhcp_packet * raw
Definition: dhcpd.h:406
unsigned char dhcp4o6_flags[3]
Definition: dhcpd.h:425
unsigned char dhcpv6_msg_type
Definition: dhcpd.h:411
int got_requested_address
Definition: dhcpd.h:445
int sv_echo_client_id
Definition: dhcpd.h:474
isc_boolean_t unicast
Definition: dhcpd.h:470
int remote_id_len
Definition: dhcpd.h:443
unsigned char dhcpv6_hop_count
Definition: dhcpd.h:417
struct interface_info * interface
Definition: dhcpd.h:433
isc_boolean_t relay_source_port
Definition: dhcpd.h:477
struct in6_addr dhcpv6_peer_address
Definition: dhcpd.h:419
int known
Definition: dhcpd.h:457
int circuit_id_len
Definition: dhcpd.h:441
int class_count
Definition: dhcpd.h:454
struct option_state * options
Definition: dhcpd.h:449
unsigned packet_length
Definition: dhcpd.h:408
int refcnt
Definition: dhcpd.h:407
struct data_string * dhcp4o6_response
Definition: dhcpd.h:428
u_int8_t * circuit_id
Definition: dhcpd.h:440
int options_valid
Definition: dhcpd.h:430
unsigned char dhcpv6_transaction_id[3]
Definition: dhcpd.h:414
int packet_type
Definition: dhcpd.h:409
u_int8_t * remote_id
Definition: dhcpd.h:442
int authenticated
Definition: dhcpd.h:458
struct class * classes[PACKET_MAX_CLASSES]
Definition: dhcpd.h:455
struct iaddr client_addr
Definition: dhcpd.h:432
Definition: dhcpd.h:288
int ugflag
Definition: dhcpd.h:321
size_t buflen
Definition: dhcpd.h:329
int lexline
Definition: dhcpd.h:289
char line1[81]
Definition: dhcpd.h:314
int tlen
Definition: dhcpd.h:323
int warnings_occurred
Definition: dhcpd.h:326
int line
Definition: dhcpd.h:317
enum dhcp_token token
Definition: dhcpd.h:320
char * token_line
Definition: dhcpd.h:291
size_t bufsiz
Definition: dhcpd.h:330
int tlpos
Definition: dhcpd.h:318
const char * tlname
Definition: dhcpd.h:294
size_t bufix
Definition: dhcpd.h:329
int tline
Definition: dhcpd.h:319
struct parse * saved_state
Definition: dhcpd.h:332
char tokbuf[1500]
Definition: dhcpd.h:324
int file
Definition: dhcpd.h:327
char * prev_line
Definition: dhcpd.h:292
char * tval
Definition: dhcpd.h:322
int lexchar
Definition: dhcpd.h:290
int eol_token
Definition: dhcpd.h:295
char * inbuf
Definition: dhcpd.h:328
char * cur_line
Definition: dhcpd.h:293
int lpos
Definition: dhcpd.h:316
char line2[81]
Definition: dhcpd.h:315
Definition: dhcpd.h:997
@ permit_known_clients
Definition: dhcpd.h:1001
@ permit_dynamic_bootp_clients
Definition: dhcpd.h:1005
@ permit_class
Definition: dhcpd.h:1006
@ permit_after
Definition: dhcpd.h:1007
@ permit_unknown_clients
Definition: dhcpd.h:1000
@ permit_authenticated_clients
Definition: dhcpd.h:1002
@ permit_all_clients
Definition: dhcpd.h:1004
@ permit_unauthenticated_clients
Definition: dhcpd.h:1003
TIME after
Definition: dhcpd.h:1010
struct permit * next
Definition: dhcpd.h:998
enum permit::@0 type
Definition: dhcpd.h:1025
struct permit * prohibit_list
Definition: dhcpd.h:1031
struct group * group
Definition: dhcpd.h:1028
LEASE_STRUCT expired
Definition: dhcpd.h:1033
struct permit * permit_list
Definition: dhcpd.h:1030
TIME next_event_time
Definition: dhcpd.h:1038
int free_leases
Definition: dhcpd.h:1040
int backup_leases
Definition: dhcpd.h:1041
dhcp_failover_state_t * failover_peer
Definition: dhcpd.h:1047
int index
Definition: dhcpd.h:1042
struct pool * next
Definition: dhcpd.h:1027
int lease_count
Definition: dhcpd.h:1039
LEASE_STRUCT free
Definition: dhcpd.h:1034
int low_threshold
Definition: dhcpd.h:1050
int logged
Definition: dhcpd.h:1049
LEASE_STRUCT abandoned
Definition: dhcpd.h:1036
LEASE_STRUCT reserved
Definition: dhcpd.h:1037
TIME valid_from
Definition: dhcpd.h:1043
TIME valid_until
Definition: dhcpd.h:1044
LEASE_STRUCT active
Definition: dhcpd.h:1032
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1026
LEASE_STRUCT backup
Definition: dhcpd.h:1035
struct shared_network * shared_network
Definition: dhcpd.h:1029
struct protocol * next
Definition: dhcpd.h:1466
void(* handler)(struct protocol *)
Definition: dhcpd.h:1468
void * local
Definition: dhcpd.h:1469
int fd
Definition: dhcpd.h:1467
struct shared_network * next
Definition: dhcpd.h:1055
struct group * group
Definition: dhcpd.h:1065
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1054
struct ipv6_pond * ipv6_pond
Definition: dhcpd.h:1064
struct subnet * subnets
Definition: dhcpd.h:1061
struct interface_info * interface
Definition: dhcpd.h:1062
char * name
Definition: dhcpd.h:1056
struct pool * pools
Definition: dhcpd.h:1063
dhcp_failover_state_t * failover_peer
Definition: dhcpd.h:1067
struct string_list * next
Definition: dhcpd.h:348
Definition: dhcpd.h:1071
int prefix_len
Definition: dhcpd.h:1080
OMAPI_OBJECT_PREAMBLE
Definition: dhcpd.h:1072
struct subnet * next_subnet
Definition: dhcpd.h:1073
struct group * group
Definition: dhcpd.h:1081
struct iaddr netmask
Definition: dhcpd.h:1079
struct iaddr net
Definition: dhcpd.h:1078
struct interface_info * interface
Definition: dhcpd.h:1076
struct subnet * next_sibling
Definition: dhcpd.h:1074
struct shared_network * shared_network
Definition: dhcpd.h:1075
struct iaddr interface_address
Definition: dhcpd.h:1077
void(* func)(void *)
Definition: dhcpd.h:1453
tvunref_t unref
Definition: dhcpd.h:1456
tvref_t ref
Definition: dhcpd.h:1455
void * what
Definition: dhcpd.h:1454
struct timeout * next
Definition: dhcpd.h:1451
isc_timer_t * isc_timeout
Definition: dhcpd.h:1457
struct timeval when
Definition: dhcpd.h:1452
Definition: tree.h:301
char * default_option_format
Definition: tables.c:985
expression_context
Definition: tree.h:83
expr_op
Definition: tree.h:131