Extensible Connection-oriented Messaging (XCM)
Loading...
Searching...
No Matches
xcm.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2020-2021 Ericsson AB
4 */
5
6#ifndef XCM_H
7#define XCM_H
8#ifdef __cplusplus
9extern "C" {
10#endif
11
1570#include <errno.h>
1571#include <stdbool.h>
1572#include <stddef.h>
1573#include <sys/types.h>
1574#include <xcm_attr_map.h>
1575
1577#define XCM_NONBLOCK (1<<0)
1578
1585struct xcm_socket;
1586
1639struct xcm_socket *xcm_connect(const char *remote_addr, int flags);
1640
1662struct xcm_socket *xcm_connect_a(const char *remote_addr,
1663 const struct xcm_attr_map *attrs);
1664
1700struct xcm_socket *xcm_server(const char *local_addr);
1701
1717struct xcm_socket *xcm_server_a(const char *local_addr,
1718 const struct xcm_attr_map *attrs);
1719
1735int xcm_close(struct xcm_socket *socket);
1736
1756void xcm_cleanup(struct xcm_socket *socket);
1757
1776struct xcm_socket *xcm_accept(struct xcm_socket *server_socket);
1777
1797struct xcm_socket *xcm_accept_a(struct xcm_socket *server_socket,
1798 const struct xcm_attr_map *attrs);
1799
1822int xcm_send(struct xcm_socket *__restrict conn_socket,
1823 const void *__restrict buf, size_t len);
1824
1848int xcm_receive(struct xcm_socket *__restrict conn_socket,
1849 void *__restrict buf, size_t capacity);
1850
1853#define XCM_SO_RECEIVABLE (1<<0)
1856#define XCM_SO_SENDABLE (1<<1)
1858#define XCM_SO_ACCEPTABLE (1<<2)
1859
1920int xcm_await(struct xcm_socket *socket, int condition);
1921
1969int xcm_fd(struct xcm_socket *socket);
1970
2016int xcm_finish(struct xcm_socket *socket);
2017
2058int xcm_set_blocking(struct xcm_socket *socket, bool should_block);
2059
2074bool xcm_is_blocking(struct xcm_socket *socket);
2075
2092const char *xcm_remote_addr(struct xcm_socket *conn_socket);
2093
2108const char *xcm_local_addr(struct xcm_socket *socket);
2109
2110#include <xcm_compat.h>
2111
2112#ifdef __cplusplus
2113}
2114#endif
2115#endif
int xcm_await(struct xcm_socket *socket, int condition)
int xcm_fd(struct xcm_socket *socket)
int xcm_receive(struct xcm_socket *__restrict conn_socket, void *__restrict buf, size_t capacity)
const char * xcm_remote_addr(struct xcm_socket *conn_socket)
struct xcm_socket * xcm_server_a(const char *local_addr, const struct xcm_attr_map *attrs)
bool xcm_is_blocking(struct xcm_socket *socket)
const char * xcm_local_addr(struct xcm_socket *socket)
struct xcm_socket * xcm_accept(struct xcm_socket *server_socket)
int xcm_finish(struct xcm_socket *socket)
struct xcm_socket * xcm_server(const char *local_addr)
void xcm_cleanup(struct xcm_socket *socket)
int xcm_close(struct xcm_socket *socket)
struct xcm_socket * xcm_accept_a(struct xcm_socket *server_socket, const struct xcm_attr_map *attrs)
struct xcm_socket * xcm_connect(const char *remote_addr, int flags)
int xcm_set_blocking(struct xcm_socket *socket, bool should_block)
struct xcm_socket * xcm_connect_a(const char *remote_addr, const struct xcm_attr_map *attrs)
int xcm_send(struct xcm_socket *__restrict conn_socket, const void *__restrict buf, size_t len)
XCM attribute map API.
Obsolete parts of the XCM API.