QUIC STREAM abstraction (headers)
More...
#include <stdint.h>
#include <glib.h>
#include "buffer.h"
#include "refcount.h"
Go to the source code of this file.
|
| const char * | imquic_stream_state_str (imquic_stream_state state) |
| | Helper function to serialize to string the name of a imquic_stream_state value.
|
| |
| imquic_stream * | imquic_stream_create (uint64_t stream_id, gboolean is_server) |
| | Helper method to create a new stream.
|
| |
| gboolean | imquic_stream_can_send (imquic_stream *stream, uint64_t offset, uint64_t length, gboolean verbose) |
| | Helper method to check whether an endpoint can send data on this stream.
|
| |
| gboolean | imquic_stream_can_receive (imquic_stream *stream, uint64_t offset, uint64_t length, gboolean verbose) |
| | Helper method to check whether an endpoint can receive data on this stream.
|
| |
| gboolean | imquic_stream_mark_complete (imquic_stream *stream, gboolean incoming) |
| | Helper method to mark a stream as complete in one direction.
|
| |
| gboolean | imquic_stream_is_done (imquic_stream *stream) |
| | Helper method to check whether an existing stream is now done.
|
| |
| void | imquic_stream_destroy (imquic_stream *stream) |
| | Helper method to destroy an existing imquic_stream instance.
|
| |
|
| void | imquic_parse_stream_id (uint64_t stream_id, uint64_t *id, gboolean *client_initiated, gboolean *bidirectional) |
| | Parse a QUIC stream ID to its actual ID and its other properties.
|
| |
| uint64_t | imquic_build_stream_id (uint64_t id, gboolean client_initiated, gboolean bidirectional) |
| | Build a QUIC stream ID out of its actual ID and its other properties.
|
| |
QUIC STREAM abstraction (headers)
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- MIT License
Abstraction of QUIC STREAMs, to facilitate the management of client/server unidirectional/bidirectional streams created within the contect of a QUIC connection.
◆ imquic_stream
| typedef struct imquic_stream imquic_stream |
◆ imquic_stream_state
◆ imquic_stream_state
Stream states.
| Enumerator |
|---|
| IMQUIC_STREAM_INACTIVE | Inactive.
|
| IMQUIC_STREAM_READY | Ready.
|
| IMQUIC_STREAM_BLOCKED | Blocked.
|
| IMQUIC_STREAM_RESET | Reset.
|
| IMQUIC_STREAM_COMPLETE | Complete.
|
◆ imquic_build_stream_id()
| uint64_t imquic_build_stream_id |
( |
uint64_t | id, |
|
|
gboolean | client_initiated, |
|
|
gboolean | bidirectional ) |
Build a QUIC stream ID out of its actual ID and its other properties.
- Parameters
-
| [in] | id | The actual client/server uni/bidirectional ID |
| [in] | client_initiated | Whether this stream is client initiated |
| [in] | bidirectional | Whether this stream is bidirectional |
- Returns
- The QUIC stream ID
◆ imquic_parse_stream_id()
| void imquic_parse_stream_id |
( |
uint64_t | stream_id, |
|
|
uint64_t * | id, |
|
|
gboolean * | client_initiated, |
|
|
gboolean * | bidirectional ) |
Parse a QUIC stream ID to its actual ID and its other properties.
- Parameters
-
| [in] | stream_id | The QUIC stream ID to parse |
| [out] | id | The actual client/server uni/bidirectional ID |
| [out] | client_initiated | Whether this stream is client initiated |
| [out] | bidirectional | Whether this stream is bidirectional |
◆ imquic_stream_can_receive()
| gboolean imquic_stream_can_receive |
( |
imquic_stream * | stream, |
|
|
uint64_t | offset, |
|
|
uint64_t | length, |
|
|
gboolean | verbose ) |
Helper method to check whether an endpoint can receive data on this stream.
- Note
- This checks characteristics of the stream (e.g., client-originated, bidirectional, etc.), the stream state, and whether a stream is complete
- Parameters
-
| stream | The imquic_stream instance to check |
| offset | Offset in the stream from where the new data would be received |
| length | Length of the data that would be received |
| verbose | Whether details on the checks should be logged in a verbose way with warnings |
- Returns
- TRUE if data can be received, FALSE otherwise
◆ imquic_stream_can_send()
| gboolean imquic_stream_can_send |
( |
imquic_stream * | stream, |
|
|
uint64_t | offset, |
|
|
uint64_t | length, |
|
|
gboolean | verbose ) |
Helper method to check whether an endpoint can send data on this stream.
- Note
- This checks characteristics of the stream (e.g., client-originated, bidirectional, etc.), the stream state, and whether a stream is complete
- Parameters
-
| stream | The imquic_stream instance to check |
| offset | Offset in the stream from where the new data would be sent |
| length | Length of the data that would be sent |
| verbose | Whether details on the checks should be logged in a verbose way with warnings |
- Returns
- TRUE if data can be sent, FALSE otherwise
◆ imquic_stream_create()
| imquic_stream * imquic_stream_create |
( |
uint64_t | stream_id, |
|
|
gboolean | is_server ) |
Helper method to create a new stream.
- Parameters
-
| stream_id | The stream ID |
| is_server | Whether the endpoint this stream is added to is a server |
- Returns
- A pointer to a new imquic_stream instance, if successful, or NULL otherwise
◆ imquic_stream_destroy()
Helper method to destroy an existing imquic_stream instance.
- Parameters
-
◆ imquic_stream_is_done()
Helper method to check whether an existing stream is now done.
- Parameters
-
- Returns
- TRUE if the stream is now done, FALSE otherwise
◆ imquic_stream_mark_complete()
| gboolean imquic_stream_mark_complete |
( |
imquic_stream * | stream, |
|
|
gboolean | incoming ) |
Helper method to mark a stream as complete in one direction.
- Note
- This may end up marking the stream as complete in general, depending on the stream state or the unidirectional nature of the stream
- Parameters
-
| stream | The imquic_stream instance to update |
| incoming | Whether the stream is now complete on the way in or on the way out |
- Returns
- TRUE in case of success, or FALSE otherwise
◆ imquic_stream_state_str()
Helper function to serialize to string the name of a imquic_stream_state value.
- Parameters
-
| state | The imquic_stream_state value |
- Returns
- The state name as a string, if valid, or NULL otherwise