quicp2p/quicly/constants.nim

63 lines
2.1 KiB
Nim
Raw Normal View History

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
type
quicly_stream_id_t* {.importc, header: "quicly/constants.h", bycopy.} = int64
quicly_conn_t* {.importc, header: "quicly/constants.h", incompleteStruct.} = object
quicly_stream_callbacks_t* {.importc, header: "quicly.h", bycopy.} = object
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.}
quicly_sender_state_t* {.importc, header: "quicly.h".} = enum
QUICLY_SENDER_STATE_NONE,
QUICLY_SENDER_STATE_SEND,
QUICLY_SENDER_STATE_UNACKED,
QUICLY_SENDER_STATE_ACKED,
StreamSendError* {.bycopy.} = object
sender_state*: quicly_sender_state_t
error_code: uint16
StreamSendPendingLink* {.bycopy.} = object
control*: quicly_linklist_t
default_scheduler*: quicly_linklist_t
StreamSendAux* {.bycopy.} = object
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
StreamRecvAux* {.bycopy.} = object
window*: uint32
max_ranges*: uint32
quicly_stream_t* {.importc, header: "quicly.h", bycopy.} = object
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