Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
bc216c2c
Commit
bc216c2c
authored
Feb 03, 2014
by
Tomek Mrugalski
🛰
Browse files
[3274] ClientClass added, Classes renamed to ClientClasses
parent
9c9ec6cd
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/tests/config_parser_unittest.cc
View file @
bc216c2c
...
...
@@ -456,10 +456,10 @@ public:
}
boost
::
scoped_ptr
<
Dhcpv4Srv
>
srv_
;
// DHCP4 server under test
int
rcode_
;
// Return code from element parsing
ConstElementPtr
comment_
;
// Reason for parse fail
isc
::
dhcp
::
Classes
classify_
;
// used in client classification
boost
::
scoped_ptr
<
Dhcpv4Srv
>
srv_
;
/
//
<
DHCP4 server under test
int
rcode_
;
/
//
<
Return code from element parsing
ConstElementPtr
comment_
;
/
//
<
Reason for parse fail
isc
::
dhcp
::
Client
Classes
classify_
;
/
//
<
used in client classification
};
// Goal of this test is a verification if a very simple config update
...
...
src/bin/dhcp6/tests/config_parser_unittest.cc
View file @
bc216c2c
...
...
@@ -476,7 +476,7 @@ public:
ConstElementPtr
comment_
;
///< Comment (see @ref isc::config::parseAnswer)
string
valid_iface_
;
///< Valid network interface name (present in system)
string
bogus_iface_
;
///< invalid network interface name (not in system)
isc
::
dhcp
::
Classes
classify_
;
///< used in client classification
isc
::
dhcp
::
Client
Classes
classify_
;
///< used in client classification
};
// Goal of this test is a verification if a very simple config update
...
...
src/lib/dhcp/classify.h
View file @
bc216c2c
...
...
@@ -34,8 +34,11 @@ namespace isc {
namespace
dhcp
{
/// Definition of a single class.
typedef
std
::
string
ClientClass
;
/// Container for storing client classes
typedef
std
::
set
<
std
::
string
>
Classes
;
typedef
std
::
set
<
ClientClass
>
Client
Classes
;
};
...
...
src/lib/dhcp/pkt4.h
View file @
bc216c2c
...
...
@@ -581,7 +581,7 @@ public:
/// existing classes. Having it public also solves the problem of returned
/// reference lifetime. It is preferred to use @ref inClass and @ref addClass
/// should be used to operate on this field.
Classes
classes_
;
Client
Classes
classes_
;
private:
...
...
src/lib/dhcp/pkt6.h
View file @
bc216c2c
...
...
@@ -455,7 +455,7 @@ public:
///
/// This field is public, so code can iterate over existing classes.
/// Having it public also solves the problem of returned reference lifetime.
Classes
classes_
;
Client
Classes
classes_
;
protected:
/// Builds on wire packet for TCP transmission.
...
...
src/lib/dhcpsrv/cfgmgr.cc
View file @
bc216c2c
...
...
@@ -123,7 +123,7 @@ CfgMgr::getOptionDef(const std::string& option_space,
Subnet6Ptr
CfgMgr
::
getSubnet6
(
const
std
::
string
&
iface
,
const
isc
::
dhcp
::
Classes
&
/*classes*/
)
{
const
isc
::
dhcp
::
Client
Classes
&
/*classes*/
)
{
if
(
!
iface
.
length
())
{
return
(
Subnet6Ptr
());
...
...
@@ -144,7 +144,7 @@ CfgMgr::getSubnet6(const std::string& iface,
Subnet6Ptr
CfgMgr
::
getSubnet6
(
const
isc
::
asiolink
::
IOAddress
&
hint
,
const
isc
::
dhcp
::
Classes
&
/*classes*/
)
{
const
isc
::
dhcp
::
Client
Classes
&
/*classes*/
)
{
// If there's only one subnet configured, let's just use it
// The idea is to keep small deployments easy. In a small network - one
...
...
@@ -180,7 +180,7 @@ CfgMgr::getSubnet6(const isc::asiolink::IOAddress& hint,
}
Subnet6Ptr
CfgMgr
::
getSubnet6
(
OptionPtr
iface_id_option
,
const
isc
::
dhcp
::
Classes
&
/*classes*/
)
{
const
isc
::
dhcp
::
Client
Classes
&
/*classes*/
)
{
if
(
!
iface_id_option
)
{
return
(
Subnet6Ptr
());
}
...
...
@@ -211,7 +211,7 @@ void CfgMgr::addSubnet6(const Subnet6Ptr& subnet) {
Subnet4Ptr
CfgMgr
::
getSubnet4
(
const
isc
::
asiolink
::
IOAddress
&
hint
,
const
isc
::
dhcp
::
Classes
&
/*classes*/
)
{
const
isc
::
dhcp
::
Client
Classes
&
/*classes*/
)
{
// If there's only one subnet configured, let's just use it
// The idea is to keep small deployments easy. In a small network - one
...
...
src/lib/dhcpsrv/cfgmgr.h
View file @
bc216c2c
...
...
@@ -170,7 +170,7 @@ public:
///
/// @return a subnet object (or NULL if no suitable match was fount)
Subnet6Ptr
getSubnet6
(
const
isc
::
asiolink
::
IOAddress
&
hint
,
const
isc
::
dhcp
::
Classes
&
classes
);
const
isc
::
dhcp
::
Client
Classes
&
classes
);
/// @brief get IPv6 subnet by interface name
///
...
...
@@ -180,7 +180,7 @@ public:
/// @param iface_name interface name
/// @return a subnet object (or NULL if no suitable match was fount)
Subnet6Ptr
getSubnet6
(
const
std
::
string
&
iface_name
,
const
isc
::
dhcp
::
Classes
&
classes
);
const
isc
::
dhcp
::
Client
Classes
&
classes
);
/// @brief get IPv6 subnet by interface-id
///
...
...
@@ -190,7 +190,7 @@ public:
///
/// @return a subnet object
Subnet6Ptr
getSubnet6
(
OptionPtr
interface_id
,
const
isc
::
dhcp
::
Classes
&
classes
);
const
isc
::
dhcp
::
Client
Classes
&
classes
);
/// @brief adds an IPv6 subnet
///
...
...
@@ -249,7 +249,7 @@ public:
///
/// @return a subnet object
Subnet4Ptr
getSubnet4
(
const
isc
::
asiolink
::
IOAddress
&
hint
,
const
isc
::
dhcp
::
Classes
&
classes
);
const
isc
::
dhcp
::
Client
Classes
&
classes
);
/// @brief adds a subnet4
void
addSubnet4
(
const
Subnet4Ptr
&
subnet
);
...
...
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
View file @
bc216c2c
...
...
@@ -186,7 +186,7 @@ public:
}
/// used in client classification (or just empty container for other tests)
isc
::
dhcp
::
Classes
classify_
;
isc
::
dhcp
::
Client
Classes
classify_
;
};
// This test verifies that multiple option definitions can be added
...
...
@@ -352,7 +352,7 @@ TEST_F(CfgMgrTest, addOptionDefNegative) {
}
// This test verifies if the configuration manager is able to hold and return
// valid
leases
// valid
subnets.
TEST_F
(
CfgMgrTest
,
subnet4
)
{
CfgMgr
&
cfg_mgr
=
CfgMgr
::
instance
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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