mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 04:57:52 +00:00
[trac4269] Add documentation and test for handling pkt4 as input
This commit is contained in:
parent
72859969fc
commit
2a01de22f2
@ -169,6 +169,20 @@
|
||||
sub-option</entry><entry>relay4[code].hex</entry><entry>The value of
|
||||
sub-option with code "code" from the DHCPv4 Relay Agent Information option
|
||||
(option 82)</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.</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.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
@ -209,6 +223,14 @@ sub-option with code "code" from the DHCPv4 Relay Agent Information option
|
||||
instance "relay4[code].exists" is supported.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
"pkt6" refers to information from the client request. To access any
|
||||
information from an intermediate relay use "relay6". "pkt6.msgtype"
|
||||
outputs the string representation of the integer value for the message
|
||||
type, for example SOLICIT will be '1'. "pkt6.transid" outputs the string
|
||||
representation of the value of the transaction ID.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<table frame="all" id="classification-expressions-list">
|
||||
<title>List of Classification Expressions</title>
|
||||
|
@ -985,4 +985,9 @@ TEST_F(TokenTest, pkt6Fields) {
|
||||
EXPECT_NO_THROW(t_->evaluate(*pkt6_, values_));
|
||||
ASSERT_EQ(1, values_.size());
|
||||
EXPECT_EQ("12345", values_.top());
|
||||
|
||||
// Check that working with a v4 packet generates an error
|
||||
clearStack();
|
||||
ASSERT_NO_THROW(t_.reset(new TokenPkt6(TokenPkt6::TRANSID)));
|
||||
EXPECT_THROW(t_->evaluate(*pkt4_, values_), EvalTypeError);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user