]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd-network/dhcp-protocol.h
Adding dhcp_state_to_string and dhcp client state change logging
[thirdparty/systemd.git] / src / libsystemd-network / dhcp-protocol.h
index 2dc0660cc7d7b59dbce56e32d6c9e1a532d8d048..dd330ae83938829a5600ac3447ccfe914f449913 100644 (file)
@@ -55,15 +55,17 @@ enum {
 };
 
 enum DHCPState {
-        DHCP_STATE_STOPPED                      = 0,
-        DHCP_STATE_INIT                         = 1,
-        DHCP_STATE_SELECTING                    = 2,
-        DHCP_STATE_INIT_REBOOT                  = 3,
-        DHCP_STATE_REBOOTING                    = 4,
-        DHCP_STATE_REQUESTING                   = 5,
-        DHCP_STATE_BOUND                        = 6,
-        DHCP_STATE_RENEWING                     = 7,
-        DHCP_STATE_REBINDING                    = 8,
+        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,
 };
 
 typedef enum DHCPState DHCPState;
@@ -107,3 +109,5 @@ enum {
         DHCP_FQDN_FLAG_E = (1 << 2),
         DHCP_FQDN_FLAG_N = (1 << 3),
 };
+
+const char *dhcp_state_to_string(DHCPState s) _const_;