FLOW_ALLOC

Section: Ouroboros Programmer's Manual (3)
Updated: 2018-10-05
Index Return to wiki

 

NAME

flow_accept, flow_alloc, flow_dealloc - allocate and free resources to support Inter-Process Communication

 

SYNOPSIS

#include <ouroboros/dev.h>

int flow_accept(qosspec_t * qs, const struct timespec * timeo);

int flow_alloc(const char * dst_name, qosspec_t * qs, const struct timespec * timeo);

int flow_join(const char * dst_name, qosspec_t * qs, const struct timespec * timeo);

int flow_dealloc(int fd);

Compile and link with -louroboros-dev.

 

DESCRIPTION

These calls are used to allocate and free system and network resources to support Inter-Process Communication (IPC). Such a collection of allocated system and network resources is referred to as a flow. A flow has a certain Quality of Service (QoS) associated with it.

The flow_accept() function blocks the calling thread waiting for an incoming request to allocate a flow. If qosspec_t * qs is not NULL, the value of qs will be updated to reflect the actual QoS provided by the IPC facility for the accepted flow. Which flows this process will accept is configured through the IRMd. For an explanation on configuring which flows an application should accept, see irm(8).

The flow_alloc() function requests to allocate system and/or network resources to support Inter-Process Communication between the calling application and one or more processes accepting flows for char * dst_name, which cannot be NULL. The flow_alloc() call can specify a certain minimum qosspec_t * qs that has to be guaranteed by the IPC facility allocating the resources. This can be NULL if there is no QoS to be guaranteed (best effort service). If qs is not NULL, the value of qs will be updated to reflect the actual QoS provided by the IPC facility.

The flow_accept() and flow_alloc() take a const struct timespec * timeo to specify a timeout. If timeo is NULL, the call will block indefinitely or until some error condition occurs.

The flow_join() function allows applications to join a broadcast flow provided by a broadcast layer. The dst is the layer name.

The flow_dealloc() function will release any resources associated with the flow. This call may block and keep reliable flows active until all packets are acknowledged.

A qosspec_t specifies the following QoS characteristics of a flow:

TODO: specify a qosspec_t

 

RETURN VALUE

On success, flow_accept() and flow_alloc() calls return a non-negative integer, referred to as a flow descriptor. On failure, a negative value indicating the error will be returned.

 

ERRORS

flow_accept(), flow_alloc() and flow_dealloc() can return the following errors:

-EINVAL An invalid argument was passed.

-EIRMD Failed to contact an IRMd instance.

flow_accept() and flow_alloc() can also return

-EBADF No more flow desciptors or flow_ids available.

-ENOMEM Not enough system memory resources available to allocate the flow.

-ETIMEDOUT Flow allocation timed out.

-ECRYPT The requested encryption is not supported.

 

ATTRIBUTES

For an explanation of the terms used in this section, see attributes(7).

Interface Attribute Value

flow_accept() Thread safety MT-Safe

flow_alloc() Thread safety MT-Safe

flow_join() Thread safety MT-Safe

flow_dealloc() Thread safety MT-Safe

 

TERMINOLOGY

Please see ouroboros-glossary(7).

 

SEE ALSO

fccntl(3), flow_read(3), fqueue(3), fset(3), ouroboros(8)

 

COLOPHON

This page is part of the Ouroboros project, found at http://ouroboros.rocks

These man pages are licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
ATTRIBUTES
TERMINOLOGY
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 07:31:44 GMT, August 02, 2024