log_msg.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * netlink/netfilter/log_msg.h Netfilter Log Message
  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-2008 Thomas Graf <tgraf@suug.ch>
  10. * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
  11. * Copyright (c) 2007 Secure Computing Corporation
  12. * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
  13. */
  14. #ifndef NETLINK_LOG_MSG_H_
  15. #define NETLINK_LOG_MSG_H_
  16. #include <netlink/netlink.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct nlmsghdr;
  21. struct nfnl_log_msg;
  22. extern struct nl_object_ops log_msg_obj_ops;
  23. /* General */
  24. extern struct nfnl_log_msg *nfnl_log_msg_alloc(void);
  25. extern int nfnlmsg_log_msg_parse(struct nlmsghdr *,
  26. struct nfnl_log_msg **);
  27. extern void nfnl_log_msg_get(struct nfnl_log_msg *);
  28. extern void nfnl_log_msg_put(struct nfnl_log_msg *);
  29. extern void nfnl_log_msg_set_family(struct nfnl_log_msg *, uint8_t);
  30. extern uint8_t nfnl_log_msg_get_family(const struct nfnl_log_msg *);
  31. extern void nfnl_log_msg_set_hwproto(struct nfnl_log_msg *, uint16_t);
  32. extern int nfnl_log_msg_test_hwproto(const struct nfnl_log_msg *);
  33. extern uint16_t nfnl_log_msg_get_hwproto(const struct nfnl_log_msg *);
  34. extern void nfnl_log_msg_set_hook(struct nfnl_log_msg *, uint8_t);
  35. extern int nfnl_log_msg_test_hook(const struct nfnl_log_msg *);
  36. extern uint8_t nfnl_log_msg_get_hook(const struct nfnl_log_msg *);
  37. extern void nfnl_log_msg_set_mark(struct nfnl_log_msg *, uint32_t);
  38. extern int nfnl_log_msg_test_mark(const struct nfnl_log_msg *);
  39. extern uint32_t nfnl_log_msg_get_mark(const struct nfnl_log_msg *);
  40. extern void nfnl_log_msg_set_timestamp(struct nfnl_log_msg *,
  41. struct timeval *);
  42. extern const struct timeval *nfnl_log_msg_get_timestamp(const struct nfnl_log_msg *);
  43. extern void nfnl_log_msg_set_indev(struct nfnl_log_msg *, uint32_t);
  44. extern uint32_t nfnl_log_msg_get_indev(const struct nfnl_log_msg *);
  45. extern void nfnl_log_msg_set_outdev(struct nfnl_log_msg *, uint32_t);
  46. extern uint32_t nfnl_log_msg_get_outdev(const struct nfnl_log_msg *);
  47. extern void nfnl_log_msg_set_physindev(struct nfnl_log_msg *, uint32_t);
  48. extern uint32_t nfnl_log_msg_get_physindev(const struct nfnl_log_msg *);
  49. extern void nfnl_log_msg_set_physoutdev(struct nfnl_log_msg *, uint32_t);
  50. extern uint32_t nfnl_log_msg_get_physoutdev(const struct nfnl_log_msg *);
  51. extern void nfnl_log_msg_set_hwaddr(struct nfnl_log_msg *, uint8_t *, int);
  52. extern const uint8_t * nfnl_log_msg_get_hwaddr(const struct nfnl_log_msg *, int *);
  53. extern int nfnl_log_msg_set_payload(struct nfnl_log_msg *, uint8_t *, int);
  54. extern const void * nfnl_log_msg_get_payload(const struct nfnl_log_msg *, int *);
  55. extern int nfnl_log_msg_set_prefix(struct nfnl_log_msg *, void *);
  56. extern const char * nfnl_log_msg_get_prefix(const struct nfnl_log_msg *);
  57. extern void nfnl_log_msg_set_uid(struct nfnl_log_msg *, uint32_t);
  58. extern int nfnl_log_msg_test_uid(const struct nfnl_log_msg *);
  59. extern uint32_t nfnl_log_msg_get_uid(const struct nfnl_log_msg *);
  60. extern void nfnl_log_msg_set_gid(struct nfnl_log_msg *, uint32_t);
  61. extern int nfnl_log_msg_test_gid(const struct nfnl_log_msg *);
  62. extern uint32_t nfnl_log_msg_get_gid(const struct nfnl_log_msg *);
  63. extern void nfnl_log_msg_set_seq(struct nfnl_log_msg *, uint32_t);
  64. extern int nfnl_log_msg_test_seq(const struct nfnl_log_msg *);
  65. extern uint32_t nfnl_log_msg_get_seq(const struct nfnl_log_msg *);
  66. extern void nfnl_log_msg_set_seq_global(struct nfnl_log_msg *, uint32_t);
  67. extern int nfnl_log_msg_test_seq_global(const struct nfnl_log_msg *);
  68. extern uint32_t nfnl_log_msg_get_seq_global(const struct nfnl_log_msg *);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif