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