Home | History | Annotate | Line # | Download | only in includes
      1  1.2  christos /*	$NetBSD: site.h,v 1.3 2022/04/03 01:10:58 christos Exp $	*/
      2  1.1  christos 
      3  1.1  christos /* Site-specific definitions.
      4  1.1  christos 
      5  1.1  christos    For supported systems, you shouldn't need to make any changes here.
      6  1.1  christos    However, you may want to, in order to deal with site-specific
      7  1.1  christos    differences. */
      8  1.1  christos 
      9  1.1  christos /* Add any site-specific definitions and inclusions here... */
     10  1.1  christos 
     11  1.1  christos /* #include <site-foo-bar.h> */
     12  1.1  christos /* #define SITE_FOOBAR */
     13  1.1  christos 
     14  1.1  christos /* Define this if you don't want dhcpd to run as a daemon and do want
     15  1.1  christos    to see all its output printed to stdout instead of being logged via
     16  1.1  christos    syslog().   This also makes dhcpd use the dhcpd.conf in its working
     17  1.1  christos    directory and write the dhcpd.leases file there. */
     18  1.1  christos 
     19  1.1  christos /* #define DEBUG */
     20  1.1  christos 
     21  1.1  christos /* Define this to see what the parser is parsing.   You probably don't
     22  1.1  christos    want to see this. */
     23  1.1  christos 
     24  1.1  christos /* #define DEBUG_TOKENS */
     25  1.1  christos 
     26  1.1  christos /* Define this to see dumps of incoming and outgoing packets.    This
     27  1.1  christos    slows things down quite a bit... */
     28  1.1  christos 
     29  1.1  christos /* #define DEBUG_PACKET */
     30  1.1  christos 
     31  1.1  christos /* Define this if you want to see dumps of expression evaluation. */
     32  1.1  christos 
     33  1.1  christos /* #define DEBUG_EXPRESSIONS */
     34  1.1  christos 
     35  1.1  christos /* Define this if you want to see dumps of find_lease() in action. */
     36  1.1  christos 
     37  1.1  christos /* #define DEBUG_FIND_LEASE */
     38  1.1  christos 
     39  1.1  christos /* Define this if you want to see dumps of parsed expressions. */
     40  1.1  christos 
     41  1.1  christos /* #define DEBUG_EXPRESSION_PARSE */
     42  1.1  christos 
     43  1.1  christos /* Define this if you want to watch the class matching process. */
     44  1.1  christos 
     45  1.1  christos /* #define DEBUG_CLASS_MATCHING */
     46  1.1  christos 
     47  1.1  christos /* Define this if you want to track memory usage for the purpose of
     48  1.1  christos    noticing memory leaks quickly. */
     49  1.1  christos 
     50  1.1  christos /* #define DEBUG_MEMORY_LEAKAGE */
     51  1.1  christos /* #define DEBUG_MEMORY_LEAKAGE_ON_EXIT */
     52  1.1  christos 
     53  1.1  christos /* Define this if you want exhaustive (and very slow) checking of the
     54  1.1  christos    malloc pool for corruption. */
     55  1.1  christos 
     56  1.1  christos /* #define DEBUG_MALLOC_POOL */
     57  1.1  christos 
     58  1.1  christos /* Define this if you want to see a message every time a lease's state
     59  1.1  christos    changes. */
     60  1.1  christos /* #define DEBUG_LEASE_STATE_TRANSITIONS */
     61  1.1  christos 
     62  1.1  christos /* Define this if you want to maintain a history of the last N operations
     63  1.1  christos    that changed reference counts on objects.   This can be used to debug
     64  1.1  christos    cases where an object is dereferenced too often, or not often enough. */
     65  1.1  christos 
     66  1.1  christos /* #define DEBUG_RC_HISTORY */
     67  1.1  christos 
     68  1.1  christos /* Define this if you want to see the history every cycle. */
     69  1.1  christos 
     70  1.1  christos /* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
     71  1.1  christos 
     72  1.1  christos /* This is the number of history entries to maintain - by default, 256. */
     73  1.1  christos 
     74  1.1  christos /* #define RC_HISTORY_MAX 10240 */
     75  1.1  christos 
     76  1.1  christos /* Define this if you want dhcpd to dump core when a non-fatal memory
     77  1.1  christos    allocation error is detected (i.e., something that would cause a
     78  1.1  christos    memory leak rather than a memory smash). */
     79  1.1  christos 
     80  1.1  christos /* #define POINTER_DEBUG */
     81  1.1  christos 
     82  1.1  christos /* Define this if you want debugging output for DHCP failover protocol
     83  1.1  christos    messages. */
     84  1.1  christos 
     85  1.1  christos /* #define DEBUG_FAILOVER_MESSAGES */
     86  1.1  christos 
     87  1.1  christos /* Define this to include contact messages in failover message debugging.
     88  1.1  christos    The contact messages are sent once per second, so this can generate a
     89  1.1  christos    lot of log entries. */
     90  1.1  christos 
     91  1.1  christos /* #define DEBUG_FAILOVER_CONTACT_MESSAGES */
     92  1.1  christos 
     93  1.1  christos /* Define this if you want debugging output for DHCP failover protocol
     94  1.1  christos    event timeout timing. */
     95  1.1  christos 
     96  1.1  christos /* #define DEBUG_FAILOVER_TIMING */
     97  1.1  christos 
     98  1.1  christos /* Define this if you want to include contact message timing, which is
     99  1.1  christos    performed once per second and can generate a lot of log entries. */
    100  1.1  christos 
    101  1.1  christos /* #define DEBUG_FAILOVER_CONTACT_TIMING */
    102  1.1  christos 
    103  1.1  christos /* Define this if you want all leases written to the lease file, even if
    104  1.1  christos    they are free leases that have never been used. */
    105  1.1  christos 
    106  1.1  christos /* #define DEBUG_DUMP_ALL_LEASES */
    107  1.1  christos 
    108  1.1  christos /* Define this if you want to see the requests and replies between the
    109  1.1  christos    DHCP code and the DNS library code. */
    110  1.1  christos /* #define DEBUG_DNS_UPDATES */
    111  1.1  christos 
    112  1.1  christos /* Define this if you want to debug the host part of the inform processing */
    113  1.1  christos /* #define DEBUG_INFORM_HOST */
    114  1.1  christos 
    115  1.1  christos /* Define this if you want to debug the binary leases (lease_chain) code */
    116  1.1  christos /* #define DEBUG_BINARY_LEASES */
    117  1.1  christos 
    118  1.1  christos /* Define this if you want to debug checksum calculations */
    119  1.1  christos /* #define DEBUG_CHECKSUM */
    120  1.1  christos 
    121  1.1  christos /* Define this if you want to verbosely debug checksum calculations */
    122  1.1  christos /* #define DEBUG_CHECKSUM_VERBOSE */
    123  1.1  christos 
    124  1.1  christos 
    125  1.1  christos /* Define this if you want DHCP failover protocol support in the DHCP
    126  1.1  christos    server. */
    127  1.1  christos 
    128  1.1  christos /* #define FAILOVER_PROTOCOL */
    129  1.1  christos 
    130  1.1  christos /* Define this if you want DNS update functionality to be available. */
    131  1.1  christos 
    132  1.1  christos #define NSUPDATE
    133  1.1  christos 
    134  1.1  christos /* Define this if you want to enable the DHCP server attempting to
    135  1.1  christos    find a nameserver to use for DDNS updates. */
    136  1.1  christos #define DNS_ZONE_LOOKUP
    137  1.1  christos 
    138  1.1  christos /* Define this if you want the dhcpd.pid file to go somewhere other than
    139  1.1  christos    the default (which varies from system to system, but is usually either
    140  1.1  christos    /etc or /var/run. */
    141  1.1  christos 
    142  1.1  christos /* #define _PATH_DHCPD_PID	"/var/run/dhcpd.pid" */
    143  1.1  christos 
    144  1.1  christos /* Define this if you want the dhcpd.leases file (the dynamic lease database)
    145  1.1  christos    to go somewhere other than the default location, which is normally
    146  1.1  christos    /etc/dhcpd.leases. */
    147  1.1  christos 
    148  1.1  christos /* #define _PATH_DHCPD_DB	"/etc/dhcpd.leases" */
    149  1.1  christos 
    150  1.1  christos /* Define this if you want the dhcpd.conf file to go somewhere other than
    151  1.1  christos    the default location.   By default, it goes in /etc/dhcpd.conf. */
    152  1.1  christos 
    153  1.1  christos /* #define _PATH_DHCPD_CONF	"/etc/dhcpd.conf" */
    154  1.1  christos 
    155  1.1  christos /* Network API definitions.   You do not need to choose one of these - if
    156  1.1  christos    you don't choose, one will be chosen for you in your system's config
    157  1.1  christos    header.    DON'T MESS WITH THIS UNLESS YOU KNOW WHAT YOU'RE DOING!!! */
    158  1.1  christos 
    159  1.1  christos /* Define USE_SOCKETS to use the standard BSD socket API.
    160  1.1  christos 
    161  1.1  christos    On many systems, the BSD socket API does not provide the ability to
    162  1.1  christos    send packets to the 255.255.255.255 broadcast address, which can
    163  1.1  christos    prevent some clients (e.g., Win95) from seeing replies.   This is
    164  1.1  christos    not a problem on Solaris.
    165  1.1  christos 
    166  1.1  christos    In addition, the BSD socket API will not work when more than one
    167  1.1  christos    network interface is configured on the server.
    168  1.1  christos 
    169  1.1  christos    However, the BSD socket API is about as efficient as you can get, so if
    170  1.1  christos    the aforementioned problems do not matter to you, or if no other
    171  1.1  christos    API is supported for your system, you may want to go with it. */
    172  1.1  christos 
    173  1.1  christos /* #define USE_SOCKETS */
    174  1.1  christos 
    175  1.1  christos /* Define this to use the Sun Streams NIT API.
    176  1.1  christos 
    177  1.1  christos    The Sun Streams NIT API is only supported on SunOS 4.x releases. */
    178  1.1  christos 
    179  1.1  christos /* #define USE_NIT */
    180  1.1  christos 
    181  1.1  christos /* Define this to use the Berkeley Packet Filter API.
    182  1.1  christos 
    183  1.1  christos    The BPF API is available on all 4.4-BSD derivatives, including
    184  1.1  christos    NetBSD, FreeBSD and BSDI's BSD/OS.   It's also available on
    185  1.1  christos    DEC Alpha OSF/1 in a compatibility mode supported by the Alpha OSF/1
    186  1.1  christos    packetfilter interface. */
    187  1.1  christos 
    188  1.1  christos /* #define USE_BPF */
    189  1.1  christos 
    190  1.1  christos /* Define this to use the raw socket API.
    191  1.1  christos 
    192  1.1  christos    The raw socket API is provided on many BSD derivatives, and provides
    193  1.1  christos    a way to send out raw IP packets.   It is only supported for sending
    194  1.1  christos    packets - packets must be received with the regular socket API.
    195  1.1  christos    This code is experimental - I've never gotten it to actually transmit
    196  1.1  christos    a packet to the 255.255.255.255 broadcast address - so use it at your
    197  1.1  christos    own risk. */
    198  1.1  christos 
    199  1.1  christos /* #define USE_RAW_SOCKETS */
    200  1.1  christos 
    201  1.1  christos /* Define this to keep the old program name (e.g., "dhcpd" for
    202  1.1  christos    the DHCP server) in place of the (base) name the program was
    203  1.1  christos    invoked with. */
    204  1.1  christos 
    205  1.1  christos /* #define OLD_LOG_NAME */
    206  1.1  christos 
    207  1.1  christos /* Define this to change the logging facility used by dhcpd. */
    208  1.1  christos 
    209  1.1  christos /* #define DHCPD_LOG_FACILITY LOG_DAEMON */
    210  1.1  christos 
    211  1.1  christos 
    212  1.1  christos /* Define this if you want to be able to execute external commands
    213  1.1  christos    during conditional evaluation. */
    214  1.1  christos 
    215  1.1  christos /* #define ENABLE_EXECUTE */
    216  1.1  christos 
    217  1.1  christos /* Define this if you aren't debugging and you want to save memory
    218  1.1  christos    (potentially a _lot_ of memory) by allocating leases in chunks rather
    219  1.1  christos    than one at a time. */
    220  1.1  christos 
    221  1.1  christos #define COMPACT_LEASES
    222  1.1  christos 
    223  1.1  christos /* Define this if you want to be able to save and playback server operational
    224  1.1  christos    traces. */
    225  1.1  christos 
    226  1.1  christos /* #define TRACING */
    227  1.1  christos 
    228  1.1  christos /* Define this if you want the server to use the previous behavior
    229  1.1  christos    when determining the DDNS TTL.  If the user has specified a ddns-ttl
    230  1.1  christos    option that is used to detemine the ttl.  (If the user specifies
    231  1.1  christos    an option that references the lease structure it is only usable
    232  1.1  christos    for v4.  In that case v6 will use the default.) Otherwise when
    233  1.1  christos    defined the defaults are: v4 - 1/2 the lease time,
    234  1.1  christos    v6 - DEFAULT_DDNS_TTL.  When undefined the defaults are 1/2 the
    235  1.1  christos    (preferred) lease time for both but with a cap on the maximum. */
    236  1.1  christos 
    237  1.1  christos /* #define USE_OLD_DDNS_TTL */
    238  1.1  christos 
    239  1.1  christos /* Define this if you want a DHCPv6 server to send replies to the
    240  1.1  christos    source port of the message it received.  This is useful for testing
    241  1.1  christos    but is only included for backwards compatibility. */
    242  1.1  christos /* #define REPLY_TO_SOURCE_PORT */
    243  1.1  christos 
    244  1.1  christos /* Define this if you want to enable strict checks in DNS Updates mechanism.
    245  1.1  christos    Do not enable this unless are DHCP developer. */
    246  1.1  christos /* #define DNS_UPDATES_MEMORY_CHECKS */
    247  1.1  christos 
    248  1.1  christos /* Define this if you want to allow domain list in domain-name option.
    249  1.1  christos    RFC2132 does not allow that behavior, but it is somewhat used due
    250  1.1  christos    to historic reasons. Note that it may be removed some time in the
    251  1.1  christos    future. */
    252  1.1  christos 
    253  1.1  christos #define ACCEPT_LIST_IN_DOMAIN_NAME
    254  1.1  christos 
    255  1.1  christos /* In previous versions of the code when the server generates a NAK
    256  1.1  christos    it doesn't attempt to determine if the configuration included a
    257  1.1  christos    server ID for that client.  Defining this option causes the server
    258  1.1  christos    to make a modest effort to determine the server id when building
    259  1.1  christos    a NAK as a response.  This effort will only check the first subnet
    260  1.1  christos    and pool associated with a shared subnet and will not check for
    261  1.1  christos    host declarations.  With some configurations the server id
    262  1.1  christos    computed for a NAK may not match that computed for an ACK. */
    263  1.1  christos 
    264  1.1  christos #define SERVER_ID_FOR_NAK
    265  1.1  christos 
    266  1.1  christos /* NOTE:  SERVER_ID_CHECK switch has been removed. Enabling server id
    267  1.1  christos  * checking is now done via the server-id-check statement. Please refer
    268  1.1  christos  * to the dhcpd manpage (server/dhcpd.conf.5) */
    269  1.1  christos 
    270  1.1  christos /* Include code to do a slow transition of DDNS records
    271  1.1  christos    from the interim to the standard version, or backwards.
    272  1.1  christos    The normal code will handle removing an old style record
    273  1.1  christos    when the name on a lease is being changed.  This adds code
    274  1.1  christos    to handle the case where the name isn't being changed but
    275  1.1  christos    the old record should be removed to allow a new record to
    276  1.1  christos    be added.  This is the slow transition as leases are only
    277  1.1  christos    updated as a client touches them.  A fast transition would
    278  1.1  christos    entail updating all the records at once, probably at start
    279  1.1  christos    up. */
    280  1.1  christos #define DDNS_UPDATE_SLOW_TRANSITION
    281  1.1  christos 
    282  1.1  christos /* Define the default prefix length passed from the client to
    283  1.1  christos    the script when modifying an IPv6 IA_NA or IA_TA address.
    284  1.1  christos    The two most useful values are 128 which is what the current
    285  1.1  christos    specifications call for or 64 which is what has been used in
    286  1.1  christos    the past.  For most OSes 128 will indicate that the address
    287  1.1  christos    is a host address and doesn't include any on-link information.
    288  1.1  christos    64 indicates that the first 64 bits are the subnet or on-link
    289  1.1  christos    prefix. */
    290  1.1  christos #define DHCLIENT_DEFAULT_PREFIX_LEN 128
    291  1.1  christos 
    292  1.1  christos /* Enable the gentle shutdown signal handling.  Currently this
    293  1.1  christos    means that on SIGINT or SIGTERM a client will release its
    294  1.1  christos    address and a server in a failover pair will go through
    295  1.1  christos    partner down.  Both of which can be undesireable in some
    296  1.1  christos    situations.  We plan to revisit this feature and may
    297  1.1  christos    make non-backwards compatible changes including the
    298  1.1  christos    removal of this define.  Use at your own risk.  */
    299  1.1  christos /* #define ENABLE_GENTLE_SHUTDOWN */
    300  1.1  christos 
    301  1.1  christos /* Include old error codes.  This is provided in case you
    302  1.1  christos    are building an external program similar to omshell for
    303  1.1  christos    which you need the ISC_R_* error codes.  You should switch
    304  1.1  christos    to DHCP_R_* error codes for those that have been defined
    305  1.1  christos    (see includes/omapip/result.h).  The extra defines and
    306  1.1  christos    this option will be removed at some time. */
    307  1.1  christos /* #define INCLUDE_OLD_DHCP_ISC_ERROR_CODES */
    308  1.1  christos 
    309  1.1  christos /* Use the older factors for scoring a lease in the v6 client code.
    310  1.1  christos    The new factors cause the client to choose more bindings (IAs)
    311  1.1  christos    over more addresse within a binding.  Most uses will get a
    312  1.1  christos    single address in a single binding and only get an adverstise
    313  1.1  christos    from a single server and there won't be a difference. */
    314  1.1  christos /* #define USE_ORIGINAL_CLIENT_LEASE_WEIGHTS */
    315  1.1  christos 
    316  1.1  christos /* Print out specific error messages for dhclient, dhcpd
    317  1.1  christos    or dhcrelay when processing an incorrect command line.  This
    318  1.1  christos    is included for those that might require the exact error
    319  1.1  christos    messages, as we don't expect that is necessary it is on by
    320  1.1  christos    default. */
    321  1.1  christos #define PRINT_SPECIFIC_CL_ERRORS
    322  1.1  christos 
    323  1.1  christos /* Limit the value of a file descriptor the serve will use
    324  1.1  christos    when accepting a connecting request.  This can be used to
    325  1.1  christos    limit the number of TCP connections that the server will
    326  1.1  christos    allow at one time.  A value of 0 means there is no limit.*/
    327  1.1  christos #define MAX_FD_VALUE 200
    328  1.1  christos 
    329  1.1  christos /* Enable EUI-64 Address assignment policy.  Instructs the server
    330  1.1  christos  * to use EUI-64 addressing instead of dynamic address allocation
    331  1.1  christos  * for IA_NA pools, if the parameter use-eui-64 is true for the
    332  1.1  christos  * pool.  Can be at all scopes down to the pool level.  Not
    333  1.1  christos  * supported by the configure script. */
    334  1.1  christos /* #define EUI_64 */
    335  1.1  christos 
    336  1.1  christos /* Enable enforcement of the require option statement as documented
    337  1.1  christos  * in man page.  Instructs the dhclient, when in -6 mode, to discard
    338  1.1  christos  * offered leases that do not contain all options specified as required
    339  1.1  christos  * in the client's configuration file. The client already enforces this
    340  1.1  christos  * in -4 mode. */
    341  1.1  christos #define ENFORCE_DHCPV6_CLIENT_REQUIRE
    342  1.1  christos 
    343  1.1  christos /* Enable the invocation of the client script with a FAIL state code
    344  1.1  christos  * by dhclient when running in one-try mode (-T) and the attempt to
    345  1.1  christos  * obtain the desired lease(s) fails. Applies to IPv4 mode only. */
    346  1.1  christos /* #define CALL_SCRIPT_ON_ONETRY_FAIL */
    347  1.1  christos 
    348  1.1  christos /* Include definitions for various options.  In general these
    349  1.1  christos    should be left as is, but if you have already defined one
    350  1.1  christos    of these and prefer your definition you can comment the
    351  1.1  christos    RFC define out to avoid conflicts */
    352  1.1  christos #define RFC2563_OPTIONS
    353  1.1  christos #define RFC2937_OPTIONS
    354  1.1  christos #define RFC4776_OPTIONS
    355  1.1  christos #define RFC4578_OPTIONS
    356  1.1  christos #define RFC4833_OPTIONS
    357  1.1  christos #define RFC4994_OPTIONS
    358  1.1  christos #define RFC5071_OPTIONS
    359  1.1  christos #define RFC5192_OPTIONS
    360  1.1  christos #define RFC5223_OPTIONS
    361  1.1  christos #define RFC5417_OPTIONS
    362  1.1  christos #define RFC5460_OPTIONS
    363  1.1  christos #define RFC5859_OPTIONS
    364  1.1  christos #define RFC5969_OPTIONS
    365  1.1  christos #define RFC5970_OPTIONS
    366  1.1  christos #define RFC5986_OPTIONS
    367  1.1  christos #define RFC6011_OPTIONS
    368  1.1  christos #define RFC6011_OPTIONS
    369  1.1  christos #define RFC6153_OPTIONS
    370  1.1  christos #define RFC6334_OPTIONS
    371  1.1  christos #define RFC6440_OPTIONS
    372  1.1  christos #define RFC6731_OPTIONS
    373  1.1  christos #define RFC6939_OPTIONS
    374  1.1  christos #define RFC6977_OPTIONS
    375  1.1  christos #define RFC7083_OPTIONS
    376  1.1  christos #define RFC7341_OPTIONS
    377  1.1  christos #define RFC7618_OPTIONS
    378  1.1  christos #define RFC7710_OPTIONS
    379  1.3  christos #define RFC8925_OPTIONS
    380