logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

nfnetlink_log.h (3105B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _NFNETLINK_LOG_H
  3. #define _NFNETLINK_LOG_H
  4. /* This file describes the netlink messages (i.e. 'protocol packets'),
  5. * and not any kind of function definitions. It is shared between kernel and
  6. * userspace. Don't put kernel specific stuff in here */
  7. #include <linux/types.h>
  8. #include <linux/netfilter/nfnetlink.h>
  9. enum nfulnl_msg_types {
  10. NFULNL_MSG_PACKET, /* packet from kernel to userspace */
  11. NFULNL_MSG_CONFIG, /* connect to a particular queue */
  12. NFULNL_MSG_MAX
  13. };
  14. struct nfulnl_msg_packet_hdr {
  15. __be16 hw_protocol; /* hw protocol (network order) */
  16. __u8 hook; /* netfilter hook */
  17. __u8 _pad;
  18. };
  19. struct nfulnl_msg_packet_hw {
  20. __be16 hw_addrlen;
  21. __u16 _pad;
  22. __u8 hw_addr[8];
  23. };
  24. struct nfulnl_msg_packet_timestamp {
  25. __aligned_be64 sec;
  26. __aligned_be64 usec;
  27. };
  28. enum nfulnl_vlan_attr {
  29. NFULA_VLAN_UNSPEC,
  30. NFULA_VLAN_PROTO, /* __be16 skb vlan_proto */
  31. NFULA_VLAN_TCI, /* __be16 skb htons(vlan_tci) */
  32. __NFULA_VLAN_MAX,
  33. };
  34. #define NFULA_VLAN_MAX (__NFULA_VLAN_MAX + 1)
  35. enum nfulnl_attr_type {
  36. NFULA_UNSPEC,
  37. NFULA_PACKET_HDR,
  38. NFULA_MARK, /* __u32 nfmark */
  39. NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
  40. NFULA_IFINDEX_INDEV, /* __u32 ifindex */
  41. NFULA_IFINDEX_OUTDEV, /* __u32 ifindex */
  42. NFULA_IFINDEX_PHYSINDEV, /* __u32 ifindex */
  43. NFULA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
  44. NFULA_HWADDR, /* nfulnl_msg_packet_hw */
  45. NFULA_PAYLOAD, /* opaque data payload */
  46. NFULA_PREFIX, /* string prefix */
  47. NFULA_UID, /* user id of socket */
  48. NFULA_SEQ, /* instance-local sequence number */
  49. NFULA_SEQ_GLOBAL, /* global sequence number */
  50. NFULA_GID, /* group id of socket */
  51. NFULA_HWTYPE, /* hardware type */
  52. NFULA_HWHEADER, /* hardware header */
  53. NFULA_HWLEN, /* hardware header length */
  54. NFULA_CT, /* nfnetlink_conntrack.h */
  55. NFULA_CT_INFO, /* enum ip_conntrack_info */
  56. NFULA_VLAN, /* nested attribute: packet vlan info */
  57. NFULA_L2HDR, /* full L2 header */
  58. __NFULA_MAX
  59. };
  60. #define NFULA_MAX (__NFULA_MAX - 1)
  61. enum nfulnl_msg_config_cmds {
  62. NFULNL_CFG_CMD_NONE,
  63. NFULNL_CFG_CMD_BIND,
  64. NFULNL_CFG_CMD_UNBIND,
  65. NFULNL_CFG_CMD_PF_BIND,
  66. NFULNL_CFG_CMD_PF_UNBIND,
  67. };
  68. struct nfulnl_msg_config_cmd {
  69. __u8 command; /* nfulnl_msg_config_cmds */
  70. } __attribute__ ((packed));
  71. struct nfulnl_msg_config_mode {
  72. __be32 copy_range;
  73. __u8 copy_mode;
  74. __u8 _pad;
  75. } __attribute__ ((packed));
  76. enum nfulnl_attr_config {
  77. NFULA_CFG_UNSPEC,
  78. NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
  79. NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
  80. NFULA_CFG_NLBUFSIZ, /* __u32 buffer size */
  81. NFULA_CFG_TIMEOUT, /* __u32 in 1/100 s */
  82. NFULA_CFG_QTHRESH, /* __u32 */
  83. NFULA_CFG_FLAGS, /* __u16 */
  84. __NFULA_CFG_MAX
  85. };
  86. #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
  87. #define NFULNL_COPY_NONE 0x00
  88. #define NFULNL_COPY_META 0x01
  89. #define NFULNL_COPY_PACKET 0x02
  90. /* 0xff is reserved, don't use it for new copy modes. */
  91. #define NFULNL_CFG_F_SEQ 0x0001
  92. #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
  93. #define NFULNL_CFG_F_CONNTRACK 0x0004
  94. #endif /* _NFNETLINK_LOG_H */