libnl 1.1
|
00001 /* 00002 * netlink/socket.h Netlink Socket 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation version 2.1 00007 * of the License. 00008 * 00009 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> 00010 */ 00011 00012 #ifndef NETLINK_SOCKET_H_ 00013 #define NETLINK_SOCKET_H_ 00014 00015 #include <netlink/types.h> 00016 #include <netlink/handlers.h> 00017 00018 #ifdef __cplusplus 00019 extern "C" { 00020 #endif 00021 00022 extern struct nl_handle * nl_handle_alloc(void); 00023 extern struct nl_handle * nl_handle_alloc_cb(struct nl_cb *); 00024 extern void nl_handle_destroy(struct nl_handle *); 00025 00026 extern uint32_t nl_socket_get_local_port(struct nl_handle *); 00027 extern void nl_socket_set_local_port(struct nl_handle *, 00028 uint32_t); 00029 00030 extern int nl_socket_add_membership(struct nl_handle *, 00031 int); 00032 extern int nl_socket_drop_membership(struct nl_handle *, 00033 int); 00034 extern void nl_join_groups(struct nl_handle *, int); 00035 00036 extern uint32_t nl_socket_get_peer_port(struct nl_handle *); 00037 extern void nl_socket_set_peer_port(struct nl_handle *, 00038 uint32_t); 00039 00040 extern struct nl_cb * nl_socket_get_cb(struct nl_handle *); 00041 extern void nl_socket_set_cb(struct nl_handle *, 00042 struct nl_cb *); 00043 extern int nl_socket_modify_cb(struct nl_handle *, 00044 enum nl_cb_type, 00045 enum nl_cb_kind, 00046 nl_recvmsg_msg_cb_t, 00047 void *); 00048 00049 extern int nl_set_buffer_size(struct nl_handle *, 00050 int, int); 00051 extern int nl_set_passcred(struct nl_handle *, int); 00052 extern int nl_socket_recv_pktinfo(struct nl_handle *, int); 00053 00054 extern void nl_disable_sequence_check(struct nl_handle *); 00055 extern unsigned int nl_socket_use_seq(struct nl_handle *); 00056 00057 extern int nl_socket_get_fd(struct nl_handle *); 00058 extern int nl_socket_set_nonblocking(struct nl_handle *); 00059 extern void nl_socket_enable_msg_peek(struct nl_handle *); 00060 extern void nl_socket_disable_msg_peek(struct nl_handle *); 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif 00065 00066 #endif