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
1306#include <errno.h>
1307#include <stdbool.h>
1308#include <stddef.h>
1309#include <sys/types.h>
1310#include <xcm_attr_map.h>
1311
1313#define XCM_NONBLOCK (1<<0)
1314
1321struct xcm_socket;
1322
1375struct xcm_socket *xcm_connect(const char *remote_addr, int flags);
1376
1398struct xcm_socket *xcm_connect_a(const char *remote_addr,
1399 const struct xcm_attr_map *attrs);
1400
1436struct xcm_socket *xcm_server(const char *local_addr);
1437
1453struct xcm_socket *xcm_server_a(const char *local_addr,
1454 const struct xcm_attr_map *attrs);
1455
1472int xcm_close(struct xcm_socket *socket);
1473
1493void xcm_cleanup(struct xcm_socket *socket);
1494
1513struct xcm_socket *xcm_accept(struct xcm_socket *server_socket);
1514
1534struct xcm_socket *xcm_accept_a(struct xcm_socket *server_socket,
1535 const struct xcm_attr_map *attrs);
1536
1559int xcm_send(struct xcm_socket *conn_socket, const void *buf, size_t len);
1560
1584int xcm_receive(struct xcm_socket *conn_socket, void *buf, size_t capacity);
1585
1588#define XCM_SO_RECEIVABLE (1<<0)
1591#define XCM_SO_SENDABLE (1<<1)
1593#define XCM_SO_ACCEPTABLE (1<<2)
1594
1655int xcm_await(struct xcm_socket *socket, int condition);
1656
1704int xcm_fd(struct xcm_socket *socket);
1705
1751int xcm_finish(struct xcm_socket *socket);
1752
1793int xcm_set_blocking(struct xcm_socket *socket, bool should_block);
1794
1809bool xcm_is_blocking(struct xcm_socket *socket);
1810
1827const char *xcm_remote_addr(struct xcm_socket *conn_socket);
1828
1843const char *xcm_local_addr(struct xcm_socket *socket);
1844
1845#include <xcm_compat.h>
1846
1847#ifdef __cplusplus
1848}
1849#endif
1850#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.