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
1450#include <errno.h>
1451#include <stdbool.h>
1452#include <stddef.h>
1453#include <sys/types.h>
1454#include <xcm_attr_map.h>
1455
1457#define XCM_NONBLOCK (1<<0)
1458
1465struct xcm_socket;
1466
1519struct xcm_socket *xcm_connect(const char *remote_addr, int flags);
1520
1542struct xcm_socket *xcm_connect_a(const char *remote_addr,
1543 const struct xcm_attr_map *attrs);
1544
1580struct xcm_socket *xcm_server(const char *local_addr);
1581
1597struct xcm_socket *xcm_server_a(const char *local_addr,
1598 const struct xcm_attr_map *attrs);
1599
1615int xcm_close(struct xcm_socket *socket);
1616
1636void xcm_cleanup(struct xcm_socket *socket);
1637
1656struct xcm_socket *xcm_accept(struct xcm_socket *server_socket);
1657
1677struct xcm_socket *xcm_accept_a(struct xcm_socket *server_socket,
1678 const struct xcm_attr_map *attrs);
1679
1702int xcm_send(struct xcm_socket *__restrict conn_socket,
1703 const void *__restrict buf, size_t len);
1704
1728int xcm_receive(struct xcm_socket *__restrict conn_socket,
1729 void *__restrict buf, size_t capacity);
1730
1733#define XCM_SO_RECEIVABLE (1<<0)
1736#define XCM_SO_SENDABLE (1<<1)
1738#define XCM_SO_ACCEPTABLE (1<<2)
1739
1800int xcm_await(struct xcm_socket *socket, int condition);
1801
1849int xcm_fd(struct xcm_socket *socket);
1850
1896int xcm_finish(struct xcm_socket *socket);
1897
1938int xcm_set_blocking(struct xcm_socket *socket, bool should_block);
1939
1954bool xcm_is_blocking(struct xcm_socket *socket);
1955
1972const char *xcm_remote_addr(struct xcm_socket *conn_socket);
1973
1988const char *xcm_local_addr(struct xcm_socket *socket);
1989
1990#include <xcm_compat.h>
1991
1992#ifdef __cplusplus
1993}
1994#endif
1995#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)
This file contains the XCM attribute map API.
This file contains obsolete parts of the XCM core API.