#include <ucommon/timers.h>
#include <ucommon/string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <stdio.h>
Include dependency graph for socket.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | ucommon |
Data Structures | |
struct | hostaddr_internet |
An object that holds ipv4 or ipv6 binary encoded host addresses. More... | |
struct | sockaddr_internet |
An object that can hold a ipv4 or ipv6 socket address. More... | |
class | ucommon::cidr |
A class to hold internet segment routing rules. More... | |
class | ucommon::linked_pointer< sockaddr_struct > |
Linked pointer for address lists. More... | |
class | ucommon::ListenSocket |
A bound socket used to listen for inbound socket connections. More... | |
class | ucommon::Socket |
A generic socket base class. More... | |
class | ucommon::Socket::address |
A generic socket address class. More... | |
class | ucommon::TCPServer |
A generic tcp server class. More... | |
Defines | |
#define | DCCP_SOCKOPT_AVAILABLE_CCIDS 12 |
#define | DCCP_SOCKOPT_CCID 13 |
#define | DCCP_SOCKOPT_RX_CCID 15 |
#define | DCCP_SOCKOPT_TX_CCID 14 |
#define | DEFAULT_FAMILY AF_UNSPEC |
#define | IPPROTO_DCCP 23 |
#define | IPTOS_LOWDELAY 0x10 |
#define | IPTOS_MINCOST 0x02 |
#define | IPTOS_RELIABILITY 0x04 |
#define | IPTOS_THROUGHPUT 0x08 |
#define | SOCK_DCCP 6 |
#define | SOL_DCCP 269 |
Typedefs | |
typedef hostaddr_internet | inethostaddr_t |
An object that holds ipv4 or ipv6 binary encoded host addresses. | |
typedef sockaddr_internet | inetsockaddr_t |
An object that can hold a ipv4 or ipv6 socket address. | |
typedef sockaddr | sockaddr_struct |
typedef sockaddr * | sockaddr_t |
typedef TCPServer | ucommon::tcpserv_t |
Functions | |
sockaddr * | ucommon::_getaddrinfo (struct addrinfo *addrinfo) |
Helper function for linked_pointer<struct sockaddr>. | |
socket_t | ucommon::_getaddrsock (struct addrinfo *addrinfo) |
Helper function for linked_pointer<struct sockaddr>. | |
addrinfo * | ucommon::_nextaddrinfo (struct addrinfo *addrinfo) |
Helper function for linked_pointer<struct sockaddr>. | |
sockaddr * | ucommon::addr (Socket::address &address) |
A convenience function to convert a socket address list into a socket address. | |
addrinfo * | ucommon::addrinfo (Socket::address &address) |
A convenience function to convert a socket address list into an addrinfo. | |
bool | ucommon::eq (struct sockaddr_storage *s1, struct sockaddr_storage *s2) |
Compare two stored socket addresses to see if equal. | |
bool | ucommon::eq (struct sockaddr *s1, struct sockaddr *s2) |
Compare two socket addresses to see if equal. | |
bool | ucommon::eq_host (struct sockaddr *s1, struct sockaddr *s2) |
Compare two host addresses to see if equal. | |
bool | ucommon::eq_subnet (struct sockaddr *s1, struct sockaddr *s2) |
String | ucommon::str (Socket &so, strsize_t size) |
This offers a common socket base class that exposes socket functionality based on what the target platform supports. Support for multicast, IPV6 addressing, and manipulation of cidr policies are all supported here.
Definition in file socket.h.
typedef struct sockaddr_internet inetsockaddr_t |
An object that can hold a ipv4 or ipv6 socket address.
This would be used for tcpip socket connections. We do not use sockaddr_storage because it is not present in pre ipv6 stacks, and because the storage size also includes the size of the path of a unix domain socket on posix systems.