SOLA
Loading...
Searching...
No Matches
minhton_application.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_MINHTON_NS3_MINHTON_APPLICATION_H_
18#define DAISI_MINHTON_NS3_MINHTON_APPLICATION_H_
19
20#include <memory>
21
22#include "minhton/core/node.h"
23#include "minhton_logger_ns3.h"
24#include "ns3/application.h"
25
26namespace daisi::minhton_ns3 {
27
29class MinhtonApplication final : public ns3::Application {
30public:
31 static ns3::TypeId GetTypeId();
32 MinhtonApplication() = default;
33 ~MinhtonApplication() override = default;
34
35 void initializeNode(minhton::ConfigNode config);
36
37 void processSignal(const minhton::Signal &signal);
38
39 minhton::NodeInfo getNodeInfo() const;
40
41 void executeSearchExactTest(uint32_t dest_level, uint32_t dest_number);
42
43 void executeFindQuery(const minhton::FindQuery &query);
44
45 void localTestDataInsert(const std::vector<minhton::Entry> &entries);
46 void localTestDataUpdate(const std::vector<minhton::Entry> &entries);
47 void localTestDataRemove(const std::vector<minhton::NodeData::Key> &keys);
48
49 void setStaticBuildNeighbors(const minhton::NodeInfo &self_pos,
50 const std::vector<minhton::NodeInfo> &neighbors,
51 const minhton::NodeInfo &adj_left,
52 const minhton::NodeInfo &adj_right);
53
54 void StopApplication() override;
55
56private:
57 void StartApplication() override;
58
59 std::unique_ptr<minhton::MinhtonNode> minhton_node_;
60
61 std::shared_ptr<minhton::MinhtonLoggerNs3> logger_;
62};
63} // namespace daisi::minhton_ns3
64#endif
Wrapper to run MINHTON as a ns-3 application.
Definition minhton_application.h:29
Definition config_node.h:30
Definition find_query.h:21
Definition node_info.h:24
Definition fsm.h:26