55#if !defined (PLIBSYS_H_INSIDE) && !defined (PLIBSYS_COMPILATION)
56# error "Header files shouldn't be included directly, consider using <plibsys.h> instead."
59#ifndef PLIBSYS_HEADER_PSOCKETADDRESS_H
60#define PLIBSYS_HEADER_PSOCKETADDRESS_H
66# include <sys/types.h>
67# include <sys/socket.h>
68# include <netinet/in.h>
#define P_BEGIN_DECLS
Starts .h file declarations to be exported as C functions.
#define P_END_DECLS
Closes .h file declarations to be exported as C functions, should be always used after P_BEGIN_DECLS.
#define P_LIB_API
Exports a symbol from a shared library.
P_LIB_API pboolean p_socket_address_is_ipv6_supported(void)
Checks whether IPv6 protocol is supported.
P_LIB_API void p_socket_address_free(PSocketAddress *addr)
Frees a socket address structure and its resources.
P_LIB_API pchar * p_socket_address_get_address(const PSocketAddress *addr)
Gets a socket address in a string representation, i.e.
enum PSocketFamily_ PSocketFamily
Socket address family.
P_LIB_API PSocketFamily p_socket_address_get_family(const PSocketAddress *addr)
Gets a family of a socket address.
PSocketFamily_
Socket address family.
@ P_SOCKET_FAMILY_INET6
No IPv6 family.
@ P_SOCKET_FAMILY_INET
IPv4 family.
@ P_SOCKET_FAMILY_UNKNOWN
Unknown family.
P_LIB_API puint32 p_socket_address_get_flow_info(const PSocketAddress *addr)
Gets IPv6 traffic class and flow information.
P_LIB_API psize p_socket_address_get_native_size(const PSocketAddress *addr)
Gets the size of the native socket address raw data, in bytes.
struct PSocketAddress_ PSocketAddress
Socket address opaque structure.
P_LIB_API PSocketAddress * p_socket_address_new(const pchar *address, puint16 port)
Creates new PSocketAddress.
P_LIB_API pboolean p_socket_address_is_any(const PSocketAddress *addr)
Checks whether a given socket address is an any-address representation.
P_LIB_API pboolean p_socket_address_is_loopback(const PSocketAddress *addr)
Checks whether a given socket address is for the loopback interface.
P_LIB_API pboolean p_socket_address_to_native(const PSocketAddress *addr, ppointer dest, psize destlen)
Converts PSocketAddress to the native socket address raw data.
P_LIB_API void p_socket_address_set_scope_id(PSocketAddress *addr, puint32 scope_id)
Sets an IPv6 set of interfaces for a scope.
P_LIB_API pboolean p_socket_address_is_scope_id_supported(void)
Checks whether a set of interfaces for a scope is supported in IPv6.
P_LIB_API PSocketAddress * p_socket_address_new_from_native(pconstpointer native, psize len)
Creates new PSocketAddress from the native socket address raw data.
P_LIB_API PSocketAddress * p_socket_address_new_loopback(PSocketFamily family, puint16 port)
Creates new PSocketAddress for the loopback interface.
P_LIB_API pboolean p_socket_address_is_flow_info_supported(void)
Checks whether flow information is supported in IPv6.
P_LIB_API void p_socket_address_set_flow_info(PSocketAddress *addr, puint32 flowinfo)
Sets IPv6 traffic class and flow information.
P_LIB_API puint16 p_socket_address_get_port(const PSocketAddress *addr)
Gets a port number of a socket address.
P_LIB_API PSocketAddress * p_socket_address_new_any(PSocketFamily family, puint16 port)
Creates new PSocketAddress for the any-address representation.
P_LIB_API puint32 p_socket_address_get_scope_id(const PSocketAddress *addr)
Gets an IPv6 set of interfaces for a scope.
unsigned short puint16
Type for unsigned 16 bit.
char pchar
Type for a char.
unsigned int psize
Type for a platform independent size_t.
const void * pconstpointer
Type for a const pointer.
void * ppointer
Type for a pointer.
signed int pboolean
Type for a bool.
unsigned int puint32
Type for unsigned 32 bit.