diff --git a/src/libsystemd-network/dhcp-client-internal.h b/src/libsystemd-network/dhcp-client-internal.h index bd9308e2d1..4adaeeec22 100644 --- a/src/libsystemd-network/dhcp-client-internal.h +++ b/src/libsystemd-network/dhcp-client-internal.h @@ -4,6 +4,7 @@ #include "sd-dhcp-client.h" #include "dhcp-client-id-internal.h" +#include "dhcp-protocol.h" #include "ether-addr-util.h" #include "iovec-wrapper.h" #include "network-common.h" @@ -11,22 +12,6 @@ #include "socket-util.h" #include "tlv-util.h" -typedef enum DHCPState { - DHCP_STATE_STOPPED, - DHCP_STATE_INIT, - DHCP_STATE_SELECTING, - DHCP_STATE_INIT_REBOOT, - DHCP_STATE_REBOOTING, - DHCP_STATE_REQUESTING, - DHCP_STATE_BOUND, - DHCP_STATE_RENEWING, - DHCP_STATE_REBINDING, - _DHCP_STATE_MAX, - _DHCP_STATE_INVALID = -EINVAL, -} DHCPState; - -DECLARE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState); - struct sd_dhcp_client { unsigned n_ref; diff --git a/src/libsystemd-network/dhcp-protocol.c b/src/libsystemd-network/dhcp-protocol.c index caf92c494e..3a42087766 100644 --- a/src/libsystemd-network/dhcp-protocol.c +++ b/src/libsystemd-network/dhcp-protocol.c @@ -188,3 +188,17 @@ static const char * const dhcp_option_code_table[] = { }; DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_option_code, int); + +static const char* const dhcp_state_table[_DHCP_STATE_MAX] = { + [DHCP_STATE_STOPPED] = "stopped", + [DHCP_STATE_INIT] = "initialization", + [DHCP_STATE_SELECTING] = "selecting", + [DHCP_STATE_INIT_REBOOT] = "init-reboot", + [DHCP_STATE_REBOOTING] = "rebooting", + [DHCP_STATE_REQUESTING] = "requesting", + [DHCP_STATE_BOUND] = "bound", + [DHCP_STATE_RENEWING] = "renewing", + [DHCP_STATE_REBINDING] = "rebinding", +}; + +DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState); diff --git a/src/libsystemd-network/dhcp-protocol.h b/src/libsystemd-network/dhcp-protocol.h index 2acdb3693c..eb4799ba1c 100644 --- a/src/libsystemd-network/dhcp-protocol.h +++ b/src/libsystemd-network/dhcp-protocol.h @@ -138,3 +138,19 @@ enum { }; DECLARE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_option_code, int); + +typedef enum DHCPState { + DHCP_STATE_STOPPED, + DHCP_STATE_INIT, + DHCP_STATE_SELECTING, + DHCP_STATE_INIT_REBOOT, + DHCP_STATE_REBOOTING, + DHCP_STATE_REQUESTING, + DHCP_STATE_BOUND, + DHCP_STATE_RENEWING, + DHCP_STATE_REBINDING, + _DHCP_STATE_MAX, + _DHCP_STATE_INVALID = -EINVAL, +} DHCPState; + +DECLARE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState); diff --git a/src/libsystemd-network/fuzz-dhcp-client.c b/src/libsystemd-network/fuzz-dhcp-client.c index 0737e0c2cd..82c92c914b 100644 --- a/src/libsystemd-network/fuzz-dhcp-client.c +++ b/src/libsystemd-network/fuzz-dhcp-client.c @@ -6,7 +6,7 @@ #include "sd-event.h" #include "sd-json.h" -#include "dhcp-client-internal.h" +#include "dhcp-client-internal.h" /* IWYU pragma: keep */ #include "dhcp-lease-internal.h" #include "dhcp-message.h" #include "fd-util.h" diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index d94e6057d5..5675c7d787 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -24,7 +24,6 @@ #include "random-util.h" #include "set.h" #include "socket-util.h" -#include "string-table.h" #include "string-util.h" #include "time-util.h" #include "web-util.h" @@ -1443,17 +1442,3 @@ int sd_dhcp_client_new(sd_dhcp_client **ret) { return 0; } - -static const char* const dhcp_state_table[_DHCP_STATE_MAX] = { - [DHCP_STATE_STOPPED] = "stopped", - [DHCP_STATE_INIT] = "initialization", - [DHCP_STATE_SELECTING] = "selecting", - [DHCP_STATE_INIT_REBOOT] = "init-reboot", - [DHCP_STATE_REBOOTING] = "rebooting", - [DHCP_STATE_REQUESTING] = "requesting", - [DHCP_STATE_BOUND] = "bound", - [DHCP_STATE_RENEWING] = "renewing", - [DHCP_STATE_REBINDING] = "rebinding", -}; - -DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState);