sd-dhcp6-client: use proper type for string table lookup funcs
This commit is contained in:
@@ -167,10 +167,10 @@ int dhcp6_network_bind_udp_socket(int ifindex, struct in6_addr *address);
|
||||
int dhcp6_network_send_udp_socket(int s, struct in6_addr *address,
|
||||
const void *packet, size_t len);
|
||||
|
||||
const char *dhcp6_message_type_to_string(int s) _const_;
|
||||
int dhcp6_message_type_from_string(const char *s) _pure_;
|
||||
const char *dhcp6_message_status_to_string(int s) _const_;
|
||||
int dhcp6_message_status_from_string(const char *s) _pure_;
|
||||
const char *dhcp6_message_type_to_string(DHCP6MessageType t) _const_;
|
||||
DHCP6MessageType dhcp6_message_type_from_string(const char *s) _pure_;
|
||||
const char *dhcp6_message_status_to_string(DHCP6Status s) _const_;
|
||||
DHCP6Status dhcp6_message_status_from_string(const char *s) _pure_;
|
||||
|
||||
void dhcp6_client_set_test_mode(sd_dhcp6_client *client, bool test_mode);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ static const uint16_t default_req_opts[] = {
|
||||
SD_DHCP6_OPTION_SNTP_SERVERS,
|
||||
};
|
||||
|
||||
const char * dhcp6_message_type_table[_DHCP6_MESSAGE_TYPE_MAX] = {
|
||||
static const char * const dhcp6_message_type_table[_DHCP6_MESSAGE_TYPE_MAX] = {
|
||||
[DHCP6_MESSAGE_SOLICIT] = "Solicit",
|
||||
[DHCP6_MESSAGE_ADVERTISE] = "Advertise",
|
||||
[DHCP6_MESSAGE_REQUEST] = "Request",
|
||||
@@ -75,9 +75,9 @@ const char * dhcp6_message_type_table[_DHCP6_MESSAGE_TYPE_MAX] = {
|
||||
[DHCP6_MESSAGE_CONTACT] = "Contact",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_type, int);
|
||||
DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_type, DHCP6MessageType);
|
||||
|
||||
const char * dhcp6_message_status_table[_DHCP6_STATUS_MAX] = {
|
||||
static const char * const dhcp6_message_status_table[_DHCP6_STATUS_MAX] = {
|
||||
[DHCP6_STATUS_SUCCESS] = "Success",
|
||||
[DHCP6_STATUS_UNSPEC_FAIL] = "Unspecified failure",
|
||||
[DHCP6_STATUS_NO_ADDRS_AVAIL] = "No addresses available",
|
||||
@@ -103,7 +103,7 @@ const char * dhcp6_message_status_table[_DHCP6_STATUS_MAX] = {
|
||||
[DHCP6_STATUS_EXCESSIVE_TIME_SKEW] = "Excessive time skew",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_status, int);
|
||||
DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_status, DHCP6Status);
|
||||
|
||||
#define DHCP6_CLIENT_DONT_DESTROY(client) \
|
||||
_cleanup_(sd_dhcp6_client_unrefp) _unused_ sd_dhcp6_client *_dont_destroy_##client = sd_dhcp6_client_ref(client)
|
||||
|
||||
Reference in New Issue
Block a user