ovn-nbctl: Use "ctx->output" instead of printf for list ACLs.
[cascardo/ovs.git] / datapath / compat.h
1 /*
2  * Copyright (c) 2007-2015 Nicira, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 2 of the GNU General Public
6  * License as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16  * 02110-1301, USA
17  */
18
19 #ifndef COMPAT_H
20 #define COMPAT_H 1
21
22 #include <linux/in.h>
23 #include <linux/in_route.h>
24 #include <linux/netlink.h>
25 #include <net/ip.h>
26 #include <net/route.h>
27 #include <net/xfrm.h>
28 #include <net/netfilter/ipv6/nf_defrag_ipv6.h>
29
30 /* Even though vanilla 3.10 kernel has grp->id, RHEL 7 kernel is missing
31  * this field. */
32 #ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
33 #define GROUP_ID(grp)   ((grp)->id)
34 #else
35 #define GROUP_ID(grp)   0
36 #endif
37
38 #ifdef HAVE_NF_IPV6_OPS_FRAGMENT
39 static inline int __init ip6_output_init(void) { return 0; }
40 static inline void ip6_output_exit(void) { }
41 #else
42 int __init ip6_output_init(void);
43 void ip6_output_exit(void);
44 #endif
45
46 static inline int __init compat_init(void)
47 {
48         int err;
49
50         err = ipfrag_init();
51         if (err)
52                 return err;
53
54         err = nf_ct_frag6_init();
55         if (err)
56                 goto error_ipfrag_exit;
57
58         err = ip6_output_init();
59         if (err)
60                 goto error_frag6_exit;
61
62         return 0;
63
64 error_frag6_exit:
65         nf_ct_frag6_cleanup();
66 error_ipfrag_exit:
67         rpl_ipfrag_fini();
68         return err;
69 }
70 static inline void compat_exit(void)
71 {
72         ip6_output_exit();
73         nf_ct_frag6_cleanup();
74         rpl_ipfrag_fini();
75 }
76
77 #endif /* compat.h */