aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/leases.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/leases.c')
-rw-r--r--networking/udhcp/leases.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c
index add114f6c..dce056654 100644
--- a/networking/udhcp/leases.c
+++ b/networking/udhcp/leases.c
@@ -17,10 +17,10 @@
17#include "common.h" 17#include "common.h"
18 18
19 19
20unsigned char blank_chaddr[] = {[0 ... 15] = 0}; 20uint8_t blank_chaddr[] = {[0 ... 15] = 0};
21 21
22/* clear every lease out that chaddr OR yiaddr matches and is nonzero */ 22/* clear every lease out that chaddr OR yiaddr matches and is nonzero */
23void clear_lease(u_int8_t *chaddr, u_int32_t yiaddr) 23void clear_lease(uint8_t *chaddr, uint32_t yiaddr)
24{ 24{
25 unsigned int i, j; 25 unsigned int i, j;
26 26
@@ -35,7 +35,7 @@ void clear_lease(u_int8_t *chaddr, u_int32_t yiaddr)
35 35
36 36
37/* add a lease into the table, clearing out any old ones */ 37/* add a lease into the table, clearing out any old ones */
38struct dhcpOfferedAddr *add_lease(u_int8_t *chaddr, u_int32_t yiaddr, unsigned long lease) 38struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease)
39{ 39{
40 struct dhcpOfferedAddr *oldest; 40 struct dhcpOfferedAddr *oldest;
41 41
@@ -80,7 +80,7 @@ struct dhcpOfferedAddr *oldest_expired_lease(void)
80 80
81 81
82/* Find the first lease that matches chaddr, NULL if no match */ 82/* Find the first lease that matches chaddr, NULL if no match */
83struct dhcpOfferedAddr *find_lease_by_chaddr(u_int8_t *chaddr) 83struct dhcpOfferedAddr *find_lease_by_chaddr(uint8_t *chaddr)
84{ 84{
85 unsigned int i; 85 unsigned int i;
86 86
@@ -92,7 +92,7 @@ struct dhcpOfferedAddr *find_lease_by_chaddr(u_int8_t *chaddr)
92 92
93 93
94/* Find the first lease that matches yiaddr, NULL is no match */ 94/* Find the first lease that matches yiaddr, NULL is no match */
95struct dhcpOfferedAddr *find_lease_by_yiaddr(u_int32_t yiaddr) 95struct dhcpOfferedAddr *find_lease_by_yiaddr(uint32_t yiaddr)
96{ 96{
97 unsigned int i; 97 unsigned int i;
98 98
@@ -104,7 +104,7 @@ struct dhcpOfferedAddr *find_lease_by_yiaddr(u_int32_t yiaddr)
104 104
105 105
106/* check is an IP is taken, if it is, add it to the lease table */ 106/* check is an IP is taken, if it is, add it to the lease table */
107static int check_ip(u_int32_t addr) 107static int check_ip(uint32_t addr)
108{ 108{
109 struct in_addr temp; 109 struct in_addr temp;
110 110
@@ -120,9 +120,9 @@ static int check_ip(u_int32_t addr)
120 120
121/* find an assignable address, it check_expired is true, we check all the expired leases as well. 121/* find an assignable address, it check_expired is true, we check all the expired leases as well.
122 * Maybe this should try expired leases by age... */ 122 * Maybe this should try expired leases by age... */
123u_int32_t find_address(int check_expired) 123uint32_t find_address(int check_expired)
124{ 124{
125 u_int32_t addr, ret; 125 uint32_t addr, ret;
126 struct dhcpOfferedAddr *lease = NULL; 126 struct dhcpOfferedAddr *lease = NULL;
127 127
128 addr = ntohl(server_config.start); /* addr is in host order here */ 128 addr = ntohl(server_config.start); /* addr is in host order here */