2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 05:27:55 +00:00

[#1680] added ChangeLog entry and addressed comments

This commit is contained in:
Razvan Becheriu 2021-04-23 20:32:11 +03:00
parent 71cd0f495b
commit af08545ccd
4 changed files with 31 additions and 16 deletions

View File

@ -1,3 +1,9 @@
1895. [func] razvan
Added additional evaluation tokens to extract and print data:
addrtotext, int8totext, int16totext, int32totext, uint8totext,
uint16totext, uint32totext.
(Gitlab #1680)
1894. [func] fdupont
Implemented 'auth' logger, dedicated to logging access
control information, such as basic HTTP authentication.

View File

@ -321,7 +321,9 @@ loaded by the correct process per the table below.
| | |sufficient it may be used directly. If your jurisdiction |
| | |requires that you save a different set of information, you |
| | |may use it as a template or example and create your own |
| | |custom logging hooks. |
| | |custom logging hooks. In Kea 1.9.7 additional parameters |
| | |have been added to give users more flexibility regarding |
| | |what information should be logged. |
+-----------------+---------------+------------------------------------------------------------+
| Flexible | Support |Kea software provides a way to handle host reservations that|
| Identifier | customers |include addresses, prefixes, options, client classes and |

View File

@ -493,12 +493,12 @@ public:
}
/// @brief checks if the given token is a inttotext operator
template <typename IntegerType, typename TokenInteger>
template <typename IntegerType, typename TokenIntegerType>
void checkTokenIntToText(const TokenPtr& token,
const std::string& expected) {
ASSERT_TRUE(token);
boost::shared_ptr<TokenInteger> inttotext =
boost::dynamic_pointer_cast<TokenInteger>(token);
boost::shared_ptr<TokenIntegerType> inttotext =
boost::dynamic_pointer_cast<TokenIntegerType>(token);
EXPECT_TRUE(inttotext);
Pkt4Ptr pkt4(new Pkt4(DHCPDISCOVER, 12345));

View File

@ -116,6 +116,7 @@ TokenIpAddressToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
if (!size) {
return;
}
values.pop();
if ((size != V4ADDRESS_LEN) && (size != V6ADDRESS_LEN)) {
@ -143,12 +144,13 @@ TokenInt8ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(int8_t)) {
@ -171,12 +173,13 @@ TokenInt16ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(int16_t)) {
@ -201,12 +204,13 @@ TokenInt32ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(int32_t)) {
@ -231,12 +235,13 @@ TokenUInt8ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(uint8_t)) {
@ -259,12 +264,13 @@ TokenUInt16ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(uint16_t)) {
@ -289,12 +295,13 @@ TokenUInt32ToText::evaluate(Pkt& /*pkt*/, ValueStack& values) {
isc_throw(EvalBadStack, "Incorrect empty stack.");
}
size_t size;
string op = values.top();
size_t size = op.size();
if (!(size = op.size())) {
if (!size) {
return;
}
values.pop();
if (size != sizeof(uint32_t)) {