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