summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-option.c
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-01-20 14:44:24 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-01-20 17:25:16 +0100
commit22805d9207d5242681e5667ee304572e4abf9b94 (patch)
tree0be33223c33ca5fe5198fb83f1f4156becafb2c8 /src/libsystemd-network/dhcp-option.c
parentf8693fc7971942eedb4651a8c82500c227773f62 (diff)
dhcp: make DHCP_OPTION_* enum public
libsystemd-network provides the public function sd_dhcp_client_set_request_option() to enable the request of a given DHCP option. However the enum defining such options is defined in the internal header dhcp-protocol.h. Move the enum definition to the public header sd-dhcp-client.h and properly namespace values.
Diffstat (limited to 'src/libsystemd-network/dhcp-option.c')
-rw-r--r--src/libsystemd-network/dhcp-option.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libsystemd-network/dhcp-option.c b/src/libsystemd-network/dhcp-option.c
index 1de7f3639c..9f0d96e57d 100644
--- a/src/libsystemd-network/dhcp-option.c
+++ b/src/libsystemd-network/dhcp-option.c
@@ -34,14 +34,14 @@ static int option_append(uint8_t options[], size_t size, size_t *offset,
assert(options);
assert(offset);
- if (code != DHCP_OPTION_END)
+ if (code != SD_DHCP_OPTION_END)
/* always make sure there is space for an END option */
size --;
switch (code) {
- case DHCP_OPTION_PAD:
- case DHCP_OPTION_END:
+ case SD_DHCP_OPTION_PAD:
+ case SD_DHCP_OPTION_END:
if (size < *offset + 1)
return -ENOBUFS;
@@ -91,7 +91,7 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset,
else if (r == -ENOBUFS && (file || sname)) {
/* did not fit, but we have more buffers to try
close the options array and move the offset to its end */
- r = option_append(message->options, size, offset, DHCP_OPTION_END, 0, NULL);
+ r = option_append(message->options, size, offset, SD_DHCP_OPTION_END, 0, NULL);
if (r < 0)
return r;
@@ -112,7 +112,7 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset,
} else if (r == -ENOBUFS && sname) {
/* did not fit, but we have more buffers to try
close the file array and move the offset to its end */
- r = option_append(message->options, size, offset, DHCP_OPTION_END, 0, NULL);
+ r = option_append(message->options, size, offset, SD_DHCP_OPTION_END, 0, NULL);
if (r < 0)
return r;
@@ -152,10 +152,10 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
code = options[offset ++];
switch (code) {
- case DHCP_OPTION_PAD:
+ case SD_DHCP_OPTION_PAD:
continue;
- case DHCP_OPTION_END:
+ case SD_DHCP_OPTION_END:
return 0;
}
@@ -170,7 +170,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
option = &options[offset];
switch (code) {
- case DHCP_OPTION_MESSAGE_TYPE:
+ case SD_DHCP_OPTION_MESSAGE_TYPE:
if (len != 1)
return -EINVAL;
@@ -179,7 +179,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
break;
- case DHCP_OPTION_ERROR_MESSAGE:
+ case SD_DHCP_OPTION_ERROR_MESSAGE:
if (len == 0)
return -EINVAL;
@@ -203,7 +203,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
}
break;
- case DHCP_OPTION_OVERLOAD:
+ case SD_DHCP_OPTION_OVERLOAD:
if (len != 1)
return -EINVAL;