summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2008-01-21 19:53:21 +0000
committerDavid Hankins <dhankins@isc.org>2008-01-21 19:53:21 +0000
commit6368a1bd72881aa88238969a6f1f9310bff5348f (patch)
tree2f47e9677b629fcb2eee49543a27cca9c9f4d895 /includes
parent7dc9b5fb308aa6628f231989d6caad4fb319d5ee (diff)
downloadisc-dhcp-6368a1bd72881aa88238969a6f1f9310bff5348f.tar.gz
- Multiple (up to "delayed-ack x;" maximum) DHCPv4 packets are now queued and
released in bursts after single fsync() events when the upper limit is reached or if the receiving sockets go dry. The practical upshot is that fsync-coupled server performance is now multiplicitively increased. The default delayed ack limit is 28. Thanks entirely to a patch from Christof Chen.
Diffstat (limited to 'includes')
-rw-r--r--includes/dhcpd.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index 6afe74ab..62f8915c 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -621,11 +621,16 @@ struct lease_state {
#define SV_DHCPV6_LEASE_FILE_NAME 54
#define SV_DHCPV6_PID_FILE_NAME 55
#define SV_LIMIT_ADDRS_PER_IA 56
+#define SV_DELAYED_ACK 57
#if !defined (DEFAULT_PING_TIMEOUT)
# define DEFAULT_PING_TIMEOUT 1
#endif
+#if !defined (DEFAULT_DELAYED_ACK)
+# define DEFAULT_DELAYED_ACK 28 /* default SO_SNDBUF size / 576 bytes */
+#endif
+
#if !defined (DEFAULT_DEFAULT_LEASE_TIME)
# define DEFAULT_DEFAULT_LEASE_TIME 43200
#endif
@@ -1138,6 +1143,12 @@ struct hardware_link {
struct hardware address;
};
+struct leasequeue {
+ struct leasequeue *prev;
+ struct leasequeue *next;
+ struct lease *lease;
+};
+
typedef void (*tvref_t)(void *, void *, const char *, int);
typedef void (*tvunref_t)(void *, const char *, int);
struct timeout {
@@ -1149,6 +1160,11 @@ struct timeout {
tvunref_t unref;
};
+struct eventqueue {
+ struct eventqueue *next;
+ void (*handler)(void *);
+};
+
struct protocol {
struct protocol *next;
int fd;
@@ -1653,6 +1669,7 @@ extern const char *path_dhcpd_db;
extern const char *path_dhcpd_pid;
extern int dhcp_max_agent_option_packet_length;
+extern struct eventqueue *rw_queue_empty;
int main(int, char **);
void postconf_initialization(int);
@@ -1912,6 +1929,7 @@ int data_string_sprintfa(struct data_string *ds, const char *fmt, ...);
/* dhcp.c */
extern int outstanding_pings;
+extern int max_outstanding_acks;
void dhcp PROTO ((struct packet *));
void dhcpdiscover PROTO ((struct packet *, int));
@@ -1923,6 +1941,9 @@ void dhcpleasequery PROTO ((struct packet *, int));
void nak_lease PROTO ((struct packet *, struct iaddr *cip));
void ack_lease PROTO ((struct packet *, struct lease *,
unsigned int, TIME, char *, int, struct host_decl *));
+void delayed_ack_enqueue(struct lease *);
+void commit_leases_readerdry(void *);
+void flush_ackqueue(void *);
void dhcp_reply PROTO ((struct lease *));
int find_lease PROTO ((struct lease **, struct packet *,
struct shared_network *, int *, int *, struct lease *,
@@ -2537,6 +2558,7 @@ isc_result_t write_named_billing_class(const void *, unsigned, void *);
void write_billing_classes (void);
int write_billing_class PROTO ((struct class *));
void commit_leases_timeout PROTO ((void *));
+void commit_leases_readerdry(void *);
int commit_leases PROTO ((void));
void db_startup PROTO ((int));
int new_lease_file PROTO ((void));
@@ -2966,6 +2988,10 @@ isc_result_t binding_scope_get_value (omapi_value_t **,
isc_result_t binding_scope_stuff_values (omapi_object_t *,
struct binding_scope *);
+void register_eventhandler(struct eventqueue **, void (*handler)(void *));
+void unregister_eventhandler(struct eventqueue **, void (*handler)(void *));
+void trigger_event(struct eventqueue **);
+
/* mdb.c */
extern struct subnet *subnets;