rtnetlink-link: Expose carrier changes.
authorEthan Jackson <ethan@nicira.com>
Fri, 14 Oct 2011 22:39:49 +0000 (15:39 -0700)
committerEthan Jackson <ethan@nicira.com>
Mon, 17 Oct 2011 22:03:03 +0000 (15:03 -0700)
This will be used in a future commit.

lib/rtnetlink-link.c
lib/rtnetlink-link.h

index 0a40cea..7d26d86 100644 (file)
@@ -63,6 +63,7 @@ rtnetlink_link_parse(struct ofpbuf *buf,
         change->nlmsg_type     = nlmsg->nlmsg_type;
         change->ifi_index      = ifinfo->ifi_index;
         change->ifname         = nl_attr_get_string(attrs[IFLA_IFNAME]);
+        change->running        = ifinfo->ifi_flags & IFF_RUNNING;
         change->master_ifindex = (attrs[IFLA_MASTER]
                                   ? nl_attr_get_u32(attrs[IFLA_MASTER])
                                   : 0);
index 23f1ef2..24a7728 100644 (file)
@@ -37,6 +37,7 @@ struct rtnetlink_link_change {
     /* Extracted from Netlink attributes. */
     const char *ifname;         /* Name of network device. */
     int master_ifindex;         /* Ifindex of datapath master (0 if none). */
+    bool running;               /* Carrier of network device. */
 };
 
 /* Function called to report that a netdev has changed.  'change' describes the