]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/netfilter_ipv4/ip_conntrack_tuple.h
[NETFILTER]: x_tables: remove duplicate of xt_prefix
[mirror_ubuntu-bionic-kernel.git] / include / linux / netfilter_ipv4 / ip_conntrack_tuple.h
index 20e43f018b7c768cc8b9c13c23253e99c5561d6c..c228bde74c3325c0d26f3319297a63c36f1792dd 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef _IP_CONNTRACK_TUPLE_H
 #define _IP_CONNTRACK_TUPLE_H
 
+#include <linux/types.h>
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
 /* A `tuple' is a structure containing the information to uniquely
   identify a connection.  ie. if two packets have the same tuple, they
   are in the same connection; if not, they are not.
@@ -20,13 +23,13 @@ union ip_conntrack_manip_proto
                __be16 port;
        } tcp;
        struct {
-               u_int16_t port;
+               __be16 port;
        } udp;
        struct {
-               u_int16_t id;
+               __be16 id;
        } icmp;
        struct {
-               u_int16_t port;
+               __be16 port;
        } sctp;
        struct {
                __be16 key;     /* key is 32bit, pptp only uses 16 */
@@ -36,7 +39,7 @@ union ip_conntrack_manip_proto
 /* The manipulable part of the tuple. */
 struct ip_conntrack_manip
 {
-       u_int32_t ip;
+       __be32 ip;
        union ip_conntrack_manip_proto u;
 };
 
@@ -47,22 +50,22 @@ struct ip_conntrack_tuple
 
        /* These are the parts of the tuple which are fixed. */
        struct {
-               u_int32_t ip;
+               __be32 ip;
                union {
                        /* Add other protocols here. */
                        u_int16_t all;
 
                        struct {
-                               u_int16_t port;
+                               __be16 port;
                        } tcp;
                        struct {
-                               u_int16_t port;
+                               __be16 port;
                        } udp;
                        struct {
                                u_int8_t type, code;
                        } icmp;
                        struct {
-                               u_int16_t port;
+                               __be16 port;
                        } sctp;
                        struct {
                                __be16 key;     /* key is 32bit, 
@@ -86,13 +89,6 @@ struct ip_conntrack_tuple
                (tuple)->dst.u.all = 0;                         \
        } while (0)
 
-enum ip_conntrack_dir
-{
-       IP_CT_DIR_ORIGINAL,
-       IP_CT_DIR_REPLY,
-       IP_CT_DIR_MAX
-};
-
 #ifdef __KERNEL__
 
 #define DUMP_TUPLE(tp)                                         \
@@ -101,8 +97,6 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n",  \
        NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all),          \
        NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all))
 
-#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
-
 /* If we're the first tuple, it's the original dir. */
 #define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir)