summaryrefslogtreecommitdiff
path: root/osdep/LinuxNetLink.hpp
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2018-05-24 16:15:03 -0700
committerGrant Limberg <grant.limberg@zerotier.com>2018-05-24 16:15:03 -0700
commit7da4b0af15fe5ff48db75471a3b416bbf2a6b822 (patch)
treef5b1b1baa040cfbb90cfad6726cd3ebd869e38f5 /osdep/LinuxNetLink.hpp
parent2fff651378072c894bc097b244b5ea9c97b7d021 (diff)
downloadinfinitytier-7da4b0af15fe5ff48db75471a3b416bbf2a6b822.tar.gz
infinitytier-7da4b0af15fe5ff48db75471a3b416bbf2a6b822.zip
better data localization in LinuxNetLink now that I know what Im doing
Diffstat (limited to 'osdep/LinuxNetLink.hpp')
-rw-r--r--osdep/LinuxNetLink.hpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/osdep/LinuxNetLink.hpp b/osdep/LinuxNetLink.hpp
index 519bb435..8ee42ee4 100644
--- a/osdep/LinuxNetLink.hpp
+++ b/osdep/LinuxNetLink.hpp
@@ -79,19 +79,19 @@ public:
RouteList getIPV4Routes() const;
RouteList getIPV6Routes() const;
- void addInterface(const char *iface);
+ void addInterface(const char *iface, unsigned int mtu);
void addAddress(const InetAddress &addr, const char *iface);
void threadMain() throw();
private:
- void _processMessage();
- void _routeAdded();
- void _routeDeleted();
- void _linkAdded();
- void _linkDeleted();
- void _ipAddressAdded();
- void _ipAddressDeleted();
+ void _processMessage(struct nlmsghdr *nlp, int nll);
+ void _routeAdded(struct nlmsghdr *nlp);
+ void _routeDeleted(struct nlmsghdr *nlp);
+ void _linkAdded(struct nlmsghdr *nlp);
+ void _linkDeleted(struct nlmsghdr *nlp);
+ void _ipAddressAdded(struct nlmsghdr *nlp);
+ void _ipAddressDeleted(struct nlmsghdr *nlp);
void _requestIPv4Routes();
@@ -103,29 +103,11 @@ private:
RouteList _routes_ipv4;
RouteList _routes_ipv6;
+ uint32_t _seq;
+
// socket communication vars;
int _fd;
struct sockaddr_nl _la;
- struct sockaddr_nl _pa;
- struct msghdr _msg;
- struct iovec _iov;
- int _rtn;
- char _buf[8192];
-
- // RTNETLINK message pointers & lengths
- // used for processing messages
- struct nlmsghdr *_nlp;
- int _nll;
-
- struct rtmsg *_rtp;
- int _rtl;
- struct rtattr *_rtap;
-
- struct ifinfomsg *_ifip;
- int _ifil;
-
- struct ifaddrmsg *_ifap;
- int _ifal;
};
}