found some more unused #defines

Index: dhcpd.h
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dhcpd.h,v
retrieving revision 1.64
diff -u -p -u -r1.64 dhcpd.h
--- dhcpd.h    24 Apr 2017 14:58:36 -0000    1.64
+++ dhcpd.h    26 Jun 2017 21:17:15 -0000
@@ -54,11 +54,6 @@ struct iaddr {
     unsigned char iabuf[16];
 };

-struct iaddrlist {
-    struct iaddrlist *next;
-    struct iaddr addr;
-};
-
 #define DEFAULT_HASH_SIZE    97

 struct hash_bucket {
@@ -78,25 +73,6 @@ struct option_data {
     u_int8_t *data;
 };

-struct string_list {
-    struct string_list *next;
-    char *string;
-};
-
-/* A name server, from /etc/resolv.conf. */
-struct name_server {
-    struct name_server *next;
-    struct sockaddr_in addr;
-    time_t rcdate;
-};
-
-/* A domain search list element. */
-struct domain_search_list {
-    struct domain_search_list *next;
-    char *domain;
-    time_t rcdate;
-};
-
 /* A dhcp packet and the pointers to its option values. */
 struct packet {
     struct dhcp_packet *raw;
@@ -107,12 +83,12 @@ struct packet {
     struct iaddr client_addr;
     struct interface_info *interface;    /* Interface on which packet
                            was received. */
-    struct hardware *haddr;        /* Physical link address
-                       of local sender (maybe gateway). */
+    struct hardware *haddr;            /* Physical link address
+                              of local sender (maybe gateway). */
     struct shared_network *shared_network;
     struct option_data options[256];
-    int got_requested_address;    /* True if client sent the
-                       dhcp-requested-address option. */
+    int got_requested_address;        /* True if client sent the
+                               dhcp-requested-address option. */
 };

 struct hardware {
@@ -174,13 +150,12 @@ struct lease_state {
     int max_message_size;
     u_int8_t *prl;
     int prl_len;
-    int got_requested_address;    /* True if client sent the
-                       dhcp-requested-address option. */
-    int got_server_identifier;    /* True if client sent the
-                       dhcp-server-identifier option. */
+    int got_requested_address;        /* True if client sent the
+                               dhcp-requested-address option. */
+    int got_server_identifier;        /* True if client sent the
+                               dhcp-server-identifier option. */
struct shared_network *shared_network; /* Shared network of interface
                            on which request arrived. */
-
     u_int32_t xid;
     u_int16_t secs;
     u_int16_t bootp_flags;
@@ -278,7 +253,7 @@ struct pf_cmd {
 struct interface_info {
     struct interface_info *next;    /* Next interface in list... */
     struct shared_network *shared_network;
-                /* Networks connected to this interface. */
+                    /* Networks connected to this interface. */
     struct hardware hw_address;    /* Its physical address. */
     struct in_addr primary_address;    /* Primary interface address. */
     char name[IFNAMSIZ];        /* Its name... */
@@ -301,12 +276,6 @@ struct interface_info {
         size_t, struct in_addr, struct sockaddr_in *, struct hardware *);
 };

-struct hardware_link {
-    struct hardware_link *next;
-    char name[IFNAMSIZ];
-    struct hardware address;
-};
-
 struct dhcpd_timeout {
     struct dhcpd_timeout *next;
     time_t when;
@@ -321,20 +290,8 @@ struct protocol {
     void *local;
 };

-/* Bitmask of dhcp option codes. */
-typedef unsigned char option_mask[16];
-
-/* DHCP Option mask manipulation macros... */
-#define OPTION_ZERO(mask)    (memset (mask, 0, 16))
-#define OPTION_SET(mask, bit)    (mask[bit >> 8] |= (1 << (bit & 7)))
-#define OPTION_CLR(mask, bit)    (mask[bit >> 8] &= ~(1 << (bit & 7)))
-#define OPTION_ISSET(mask, bit)    (mask[bit >> 8] & (1 << (bit & 7)))
-#define OPTION_ISCLR(mask, bit)    (!OPTION_ISSET (mask, bit))
-
 /* An option occupies its length plus two header bytes (code and
-    length) for every 255 bytes that must be stored. */
-#define OPTION_SPACE(x)        ((x) + 2 * ((x) / 255 + 1))
-
+ * length) for every 255 bytes that must be stored. */
 #define _PATH_DHCPD_CONF    "/etc/dhcpd.conf"
 #define _PATH_DHCPD_DB        "/var/db/dhcpd.leases"
 #define _PATH_DEV_PF        "/dev/pf"


On 06/25/17 13:40, Edgar Pettijohn wrote:
Remove unused structs and line up some comments.


Index: dhcpd.h
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dhcpd.h,v
retrieving revision 1.64
diff -u -p -u -r1.64 dhcpd.h
--- dhcpd.h    24 Apr 2017 14:58:36 -0000    1.64
+++ dhcpd.h    25 Jun 2017 18:36:47 -0000
@@ -54,11 +54,6 @@ struct iaddr {
     unsigned char iabuf[16];
 };

-struct iaddrlist {
-    struct iaddrlist *next;
-    struct iaddr addr;
-};
-
 #define DEFAULT_HASH_SIZE    97

 struct hash_bucket {
@@ -78,25 +73,6 @@ struct option_data {
     u_int8_t *data;
 };

-struct string_list {
-    struct string_list *next;
-    char *string;
-};
-
-/* A name server, from /etc/resolv.conf. */
-struct name_server {
-    struct name_server *next;
-    struct sockaddr_in addr;
-    time_t rcdate;
-};
-
-/* A domain search list element. */
-struct domain_search_list {
-    struct domain_search_list *next;
-    char *domain;
-    time_t rcdate;
-};
-
 /* A dhcp packet and the pointers to its option values. */
 struct packet {
     struct dhcp_packet *raw;
@@ -107,12 +83,12 @@ struct packet {
     struct iaddr client_addr;
     struct interface_info *interface;    /* Interface on which packet
                            was received. */
-    struct hardware *haddr;        /* Physical link address
-                       of local sender (maybe gateway). */
+    struct hardware *haddr;            /* Physical link address
+                              of local sender (maybe gateway). */
     struct shared_network *shared_network;
     struct option_data options[256];
-    int got_requested_address;    /* True if client sent the
-                       dhcp-requested-address option. */
+    int got_requested_address;        /* True if client sent the
+                               dhcp-requested-address option. */
 };

 struct hardware {
@@ -174,13 +150,12 @@ struct lease_state {
     int max_message_size;
     u_int8_t *prl;
     int prl_len;
-    int got_requested_address;    /* True if client sent the
-                       dhcp-requested-address option. */
-    int got_server_identifier;    /* True if client sent the
-                       dhcp-server-identifier option. */
+    int got_requested_address;        /* True if client sent the
+                               dhcp-requested-address option. */
+    int got_server_identifier;        /* True if client sent the
+                               dhcp-server-identifier option. */
struct shared_network *shared_network; /* Shared network of interface
                            on which request arrived. */
-
     u_int32_t xid;
     u_int16_t secs;
     u_int16_t bootp_flags;
@@ -278,7 +253,7 @@ struct pf_cmd {
 struct interface_info {
     struct interface_info *next;    /* Next interface in list... */
     struct shared_network *shared_network;
-                /* Networks connected to this interface. */
+                    /* Networks connected to this interface. */
     struct hardware hw_address;    /* Its physical address. */
     struct in_addr primary_address;    /* Primary interface address. */
     char name[IFNAMSIZ];        /* Its name... */
@@ -299,12 +274,6 @@ struct interface_info {
     int is_udpsock;
ssize_t (*send_packet)(struct interface_info *, struct dhcp_packet *, size_t, struct in_addr, struct sockaddr_in *, struct hardware *);
-};
-
-struct hardware_link {
-    struct hardware_link *next;
-    char name[IFNAMSIZ];
-    struct hardware address;
 };

 struct dhcpd_timeout {

Reply via email to