Feature #4011
closedUnicast Ethernet Transport and Channel
Added by Eric Newberry over 7 years ago. Updated over 7 years ago.
100%
Updated by Alex Afanasyev over 7 years ago
- Assignee set to Davide Pesavento
- Target version set to v0.6
- % Done changed from 0 to 70
Updated by Davide Pesavento over 7 years ago
- Start date changed from 03/26/2017 to 03/25/2017
Updated by Davide Pesavento over 7 years ago
- Related to Feature #4012: Ethernet unicast configuration added
Updated by Junxiao Shi over 7 years ago
Looking at https://gerrit.named-data.net/3790 patchset3 and https://gerrit.named-data.net/3793 patchset4, similar pcap_*
function calls are duplicated between EthernetTransport
and EthernetChannel
. Is there any way to abstract them into an implementation class?
Updated by Davide Pesavento over 7 years ago
Junxiao Shi wrote:
Looking at https://gerrit.named-data.net/3790 patchset3 and https://gerrit.named-data.net/3793 patchset4, similar
pcap_*
function calls are duplicated betweenEthernetTransport
andEthernetChannel
. Is there any way to abstract them into an implementation class?
https://gerrit.named-data.net/3876 introduces PcapHelper
.
There isn't an obvious choice for the level of abstraction. I've decided to keep the PcapHelper
class independent of the data-link type (DLT_*
). Therefore, the class doesn't know anything about frame structures, ethernet, or any other link-layer protocols. It just wraps a pcap_t
handle in a RAII class with a slightly higher-level (more C++-like) interface. Ethernet-specific routines that are reusable can be moved to face/ethernet-protocol.{cpp,hpp}
.
Another question is: how can consumers access the raw pcap_t
pointer?
- implicit conversion via
operator pcap_t*()
- overload
operator*()
- member function
getHandle()
- don't provide external access to the raw
pcap_t*
(this implies thatPcapHelper
must wrap all libpcap functions that we use)
Updated by Davide Pesavento over 7 years ago
- % Done changed from 60 to 90
https://gerrit.named-data.net/3793 (untested)
Updated by Davide Pesavento over 7 years ago
- Related to deleted (Feature #4012: Ethernet unicast configuration)
Updated by Davide Pesavento over 7 years ago
- Blocks Feature #4012: Ethernet unicast configuration added
Updated by Davide Pesavento over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100