diff options
author | Martin Willi <martin@revosec.ch> | 2014-09-24 11:20:53 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-09-24 11:20:53 +0200 |
commit | b3accbe2cb600a47cf7a184d6271d9e61f7c5e30 (patch) | |
tree | fea915e3c07cb4e81186f5b09d16e1969fe9716d /src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h | |
parent | 6fe02dda752cbb2c2389a3367a3b6e04add43425 (diff) | |
parent | 5ea627bdfad4026ca6cc4fe87f6f1959b8b057fe (diff) | |
download | strongswan-b3accbe2cb600a47cf7a184d6271d9e61f7c5e30.tar.bz2 strongswan-b3accbe2cb600a47cf7a184d6271d9e61f7c5e30.tar.xz |
Merge branch 'netlink-cleanups'
In preparation for larger parallelization changes in kernel-netlink, this
merge does some general code cleanup in that plugin.
Diffstat (limited to 'src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h')
-rw-r--r-- | src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h index 8be935bc3..069f746d1 100644 --- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h +++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.h @@ -26,7 +26,10 @@ * 1024 byte is currently sufficient for all operations. Some platform * require an enforced aligment to four bytes (e.g. ARM). */ -typedef u_char netlink_buf_t[1024] __attribute__((aligned(RTA_ALIGNTO))); +typedef union { + struct nlmsghdr hdr; + u_char bytes[1024]; +} netlink_buf_t __attribute__((aligned(RTA_ALIGNTO))); typedef struct netlink_socket_t netlink_socket_t; @@ -61,9 +64,10 @@ struct netlink_socket_t { /** * Create a netlink_socket_t object. * - * @param protocol protocol type (e.g. NETLINK_XFRM or NETLINK_ROUTE) + * @param protocol protocol type (e.g. NETLINK_XFRM or NETLINK_ROUTE) + * @param names optional enum names for Netlink messages */ -netlink_socket_t *netlink_socket_create(int protocol); +netlink_socket_t *netlink_socket_create(int protocol, enum_name_t *names); /** * Creates an rtattr and adds it to the given netlink message. |