[Kea-users] what does ach dhcpv4 hook point/parameter mean ?

luckydog xf luckydogxf at gmail.com
Fri Aug 9 01:10:04 UTC 2024


Thanks guys.
Here is my hook point and event.
---
# hook points and events
case "$1" in

        lease4_renew|lease4_recover|lease4_decline)

        # Do nothing
                echo $1
                exit 0
        ;;

        leases4_committed)

                echo $1
                delete_record
                add_record
        ;;

        lease4_expire |lease4_release)
                echo $1

                delete_record
        ;;

        *)
                echo "Unhandled function call ${*}"
                exit 123
        ;;
esac

On Thu, Aug 8, 2024 at 6:04 PM Darren Ankney <darren.ankney at gmail.com>
wrote:

> Hi,
>
> I am not a developer, but I do know (loosely) what events these refer to:
>
> * lease4_recover (Kea has removed the lease from the lease database
> (post expire or release) things like lease affinity affect when this
> happens)
> * lease4_release (client sent a DHCPRELEASE packet)
> * lease4_decline (client sent a DHCPDECLINE packet)
>
> Thank you,
> Darren Ankney
>
> On Thu, Aug 8, 2024 at 3:55 AM luckydog xf <luckydogxf at gmail.com> wrote:
> >
> > Actually I have tested  lease4_expire,  leases4_committed and
> lease4_renew already. They're easy to verify.
> > But the rest ones, I don't understand which scenarios can call them.
> > Thanks.
> >
> > On Thu, Aug 8, 2024 at 3:52 PM luckydog xf <luckydogxf at gmail.com> wrote:
> >>
> >> Thanks for your reply.
> >> Actually, I have read that docs already. However, I'm still puzzled.
> I'm going to add and remove DNS records against Samba with kea-dhcp hook
> points, which is the same as DDNS.
> >>
> >> Here is the skeleton of my  bash script. Not sure if the action for
> each hook point is right or not.
> >> While add_record and delete_record are public functions.
> >> ---
> >> # hook points
> >> case "$1" in
> >>
> >>         lease4_renew|lease4_recover )
> >>
> >>         # Do nothing
> >>                 echo $1
> >>                 exit 0
> >>         ;;
> >>
> >>         leases4_committed)
> >>
> >>                 echo $1
> >>                 delete_record
> >>                 add_record
> >>         ;;
> >>
> >>         lease4_expire |lease4_release) #|lease4_decline)
> >>                 echo $1
> >>
> >>                 delete_record
> >>         ;;
> >>
> >>         *)
> >>                 echo "Unhandled function call ${*}"
> >>                 exit 123
> >>         ;;
> >> esac
> >>
> >>
> >> On Thu, Aug 8, 2024 at 3:38 PM Francis Dupont <fdupont at isc.org> wrote:
> >>>
> >>> luckydog xf writes:
> >>> >  I'm running External Hook Scripts now. From
> >>> > https://kea.readthedocs.io/en/kea-2.6.0/arm/hooks.html there are the
> >>> > following hook points.
> >>>
> >>> => the right documentation for writing hooks is not the ARM but
> >>> the developer guide and its Hook Developer's Guide section
> >>>
> https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html
> >>>
> >>> If you can't find all answers to your questions please come back to
> >>> this mailing list.
> >>>
> >>> BTW names as LEASES4_AT0_HOSTNAME are about a particular hook library
> >>> running shell scripts described in its own section of the ARM
> >>> (Run Script Support for External Hook Scripts) which in fact just
> >>> exposes parameters which can be read from some callout points.
> >>>
> >>> Regards
> >>>
> >>> Francis Dupont <fdupont at isc.org>
> >
> > --
> > ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
> >
> > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> >
> > Kea-users mailing list
> > Kea-users at lists.isc.org
> > https://lists.isc.org/mailman/listinfo/kea-users
> --
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240809/38f15d59/attachment.htm>


More information about the Kea-users mailing list