blob: f2245e5e3feb53c5a3c5721db09e838fa1693760 [file] [log] [blame]
Giulio Grassi624f6c62014-02-18 19:42:14 +01001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NFD_FACE_MULTICAST_UDP_FACE_HPP
8#define NFD_FACE_MULTICAST_UDP_FACE_HPP
9
Alexander Afanasyeva39b90b2014-03-05 15:31:00 +000010#include "datagram-face.hpp"
Giulio Grassi624f6c62014-02-18 19:42:14 +010011
Davide Pesaventod8d4d982014-03-21 18:47:58 +010012namespace nfd {
Giulio Grassi624f6c62014-02-18 19:42:14 +010013
14/**
Davide Pesaventod8d4d982014-03-21 18:47:58 +010015 * \brief Implementation of Face abstraction that uses
Giulio Grassi624f6c62014-02-18 19:42:14 +010016 * multicast UDP as underlying transport mechanism
17 */
Alexander Afanasyeva39b90b2014-03-05 15:31:00 +000018class MulticastUdpFace : public DatagramFace<boost::asio::ip::udp>
Giulio Grassi624f6c62014-02-18 19:42:14 +010019{
20public:
Giulio Grassi624f6c62014-02-18 19:42:14 +010021 /**
Davide Pesaventod8d4d982014-03-21 18:47:58 +010022 * \brief Creates a UDP-based face for multicast communication
Giulio Grassi624f6c62014-02-18 19:42:14 +010023 */
Junxiao Shi79494162014-04-02 18:25:11 -070024 MulticastUdpFace(const shared_ptr<protocol::socket>& socket,
25 const protocol::endpoint& localEndpoint);
Giulio Grassi624f6c62014-02-18 19:42:14 +010026
Davide Pesaventod8d4d982014-03-21 18:47:58 +010027 const protocol::endpoint&
Giulio Grassi624f6c62014-02-18 19:42:14 +010028 getMulticastGroup() const;
29
30 // from Face
31 virtual void
32 sendInterest(const Interest& interest);
33
34 virtual void
35 sendData(const Data& data);
Davide Pesaventod8d4d982014-03-21 18:47:58 +010036
Giulio Grassi624f6c62014-02-18 19:42:14 +010037 virtual bool
38 isMultiAccess() const;
Davide Pesaventod8d4d982014-03-21 18:47:58 +010039
Giulio Grassi624f6c62014-02-18 19:42:14 +010040private:
Davide Pesaventod8d4d982014-03-21 18:47:58 +010041 protocol::endpoint m_multicastGroup;
Giulio Grassi624f6c62014-02-18 19:42:14 +010042};
43
44} // namespace nfd
45
46#endif // NFD_FACE_MULTICAST_UDP_FACE_HPP