Loading...
Searching...
No Matches
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 <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_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_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(), osmo_io_fd::ofd, and subsys.

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 osmo_io_fd::cmsg_size, osmo_fd::data, osmo_fd::fd, flags, hdr, iofd_msghdr::hdr, osmo_io_fd::io_ops, iofd_msghdr::iofd, IOFD_FLAG_CLOSED, IOFD_FLAG_ISSET, iofd_handle_recv(), iofd_handle_send_completion(), iofd_msgb_pending_or_alloc(), iofd_poll_ops, iofd_txqueue_dequeue(), LOGL_ERROR, LOGPIO, osmo_io_fd::mode, msg, iofd_msghdr::msg, msgb_put(), msgb_tailroom(), osmo_io_fd::ofd, 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_io_ops::sendmsg_cb, osmo_io_ops::sendto_cb, subsys, msgb::tail, 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:160
iofd_poll_read_enable
static void iofd_poll_read_enable(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:173
iofd_poll_write_disable
static void iofd_poll_write_disable(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:188
iofd_poll_write_enable
static void iofd_poll_write_enable(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:183
iofd_poll_notify_connected
static void iofd_poll_notify_connected(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:193
iofd_poll_register
static int iofd_poll_register(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:147
iofd_poll_read_disable
static void iofd_poll_read_disable(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:178
iofd_poll_close
static int iofd_poll_close(struct osmo_io_fd *iofd)
Definition osmo_io_poll.c:167

Referenced by __attribute__(), and iofd_poll_ofd_cb_recvmsg_sendmsg().