NetSim 1.0.0
An educational network simulation software for students
|
A static class that provides methods to convert header data to string. More...
#include <headerutil.h>
Static Public Member Functions | |
static QString | getMacAddress (const Package &data, bool src) |
Extracts the MAC Address from a given package. | |
static QString | getEtherType (const Package &data) |
Extracts the EtherType from a given package. | |
static QString | getIPHeaderLength (const Package &data) |
Extracts the IP header length from a given package. | |
static QString | getIPTOS (const Package &data) |
Extracts the IP Type of Service from a given package. | |
static QString | getIPTotalLength (const Package &data) |
Extracts the IP Total Length from a given package. | |
static QString | getIPIdentification (const Package &data) |
Extracts the IP Identification from a given package. | |
static QString | getIPTTL (const Package &data) |
Extracts the IP TTL from a given package. | |
static QString | getIPAddress (const Package &data, bool src) |
Extracts the IP Protocol from a given package. | |
static QString | getIPFlags (const Package &data) |
Extracts the IP Flags from a given package. | |
static QString | getIPFlag (const Package &data, const IPFlag &flagName) |
Extracts a specific IP Flag from a given package. | |
static QString | getIPNextProtocol (const Package &data) |
Extracts the IP Next Protocol from a given package. | |
static QString | getIPChecksum (const Package &data) |
Extracts the IP Checksum from a given package. | |
static QString | getIPFragmentOffset (const Package &data) |
Extracts the IP Fragment Offset from a given package. | |
static QString | getPort (const Package &data, bool src) |
Extracts the Port from a given package. | |
static QString | getTCPFlags (const Package &data) |
Extracts the TCP Flags from a given package. | |
static QString | getTCPFlag (const Package &data, const TCPFlag &flagName) |
Extracts a specific TCP Flag from a given package. | |
static QString | getTCPSequenceNumber (const Package &data) |
Extracts the TCP Sequence Number from a given package. | |
static QString | getTCPAcknowledgementNumber (const Package &data) |
Extracts the TCP Acknowledgement Number from a given package. | |
static QString | getTCPHeaderLength (const Package &data) |
Extracts the TCP Header Length from a given package. | |
static QString | getTCPWindow (const Package &data) |
Extracts the TCP Window from a given package. | |
static QString | getTCPChecksum (const Package &data) |
Extracts the TCP Checksum from a given package. | |
static QString | getTCPUrgentPointer (const Package &data) |
Extracts the TCP Urgent Pointer from a given package. | |
static QString | getUDPChecksum (const Package &data) |
Extracts the UDP Checksum from a given package. | |
static QString | getUDPLength (const Package &data) |
Extracts the UDP Length from a given package. | |
static QString | getHTTPAttribute (const Package &data, const QString &attributeName) |
Extracts a specific HTTP Attribute from a given package. | |
static bool | getHTTPIsResponse (const Package &data) |
Extracts if the package is a response or request. | |
static bool | getHTTPIsRequest (const Package &data) |
Extracts if the package is a request or response. | |
static QString | getDNSID (const Package &data) |
Extracts the DNS ID from a given package. | |
static QString | getDNSFlags (const Package &data) |
Extracts the DNS Flags from a given package. | |
static QString | getDNSFlag (const Package &data, const DNSFlag &flagName) |
Extracts a specific DNS Flag from a given package. | |
static QString | getDNSQuestions (const Package &data) |
Extracts the DNS Question Count from a given package. | |
static QString | getDNSAnswerRRs (const Package &data) |
Extracts the DNS Answer Count from a given package. | |
static QString | getDNSQuery (const Package &data, int index, const RRAttribute &attr=RRAttribute::FULL_DATA) |
Extracts the DNS Query at the given index from a given package. | |
static QString | getDNSAnswer (const Package &data, int index, const RRAttribute &attr=RRAttribute::FULL_DATA) |
Extracts the DNS Answer at the given index from a given package. | |
static IPAddress | getDNSAnswerIPAddress (const Package &data, int index) |
Extracts the IP Address of the DNS Answer at the given index from a given package. | |
static QString | getPackageLength (const Package &data) |
Extracts the Port of the DNS Answer at the given index from a given package. | |
static HeaderType | getTopProtocol (const Package &data) |
Extracts the Package Top Protocol. | |
static IPAddress | getIPAddressAsIPAddress (const Package &data, bool src) |
Extracts the IP Address of the IP Protocol from the given package. | |
static Port | getPortAsPort (const Package &data, bool src) |
Extracts the Port of the TCP Protocol from the given package. | |
A static class that provides methods to convert header data to string.
The HeaderUtil class contains static methods that can convert header data to string representations to be displayed in the UI.
|
static |
Extracts the DNS Answer at the given index from a given package.
This method extacts the DNS Answer at the given index from a given package and converts it to a string representation. It is possible to request specific data, in this case only this data will be returned. As default full data will be returned.
data | The package to extract the DNS Answer from. |
index | The index of the DNS Answer to extract. |
attr | The RRAttribute to extract. |
Extracts the IP Address of the DNS Answer at the given index from a given package.
This method extracts the IP Address of the DNS Answer at the given index from a given package and converts it to a reusable format.
data | The package to extract the IP Address from. |
index | The index of the DNS Answer to extract. |
|
static |
Extracts the DNS Answer Count from a given package.
This method extracts the DNS Answer Count from a given package and converts it to a string representation.
data | The package to extract the DNS Answer Count from. |
Extracts a specific DNS Flag from a given package.
This method extracts a specific DNS Flag from a given package and converts it to a string representation.
data | The package to extract the DNS Flag from. |
flagName | The name of the DNS Flag to extract. |
|
static |
Extracts the DNS Flags from a given package.
This method extracts the DNS Flags from a given package and converts it to a string representation.
data | The package to extract the DNS Flags from. |
|
static |
|
static |
Extracts the DNS Query at the given index from a given package.
This method extacts the DNS Query at the given index from a given package and converts it to a string representation. It is possible to request specific data, in this case only this data will be returned. As default full data will be returned.
data | The package to extract the DNS Query from. |
index | The index of the DNS Query to extract. |
attr | The RRAttribute to extract. |
|
static |
Extracts the DNS Question Count from a given package.
This method extracts the DNS Question Count from a given package and converts it to a string representation.
data | The package to extract the DNS Question Count from. |
|
static |
Extracts the EtherType from a given package.
This method extracts the EtherType from a given package and converts it to a string representation.
data | The package to extract the EtherType from. |
|
static |
Extracts a specific HTTP Attribute from a given package.
This method extracts a specific HTTP Attribute from a given package and converts it to a string representation.
data | The package to extract the HTTP Attribute from. |
attributeName | The name of the HTTP Attribute to extract. |
|
static |
Extracts if the package is a request or response.
This method extracts if the package is a request or response and returns the specific boolean.
data | The package to analyze. |
|
static |
Extracts if the package is a response or request.
This method extracts if the package is a response or request and returns the specific boolean.
data | The package to analyze. |
|
static |
Extracts the IP Protocol from a given package.
This method extracts the IP Protocol from a given package and converts it to a string representation.
data | The package to extract the IP Protocol from. |
Extracts the IP Address of the IP Protocol from the given package.
This method extracts the IP Address of the IP Protocol from the given package and converts it to a reusable format.
data | The package to extract the IP Address from. |
src | True if the source IP Address should be extracted, false if the destination IP Address should be extracted. |
|
static |
Extracts the IP Checksum from a given package.
This method extracts the IP Checksum from a given package and converts it to a string representation.
data | The package to extract the IP Checksum from. |
Extracts a specific IP Flag from a given package.
This method extracts a specific IP Flag from a given package and converts it to a string representation.
data | The package to extract the IP Flag from. |
flagName | The name of the IP Flag to extract. |
|
static |
Extracts the IP Flags from a given package.
This method extracts the IP Flags from a given package and converts it to a string representation.
data | The package to extract the IP Flags from. |
|
static |
Extracts the IP Fragment Offset from a given package.
This method extacts the IP Fragment Offset from a given package and converts it to a string representation.
data | The package to extract the IP Fragment Offset from. |
|
static |
Extracts the IP header length from a given package.
This method extracts the IP version from a given package and converts it to a string representation.
data | The package to extract the IP header length from. |
|
static |
Extracts the IP Identification from a given package.
This method extracts the IP Identification from a given package and converts it to a string representation.
data | The package to extract the IP Identification from. |
|
static |
Extracts the IP Next Protocol from a given package.
This method extracts the IP next protocol from a given package and converts it to a string representation.
data | The package to extract the IP next protocol from. |
|
static |
Extracts the IP Type of Service from a given package.
This method extracts the IP Type of Service from a given package and converts it to a string representation.
data | The package to extract the IP Type of Service from. |
|
static |
Extracts the IP Total Length from a given package.
This method extracts the IP Total Length from a given package and converts it to a string representation.
data | The package to extract the IP Total Length from. |
|
static |
Extracts the IP TTL from a given package.
This method extracts the IP TTL from a given package and converts it to a string representation.
data | The package to extract the IP TTL from. |
|
static |
Extracts the MAC Address from a given package.
This method extracts the MAC address from a given package and converts it to a string representation. The MAC address can be either the source or the destination address.
data | The package to extract the MAC address from. |
src | Whether the source or the destination MAC address should be extracted. |
|
static |
|
static |
Extracts the Port from a given package.
This method extracts the Port from a given package and converts it to a string representation. The method automatically checks if the package is send by UDP or TCP and returns the correct port. The port can either be the source or the destination port.
data | The package to extract the port from. |
src | Whether the source or the destination port should be extracted. |
Extracts the Port of the TCP Protocol from the given package.
This method extracts the Port of the TCP Protocol from the given package and converts it to a reusable format.
data | The package to extract the Port from. |
src | True if the source Port should be extracted, false if the destination Port should be extracted. |
|
static |
Extracts the TCP Acknowledgement Number from a given package.
This method extracts the TCP Acknowledgement Number from a given package and converts it to a string representation.
data | The package to extract the TCP Acknowledgement Number from. |
|
static |
Extracts the TCP Checksum from a given package.
This method extracts the TCP Checksum from a given package and converts it to a string representation.
data | The package to extract the TCP Checksum from. |
Extracts a specific TCP Flag from a given package.
This method extracts a specific TCP Flag from a given package and converts it to a string representation.
data | The package to extract the TCP Flag from. |
flagName | The name of the TCP Flag to extract. |
|
static |
Extracts the TCP Flags from a given package.
This method extracts the TCP Flags from a given package and converts it to a string representation.
data | The package to extract the TCP Flags from. |
|
static |
|
static |
Extracts the TCP Sequence Number from a given package.
This method extracts the TCP Sequence Number from a given package and converts it to a string representation.
data | The package to extract the TCP Sequence Number from. |
|
static |
Extracts the TCP Urgent Pointer from a given package.
This method extracts the TCP Urgent Pointer from a given package and converts it to a string representation.
data | The package to extract the TCP Urgent Pointer from. |
|
static |
Extracts the TCP Window from a given package.
This method extracts the TCP Window from a given package and converts it to a string representation.
data | The package to extract the TCP Window from. |
|
static |
Extracts the Package Top Protocol.
This method analyzes the given package and extracts the top level protocol.
data | The package to analyze. |
|
static |
Extracts the UDP Checksum from a given package.
This method extracts the UDP Checksum from a given package and converts it to a string representation.
data | The package to extract the UDP Checksum from. |
|
static |
Extracts the UDP Length from a given package.
This method extracts the UDP Length from a given package and converts it to a string representation.
data | The package to extract the UDP Length from. |