blob: 2697a7f5985c7f2a5b08ac59c8e31f48774ba7c1 [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
12namespace nfd
13{
14
15/**
16 * \brief Implementation of Face abstraction that uses
17 * multicast UDP as underlying transport mechanism
18 */
Alexander Afanasyeva39b90b2014-03-05 15:31:00 +000019class MulticastUdpFace : public DatagramFace<boost::asio::ip::udp>
Giulio Grassi624f6c62014-02-18 19:42:14 +010020{
21public:
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
43private:
44 boost::asio::ip::udp::endpoint m_multicastGroup;
45};
46
47} // namespace nfd
48
49#endif // NFD_FACE_MULTICAST_UDP_FACE_HPP