Opened 2 years ago

Closed 7 months ago

#4070 closed enhancement (complete)

Enhance option configuration parsing to accept multiple string like fields

Reported by: sar Owned by: fdupont
Priority: low Milestone: Kea1.2-final
Component: remote-management Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Mozilla Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 3
Total Hours: 13 Internal?: no

Description (last modified by hschempf)

For some options such as v4 option 124 or v6 option 60 the specification allows for an arbitrary number of strings separated by lengths
<length1><string1><length2><string2>.....<lengthN><stringN>
It would be useful to allow the user to specify this as a set of strings rather than as a hex string that requires them to determine the lengths. So something like
"foo, test"
instead of something like (with the 3 and 4 as actual numbers instead of ascii characters)
"3foo4test"

Opened as medium / 1.0 per discussion in Sept 28, the priority may be modified upon review.

Subtickets

Change History (20)

comment:1 Changed 2 years ago by sar

  • Type changed from defect to enhancement

comment:2 Changed 2 years ago by sar

This is an outgrowth of ticket 3576 working on the PXE options.

comment:3 follow-up: Changed 2 years ago by fdupont

I have a question about this: is this in fact a call for a "string array" new option type?

comment:4 in reply to: ↑ 3 Changed 2 years ago by sar

Replying to fdupont:

I have a question about this: is this in fact a call for a "string array" new option type?

as part of the work on 3576 I'll be adding a new option type currently named OptionOpaqueDataTuples?. This should provide the functionality for manipulating the strings and packing and unpacking them for wire format.

What this ticket is for is to be able to configure such an option more conveniently - so enhance the code to pick the information up from the configuration file and convert it into the proper option class.

comment:5 Changed 2 years ago by stephen

  • Priority changed from medium to low

Moved to low priority as per Kea planning meeting on 14 October 2015.

comment:6 Changed 2 years ago by tomek

  • Milestone changed from Kea1.0 to Kea1.0-beta

Milestone renamed

comment:7 Changed 2 years ago by hschempf

  • Description modified (diff)

Per team meeting Dec 2, this ticket could be put off to a time later than 1.0, if needed

comment:8 Changed 2 years ago by tomek

  • Milestone changed from Kea1.0-beta to Kea1.0

comment:9 Changed 23 months ago by tomek

  • Milestone changed from Kea1.0 to Outstanding Tasks

comment:10 Changed 15 months ago by tomek

  • Milestone changed from Outstanding Tasks to Kea1.2

comment:11 Changed 14 months ago by tomek

  • Component changed from dhcp to configuration

comment:12 Changed 13 months ago by tomek

  • Component changed from configuration to remote-management

comment:13 Changed 9 months ago by fdupont

  • Owner set to fdupont
  • Status changed from new to accepted

comment:14 Changed 9 months ago by fdupont

  • Add Hours to Ticket changed from 0 to 10
  • Owner changed from fdupont to UnAssigned
  • Status changed from accepted to reviewing

Added new tuple option data type.
Added readTuple and writeTuple using std::string or OpaqueDataTuple.
Updated option data type, option custom and option definition code and tests.
Moved D6O_BOOTFILE_PARAM (DHCPv6 option code 60) to use now a tuple array.

Two comments:

  • DHO_VIVCO_SUBOPTIONS (DHCPv4 option code 124) uses a slightly different format so the DHCPv4 side is currently unused.
  • there is no DHCPv6 option code 60 test in the DHCPv6 server code (IMHO we should add one).

Ready for review.

comment:15 Changed 9 months ago by fdupont

Add the example from kea-user <CAD_nvyN1q3ghxaGwp6TkmfGbDvSy7Lihs1T97TmtM2FC_EdFpQ@…> message.

comment:16 Changed 9 months ago by tomek

  • Sub-Project changed from DHCP to Mozilla

comment:17 Changed 8 months ago by tomek

  • Milestone changed from Kea1.2 to Kea1.2-final

Code freeze for 1.2-beta. Moving all remaining open tickets to 1.2-final.

comment:18 Changed 7 months ago by tomek

  • Owner changed from UnAssigned to tomek

comment:19 Changed 7 months ago by tomek

  • Add Hours to Ticket changed from 10 to 3
  • Owner changed from tomek to fdupont
  • Total Hours changed from 0 to 13

I reviewed your changes and they look good. The code compiles and unit-tests pass on Ubuntu 16.04 x64. There's one thing that needs changing. Please update one of the example files in doc/examples/kea6/ (preferably multiple-options.json to show how to define option 60). We have another ticket to put more option examples and it will address all the existing formats we have. But we also should have an example of option 60.

This change requires ChangeLog. If you don't have any better proposal, here's one:

12xx.	[func]		fdupont
	Support for tuple-based options added. DHCPv6 option
	bootfile-param (code 60) can now be set in a more convenient
	manner.
	(Trac #4070, git tbd)

comment:20 Changed 7 months ago by fdupont

  • Resolution set to complete
  • Status changed from reviewing to closed

Added an example using a Linux doc in order to put realistic values. Merged. Closing.

Note: See TracTickets for help on using tickets.