2020-11-02 00:52:13 +01:00
|
|
|
from linklist import quicly_linklist_t
|
|
|
|
from maxsender import quicly_maxsender_t
|
|
|
|
|
|
|
|
from recvstate import
|
|
|
|
quicly_recvstate_t,
|
|
|
|
quicly_recvstate_transfer_complete
|
|
|
|
|
|
|
|
from sendstate import
|
|
|
|
quicly_sendstate_t,
|
|
|
|
quicly_sendstate_is_open
|
|
|
|
|
2020-11-07 11:05:57 +01:00
|
|
|
const QUICLY_ERROR_FREE_CONNECTION* = 0xff03
|
|
|
|
|
2020-11-02 00:52:13 +01:00
|
|
|
type
|
2020-11-07 11:42:11 +01:00
|
|
|
quicly_stream_id_t* {.importc, header: "quicly/constants.h", bycopy.} = int64
|
2020-11-02 00:52:13 +01:00
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
quicly_conn_t* {.bycopy, header: "quicly/constants.h", incompleteStruct.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
# quicly.h definitions moved here to resolve recursive dependency
|
|
|
|
quicly_stream_callbacks_t* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
on_destroy*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.}
|
|
|
|
on_send_shift*: proc(stream: ptr quicly_stream_t, delta: csize_t) {.cdecl.}
|
|
|
|
on_send_emit*: proc(stream: ptr quicly_stream_t, off: csize_t, dst: pointer,
|
|
|
|
len: csize_t, wrote_all: cint) {.cdecl.}
|
|
|
|
on_send_stop*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.}
|
|
|
|
on_receive*: proc(stream: ptr quicly_stream_t, off: csize_t, src: pointer,
|
|
|
|
len: csize_t) {.cdecl.}
|
|
|
|
on_receive_reset*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.}
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
quicly_sender_state_t* {.importc, header: "quicly.h", bycopy.} = enum
|
2020-11-02 00:52:13 +01:00
|
|
|
QUICLY_SENDER_STATE_NONE,
|
|
|
|
QUICLY_SENDER_STATE_SEND,
|
|
|
|
QUICLY_SENDER_STATE_UNACKED,
|
|
|
|
QUICLY_SENDER_STATE_ACKED,
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
StreamSendError* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
sender_state*: quicly_sender_state_t
|
|
|
|
error_code: uint16
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
StreamSendPendingLink* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
control*: quicly_linklist_t
|
|
|
|
default_scheduler*: quicly_linklist_t
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
StreamSendAux* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
max_stream_data*: uint64
|
|
|
|
stop_sending*: StreamSendError
|
|
|
|
reset_stream*: StreamSendError
|
|
|
|
max_stream_data_sender*: quicly_maxsender_t
|
|
|
|
blocked*: quicly_sender_state_t
|
|
|
|
pending_link*: StreamSendPendingLink
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
StreamRecvAux* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
window*: uint32
|
|
|
|
max_ranges*: uint32
|
|
|
|
|
2020-11-07 11:42:11 +01:00
|
|
|
quicly_stream_t* {.importc, header: "quicly.h", bycopy.} = object
|
2020-11-02 00:52:13 +01:00
|
|
|
conn*: ptr quicly_conn_t
|
|
|
|
stream_id*: quicly_stream_id_t
|
|
|
|
callbacks*: ptr quicly_stream_callbacks_t
|
|
|
|
sendstate*: quicly_sendstate_t
|
|
|
|
recvstate*: quicly_recvstate_t
|
|
|
|
data*: pointer
|
|
|
|
streams_blocked* {.bitsize: 1.}: cuint
|
|
|
|
send_aux*: StreamSendAux
|
|
|
|
recv_aux*: StreamRecvAux
|