summaryrefslogtreecommitdiffstats
path: root/nhrpd/znl.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-12-25 10:32:11 +0200
committerTimo Teräs <timo.teras@iki.fi>2016-03-30 16:59:22 +0300
commit068e64859913c6844bbe6703815a633175650547 (patch)
tree3efc0440477560ac6211f9da3bea3f812bb05270 /nhrpd/znl.h
parent76aaa0456a3804a0a1d2948d9a391383b62cbe37 (diff)
downloadquagga-nhrp.tar.bz2
quagga-nhrp.tar.xz
initial implementation of nhrpnhrp
this is nhrp changes from commit c321432aef01e13116980983f0a50ba486505804 rebased on quagga master and updated for vrf changes
Diffstat (limited to 'nhrpd/znl.h')
-rw-r--r--nhrpd/znl.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/nhrpd/znl.h b/nhrpd/znl.h
new file mode 100644
index 00000000..2cd630b5
--- /dev/null
+++ b/nhrpd/znl.h
@@ -0,0 +1,29 @@
+/* Netlink helpers for zbuf
+ * Copyright (c) 2014-2015 Timo Teräs
+ *
+ * This file is free software: you may copy, redistribute and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "zbuf.h"
+
+#define ZNL_BUFFER_SIZE 8192
+
+void *znl_push(struct zbuf *zb, size_t n);
+void *znl_pull(struct zbuf *zb, size_t n);
+
+struct nlmsghdr *znl_nlmsg_push(struct zbuf *zb, uint16_t type, uint16_t flags);
+void znl_nlmsg_complete(struct zbuf *zb, struct nlmsghdr *n);
+struct nlmsghdr *znl_nlmsg_pull(struct zbuf *zb, struct zbuf *payload);
+
+struct rtattr *znl_rta_push(struct zbuf *zb, uint16_t type, const void *val, size_t len);
+struct rtattr *znl_rta_push_u32(struct zbuf *zb, uint16_t type, uint32_t val);
+struct rtattr *znl_rta_nested_push(struct zbuf *zb, uint16_t type);
+void znl_rta_nested_complete(struct zbuf *zb, struct rtattr *rta);
+
+struct rtattr *znl_rta_pull(struct zbuf *zb, struct zbuf *payload);
+
+int znl_open(int protocol, int groups);
+