FARGOS/VISTA Object Management Environment Core
..
|
Protocol-independent representation of a socket address. IPv4, IPv6 and file domain sockets are supported. More...
#include <HTTPembeddedServer.hpp>
Classes | |
union | GenericSocketAddress_union |
Public Member Functions | |
int | setFromHostAndPort (const char *targetAddress, uint16_t port) |
Assign from an URL representation of the address and an integer value of the port. The following URL prefixes are recognized: "ipv4:", "ipv6:" and "file:". If no prefix is specified, the default of "ipv4:" is assumed. More... | |
int | setFromURL (const char *addressString) |
Convenience cover to setFromHostAndPort() that also converts the port. More... | |
GenericSocketAddress () OME_ALWAYS_INLINE | |
GenericSocketAddress (const struct sockaddr_in ipv4) OME_ALWAYS_INLINE | |
GenericSocketAddress (const struct sockaddr_in6 ipv6) OME_ALWAYS_INLINE | |
GenericSocketAddress (const char *addressString) | |
GenericSocketAddress (const struct sockaddr *generic_addr, socklen_t addrLen) OME_ALWAYS_INLINE | |
GenericSocketAddress (const char *address, uint16_t port) | |
GenericSocketAddress (const std::string &address, uint16_t port) | |
GenericSocketAddress & | operator= (const struct sockaddr_in ipv4) OME_ALWAYS_INLINE |
GenericSocketAddress & | operator= (const struct sockaddr_in6 ipv6) OME_ALWAYS_INLINE |
int | copyAddressAndPort (char *addrText, uint32_t bfrSize, bool includeURLprefix=false) const |
Return the address as a URL. More... | |
char * | getAddressAndPort (char *bfr, uint32_t bfrSize, bool includeURLprefix=false) const |
Convenience cover to copyAddressAndPort() that concatenates the port to the result. More... | |
bool | operator== (const GenericSocketAddress &arg) const OME_ALWAYS_INLINE |
bool | operator!= (const GenericSocketAddress &arg) const OME_ALWAYS_INLINE |
bool | operator< (const GenericSocketAddress &arg) const OME_ALWAYS_INLINE |
bool | operator> (const GenericSocketAddress &arg) const OME_ALWAYS_INLINE |
Public Attributes | |
union GenericSocketAddress::GenericSocketAddress_union | socketAddress |
uint8_t | addressLength |
Protocol-independent representation of a socket address. IPv4, IPv6 and file domain sockets are supported.
|
inline |
References addressLength.
|
inlineexplicit |
References addressLength, GenericSocketAddress::GenericSocketAddress_union::ipv4, and socketAddress.
|
inlineexplicit |
References addressLength, GenericSocketAddress::GenericSocketAddress_union::ipv6, and socketAddress.
|
inlineexplicit |
References setFromURL().
|
inlineexplicit |
|
inline |
References setFromHostAndPort().
|
inline |
References setFromHostAndPort().
|
inline |
Return the address as a URL.
addrText | points to the buffer into which the textual representation of the address will be constructed. |
bfrSize | specifies the size of the buffer. |
includeURLprefix | is a Boolean that indicates if a type-specific URL prefix, such as "ipv4://", should be included before the address. |
References GenericSocketAddress::GenericSocketAddress_union::filename, GenericSocketAddress::GenericSocketAddress_union::genericAddr, GenericSocketAddress::GenericSocketAddress_union::ipv4, GenericSocketAddress::GenericSocketAddress_union::ipv6, ntohs, safe_strcpy, and socketAddress.
Referenced by getAddressAndPort().
|
inline |
Convenience cover to copyAddressAndPort() that concatenates the port to the result.
bfr | points to the buffer into which the textual representation of the address and port will be constructed. |
bfrSize | specifies the size of the buffer. |
includeURLprefix | is a Boolean that indicates if a type-specific URL prefix, such as "ipv4://", should be included before the address. |
References copyAddressAndPort().
|
inline |
References addressLength, OME_EXPECT_FALSE, and socketAddress.
|
inline |
References addressLength, OME_EXPECT_FALSE, and socketAddress.
|
inline |
References addressLength, GenericSocketAddress::GenericSocketAddress_union::ipv4, and socketAddress.
|
inline |
References addressLength, GenericSocketAddress::GenericSocketAddress_union::ipv6, and socketAddress.
|
inline |
References addressLength, OME_EXPECT_FALSE, and socketAddress.
|
inline |
References addressLength, OME_EXPECT_TRUE, and socketAddress.
|
inline |
Assign from an URL representation of the address and an integer value of the port. The following URL prefixes are recognized: "ipv4:", "ipv6:" and "file:". If no prefix is specified, the default of "ipv4:" is assumed.
targetAddress | points to a string containing the text representation of the address, which may be prefixed with the relevant type. For IPv4 addresses, this is expected to be a dotted-decimal string. For IPv6 addresses, this is expected to be a colon-separated string of hexadecimal values. For files, this is expected to be a path. |
port | specifies the port. |
Use setFromURL() if the address text also contains the port.
References addressLength, GenericSocketAddress::GenericSocketAddress_union::filename, htons, GenericSocketAddress::GenericSocketAddress_union::ipv4, GenericSocketAddress::GenericSocketAddress_union::ipv6, l, and socketAddress.
Referenced by GenericSocketAddress(), and setFromURL().
|
inline |
Convenience cover to setFromHostAndPort() that also converts the port.
addressString | points to the text string to be parsed and converted. |
References setFromHostAndPort(), and text2uint32().
Referenced by GenericSocketAddress().
uint8_t GenericSocketAddress::addressLength |
union GenericSocketAddress::GenericSocketAddress_union GenericSocketAddress::socketAddress |
Referenced by HTTP_SessionRecord::connectionEOF(), copyAddressAndPort(), GenericSocketAddress(), HTTP_SessionRecord::handleHTTPrequest(), operator!=(), operator<(), operator<<(), operator=(), operator==(), operator>(), HTTP_SessionRecord::processBlock(), HTTP_SessionRecord::processHTTPheader(), setFromHostAndPort(), and HTTPembeddedServerBase::startHTTPlisten().
![]() | Generated: Fri Jul 31 2020 18:19:16
Support Information |