Skip to content

Commit

Permalink
Doxygen fixes (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
seladb authored Nov 30, 2023
1 parent 048cc9b commit ec14cab
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 120 deletions.
4 changes: 2 additions & 2 deletions Common++/header/IpAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace pcpp
* @param[in] network A string in one of these formats:
* - X.X.X.X/Y where X.X.X.X is a valid IP address and Y is a number between 0 and 32
* - X.X.X.X/Y.Y.Y.Y where X.X.X.X is a valid IP address and Y.Y.Y.Y is a valid netmask
* @return True if the address matches the network or false if it doesn't or if the network is invalid
* @return True if the address matches the network or false if it doesn't or if the network is invalid
*/
bool matchNetwork(const std::string& network) const;

Expand Down Expand Up @@ -286,7 +286,7 @@ namespace pcpp
* - IPV6_ADDRESS/Y where IPV6_ADDRESS is a valid IPv6 address and Y is a number between 0 and 128
* - IPV6_ADDRESS/IPV6_NETMASK where IPV6_ADDRESS is a valid IPv6 address and IPV6_NETMASK is a valid
* IPv6 netmask
* @return True if the address matches the network or false if it doesn't or if the network is invalid
* @return True if the address matches the network or false if it doesn't or if the network is invalid
*/
bool matchNetwork(const std::string& network) const;

Expand Down
26 changes: 13 additions & 13 deletions Common++/header/MacAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ namespace pcpp
MacAddress(const uint8_t* addr) : m_IsValid(true) { memcpy(m_Address, addr, sizeof(m_Address)); }

/**
* A constructor that creates an instance of the class out of a (char*) string.
* If the string doesn't represent a valid MAC address, instance will be invalid, meaning isValid() will return false
* @param[in] addr A pointer to the (char*) string
* A constructor that creates an instance of the class out of a (char*) string.
* If the string doesn't represent a valid MAC address, instance will be invalid, meaning isValid() will return false
* @param[in] addr A pointer to the (char*) string
*/
MacAddress(const char* addr) { init(addr); }

/**
* A constructor that creates an instance of the class out of a std::string.
* If the string doesn't represent a valid MAC address, instance will be invalid, meaning isValid() will return false
* @param[in] addr A pointer to the string
* A constructor that creates an instance of the class out of a std::string.
* If the string doesn't represent a valid MAC address, instance will be invalid, meaning isValid() will return false
* @param[in] addr A pointer to the string
*/
MacAddress(const std::string& addr) { init(addr.c_str()); }

/**
* A constructor that creates an instance of 6 bytes representing the MAC address
* @param[in] firstOctest Represent the first octet in the address
* @param[in] secondOctet Represent the second octet in the address
* @param[in] thirdOctet Represent the third octet in the address
* @param[in] fourthOctet Represent the fourth octet in the address
* @param[in] fifthOctet Represent the fifth octet in the address
* @param[in] sixthOctet Represent the sixth octet in the address
* A constructor that creates an instance of 6 bytes representing the MAC address
* @param[in] firstOctest Represent the first octet in the address
* @param[in] secondOctet Represent the second octet in the address
* @param[in] thirdOctet Represent the third octet in the address
* @param[in] fourthOctet Represent the fourth octet in the address
* @param[in] fifthOctet Represent the fifth octet in the address
* @param[in] sixthOctet Represent the sixth octet in the address
*/
inline MacAddress(uint8_t firstOctest, uint8_t secondOctet, uint8_t thirdOctet, uint8_t fourthOctet, uint8_t fifthOctet, uint8_t sixthOctet);

Expand Down
5 changes: 3 additions & 2 deletions Common++/header/SystemUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ namespace pcpp
{
/**
* Core position in a 32-bit mask. For each core this attribute holds a 4B integer where only 1 bit is set, according to the core ID.
* For example: in core #0 the right-most bit will be set (meaning the number 0x01);
* in core #5 the 5th right-most bit will be set (meaning the number 0x20)...
* For example:
* - In core #0 the right-most bit will be set (meaning the number 0x01);
* - in core #5 the 5th right-most bit will be set (meaning the number 0x20)
*/
uint32_t Mask;

Expand Down
24 changes: 12 additions & 12 deletions Packet++/header/DnsLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,41 @@ namespace pcpp
uint16_t
/** Recursion desired flag */
recursionDesired:1,
/** Truncated flag */
/** Truncated flag */
truncation:1,
/** Authoritative answer flag */
/** Authoritative answer flag */
authoritativeAnswer:1,
/** Operation Code */
opcode:4,
/** Query/Response flag */
/** Query/Response flag */
queryOrResponse:1,
/** Return Code */
responseCode:4,
/** Checking disabled flag */
checkingDisabled:1,
/** Authenticated data flag */
/** Authenticated data flag */
authenticData:1,
/** Zero flag (Reserved) */
/** Zero flag (Reserved) */
zero:1,
/** Recursion available flag */
/** Recursion available flag */
recursionAvailable:1;
#elif (BYTE_ORDER == BIG_ENDIAN)
uint16_t
/** Query/Response flag */
/** Query/Response flag */
queryOrResponse:1,
/** Operation Code */
opcode:4,
/** Authoritative answer flag */
/** Authoritative answer flag */
authoritativeAnswer:1,
/** Truncated flag */
/** Truncated flag */
truncation:1,
/** Recursion desired flag */
recursionDesired:1,
/** Recursion available flag */
/** Recursion available flag */
recursionAvailable:1,
/** Zero flag (Reserved) */
/** Zero flag (Reserved) */
zero:1,
/** Authenticated data flag */
/** Authenticated data flag */
authenticData:1,
/** Checking disabled flag */
checkingDisabled:1,
Expand Down
2 changes: 1 addition & 1 deletion Packet++/header/DnsLayerEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace pcpp
DNS_TYPE_GPOS,
/** IPv6 address record */
DNS_TYPE_AAAA,
/** Location record */
/** Location record */
DNS_TYPE_LOC,
/** Obsolete record */
DNS_TYPE_NXT,
Expand Down
7 changes: 4 additions & 3 deletions Packet++/header/HttpLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ namespace pcpp
* The content-length field value. The method supports several cases:
* - If the "Content-Length" field exists - the method will only replace the existing value with the new value
* - If the "Content-Length" field doesn't exist - the method will create this field and put the value in it. Here are also 2 cases:
* - If prevFieldName is specified - the new "Content-Length" field will be created after it
* - If prevFieldName isn't specified or doesn't exist - the new "Content-Length" field will be created as the last field before
* end-of-header field
* - If prevFieldName is specified - the new "Content-Length" field will be created after it
* - If prevFieldName isn't specified or doesn't exist - the new "Content-Length" field will be created as the last field before
* end-of-header field
*
* @param[in] contentLength The content length value to set
* @param[in] prevFieldName Optional field, if specified and "Content-Length" field doesn't exist, it will be created after it
* @return A pointer to the "Content-Length" field, or NULL if creation failed for some reason
Expand Down
34 changes: 17 additions & 17 deletions Packet++/header/IPv4Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,47 +62,47 @@ namespace pcpp
*/
enum IPProtocolTypes
{
/** Dummy protocol for TCP */
/** Dummy protocol for TCP */
PACKETPP_IPPROTO_IP = 0,
/** IPv6 Hop-by-Hop options */
/** IPv6 Hop-by-Hop options */
PACKETPP_IPPROTO_HOPOPTS = 0,
/** Internet Control Message Protocol */
/** Internet Control Message Protocol */
PACKETPP_IPPROTO_ICMP = 1,
/** Internet Gateway Management Protocol */
PACKETPP_IPPROTO_IGMP = 2,
/** IPIP tunnels (older KA9Q tunnels use 94) */
PACKETPP_IPPROTO_IPIP = 4,
/** Transmission Control Protocol */
/** Transmission Control Protocol */
PACKETPP_IPPROTO_TCP = 6,
/** Exterior Gateway Protocol */
/** Exterior Gateway Protocol */
PACKETPP_IPPROTO_EGP = 8,
/** PUP protocol */
/** PUP protocol */
PACKETPP_IPPROTO_PUP = 12,
/** User Datagram Protocol */
/** User Datagram Protocol */
PACKETPP_IPPROTO_UDP = 17,
/** XNS IDP protocol */
/** XNS IDP protocol */
PACKETPP_IPPROTO_IDP = 22,
/** IPv6 header */
/** IPv6 header */
PACKETPP_IPPROTO_IPV6 = 41,
/** IPv6 Routing header */
/** IPv6 Routing header */
PACKETPP_IPPROTO_ROUTING = 43,
/** IPv6 fragmentation header */
/** IPv6 fragmentation header */
PACKETPP_IPPROTO_FRAGMENT = 44,
/** GRE protocol */
PACKETPP_IPPROTO_GRE = 47,
/** encapsulating security payload */
/** encapsulating security payload */
PACKETPP_IPPROTO_ESP = 50,
/** authentication header */
/** authentication header */
PACKETPP_IPPROTO_AH = 51,
/** ICMPv6 */
/** ICMPv6 */
PACKETPP_IPPROTO_ICMPV6 = 58,
/** IPv6 no next header */
/** IPv6 no next header */
PACKETPP_IPPROTO_NONE = 59,
/** IPv6 Destination options */
/** IPv6 Destination options */
PACKETPP_IPPROTO_DSTOPTS = 60,
/** VRRP protocol */
PACKETPP_IPPROTO_VRRP = 112,
/** Raw IP packets */
/** Raw IP packets */
PACKETPP_IPPROTO_RAW = 255,
/** Maximum value */
PACKETPP_IPPROTO_MAX
Expand Down
32 changes: 15 additions & 17 deletions Packet++/header/Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,21 @@ namespace pcpp
* Each layer holds a pointer to the relevant place in the packet. The layer sees all the data from this pointer forward until the
* end of the packet. Here is an example packet showing this concept:
*
@verbatim
====================================================
|Eth |IPv4 |TCP |Packet |
|Header |Header |Header |Payload |
====================================================
|--------------------------------------------------|
EthLayer data
|---------------------------------------|
IPv4Layer data
|---------------------------|
TcpLayer data
|----------------|
PayloadLayer data
@endverbatim
@verbatim
====================================================
|Eth |IPv4 |TCP |Packet |
|Header |Header |Header |Payload |
====================================================
|--------------------------------------------------|
EthLayer data
|---------------------------------------|
IPv4Layer data
|---------------------------|
TcpLayer data
|----------------|
PayloadLayer data
@endverbatim
*
*/
class Layer : public IDataContainer
Expand Down
4 changes: 2 additions & 2 deletions Packet++/header/NdpLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class NDPNeighborSolicitationLayer : public NDPLayerBase

private:
void initLayer(uint8_t code, const IPv6Address &targetIP);
ndpneighborsolicitationhdr *getNdpHeader() const { return (ndpneighborsolicitationhdr *)m_Data; }
ndpneighborsolicitationhdr *getNdpHeader() const { return (ndpneighborsolicitationhdr *)m_Data; }
size_t getNdpHeaderLen() const { return sizeof(ndpneighborsolicitationhdr); };
};

Expand Down Expand Up @@ -363,7 +363,7 @@ class NDPNeighborAdvertisementLayer : public NDPLayerBase

private:
void initLayer(uint8_t code, const IPv6Address &targetIP, bool routerFlag, bool unicastFlag, bool overrideFlag);
ndpneighboradvertisementhdr *getNdpHeader() const { return (ndpneighboradvertisementhdr *)m_Data; }
ndpneighboradvertisementhdr *getNdpHeader() const { return (ndpneighboradvertisementhdr *)m_Data; }
size_t getNdpHeaderLen() const { return sizeof(ndpneighboradvertisementhdr); };
};

Expand Down
14 changes: 7 additions & 7 deletions Packet++/header/SSHLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ namespace pcpp
* A class representing all of the non-encrypted SSH handshake messages.
* An handshake message typically has the following structure:
*
@verbatim
0 1 2 3 4 5 6
+---------+---------+---------+---------+---------+---------+----------- ---------+
| Packet Length | Padding | Message | Message .... Padding |
| | Length | Type | Content .... |
+---------------------------------------+---------+---------+----------- ---------+
@endverbatim
@verbatim
0 1 2 3 4 5 6
+---------+---------+---------+---------+---------+---------+----------- ---------+
| Packet Length | Padding | Message | Message .... Padding |
| | Length | Type | Content .... |
+---------------------------------------+---------+---------+----------- ---------+
@endverbatim
*
* The first 4 bytes hold the packet length, followed by 1 byte that holds the padding length (which comes at the end of the message),
* then 1 byte that holds the message type (which can be of type SSHHandshakeMessage#SSHHandshakeMessageType) and then the message content.
Expand Down
63 changes: 30 additions & 33 deletions Packet++/header/SSLLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,43 +265,40 @@ namespace pcpp
* server-key-exchange, etc.). Usually this layer will contain just one message (as the first example below
* demonstrates). But there are cases a layer may contain more than 1 message. To better explain this layer structure
* we'll use 2 examples. The first will be client-hello message. The layer structure will look like this:
@verbatim
|------------------- SSLHandshakeLayer ----------------------|
+----------------------+-------------------------------------+
| ssl_tls_record_layer | SSLClientHelloMessage |
| struct | |
+----------------------+-------------------------------------+
/ | \ | \ \ \
/ version \ | handshake \ \ \
/ TLS1_0 \ type \ \ rest of
type \ | SSL_CLIENT_HELLO \ \ message fields...
SSL_HANDSHAKE length handshake \
(22) xxx | version message
TLS1_2 length
| yyy
@endverbatim
@verbatim
|------------------- SSLHandshakeLayer ----------------------|
+----------------------+-------------------------------------+
| ssl_tls_record_layer | SSLClientHelloMessage |
| struct | |
+----------------------+-------------------------------------+
/ | \ | \ \ \
/ version \ | handshake \ \ \
/ TLS1_0 \ type \ \ rest of
type \ | SSL_CLIENT_HELLO \ \ message fields...
SSL_HANDSHAKE length handshake \
(22) xxx | version message
TLS1_2 length
| yyy
@endverbatim
* Second example is a multiple-message handshake layer comprises of server-hello, certificate and server-key-exchange
* messages:
@verbatim
|---------------------------------------------- SSLHandshakeLayer -----------------------------------------------------|
+----------------------+-------------------------------------+---------------------------+-----------------------------+
| ssl_tls_record_layer | SSLServerHelloMessage | SSLCertificateMessage | SSLServerKeyExchangeMessage |
| struct | | | |
+----------------------+-------------------------------------+---------------------------+-----------------------------+
/ | \ | \ \ | \ | \
/ version \ | handshake \ rest of | | rest | | rest
/ TLS1_0 \ type \ message handshake of fields... handshake of fields...
type \ | SSL_SERVER_HELLO \ fields...| type | type
SSL_HANDSHAKE length handshake SSL_CERTIFICATE SSL_SERVER_KEY_EXCHANGE
(22) xxx | version,length | |
| | |
@endverbatim
@verbatim
|---------------------------------------------- SSLHandshakeLayer -----------------------------------------------------|
+----------------------+-------------------------------------+---------------------------+-----------------------------+
| ssl_tls_record_layer | SSLServerHelloMessage | SSLCertificateMessage | SSLServerKeyExchangeMessage |
| struct | | | |
+----------------------+-------------------------------------+---------------------------+-----------------------------+
/ | \ | \ \ | \ | \
/ version \ | handshake \ rest of | | rest | | rest
/ TLS1_0 \ type \ message handshake of fields... handshake of fields...
type \ | SSL_SERVER_HELLO \ fields...| type | type
SSL_HANDSHAKE length handshake SSL_CERTIFICATE SSL_SERVER_KEY_EXCHANGE
(22) xxx | version,length | |
@endverbatim
*/
class SSLHandshakeLayer: public SSLLayer
{
Expand Down
6 changes: 3 additions & 3 deletions Packet++/header/SipLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace pcpp
* The content-length field value. The method supports several cases:
* - If the "Content-Length" field exists - the method will only replace the existing value with the new value
* - If the "Content-Length" field doesn't exist - the method will create this field and put the value in it. Here are also 2 cases:
* - If prevFieldName is specified - the new "Content-Length" field will be created after it
* - If prevFieldName isn't specified or doesn't exist - the new "Content-Length" field will be created as the last field before
* end-of-header field
* - If prevFieldName is specified - the new "Content-Length" field will be created after it
* - If prevFieldName isn't specified or doesn't exist - the new "Content-Length" field will be created as the last field before
* end-of-header field
*
* @param[in] contentLength The content length value to set
* @param[in] prevFieldName Optional parameter, if specified and "Content-Length" field doesn't exist, it will be created after this field
Expand Down
2 changes: 1 addition & 1 deletion Packet++/header/TelnetLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class TelnetLayer : public Layer
* @param[in] dataSize The byte array size (in bytes)
* @return True if the data is identified as Telnet message
*/
static bool isDataValid(const uint8_t *data, size_t dataSize) { return data && dataSize; }
static bool isDataValid(const uint8_t *data, size_t dataSize) { return data && dataSize; }

// overridden methods

Expand Down
Loading

0 comments on commit ec14cab

Please sign in to comment.