mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 15:25:48 +00:00
Add get-lease-hostnames parameter
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: conflex.c,v 1.17 1996/08/29 09:49:52 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: conflex.c,v 1.18 1996/08/29 23:02:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -390,6 +390,8 @@ static int intern (atom, dfv)
|
|||||||
return GIADDR;
|
return GIADDR;
|
||||||
if (!strcasecmp (atom + 1, "roup"))
|
if (!strcasecmp (atom + 1, "roup"))
|
||||||
return GROUP;
|
return GROUP;
|
||||||
|
if (!strcasecmp (atom + 1, "et-lease-hostnames"))
|
||||||
|
return GET_LEASE_HOSTNAMES;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
if (!strcasecmp (atom + 1, "ost"))
|
if (!strcasecmp (atom + 1, "ost"))
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: conflex.c,v 1.17 1996/08/29 09:49:52 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: conflex.c,v 1.18 1996/08/29 23:02:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -390,6 +390,8 @@ static int intern (atom, dfv)
|
|||||||
return GIADDR;
|
return GIADDR;
|
||||||
if (!strcasecmp (atom + 1, "roup"))
|
if (!strcasecmp (atom + 1, "roup"))
|
||||||
return GROUP;
|
return GROUP;
|
||||||
|
if (!strcasecmp (atom + 1, "et-lease-hostnames"))
|
||||||
|
return GET_LEASE_HOSTNAMES;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
if (!strcasecmp (atom + 1, "ost"))
|
if (!strcasecmp (atom + 1, "ost"))
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: confpars.c,v 1.29 1996/08/29 20:12:37 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: confpars.c,v 1.30 1996/08/29 23:02:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -143,6 +143,7 @@ void read_leases ()
|
|||||||
| DYNAMIC_BOOTP_LEASE_LENGTH lease_time
|
| DYNAMIC_BOOTP_LEASE_LENGTH lease_time
|
||||||
| BOOT_UNKNOWN_CLIENTS boolean
|
| BOOT_UNKNOWN_CLIENTS boolean
|
||||||
| ONE_LEASE_PER_CLIENT boolean
|
| ONE_LEASE_PER_CLIENT boolean
|
||||||
|
| GET_LEASE_HOSTNAMES boolean
|
||||||
| NEXT_SERVER ip-addr-or-hostname SEMI
|
| NEXT_SERVER ip-addr-or-hostname SEMI
|
||||||
| option_parameter
|
| option_parameter
|
||||||
| SERVER-IDENTIFIER ip-addr-or-hostname SEMI
|
| SERVER-IDENTIFIER ip-addr-or-hostname SEMI
|
||||||
@@ -285,6 +286,12 @@ int parse_statement (cfile, group, type, host_decl, declaration)
|
|||||||
group -> one_lease_per_client = parse_boolean (cfile);
|
group -> one_lease_per_client = parse_boolean (cfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GET_LEASE_HOSTNAMES:
|
||||||
|
if (type == HOST_DECL)
|
||||||
|
parse_warn ("get-lease-hostnames not allowed here.");
|
||||||
|
group -> get_lease_hostnames = parse_boolean (cfile);
|
||||||
|
break;
|
||||||
|
|
||||||
case NEXT_SERVER:
|
case NEXT_SERVER:
|
||||||
tree = parse_ip_addr_or_hostname (cfile, 0);
|
tree = parse_ip_addr_or_hostname (cfile, 0);
|
||||||
if (!tree)
|
if (!tree)
|
||||||
|
13
dhcpd.conf.5
13
dhcpd.conf.5
@@ -595,6 +595,19 @@ or not to dynamically assign addresses to unknown DHCP clients. If
|
|||||||
assigned to unknown DHCP clients when available. If \fIflag\fR is
|
assigned to unknown DHCP clients when available. If \fIflag\fR is
|
||||||
false, then addresses are provided only to DHCP clients which match at
|
false, then addresses are provided only to DHCP clients which match at
|
||||||
least one host declaration.
|
least one host declaration.
|
||||||
|
.PP
|
||||||
|
.B The
|
||||||
|
.I get-lease-hostnames
|
||||||
|
.B statement
|
||||||
|
.PP
|
||||||
|
\fBget-lease-hostnames\fR \fIflag\fR\fB;\fR
|
||||||
|
.PP
|
||||||
|
The \fIget-lease-hostnames\fR statement is used to tell dhcpd whether
|
||||||
|
or not to look up the domain name corresponding to the IP address of
|
||||||
|
each address in the lease pool and use that address for the DHCP
|
||||||
|
\fIhostname\fR option. If \fIflag\fR is true, then this lookup is
|
||||||
|
done for all addresses in the current scope. By default, or if
|
||||||
|
\fIflag\fR is false, no lookups are done.
|
||||||
.SH REFERENCE: OPTION STATEMENTS
|
.SH REFERENCE: OPTION STATEMENTS
|
||||||
.PP
|
.PP
|
||||||
DHCP \fIoption\fR statements always start with the \fIoption\fR
|
DHCP \fIoption\fR statements always start with the \fIoption\fR
|
||||||
|
1272
dhcpd.conf.cat5
1272
dhcpd.conf.cat5
File diff suppressed because it is too large
Load Diff
1
dhcpd.h
1
dhcpd.h
@@ -137,6 +137,7 @@ struct group {
|
|||||||
int boot_unknown_clients;
|
int boot_unknown_clients;
|
||||||
int dynamic_bootp;
|
int dynamic_bootp;
|
||||||
int one_lease_per_client;
|
int one_lease_per_client;
|
||||||
|
int get_lease_hostnames;
|
||||||
|
|
||||||
struct tree_cache *options [256];
|
struct tree_cache *options [256];
|
||||||
};
|
};
|
||||||
|
@@ -88,6 +88,7 @@
|
|||||||
#define TOKEN_RING 292
|
#define TOKEN_RING 292
|
||||||
#define GROUP 293
|
#define GROUP 293
|
||||||
#define ONE_LEASE_PER_CLIENT 294
|
#define ONE_LEASE_PER_CLIENT 294
|
||||||
|
#define GET_LEASE_HOSTNAMES 295
|
||||||
|
|
||||||
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
||||||
(x) != STRING && \
|
(x) != STRING && \
|
||||||
|
@@ -137,6 +137,7 @@ struct group {
|
|||||||
int boot_unknown_clients;
|
int boot_unknown_clients;
|
||||||
int dynamic_bootp;
|
int dynamic_bootp;
|
||||||
int one_lease_per_client;
|
int one_lease_per_client;
|
||||||
|
int get_lease_hostnames;
|
||||||
|
|
||||||
struct tree_cache *options [256];
|
struct tree_cache *options [256];
|
||||||
};
|
};
|
||||||
|
@@ -88,6 +88,7 @@
|
|||||||
#define TOKEN_RING 292
|
#define TOKEN_RING 292
|
||||||
#define GROUP 293
|
#define GROUP 293
|
||||||
#define ONE_LEASE_PER_CLIENT 294
|
#define ONE_LEASE_PER_CLIENT 294
|
||||||
|
#define GET_LEASE_HOSTNAMES 295
|
||||||
|
|
||||||
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
||||||
(x) != STRING && \
|
(x) != STRING && \
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: confpars.c,v 1.29 1996/08/29 20:12:37 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: confpars.c,v 1.30 1996/08/29 23:02:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -143,6 +143,7 @@ void read_leases ()
|
|||||||
| DYNAMIC_BOOTP_LEASE_LENGTH lease_time
|
| DYNAMIC_BOOTP_LEASE_LENGTH lease_time
|
||||||
| BOOT_UNKNOWN_CLIENTS boolean
|
| BOOT_UNKNOWN_CLIENTS boolean
|
||||||
| ONE_LEASE_PER_CLIENT boolean
|
| ONE_LEASE_PER_CLIENT boolean
|
||||||
|
| GET_LEASE_HOSTNAMES boolean
|
||||||
| NEXT_SERVER ip-addr-or-hostname SEMI
|
| NEXT_SERVER ip-addr-or-hostname SEMI
|
||||||
| option_parameter
|
| option_parameter
|
||||||
| SERVER-IDENTIFIER ip-addr-or-hostname SEMI
|
| SERVER-IDENTIFIER ip-addr-or-hostname SEMI
|
||||||
@@ -285,6 +286,12 @@ int parse_statement (cfile, group, type, host_decl, declaration)
|
|||||||
group -> one_lease_per_client = parse_boolean (cfile);
|
group -> one_lease_per_client = parse_boolean (cfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GET_LEASE_HOSTNAMES:
|
||||||
|
if (type == HOST_DECL)
|
||||||
|
parse_warn ("get-lease-hostnames not allowed here.");
|
||||||
|
group -> get_lease_hostnames = parse_boolean (cfile);
|
||||||
|
break;
|
||||||
|
|
||||||
case NEXT_SERVER:
|
case NEXT_SERVER:
|
||||||
tree = parse_ip_addr_or_hostname (cfile, 0);
|
tree = parse_ip_addr_or_hostname (cfile, 0);
|
||||||
if (!tree)
|
if (!tree)
|
||||||
|
@@ -595,6 +595,19 @@ or not to dynamically assign addresses to unknown DHCP clients. If
|
|||||||
assigned to unknown DHCP clients when available. If \fIflag\fR is
|
assigned to unknown DHCP clients when available. If \fIflag\fR is
|
||||||
false, then addresses are provided only to DHCP clients which match at
|
false, then addresses are provided only to DHCP clients which match at
|
||||||
least one host declaration.
|
least one host declaration.
|
||||||
|
.PP
|
||||||
|
.B The
|
||||||
|
.I get-lease-hostnames
|
||||||
|
.B statement
|
||||||
|
.PP
|
||||||
|
\fBget-lease-hostnames\fR \fIflag\fR\fB;\fR
|
||||||
|
.PP
|
||||||
|
The \fIget-lease-hostnames\fR statement is used to tell dhcpd whether
|
||||||
|
or not to look up the domain name corresponding to the IP address of
|
||||||
|
each address in the lease pool and use that address for the DHCP
|
||||||
|
\fIhostname\fR option. If \fIflag\fR is true, then this lookup is
|
||||||
|
done for all addresses in the current scope. By default, or if
|
||||||
|
\fIflag\fR is false, no lookups are done.
|
||||||
.SH REFERENCE: OPTION STATEMENTS
|
.SH REFERENCE: OPTION STATEMENTS
|
||||||
.PP
|
.PP
|
||||||
DHCP \fIoption\fR statements always start with the \fIoption\fR
|
DHCP \fIoption\fR statements always start with the \fIoption\fR
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user