From e4e0785793145b67a7335e2e79920da86c269b5a Mon Sep 17 00:00:00 2001 From: Zsolt Magyari Date: Wed, 29 Jun 2016 05:19:12 -0700 Subject: [PATCH 1/4] Create LSI is a POST call instead of PUT, it is defined for PUT but it reacts on POST. (gdb) --- src/xdpd/management/plugins/rest/misc-controllers.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xdpd/management/plugins/rest/misc-controllers.cc b/src/xdpd/management/plugins/rest/misc-controllers.cc index 0a2bb14d..33300e53 100644 --- a/src/xdpd/management/plugins/rest/misc-controllers.cc +++ b/src/xdpd/management/plugins/rest/misc-controllers.cc @@ -66,14 +66,13 @@ void index(const http::server::request &req, http::server::reply &rep, boost::cm html << "
  • /mgmt/port/<lsi_name>/down: bring port administratively down" << std::endl; html << "
  • /mgmt/attach/port/<port_name>/<lsi_name>: attach a port to an LSI" << std::endl; html << "
  • /mgmt/detach/port/<port_name>/<lsi_name>: detach a port from an LSI" << std::endl; - + html << "
  • /mgmt/create/lsi: create a LSI" << std::endl; html << "" << std::endl; //PUT html << "

    PUT

    " << std::endl; html << "" << std::endl; From 5947879aac4ae3753de5904a91576f98707952fd Mon Sep 17 00:00:00 2001 From: Zsolt Magyari Date: Wed, 29 Jun 2016 08:35:15 -0700 Subject: [PATCH 2/4] Controller connection details added to REST LSI creation call. --- .../management/plugins/rest/sw-controllers.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/xdpd/management/plugins/rest/sw-controllers.cc b/src/xdpd/management/plugins/rest/sw-controllers.cc index d75b537f..35477c8f 100644 --- a/src/xdpd/management/plugins/rest/sw-controllers.cc +++ b/src/xdpd/management/plugins/rest/sw-controllers.cc @@ -251,6 +251,8 @@ void create_lsi(const http::server::request &req, http::server::reply &rep, boos std::string lsi_name = ""; unsigned int num_of_tables = 0; int ma_list[OF1X_MAX_FLOWTABLES] = { 0 }; + std::string controller_hostname = ""; + unsigned int controller_port = 6653; int reconnect_start_time = 1; enum rofl::csocket::socket_type_t socket_type = rofl::csocket::SOCKET_TYPE_PLAIN; rofl::cparams socket_params = rofl::csocket::get_default_params(socket_type); @@ -314,6 +316,19 @@ void create_lsi(const http::server::request &req, http::server::reply &rep, boos }catch(...){ } + + //Controller connection + controller_hostname = json_spirit::find_value(obj, "controller-hostname").get_str(); + controller_port = json_spirit::find_value(obj, "controller-port").get_uint64(); + std::cout << controller_hostname << " " << controller_port << std::endl; + socket_params.drop_param("remote-hostname"); + socket_params.add_param("remote-hostname") = controller_hostname; + socket_params.drop_param("remote-port"); + std::stringstream to_string; + to_string << controller_port; + socket_params.add_param("remote-port") = to_string.str(); + + }catch(...){ //Something went wrong std::stringstream ss; @@ -344,6 +359,7 @@ void create_lsi(const http::server::request &req, http::server::reply &rep, boos //Create try{ + std::cout << socket_params; switch_manager::create_switch(ver, dpid, lsi_name, num_of_tables, ma_list, reconnect_start_time, socket_type, socket_params); }catch(...){ From fc73a7134e26f609b1b45f94b32485dbfd6ea30c Mon Sep 17 00:00:00 2001 From: Zsolt Magyari Date: Fri, 1 Jul 2016 00:31:36 -0700 Subject: [PATCH 3/4] clearing cout's --- src/xdpd/management/plugins/rest/sw-controllers.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xdpd/management/plugins/rest/sw-controllers.cc b/src/xdpd/management/plugins/rest/sw-controllers.cc index 35477c8f..2363a48f 100644 --- a/src/xdpd/management/plugins/rest/sw-controllers.cc +++ b/src/xdpd/management/plugins/rest/sw-controllers.cc @@ -320,7 +320,6 @@ void create_lsi(const http::server::request &req, http::server::reply &rep, boos //Controller connection controller_hostname = json_spirit::find_value(obj, "controller-hostname").get_str(); controller_port = json_spirit::find_value(obj, "controller-port").get_uint64(); - std::cout << controller_hostname << " " << controller_port << std::endl; socket_params.drop_param("remote-hostname"); socket_params.add_param("remote-hostname") = controller_hostname; socket_params.drop_param("remote-port"); @@ -359,7 +358,6 @@ void create_lsi(const http::server::request &req, http::server::reply &rep, boos //Create try{ - std::cout << socket_params; switch_manager::create_switch(ver, dpid, lsi_name, num_of_tables, ma_list, reconnect_start_time, socket_type, socket_params); }catch(...){ From 062172210f2edf3a234aed94be187731dad4a1d3 Mon Sep 17 00:00:00 2001 From: Zsolt Magyari Date: Wed, 17 Aug 2016 13:41:41 +0200 Subject: [PATCH 4/4] For DEB packages: rofl-common and rofl-datapath dependencies fixed. --- tools/deb/checkinstall_gen.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/deb/checkinstall_gen.sh b/tools/deb/checkinstall_gen.sh index 3c7cbc32..ebd5ee93 100755 --- a/tools/deb/checkinstall_gen.sh +++ b/tools/deb/checkinstall_gen.sh @@ -2,8 +2,13 @@ PKG_NAME="xdpd" PKG_NAME_DBG="xdpd-dbg" -ROFL_PKG_NAME="rofl" -ROFL_DBG_PKG_NAME="rofl-dbg" +ROFL_DATAPATH_PKG_NAME="rofl-datapath" +ROFL_DATAPATH_DBG_PKG_NAME="rofl-datapath-dbg" +ROFL_COMMON_PKG_NAME="rofl-common" +ROFL_COMMON_DBG_PKG_NAME="rofl-common-dbg" + + + VERSION="" RELEASE="" DEFAULT_REQUIRES=" libconfig++9" @@ -78,11 +83,11 @@ get_release #Generate the package if test -z "$IS_NOT_DEBUG"; then - REQUIRES+=", $ROFL_DBG_PKG_NAME" + REQUIRES+=", $ROFL_DATAPATH_DBG_PKG_NAME, $ROFL_COMMON_DBG_PKG_NAME" dump_result $PKG_NAME_DBG $PKG_NAME generate_pkg $PKG_NAME_DBG $PKG_NAME else - REQUIRES+=", $ROFL_PKG_NAME" + REQUIRES+=", $ROFL_DATAPATH_PKG_NAME, $ROFL_COMMON_PKG_NAME" dump_result $PKG_NAME $PKG_NAME_DBG generate_pkg $PKG_NAME $PKG_NAME_DBG fi