diff --git a/configure.ac b/configure.ac index 6a8113a5c..8f7f4a770 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,7 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct mmsghdr.msg_len], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [], [[#include +#include #include ]]) AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg clock_gettime]) AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h stdatomic.h]) diff --git a/include/openvswitch/packets.h b/include/openvswitch/packets.h index c74ce286d..43b93b374 100644 --- a/include/openvswitch/packets.h +++ b/include/openvswitch/packets.h @@ -17,6 +17,7 @@ #ifndef OPENVSWITCH_PACKETS_H #define OPENVSWITCH_PACKETS_H 1 +#include #include #include "openvswitch/tun-metadata.h" diff --git a/include/sparse/arpa/inet.h b/include/sparse/arpa/inet.h index dd64e6176..3634b230c 100644 --- a/include/sparse/arpa/inet.h +++ b/include/sparse/arpa/inet.h @@ -18,4 +18,8 @@ #error "Use this header only with sparse. It is not a correct implementation." #endif +#ifndef NETINET_IN_H_INCLUDED +#error "Must include before for FreeBSD support" +#endif + #include diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index f3282c260..e9b42f52c 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -13,4 +13,5 @@ noinst_HEADERS += \ include/sparse/rte_memcpy.h \ include/sparse/rte_vect.h \ include/sparse/sys/socket.h \ + include/sparse/sys/types.h \ include/sparse/sys/wait.h diff --git a/include/sparse/netinet/in.h b/include/sparse/netinet/in.h index c28158ca0..6abdb2331 100644 --- a/include/sparse/netinet/in.h +++ b/include/sparse/netinet/in.h @@ -18,6 +18,12 @@ #error "Use this header only with sparse. It is not a correct implementation." #endif +#define NETINET_IN_H_INCLUDED 1 + +#ifndef SYS_TYPES_H_INCLUDED +#error "Must include before for FreeBSD support" +#endif + #ifndef _NETINET_IN_H #define _NETINET_IN_H 1 diff --git a/include/sparse/sys/types.h b/include/sparse/sys/types.h new file mode 100644 index 000000000..9bae5ae73 --- /dev/null +++ b/include/sparse/sys/types.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2011, 2013, 2014, 2015, 2017 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +#define SYS_TYPES_H_INCLUDED 1 +#include_next diff --git a/lib/bfd.c b/lib/bfd.c index 40cd0beb9..482e779ea 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -16,6 +16,7 @@ #include "bfd.h" #include +#include #include #include #include diff --git a/lib/bundle.c b/lib/bundle.c index e6705a085..a58d8d247 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -17,6 +17,8 @@ #include "bundle.h" +#include +#include #include #include diff --git a/lib/bundle.h b/lib/bundle.h index 21f353f67..85a2e861d 100644 --- a/lib/bundle.h +++ b/lib/bundle.h @@ -16,6 +16,8 @@ #ifndef BUNDLE_H #define BUNDLE_H 1 +#include +#include #include #include #include diff --git a/lib/byte-order.h b/lib/byte-order.h index b2a9082bb..66d29a2b3 100644 --- a/lib/byte-order.h +++ b/lib/byte-order.h @@ -16,8 +16,9 @@ #ifndef BYTE_ORDER_H #define BYTE_ORDER_H 1 -#include #include +#include +#include #include #include "openvswitch/types.h" diff --git a/lib/classifier.c b/lib/classifier.c index ca0650afb..16c451da1 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -18,6 +18,7 @@ #include "classifier.h" #include "classifier-private.h" #include +#include #include #include "byte-order.h" #include "openvswitch/dynamic-string.h" diff --git a/lib/csum.c b/lib/csum.c index 6419043aa..eaa05ad98 100644 --- a/lib/csum.c +++ b/lib/csum.c @@ -17,6 +17,7 @@ #include #include "csum.h" #include "unaligned.h" +#include #include #ifndef __CHECKER__ diff --git a/lib/dpctl.c b/lib/dpctl.c index a28ded98f..b76954406 100644 --- a/lib/dpctl.c +++ b/lib/dpctl.c @@ -15,12 +15,13 @@ */ #include +#include +#include #include #include #include #include #include -#include #include #include #include diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 55be63236..6ba025b66 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 6b02e9389..5b014e5f3 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/lib/lldp/lldpd-structs.h b/lib/lldp/lldpd-structs.h index 15e5ce8fa..6a3ffb8d3 100644 --- a/lib/lldp/lldpd-structs.h +++ b/lib/lldp/lldpd-structs.h @@ -20,11 +20,9 @@ #define _LLDPD_STRUCTS_H #include -#ifndef _WIN32 -#include -#endif -#include #include +#include +#include #include "aa-structs.h" #include "lldp-const.h" #include "packets.h" diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c index e9d1cf18e..ff5e62846 100644 --- a/lib/lldp/lldpd.c +++ b/lib/lldp/lldpd.c @@ -18,6 +18,8 @@ #include #include "lldpd.h" +#include +#include #include #include #include @@ -28,7 +30,6 @@ #include #include #include -#include #include #include #ifndef _WIN32 diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h index f77c6d523..5267c112a 100644 --- a/lib/lldp/lldpd.h +++ b/lib/lldp/lldpd.h @@ -19,13 +19,11 @@ #ifndef _LLDPD_H #define _LLDPD_H -#ifndef _WIN32 +#include #include -#endif #include #include #include -#include #include "dp-packet.h" #include "openvswitch/list.h" #include "lldpd-structs.h" diff --git a/lib/multipath.c b/lib/multipath.c index 19e3d33e7..fdbf94ea6 100644 --- a/lib/multipath.c +++ b/lib/multipath.c @@ -17,10 +17,10 @@ #include #include "multipath.h" -#include -#include #include #include +#include +#include #include "colors.h" #include "nx-match.h" #include "openflow/nicira-ext.h" diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index e809b8877..40b089094 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -20,6 +20,8 @@ #include #include +#include +#include #include #include #include @@ -31,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c index 3264810f3..9ce856798 100644 --- a/lib/netdev-native-tnl.c +++ b/lib/netdev-native-tnl.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 518058a1f..f72025e5b 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/netdev.c b/lib/netdev.c index 2d69fe5da..cd11281a5 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include #endif #include "cmap.h" diff --git a/lib/netlink.h b/lib/netlink.h index e4cb2f7b8..44b8e4d1a 100644 --- a/lib/netlink.h +++ b/lib/netlink.h @@ -31,6 +31,7 @@ * Linux-specific definitions for Netlink sockets, see netlink-socket.h. */ +#include #include #include #include diff --git a/lib/odp-execute.c b/lib/odp-execute.c index 44e669138..56e316e1e 100644 --- a/lib/odp-execute.c +++ b/lib/odp-execute.c @@ -17,8 +17,9 @@ #include #include "odp-execute.h" -#include +#include #include +#include #include #include #include diff --git a/lib/odp-util.c b/lib/odp-util.c index ec0432c8a..94edd7800 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -15,12 +15,13 @@ */ #include +#include +#include #include #include "odp-util.h" #include #include #include -#include #include #include #include diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index e5d03e155..a59962fc3 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -15,6 +15,8 @@ */ #include + +#include #include #include "bundle.h" diff --git a/lib/ofp-ed-props.c b/lib/ofp-ed-props.c index eb168fee3..d7bb72f35 100644 --- a/lib/ofp-ed-props.c +++ b/lib/ofp-ed-props.c @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include "openvswitch/ofp-ed-props.h" #include "openvswitch/ofp-util.h" diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 0c68495bf..bacbaa638 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "byte-order.h" diff --git a/lib/ovs-lldp.c b/lib/ovs-lldp.c index a056ace93..d7062f325 100644 --- a/lib/ovs-lldp.c +++ b/lib/ovs-lldp.c @@ -28,12 +28,12 @@ #include #include "ovs-lldp.h" +#include +#include #include #include -#include #include #include -#include #include "openvswitch/dynamic-string.h" #include "flow.h" #include "openvswitch/list.h" diff --git a/lib/ovs-router.c b/lib/ovs-router.c index ce2f80b38..cd2ab15fb 100644 --- a/lib/ovs-router.c +++ b/lib/ovs-router.c @@ -18,12 +18,13 @@ #include "ovs-router.h" +#include +#include #include #include #include #include #include -#include #include #include #include diff --git a/lib/ovs-router.h b/lib/ovs-router.h index 29c7c5fe1..b55b1a50b 100644 --- a/lib/ovs-router.h +++ b/lib/ovs-router.h @@ -17,6 +17,7 @@ #ifndef OVS_TNL_ROUTER_H #define OVS_TNL_ROUTER_H 1 +#include #include #include "util.h" diff --git a/lib/packets.c b/lib/packets.c index 7341f5f1f..c9eef2dde 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -16,13 +16,13 @@ #include #include "packets.h" +#include +#include #include #include -#include #include #include #include -#include #include #include "byte-order.h" #include "csum.h" diff --git a/lib/route-table.c b/lib/route-table.c index 4e40c37b4..97a0be5c5 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -19,6 +19,8 @@ #include "route-table.h" #include +#include +#include #include #include #include diff --git a/lib/rstp-state-machines.c b/lib/rstp-state-machines.c index 8fdaec953..7d677d7a2 100644 --- a/lib/rstp-state-machines.c +++ b/lib/rstp-state-machines.c @@ -31,11 +31,11 @@ #include #include "rstp.h" #include "rstp-state-machines.h" +#include +#include #include #include -#include #include -#include #include "byte-order.h" #include "connectivity.h" #include "openvswitch/ofpbuf.h" diff --git a/lib/rstp.c b/lib/rstp.c index 5d71a4374..7a61b24d7 100644 --- a/lib/rstp.c +++ b/lib/rstp.c @@ -32,11 +32,11 @@ #include "rstp.h" #include "rstp-common.h" #include "rstp-state-machines.h" +#include +#include #include #include -#include #include -#include #include "byte-order.h" #include "connectivity.h" #include "openvswitch/ofpbuf.h" diff --git a/lib/sflow_api.h b/lib/sflow_api.h index 2730a4cf4..7264fc1c5 100644 --- a/lib/sflow_api.h +++ b/lib/sflow_api.h @@ -13,18 +13,18 @@ callback in sfl_agent_init.*/ /* #define SFLOW_DO_SOCKET */ +#include +#include +#include #include #include #include #include #include -#include -#include /* for htonl */ #ifdef SFLOW_DO_SOCKET #include #include -#include #include #endif diff --git a/lib/smap.h b/lib/smap.h index 838e2e4bb..f1b5b4dfc 100644 --- a/lib/smap.h +++ b/lib/smap.h @@ -15,6 +15,7 @@ #ifndef SMAP_H #define SMAP_H 1 +#include #include #include "hash.h" #include "openvswitch/hmap.h" diff --git a/lib/socket-util.c b/lib/socket-util.c index 055593d35..7fbcdf19f 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -16,6 +16,8 @@ #include #include "socket-util.h" +#include +#include #include #include #include diff --git a/lib/stream.c b/lib/stream.c index 9cef18e84..083e2fb93 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -18,6 +18,7 @@ #include "stream-provider.h" #include #include +#include #include #include #include diff --git a/lib/tc.h b/lib/tc.h index 5f65a88ce..6af51c69b 100644 --- a/lib/tc.h +++ b/lib/tc.h @@ -18,6 +18,7 @@ #ifndef TC_H #define TC_H 1 +#include #include /* Must happen before linux/pkt_cls.h - Glibc #20215 */ #include #include diff --git a/lib/util.h b/lib/util.h index b01f42130..1792356e5 100644 --- a/lib/util.h +++ b/lib/util.h @@ -17,6 +17,8 @@ #ifndef UTIL_H #define UTIL_H 1 +#include +#include #include #include #include diff --git a/lib/vconn.c b/lib/vconn.c index 13623d87a..bb56be2d2 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -18,6 +18,7 @@ #include "vconn-provider.h" #include #include +#include #include #include #include diff --git a/ofproto/in-band.c b/ofproto/in-band.c index 343dcfa17..849b1ceda 100644 --- a/ofproto/in-band.c +++ b/ofproto/in-band.c @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include #include diff --git a/ofproto/in-band.h b/ofproto/in-band.h index 6e0585ad3..3debd0128 100644 --- a/ofproto/in-band.h +++ b/ofproto/in-band.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "flow.h" diff --git a/ofproto/netflow.c b/ofproto/netflow.c index 783b9c945..b6baeb826 100644 --- a/ofproto/netflow.c +++ b/ofproto/netflow.c @@ -16,6 +16,8 @@ #include #include "netflow.h" +#include +#include #include #include #include diff --git a/ofproto/ofproto-dpif-xlate-cache.c b/ofproto/ofproto-dpif-xlate-cache.c index 24fc769a7..5f53a525a 100644 --- a/ofproto/ofproto-dpif-xlate-cache.c +++ b/ofproto/ofproto-dpif-xlate-cache.c @@ -16,10 +16,11 @@ #include "ofproto/ofproto-dpif-xlate-cache.h" +#include +#include #include #include #include -#include #include #include "bfd.h" diff --git a/ofproto/ofproto-dpif-xlate-cache.h b/ofproto/ofproto-dpif-xlate-cache.h index e62719740..19c1ef7b9 100644 --- a/ofproto/ofproto-dpif-xlate-cache.h +++ b/ofproto/ofproto-dpif-xlate-cache.h @@ -17,6 +17,7 @@ #include #include +#include #include #include "openvswitch/types.h" diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index a2b4fdb3b..d94e9dc28 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -17,10 +17,11 @@ #include "ofproto/ofproto-dpif-xlate.h" #include +#include +#include #include #include #include -#include #include "bfd.h" #include "bitmap.h" diff --git a/ovn/lib/ovn-l7.h b/ovn/lib/ovn-l7.h index 41cdacdfc..b8d6683bc 100644 --- a/ovn/lib/ovn-l7.h +++ b/ovn/lib/ovn-l7.h @@ -17,6 +17,7 @@ #ifndef OVN_DHCP_H #define OVN_DHCP_H 1 +#include #include #include #include "openvswitch/hmap.h" diff --git a/tests/test-csum.c b/tests/test-csum.c index 97638b916..b94bd6481 100644 --- a/tests/test-csum.c +++ b/tests/test-csum.c @@ -19,6 +19,7 @@ #include "csum.h" #include #include +#include #include #include #include diff --git a/tests/test-sflow.c b/tests/test-sflow.c index b70336b45..82e950273 100644 --- a/tests/test-sflow.c +++ b/tests/test-sflow.c @@ -18,6 +18,8 @@ #include #undef NDEBUG #include "netflow.h" +#include +#include #include #include #include diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index ef2daf6fb..7e6101632 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -15,13 +15,14 @@ */ #include +#include +#include #include #include #include #include #include #include -#include #include #include #include