NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1#ifndef HEADER_H
2#define HEADER_H
3
7
8#include "headerAttribute.h"
9#include <QDebug>
10#include <QList>
11
12namespace NetSim {
13
17
24
30class Header {
31public:
35 Header() = default;
36
43 Header(const HeaderType &headerType,
44 const QList<HeaderAttribute> &headerList);
45
51 void addHeaderAttribute(const HeaderAttribute &headerAttribute);
52
58 void setHeaderType(const HeaderType &headerType);
59
65 QList<HeaderAttribute> headerList() const;
66
72 HeaderType type() const;
73
79 quint16 size() const;
80
89 HeaderAttribute &operator[](const QString &name);
90
91private:
92 HeaderType m_headerType{HeaderType::UNKNOWN};
93 QList<HeaderAttribute> m_headerList{};
94};
95
96} // namespace NetSim
97
98#endif // HEADER_H
Provides utility methods to initialize DNS request and response data in packages.
Definition dns.h:39
A static class that provides methods to handle HTTP requests and responses.
Definition http.h:26
Class representing an attribute of a header.
Definition headerAttribute.h:21
Class representing headers for different protocols.
Definition header.h:30
HeaderAttribute & operator[](const QString &name)
Overloaded subscript operator to get a header attribute by its name.
Definition header.cpp:30
void setHeaderType(const HeaderType &headerType)
Sets the header type.
Definition header.cpp:14
void addHeaderAttribute(const HeaderAttribute &headerAttribute)
Adds a header attribute to the header.
Definition header.cpp:10
HeaderType type() const
Retrieves the header type.
Definition header.cpp:20
QList< HeaderAttribute > headerList() const
Retrieves the list of header attributes.
Definition header.cpp:18
Header()=default
Default constructor.
quint16 size() const
Calculates the size of the header.
Definition header.cpp:22
A static class that provides methods to handle MAC headers and their Frame Check Sequence (FCS).
Definition mac.h:27
A static class providing methods for initializing TCP headers and managing TCP flags.
Definition tcp.h:43
A static class providing methods for initializing UDP headers.
Definition udp.h:25
Contains the HeaderAttribute class definition.
Definition logger.h:12
HeaderType
Definition header.h:23
@ IP
Definition header.h:23
@ UNKNOWN
Definition header.h:23