blob: be44e0c85951bcade244ca6383929fc3c6394bf6 [file] [log] [blame]
Davide Pesavento44deacc2014-02-19 10:48:07 +01001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Junxiao Shi7003c602017-01-10 13:35:28 +00003 * Copyright (c) 2014-2017, Regents of the University of California,
Alexander Afanasyev319f2c82015-01-07 14:56:53 -08004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
Alexander Afanasyev9bcbc7c2014-04-06 19:37:37 -070010 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Junxiao Shi3ffe66d2014-11-06 15:37:59 -070024 */
Davide Pesavento44deacc2014-02-19 10:48:07 +010025
Davide Pesavento35120ea2015-11-17 21:13:18 +010026#include "ethernet-transport.hpp"
Davide Pesaventof8b41eb2014-12-26 19:14:06 +010027#include "core/global-io.hpp"
Davide Pesavento44deacc2014-02-19 10:48:07 +010028
29#include <pcap/pcap.h>
30
Davide Pesavento10783f22014-03-15 04:40:01 +010031#include <cerrno> // for errno
Davide Pesavento35120ea2015-11-17 21:13:18 +010032#include <cstring> // for memcpy(), strerror(), strncpy()
Davide Pesavento44deacc2014-02-19 10:48:07 +010033#include <arpa/inet.h> // for htons() and ntohs()
34#include <net/ethernet.h> // for struct ether_header
35#include <net/if.h> // for struct ifreq
Davide Pesavento44deacc2014-02-19 10:48:07 +010036#include <sys/ioctl.h> // for ioctl()
37#include <unistd.h> // for dup()
38
Alexander Afanasyevd9479aa2014-06-26 13:52:02 -070039#if !defined(PCAP_NETMASK_UNKNOWN)
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040040#define PCAP_NETMASK_UNKNOWN 0xffffffff
Alexander Afanasyevd9479aa2014-06-26 13:52:02 -070041#endif
42
Davide Pesavento44deacc2014-02-19 10:48:07 +010043namespace nfd {
Davide Pesavento35120ea2015-11-17 21:13:18 +010044namespace face {
Davide Pesavento44deacc2014-02-19 10:48:07 +010045
Davide Pesavento35120ea2015-11-17 21:13:18 +010046NFD_LOG_INIT("EthernetTransport");
Davide Pesavento44deacc2014-02-19 10:48:07 +010047
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040048EthernetTransport::EthernetTransport(const NetworkInterfaceInfo& localEndpoint,
49 const ethernet::Address& remoteEndpoint)
Davide Pesavento35120ea2015-11-17 21:13:18 +010050 : m_pcap(nullptr, pcap_close)
51 , m_socket(getGlobalIoService())
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040052 , m_srcAddress(localEndpoint.etherAddress)
53 , m_destAddress(remoteEndpoint)
54 , m_interfaceName(localEndpoint.name)
Davide Pesavento10783f22014-03-15 04:40:01 +010055#if defined(__linux__)
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040056 , m_interfaceIndex(localEndpoint.index)
Davide Pesavento10783f22014-03-15 04:40:01 +010057#endif
Davide Pesavento9a090a02015-01-29 18:15:26 +010058#ifdef _DEBUG
59 , m_nDropped(0)
60#endif
Davide Pesavento44deacc2014-02-19 10:48:07 +010061{
Davide Pesavento44deacc2014-02-19 10:48:07 +010062 pcapInit();
63
Davide Pesavento7726ae52014-11-23 21:01:05 +010064 int fd = pcap_get_selectable_fd(m_pcap.get());
Davide Pesavento44deacc2014-02-19 10:48:07 +010065 if (fd < 0)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -070066 BOOST_THROW_EXCEPTION(Error("pcap_get_selectable_fd failed"));
Davide Pesavento44deacc2014-02-19 10:48:07 +010067
68 // need to duplicate the fd, otherwise both pcap_close()
69 // and stream_descriptor::close() will try to close the
70 // same fd and one of them will fail
Davide Pesavento292e5e12015-03-13 02:08:33 +010071 m_socket.assign(::dup(fd));
Davide Pesavento44deacc2014-02-19 10:48:07 +010072
Davide Pesavento35120ea2015-11-17 21:13:18 +010073 // do this after assigning m_socket because getInterfaceMtu uses it
74 this->setMtu(getInterfaceMtu());
Matteo Sammarco66df9742014-11-21 18:31:26 +010075
Davide Pesavento292e5e12015-03-13 02:08:33 +010076 m_socket.async_read_some(boost::asio::null_buffers(),
Davide Pesavento35120ea2015-11-17 21:13:18 +010077 bind(&EthernetTransport::handleRead, this,
Davide Pesavento292e5e12015-03-13 02:08:33 +010078 boost::asio::placeholders::error,
79 boost::asio::placeholders::bytes_transferred));
Davide Pesavento44deacc2014-02-19 10:48:07 +010080}
81
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040082void
83EthernetTransport::doSend(Transport::Packet&& packet)
Davide Pesavento44deacc2014-02-19 10:48:07 +010084{
Davide Pesaventobe40fb12015-02-23 21:09:34 +010085 NFD_LOG_FACE_TRACE(__func__);
86
Davide Pesavento35120ea2015-11-17 21:13:18 +010087 sendPacket(packet.packet);
Davide Pesavento44deacc2014-02-19 10:48:07 +010088}
89
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -040090void
91EthernetTransport::doClose()
Davide Pesavento44deacc2014-02-19 10:48:07 +010092{
Davide Pesavento35120ea2015-11-17 21:13:18 +010093 NFD_LOG_FACE_TRACE(__func__);
Alexander Afanasyev251f3c12014-06-02 18:39:58 +030094
Davide Pesavento35120ea2015-11-17 21:13:18 +010095 if (m_socket.is_open()) {
96 // Cancel all outstanding operations and close the socket.
97 // Use the non-throwing variants and ignore errors, if any.
98 boost::system::error_code error;
99 m_socket.cancel(error);
100 m_socket.close(error);
101 }
Davide Pesavento292e5e12015-03-13 02:08:33 +0100102 m_pcap.reset();
Davide Pesavento7726ae52014-11-23 21:01:05 +0100103
Davide Pesavento35120ea2015-11-17 21:13:18 +0100104 // Ensure that the Transport stays alive at least
105 // until all pending handlers are dispatched
106 getGlobalIoService().post([this] {
107 this->setState(TransportState::CLOSED);
108 });
Davide Pesavento44deacc2014-02-19 10:48:07 +0100109}
110
111void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100112EthernetTransport::pcapInit()
Davide Pesavento44deacc2014-02-19 10:48:07 +0100113{
Davide Pesavento7726ae52014-11-23 21:01:05 +0100114 char errbuf[PCAP_ERRBUF_SIZE] = {};
115 m_pcap.reset(pcap_create(m_interfaceName.c_str(), errbuf));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100116 if (!m_pcap)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -0700117 BOOST_THROW_EXCEPTION(Error("pcap_create: " + std::string(errbuf)));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100118
Davide Pesaventof0ae4422014-05-05 16:32:12 +0200119#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
120 // Enable "immediate mode", effectively disabling any read buffering in the kernel.
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -0400121 // This corresponds to the BIOCIMMEDIATE ioctl on BSD-like systems (including macOS)
Davide Pesaventof0ae4422014-05-05 16:32:12 +0200122 // where libpcap uses a BPF device. On Linux this forces libpcap not to use TPACKET_V3,
123 // even if the kernel supports it, thus preventing bug #1511.
Davide Pesavento7726ae52014-11-23 21:01:05 +0100124 pcap_set_immediate_mode(m_pcap.get(), 1);
Davide Pesaventof0ae4422014-05-05 16:32:12 +0200125#endif
126
Davide Pesavento7726ae52014-11-23 21:01:05 +0100127 if (pcap_activate(m_pcap.get()) < 0)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -0700128 BOOST_THROW_EXCEPTION(Error("pcap_activate failed"));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100129
Davide Pesavento7726ae52014-11-23 21:01:05 +0100130 if (pcap_set_datalink(m_pcap.get(), DLT_EN10MB) < 0)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -0700131 BOOST_THROW_EXCEPTION(Error("pcap_set_datalink: " + std::string(pcap_geterr(m_pcap.get()))));
Davide Pesavento9eaeac72014-03-15 05:03:42 +0100132
Davide Pesavento7726ae52014-11-23 21:01:05 +0100133 if (pcap_setdirection(m_pcap.get(), PCAP_D_IN) < 0)
Davide Pesavento9eaeac72014-03-15 05:03:42 +0100134 // no need to throw on failure, BPF will filter unwanted packets anyway
Davide Pesaventobe40fb12015-02-23 21:09:34 +0100135 NFD_LOG_FACE_WARN("pcap_setdirection failed: " << pcap_geterr(m_pcap.get()));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100136}
137
138void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100139EthernetTransport::setPacketFilter(const char* filterString)
Davide Pesavento44deacc2014-02-19 10:48:07 +0100140{
141 bpf_program filter;
Davide Pesavento7726ae52014-11-23 21:01:05 +0100142 if (pcap_compile(m_pcap.get(), &filter, filterString, 1, PCAP_NETMASK_UNKNOWN) < 0)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -0700143 BOOST_THROW_EXCEPTION(Error("pcap_compile: " + std::string(pcap_geterr(m_pcap.get()))));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100144
Davide Pesavento7726ae52014-11-23 21:01:05 +0100145 int ret = pcap_setfilter(m_pcap.get(), &filter);
Davide Pesavento44deacc2014-02-19 10:48:07 +0100146 pcap_freecode(&filter);
147 if (ret < 0)
Spyridon Mastorakis149e02c2015-07-27 13:22:22 -0700148 BOOST_THROW_EXCEPTION(Error("pcap_setfilter: " + std::string(pcap_geterr(m_pcap.get()))));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100149}
150
Davide Pesavento10783f22014-03-15 04:40:01 +0100151void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100152EthernetTransport::sendPacket(const ndn::Block& block)
Davide Pesavento44deacc2014-02-19 10:48:07 +0100153{
Davide Pesavento44deacc2014-02-19 10:48:07 +0100154 /// \todo Right now there is no reserve when packet is received, but
155 /// we should reserve some space at the beginning and at the end
156 ndn::EncodingBuffer buffer(block);
157
Davide Pesaventoe4631002014-03-21 20:55:36 +0100158 // pad with zeroes if the payload is too short
Davide Pesavento35120ea2015-11-17 21:13:18 +0100159 if (block.size() < ethernet::MIN_DATA_LEN) {
160 static const uint8_t padding[ethernet::MIN_DATA_LEN] = {};
161 buffer.appendByteArray(padding, ethernet::MIN_DATA_LEN - block.size());
162 }
Davide Pesavento44deacc2014-02-19 10:48:07 +0100163
164 // construct and prepend the ethernet header
Junxiao Shi3ffe66d2014-11-06 15:37:59 -0700165 static uint16_t ethertype = htons(ethernet::ETHERTYPE_NDN);
Davide Pesavento44deacc2014-02-19 10:48:07 +0100166 buffer.prependByteArray(reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN);
Davide Pesaventob60cc122014-03-19 19:26:02 +0100167 buffer.prependByteArray(m_srcAddress.data(), m_srcAddress.size());
Davide Pesavento44deacc2014-02-19 10:48:07 +0100168 buffer.prependByteArray(m_destAddress.data(), m_destAddress.size());
169
170 // send the packet
Davide Pesavento7726ae52014-11-23 21:01:05 +0100171 int sent = pcap_inject(m_pcap.get(), buffer.buf(), buffer.size());
Davide Pesavento44deacc2014-02-19 10:48:07 +0100172 if (sent < 0)
Davide Pesavento35120ea2015-11-17 21:13:18 +0100173 NFD_LOG_FACE_ERROR("pcap_inject failed: " << pcap_geterr(m_pcap.get()));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100174 else if (static_cast<size_t>(sent) < buffer.size())
Davide Pesavento35120ea2015-11-17 21:13:18 +0100175 NFD_LOG_FACE_ERROR("Failed to send the full frame: bufsize=" << buffer.size() << " sent=" << sent);
176 else
177 // print block size because we don't want to count the padding in buffer
178 NFD_LOG_FACE_TRACE("Successfully sent: " << block.size() << " bytes");
Davide Pesavento44deacc2014-02-19 10:48:07 +0100179}
180
181void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100182EthernetTransport::handleRead(const boost::system::error_code& error, size_t)
Davide Pesavento44deacc2014-02-19 10:48:07 +0100183{
184 if (error)
185 return processErrorCode(error);
186
Davide Pesavento7726ae52014-11-23 21:01:05 +0100187 pcap_pkthdr* header;
Davide Pesavento44deacc2014-02-19 10:48:07 +0100188 const uint8_t* packet;
Davide Pesavento35120ea2015-11-17 21:13:18 +0100189
190 // read the pcap header and packet data
Davide Pesavento7726ae52014-11-23 21:01:05 +0100191 int ret = pcap_next_ex(m_pcap.get(), &header, &packet);
Davide Pesavento44deacc2014-02-19 10:48:07 +0100192 if (ret < 0)
Davide Pesavento35120ea2015-11-17 21:13:18 +0100193 NFD_LOG_FACE_ERROR("pcap_next_ex failed: " << pcap_geterr(m_pcap.get()));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100194 else if (ret == 0)
Davide Pesavento35120ea2015-11-17 21:13:18 +0100195 NFD_LOG_FACE_WARN("Read timeout");
Davide Pesavento44deacc2014-02-19 10:48:07 +0100196 else
Davide Pesavento35120ea2015-11-17 21:13:18 +0100197 processIncomingPacket(header, packet);
Davide Pesavento44deacc2014-02-19 10:48:07 +0100198
Davide Pesavento9a090a02015-01-29 18:15:26 +0100199#ifdef _DEBUG
200 pcap_stat ps{};
201 ret = pcap_stats(m_pcap.get(), &ps);
Davide Pesavento35120ea2015-11-17 21:13:18 +0100202 if (ret < 0) {
203 NFD_LOG_FACE_DEBUG("pcap_stats failed: " << pcap_geterr(m_pcap.get()));
204 }
205 else if (ret == 0) {
206 if (ps.ps_drop - m_nDropped > 0)
207 NFD_LOG_FACE_DEBUG("Detected " << ps.ps_drop - m_nDropped << " dropped packet(s)");
208 m_nDropped = ps.ps_drop;
209 }
Davide Pesavento9a090a02015-01-29 18:15:26 +0100210#endif
211
Davide Pesavento292e5e12015-03-13 02:08:33 +0100212 m_socket.async_read_some(boost::asio::null_buffers(),
Davide Pesavento35120ea2015-11-17 21:13:18 +0100213 bind(&EthernetTransport::handleRead, this,
Davide Pesavento292e5e12015-03-13 02:08:33 +0100214 boost::asio::placeholders::error,
215 boost::asio::placeholders::bytes_transferred));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100216}
217
218void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100219EthernetTransport::processIncomingPacket(const pcap_pkthdr* header, const uint8_t* packet)
Davide Pesavento44deacc2014-02-19 10:48:07 +0100220{
Davide Pesavento7726ae52014-11-23 21:01:05 +0100221 size_t length = header->caplen;
Junxiao Shi083f7782015-02-21 12:06:26 -0700222 if (length < ethernet::HDR_LEN + ethernet::MIN_DATA_LEN) {
223 NFD_LOG_FACE_WARN("Received frame is too short (" << length << " bytes)");
224 return;
225 }
Davide Pesavento44deacc2014-02-19 10:48:07 +0100226
Davide Pesavento7726ae52014-11-23 21:01:05 +0100227 const ether_header* eh = reinterpret_cast<const ether_header*>(packet);
Matteo Sammarco66df9742014-11-21 18:31:26 +0100228 const ethernet::Address sourceAddress(eh->ether_shost);
Davide Pesavento7726ae52014-11-23 21:01:05 +0100229
Davide Pesaventoca25d722015-12-21 21:04:07 +0100230 // in some cases VLAN-tagged frames may survive the BPF filter,
231 // make sure we do not process those frames (see #3348)
232 if (ntohs(eh->ether_type) != ethernet::ETHERTYPE_NDN)
233 return;
234
235 // check that our BPF filter is working correctly
Davide Pesavento7726ae52014-11-23 21:01:05 +0100236 BOOST_ASSERT_MSG(ethernet::Address(eh->ether_dhost) == m_destAddress,
Davide Pesavento6bd6d0b2017-03-25 15:16:40 -0400237 "Received frame addressed to another host or multicast group");
Matteo Sammarco66df9742014-11-21 18:31:26 +0100238 BOOST_ASSERT_MSG(sourceAddress != m_srcAddress,
Davide Pesavento7726ae52014-11-23 21:01:05 +0100239 "Received frame sent by this host");
Davide Pesavento7726ae52014-11-23 21:01:05 +0100240
241 packet += ethernet::HDR_LEN;
242 length -= ethernet::HDR_LEN;
243
Junxiao Shi78926c92015-02-28 22:56:06 -0700244 bool isOk = false;
Davide Pesavento35120ea2015-11-17 21:13:18 +0100245 Block element;
246 std::tie(isOk, element) = Block::fromBuffer(packet, length);
Junxiao Shi083f7782015-02-21 12:06:26 -0700247 if (!isOk) {
Davide Pesavento35120ea2015-11-17 21:13:18 +0100248 NFD_LOG_FACE_WARN("Received invalid packet from " << sourceAddress.toString());
Junxiao Shi083f7782015-02-21 12:06:26 -0700249 return;
250 }
Matteo Sammarco66df9742014-11-21 18:31:26 +0100251
Davide Pesavento35120ea2015-11-17 21:13:18 +0100252 NFD_LOG_FACE_TRACE("Received: " << element.size() << " bytes from " << sourceAddress.toString());
Matteo Sammarco66df9742014-11-21 18:31:26 +0100253
Davide Pesavento35120ea2015-11-17 21:13:18 +0100254 Transport::Packet tp(std::move(element));
255 static_assert(sizeof(tp.remoteEndpoint) >= ethernet::ADDR_LEN,
256 "Transport::Packet::remoteEndpoint is too small");
257 std::memcpy(&tp.remoteEndpoint, sourceAddress.data(), sourceAddress.size());
258 this->receive(std::move(tp));
Davide Pesavento7726ae52014-11-23 21:01:05 +0100259}
260
261void
Davide Pesavento35120ea2015-11-17 21:13:18 +0100262EthernetTransport::processErrorCode(const boost::system::error_code& error)
Davide Pesavento7726ae52014-11-23 21:01:05 +0100263{
Junxiao Shi7003c602017-01-10 13:35:28 +0000264 // boost::asio::error::operation_aborted must be checked first. In that situation, the Transport
265 // may already have been destructed, and it's unsafe to call getState() or do logging.
266 if (error == boost::asio::error::operation_aborted ||
267 getState() == TransportState::CLOSING ||
Davide Pesavento35120ea2015-11-17 21:13:18 +0100268 getState() == TransportState::FAILED ||
Junxiao Shi7003c602017-01-10 13:35:28 +0000269 getState() == TransportState::CLOSED) {
Davide Pesavento35120ea2015-11-17 21:13:18 +0100270 // transport is shutting down, ignore any errors
Davide Pesavento7726ae52014-11-23 21:01:05 +0100271 return;
Junxiao Shi7003c602017-01-10 13:35:28 +0000272 }
Davide Pesavento7726ae52014-11-23 21:01:05 +0100273
Davide Pesavento35120ea2015-11-17 21:13:18 +0100274 NFD_LOG_FACE_WARN("Receive operation failed: " << error.message());
Davide Pesavento44deacc2014-02-19 10:48:07 +0100275}
276
Davide Pesavento44deacc2014-02-19 10:48:07 +0100277size_t
Davide Pesavento35120ea2015-11-17 21:13:18 +0100278EthernetTransport::getInterfaceMtu()
Davide Pesavento44deacc2014-02-19 10:48:07 +0100279{
Davide Pesavento44deacc2014-02-19 10:48:07 +0100280#ifdef SIOCGIFMTU
Davide Pesaventof8b41eb2014-12-26 19:14:06 +0100281#if defined(__APPLE__) || defined(__FreeBSD__)
282 // see bug #2328
283 using boost::asio::ip::udp;
Davide Pesavento35120ea2015-11-17 21:13:18 +0100284 udp::socket sock(getGlobalIoService(), udp::v4());
Davide Pesaventof8b41eb2014-12-26 19:14:06 +0100285 int fd = sock.native_handle();
286#else
Davide Pesavento292e5e12015-03-13 02:08:33 +0100287 int fd = m_socket.native_handle();
Davide Pesaventof8b41eb2014-12-26 19:14:06 +0100288#endif
289
Davide Pesavento10783f22014-03-15 04:40:01 +0100290 ifreq ifr{};
Davide Pesaventob60cc122014-03-19 19:26:02 +0100291 std::strncpy(ifr.ifr_name, m_interfaceName.c_str(), sizeof(ifr.ifr_name) - 1);
Davide Pesavento44deacc2014-02-19 10:48:07 +0100292
Davide Pesavento35120ea2015-11-17 21:13:18 +0100293 if (::ioctl(fd, SIOCGIFMTU, &ifr) == 0) {
294 NFD_LOG_FACE_DEBUG("Interface MTU is " << ifr.ifr_mtu);
Davide Pesavento8eb99572014-12-19 19:12:15 +0100295 return static_cast<size_t>(ifr.ifr_mtu);
Davide Pesavento35120ea2015-11-17 21:13:18 +0100296 }
Davide Pesavento8eb99572014-12-19 19:12:15 +0100297
Davide Pesaventobe40fb12015-02-23 21:09:34 +0100298 NFD_LOG_FACE_WARN("Failed to get interface MTU: " << std::strerror(errno));
Davide Pesavento44deacc2014-02-19 10:48:07 +0100299#endif
300
Davide Pesavento35120ea2015-11-17 21:13:18 +0100301 NFD_LOG_FACE_DEBUG("Assuming default MTU of " << ethernet::MAX_DATA_LEN);
Davide Pesavento8eb99572014-12-19 19:12:15 +0100302 return ethernet::MAX_DATA_LEN;
Davide Pesavento44deacc2014-02-19 10:48:07 +0100303}
304
Davide Pesavento35120ea2015-11-17 21:13:18 +0100305} // namespace face
Davide Pesavento44deacc2014-02-19 10:48:07 +0100306} // namespace nfd