libosmocore 1.9.0.105-ca54.202312162026
Osmocom core library
osmo_io_ops Struct Reference

#include <osmo_io.h>

Data Fields

union {
   struct {
      void(*   read_cb )(struct osmo_io_fd *iofd, int
         res, struct msgb *msg)
 call-back function when something was read from fd More...
 
      void(*   write_cb )(struct osmo_io_fd *iofd, int
         res, struct msgb *msg)
 call-back function when write has completed on fd More...
 
      int(*   segmentation_cb )(struct msgb *msg)
 call-back function to segment the data at message boundaries. More...
 
   } 
 
   struct {
      void(*   recvfrom_cb )(struct osmo_io_fd *iofd, int
         res, struct msgb *msg, const
         struct osmo_sockaddr *saddr)
 call-back function emulating recvfrom More...
 
      void(*   sendto_cb )(struct osmo_io_fd *iofd, int
         res, struct msgb *msg, const
         struct osmo_sockaddr *daddr)
 call-back function emulating sendto More...
 
   } 
 
}; 
 

Field Documentation

◆ 

union { ... } osmo_io_ops::@19

◆ read_cb

void(* osmo_io_ops::read_cb) (struct osmo_io_fd *iofd, int res, struct msgb *msg)

call-back function when something was read from fd

◆ recvfrom_cb

void(* osmo_io_ops::recvfrom_cb) (struct osmo_io_fd *iofd, int res, struct msgb *msg, const struct osmo_sockaddr *saddr)

call-back function emulating recvfrom

◆ segmentation_cb

int(* osmo_io_ops::segmentation_cb) (struct msgb *msg)

call-back function to segment the data at message boundaries.

Needs to return the size of the next message. If it returns -EAGAIN or a value larger than msgb_length() (message is incomplete) osmo_io will wait for more data to be read. Other negative values cause the msg to be discarded. If a full message was received (segmentation_cb() returns a value <= msgb_length()) the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any parsing done to the msgb by segmentation_cb() will be preserved for the read_cb() (e.g. setting lxh or msgb->cb).

◆ sendto_cb

void(* osmo_io_ops::sendto_cb) (struct osmo_io_fd *iofd, int res, struct msgb *msg, const struct osmo_sockaddr *daddr)

call-back function emulating sendto

◆ write_cb

void(* osmo_io_ops::write_cb) (struct osmo_io_fd *iofd, int res, struct msgb *msg)

call-back function when write has completed on fd


The documentation for this struct was generated from the following file: