libosmocore 1.13.1.1-afb4 Osmocom core library

Functions | Variables
osmo_io_poll.c File Reference

New osmocom async I/O API. More...

`#include "../config.h"`
`#include <errno.h>`
`#include <stdio.h>`
`#include <talloc.h>`
`#include <unistd.h>`
`#include <stdbool.h>`
`#include <sys/socket.h>`
`#include <sys/uio.h>`
`#include <osmocom/core/osmo_io.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/core/select.h>`
`#include <osmocom/core/socket.h>`
`#include <osmocom/core/utils.h>`
`#include "osmo_io_internal.h"`

## Functions
static void | iofd_poll_handle_recv (struct iofd_msghdr *msghdr, int rc)
| completion call-back for READ More...
static void | iofd_poll_ofd_cb_recvmsg_sendmsg (struct osmo_fd *ofd, unsigned int what)
static int | iofd_poll_ofd_cb_dispatch (struct osmo_fd *ofd, unsigned int what)
static int | iofd_poll_register (struct osmo_io_fd *iofd)
static int | iofd_poll_unregister (struct osmo_io_fd *iofd)
static int | iofd_poll_close (struct osmo_io_fd *iofd)
static void | iofd_poll_read_enable (struct osmo_io_fd *iofd)
static void | iofd_poll_read_disable (struct osmo_io_fd *iofd)
static void | iofd_poll_write_enable (struct osmo_io_fd *iofd)
static void | iofd_poll_write_disable (struct osmo_io_fd *iofd)
static void | iofd_poll_notify_connected (struct osmo_io_fd *iofd)

## Variables
const struct iofd_backend_ops | iofd_poll_ops

## Detailed Description

New osmocom async I/O API.

(C) 2022 by Harald Welte lafor.nosp@m.ge@o.nosp@m.smoco.nosp@m.m.or.nosp@m.g (C) 2022-2023 by sysmocom - s.f.m.c. GmbH info@.nosp@m.sysm.nosp@m.ocom..nosp@m.de Author: Daniel Willmann dwill.nosp@m.mann.nosp@m.@sysm.nosp@m.ocom.nosp@m..de

All Rights Reserved.

SPDX-License-Identifier: GPL-2.0+

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

## Function Documentation

## ◆ iofd_poll_close()

static int iofd_poll_close | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_close(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_handle_recv()

static void iofd_poll_handle_recv | ( | struct iofd_msghdr * | msghdr,
|  | int | rc
| ) |  |
| static

completion call-back for READ

References IOFD_FLAG_FD_REGISTERED, IOFD_FLAG_ISSET, iofd_handle_recv(), iofd_msghdr_free(), iofd_msghdr::iov, msg, iofd_msghdr::msg, msgb_free(), msgb_put(), osmo_io_fd::msghdr, osmo_io_fd::ofd, OSMO_FD_READ, osmo_io_fd::poll, osmo_io_fd::u, and osmo_fd::when.

Referenced by iofd_poll_ofd_cb_recvmsg_sendmsg().

## ◆ iofd_poll_notify_connected()

static void iofd_poll_notify_connected | ( | struct osmo_io_fd * | iofd | ) |
| static

References IOFD_FLAG_NOTIFY_CONNECTED, IOFD_FLAG_SET, osmo_io_fd::ofd, osmo_fd_write_enable(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_ofd_cb_dispatch()

static int iofd_poll_ofd_cb_dispatch | ( | struct osmo_fd * | ofd,
|  | unsigned int | what
| ) |  |
| static

References osmo_fd::data, IOFD_FLAG_IN_CALLBACK, IOFD_FLAG_ISSET, IOFD_FLAG_SET, IOFD_FLAG_TO_FREE, IOFD_FLAG_UNSET, iofd_poll_ofd_cb_recvmsg_sendmsg(), and osmo_io_fd::ofd.

Referenced by iofd_poll_register().

## ◆ iofd_poll_ofd_cb_recvmsg_sendmsg()

static void iofd_poll_ofd_cb_recvmsg_sendmsg | ( | struct osmo_fd * | ofd,
|  | unsigned int | what
| ) |  |
| static

References iofd_msghdr::action, osmo_io_fd::cmsg_size, osmo_fd::data, osmo_fd::fd, iofd_msghdr::flags, iofd_msghdr::hdr, iofd_msghdr::io_len, osmo_io_fd::io_ops, iofd_msghdr::iofd, IOFD_ACT_READ, IOFD_ACT_RECVFROM, IOFD_ACT_RECVMSG, IOFD_FLAG_CLOSED, IOFD_FLAG_ISSET, iofd_handle_send_completion(), iofd_msghdr_alloc(), iofd_poll_handle_recv(), iofd_poll_ops, iofd_txqueue_dequeue(), iofd_msghdr::iov, LOGL_ERROR, LOGPIO, osmo_io_fd::mode, iofd_msghdr::msg, msgb_tailroom(), osmo_io_fd::ofd, iofd_msghdr::osa, OSMO_ASSERT, OSMO_FD_READ, OSMO_FD_WRITE, OSMO_IO_FD_MODE_READ_WRITE, OSMO_IO_FD_MODE_RECVFROM_SENDTO, OSMO_IO_FD_MODE_RECVMSG_SENDMSG, osmo_iofd_txqueue_len(), osmo_sockaddr_size(), osmo_sockaddr::sa, osmo_io_ops::sendmsg_cb, osmo_io_ops::sendto_cb, msgb::tail, osmo_sockaddr::u, osmo_io_ops::write_cb, and iofd_backend_ops::write_disable.

Referenced by iofd_poll_ofd_cb_dispatch().

## ◆ iofd_poll_read_disable()

static void iofd_poll_read_disable | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_read_disable(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_read_enable()

static void iofd_poll_read_enable | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_read_enable(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_register()

static int iofd_poll_register | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::fd, IOFD_FLAG_ISSET, IOFD_FLAG_NOTIFY_CONNECTED, iofd_poll_ofd_cb_dispatch(), osmo_io_fd::ofd, osmo_fd_register(), osmo_fd_setup(), osmo_fd_write_enable(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_unregister()

static int iofd_poll_unregister | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_unregister(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_write_disable()

static void iofd_poll_write_disable | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_write_disable(), osmo_io_fd::poll, and osmo_io_fd::u.

## ◆ iofd_poll_write_enable()

static void iofd_poll_write_enable | ( | struct osmo_io_fd * | iofd | ) |
| static

References osmo_io_fd::ofd, osmo_fd_write_enable(), osmo_io_fd::poll, and osmo_io_fd::u.

## Variable Documentation

## ◆ iofd_poll_ops

const struct iofd_backend_ops iofd_poll_ops

Initial value:
= {
.register_fd = iofd_poll_register,
.unregister_fd = iofd_poll_unregister,
.close = iofd_poll_close,
.write_enable = iofd_poll_write_enable,
.write_disable = iofd_poll_write_disable,
.read_enable = iofd_poll_read_enable,
.read_disable = iofd_poll_read_disable,
.notify_connected = iofd_poll_notify_connected,
}
iofd_poll_unregister
static int iofd_poll_unregister(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:220
iofd_poll_read_enable
static void iofd_poll_read_enable(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:233
iofd_poll_write_disable
static void iofd_poll_write_disable(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:248
iofd_poll_write_enable
static void iofd_poll_write_enable(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:243
iofd_poll_notify_connected
static void iofd_poll_notify_connected(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:253
iofd_poll_register
static int iofd_poll_register(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:207
iofd_poll_read_disable
static void iofd_poll_read_disable(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:238
iofd_poll_close
static int iofd_poll_close(struct osmo_io_fd *iofd)
Definition: osmo_io_poll.c:227

Referenced by __attribute__(), and iofd_poll_ofd_cb_recvmsg_sendmsg().