Update libnl++ class naming to match Android code style
nl::nlbuf -> nl::Buffer
nl::nlmsg -> nl::Message
nl::NetlinkRequest -> nl::MessageFactory
nl::NetlinkSocket -> nl::Socket
Bug: 162032964
Test: it builds
Change-Id: Id9858805ff3fce3e48f9a82b7dbaea09269bcb3c
diff --git a/automotive/can/1.0/default/libnetdevice/can.cpp b/automotive/can/1.0/default/libnetdevice/can.cpp
index c6f1b04..b047bc9 100644
--- a/automotive/can/1.0/default/libnetdevice/can.cpp
+++ b/automotive/can/1.0/default/libnetdevice/can.cpp
@@ -20,8 +20,8 @@
#include <android-base/logging.h>
#include <android-base/unique_fd.h>
-#include <libnl++/NetlinkRequest.h>
-#include <libnl++/NetlinkSocket.h>
+#include <libnl++/MessageFactory.h>
+#include <libnl++/Socket.h>
#include <linux/can.h>
#include <linux/can/error.h>
@@ -70,7 +70,7 @@
struct can_bittiming bt = {};
bt.bitrate = bitrate;
- nl::NetlinkRequest<struct ifinfomsg> req(RTM_NEWLINK, NLM_F_REQUEST);
+ nl::MessageFactory<struct ifinfomsg> req(RTM_NEWLINK, NLM_F_REQUEST);
const auto ifidx = nametoindex(ifname);
if (ifidx == 0) {
@@ -90,7 +90,7 @@
}
}
- nl::NetlinkSocket sock(NETLINK_ROUTE);
+ nl::Socket sock(NETLINK_ROUTE);
return sock.send(req) && sock.receiveAck();
}
diff --git a/automotive/can/1.0/default/libnetdevice/common.h b/automotive/can/1.0/default/libnetdevice/common.h
index 201909f..661e3f8 100644
--- a/automotive/can/1.0/default/libnetdevice/common.h
+++ b/automotive/can/1.0/default/libnetdevice/common.h
@@ -16,8 +16,6 @@
#pragma once
-#include <libnl++/nlbuf.h>
-
#include <linux/can.h>
#include <net/if.h>
diff --git a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
index aeb5005..f7f5f4d 100644
--- a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
+++ b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
@@ -20,8 +20,8 @@
#include "ifreqs.h"
#include <android-base/logging.h>
-#include <libnl++/NetlinkRequest.h>
-#include <libnl++/NetlinkSocket.h>
+#include <libnl++/MessageFactory.h>
+#include <libnl++/Socket.h>
#include <linux/can.h>
#include <linux/rtnetlink.h>
@@ -62,7 +62,7 @@
}
bool add(std::string dev, std::string type) {
- nl::NetlinkRequest<struct ifinfomsg> req(RTM_NEWLINK,
+ nl::MessageFactory<struct ifinfomsg> req(RTM_NEWLINK,
NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL);
req.addattr(IFLA_IFNAME, dev);
@@ -71,15 +71,15 @@
req.addattr(IFLA_INFO_KIND, type);
}
- nl::NetlinkSocket sock(NETLINK_ROUTE);
+ nl::Socket sock(NETLINK_ROUTE);
return sock.send(req) && sock.receiveAck();
}
bool del(std::string dev) {
- nl::NetlinkRequest<struct ifinfomsg> req(RTM_DELLINK, NLM_F_REQUEST);
+ nl::MessageFactory<struct ifinfomsg> req(RTM_DELLINK, NLM_F_REQUEST);
req.addattr(IFLA_IFNAME, dev);
- nl::NetlinkSocket sock(NETLINK_ROUTE);
+ nl::Socket sock(NETLINK_ROUTE);
return sock.send(req) && sock.receiveAck();
}
diff --git a/automotive/can/1.0/default/libnetdevice/vlan.cpp b/automotive/can/1.0/default/libnetdevice/vlan.cpp
index e419154..3e07f67 100644
--- a/automotive/can/1.0/default/libnetdevice/vlan.cpp
+++ b/automotive/can/1.0/default/libnetdevice/vlan.cpp
@@ -19,8 +19,8 @@
#include "common.h"
#include <android-base/logging.h>
-#include <libnl++/NetlinkRequest.h>
-#include <libnl++/NetlinkSocket.h>
+#include <libnl++/MessageFactory.h>
+#include <libnl++/Socket.h>
#include <linux/rtnetlink.h>
@@ -33,7 +33,7 @@
return false;
}
- nl::NetlinkRequest<struct ifinfomsg> req(RTM_NEWLINK,
+ nl::MessageFactory<struct ifinfomsg> req(RTM_NEWLINK,
NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL);
req.addattr(IFLA_IFNAME, vlan);
req.addattr<uint32_t>(IFLA_LINK, ethidx);
@@ -48,7 +48,7 @@
}
}
- nl::NetlinkSocket sock(NETLINK_ROUTE);
+ nl::Socket sock(NETLINK_ROUTE);
return sock.send(req) && sock.receiveAck();
}