Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/dhcp Pull up revision 1.18 (requested by mellon):



details:   https://anonhg.NetBSD.org/src/rev/37a0a8b051e9
branches:  netbsd-1-5
changeset: 491098:37a0a8b051e9
user:      he <he%NetBSD.org@localhost>
date:      Wed Apr 04 20:55:55 2001 +0000

description:
Pull up revision 1.18 (requested by mellon):
  Update DHCP software to ISC version 3, Beta 2, Patchlevel 23.

diffstat:

 usr.sbin/dhcp/common/Makefile  |    2 +-
 usr.sbin/dhcp/includes/dhcpd.h |  250 +++++++++++----
 usr.sbin/dhcp/server/dhcp.c    |  677 +++++++++++++++++++++++++++++++---------
 3 files changed, 712 insertions(+), 217 deletions(-)

diffs (truncated from 2130 to 300 lines):

diff -r a7c3f7b4cf7f -r 37a0a8b051e9 usr.sbin/dhcp/common/Makefile
--- a/usr.sbin/dhcp/common/Makefile     Wed Apr 04 20:55:51 2001 +0000
+++ b/usr.sbin/dhcp/common/Makefile     Wed Apr 04 20:55:55 2001 +0000
@@ -33,7 +33,7 @@
 LIB    = dhcp
 SRCS   = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
         lpf.c dlpi.c packet.c tr.c ethernet.c memory.c print.c options.c \
-        inet.c tree.c tables.c alloc.c fddi.c \
+        inet.c tree.c tables.c alloc.c fddi.c ctrace.c \
         dns.c resolv.c execute.c discover.c comapi.c
 
 MKLINT=        no
diff -r a7c3f7b4cf7f -r 37a0a8b051e9 usr.sbin/dhcp/includes/dhcpd.h
--- a/usr.sbin/dhcp/includes/dhcpd.h    Wed Apr 04 20:55:51 2001 +0000
+++ b/usr.sbin/dhcp/includes/dhcpd.h    Wed Apr 04 20:55:55 2001 +0000
@@ -3,7 +3,7 @@
    Definitions for dhcpd... */
 
 /*
- * Copyright (c) 1996-2000 Internet Software Consortium.
+ * Copyright (c) 1996-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -119,6 +119,7 @@
        enum dhcp_token token;
        int ugflag;
        char *tval;
+       int tlen;
        char tokbuf [1500];
 
 #ifdef OLD_LEXER
@@ -253,24 +254,25 @@
 
        struct iaddr ip_addr;
        TIME starts, ends, timestamp, sort_time;
-       unsigned char *uid;
-       unsigned uid_len;
-       unsigned uid_max;
-       unsigned char uid_buf [32];
-       char *hostname;
        char *client_hostname;
        struct binding_scope *scope;
        struct host_decl *host;
        struct subnet *subnet;
        struct pool *pool;
        struct class *billing_class;
-       struct hardware hardware_addr;
+       struct option_chain_head *agent_options;
 
        struct executable_statement *on_expiry;
        struct executable_statement *on_commit;
        struct executable_statement *on_release;
 
-       u_int16_t flags;
+       unsigned char *uid;
+       unsigned short uid_len;
+       unsigned short uid_max;
+       unsigned char uid_buf [7];
+       struct hardware hardware_addr;
+
+       u_int8_t flags;
 #       define STATIC_LEASE            1
 #      define PERSISTENT_FLAGS         (ON_ACK_QUEUE | ON_UPDATE_QUEUE)
 #      define MS_NULL_TERMINATION      8
@@ -280,8 +282,8 @@
 #      define EPHEMERAL_FLAGS          (MS_NULL_TERMINATION | \
                                         UNICAST_BROADCAST_HACK)
 
-       binding_state_t binding_state;  /* See failover.h, FTS_*. */
-       binding_state_t next_binding_state;     /* See failover.h, FTS_*. */
+       binding_state_t __attribute__ ((mode (__byte__))) binding_state;
+       binding_state_t __attribute__ ((mode (__byte__))) next_binding_state;
        
        struct lease_state *state;
 
@@ -375,6 +377,14 @@
 #define SV_REMOTE_PORT                 34
 #define SV_LOCAL_ADDRESS               35
 #define SV_OMAPI_KEY                   36
+#define SV_STASH_AGENT_OPTIONS         37
+#define SV_DDNS_TTL                    38
+#define SV_DDNS_UPDATE_STYLE           39
+#define SV_CLIENT_UPDATES              40
+#define SV_UPDATE_OPTIMIZATION         41
+#define SV_PING_CHECKS                 42
+#define SV_UPDATE_STATIC_LEASES                43
+#define SV_LOG_FACILITY                        44
 
 #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
 # define DEFAULT_DEFAULT_LEASE_TIME 43200
@@ -388,6 +398,10 @@
 # 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
@@ -432,10 +446,6 @@
 # define CL_DEFAULT_BOOTP_POLICY P_ACCEPT
 #endif
 
-#ifndef CL_DEFAULT_SCRIPT_NAME
-# define CL_DEFAULT_SCRIPT_NAME "/etc/dhclient-script"
-#endif
-
 #ifndef CL_DEFAULT_REQUESTED_OPTIONS
 # define CL_DEFAULT_REQUESTED_OPTIONS \
        { DHO_SUBNET_MASK, \
@@ -609,13 +619,13 @@
 
 /* Possible states in which the client can be. */
 enum dhcp_state {
-       S_REBOOTING,
-       S_INIT,
-       S_SELECTING,
-       S_REQUESTING, 
-       S_BOUND,
-       S_RENEWING,
-       S_REBINDING
+       S_REBOOTING = 1,
+       S_INIT = 2,
+       S_SELECTING = 3,
+       S_REQUESTING = 4, 
+       S_BOUND = 5,
+       S_RENEWING = 6,
+       S_REBINDING = 7
 };
 
 /* Authentication and BOOTP policy possibilities (not all values work
@@ -726,6 +736,7 @@
        unsigned remote_id_len;         /* Length of Remote ID. */
 
        char name [IFNAMSIZ];           /* Its name... */
+       int index;                      /* Its index. */
        int rfdesc;                     /* Its read file descriptor. */
        int wfdesc;                     /* Its write file descriptor, if
                                           different. */
@@ -742,6 +753,10 @@
 
        /* Only used by DHCP client code. */
        struct client_state *client;
+# if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
+       int dlpi_sap_length;
+       struct hardware dlpi_broadcast_addr;
+# endif /* DLPI_SEND || DLPI_RECEIVE */
 };
 
 struct hardware_link {
@@ -818,6 +833,8 @@
        struct auth_key *key;
 };
 
+#include "ctrace.h"
+
 /* Bitmask of dhcp option codes. */
 typedef unsigned char option_mask [16];
 
@@ -856,6 +873,10 @@
 #define _PATH_DHCLIENT_CONF    "/etc/dhclient.conf"
 #endif
 
+#ifndef _PATH_DHCLIENT_SCRIPT
+#define _PATH_DHCLIENT_SCRIPT  "/sbin/dhclient-script"
+#endif
+
 #ifndef _PATH_DHCLIENT_PID
 #define _PATH_DHCLIENT_PID     "/var/run/dhclient.pid"
 #endif
@@ -885,26 +906,29 @@
 
 extern struct option *vendor_cfg_option;
 int parse_options PROTO ((struct packet *));
-int parse_option_buffer PROTO ((struct option_state *,
-                               unsigned char *, unsigned, struct universe *));
+int parse_option_buffer PROTO ((struct option_state *, const unsigned char *,
+                               unsigned, struct universe *));
+struct universe *find_option_universe (struct option *, const char *);
 int parse_encapsulated_suboptions (struct option_state *, struct option *,
-                                  unsigned char *, unsigned,
-                                  struct universe *, struct universe *);
+                                  const unsigned char *, unsigned,
+                                  struct universe *, const char *);
 int cons_options PROTO ((struct packet *, struct dhcp_packet *, struct lease *,
+                        struct client_state *,
                         int, struct option_state *, struct option_state *,
                         struct binding_scope **,
                         int, int, int, struct data_string *, const char *));
 int fqdn_universe_decode (struct option_state *,
-                         unsigned char *, unsigned, struct universe *);
+                         const unsigned char *, unsigned, struct universe *);
 int store_options PROTO ((unsigned char *, unsigned, struct packet *,
-                         struct lease *, struct option_state *,
+                         struct lease *, struct client_state *,
+                         struct option_state *,
                          struct option_state *, struct binding_scope **,
                          unsigned *, int, unsigned, unsigned,
                          int, const char *));
-const char *pretty_print_option PROTO ((unsigned int, const unsigned char *,
+const char *pretty_print_option PROTO ((struct option *, const unsigned char *,
                                        unsigned, int, int));
 int get_option (struct data_string *, struct universe *,
-               struct packet *, struct lease *,
+               struct packet *, struct lease *, struct client_state *,
                struct option_state *, struct option_state *,
                struct option_state *, struct binding_scope **, unsigned);
 void set_option (struct universe *, struct option_state *,
@@ -931,44 +955,61 @@
                                            const char *, int));
 int store_option PROTO ((struct data_string *,
                         struct universe *, struct packet *, struct lease *,
+                        struct client_state *,
                         struct option_state *, struct option_state *,
                         struct binding_scope **, struct option_cache *));
 int option_space_encapsulate PROTO ((struct data_string *,
                                     struct packet *, struct lease *,
+                                    struct client_state *,
                                     struct option_state *,
                                     struct option_state *,
                                     struct binding_scope **,
                                     struct data_string *));
 int hashed_option_space_encapsulate PROTO ((struct data_string *,
                                            struct packet *, struct lease *,
+                                           struct client_state *,
                                            struct option_state *,
                                            struct option_state *,
                                            struct binding_scope **,
                                            struct universe *));
 int nwip_option_space_encapsulate PROTO ((struct data_string *,
                                          struct packet *, struct lease *,
+                                         struct client_state *,
                                          struct option_state *,
                                          struct option_state *,
                                          struct binding_scope **,
                                          struct universe *));
 int fqdn_option_space_encapsulate (struct data_string *,
                                   struct packet *, struct lease *,
+                                  struct client_state *,
                                   struct option_state *,
                                   struct option_state *,
                                   struct binding_scope **,
                                   struct universe *);
+void suboption_foreach (struct packet *, struct lease *, struct client_state *,
+                       struct option_state *, struct option_state *,
+                       struct binding_scope **, struct universe *, void *,
+                       void (*) (struct option_cache *, struct packet *,
+                                 struct lease *, struct client_state *,
+                                 struct option_state *, struct option_state *,
+                                 struct binding_scope **,
+                                 struct universe *, void *),
+                       struct option_cache *, const char *);
 void option_space_foreach (struct packet *, struct lease *,
+                          struct client_state *,
                           struct option_state *,
                           struct option_state *,
                           struct binding_scope **,
                           struct universe *, void *,
                           void (*) (struct option_cache *,
                                     struct packet *,
-                                    struct lease *, struct option_state *,
+                                    struct lease *, struct client_state *,
+                                    struct option_state *,
                                     struct option_state *,
                                     struct binding_scope **,
                                     struct universe *, void *));
 void hashed_option_space_foreach (struct packet *, struct lease *,
+                                 struct client_state *,
                                  struct option_state *,
                                  struct option_state *,
                                  struct binding_scope **,
@@ -976,12 +1017,14 @@
                                  void (*) (struct option_cache *,
                                            struct packet *,
                                            struct lease *,
+                                           struct client_state *,
                                            struct option_state *,
                                            struct option_state *,
                                            struct binding_scope **,
                                            struct universe *, void *));
 int linked_option_get PROTO ((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));
@@ -991,6 +1034,7 @@
 void save_linked_option (struct universe *, struct option_state *,
                         struct option_cache *);
 void linked_option_space_foreach (struct packet *, struct lease *,
+                                 struct client_state *,
                                  struct option_state *,
                                  struct option_state *,
                                  struct binding_scope **,
@@ -998,12 +1042,14 @@
                                  void (*) (struct option_cache *,
                                            struct packet *,



Home | Main Index | Thread Index | Old Index