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