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 0a40ceaf9c8bfbb5569f4b6de3430439b35dcc3a..7d26d866818c64bed08fc3d9267e97963c6dc36c 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 23f1ef27820c68ecd26ad652e68b26da52b9236e..24a772863e89aa9ba7397030a620b0ef8387b19a 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