Send kea-dev mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/kea-dev
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

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


Today's Topics:

   1.  Is it possible to define custom arguments in hooks and have
      those saved with the lease? (Dave Cole)
   2. Re:  Is it possible to define custom arguments in hooks and
      have those saved with the lease? (Tomek Mrugalski)


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

Message: 1
Date: Wed, 11 Oct 2017 02:11:50 +0000
From: Dave Cole <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [kea-dev] Is it possible to define custom arguments in hooks
        and have those saved with the lease?
Message-ID:
        
<syxpr01mb17274ad27c2ed8e80b220fa4f2...@syxpr01mb1727.ausprd01.prod.outlook.com>
        
Content-Type: text/plain; charset="iso-8859-1"

With the hook we are developing here we extract values from Option 82 and 
publish them to Kafka.  This works quite well, but it occurred to me that it 
would be very useful if we could have the Option82 value saved in PostgreSQL 
along with the lease.


>From my initial reading of the code it seems that it is not possible.  To me, 
>the necessary changes to support the function (for us) would be in 
>AllocEngine::createLease4 so that the CalloutHandlePtr was passed into 
>LeaseMgrFactory::addLease.  From there it would be necessary to have the 
>ability to dynamically extend (via confirguration) the createBindForSend so 
>that extra columns could be bound to arguments populated via setArgument in 
>previous hooks.


Am I completely wrong in my assessment?


Is there a way to do what I want already?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/kea-dev/attachments/20171011/d8cc0f29/attachment-0001.html>

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

Message: 2
Date: Wed, 11 Oct 2017 10:36:25 +0200
From: Tomek Mrugalski <[email protected]>
To: [email protected]
Subject: Re: [kea-dev] Is it possible to define custom arguments in
        hooks and have those saved with the lease?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

W dniu 11.10.2017 o?04:11, Dave Cole pisze:
> With the hook we are developing here we extract values from Option 82
> and publish them to Kafka.? This works quite well, but it occurred to me
> that it would be very useful if we could have the Option82 value saved
> in PostgreSQL along with the lease.
> 
> From my initial reading of the code it seems that it is not possible.?
> To me, the necessary changes to support the function (for us) would be
> in AllocEngine::createLease4 so that the CalloutHandlePtr was passed
> into LeaseMgrFactory::addLease.? From there it would be necessary to
> have the ability to dynamically extend (via confirguration)
> the?createBindForSend so that extra columns could be bound to arguments
> populated via setArgument in previous hooks.

> Am I completely wrong in my assessment?
>
You are right, it is not possible right now. Of course this is a
software, so with enough effort put in, anything is possible.

> Is there a way to do what I want already?
No.

If you are considering writing a hook that saves extra information, I
think a pkt4_send would be the place to start. At that time the lease is
already inserted, so you could update the table by calling SQL update
command. Yes, it's would have performance impact and this would double
the number of queries needed for lease insertion, but on the other hand
update shouldn't be as costly as insert.

ISC will one day implement a capability to store extra information. You
want some option 82 values, but there are people who want other things
to be stored. So I think we'd go with an expression. User would specify
what exactly he wants, and that expression would be evaluated for each
incoming packet and would be stored for new leases (or when lease is
updated).

Tomek


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

Subject: Digest Footer

_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev

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

End of kea-dev Digest, Vol 43, Issue 6
**************************************

Reply via email to