SOLA
Loading...
Searching...
No Matches
sola_utils.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_UTILS_SOLA_UTILS_H_
18#define DAISI_UTILS_SOLA_UTILS_H_
19
20#include <cstdio>
21#include <ctime>
22#include <fstream>
23#include <iomanip>
24#include <iostream>
25#include <istream>
26#include <string>
27#include <tuple>
28#include <unordered_map>
29#include <vector>
30
31#include "ns3/network-module.h"
32
33namespace daisi {
34
35std::string getScenariofilePath(std::string scenariofile_name);
36int getTestFile(std::string &scenariofile_name, std::string &scenariofile_string,
37 std::string &scenariofile_path);
38std::string getIpv4AddressString(ns3::Ipv4Address address);
39
40std::string generateRandomString();
41
42// we want to have the information stored as "(yyyy-mm-dd_hh-mm-ss_m00_n00000.db)"
43std::string generateDBNameWithMinhtonInfo(const std::string &app_name, uint16_t fanout,
44 uint16_t number_of_nodes);
45
46std::string generateDBName(const std::string &app_name);
47std::string generateDBName(const std::string &app_name, const std::string &identification_string);
48
49std::vector<ns3::Ipv4Address> getAddressesForNode(const ns3::NodeContainer &container,
50 uint32_t node_container_idx);
51
54ns3::Ipv4Address getNonLocalAddress(std::vector<ns3::Ipv4Address> addresses);
55
56} // namespace daisi
57#endif