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

Format host_identifier, iaid and duid as colon-separated hex strings #30

Open
jjakob opened this issue Jul 18, 2019 · 2 comments
Open

Comments

@jjakob
Copy link

jjakob commented Jul 18, 2019

This would then equal the format that dhcpd.conf takes as identifier, so the values could be used to directly transfer to host blocks.

We are using this library in vyos to display the leases in a user friendly format, which requires additional parsing inside our script to add the colons. show_dhcpv6.py#L49

@MartijnBraam
Copy link
Owner

I'll check if I can add that functionality without breaking the existing api

@jaredmauch
Copy link

If you set

lease-id-format hex;

in dhcpd6.conf you will get the proper results, but it does seem that the parsing does not work in this library due to the regex match:

    regex_leaseblock6 = re.compile(
        r"ia-(?P<type>ta|na|pd) \"(?P<id>[^\"\\]*(?:\\.[^\"\\]*)*)\" {(?P<config>[\s\S]+?)\n}")

with a lease such as this:

ia-na 03:00:00:00:00:03:00:01:18:fd:74:8f:3e:46 {
  cltt 5 2024/05/31 01:28:56;
  iaaddr 2001:db8:3::ffbb {
    binding state active;
    preferred-life 604800;
    max-life 2592000;
    ends 0 2024/06/30 01:28:56;
    set cid = "b4fbe41b4a18/3/70a741336758/1:100";
    on release {
      log (error, 
          concat ("RELEASE6 from", cid));
    }
  }
}

while the previous octal output and match works. I'm hoping that @MartijnBraam could make that match work as well :-)

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

No branches or pull requests

3 participants