Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4092 closed enhancement (complete)

Implement TokenOption class

Reported by: sar Owned by:
Priority: medium Milestone: Kea1.0-beta
Component: dhcp Version: git
Keywords: classification Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 24 Internal?: no

Description (last modified by marcin)

Implement the token option class for both v4 and v6 to extract the requested option from a packet.

This may have already been addressed in 4081

Subtickets

Change History (6)

comment:1 Changed 4 years ago by sar

  • Keywords classification added

comment:2 Changed 4 years ago by sar

  • Priority changed from high to medium

The current code (as merged from 4081) provides a basic TokenOption? class.

This ticket is now to expand the TokenOption? class to support setting the code by name rather than requiring the user to know the proper DHCPv4 or DHCPv6 option code.

It is also being reduced from high to medium and may be reduced further at the next review.

comment:3 Changed 4 years ago by fdupont

Some questions:

  • is the option name a literal? I believe it will be the case until we ask for an Option operator (vs a constructor). So this can be handled by the parser (i.e., the parser does the name -> code mapping when the lexical cast on the code fails, and calls the TokenOpen? constructor with the code value.
  • can the name be a configured one from option-def? Note this only changes the time the parser is called: if the answer is yes it can be called only after option-def's are built.
  • do we want a space qualifier? (I believe we want one with a default and "." as separator)

comment:4 Changed 4 years ago by fdupont

For info option names have some constraints, according to OptionDefinition::validate():

    // Allowed characters in the option name are: lower or
    // upper case letters, digits, underscores and hyphens.
    ...
    // Hyphens and underscores are not allowed at the beginning
    // and at the end of the option name.

comment:5 Changed 4 years ago by marcin

  • Description modified (diff)
  • Resolution set to complete
  • Status changed from new to closed

Because the TokenOption has been implemented in #4081 I am closing this ticket. I opened #4204 to address referencing options by name in the evaluation code.

comment:6 Changed 4 years ago by tomek

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

Milestone renamed

Note: See TracTickets for help on using tickets.