Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
3606c3ba
Commit
3606c3ba
authored
Jul 16, 2018
by
mayya
Committed by
Tomek Mrugalski
Jul 23, 2018
Browse files
fixed minor issues
parent
f30ca446
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/host.cc
View file @
3606c3ba
...
...
@@ -73,8 +73,7 @@ AuthKey::operator!=(const AuthKey& other) const {
IPv6Resrv
::
IPv6Resrv
(
const
Type
&
type
,
const
asiolink
::
IOAddress
&
prefix
,
const
uint8_t
prefix_len
)
:
type_
(
type
),
prefix_
(
asiolink
::
IOAddress
(
"::"
)),
prefix_len_
(
128
){
:
type_
(
type
),
prefix_
(
asiolink
::
IOAddress
(
"::"
)),
prefix_len_
(
128
)
{
// Validate and set the actual values.
set
(
type
,
prefix
,
prefix_len
);
}
...
...
src/lib/dhcpsrv/host.h
View file @
3606c3ba
...
...
@@ -696,6 +696,8 @@ private:
std
::
string
server_host_name_
;
/// @brief Boot file name (a.k.a. file, carried in DHCPv4 message)
std
::
string
boot_file_name_
;
/// @brief HostID (a unique identifier assigned when the host is stored in
/// MySQL, PostgreSQL or Cassandra)
uint64_t
host_id_
;
...
...
@@ -710,15 +712,14 @@ private:
/// we queried other backends for specific host and there was no
/// entry for it.
bool
negative_
;
/// @brief key
s
for authentication .
/// @brief key for authentication .
///
///
This
key is a 16 byte value to be used in the authentication field
///
During s
erver replies
specified in the RFC 3315bis authentication field will
//
/ contain the below key.
While sending reconfigure message authentication field
/// key is a 16 byte value to be used in the authentication field
.
///
S
erver replies
will contain the below key in authentication field as specified in the RFC 3315bis.
//
While sending reconfigure message authentication field
/// shall contain MD5 hash computed using this key.
AuthKey
key_
;
/// @brief HostID (a unique identifier assigned when the host is stored in
};
/// @brief Pointer to the @c Host object.
...
...
src/lib/dhcpsrv/memfile_lease_mgr.h
View file @
3606c3ba
...
...
@@ -312,6 +312,12 @@ public:
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual
Lease6Collection
getLeases6
()
const
;
/// @brief Returns IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
virtual
Lease6Collection
getLeases6
(
const
DUID
&
duid
)
const
;
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
...
...
src/lib/dhcpsrv/mysql_host_data_source.cc
View file @
3606c3ba
...
...
@@ -76,7 +76,6 @@ const size_t BOOT_FILE_NAME_MAX_LEN = 128;
/// @brief Maximum length of keys.
const
size_t
KEY_LEN
=
16
;
/// @brief Numeric value representing last supported identifier.
/// @brief Numeric value representing last supported identifier.
///
/// This value is used to validate whether the identifier type stored in
...
...
src/lib/dhcpsrv/mysql_lease_mgr.h
View file @
3606c3ba
...
...
@@ -309,6 +309,12 @@ public:
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual
Lease6Collection
getLeases6
()
const
;
/// @brief Returns all IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
virtual
Lease6Collection
getLeases6
(
const
DUID
&
duid
)
const
;
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
...
...
src/lib/dhcpsrv/pgsql_lease_mgr.h
View file @
3606c3ba
...
...
@@ -281,6 +281,12 @@ public:
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual
Lease6Collection
getLeases6
()
const
;
/// @brief Returns IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID
virtual
Lease6Collection
getLeases6
(
const
DUID
&
duid
)
const
;
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
...
...
src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
View file @
3606c3ba
...
...
@@ -1590,9 +1590,9 @@ TEST_F(ExpirationAllocEngine6Test, reclaimDeclinedStats) {
// This test verifies that expired leases are reclaimed before they are
// allocated to another client sending a Request message.
/
/TEST_F(ExpirationAllocEngine6Test, reclaimReusedLeases) {
//
testReclaimReusedLeases(DHCPV6_REQUEST, false);
//
}
/
TEST_F
(
ExpirationAllocEngine6Test
,
reclaimReusedLeases
)
{
testReclaimReusedLeases
(
DHCPV6_REQUEST
,
false
);
}
// This test verifies that allocation engine detects that the expired
// lease has been reclaimed already when it reuses this lease.
...
...
src/lib/dhcpsrv/tests/host_unittest.cc
View file @
3606c3ba
...
...
@@ -1285,5 +1285,3 @@ TEST(AuthKeyTest, basicTest) {
}
}
// end of anonymous namespace
// Test verifies if
src/share/database/scripts/cql/dhcpdb_create.cql
View file @
3606c3ba
...
...
@@ -276,6 +276,9 @@ INSERT INTO schema_version (version, minor) VALUES(2, 0);
-- This line starts database upgrade to version 3.0
-- This line adds auth_key column into host reservation table
ALTER TABLE host_reservations ADD auth_key text;
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD user_context text;
ALTER TABLE lease6 ADD user_context text;
...
...
src/share/database/scripts/mysql/dhcpdb_create.mysql
View file @
3606c3ba
...
...
@@ -679,6 +679,10 @@ SET version = '6', minor = '0';
# This line concludes database upgrade to version 6.0.
#add auth key in host tables
ALTER TABLE hosts
ADD COLUMN auth_key VARCHAR(16) NULL;
# Add user context into tables holding leases
ALTER TABLE lease4 ADD COLUMN user_context TEXT NULL;
ALTER TABLE lease6 ADD COLUMN user_context TEXT NULL;
...
...
src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in
View file @
3606c3ba
...
...
@@ -23,7 +23,6 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
# Add user contexts into tables holding DHCP options
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
ALTER TABLE ipv6_reservations ADD COLUMN auth_key VARCHAR(128) NOT NULL;
# Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
...
...
src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in
View file @
3606c3ba
...
...
@@ -19,6 +19,9 @@ psql "$@" >/dev/null <<EOF
START TRANSACTION;
-- Create auth_key in hosts table
ALTER TABLE hosts ADD COLUMN auth_key VARCHAR(16) DEFAULT NULL;
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD COLUMN user_context TEXT;
ALTER TABLE lease6 ADD COLUMN user_context TEXT;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment