ObjFW
|
#include "objfw-defs.h"
#include <stdbool.h>
#import "OFString.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netinet/sctp.h>
#include <netipx/ipx.h>
#include "platform.h"
#import "macros.h"
Go to the source code of this file.
Classes | |
struct | of_socket_address_t |
A struct which represents a host / port pair for a socket. More... | |
Enumerations | |
enum | of_socket_address_family_t { OF_SOCKET_ADDRESS_FAMILY_UNKNOWN , OF_SOCKET_ADDRESS_FAMILY_IPV4 , OF_SOCKET_ADDRESS_FAMILY_IPV6 , OF_SOCKET_ADDRESS_FAMILY_IPX , OF_SOCKET_ADDRESS_FAMILY_ANY = 255 } |
A socket address family. More... | |
Functions | |
of_socket_address_t | of_socket_address_parse_ip (OFString *IP, uint16_t port) |
Parses the specified IP and port into an of_socket_address_t. More... | |
of_socket_address_t | of_socket_address_parse_ipv4 (OFString *IP, uint16_t port) |
Parses the specified IPv4 and port into an of_socket_address_t. More... | |
of_socket_address_t | of_socket_address_parse_ipv6 (OFString *IP, uint16_t port) |
Parses the specified IPv6 and port into an of_socket_address_t. More... | |
of_socket_address_t | of_socket_address_ipx (const unsigned char node[_Nonnull IPX_NODE_LEN], uint32_t network, uint16_t port) |
Creates an IPX address for the specified network, node and port. More... | |
bool | of_socket_address_equal (const of_socket_address_t *_Nonnull address1, const of_socket_address_t *_Nonnull address2) |
Compares two of_socket_address_t for equality. More... | |
unsigned long | of_socket_address_hash (const of_socket_address_t *_Nonnull address) |
Returns the hash for the specified of_socket_address_t. More... | |
OFString *_Nonnull | of_socket_address_ip_string (const of_socket_address_t *_Nonnull address, uint16_t *_Nullable port) |
Converts the specified of_socket_address_t to an IP string and port. More... | |
void | of_socket_address_set_port (of_socket_address_t *_Nonnull address, uint16_t port) |
Sets the port of the specified of_socket_address_t, independent of the address family used. More... | |
uint16_t | of_socket_address_get_port (const of_socket_address_t *_Nonnull address) |
Returns the port of the specified of_socket_address_t, independent of the address family used. More... | |
void | of_socket_address_set_ipx_network (of_socket_address_t *_Nonnull address, uint32_t network) |
Sets the IPX network of the specified of_socket_address_t. More... | |
uint32_t | of_socket_address_get_ipx_network (const of_socket_address_t *_Nonnull address) |
Returns the IPX network of the specified of_socket_address_t. More... | |
void | of_socket_address_set_ipx_node (of_socket_address_t *_Nonnull address, const unsigned char node[_Nonnull IPX_NODE_LEN]) |
Sets the IPX node of the specified of_socket_address_t. More... | |
void | of_socket_address_get_ipx_node (const of_socket_address_t *_Nonnull address, unsigned char node[_Nonnull IPX_NODE_LEN]) |
Gets the IPX node of the specified of_socket_address_t. More... | |
bool of_socket_address_equal | ( | const of_socket_address_t *_Nonnull | address1, |
const of_socket_address_t *_Nonnull | address2 | ||
) |
Compares two of_socket_address_t for equality.
address1 | The address to compare with the second address |
address2 | The second address |
uint32_t of_socket_address_get_ipx_network | ( | const of_socket_address_t *_Nonnull | address | ) |
Returns the IPX network of the specified of_socket_address_t.
address | The address on which to get the IPX network |
void of_socket_address_get_ipx_node | ( | const of_socket_address_t *_Nonnull | address, |
unsigned char | node[_Nonnull IPX_NODE_LEN] | ||
) |
Gets the IPX node of the specified of_socket_address_t.
address | The address on which to get the IPX node |
node | A byte array to store the IPX node of the address |
uint16_t of_socket_address_get_port | ( | const of_socket_address_t *_Nonnull | address | ) |
Returns the port of the specified of_socket_address_t, independent of the address family used.
address | The address on which to get the port |
unsigned long of_socket_address_hash | ( | const of_socket_address_t *_Nonnull | address | ) |
Returns the hash for the specified of_socket_address_t.
address | The address to hash |
OFString* _Nonnull of_socket_address_ip_string | ( | const of_socket_address_t *_Nonnull | address, |
uint16_t *_Nullable | port | ||
) |
Converts the specified of_socket_address_t to an IP string and port.
address | The address to convert to a string |
port | A pointer to an uint16_t which should be set to the port of the address or NULL if the port is not needed |
of_socket_address_t of_socket_address_ipx | ( | const unsigned char | node[_Nonnull IPX_NODE_LEN], |
uint32_t | network, | ||
uint16_t | port | ||
) |
Creates an IPX address for the specified network, node and port.
node | The node in the IPX network |
network | The IPX network |
port | The IPX port (sometimes called socket number) on the node |
of_socket_address_t of_socket_address_parse_ip | ( | OFString * | IP, |
uint16_t | port | ||
) |
Parses the specified IP and port into an of_socket_address_t.
IP | The IP to parse |
port | The port to use |
of_socket_address_t of_socket_address_parse_ipv4 | ( | OFString * | IP, |
uint16_t | port | ||
) |
Parses the specified IPv4 and port into an of_socket_address_t.
IP | The IPv4 to parse |
port | The port to use |
of_socket_address_t of_socket_address_parse_ipv6 | ( | OFString * | IP, |
uint16_t | port | ||
) |
Parses the specified IPv6 and port into an of_socket_address_t.
IP | The IPv6 to parse |
port | The port to use |
void of_socket_address_set_ipx_network | ( | of_socket_address_t *_Nonnull | address, |
uint32_t | network | ||
) |
Sets the IPX network of the specified of_socket_address_t.
address | The address on which to set the IPX network |
network | The IPX network to set on the address |
void of_socket_address_set_ipx_node | ( | of_socket_address_t *_Nonnull | address, |
const unsigned char | node[_Nonnull IPX_NODE_LEN] | ||
) |
Sets the IPX node of the specified of_socket_address_t.
address | The address on which to set the IPX node |
node | The IPX node to set on the address |
void of_socket_address_set_port | ( | of_socket_address_t *_Nonnull | address, |
uint16_t | port | ||
) |
Sets the port of the specified of_socket_address_t, independent of the address family used.
address | The address on which to set the port |
port | The port to set on the address |