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. Re: Accessing DHCP options within hooks libs (Duane Zimmer)
----------------------------------------------------------------------
Message: 1
Date: Wed, 22 Jun 2016 17:58:44 +0000
From: Duane Zimmer <[email protected]>
To: 'Francis Dupont' <[email protected]>
Cc: "'[email protected]'" <[email protected]>
Subject: Re: [kea-dev] Accessing DHCP options within hooks libs
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="us-ascii"
Okay that all worked. But now I'm stuck, what if I want to map a subnet from a
helper-address to a different IP pool? how do I do that?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Francis Dupont
Sent: Tuesday, June 21, 2016 1:49 PM
To: Francis Dupont <[email protected]>
Cc: Kea Dev List <[email protected]>
Subject: Re: [kea-dev] Accessing DHCP options within hooks libs
Francis Dupont writes:
> We are using smart pointers, not raw pointers, so perhaps it is
> possible to implement a kind of copy on write?
>
> PS: usually COW in C++ is done playing on const/not const.
=> revisiting the #4497 ticket and its associated discussio I add a point:
there is a trivial way to deep copy a packet (or an option):
just pack it and unpack the result, i.e., the opposite of the repack method of
pkt.h:
/// @brief Copies content of input buffer to output buffer.
///
/// This is mostly a diagnostic function. It is being used for sending
/// received packet. Received packet is stored in data_, but
/// transmitted data is stored in buffer_out_. If we want to send packet
/// that we just received, a copy between those two buffers is necessary.
void repack();
BTW even it is a reunpack() IMHO something like deepcopy() is a better (and
less misleading) name.
Regards
Francis Dupont <[email protected]>
PS: sample code (with X = 4 or 6) for a packet:
void deepCopy(PktXPtr& pkt) {
pkt->pack();
OutputBuffer& buf(pkt->getBuffer());
pkt.reset(new PktX(&buf[0], buf.size(),
pkt->getLocalAddr(),
pkt->getRemoteAddr(),
pkt->getLocalPort(),
pkt->getRemotePort())); }
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
------------------------------
Subject: Digest Footer
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
------------------------------
End of kea-dev Digest, Vol 27, Issue 7
**************************************