SOLA
Loading...
Searching...
No Matches
sola_message_ns3.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_SOLANET_NS3_SOLA_MESSAGE_NS3_H_
18#define DAISI_SOLANET_NS3_SOLA_MESSAGE_NS3_H_
19
20#include <string>
21#include <tuple>
22#include <vector>
23
24#include "ns3/header.h"
25#include "ns3/ipv4-address.h"
26#include "ns3/nstime.h"
27#include "ns3/object.h"
28#include "ns3/packet.h"
29#include "ns3/ptr.h"
30
31namespace daisi::solanet_ns3 {
32
33class SolaMessageNs3 : public ns3::Header {
34public:
36
37 static ns3::TypeId GetTypeId();
38 ns3::TypeId GetInstanceTypeId() const override;
39
40 void Print(std::ostream &os) const override;
41 uint32_t GetSerializedSize() const override;
42 void Serialize(ns3::Buffer::Iterator start) const override;
43 uint32_t Deserialize(ns3::Buffer::Iterator start) override;
44
45 void setPayload(const std::string &payload);
46 std::string getPayload() const;
47
48 void setIp(const std::string &ip);
49 std::string getIp() const;
50
51 void setPort(uint16_t port);
52 uint16_t getPort() const;
53
54private:
55 std::string payload_;
56 std::string ip_;
57 uint16_t port_ = 0;
58};
59} // namespace daisi::solanet_ns3
60#endif
Definition sola_message_ns3.h:33