Skip to content
GitLab
Menu
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
79ec6c32
Commit
79ec6c32
authored
Jun 22, 2011
by
JINMEI Tatuya
Browse files
[trac998] simple, mostly editorial suggested fixes.
parent
8f5fafa6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/acl/ip_check.h
View file @
79ec6c32
...
...
@@ -152,9 +152,9 @@ public:
/// \param address IP address to check for (as an address in host-byte
/// order). Note host-byte order - this is different to the IPV6
/// constructor.
/// \param prefixlen The prefix length specified as an integer between 0
and
/// 32. This determines the number of bits of the address to
check.
/// (A value of zero imples match all IPV4 addresses.)
/// \param prefixlen The prefix length specified as an integer between 0
///
and
32. This determines the number of bits of the address to
///
check.
(A value of zero imples match all IPV4 addresses.)
IPCheck
(
uint32_t
address
,
int
prefixlen
=
8
*
IPV4_SIZE
)
:
address_
(
IPV4_SIZE
),
mask_
(),
family_
(
AF_INET
)
{
...
...
@@ -175,8 +175,9 @@ public:
///
/// \param address IP address to check for (as an address in network-byte
/// order).
/// \param mask The network mask specified as an integer between 1 and
/// 128 This determines the number of bits in the mask to check.
/// \param prefixlen The prefix length specified as an integer between 0
/// and 128. This determines the number of bits of the address to
/// check.
IPCheck
(
const
uint8_t
*
address
,
int
prefixlen
=
8
*
IPV6_SIZE
)
:
address_
(
address
,
address
+
IPV6_SIZE
),
mask_
(),
family_
(
AF_INET6
)
{
...
...
@@ -197,8 +198,7 @@ public:
/// address). If "n" is specified as zero, the match is for any
/// address in that address family. The address can also be
/// given as "any4" or "any6".
IPCheck
(
const
std
::
string
&
ipprefix
)
:
address_
(),
mask_
(),
family_
(
0
)
{
IPCheck
(
const
std
::
string
&
ipprefix
)
:
address_
(),
mask_
(),
family_
(
0
)
{
// Check for special cases first.
if
(
ipprefix
==
"any4"
)
{
family_
=
AF_INET
;
...
...
@@ -210,7 +210,7 @@ public:
// General address prefix. Split into address part and prefix
// length.
std
::
pair
<
std
::
string
,
int
>
result
=
const
std
::
pair
<
std
::
string
,
int
>
result
=
internal
::
splitIPAddress
(
ipprefix
);
// Try to convert the address. If successful, the result is in
...
...
src/lib/acl/tests/ip_check_unittest.cc
View file @
79ec6c32
...
...
@@ -77,7 +77,7 @@ struct GeneralAddress {
// Check that the IPV4 address is the same as that given.
bool
equals
(
uint32_t
address
)
{
if
(
addr
.
size
()
==
IPV4_SIZE
)
{
vector
<
uint8_t
>
byte_address
=
convertUint32
(
address
);
const
vector
<
uint8_t
>
byte_address
=
convertUint32
(
address
);
return
(
equal
(
byte_address
.
begin
(),
byte_address
.
end
(),
addr
.
begin
()));
}
...
...
Write
Preview
Supports
Markdown
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