Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create LSI is a POST call instead of PUT, it is defined for PUT but i… #101

Open
wants to merge 4 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/xdpd/management/plugins/rest/misc-controllers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ void index(const http::server::request &req, http::server::reply &rep, boost::cm
html << "<li><b>/mgmt/port/&lt;lsi_name&gt/down</b>: bring port administratively down" << std::endl;
html << "<li><b>/mgmt/attach/port/&lt;port_name&gt/&lt;lsi_name&gt</b>: attach a port to an LSI" << std::endl;
html << "<li><b>/mgmt/detach/port/&lt;port_name&gt/&lt;lsi_name&gt</b>: detach a port from an LSI" << std::endl;

html << "<li><b>/mgmt/create/lsi</b>: create a LSI" << std::endl;
html << "</ul>" << std::endl;

//PUT
html << "<h3 "<< mgmt_class << ">PUT</h3>" << std::endl;
html << "<ul>" << std::endl;

html << "<li><b>/mgmt/create/lsi</b>: create a LSI" << std::endl;
html << "<li><b>/mgmt/create/vlink/&lt;lsi1_name&gt/&lt;lsi2_name&gt</b>: create a virtual link between two LSIs" << std::endl;

html << "</ul>" << std::endl;
Expand Down
14 changes: 14 additions & 0 deletions src/xdpd/management/plugins/rest/sw-controllers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -314,6 +316,18 @@ 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();
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;
Expand Down
13 changes: 9 additions & 4 deletions tools/deb/checkinstall_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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