12 #ifndef NETLINK_SOCKET_H_ 13 #define NETLINK_SOCKET_H_ 15 #include <netlink/types.h> 16 #include <netlink/handlers.h> 26 extern uint32_t nl_socket_get_local_port(
struct nl_handle *);
36 extern uint32_t nl_socket_get_peer_port(
struct nl_handle *);
37 extern void nl_socket_set_peer_port(
struct nl_handle *,
40 extern struct nl_cb * nl_socket_get_cb(
struct nl_handle *);
41 extern void nl_socket_set_cb(
struct nl_handle *,
57 extern int nl_socket_get_fd(
struct nl_handle *);
void nl_socket_disable_msg_peek(struct nl_handle *)
Disable use of MSG_PEEK when reading from socket.
void nl_disable_sequence_check(struct nl_handle *)
Disable sequence number checking.
void nl_handle_destroy(struct nl_handle *)
Destroy netlink handle.
void nl_join_groups(struct nl_handle *, int)
Join multicast groups (deprecated)
unsigned int nl_socket_use_seq(struct nl_handle *)
Use next sequence number.
int nl_set_passcred(struct nl_handle *, int)
Enable/disable credential passing on netlink handle.
int nl_socket_recv_pktinfo(struct nl_handle *, int)
Enable/disable receival of additional packet information.
int nl_socket_set_nonblocking(struct nl_handle *)
Set file descriptor of socket handle to non-blocking state.
nl_cb_kind
Callback kinds.
struct nl_handle * nl_handle_alloc(void)
Allocate new netlink socket handle.
int nl_set_buffer_size(struct nl_handle *, int, int)
Set socket buffer size of netlink handle.
int(* nl_recvmsg_msg_cb_t)(struct nl_msg *msg, void *arg)
nl_recvmsgs() callback for message processing customization
struct nl_handle * nl_handle_alloc_cb(struct nl_cb *)
Allocate new socket handle with custom callbacks.
nl_cb_type
Callback types.
int nl_socket_drop_membership(struct nl_handle *, int)
Leave a group.
void nl_socket_set_local_port(struct nl_handle *, uint32_t)
Set local port of socket.
int nl_socket_modify_cb(struct nl_handle *, enum nl_cb_type, enum nl_cb_kind, nl_recvmsg_msg_cb_t, void *)
Modify the callback handler associated to the socket.
void nl_socket_enable_msg_peek(struct nl_handle *)
Enable use of MSG_PEEK when reading from socket.
int nl_socket_add_membership(struct nl_handle *, int)
Join a group.