blob: 1c33242bf0c761f9be8d6266878a011d33d019b1 [file] [log] [blame]
Jiewen Tana0497d82015-02-02 21:59:18 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Nick Gordonc6a85222017-01-03 16:54:34 -06003 * Copyright (c) 2014-2017, The University of Memphis,
Jiewen Tana0497d82015-02-02 21:59:18 -08004 * Regents of the University of California,
5 * Arizona Board of Regents.
6 *
7 * This file is part of NLSR (Named-data Link State Routing).
8 * See AUTHORS.md for complete list of NLSR authors and contributors.
9 *
10 * NLSR is free software: you can redistribute it and/or modify it under the terms
11 * of the GNU General Public License as published by the Free Software Foundation,
12 * either version 3 of the License, or (at your option) any later version.
13 *
14 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22#ifndef NLSR_PUBLISHER_LSA_PUBLISHER_HPP
23#define NLSR_PUBLISHER_LSA_PUBLISHER_HPP
24
25#include "lsdb.hpp"
26#include "segment-publisher.hpp"
27#include "tlv/adjacency-lsa.hpp"
28#include "tlv/coordinate-lsa.hpp"
29#include "tlv/name-lsa.hpp"
30
31#include <ndn-cxx/face.hpp>
32
33namespace nlsr {
34
Nick G97e34942016-07-11 14:46:27 -050035 /*! \brief Class to publish adjacency lsa dataset
36
37 \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
38
39 */
laqinfand22da512017-05-25 17:29:53 -050040class AdjacencyLsaPublisher
Jiewen Tana0497d82015-02-02 21:59:18 -080041{
42public:
43 AdjacencyLsaPublisher(Lsdb& lsdb,
44 ndn::Face& face,
Jiewen Tana0497d82015-02-02 21:59:18 -080045 ndn::KeyChain& keyChain);
46
Nick G97e34942016-07-11 14:46:27 -050047 /*! \brief Returns the adj. LSAs represented by this object. */
Jiewen Tana0497d82015-02-02 21:59:18 -080048 std::list<tlv::AdjacencyLsa>
49 getTlvLsas();
50
51public:
52 static const ndn::Name::Component DATASET_COMPONENT;
53
54private:
55 const std::list<AdjLsa>& m_adjacencyLsas;
56};
57
Nick G97e34942016-07-11 14:46:27 -050058 /*! \brief Class to publish coordinate lsa dataset
59 \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
60 */
laqinfand22da512017-05-25 17:29:53 -050061class CoordinateLsaPublisher
Jiewen Tana0497d82015-02-02 21:59:18 -080062{
63public:
64 CoordinateLsaPublisher(Lsdb& lsdb,
65 ndn::Face& face,
Jiewen Tana0497d82015-02-02 21:59:18 -080066 ndn::KeyChain& keyChain);
67
Nick G97e34942016-07-11 14:46:27 -050068 /*! \brief Returns the cor. LSAs represented by this object. */
Jiewen Tana0497d82015-02-02 21:59:18 -080069 std::list<tlv::CoordinateLsa>
70 getTlvLsas();
71
72public:
73 static const ndn::Name::Component DATASET_COMPONENT;
74
75private:
76 const std::list<CoordinateLsa>& m_coordinateLsas;
77};
78
Nick G97e34942016-07-11 14:46:27 -050079 /*! \brief Class to publish name lsa dataset
80 \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
81 */
laqinfand22da512017-05-25 17:29:53 -050082class NameLsaPublisher
Jiewen Tana0497d82015-02-02 21:59:18 -080083{
84public:
85 NameLsaPublisher(Lsdb& lsdb,
86 ndn::Face& face,
Jiewen Tana0497d82015-02-02 21:59:18 -080087 ndn::KeyChain& keyChain);
Nick G97e34942016-07-11 14:46:27 -050088 /*! \brief Returns the name LSAs represented by this object. */
Jiewen Tana0497d82015-02-02 21:59:18 -080089 std::list<tlv::NameLsa>
90 getTlvLsas();
91
92public:
93 static const ndn::Name::Component DATASET_COMPONENT;
94
95private:
96 const std::list<NameLsa>& m_nameLsas;
97};
98
99} // namespace nlsr
100
101#endif // NLSR_PUBLISHER_LSA_PUBLISHER_HPP