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