Commit be3961f4 authored by Shawn Routhier's avatar Shawn Routhier
Browse files

[trac4483] Tidy up some typos and spacing

parent 82f3b238
......@@ -19,12 +19,12 @@
# One packet can belong to zero or more classes.
"client-classes": [
# The first class attempts to match the whole hardware address to specific
# value. All incoming packets with that MAC address will get special
# The first class attempts to match the whole hardware address to a specific
# value. All incoming packets with that MAC address will get a special
# value of the option. If there are many hosts that require special
# treatment, it is much better to use host reservations. However, doing
# tricks with MAC addresses may prove useful in some cases, e.g.
# by matching OUI to known value we can detect certain vendors.
# by matching OUI to known values we can detect certain vendors.
{
"name": "special_snowflake",
"test": "pkt4.mac == 0x010203040506",
......@@ -41,7 +41,7 @@
"test": "pkt4.msgtype == 1"
},
# Clients are supposed to set transaction-id field to a random value.
# Clients are supposed to set the transaction-id field to a random value.
# Clients that send it with 0 are most likely broken. Let's mark them
# as such.
{
......@@ -61,23 +61,23 @@
# The following list defines subnets. For some subnets we defined
# a class that is allowed in that subnet. If not specified,
# everyone is allowed. When it is specified, only packets belonging
# to that class are allowed for a given subnet.
# everyone is allowed. When a class is specified, only packets belonging
# to that class are allowed for that subnet.
"subnet4": [
{
{
# This one is for VoIP devices only.
"pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
"subnet": "192.0.2.0/24",
"client-class": "VoIP",
"interface": "ethX"
},
"pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
"subnet": "192.0.2.0/24",
"client-class": "VoIP",
"interface": "ethX"
},
# This one doesn't have any client-class specified, so everyone
# is allowed in. The normal subnet selection rules still apply,
# though.
{
"pools": [ { "pool": "192.0.3.1 - 192.0.3.200" } ],
"subnet": "192.0.3.0/24",
"interface": "ethX"
"pools": [ { "pool": "192.0.3.1 - 192.0.3.200" } ],
"subnet": "192.0.3.0/24",
"interface": "ethX"
}
]
},
......
......@@ -34,12 +34,12 @@
# Let's classify all incoming RENEW (message type 5) to a separate
# class.
{
"name": "discovers",
"name": "renews",
"test": "pkt6.msgtype == 5"
},
# Let's pick cable modems. In this simple example we'll assume the device
# is a cable modem if it sends vendor option with enterprise-id equal
# is a cable modem if it sends a vendor option with enterprise-id equal
# to 4491.
{
"name": "cable-modems",
......
......@@ -181,7 +181,7 @@
<entry>Integer literal</entry>
<entry>123</entry>
<entry>'123'</entry>
<entry>A 32 bits unsigned integer value</entry>
<entry>A 32 bit unsigned integer value</entry>
</row>
<row></row>
<row>
......@@ -258,7 +258,7 @@
<entry>pkt.len</entry>
<entry>513</entry>
<entry>The length of a DHCP packet (UDP header field), expressed
as 32 bits unsigned integer.</entry>
as a 32 bit unsigned integer.</entry>
</row>
<row>
<entry>Hardware address in DHCPv4 packet</entry>
......@@ -307,28 +307,28 @@
<entry>pkt4.msgtype</entry>
<entry>1</entry>
<entry>The value of the message type field in the DHCPv4
packet (expressed as 32 bits unsigned integer).</entry>
packet (expressed as a 32 bit unsigned integer).</entry>
</row>
<row>
<entry>Transaction ID (xid) in DHCPv4 packet</entry>
<entry>pkt4.transid</entry>
<entry>12345</entry>
<entry>The value of the transaction id in the DHCPv4
packet (expressed as 32 bits unsigned integer).</entry>
packet (expressed as a 32 bit unsigned integer).</entry>
</row>
<row>
<entry>Message Type in DHCPv6 packet</entry>
<entry>pkt6.msgtype</entry>
<entry>1</entry>
<entry>The value of the message type field in the DHCPv6
packet (expressed as 32 bits unsigned integer).</entry>
packet (expressed as a 32 bit unsigned integer).</entry>
</row>
<row>
<entry>Transaction ID in DHCPv6 packet</entry>
<entry>pkt6.transid</entry>
<entry>12345</entry>
<entry>The value of the transaction id in the DHCPv6
packet (expressed as 32 bits unsigned integer).</entry>
packet (expressed as a 32 bit unsigned integer).</entry>
</row>
<row>
......@@ -426,9 +426,9 @@
</para>
<para>
Integers in the expression are converted to 32 bit unsigned integers and
Integers in an expression are converted to 32 bit unsigned integers and
are represented as four byte strings. For example 123 is represented as
0x0000007b. All expressions that return numeric values use 32 bits
0x0000007b. All expressions that return numeric values use 32 bit
unsigned integers, even if the field in the packet is smaller. In general
it is easier to use decimal notation to represent integers, but it is also
possible to use hex notation. When using hex notation to represent an
......
......@@ -133,12 +133,12 @@ public:
/// @brief Converts integer to string representation
///
/// The integer is coded as 4 bytes long string in network order, e.g.
/// The integer is coded as a 4 byte long string in network order, e.g.
/// 6 is represented as 00000006. For reverse conversion, see
/// @ref convertUint32.
///
/// @param integer value to be converted
/// @return 4 bytes long string that encodes the value.
/// @return 4 byte long string that encodes the value.
static std::string fromUint32(const uint32_t integer);
/// @brief Returns the universe (v4 or v6)
......
......@@ -286,10 +286,10 @@ TEST_F(EvaluateTest, complex) {
/// @brief Generic class for parsing expressions and evaluating them.
///
/// The main purpose of this class is to provide a generic interface to the
/// eval library, so everything (expression parsing and then its evaluation for
/// eval library, so everything (expression parsing and then evaluation for
/// given packets) can be done in one simple call.
///
/// Those tests may be somewhat redundant to other more specialized tests, but
/// These tests may be somewhat redundant to other more specialized tests, but
/// the idea here is to mass produce tests that are trivial to write.
class ExpressionsTest : public EvaluateTest {
public:
......@@ -302,7 +302,7 @@ public:
/// Note that contrary to the usual interface, this method calls
/// @ref isc::dhcp::evaluateString, rather than @ref isc::dhcp::evaluate.
/// The main benefit of this is the ability to test partial expressions that
/// not necessarily evaluate to bool.
/// do not necessarily evaluate to bool.
///
/// @param u universe (V4 or V6)
/// @param expr expression to be parsed
......@@ -380,7 +380,7 @@ TEST_F(ExpressionsTest, expressionsPkt4Hlen) {
testExpression(Option::V4, "pkt4.hlen == 0", true);
testExpression(Option::V4, "pkt4.htype == 1", true);
// Ok, let's initialized the hardware address to something plausible.
// Ok, let's initialize the hardware address to something plausible.
const size_t hwaddr_len = 6;
const uint16_t expected_htype = 123;
std::vector<uint8_t> hw(hwaddr_len,0);
......
......@@ -194,10 +194,10 @@ public:
}
}
/// @brief Aux. function that stores integer values as 4 bytes string.
/// @brief Aux. function that stores integer values as 4 byte string.
///
/// @param value integer value to be stored
/// @return 4 bytes long string with encoded value.
/// @return 4 byte long string with encoded value.
string encode(uint32_t value) {
return EvalContext::fromUint32(value);
}
......@@ -483,10 +483,10 @@ public:
evaluate(u, expected);
}
/// @brief Tests if TokenInteger evaluates to proper value
/// @brief Tests if TokenInteger evaluates to the proper value
///
/// @param value integer value passed to constructor
/// @param expected expected string representation on stack after evaluation
/// @param value integer value passed to constructor
void testInteger(std::string expected, uint32_t value) {
clearStack();
......
......@@ -155,11 +155,11 @@ protected:
std::string value_; ///< Constant value
};
/// @brief Token representing an unsigned 32 bits integer
/// @brief Token representing an unsigned 32 bit integer
///
/// For performance reasons, the constant integer value is converted to string
/// just once (in constructor). Afterwards, this effectively works as constant
/// 4 bytes long string. Hence this class is derived from TokenString and
/// For performance reasons, the constant integer value is converted to a string
/// just once (in the constructor). Afterwards, this effectively works as a constant
/// 4 byte long string. Hence this class is derived from TokenString and
/// does not even need its own evaluate() method.
class TokenInteger : public TokenString {
public:
......
Markdown is supported
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