Loading...
Searching...
No Matches
stream.h
Go to the documentation of this file.
1
12#ifndef IMQUIC_STREAM_H
13#define IMQUIC_STREAM_H
14
15#include <stdint.h>
16
17#include <glib.h>
18
19#include "buffer.h"
20#include "refcount.h"
21
39
68imquic_stream *imquic_stream_create(uint64_t stream_id, gboolean is_server);
77gboolean imquic_stream_can_send(imquic_stream *stream, uint64_t offset, uint64_t length, gboolean verbose);
86gboolean imquic_stream_can_receive(imquic_stream *stream, uint64_t offset, uint64_t length, gboolean verbose);
93gboolean imquic_stream_mark_complete(imquic_stream *stream, gboolean incoming);
97gboolean imquic_stream_is_done(imquic_stream *stream);
101
105
110void imquic_parse_stream_id(uint64_t stream_id, uint64_t *id, gboolean *client_initiated, gboolean *bidirectional);
116uint64_t imquic_build_stream_id(uint64_t id, gboolean client_initiated, gboolean bidirectional);
118
119#endif
Buffer abstraction (headers)
GMutex imquic_mutex
imquic mutex implementation
Definition mutex.h:18
Reference counter mechanism.
struct imquic_stream imquic_stream
QUIC stream.
imquic_stream_state
Stream states.
Definition stream.h:23
@ IMQUIC_STREAM_BLOCKED
Blocked.
Definition stream.h:29
@ IMQUIC_STREAM_INACTIVE
Inactive.
Definition stream.h:25
@ IMQUIC_STREAM_COMPLETE
Complete.
Definition stream.h:33
@ IMQUIC_STREAM_READY
Ready.
Definition stream.h:27
@ IMQUIC_STREAM_RESET
Reset.
Definition stream.h:31
gboolean imquic_stream_is_done(imquic_stream *stream)
Helper method to check whether an existing stream is now done.
Definition stream.c:123
gboolean imquic_stream_mark_complete(imquic_stream *stream, gboolean incoming)
Helper method to mark a stream as complete in one direction.
Definition stream.c:101
imquic_stream * imquic_stream_create(uint64_t stream_id, gboolean is_server)
Helper method to create a new stream.
Definition stream.c:40
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.
Definition stream.c:80
void imquic_stream_destroy(imquic_stream *stream)
Helper method to destroy an existing imquic_stream instance.
Definition stream.c:134
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.
Definition stream.c:140
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.
Definition stream.c:147
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.
Definition stream.c:59
const char * imquic_stream_state_str(imquic_stream_state state)
Helper function to serialize to string the name of a imquic_stream_state value.
Definition stream.c:15
Buffer made of multiple chunks (possibly with gaps)
Definition buffer.h:35
Definition refcount.h:77
QUIC stream.
Definition stream.h:41
gboolean can_send
Whether the stream can send and receive data.
Definition stream.h:47
imquic_buffer * in_data
Incoming and outgoing buffers.
Definition stream.h:56
uint64_t stream_id
Stream ID and actual ID.
Definition stream.h:43
imquic_stream_state in_state
Stream incoming and outgoing state.
Definition stream.h:51
gboolean bidirectional
Definition stream.h:45
size_t skip_out
Definition stream.h:54
imquic_refcount ref
Reference counter.
Definition stream.h:62
imquic_buffer * out_data
Definition stream.h:56
imquic_mutex mutex
Mutex.
Definition stream.h:58
imquic_stream_state out_state
Definition stream.h:51
volatile gint destroyed
Whether this instance has been destroyed (reference counting)
Definition stream.h:60
size_t skip_in
Number of bytes to skip, when dealing with offsets (e.g., to hide the shifted offsets when a protocol...
Definition stream.h:54
uint64_t out_finalsize
Definition stream.h:49
gboolean can_receive
Definition stream.h:47
uint64_t in_finalsize
Stream incoming and outgoing final size (for flow control)
Definition stream.h:49
uint64_t actual_id
Definition stream.h:43
gboolean client_initiated
Whether the stream is client or server originated, and bidirectional or unidirectional.
Definition stream.h:45