Commit 79ec6c32 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac998] simple, mostly editorial suggested fixes.

parent 8f5fafa6
......@@ -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
......
......@@ -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()));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment