mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2025-01-03 14:56:36 -05:00
Feature: Defined the socket address API
This commit is contained in:
parent
81da38369a
commit
23d4385e94
@ -29,6 +29,52 @@ extern "C" {
|
||||
|
||||
/* Put stuff here */
|
||||
|
||||
/* About thread safety:
|
||||
* This set of functions is not thread safe.
|
||||
*/
|
||||
|
||||
#include <igloo/config.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
igloo_RO_FORWARD_TYPE(igloo_socketaddr_t);
|
||||
|
||||
typedef enum {
|
||||
igloo_SOCKETADDR_DOMAIN_UNSPEC = 0,
|
||||
igloo_SOCKETADDR_DOMAIN_UNIX,
|
||||
igloo_SOCKETADDR_DOMAIN_INET4,
|
||||
igloo_SOCKETADDR_DOMAIN_INET6
|
||||
} igloo_socketaddr_domain_t;
|
||||
|
||||
typedef enum {
|
||||
igloo_SOCKETADDR_TYPE_UNSPEC = 0,
|
||||
igloo_SOCKETADDR_TYPE_STREAM,
|
||||
igloo_SOCKETADDR_TYPE_DGRAM,
|
||||
igloo_SOCKETADDR_TYPE_SEQPACK,
|
||||
igloo_SOCKETADDR_TYPE_RDM
|
||||
} igloo_socketaddr_type_t;
|
||||
|
||||
typedef enum {
|
||||
igloo_SOCKETADDR_PROTOCOL_UNSPEC = 0,
|
||||
igloo_SOCKETADDR_PROTOCOL_TCP,
|
||||
igloo_SOCKETADDR_PROTOCOL_UDP,
|
||||
igloo_SOCKETADDR_PROTOCOL_DCCP,
|
||||
igloo_SOCKETADDR_PROTOCOL_SCTP,
|
||||
igloo_SOCKETADDR_PROTOCOL_UDPLITE
|
||||
} igloo_socketaddr_protocol_t;
|
||||
|
||||
igloo_socketaddr_t * igloo_socketaddr_new(igloo_socketaddr_domain_t domain, igloo_socketaddr_type_t type, igloo_socketaddr_protocol_t protocol, const char *name, igloo_ro_t associated, igloo_ro_t instance);
|
||||
igloo_error_t igloo_socketaddr_get_base(igloo_socketaddr_t *addr, igloo_socketaddr_domain_t *domain, igloo_socketaddr_type_t *type, igloo_socketaddr_protocol_t *protocol);
|
||||
|
||||
igloo_error_t igloo_socketaddr_set_node(igloo_socketaddr_t *addr, const char *node);
|
||||
igloo_error_t igloo_socketaddr_get_node(igloo_socketaddr_t *addr, const char **node);
|
||||
igloo_error_t igloo_socketaddr_get_ip (igloo_socketaddr_t *addr, const char **ip);
|
||||
igloo_error_t igloo_socketaddr_set_port(igloo_socketaddr_t *addr, uint16_t port);
|
||||
igloo_error_t igloo_socketaddr_get_port(igloo_socketaddr_t *addr, uint16_t *port);
|
||||
igloo_error_t igloo_socketaddr_set_path(igloo_socketaddr_t *addr, const char *path);
|
||||
igloo_error_t igloo_socketaddr_get_path(igloo_socketaddr_t *addr, const char **path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user