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
1223#include <errno.h>
1224#include <stdbool.h>
1225#include <sys/types.h>
1226
1227#include <xcm_attr_map.h>
1228
1230#define XCM_NONBLOCK (1<<0)
1231
1238struct xcm_socket;
1239
1294struct xcm_socket *xcm_connect(const char *remote_addr, int flags);
1295
1317struct xcm_socket *xcm_connect_a(const char *remote_addr,
1318 const struct xcm_attr_map *attrs);
1319
1354struct xcm_socket *xcm_server(const char *local_addr);
1355
1371struct xcm_socket *xcm_server_a(const char *local_addr,
1372 const struct xcm_attr_map *attrs);
1373
1390int xcm_close(struct xcm_socket *socket);
1391
1411void xcm_cleanup(struct xcm_socket *socket);
1412
1435struct xcm_socket *xcm_accept(struct xcm_socket *server_socket);
1436
1453struct xcm_socket *xcm_accept_a(struct xcm_socket *server_socket,
1454 const struct xcm_attr_map *attrs);
1455
1478int xcm_send(struct xcm_socket *conn_socket, const void *buf, size_t len);
1479
1503int xcm_receive(struct xcm_socket *conn_socket, void *buf, size_t capacity);
1504
1507#define XCM_SO_RECEIVABLE (1<<0)
1510#define XCM_SO_SENDABLE (1<<1)
1512#define XCM_SO_ACCEPTABLE (1<<2)
1513
1574int xcm_await(struct xcm_socket *socket, int condition);
1575
1617int xcm_fd(struct xcm_socket *socket);
1618
1659int xcm_finish(struct xcm_socket *socket);
1660
1701int xcm_set_blocking(struct xcm_socket *socket, bool should_block);
1702
1717bool xcm_is_blocking(struct xcm_socket *socket);
1718
1735const char *xcm_remote_addr(struct xcm_socket *conn_socket);
1736
1751const char *xcm_local_addr(struct xcm_socket *socket);
1752
1753#include <xcm_compat.h>
1754
1755#ifdef __cplusplus
1756}
1757#endif
1758#endif
int xcm_receive(struct xcm_socket *conn_socket, void *buf, size_t capacity)
int xcm_await(struct xcm_socket *socket, int condition)
int xcm_fd(struct xcm_socket *socket)
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)
int xcm_send(struct xcm_socket *conn_socket, const void *buf, size_t len)
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)
This file contains the XCM attribute map API.
This file contains obsolete parts of the XCM core API.