Skip to content

Commit

Permalink
ifstatus: slave device reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
kmroz committed Sep 11, 2014
1 parent eab5dba commit c2dc2ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/ifstatus.c
Expand Up @@ -94,6 +94,7 @@ ni_ifstatus_code_name(unsigned int status)
{ "no-config", NI_WICKED_ST_NO_CONFIG },
{ "setup-in-progress", NI_WICKED_ST_IN_PROGRESS },
{ "config-changed", NI_WICKED_ST_CHANGED_CONFIG },
{ "enslaved", NI_WICKED_ST_ENSLAVED },
{ "up", NI_WICKED_ST_OK },

{ NULL, ~0 }
Expand Down Expand Up @@ -186,6 +187,10 @@ __ifstatus_of_device(ni_netdev_t *dev)
if (!ni_ifcheck_device_is_up(dev))
return NI_WICKED_ST_NOT_RUNNING;

/* device is at least up, check if it is a slave device */
if (!ni_string_empty(dev->link.masterdev.name))
return NI_WICKED_ST_ENSLAVED;

if (!ni_ifcheck_device_link_is_up(dev))
return NI_WICKED_ST_IN_PROGRESS;

Expand Down
2 changes: 2 additions & 0 deletions include/wicked/constants.h
Expand Up @@ -274,6 +274,8 @@ typedef enum {
NI_WICKED_ST_IN_PROGRESS = 162, /*!< dev is up, but setup is incomplete */
NI_WICKED_ST_CHANGED_CONFIG = 163, /*!< up, config changed, reload advised */

NI_WICKED_ST_ENSLAVED = 164, /*!< dev is up and has masterdev */

NI_WICKED_ST_NOT_IN_STATE = 165, /*!< ifcheck state lower than expected */
NI_WICKED_ST_PERSISTENT_ON = 166, /*!< interface is in persistent mode */
NI_WICKED_ST_USERCONTROL_ON = 167, /*!< user is allowed to configure the interface */
Expand Down

0 comments on commit c2dc2ca

Please sign in to comment.