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