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