-
Notifications
You must be signed in to change notification settings - Fork 121
Add VSS plugin support #195
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
base: master
Are you sure you want to change the base?
Conversation
b0fc4d5
to
4df8656
Compare
Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com>
4df8656
to
12f63d4
Compare
Thanks for your contribution! Before going into more code-specific reviews I have a few questions about the intent / setup:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 42.62% 44.54% +1.92%
==========================================
Files 24 26 +2
Lines 1342 1430 +88
==========================================
+ Hits 572 637 +65
- Misses 679 696 +17
- Partials 91 97 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi, @Natolumin First of all, thanks for looking into this PR.
You may create a predefined file and load it on app startup or create some empty file and populate it in runtime. We're using it to dynamically configure DHCP leases in runtime by our external control-plane service (some kind of sdn agent).
Unfortunately, we're not using DHCPv6 now + it looks like adding support of the same functionality for DHCPv6 requires some additional work to be done in https://github.com/insomniacslk/dhcp. Btw, I'm not sure that DHCPv6 supports 151 suboption - https://www.rfc-editor.org/rfc/rfc6607.html#section-3.4. So it requires some investigation.
I agree, that vss plugin looks very similar to the file plugin, but:
"Teaching" all other plugins (mask, lease etc.) to work with multiple vss may be a better idea, but it seems too complicated, so that I decided just to implement a separate plugin for such functionality. |
In any case there will be changes to make to the DHCP library to support parsing the actual option/suboption and its format: https://www.rfc-editor.org/rfc/rfc6607.html#section-3.5 . The current code just interprets it as a string which surely works for your internal purposes but wouldn't be ok for coredhcp in general. As for DHCPv6, while it doesn't separate options and suboption types and the option is encoded in the relay-forward/relay-reply message instead of the relay-agent option, otherwise it supports roughly the same features I'm not asking you to do this work unless you want to, but we will want it to be done before merging. When I have some cycles I might try my hand at it
There's been multiple requests and PRs (#147, #152) to allow more data in the file plugin, and this is essentially the same request with different options to match against and different options to return. |
Add support of Virtual Subnet Selection option for DHCPv4 according to https://www.rfc-editor.org/rfc/rfc6607.html.
It is possible that some clients will use the same addresses, but they will be isolated by different virtual networks. In such case we need to know, which network this client belongs to using relay agent info.
This plugin supports providing client with various DHCP options (LeaseTime, DNS, Mask, RouterID, Address) based on clients network identifier (VPN_ID).