queue_msg.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * netlink/netfilter/queue_msg.h Netfilter Queue Messages
  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) 2007, 2008 Patrick McHardy <kaber@trash.net>
  10. */
  11. #ifndef NETLINK_QUEUE_MSG_H_
  12. #define NETLINK_QUEUE_MSG_H_
  13. #include <netlink/netlink.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. struct nl_sock;
  18. struct nlmsghdr;
  19. struct nfnl_queue_msg;
  20. extern struct nl_object_ops queue_msg_obj_ops;
  21. /* General */
  22. extern struct nfnl_queue_msg * nfnl_queue_msg_alloc(void);
  23. extern int nfnlmsg_queue_msg_parse(struct nlmsghdr *,
  24. struct nfnl_queue_msg **);
  25. extern void nfnl_queue_msg_get(struct nfnl_queue_msg *);
  26. extern void nfnl_queue_msg_put(struct nfnl_queue_msg *);
  27. extern void nfnl_queue_msg_set_group(struct nfnl_queue_msg *, uint16_t);
  28. extern int nfnl_queue_msg_test_group(const struct nfnl_queue_msg *);
  29. extern uint16_t nfnl_queue_msg_get_group(const struct nfnl_queue_msg *);
  30. extern void nfnl_queue_msg_set_family(struct nfnl_queue_msg *, uint8_t);
  31. extern int nfnl_queue_msg_test_family(const struct nfnl_queue_msg *);
  32. extern uint8_t nfnl_queue_msg_get_family(const struct nfnl_queue_msg *);
  33. extern void nfnl_queue_msg_set_packetid(struct nfnl_queue_msg *, uint32_t);
  34. extern int nfnl_queue_msg_test_packetid(const struct nfnl_queue_msg *);
  35. extern uint32_t nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *);
  36. extern void nfnl_queue_msg_set_hwproto(struct nfnl_queue_msg *, uint16_t);
  37. extern int nfnl_queue_msg_test_hwproto(const struct nfnl_queue_msg *);
  38. extern uint16_t nfnl_queue_msg_get_hwproto(const struct nfnl_queue_msg *);
  39. extern void nfnl_queue_msg_set_hook(struct nfnl_queue_msg *, uint8_t);
  40. extern int nfnl_queue_msg_test_hook(const struct nfnl_queue_msg *);
  41. extern uint8_t nfnl_queue_msg_get_hook(const struct nfnl_queue_msg *);
  42. extern void nfnl_queue_msg_set_mark(struct nfnl_queue_msg *, uint32_t);
  43. extern int nfnl_queue_msg_test_mark(const struct nfnl_queue_msg *);
  44. extern uint32_t nfnl_queue_msg_get_mark(const struct nfnl_queue_msg *);
  45. extern void nfnl_queue_msg_set_timestamp(struct nfnl_queue_msg *,
  46. struct timeval *);
  47. extern int nfnl_queue_msg_test_timestamp(const struct nfnl_queue_msg *);
  48. extern const struct timeval * nfnl_queue_msg_get_timestamp(const struct nfnl_queue_msg *);
  49. extern void nfnl_queue_msg_set_indev(struct nfnl_queue_msg *, uint32_t);
  50. extern int nfnl_queue_msg_test_indev(const struct nfnl_queue_msg *);
  51. extern uint32_t nfnl_queue_msg_get_indev(const struct nfnl_queue_msg *);
  52. extern void nfnl_queue_msg_set_outdev(struct nfnl_queue_msg *, uint32_t);
  53. extern int nfnl_queue_msg_test_outdev(const struct nfnl_queue_msg *);
  54. extern uint32_t nfnl_queue_msg_get_outdev(const struct nfnl_queue_msg *);
  55. extern void nfnl_queue_msg_set_physindev(struct nfnl_queue_msg *, uint32_t);
  56. extern int nfnl_queue_msg_test_physindev(const struct nfnl_queue_msg *);
  57. extern uint32_t nfnl_queue_msg_get_physindev(const struct nfnl_queue_msg *);
  58. extern void nfnl_queue_msg_set_physoutdev(struct nfnl_queue_msg *, uint32_t);
  59. extern int nfnl_queue_msg_test_physoutdev(const struct nfnl_queue_msg *);
  60. extern uint32_t nfnl_queue_msg_get_physoutdev(const struct nfnl_queue_msg *);
  61. extern void nfnl_queue_msg_set_hwaddr(struct nfnl_queue_msg *, uint8_t *, int);
  62. extern int nfnl_queue_msg_test_hwaddr(const struct nfnl_queue_msg *);
  63. extern const uint8_t * nfnl_queue_msg_get_hwaddr(const struct nfnl_queue_msg *, int *);
  64. extern int nfnl_queue_msg_set_payload(struct nfnl_queue_msg *, uint8_t *, int);
  65. extern int nfnl_queue_msg_test_payload(const struct nfnl_queue_msg *);
  66. extern const void * nfnl_queue_msg_get_payload(const struct nfnl_queue_msg *, int *);
  67. extern void nfnl_queue_msg_set_verdict(struct nfnl_queue_msg *,
  68. unsigned int);
  69. extern int nfnl_queue_msg_test_verdict(const struct nfnl_queue_msg *);
  70. extern unsigned int nfnl_queue_msg_get_verdict(const struct nfnl_queue_msg *);
  71. extern struct nl_msg * nfnl_queue_msg_build_verdict(const struct nfnl_queue_msg *);
  72. extern int nfnl_queue_msg_send_verdict(struct nl_sock *,
  73. const struct nfnl_queue_msg *);
  74. extern int nfnl_queue_msg_send_verdict_payload(struct nl_sock *,
  75. const struct nfnl_queue_msg *,
  76. const void *, unsigned );
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif