diff options
author | JP Abgrall <jpa@google.com> | 2014-02-21 12:01:13 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-21 12:01:13 -0800 |
commit | aee749445619dd678094e416527b43d39d763bd8 (patch) | |
tree | e146cd87948eb11eb195d463b49dc8b1bdeb0db0 /lib/genl/genl.c | |
parent | 87470d5d06cc0a0b4624f84bbdf15b2334f4f9b9 (diff) | |
parent | 823435f737de20d5ca9f4aa2ba0ae2950dbb5d4f (diff) | |
download | android_external_libnl-aee749445619dd678094e416527b43d39d763bd8.tar.gz android_external_libnl-aee749445619dd678094e416527b43d39d763bd8.tar.bz2 android_external_libnl-aee749445619dd678094e416527b43d39d763bd8.zip |
am 823435f7: Merge remote-tracking branch \'upstream_linaro/linaro-libnl2_0\'
* commit '823435f737de20d5ca9f4aa2ba0ae2950dbb5d4f': (159 commits)
Updating group definition to follow 3.13 kernel
Adding version.h
Adding support for netlink API and quota in nfaccounting
Compile 2.0 with Kitkat
Don't include pktloc_syntax.h in BUILT_SOURCES
route_obj: don't add empty destination to nlmsg
automake: add ${top_builddir}/include to AM_CFLAGS
Use CPPFLAGS
Put preprocessor definitions in AM_CPPFLAGS
add user data to change_func_t for caches
Trivial fix for TBF memleak
libnl: optionally disable cli tools.
Ignore vim swap files
Let git ignore generated pktloc source files
Fix compile warning in utils.c
Fix compile warning in nl.c
Packet Location Interface
src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE
Don't install private header files.
object: fix attribute comparison
...
Diffstat (limited to 'lib/genl/genl.c')
-rw-r--r-- | lib/genl/genl.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/genl/genl.c b/lib/genl/genl.c index 04cfebf..055be91 100644 --- a/lib/genl/genl.c +++ b/lib/genl/genl.c @@ -6,11 +6,10 @@ * License as published by the Free Software Foundation version 2.1 * of the License. * - * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> + * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ /** - * @ingroup nlfam * @defgroup genl Generic Netlink * * @par Message Format @@ -38,12 +37,12 @@ * #include <netlink/genl/genl.h> * #include <netlink/genl/ctrl.h> * - * struct nl_handle *sock; + * struct nl_sock *sock; * struct nl_msg *msg; * int family; * * // Allocate a new netlink socket - * sock = nl_handle_alloc(); + * sock = nl_socket_alloc(); * * // Connect to generic netlink socket on kernel side * genl_connect(sock); @@ -100,9 +99,9 @@ * @{ */ -int genl_connect(struct nl_handle *handle) +int genl_connect(struct nl_sock *sk) { - return nl_connect(handle, NETLINK_GENERIC); + return nl_connect(sk, NETLINK_GENERIC); } /** @} */ @@ -114,7 +113,7 @@ int genl_connect(struct nl_handle *handle) /** * Send trivial generic netlink message - * @arg handle Netlink handle. + * @arg sk Netlink socket. * @arg family Generic netlink family * @arg cmd Command * @arg version Version @@ -125,7 +124,7 @@ int genl_connect(struct nl_handle *handle) * * @return 0 on success or a negative error code. */ -int genl_send_simple(struct nl_handle *handle, int family, int cmd, +int genl_send_simple(struct nl_sock *sk, int family, int cmd, int version, int flags) { struct genlmsghdr hdr = { @@ -133,7 +132,7 @@ int genl_send_simple(struct nl_handle *handle, int family, int cmd, .version = version, }; - return nl_send_simple(handle, family, flags, &hdr, sizeof(hdr)); + return nl_send_simple(sk, family, flags, &hdr, sizeof(hdr)); } /** @} */ @@ -164,7 +163,7 @@ int genlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, struct genlmsghdr *ghdr; if (!genlmsg_valid_hdr(nlh, hdrlen)) - return nl_errno(EINVAL); + return -NLE_MSG_TOOSHORT; ghdr = nlmsg_data(nlh); return nla_validate(genlmsg_attrdata(ghdr, hdrlen), @@ -177,7 +176,7 @@ int genlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], struct genlmsghdr *ghdr; if (!genlmsg_valid_hdr(nlh, hdrlen)) - return nl_errno(EINVAL); + return -NLE_MSG_TOOSHORT; ghdr = nlmsg_data(nlh); return nla_parse(tb, maxtype, genlmsg_attrdata(ghdr, hdrlen), |