Commit 3ba0299a authored by Stephen Morris's avatar Stephen Morris

[2475] Put #include directives in correct order

Also fix some issues from the review.
parent d2551c3b
...@@ -14,21 +14,20 @@ ...@@ -14,21 +14,20 @@
#include <config.h> #include <config.h>
#include <cassert>
#include <iostream>
#include <asiolink/asiolink.h> #include <asiolink/asiolink.h>
#include <cc/data.h> #include <cc/data.h>
#include <cc/session.h> #include <cc/session.h>
#include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <dhcp/iface_mgr.h>
#include <dhcp4/ctrl_dhcp4_srv.h> #include <dhcp4/ctrl_dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h> #include <dhcp4/dhcp4_log.h>
#include <dhcp4/spec_config.h> #include <dhcp4/spec_config.h>
#include <dhcp/iface_mgr.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <util/buffer.h> #include <util/buffer.h>
#include <cassert>
#include <iostream>
using namespace isc::asiolink; using namespace isc::asiolink;
using namespace isc::cc; using namespace isc::cc;
using namespace isc::config; using namespace isc::config;
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#ifndef CTRL_DHCPV4_SRV_H #ifndef CTRL_DHCPV4_SRV_H
#define CTRL_DHCPV4_SRV_H #define CTRL_DHCPV4_SRV_H
#include <dhcp4/dhcp4_srv.h>
#include <asiolink/asiolink.h> #include <asiolink/asiolink.h>
#include <cc/data.h>
#include <cc/session.h> #include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <cc/data.h> #include <dhcp4/dhcp4_srv.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/// Defines the logger used by the top-level component of b10-dhcp4. /// Defines the logger used by the top-level component of b10-dhcp4.
#include "dhcp4_log.h" #include <dhcp4/dhcp4_log.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#ifndef DHCP4_LOG_H #ifndef DHCP4_LOG_H
#define DHCP4_LOG_H #define DHCP4_LOG_H
#include <log/macros.h>
#include <log/logger_support.h> #include <log/logger_support.h>
#include <log/macros.h>
#include <dhcp4/dhcp4_messages.h> #include <dhcp4/dhcp4_messages.h>
namespace isc { namespace isc {
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <asiolink/io_address.h>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp/pkt4.h>
#include <dhcp/iface_mgr.h> #include <dhcp/iface_mgr.h>
#include <dhcp4/dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h>
#include <asiolink/io_address.h>
#include <dhcp/option4_addrlst.h> #include <dhcp/option4_addrlst.h>
#include <dhcp/pkt4.h>
#include <dhcp4/dhcp4_log.h>
#include <dhcp4/dhcp4_srv.h>
using namespace isc; using namespace isc;
using namespace isc::asiolink; using namespace isc::asiolink;
......
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
#ifndef DHCPV4_SRV_H #ifndef DHCPV4_SRV_H
#define DHCPV4_SRV_H #define DHCPV4_SRV_H
#include <boost/noncopyable.hpp>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp/pkt4.h> #include <dhcp/pkt4.h>
#include <dhcp/option.h> #include <dhcp/option.h>
#include <boost/noncopyable.hpp>
#include <iostream> #include <iostream>
namespace isc { namespace isc {
......
...@@ -13,14 +13,15 @@ ...@@ -13,14 +13,15 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <dhcp4/ctrl_dhcp4_srv.h> #include <dhcp4/ctrl_dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h> #include <dhcp4/dhcp4_log.h>
#include <log/logger_support.h> #include <log/logger_support.h>
#include <boost/lexical_cast.hpp>
#include <iostream>
using namespace isc::dhcp; using namespace isc::dhcp;
using namespace std; using namespace std;
......
...@@ -13,16 +13,18 @@ ...@@ -13,16 +13,18 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <iostream>
#include <config/ccsession.h>
#include <dhcp/dhcp4.h>
#include <dhcp4/ctrl_dhcp4_srv.h>
#include <gtest/gtest.h>
#include <fstream> #include <fstream>
#include <iostream>
#include <sstream> #include <sstream>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <gtest/gtest.h>
#include <dhcp/dhcp4.h>
#include <dhcp4/ctrl_dhcp4_srv.h>
#include <config/ccsession.h>
using namespace std; using namespace std;
using namespace isc; using namespace isc;
......
...@@ -13,17 +13,19 @@ ...@@ -13,17 +13,19 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <iostream>
#include <fstream>
#include <sstream> #include <sstream>
#include <arpa/inet.h> #include <asiolink/io_address.h>
#include <gtest/gtest.h>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp4/dhcp4_srv.h>
#include <dhcp/option.h> #include <dhcp/option.h>
#include <asiolink/io_address.h> #include <dhcp4/dhcp4_srv.h>
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <arpa/inet.h>
using namespace std; using namespace std;
using namespace isc; using namespace isc;
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <stdio.h>
#include <gtest/gtest.h>
#include <log/logger_support.h> #include <log/logger_support.h>
#include <gtest/gtest.h>
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
......
...@@ -12,13 +12,14 @@ ...@@ -12,13 +12,14 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <string>
#include <exceptions/exceptions.h>
#include <cc/data.h>
#ifndef DHCP6_CONFIG_PARSER_H #ifndef DHCP6_CONFIG_PARSER_H
#define DHCP6_CONFIG_PARSER_H #define DHCP6_CONFIG_PARSER_H
#include <cc/data.h>
#include <exceptions/exceptions.h>
#include <string>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -14,22 +14,22 @@ ...@@ -14,22 +14,22 @@
#include <config.h> #include <config.h>
#include <cassert>
#include <iostream>
#include <asiolink/asiolink.h> #include <asiolink/asiolink.h>
#include <cc/data.h> #include <cc/data.h>
#include <cc/session.h> #include <cc/session.h>
#include <cc/session.h> #include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <dhcp/iface_mgr.h>
#include <dhcp6/config_parser.h>
#include <dhcp6/ctrl_dhcp6_srv.h> #include <dhcp6/ctrl_dhcp6_srv.h>
#include <dhcp6/dhcp6_log.h> #include <dhcp6/dhcp6_log.h>
#include <dhcp6/spec_config.h> #include <dhcp6/spec_config.h>
#include <dhcp6/config_parser.h>
#include <dhcp/iface_mgr.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <util/buffer.h> #include <util/buffer.h>
#include <cassert>
#include <iostream>
using namespace isc::asiolink; using namespace isc::asiolink;
using namespace isc::cc; using namespace isc::cc;
using namespace isc::config; using namespace isc::config;
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#ifndef CTRL_DHCPV6_SRV_H #ifndef CTRL_DHCPV6_SRV_H
#define CTRL_DHCPV6_SRV_H #define CTRL_DHCPV6_SRV_H
#include <dhcp6/dhcp6_srv.h>
#include <asiolink/asiolink.h> #include <asiolink/asiolink.h>
#include <cc/data.h>
#include <cc/session.h> #include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <cc/data.h> #include <dhcp6/dhcp6_srv.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/// Defines the logger used by the top-level component of b10-dhcp6. /// Defines the logger used by the top-level component of b10-dhcp6.
#include "dhcp6_log.h" #include <dhcp6/dhcp6_log.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
#ifndef DHCP6_LOG_H #ifndef DHCP6_LOG_H
#define DHCP6_LOG_H #define DHCP6_LOG_H
#include <log/macros.h>
#include <log/logger_support.h>
#include <dhcp6/dhcp6_messages.h> #include <dhcp6/dhcp6_messages.h>
#include <log/logger_support.h>
#include <log/macros.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#ifndef DHCPV6_SRV_H #ifndef DHCPV6_SRV_H
#define DHCPV6_SRV_H #define DHCPV6_SRV_H
#include <iostream>
#include <dhcp/dhcp6.h> #include <dhcp/dhcp6.h>
#include <dhcp/duid.h> #include <dhcp/duid.h>
#include <dhcp/option.h> #include <dhcp/option.h>
...@@ -28,8 +26,9 @@ ...@@ -28,8 +26,9 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
namespace isc { #include <iostream>
namespace isc {
namespace dhcp { namespace dhcp {
/// @brief DHCPv6 server service. /// @brief DHCPv6 server service.
/// ///
......
...@@ -13,14 +13,15 @@ ...@@ -13,14 +13,15 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <dhcp6/ctrl_dhcp6_srv.h> #include <dhcp6/ctrl_dhcp6_srv.h>
#include <dhcp6/dhcp6_log.h> #include <dhcp6/dhcp6_log.h>
#include <log/logger_support.h> #include <log/logger_support.h>
#include <boost/lexical_cast.hpp>
#include <iostream>
using namespace isc::dhcp; using namespace isc::dhcp;
using namespace std; using namespace std;
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
#include <dhcpsrv/subnet.h> #include <dhcpsrv/subnet.h>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <gtest/gtest.h>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <gtest/gtest.h>
using namespace std; using namespace std;
using namespace isc; using namespace isc;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <config.h> #include <config.h>
#include <asiolink/io_address.h> #include <asiolink/io_address.h>
#include <boost/scoped_ptr.hpp>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <dhcp/dhcp6.h> #include <dhcp/dhcp6.h>
#include <dhcp/duid.h> #include <dhcp/duid.h>
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
#include <util/buffer.h> #include <util/buffer.h>
#include <util/range_utilities.h> #include <util/range_utilities.h>
#include <boost/scoped_ptr.hpp>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <fstream> #include <fstream>
......
...@@ -12,13 +12,15 @@ ...@@ -12,13 +12,15 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <dhcp/duid.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <stdint.h>
#include <util/io_utilities.h> #include <util/io_utilities.h>
#include <dhcp/duid.h>
#include <vector>
#include <sstream>
#include <iomanip> #include <iomanip>
#include <sstream>
#include <vector>
#include <stdint.h>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
......
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
#define DUID_H #define DUID_H
#include <asiolink/io_address.h> #include <asiolink/io_address.h>
#include <vector> #include <vector>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -13,22 +13,27 @@ ...@@ -13,22 +13,27 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <sstream>
#include <fstream> // This must be included before udp_endpoint.h
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/select.h>
#include <asio.hpp> #include <asio.hpp>
#include <asiolink/io_error.h>
#include <asiolink/udp_endpoint.h>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp/dhcp6.h> #include <dhcp/dhcp6.h>
#include <dhcp/iface_mgr.h> #include <dhcp/iface_mgr.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <asiolink/udp_endpoint.h>
#include <asiolink/io_error.h>
#include <util/io/pktinfo_utilities.h> #include <util/io/pktinfo_utilities.h>
#include <fstream>
#include <sstream>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/select.h>
using namespace std; using namespace std;
using namespace isc::asiolink; using namespace isc::asiolink;
using namespace isc::util::io::internal; using namespace isc::util::io::internal;
......
...@@ -15,16 +15,18 @@ ...@@ -15,16 +15,18 @@
#ifndef IFACE_MGR_H #ifndef IFACE_MGR_H
#define IFACE_MGR_H #define IFACE_MGR_H
#include <list>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/noncopyable.hpp>
#include <asiolink/io_address.h> #include <asiolink/io_address.h>
#include <dhcp/dhcp6.h>
#include <dhcp/dhcp4.h> #include <dhcp/dhcp4.h>
#include <dhcp/dhcp6.h>
#include <dhcp/pkt4.h> #include <dhcp/pkt4.h>
#include <dhcp/pkt6.h> #include <dhcp/pkt6.h>
#include <boost/noncopyable.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
namespace isc { namespace isc {