NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
NetSim::Port Class Reference

Represents a network port. More...

#include <port.h>

Public Member Functions

 Port ()=default
 Default constructor.
 
 Port (quint16 portNumber)
 Constructs a port with a specified port number.
 
quint16 portNumber () const
 Returns the port number.
 
QVector< quint8 > toArray () const
 Converts the port number to an array of bytes.
 
bool operator< (const Port &other) const
 Compares the port number with another port.
 

Static Public Member Functions

static Port getRandomPort ()
 Returns a random port.
 

Detailed Description

Represents a network port.

This class provides functionalities to represent a network port, which is a 16-bit number commonly used in networking to specify the endpoint in a network address.

Constructor & Destructor Documentation

◆ Port() [1/2]

NetSim::Port::Port ( )
default

Default constructor.

Here is the caller graph for this function:

◆ Port() [2/2]

Port::Port ( quint16  portNumber)
explicit

Constructs a port with a specified port number.

Member Function Documentation

◆ getRandomPort()

Port Port::getRandomPort ( )
static

Returns a random port.

Here is the call graph for this function:

◆ operator<()

bool Port::operator< ( const Port other) const

Compares the port number with another port.

◆ portNumber()

quint16 Port::portNumber ( ) const

Returns the port number.

Here is the caller graph for this function:

◆ toArray()

QVector< quint8 > Port::toArray ( ) const

Converts the port number to an array of bytes.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: