From b389f8d373c2d8f5c636d40ec020e5e2adf0f01c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 14 Oct 2008 13:57:41 +0200 Subject: Add function for requesting link status --- src/rtnl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/rtnl.c b/src/rtnl.c index 6549488b..1cc59b64 100644 --- a/src/rtnl.c +++ b/src/rtnl.c @@ -406,6 +406,26 @@ int __connman_rtnl_send(const void *buf, size_t len) (struct sockaddr *) &addr, sizeof(addr)); } +int connman_rtnl_send_getlink(void) +{ + struct { + struct nlmsghdr hdr; + struct rtgenmsg msg; + } req; + + DBG(""); + + memset(&req, 0, sizeof(req)); + req.hdr.nlmsg_len = sizeof(req.hdr) + sizeof(req.msg); + req.hdr.nlmsg_type = RTM_GETLINK; + req.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + req.hdr.nlmsg_pid = 0; + req.hdr.nlmsg_seq = 42; + req.msg.rtgen_family = AF_INET; + + __connman_rtnl_send(&req, sizeof(req)); +} + int __connman_rtnl_init(void) { struct sockaddr_nl addr; -- cgit v1.2.3