libosmocore 1.10.0
Osmocom core library
|
#include <unistd.h>
#include <stdbool.h>
#include <netinet/sctp.h>
#include <osmocom/core/osmo_io.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/select.h>
#include <osmocom/core/socket.h>
#include "../config.h"
Go to the source code of this file.
Data Structures | |
struct | iofd_backend_ops |
struct | osmo_io_fd |
struct | iofd_msghdr |
serialized version of 'struct msghdr' employed by sendmsg/recvmsg More... | |
Macros | |
#define | OSMO_IO_DEFAULT_MSGB_SIZE 1024 |
#define | OSMO_IO_DEFAULT_MSGB_HEADROOM 128 |
#define | OSMO_IO_BACKEND_DEFAULT "POLL" |
#define | IOFD_FLAG_CLOSED (1<<0) |
#define | IOFD_FLAG_IN_CALLBACK (1<<1) |
#define | IOFD_FLAG_TO_FREE (1<<2) |
#define | IOFD_FLAG_NOTIFY_CONNECTED (1<<3) |
#define | IOFD_FLAG_FD_REGISTERED (1<<4) |
#define | IOFD_FLAG_SET(iofd, flag) |
#define | IOFD_FLAG_UNSET(iofd, flag) |
#define | IOFD_FLAG_ISSET(iofd, flag) |
Enumerations | |
enum | iofd_msg_action { IOFD_ACT_READ , IOFD_ACT_WRITE , IOFD_ACT_RECVFROM , IOFD_ACT_SENDTO , IOFD_ACT_RECVMSG , IOFD_ACT_SENDMSG } |
enum | iofd_seg_act { IOFD_SEG_ACT_HANDLE_ONE , IOFD_SEG_ACT_HANDLE_MORE , IOFD_SEG_ACT_DEFER } |
Functions | |
struct iofd_msghdr * | iofd_msghdr_alloc (struct osmo_io_fd *iofd, enum iofd_msg_action action, struct msgb *msg, size_t cmsg_size) |
Allocate the msghdr. | |
void | iofd_msghdr_free (struct iofd_msghdr *msghdr) |
Free the msghdr. | |
struct msgb * | iofd_msgb_alloc (struct osmo_io_fd *iofd) |
convenience wrapper to call msgb_alloc with parameters from osmo_io_fd | |
struct msgb * | iofd_msgb_pending (struct osmo_io_fd *iofd) |
return the pending msgb in iofd or NULL if there is none | |
struct msgb * | iofd_msgb_pending_or_alloc (struct osmo_io_fd *iofd) |
Return the pending msgb or allocate and return a new one. | |
void | iofd_handle_recv (struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *msghdr) |
completion handler: Internal function called by osmo_io_backend after a given I/O operation has completed | |
void | iofd_handle_send_completion (struct osmo_io_fd *iofd, int rc, struct iofd_msghdr *msghdr) |
completion handler: Internal function called by osmo_io_backend after a given I/O operation has completed | |
void | iofd_handle_segmented_read (struct osmo_io_fd *iofd, struct msgb *msg, int rc) |
Restore message boundaries on read() and pass individual messages to the read callback. | |
int | iofd_txqueue_enqueue (struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr) |
Enqueue a message to be sent. | |
void | iofd_txqueue_enqueue_front (struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr) |
Enqueue a message at the front. | |
struct iofd_msghdr * | iofd_txqueue_dequeue (struct osmo_io_fd *iofd) |
Dequeue a message from the front. | |
Variables | |
const struct iofd_backend_ops | iofd_poll_ops |
#define IOFD_FLAG_CLOSED (1<<0) |
#define IOFD_FLAG_FD_REGISTERED (1<<4) |
Referenced by iofd_poll_register(), and iofd_poll_unregister().
#define IOFD_FLAG_IN_CALLBACK (1<<1) |
Referenced by iofd_poll_ofd_cb_dispatch(), and osmo_iofd_free().
#define IOFD_FLAG_ISSET | ( | iofd, | |
flag ) |
Referenced by iofd_poll_ofd_cb_dispatch(), iofd_poll_ofd_cb_recvmsg_sendmsg(), iofd_poll_register(), iofd_poll_unregister(), iofd_txqueue_enqueue(), iofd_txqueue_enqueue_front(), osmo_iofd_close(), and osmo_iofd_free().
#define IOFD_FLAG_NOTIFY_CONNECTED (1<<3) |
#define IOFD_FLAG_SET | ( | iofd, | |
flag ) |
Referenced by iofd_poll_ofd_cb_dispatch(), iofd_poll_register(), osmo_iofd_close(), osmo_iofd_free(), and osmo_iofd_setup().
#define IOFD_FLAG_TO_FREE (1<<2) |
Referenced by iofd_poll_ofd_cb_dispatch(), and osmo_iofd_free().
#define IOFD_FLAG_UNSET | ( | iofd, | |
flag ) |
Referenced by iofd_poll_ofd_cb_dispatch(), iofd_poll_unregister(), and osmo_iofd_register().
#define OSMO_IO_BACKEND_DEFAULT "POLL" |
Referenced by __attribute__().
#define OSMO_IO_DEFAULT_MSGB_HEADROOM 128 |
Referenced by osmo_iofd_setup().
#define OSMO_IO_DEFAULT_MSGB_SIZE 1024 |
Referenced by osmo_iofd_setup().
enum iofd_msg_action |
enum iofd_seg_act |
|
extern |
Referenced by __attribute__(), and iofd_poll_ofd_cb_recvmsg_sendmsg().