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

Ipv4 addr plus port #63

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
233950b
added address plus port
Feb 1, 2018
43f201b
fixed merge
Feb 1, 2018
a238b7c
add static casts
Feb 1, 2018
67483dc
minor changes
Feb 1, 2018
0868823
minor changes
Feb 1, 2018
6012b29
fixed unit tests
Feb 2, 2018
62ce579
updated unit tests
Feb 2, 2018
26e8bf4
removed unsupported options
Feb 3, 2018
a875ea1
updated cql schema and added minor changes (including spelling mistak…
Feb 7, 2018
f804d7e
minor chnages
Feb 9, 2018
7ecf8fb
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 15, 2018
01d56b8
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 15, 2018
098865d
Merge remote-tracking branch 'isc-kea/master' into HEAD
Feb 15, 2018
10e19f3
Merge branch 'cql_clean_code' of https://github.com/razvan-becheriu/k…
Feb 15, 2018
e2317a1
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Feb 19, 2018
448cf73
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Feb 28, 2018
ae60f3f
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 28, 2018
14c3a55
minor changes - fixed eventual memory leak
Mar 1, 2018
45464c5
minor changes
Mar 1, 2018
16c80de
minor changes
Mar 1, 2018
5637d01
minor changes
Mar 1, 2018
4637a23
refactored cql recount leases plus minor changes
Mar 1, 2018
d3f8281
minor changes
Mar 1, 2018
b2d80eb
minor changes
Mar 1, 2018
ffc8c78
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 2, 2018
afddd8a
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Mar 7, 2018
d32a318
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 7, 2018
c3e4fe2
enabled tests for cql
Mar 7, 2018
e728823
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 7, 2018
8b1f21a
src/lib/dhcpsrv/tests/generic_host_data_source_unittest.cc
Mar 7, 2018
55a57d4
enabled tests for cql
Mar 7, 2018
38b5430
fixed unit tests
Mar 7, 2018
400abf1
fixed merge
Mar 13, 2018
33e4b4f
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 13, 2018
42d8ad3
minor changes
Mar 13, 2018
1b6df23
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 13, 2018
39bc0b7
fixed merge
Mar 13, 2018
61f9562
Merge branch 'cql_clean_code' into ipv4_addr_plus_port
Mar 13, 2018
b65cd1f
fixed merge
Mar 13, 2018
a1ab751
fixed comments
Mar 13, 2018
387ffa4
minor changes
Mar 13, 2018
746acc8
minor changes
Mar 13, 2018
78f3ad6
Merge branch 'cassandra_improvements' into cql_clean_code
Mar 13, 2018
38a837f
minor changes
Mar 14, 2018
9ed1f3d
minor changes
Mar 14, 2018
d61a05b
minor changes
Mar 14, 2018
cc59e9a
minor changes
Mar 14, 2018
365e64f
minor changes
Mar 14, 2018
85e88a2
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Mar 15, 2018
594bd9e
Merge branch 'cql_clean_code' into ipv4_addr_plus_port
Mar 15, 2018
053d2f3
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 19, 2018
aac7d46
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
May 24, 2018
8670f46
minor changes
May 24, 2018
552f467
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Jun 5, 2018
3d23cef
minor changes
Jun 14, 2018
0872bf5
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Jun 16, 2018
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
Next Next commit
added address plus port
  • Loading branch information
Razvan Becheriu committed Feb 1, 2018
commit 233950bbf7e471420b44140c0ef44e243a31fd1f
82 changes: 41 additions & 41 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ AX_ISC_CPP11
# Check for std::is_base_of support
AC_MSG_CHECKING([for std::is_base_of])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <type_traits>
class A {};
class B : A {};]
[static_assert(std::is_base_of<A, B>::value, "");])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_IS_BASE_OF], [1],
[Define to 1 if std::is_base_of is available])],
[AC_MSG_RESULT(no)])
[AC_LANG_PROGRAM(
[#include <type_traits>
class A {};
class B : A {};]
[static_assert(std::is_base_of<A, B>::value, "");])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_IS_BASE_OF], [1],
[Define to 1 if std::is_base_of is available])],
[AC_MSG_RESULT(no)])

dnl Determine if we are using GNU sed
GNU_SED=no
Expand Down Expand Up @@ -408,7 +408,6 @@ case "$host" in
;;
esac


# Kea-shell is written in python. It can work with python 2.7 or any 3.x.
# It may likely work with earlier versions, but 2.7 was the oldest one we tested
# it with. We require python only if kea-shell was enabled. It is disabled
Expand Down Expand Up @@ -893,9 +892,9 @@ if test "x$enable_gtest" = "xyes" ; then
AC_MSG_ERROR([no gtest source but it was selected])
fi
else
if test ! -d $GTEST_SOURCE/src -a -d $GTEST_SOURCE/googletest; then
GTEST_SOURCE=$GTEST_SOURCE/googletest
fi
if test ! -d $GTEST_SOURCE/src -a -d $GTEST_SOURCE/googletest; then
GTEST_SOURCE=$GTEST_SOURCE/googletest
fi
AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
[$GTEST_SOURCE/src/gtest_main.cc],
[have_gtest_source=yes],
Expand All @@ -905,7 +904,7 @@ if test "x$enable_gtest" = "xyes" ; then
GTEST_LDADD="\$(top_builddir)/ext/gtest/libgtest.a"
DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest-source=$GTEST_SOURCE"
GTEST_INCLUDES="-I$GTEST_SOURCE -I$GTEST_SOURCE/include"
GTEST_VERSION="`basename $GTEST_SOURCE`"
GTEST_VERSION="`basename $GTEST_SOURCE`"
fi

if test "$gtest_path" != "no" ; then
Expand Down Expand Up @@ -970,15 +969,15 @@ if test $enable_gtest != "no"; then
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <boost/shared_ptr.hpp>
#include <gtest/gtest.h>
void foo() {
boost::shared_ptr<int> bar;
ASSERT_TRUE(bar);
[#include <boost/shared_ptr.hpp>
#include <gtest/gtest.h>
void foo() {
boost::shared_ptr<int> bar;
ASSERT_TRUE(bar);
}],
[return 0;])],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR([XXX_TRUE() Google Test macros won't compile; the most likely reason is that a later version of Google Test is required])])
[return 0;])],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR([XXX_TRUE() Google Test macros won't compile; the most likely reason is that a later version of Google Test is required])])
CPPFLAGS=$CPPFLAGS_SAVED
fi

Expand All @@ -989,21 +988,21 @@ if test $enable_gtest != "no"; then
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES $GTEST_INCLUDES"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <boost/algorithm/string.hpp>
#include <gtest/gtest.h>
#include <string>
#include <vector>
std::string nodiff(std::string text) {
std::vector<std::string> lines;
boost::split(lines, text, boost::is_any_of("\n"));
using namespace testing::internal;
return (edit_distance::CreateUnifiedDiff(lines, lines));
}],
[return 0;])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_CREATE_UNIFIED_DIFF], [1],
[Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
[AC_MSG_RESULT(no)])
[#include <boost/algorithm/string.hpp>
#include <gtest/gtest.h>
#include <string>
#include <vector>
std::string nodiff(std::string text) {
std::vector<std::string> lines;
boost::split(lines, text, boost::is_any_of("\n"));
using namespace testing::internal;
return (edit_distance::CreateUnifiedDiff(lines, lines));
}],
[return 0;])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_CREATE_UNIFIED_DIFF], [1],
[Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
[AC_MSG_RESULT(no)])
CPPFLAGS=$CPPFLAGS_SAVED
fi

Expand Down Expand Up @@ -1039,7 +1038,7 @@ AC_CHECK_FUNCS([pselect])
# code will be updated by the time we really need it.
AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_DEV_POLL=1"
CPPFLAGS="$CPPFLAGS -DBOOST_ASIO_DISABLE_DEV_POLL=1"
fi

#
Expand Down Expand Up @@ -1332,6 +1331,7 @@ AC_CONFIG_FILES([Makefile
src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh
src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh
src/share/database/scripts/mysql/upgrade_5.1_to_6.0.sh
src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh
src/share/database/scripts/pgsql/Makefile
src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
Expand Down Expand Up @@ -1503,9 +1503,9 @@ if test "$CQL_CPPFLAGS" != "" ; then
cat >> config.report << END

Cassandra CQL:
CQL_VERSION: ${CQL_VERSION}
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
CQL_LIBS: ${CQL_LIBS}
CQL_VERSION: ${CQL_VERSION}
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
CQL_LIBS: ${CQL_LIBS}
END
else
cat >> config.report << END
Expand Down
2 changes: 1 addition & 1 deletion src/bin/admin/tests/dhcpdb_create_1.0.cql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
-- Table `lease4`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS lease4 (
address int,
address bigint,
hwaddr blob,
client_id blob,
valid_lifetime bigint,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/admin/tests/dhcpdb_create_1.0.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ COMMIT;
#
# Portability
# ===========
# The "ENGINE = INNODB" on some tables is not portablea to another database
# The "ENGINE = INNODB" on some tables is not portable to another database
# and will need to be removed.
#
# Some columns contain binary data so are stored as VARBINARY instead of
Expand Down
13 changes: 10 additions & 3 deletions src/bin/admin/tests/mysql_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ mysql_upgrade_test() {
mysql -u$db_user -p$db_password $db_name < @abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.mysql

# Sanity check - verify that it reports version 1.0.
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)

assert_str_eq "1.0" ${version} "Expected kea-admin to return %s, returned value was %s"

Expand Down Expand Up @@ -382,9 +382,16 @@ EOF
ERRCODE=$?
assert_eq 0 $ERRCODE "select user_context from dhcp6_options failed. (expected status code %d, returned %d)"

# Verify upgraded schema reports version 6.0
# table: lease4 (upgrade 6.0 -> 7.0)
qry="SELECT address FROM lease4"
text=`mysql_execute "${qry}"`
ERRCODE=$?
assert_eq 0 $ERRCODE "lease4 table is missing or broken. (expected status code %d, returned %d)"

# Verify upgraded schema reports version 7.

version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
assert_str_eq "6.0" ${version} "Expected kea-admin to return %s, returned value was %s"
assert_str_eq "7.0" ${version} "Expected kea-admin to return %s, returned value was %s"

# Let's wipe the whole database
mysql_wipe
Expand Down
2 changes: 1 addition & 1 deletion src/bin/d2/d2_cfg_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {

// Fetch the parameters in the config, performing any logical
// validation required.
asiolink::IOAddress ip_address(0);
asiolink::IOAddress ip_address(0U);
uint32_t port = 0;
uint32_t dns_server_timeout = 0;
dhcp_ddns::NameChangeProtocol ncr_protocol = dhcp_ddns::NCR_UDP;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/dhcp4/ctrl_dhcp4_srv.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ControlledDhcpv4Srv : public isc::dhcp::Dhcpv4Srv {
/// @brief Callback that will be called from iface_mgr when data
/// is received over control socket.
///
/// This static callback method is called from IfaceMgr::receive6() method,
/// This static callback method is called from IfaceMgr::receive4() method,
/// when there is a new command or configuration sent over control socket
/// (that was sent from some yet unspecified sender).
static void sessionReader(void);
Expand Down
72 changes: 68 additions & 4 deletions src/bin/dhcp4/dhcp4_lexer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ unsigned int comment_start_line = 0;

using namespace isc::dhcp;

};
}

/* To avoid the call to exit... oops! */
#define YY_FATAL_ERROR(msg) isc::dhcp::Parser4Context::fatal(msg)
Expand Down Expand Up @@ -410,6 +410,46 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}

\"tcp-nodelay\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
return isc::dhcp::Dhcp4Parser::make_TCP_NODELAY(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("tcp-nodelay", driver.loc_);
}
}

\"reconnect-wait-time\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
return isc::dhcp::Dhcp4Parser::make_RECONNECT_WAIT_TIME(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("reconnect-wait-time", driver.loc_);
}
}

\"request-timeout\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
return isc::dhcp::Dhcp4Parser::make_REQUEST_TIMEOUT(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("request-timeout", driver.loc_);
}
}

\"tcp-keepalive\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
return isc::dhcp::Dhcp4Parser::make_TCP_KEEPALIVE(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("tcp-keepalive", driver.loc_);
}
}

\"connect-timeout\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
Expand Down Expand Up @@ -985,7 +1025,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}


\"parameters\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::HOOKS_LIBRARIES:
Expand Down Expand Up @@ -1382,6 +1421,33 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}

\"v4-psid-offset\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
return isc::dhcp::Dhcp4Parser::make_SUBNET_V4_PSID_OFFSET(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("v4-psid-offset", driver.loc_);
}
}

\"v4-psid-len\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
return isc::dhcp::Dhcp4Parser::make_SUBNET_V4_PSID_LEN(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("v4-psid-len", driver.loc_);
}
}

\"v4-excluded-psids\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::SUBNET4:
return isc::dhcp::Dhcp4Parser::make_SUBNET_V4_EXCLUDED_PSIDS(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("v4-excluded-psids", driver.loc_);
}
}

\"echo-client-id\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
Expand Down Expand Up @@ -1441,8 +1507,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}



{JSONString} {
/* A string has been matched. It contains the actual string and single quotes.
We need to get those quotes out of the way and just use its content, e.g.
Expand Down
2 changes: 1 addition & 1 deletion src/bin/dhcp4/dhcp4_messages.mes
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ the message.

% DHCP4_DHCP4O6_RECEIVING receiving DHCPv4o6 packet from DHCPv6 server
This debug message is printed when the server is receiving a DHCPv4o6
from the DHCPv6 server over inter-process communication socket.
from the DHCPv4 server over inter-process communication socket.

% DHCP4_DHCP4O6_RESPONSE_DATA %1: responding with packet %2 (type %3), packet details: %4
A debug message including the detailed data about the packet being
Expand Down
Loading