Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sub_option type & sname/fname to config #6

Merged
merged 4 commits into from
Feb 3, 2023
Merged

Conversation

leshow
Copy link
Collaborator

@leshow leshow commented Dec 9, 2022

We likely need a way to introduce options that have sub-options or "encapsulated options" into the config. Option 43 comes to mind. We support hex decoding, but it is pretty cumbersome to read/write especially in the presence of encapsulated options.

With change, this block of options

  43:
      type: sub_option
      value:
          1:
              type: str
              value: "foobar"
          2:
              type: ip
              value: 1.2.3.4

will be decoded into (it's a hashmap so the order is not consistent)

VendorExtensions: VendorExtensions([2, 4, 1, 2, 3, 4, 1, 6, 102, 111, 111, 98, 97, 114])

I've opened an issue in the protocol repo: bluecatengineering/dhcproto#45 so that we can track supporting encapsulated options better there also. To make VendorExtensions type really usable inside dora we likely need a way to pull out specific sub-options.

I took the opportunity to add sname and fname to the config also. These can now be set with server_name and file_name and will be put in the respective header fields.

@leshow leshow marked this pull request as draft December 9, 2022 21:45
@leshow leshow changed the title draft: add sub_option type to config draft: add sub_option type & sname/fname to config Dec 13, 2022
@leshow leshow changed the title draft: add sub_option type & sname/fname to config add sub_option type & sname/fname to config Feb 3, 2023
@leshow leshow marked this pull request as ready for review February 3, 2023 17:08
@leshow leshow merged commit 6416fdb into master Feb 3, 2023
@leshow leshow deleted the sub_options branch June 8, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant