/* no useful addresses found */
link->operstate = LINK_OPERSTATE_CARRIER;
} else if (link->flags & IFF_UP)
- link->operstate = LINK_OPERSTATE_UP;
+ link->operstate = LINK_OPERSTATE_NO_CARRIER;
else
- link->operstate = LINK_OPERSTATE_DOWN;
+ link->operstate = LINK_OPERSTATE_OFF;
}
int link_save(Link *link) {
DEFINE_STRING_TABLE_LOOKUP(link_state, LinkState);
static const char* const link_operstate_table[_LINK_OPERSTATE_MAX] = {
- [LINK_OPERSTATE_DOWN] = "down",
- [LINK_OPERSTATE_UP] = "up",
+ [LINK_OPERSTATE_OFF] = "off",
+ [LINK_OPERSTATE_NO_CARRIER] = "no-carrier",
[LINK_OPERSTATE_DORMANT] = "dormant",
[LINK_OPERSTATE_CARRIER] = "carrier",
[LINK_OPERSTATE_DEGRADED] = "degraded",
Iterator i;
_cleanup_free_ char *temp_path = NULL;
_cleanup_fclose_ FILE *f = NULL;
- LinkOperationalState operstate = LINK_OPERSTATE_DOWN;
+ LinkOperationalState operstate = LINK_OPERSTATE_OFF;
const char *operstate_str;
int r;
int sd_network_link_get_state(int ifindex, char **state);
/* Get operatinal state from ifindex.
- * Possible states: down, up, dormant, carrier, degraded, routable
+ * Possible states:
+ * off: the device is powered down
+ * no-carrier: the device is powered up, but it does not yet have a carrier
+ * dormant: the device has a carrier, but is not yet ready for normal traffic
+ * carrier: the link has a carrier
+ * degraded: the link has carrier and addresses valid on the local link configured
+ * routable: the link has carrier and routable address configured
* Possible return codes:
* -ENODATA: networkd is not aware of the link
*/