Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 1 | /* -*- 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 Afanasyev | a39b90b | 2014-03-05 15:31:00 +0000 | [diff] [blame^] | 10 | #include "datagram-face.hpp" |
Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 11 | |
| 12 | namespace nfd |
| 13 | { |
| 14 | |
| 15 | /** |
| 16 | * \brief Implementation of Face abstraction that uses |
| 17 | * multicast UDP as underlying transport mechanism |
| 18 | */ |
Alexander Afanasyev | a39b90b | 2014-03-05 15:31:00 +0000 | [diff] [blame^] | 19 | class MulticastUdpFace : public DatagramFace<boost::asio::ip::udp> |
Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 20 | { |
| 21 | public: |
| 22 | typedef boost::asio::ip::udp protocol; |
| 23 | |
| 24 | /** |
| 25 | * \brief Creates a Udp face for multicast communication |
| 26 | */ |
| 27 | explicit |
| 28 | MulticastUdpFace(const shared_ptr<protocol::socket>& socket); |
| 29 | |
| 30 | const boost::asio::ip::udp::endpoint& |
| 31 | getMulticastGroup() const; |
| 32 | |
| 33 | // from Face |
| 34 | virtual void |
| 35 | sendInterest(const Interest& interest); |
| 36 | |
| 37 | virtual void |
| 38 | sendData(const Data& data); |
| 39 | |
| 40 | virtual bool |
| 41 | isMultiAccess() const; |
| 42 | |
| 43 | private: |
| 44 | boost::asio::ip::udp::endpoint m_multicastGroup; |
| 45 | }; |
| 46 | |
| 47 | } // namespace nfd |
| 48 | |
| 49 | #endif // NFD_FACE_MULTICAST_UDP_FACE_HPP |