Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cNetPort Class Reference

#include <cNetPort.h>

Public Member Functions

 UNITTEST_FRIEND (cNetPort)
 

Static Public Member Functions

static NET_PORT_t GRAYCALL FindPortByServiceName (const char *pszPort)
 
static cStringA GRAYCALL FindServiceNameByPort (NET_PORT_t wPort)
 

Public Attributes

const char * m_pszName
 Name of the service. e.g. "http". NI_MAXSERV. More...
 
NET_PORT_t m_wPortDefault
 default port for the service type. More...
 

Static Public Attributes

static const char * k_Prefix_Http = "http"
 
static const char * k_Prefix_Https = "https"
 
static const NET_PORT_t k_Default_Http = 80
 
static const cNetPort k_Services [NETSERVICE_QTY+1]
 

Detailed Description

Define known standard services/ports. NETSERVICE_TYPE. Ranging from 1 to 65535 (port number 0 is reserved and can't be used). http://en.wikipedia.org/wiki/TCP_and_UDP_port or https://www.cs.clemson.edu/course/cpsc424/material/TCP%20UDP%20Services/etc-services.pdf

Note
ports less than 1024 are reserved for system/privileged use. k_NET_PORT_RESERVE ports greater than 49152 are Ephemeral and free for all use. k_NET_PORT_TEMP

Member Function Documentation

◆ FindPortByServiceName()

NET_PORT_t GRAYCALL GrayLib::cNetPort::FindPortByServiceName ( const char *  pszPort)
static
Returns
Port in Host order bytes.

◆ FindServiceNameByPort()

cStringA GRAYCALL GrayLib::cNetPort::FindServiceNameByPort ( NET_PORT_t  wPort)
static

Find a service name or just a string number for the port number.

  • wPort = Host order bytes.

◆ UNITTEST_FRIEND()

GrayLib::cNetPort::UNITTEST_FRIEND ( cNetPort  )

Member Data Documentation

◆ k_Default_Http

const NET_PORT_t GrayLib::cNetPort::k_Default_Http = 80
static

◆ k_Prefix_Http

const char * GrayLib::cNetPort::k_Prefix_Http = "http"
static

◆ k_Prefix_Https

const char * GrayLib::cNetPort::k_Prefix_Https = "https"
static

◆ k_Services

const cNetPort GrayLib::cNetPort::k_Services
static
Initial value:
=
{
{ "unk", 0 },
{ "file", k_NET_PORT_MAX },
{ "ftp", IPPORT_FTP },
{ "ftps", 990 },
{ k_Prefix_Https, 443 },
{ "rtmp", 1935 },
{ nullptr, 0 },
}
static const NET_PORT_t k_Default_Http
Definition: cNetPort.h:73
static const char * k_Prefix_Http
Definition: cNetPort.h:71
static const char * k_Prefix_Https
Definition: cNetPort.h:72

◆ m_pszName

const char* GrayLib::cNetPort::m_pszName

Name of the service. e.g. "http". NI_MAXSERV.

◆ m_wPortDefault

NET_PORT_t GrayLib::cNetPort::m_wPortDefault

default port for the service type.


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