| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This fixes the deallocation of non-initialized IPCP flows. These can
occur when some operations are not implemented.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new flow_join operaiton for broadcast, which is a much
safer solution than overloading destination name semantics. The
internal API now also has a different IPCP_FLOW_JOIN operation. The
IRMd doesn't need to query broadcasts IPCPs for the name, it can just
check if an IPCP with the layer name exists. The broadcast IPCP
doesn't need to implement the query proxy call anymore.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
| |
This moves the creation and destruction of shm_flow_set shared memory
structures from the init to the IRMd. Now the management of all shared
data objects is performed by the IRMd.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
| |
The fccntl call was reading from the RX queue instead of the TX queue.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
| |
This changes the API to the rdrbuff to treat it as a pool memory
allocator. The head and tailspace to allocate in a buffer is now set
system-wide instead of being passed as a parameter.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
| |
This will check if the flow id is valid instead of asserting. It
avoids assertion failures in the IPCP if an application crashes and
the IRMd deallocates the flow while the IPCP still has pending writes.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This initializes libgcrypt before use in the library. This fixes the
"called in non-operational state" error when CRC checking is enabled.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This splits off the CRC from FRCT so it can be set
independently. Ouroboros now allows raw flows with error checking.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
| |
| |
| |
| |
| |
| |
| | |
Renames port_id to flow_id according to updated nomenclature.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This will change SDU (Service Data Unit) to packet everywhere. SDU is
OSI terminology, whereas packet is Ouroboros terminology.
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The flow allocator now passes the full qos specification to the
endpoint, instead of just a cube. This is a more flexible
architecture, as it makes QoS cubes internal to the layers.
Adds endianness transforms for the flow allocator protocol in the
normal IPCP.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This removes configuration from the FRCT protocol to send it during
flow allocation.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the _DEFAULT_SOURCE definition in the endian header as it
should not be there. This avoids double and conflicting definitions.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds rudimentary support for sending and processing
acknowledgments and doing retransmission.
It replaces the generic timerwheel with a specific one for
retransmission. This is currently a fixed wheel allowing
retransmissions to be scheduled up to about 32 seconds into the
future. It currently has an 8ms resolution. This could be made
configurable in the future. Failures of the flow (i.e. rtx not
working) are indicated by the rxmwheel_move() function returning a fd.
This is currently not yet handled (maybe just setting the state of the
flow to FLOWDOWN is a better solution).
The shm_rdrbuff tracks the number of users of a du_buff. One user is
the full stack, each retransmission will increment the refs counter
(which effectively acts as a semaphore). The refs counter is
decremented when a packet is acked. The du_buff is only allowed to be
removed if there is only one user left (the "stack").
When a packet is retransmitted, it is copied in the rdrbuff. This is
to ensure integrity of the packet when multiple layers do
retransmission and it is passed down the stack again.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
| |
This adds the infrastructure to actively react to flow up, down and
deallocated events.
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This will mark flows down when they are finalized.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|/
|
|
|
|
|
|
| |
This adds a data qos cube that is reliable. Reliable qos can be
selected by setting the loss parameter of the qosspec to 0.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
| |
This adds a QoS cube that allows sending packets directly over a raw
flow, without an FRCT state machine. Flow allocation with a NULL
qosspec will now default to such raw flows.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
| |
The reordering queue is replaced by a fixed ring buffer for speed and
simplicity.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
The flow_fini() function was marking flows as wronly (so rdonly for
the application) when the flow was deallocated. With the recent
addition of the flowdown state, we can now mark them as down. Also
fixes some bounds checks and alignment.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
| |
The event type of the current event in the fqueue can now be requested
using the fqueue_type() command. Currently events for packets
(FLOW_PKT), flows (FLOW_UP, FLOW_DOWN) and allocation (FLOW_ALLOC,
FLOW_DEALLOC) are specified. The implementation only tracks FLOW_PKT
at this point.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
If a program exits, it cleans its read buffer. However, another
process could still write a packet in that buffer, which would cause
the IPCP or IRMd to run into an assertion failure on shutdown. Setting
the rbuff to ACL_FLOWDOWN prevents this.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The reg/unreg API is simplified to registering and unregistering a
single name with a single IPCP. The functionality associated with
registering names was moved from the IRMd to the irm tool. The
function to list IPCPs was simplified to return all IPCPs in the
system with their basic properties needed for management.
The above changes led to some needed changes in the irm tool and the
management functions that were depending on the previous behaviour of
list_ipcps.
Command line functionality to list IPCPs in the system is also added
to the irm tool.
Some older code was refactored.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows disabling partial reads. It adds a flag FLOWFRNOPART that
disables partial reads. Partial read is different from partial
delivery (FRCTFPARTIAL), which allows delivery of fragments of an
incomplete packet and thus potentially corrupted data. FLOWFRNOPART
will never deliver corrupted data (unless FRCTFPARTIAL is also set).
If FLOWFRNOPART is set and the buffer provided to flow_read is too
small for the SDU, that SDU will be discarded and -EMSGSIZE is
returned;
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements partial read of packets if the buffer supplied to
flow_read() is smaller than the packet in the buffer. If the number of
bytes returned by flow_read equals the size of the buffer, the next
read() will deliver the next bytes of the packet (or 0 if the packet
was exactly the size of the buffer on the previous read).
Implements #7.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
This completes the implementation of the SNDTIMEO for a blocking
write.
Fixes #6.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
| |
The rbuff uses the PTHREAD_COND_CLOCK for its condition variables, but
the flow_read was passing a time it got from the CLOCK_REALTIME_COARSE
clock. This causes the blocking reads not to timeout correctly.
The oping was updated to detect server timeouts and finish gracefully.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
This adds the FLOWGRXQLEN and FLOWGTXQLEN operations to fccntl to get
the number of packets that are in the receive and transmit buffers
respectively. The flow statistics are updated to show these queue
lengths.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
| |
There was a rdlock() instead of an unlock().
This fixes #3.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
| |
Happy New Year, Ouroboros.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
| |
This refactors ouroboros to use "program" instead of "application
process" and "process" instead of "application process instance" to
align with current naming in current Operating Systems courses instead
of the ISO nomenclature adopted by RINA. This change permeates through
the entire implementation. Also contains some minor other refactors.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
| |
The ipcp will not have the rx_rb set for a pending flow, so it should
not call shm_rbuff_fini. The irmd should not call ipcp_flow_dealloc
for flows that are still pending flow allocation.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
| |
OS X uses a different syntax for specifying ELF sections.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
The library initializers with argc and argv arguments were specified
using the __attribute__((constructor)). This is undefined behaviour as
constructors should have no arguments. This is fixed by passing the
functions to the .init_array.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
| |
Endianness conversion from/to the network for the sequence number was
missing in 68694bc.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the variable FRCT header with a packed struct, which
significantly simplifies the implementation. The shm_du_buff calls to
release the head/tail are updated to return a pointer to the original
head or the new tail (in symmetry to the alloc calls, which return a
pointer to the new head and old tail), so that it immediately points
to the structure that is needed.
The frct_pci sources are removed and frct is now fully in the frct.c
source file.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The frct_pci and rq headers are moved from include/ouroboros to
src/lib since they are only needed in the library. FRCT is moved to
its own source file.
FRCT takes the application PDUs, encapsulates and processes them and
hands them back. This makes it easier to disable FRCT should the
application want to write to a "raw" flow. An FRCT instance is now
allocated upon alloc and released upon dealloc.
The FRCT data structure is split into a sender and receiver connection
record. Setting a new configuration will now be done upon sending the
next data PDU, which will flag the DRF for a new run and use that
configuration. This avoids some issues should packets arrive
out-of-order, and simplifies setting a configuration.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
The FLOWFNONBLOCK flag now has two subflags FLOWFRNOBLOCK and
FLOWFWNOBLOCK which allows setting the behavior of read and write
independently. The default behavior is unchanged (blocking read and
write).
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
This revises the library init script so that it checks whether the
program is run by a python executable (python, python2 or python3) and
announces the script name instead of the python interpreter. This
enables binding python scripts.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|
|
|
|
|
|
|
|
|
| |
If the library init() fails, the fini() call tries to access
unreleased resources. The fix resets the ai struct to 0 if init()
fails and checks a heap pointer for NULL before the fini() accesses
internals.
Signed-off-by: dimitri staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
|
|\
| |
| |
| |
| |
| | |
#626)
Be deprecate ouroboros init fini
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit deprecates ouroboros_init and ouroboros_fini and adds them
as a constructor or destructor, causing these function to be run
automatically when a program that links to the library calls and exits
main(). For this to fully work, the library had to be split so that we
can avoid the irmd calling these functions (the IRMd has to create the
shm structures on which these calls depend).
The library is split in 3 parts: libouroboros-dev, libouroboros-irm
and libouroboros-common. The latter is linked to the other two so that
including libouroboros-dev or libouroboros-irm will also link
libouroboros-common.
|
|/
|
|
|
|
| |
Multi-block support was forgotten during the update of the build
system. This enables it again and fixes some bugs when it is disabled
and larger SDUs are sent.
|
| |
|
|
|
|
|
|
|
|
| |
This adds the flow down event to Ouroboros. In the shim-eth-llc, a
netlink socket is opened which listens to device up/down events. For
each event the flow is then adjusted with fccntl to notify the user
the flow is down or back up again. In the normal IPCP an event is
thrown if a write reports that the flow is down.
|
|
|
|
|
| |
This adds a reordering queue to FRCT so that SDUs can be delivered
in-order when requested.
|
|
|
|
|
| |
This adds a per instance FRCT lock, since it was taking a write lock,
thereby severely impacting parallelism in dev.c
|