4 #include <linux/netfilter.h>
6 /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will
7 * disappear once iptables is replaced with pkttables. Please DO NOT use them
9 #define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
10 #define NF_LOG_TCPOPT 0x02 /* Log TCP options */
11 #define NF_LOG_IPOPT 0x04 /* Log IP options */
12 #define NF_LOG_UID 0x08 /* Log UID owning local socket */
13 #define NF_LOG_MASK 0x0f
15 /* This flag indicates that copy_len field in nf_loginfo is set */
16 #define NF_LOG_F_COPY_LEN 0x1
28 /* copy_len will be used iff you set
29 * NF_LOG_F_COPY_LEN in flags
43 typedef void nf_logfn(struct net
*net
,
46 const struct sk_buff
*skb
,
47 const struct net_device
*in
,
48 const struct net_device
*out
,
49 const struct nf_loginfo
*li
,
54 enum nf_log_type type
;
59 /* Function to register/unregister log function. */
60 int nf_log_register(u_int8_t pf
, struct nf_logger
*logger
);
61 void nf_log_unregister(struct nf_logger
*logger
);
63 int nf_log_set(struct net
*net
, u_int8_t pf
, const struct nf_logger
*logger
);
64 void nf_log_unset(struct net
*net
, const struct nf_logger
*logger
);
66 int nf_log_bind_pf(struct net
*net
, u_int8_t pf
,
67 const struct nf_logger
*logger
);
68 void nf_log_unbind_pf(struct net
*net
, u_int8_t pf
);
70 int nf_logger_find_get(int pf
, enum nf_log_type type
);
71 void nf_logger_put(int pf
, enum nf_log_type type
);
72 void nf_logger_request_module(int pf
, enum nf_log_type type
);
74 #define MODULE_ALIAS_NF_LOGGER(family, type) \
75 MODULE_ALIAS("nf-logger-" __stringify(family) "-" __stringify(type))
77 /* Calls the registered backend logging function */
79 void nf_log_packet(struct net
*net
,
82 const struct sk_buff
*skb
,
83 const struct net_device
*in
,
84 const struct net_device
*out
,
85 const struct nf_loginfo
*li
,
86 const char *fmt
, ...);
89 void nf_log_trace(struct net
*net
,
92 const struct sk_buff
*skb
,
93 const struct net_device
*in
,
94 const struct net_device
*out
,
95 const struct nf_loginfo
*li
,
96 const char *fmt
, ...);
100 struct nf_log_buf
*nf_log_buf_open(void);
101 __printf(2, 3) int nf_log_buf_add(struct nf_log_buf
*m
, const char *f
, ...);
102 void nf_log_buf_close(struct nf_log_buf
*m
);
104 /* common logging functions */
105 int nf_log_dump_udp_header(struct nf_log_buf
*m
, const struct sk_buff
*skb
,
106 u8 proto
, int fragment
, unsigned int offset
);
107 int nf_log_dump_tcp_header(struct nf_log_buf
*m
, const struct sk_buff
*skb
,
108 u8 proto
, int fragment
, unsigned int offset
,
109 unsigned int logflags
);
110 void nf_log_dump_sk_uid_gid(struct nf_log_buf
*m
, struct sock
*sk
);
111 void nf_log_dump_packet_common(struct nf_log_buf
*m
, u_int8_t pf
,
112 unsigned int hooknum
, const struct sk_buff
*skb
,
113 const struct net_device
*in
,
114 const struct net_device
*out
,
115 const struct nf_loginfo
*loginfo
,
118 #endif /* _NF_LOG_H */
This page took 0.033302 seconds and 6 git commands to generate.