diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2012-07-10 10:47:48 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2012-07-10 10:47:48 -0700 |
commit | de92239055ac87e51ef7e868ed9697d038a72368 (patch) | |
tree | 575a69eb4e78edf943aaa75fad92f9898045c8e3 | |
parent | 984410aebe0525e9fe3b80b94d06960094597b18 (diff) | |
download | system_core-de92239055ac87e51ef7e868ed9697d038a72368.zip system_core-de92239055ac87e51ef7e868ed9697d038a72368.tar.gz system_core-de92239055ac87e51ef7e868ed9697d038a72368.tar.bz2 |
libnl_2: Add nl_socket_set_cb() and nl_socket_get_cb()
Change-Id: Ibc2b4dc9528bd43d3fc85491c4838a33c916330e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | libnl_2/socket.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libnl_2/socket.c b/libnl_2/socket.c index d906cac..e94eb9e 100644 --- a/libnl_2/socket.c +++ b/libnl_2/socket.c @@ -127,3 +127,15 @@ int nl_socket_get_fd(struct nl_sock *sk) { return sk->s_fd; } + +void nl_socket_set_cb(struct nl_sock *sk, struct nl_cb *cb) +{ + nl_cb_put(sk->s_cb); + sk->s_cb = cb; + nl_cb_get(cb); +} + +struct nl_cb *nl_socket_get_cb(struct nl_sock *sk) +{ + return nl_cb_get(sk->s_cb); +} |