From b992d7e23d870ada9317330b0b2b08e5823255d2 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Mon, 11 Dec 2000 18:56:45 +0000 Subject: DDNS implementation rewrite. DDNS should now operate according to . common/options.c, common/tables.c, includes/dhcp.h: Split the fqdn.name option into fqdn.hostname and fqdn.domainname. includes/dhcpd.h, server/Makefile.dist, server/ddns.c, server/dhcp.c, server/mdb.c, server/stables.c: Added a new file (server/ddns.c) containing the DDNS updates code. This file exports two functions: ddns_updates() and ddns_removals(). ddns_updates() is called when a lease is granted, and ddns_removals() is called when the lease expires or is released. server/dhcpd.c: Remove the previous DDNS update code, and add default code for the ddns-hostname, ddns-domainname, ddns-ttl, and ddns-rev-domainname server options. --- includes/dhcp.h | 5 +++-- includes/dhcpd.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/dhcp.h b/includes/dhcp.h index d4d31138..0602ae10 100644 --- a/includes/dhcp.h +++ b/includes/dhcp.h @@ -192,5 +192,6 @@ struct dhcp_packet { #define FQDN_ENCODED 3 #define FQDN_RCODE1 4 #define FQDN_RCODE2 5 -#define FQDN_NAME 6 -#define FQDN_SUBOPTION_COUNT 6 +#define FQDN_HOSTNAME 6 +#define FQDN_DOMAINNAME 7 +#define FQDN_SUBOPTION_COUNT 7 diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 1302b4d8..a6c3882c 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -377,6 +377,7 @@ struct lease_state { #define SV_LOCAL_ADDRESS 35 #define SV_OMAPI_KEY 36 #define SV_STASH_AGENT_OPTIONS 37 +#define SV_DDNS_TTL 38 #if !defined (DEFAULT_DEFAULT_LEASE_TIME) # define DEFAULT_DEFAULT_LEASE_TIME 43200 @@ -390,6 +391,10 @@ struct lease_state { # define DEFAULT_MAX_LEASE_TIME 86400 #endif +#if !defined (DEFAULT_DDNS_TTL) +# define DEFAULT_DDNS_TTL 3600 +#endif + /* Client option names */ #define CL_TIMEOUT 1 @@ -1092,6 +1097,11 @@ int parse_lease_declaration PROTO ((struct lease **, struct parse *)); void parse_address_range PROTO ((struct parse *, struct group *, int, struct pool *)); +/* ddns.c */ +int ddns_updates PROTO ((struct packet *, struct lease *, + struct lease_state *)); +int ddns_removals PROTO ((struct lease *)); + /* parse.c */ void skip_to_semi PROTO ((struct parse *)); void skip_to_rbrace PROTO ((struct parse *, int)); -- cgit v1.2.1