Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. Printing the lease start and lease end time for the DHCPv6
      leases (Kraishak Mahtha)


----------------------------------------------------------------------

Message: 1
Date: Fri, 4 Oct 2024 14:25:33 +0530
From: Kraishak Mahtha <kraishak....@gmail.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Printing the lease start and lease end time for the DHCPv6
        leases
Message-ID:
        <CADDat868EwWov_y4dpOVE48TP-h7N=y0rl0cbjnitwecnmd...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi All,

I am currently using ISC DHCPv6 on my local setup, and it works well, for
one of the use cases. I am attempting to print the DUID, lease start time,
and lease end time for each lease entry. While I am able to successfully
print the DUID, I am having trouble retrieving and printing the lease start
and end time variables.

Below is the approach I used to print the DUID:

on commit {
    log(info, concat("DUID:", binary-to-ascii(16, 8, ":", option
dhcp6.client-id)));
    log(info, concat("T1 (Preferred Lifetime): ", binary-to-ascii(10, 32,
"", substring(option dhcp6.ia-na, 4, 4)), " seconds"));
    log(info, concat("T2 (Valid Lifetime): ", binary-to-ascii(10, 32, "",
substring(option dhcp6.ia-na, 8, 4)), " seconds"));
}
```

However, when printing T1 and T2, I am only getting zeros. I've tried
different methods but haven't been able to obtain the correct values for
the lease start and end times.

If anyone with experience in working with these variables could offer
guidance, it would be greatly appreciated.

Thank you in advance!
Kraishak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20241004/d6a4aa3f/attachment-0001.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

End of dhcp-users Digest, Vol 190, Issue 1
******************************************

Reply via email to