summaryrefslogtreecommitdiffstats
path: root/watchlink/netlink_send.hh
diff options
context:
space:
mode:
Diffstat (limited to 'watchlink/netlink_send.hh')
-rw-r--r--watchlink/netlink_send.hh39
1 files changed, 39 insertions, 0 deletions
diff --git a/watchlink/netlink_send.hh b/watchlink/netlink_send.hh
new file mode 100644
index 00000000..3e13e5c8
--- /dev/null
+++ b/watchlink/netlink_send.hh
@@ -0,0 +1,39 @@
+/*
+ * Module: netlink_send.hh
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+#ifndef __NETLINK_SEND_HH__
+#define __NETLINK_SEND_HH__
+
+class NetlinkSend
+{
+public:
+ NetlinkSend(bool debug);
+ ~NetlinkSend();
+
+ int
+ send_get(int sock, int type, int ifindex = -1);
+
+ int
+ send_set(int sock, int ifindex, uint32_t local_addr, uint32_t addr, int mask_len, int type);
+
+ int
+ send_set_route(int sock, int ifindex, uint32_t local_addr, uint32_t dst_addr, int mask_len, int type, int table, int rtn_type, int rt_scope);
+
+private:
+ int
+ addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen);
+
+ int
+ addattr32(struct nlmsghdr *n, int maxlen, int type, int data);
+
+private:
+ bool _debug;
+
+};
+
+#endif //__NETLINK_SEND_HH__