socket.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * netlink/socket.h Netlink Socket
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation version 2.1
  7. * of the License.
  8. *
  9. * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
  10. */
  11. #ifndef NETLINK_SOCKET_H_
  12. #define NETLINK_SOCKET_H_
  13. #include <netlink/types.h>
  14. #include <netlink/handlers.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. extern struct nl_handle * nl_handle_alloc(void);
  19. extern struct nl_handle * nl_handle_alloc_cb(struct nl_cb *);
  20. extern void nl_handle_destroy(struct nl_handle *);
  21. extern uint32_t nl_socket_get_local_port(struct nl_handle *);
  22. extern void nl_socket_set_local_port(struct nl_handle *,
  23. uint32_t);
  24. extern int nl_socket_add_membership(struct nl_handle *,
  25. int);
  26. extern int nl_socket_drop_membership(struct nl_handle *,
  27. int);
  28. extern void nl_join_groups(struct nl_handle *, int);
  29. extern uint32_t nl_socket_get_peer_port(struct nl_handle *);
  30. extern void nl_socket_set_peer_port(struct nl_handle *,
  31. uint32_t);
  32. extern struct nl_cb * nl_socket_get_cb(struct nl_handle *);
  33. extern void nl_socket_set_cb(struct nl_handle *,
  34. struct nl_cb *);
  35. extern int nl_socket_modify_cb(struct nl_handle *,
  36. enum nl_cb_type,
  37. enum nl_cb_kind,
  38. nl_recvmsg_msg_cb_t,
  39. void *);
  40. extern int nl_set_buffer_size(struct nl_handle *,
  41. int, int);
  42. extern int nl_set_passcred(struct nl_handle *, int);
  43. extern int nl_socket_recv_pktinfo(struct nl_handle *, int);
  44. extern void nl_disable_sequence_check(struct nl_handle *);
  45. extern unsigned int nl_socket_use_seq(struct nl_handle *);
  46. extern int nl_socket_get_fd(struct nl_handle *);
  47. extern int nl_socket_set_nonblocking(struct nl_handle *);
  48. extern void nl_socket_enable_msg_peek(struct nl_handle *);
  49. extern void nl_socket_disable_msg_peek(struct nl_handle *);
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif