aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/options.c')
-rw-r--r--networking/udhcp/options.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index 32deeabb3..1bdf25708 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -59,10 +59,10 @@ int option_lengths[] = {
59 59
60 60
61/* get an option with bounds checking (warning, not aligned). */ 61/* get an option with bounds checking (warning, not aligned). */
62unsigned char *get_option(struct dhcpMessage *packet, int code) 62uint8_t *get_option(struct dhcpMessage *packet, int code)
63{ 63{
64 int i, length; 64 int i, length;
65 unsigned char *optionptr; 65 uint8_t *optionptr;
66 int over = 0, done = 0, curr = OPTION_FIELD; 66 int over = 0, done = 0, curr = OPTION_FIELD;
67 67
68 optionptr = packet->options; 68 optionptr = packet->options;
@@ -114,7 +114,7 @@ unsigned char *get_option(struct dhcpMessage *packet, int code)
114 114
115 115
116/* return the position of the 'end' option (no bounds checking) */ 116/* return the position of the 'end' option (no bounds checking) */
117int end_option(unsigned char *optionptr) 117int end_option(uint8_t *optionptr)
118{ 118{
119 int i = 0; 119 int i = 0;
120 120
@@ -128,7 +128,7 @@ int end_option(unsigned char *optionptr)
128 128
129/* add an option string to the options (an option string contains an option code, 129/* add an option string to the options (an option string contains an option code,
130 * length, then data) */ 130 * length, then data) */
131int add_option_string(unsigned char *optionptr, unsigned char *string) 131int add_option_string(uint8_t *optionptr, uint8_t *string)
132{ 132{
133 int end = end_option(optionptr); 133 int end = end_option(optionptr);
134 134
@@ -145,17 +145,17 @@ int add_option_string(unsigned char *optionptr, unsigned char *string)
145 145
146 146
147/* add a one to four byte option to a packet */ 147/* add a one to four byte option to a packet */
148int add_simple_option(unsigned char *optionptr, unsigned char code, u_int32_t data) 148int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
149{ 149{
150 char length = 0; 150 char length = 0;
151 int i; 151 int i;
152 unsigned char option[2 + 4]; 152 uint8_t option[2 + 4];
153 unsigned char *u8; 153 uint8_t *u8;
154 u_int16_t *u16; 154 uint16_t *u16;
155 u_int32_t *u32; 155 uint32_t *u32;
156 u_int32_t aligned; 156 uint32_t aligned;
157 u8 = (unsigned char *) &aligned; 157 u8 = (uint8_t *) &aligned;
158 u16 = (u_int16_t *) &aligned; 158 u16 = (uint16_t *) &aligned;
159 u32 = &aligned; 159 u32 = &aligned;
160 160
161 for (i = 0; dhcp_options[i].code; i++) 161 for (i = 0; dhcp_options[i].code; i++)