core: expose IP4 wait state to subclasses

We'll need to this to determine whether or not to retry IP config
from device subclasses.
This commit is contained in:
Dan Williams 2013-01-28 13:34:44 -06:00
parent 06bac8fcda
commit 37febd6228
4 changed files with 38 additions and 0 deletions

View file

@ -65,7 +65,10 @@ void nm_device_activate_schedule_ip6_config_result (NMDevice *device, NMIP6Confi
void nm_device_activate_schedule_ip6_config_timeout (NMDevice *device);
gboolean nm_device_activate_ip4_state_in_conf (NMDevice *device);
gboolean nm_device_activate_ip4_state_in_wait (NMDevice *device);
gboolean nm_device_activate_ip6_state_in_conf (NMDevice *device);
gboolean nm_device_activate_ip6_state_in_wait (NMDevice *device);
void nm_device_set_dhcp_timeout (NMDevice *device, guint32 timeout);
void nm_device_set_dhcp_anycast_address (NMDevice *device, guint8 *addr);

View file

@ -3458,6 +3458,13 @@ nm_device_activate_ip4_state_in_conf (NMDevice *self)
return NM_DEVICE_GET_PRIVATE (self)->ip4_state == IP_CONF;
}
gboolean
nm_device_activate_ip4_state_in_wait (NMDevice *self)
{
g_return_val_if_fail (self != NULL, FALSE);
return NM_DEVICE_GET_PRIVATE (self)->ip4_state == IP_WAIT;
}
static gboolean
nm_device_activate_ip6_config_commit (gpointer user_data)
{
@ -3550,6 +3557,13 @@ nm_device_activate_ip6_state_in_conf (NMDevice *self)
return NM_DEVICE_GET_PRIVATE (self)->ip6_state == IP_CONF;
}
gboolean
nm_device_activate_ip6_state_in_wait (NMDevice *self)
{
g_return_val_if_fail (self != NULL, FALSE);
return NM_DEVICE_GET_PRIVATE (self)->ip6_state == IP_WAIT;
}
static void
clear_act_request (NMDevice *self)
{

View file

@ -596,6 +596,24 @@ nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *self, GError **error)
return TRUE;
}
gboolean
nm_netlink_monitor_request_bridge_info (NMNetlinkMonitor *self, GError **error)
{
NMNetlinkMonitorPrivate *priv;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE);
priv = NM_NETLINK_MONITOR_GET_PRIVATE (self);
/* FIXME: nl_rtgen_request() gets the return value screwed up with
* libnl-1.1; revisit this and return a proper error when we port to
* a later libnl.
*/
nl_rtgen_request (priv->nlh_event, RTM_GETLINK, AF_BRIDGE, NLM_F_DUMP);
return TRUE;
}
static gboolean
deferred_emit_carrier_state (gpointer user_data)

View file

@ -81,6 +81,9 @@ void nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *monitor
gboolean nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *monitor,
GError **error);
gboolean nm_netlink_monitor_request_bridge_info (NMNetlinkMonitor *monitor,
GError **error);
void nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor);
gboolean nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *monitor,