Remote endpoint creation and configuration.
More...
|
| struct | ct_remote_endpoint_t |
| | Opaque handle representing a remote endpoint (generic or resolved to specific ip address and port). More...
|
| |
Remote endpoint creation and configuration.
◆ ct_remote_endpoint_deep_copy()
Create a heap-allocated copy of a remote endpoint.
- Parameters
-
| [in] | remote_endpoint | Source endpoint |
- Returns
- Pointer to newly allocated copy, or NULL on error
◆ ct_remote_endpoint_free()
Free all resources in a remote endpoint including the structure itself.
- Parameters
-
| [in] | remote_endpoint | Endpoint to free |
◆ ct_remote_endpoint_from_sockaddr()
| int ct_remote_endpoint_from_sockaddr |
( |
ct_remote_endpoint_t * |
remote_endpoint, |
|
|
const struct sockaddr_storage * |
addr |
|
) |
| |
Initialize a remote endpoint from a sockaddr structure.
- Parameters
-
| [out] | remote_endpoint | Endpoint to initialize |
| [in] | addr | Socket address structure |
- Returns
- 0 on success, negative error code on failure
◆ ct_remote_endpoint_get_service()
Get the service for a remote endpoint.
- Parameters
-
| [in] | remote_endpoint | endpoint to get service for |
- Returns
- char* pointer to service name, NULL if endpoint is null, or if service is not set
◆ ct_remote_endpoint_new()
Create a new heap-allocated remote endpoint.
The caller owns the returned endpoint and must free it with ct_remote_endpoint_free() when done.
- Returns
- Pointer to newly allocated endpoint, or NULL on error
◆ ct_remote_endpoint_with_hostname()
| int ct_remote_endpoint_with_hostname |
( |
ct_remote_endpoint_t * |
remote_endpoint, |
|
|
const char * |
hostname |
|
) |
| |
Set the hostname for a remote endpoint.
- Parameters
-
| [in,out] | remote_endpoint | Endpoint to modify |
| [in] | hostname | Hostname or IP address string |
- Returns
- 0 on success, negative error code on failure
◆ ct_remote_endpoint_with_ipv4()
Set the IPv4 address for a remote endpoint.
- Parameters
-
| [in,out] | remote_endpoint | Endpoint to modify |
| [in] | ipv4_addr | IPv4 address in network byte order |
- Returns
- 0 on success, negative error code on failure
◆ ct_remote_endpoint_with_ipv6()
| int ct_remote_endpoint_with_ipv6 |
( |
ct_remote_endpoint_t * |
remote_endpoint, |
|
|
struct in6_addr |
ipv6_addr |
|
) |
| |
Set the IPv6 address for a remote endpoint.
- Parameters
-
| [in,out] | remote_endpoint | Endpoint to modify |
| [in] | ipv6_addr | IPv6 address structure |
- Returns
- 0 on success, negative error code on failure
◆ ct_remote_endpoint_with_port()
Set the port number for a remote endpoint.
- Parameters
-
| [in,out] | remote_endpoint | Endpoint to modify |
| [in] | port | Port number |
◆ ct_remote_endpoint_with_service()
| int ct_remote_endpoint_with_service |
( |
ct_remote_endpoint_t * |
remote_endpoint, |
|
|
const char * |
service |
|
) |
| |
Set the service name for a remote endpoint.
- Parameters
-
| [in,out] | remote_endpoint | Endpoint to modify |
| [in] | service | Service name (e.g., "http", "https") |
- Returns
- 0 on success, negative error code on failure