[Kea-users] Need help defining custom options

James Sumners JamesSumners at clayton.edu
Tue Jan 31 13:36:13 UTC 2017


Documentation wouldn’t be too difficult:

When the data field is a string, and that string contains the comma (,; U+002C) character, the comma must be escaped with a two reverse solidus characters (\\; U+005C). For example, the string foo,bar would be foo\\,bar.

However, I’m not sure that escaping is the best route. It is clear to me that the problem stems from the fact that the data property can either only be a CSV value or a binary value. My suggestion for a more robust fix would be to remove the csv-format property and replace it with a format property. The new format property could accept the string values: ‘csv’, ‘binary’, or ‘literal’. The default could remain ‘csv’, and the case under discussion would be ‘literal’. This would also provide the possibility for other value types in the future.




On January 31, 2017 at 6:42:36 AM, Francis Dupont (fdupont at isc.org<mailto:fdupont at isc.org>) wrote:

As Vicky said in another response the ticket is under review so it will
be merged before the 1.2 release but the delay from today is only bounded
(I have no control on it as I wrote the patch so I may not review it too).
I pushed the trac5105 branch on github so you can take it. There is only
one commit so it is easy to make a patch from it and to apply it to
Kea 1.1 sources. I am checking it: patch succeeded with different offsets
(not a problem: this just means some files have changed since 1.1).
I am running a full check and I expect it will be successful.
An important detail: to not be misinterpreted as a field separator
commas must be escaped. The escape character is the backslash \ which
is also the escape one for JSON and C++ so to put foo,bar into an
option data string value you have to use "data": "foo\\,bar"
(and in C++ examples this becomes \"data\": \"foo\\\\,bar\" in
the case you read the patch content).
BTW something I expect from the reviewer is a request for documentation
so if you have an idea about to explain the escape feature in the Kea
user guide...

Regards

Francis Dupont <fdupont at isc.org>

PS: to clone the github repository:
git clone https://github.com/isc-projects/kea.git

if you already have a clone, don't forget to pull it and to checkout master.
To get the patch:
git diff ...origin/trac5105 > trac5105.diff

To apply the patch go to your kea sources and:
patch -p1 < trac5105.diff

And build kea...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20170131/6375ea1d/attachment.htm>


More information about the Kea-users mailing list