SOLA
Loading...
Searching...
No Matches
packet.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_CPPS_PACKET_H_
18#define DAISI_CPPS_PACKET_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::cpps {
32
34 std::string payload;
35 uint8_t type;
36};
37
38class CppsTCPMessage : public ns3::Header {
39public:
41
42 static ns3::TypeId GetTypeId();
43 ns3::TypeId GetInstanceTypeId() const override;
44
45 void Print(std::ostream &os) const override;
46 uint32_t GetSerializedSize() const override;
47 void Serialize(ns3::Buffer::Iterator start) const override;
48 uint32_t Deserialize(ns3::Buffer::Iterator start) override;
49
50 void addMessage(const FieldMessageCpps &msg);
51 std::vector<FieldMessageCpps> getMessages() const;
52
53private:
54 std::vector<FieldMessageCpps> messages_;
55};
56} // namespace daisi::cpps
57#endif
Definition packet.h:38
Definition packet.h:33