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
1b01a9d0
Commit
1b01a9d0
authored
Jun 23, 2011
by
Stephen Morris
Browse files
[trac998] Change IPV4/6 to IPv4/6 in comments.
parent
735f817c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/acl/ip_check.h
View file @
1b01a9d0
...
...
@@ -123,7 +123,7 @@ splitIPAddress(const std::string& ipprefix);
/// \brief IP Check
///
/// This class performs a match between an IP address prefix specified in an ACL
/// and a given IP address. The check works for both IP
V
4 and IP
V
6 addresses.
/// and a given IP address. The check works for both IP
v
4 and IP
v
6 addresses.
///
/// The class is templated on the type of a context structure passed to the
/// matches() method, and a template specialisation for that method must be
...
...
@@ -137,17 +137,17 @@ private:
static
const
size_t
IPV4_SIZE
=
sizeof
(
struct
in_addr
);
public:
/// \brief IP
V
4 Constructor
/// \brief IP
v
4 Constructor
///
/// Constructs an IPCheck object from a network address given as a
/// 32-bit value in network byte order and a prefix length.
///
/// \param address IP address to check for (as an address in host-byte
/// order). Note host-byte order - this is different to the IP
V
6
/// order). Note host-byte order - this is different to the IP
v
6
/// 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 IP
V
4 addresses.)
/// check. (A value of zero imples match all IP
v
4 addresses.)
IPCheck
(
uint32_t
address
,
int
prefixlen
=
8
*
IPV4_SIZE
)
:
address_
(
IPV4_SIZE
),
mask_
(),
family_
(
AF_INET
)
{
...
...
@@ -161,9 +161,9 @@ public:
setMask
(
prefixlen
);
}
/// \brief IP
V
6 Constructor
/// \brief IP
v
6 Constructor
///
/// Constructs an IP
V
6 Check object from a network address given as a
/// Constructs an IP
v
6 Check object from a network address given as a
/// 16-byte array in network-byte order and a prefix length.
///
/// \param address IP address to check for (as an address in network-byte
...
...
@@ -183,7 +183,7 @@ public:
/// form <ip-address>/n".
///
/// Also allowed are the special keywords "any4" and "any6", which match
/// any IP
V
4 or IP
V
6 address. These must be specified exactly as-is
/// any IP
v
4 or IP
v
6 address. These must be specified exactly as-is
/// (i.e. lowercase, with no leading or trailing spaces).
///
/// \param ipprefix IP address prefix in the form "<ip-address>/n"
...
...
@@ -214,13 +214,13 @@ public:
int
status
=
inet_pton
(
AF_INET6
,
result
.
first
.
c_str
(),
address_bytes
);
if
(
status
==
1
)
{
// It was an IP
V
6 address, copy into the address store
// It was an IP
v
6 address, copy into the address store
std
::
copy
(
address_bytes
,
address_bytes
+
IPV6_SIZE
,
std
::
back_inserter
(
address_
));
family_
=
AF_INET6
;
}
else
{
// Not IP
V
6, try IP
V
4
// Not IP
v
6, try IP
v
4
int
status
=
inet_pton
(
AF_INET
,
result
.
first
.
c_str
(),
address_bytes
);
if
(
status
==
1
)
{
...
...
@@ -301,7 +301,7 @@ public:
/// \return Address family
int
getFamily
()
const
{
// Check that a family_ value of 0 does not imply IP
V
4 or IP
V
6.
// Check that a family_ value of 0 does not imply IP
v
4 or IP
v
6.
// This avoids confusion if getFamily() is called on an object that
// has been initialized by default.
BOOST_STATIC_ASSERT
(
AF_INET
!=
0
);
...
...
@@ -383,7 +383,7 @@ private:
if
(
requested
<=
maxmask
)
{
// Loop, setting the bits in the set of mask bytes until all the
// specified bits have been used up. As both IP
V
4 and IP
V
6
// specified bits have been used up. As both IP
v
4 and IP
v
6
// addresses are stored in network-byte order, this works in
// both cases.
size_t
bits_left
=
requested
;
// Bits remaining to set
...
...
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