diff options
author | Tom Gundersen <teg@jklm.no> | 2014-05-19 20:44:21 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-05-19 20:44:21 +0200 |
commit | e375dcde7202d5df4e29f5258e0f8c2bcea4535c (patch) | |
tree | 68b487f54d01cc0fafc6db3364620266435b1171 /src/network/networkd.h | |
parent | bcb7a07e0a785bda1eed658e984ff6b4a11cba9a (diff) |
networkd/sd-network: extend operational states
Expose states 'degraded' or 'routable' if a link has a site/link-local or a routable address, respectively.
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r-- | src/network/networkd.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h index 46ed2ac66f..cfe24f5702 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -212,6 +212,16 @@ typedef enum LinkState { _LINK_STATE_INVALID = -1 } LinkState; +typedef enum LinkOperationalState { + LINK_OPERSTATE_UNKNOWN, + LINK_OPERSTATE_DORMANT, + LINK_OPERSTATE_CARRIER, + LINK_OPERSTATE_DEGRADED, + LINK_OPERSTATE_ROUTABLE, + _LINK_OPERSTATE_MAX, + _LINK_OPERSTATE_INVALID = -1 +} LinkOperationalState; + struct Link { Manager *manager; @@ -224,11 +234,12 @@ struct Link { struct udev_device *udev_device; unsigned flags; - uint8_t operstate; + uint8_t kernel_operstate; Network *network; LinkState state; + LinkOperationalState operstate; unsigned addr_messages; unsigned route_messages; @@ -423,6 +434,9 @@ bool link_has_carrier(unsigned flags, uint8_t operstate); const char* link_state_to_string(LinkState s) _const_; LinkState link_state_from_string(const char *s) _pure_; +const char* link_operstate_to_string(LinkOperationalState s) _const_; +LinkOperationalState link_operstate_from_string(const char *s) _pure_; + DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref); #define _cleanup_link_unref_ _cleanup_(link_unrefp) |