use header pragma again (needed for using inline functions)
This commit is contained in:
parent
1e290ac350
commit
7923bd96ab
|
@ -10,27 +10,27 @@ from picotls import
|
|||
ptls_verify_certificate_t
|
||||
|
||||
type
|
||||
ptls_openssl_signature_scheme_t* {.bycopy.} = object
|
||||
ptls_openssl_signature_scheme_t* {.importc: "struct st_ptls_openssl_signature_scheme_t", header: "picotls/openssl.h", bycopy.} = object
|
||||
scheme_id*: uint16
|
||||
scheme_md*: PEVP_MD
|
||||
|
||||
ptls_openssl_sign_certificate_t* {.bycopy.} = object
|
||||
ptls_openssl_sign_certificate_t* {.importc, header: "picotls/openssl.h", bycopy.} = object
|
||||
super*: ptls_sign_certificate_t
|
||||
key*: EVP_PKEY
|
||||
schemes*: array[4, ptls_openssl_signature_scheme_t]
|
||||
|
||||
ptls_openssl_verify_certificate_t* {.bycopy.} = object
|
||||
ptls_openssl_verify_certificate_t* {.importc, header: "picotls/openssl.h", bycopy.} = object
|
||||
super*: ptls_verify_certificate_t
|
||||
cert_store*: PX509_STORE
|
||||
|
||||
proc ptls_openssl_random_bytes*(buf: pointer, len: csize_t) {.cdecl, importc.}
|
||||
proc ptls_openssl_random_bytes*(buf: pointer, len: csize_t) {.importc, header: "picotls/openssl.h", cdecl.}
|
||||
|
||||
proc ptls_openssl_init_verifiy_certificate*(self: ptr ptls_openssl_verify_certificate_t,
|
||||
store: PX509_STORE): cint {.cdecl, importc.}
|
||||
store: PX509_STORE): cint {.importc, header: "picotls/openssl.h", cdecl.}
|
||||
|
||||
proc ptls_openssl_init_sign_certificate*(self: ptr ptls_openssl_sign_certificate_t,
|
||||
key: EVP_PKEY): cint {.cdecl, importc.}
|
||||
key: EVP_PKEY): cint {.importc, header: "picotls/openssl.h", cdecl.}
|
||||
|
||||
var ptls_openssl_cipher_suites* {.importc.}: ptr ptr ptls_cipher_suite_t
|
||||
var ptls_openssl_cipher_suites* {.importc, header: "picotls/openssl.h".}: ptr ptr ptls_cipher_suite_t
|
||||
|
||||
var ptls_openssl_key_exchanges* {.importc.}: ptr ptr ptls_key_exchange_algorithm_t
|
||||
var ptls_openssl_key_exchanges* {.importc, header: "picotls/openssl.h".}: ptr ptr ptls_key_exchange_algorithm_t
|
||||
|
|
|
@ -5,7 +5,7 @@ type
|
|||
list*: ptr T
|
||||
count*: csize_t
|
||||
|
||||
ptls_cipher_algorithm_t* {.bycopy.} = object
|
||||
ptls_cipher_algorithm_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
name*: cstring
|
||||
key_size*: csize_t
|
||||
block_size*: csize_t
|
||||
|
@ -14,7 +14,7 @@ type
|
|||
setup_crypto*: proc(ctx: ptr ptls_cipher_context_t, is_enc: cint,
|
||||
key: pointer): cint {.cdecl.}
|
||||
|
||||
ptls_aead_algorithm_t* {.bycopy.} = object
|
||||
ptls_aead_algorithm_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
name*: cstring
|
||||
confidentiality_limit*: uint64
|
||||
integrity_limit*: uint64
|
||||
|
@ -27,12 +27,12 @@ type
|
|||
setup_crypto*: proc(ctx: ptr ptls_aead_context_t, is_enc: cint,
|
||||
key: pointer, iv: pointer): cint {.cdecl.}
|
||||
|
||||
ptls_hash_final_mode_t* {.bycopy.} = enum
|
||||
ptls_hash_final_mode_t* {.importc, header: "picotls.h", bycopy.} = enum
|
||||
PTLS_HASH_FINAL_MODE_FREE = 0,
|
||||
PTLS_HASH_FINAL_MODE_RESET = 1,
|
||||
PTLS_HASH_FINAL_MODE_SNAPSHOT = 2
|
||||
|
||||
ptls_hash_context_t* {.bycopy.} = object
|
||||
ptls_hash_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
update*: proc(ctx: ptr ptls_hash_context_t, src: pointer, len: csize_t)
|
||||
{.cdecl.}
|
||||
final*: proc(ctx: ptr ptls_hash_context_t, md: pointer,
|
||||
|
@ -40,13 +40,13 @@ type
|
|||
clone*: proc(src: ptr ptls_hash_context_t): ptr ptls_hash_context_t
|
||||
{.cdecl.}
|
||||
|
||||
ptls_hash_algorithm_t* {.bycopy.} = object
|
||||
ptls_hash_algorithm_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
block_size*: csize_t
|
||||
digest_size*: csize_t
|
||||
create*: proc(): ptr ptls_hash_context_t {.cdecl.}
|
||||
empty_digest*: array[PTLS_MAX_DIGEST_SIZE, uint8]
|
||||
|
||||
ptls_cipher_suite_t* {.bycopy.} = object
|
||||
ptls_cipher_suite_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
id*: uint16
|
||||
aead*: ptr ptls_aead_algorithm_t
|
||||
hash*: ptr ptls_hash_algorithm_t
|
||||
|
@ -58,9 +58,9 @@ type
|
|||
VerifySignCb* = proc(verify_ctx: pointer, data: ptls_iovec_t,
|
||||
sign: ptls_iovec_t): cint {.cdecl.}
|
||||
|
||||
ptls_t* {.bycopy.} = object
|
||||
ptls_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
|
||||
ptls_key_exchange_algorithm_t* {.bycopy.} = object
|
||||
ptls_key_exchange_algorithm_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
id*: uint16
|
||||
create*: proc(algo: ptr ptls_key_exchange_algorithm_t,
|
||||
ctx: ptr ptr ptls_key_exchange_context_t): cint {.cdecl.}
|
||||
|
@ -69,14 +69,14 @@ type
|
|||
{.cdecl.}
|
||||
data*: pointer
|
||||
|
||||
ptls_key_exchange_context_t* {.bycopy.} = object
|
||||
ptls_key_exchange_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
algo*: ptr ptls_key_exchange_algorithm_t
|
||||
pubkey*: ptls_iovec_t
|
||||
on_exchange*: proc(keyex: ptr ptr ptls_key_exchange_context_t, release: cint,
|
||||
secret: ptr ptls_iovec_t, peerkey: ptls_iovec_t): cint
|
||||
{.cdecl.}
|
||||
|
||||
ptls_esni_context_t* {.bycopy.} = object
|
||||
ptls_esni_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
key_exchanges*: ptr ptr ptls_key_exchange_context_t
|
||||
cipher_suites*: ptr CipherSuiteListElem
|
||||
padded_length*: uint16
|
||||
|
@ -84,11 +84,11 @@ type
|
|||
not_after*: uint64
|
||||
version*: uint16
|
||||
|
||||
ptls_iovec_t* {.bycopy.} = object
|
||||
ptls_iovec_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
base*: ptr uint8
|
||||
len*: csize_t
|
||||
|
||||
ptls_on_client_hello_parameters_t* {.bycopy.} = object
|
||||
ptls_on_client_hello_parameters_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
server_name*: ptls_iovec_t
|
||||
raw_message*: ptls_iovec_t
|
||||
negotiated_protocols*: List[ptls_iovec_t]
|
||||
|
@ -98,83 +98,83 @@ type
|
|||
esni* {.bitsize: 1.}: cuint
|
||||
incompatible_version* {.bitsize: 1.}: cuint
|
||||
|
||||
ptls_traffic_protection_t* {.bycopy, incompleteStruct.} = object
|
||||
ptls_traffic_protection_t* {.importc, header: "picotls.h", incompleteStruct.} = object
|
||||
|
||||
ptls_message_emitter_t* {.bycopy.} = object
|
||||
ptls_message_emitter_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
buf*: ptr ptls_buffer_t
|
||||
enc*: ptr ptls_traffic_protection_t
|
||||
record_header_length*: csize_t
|
||||
begin_message*: proc (self: ptr ptls_message_emitter_t): cint {.cdecl.}
|
||||
commit_message*: proc (self: ptr ptls_message_emitter_t): cint {.cdecl.}
|
||||
|
||||
ptls_key_schedule_t* {.bycopy.} = object
|
||||
ptls_key_schedule_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
|
||||
ptls_buffer_t* {.bycopy.} = object
|
||||
ptls_buffer_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
base*: uint8
|
||||
capacity*: csize_t
|
||||
off*: csize_t
|
||||
is_allocated*: cint
|
||||
|
||||
ptls_get_time_t* {.bycopy.} = object
|
||||
ptls_get_time_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_get_time_t): uint64 {.cdecl.}
|
||||
|
||||
ptls_on_client_hello_t* {.bycopy.} = object
|
||||
ptls_on_client_hello_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_on_client_hello_t, tls: ptr ptls_t,
|
||||
params: ptr ptls_on_client_hello_parameters_t): cint {.cdecl.}
|
||||
|
||||
ptls_emit_certificate_t* {.bycopy.} = object
|
||||
ptls_emit_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_emit_certificate_t, tls: ptr ptls_t,
|
||||
emitter: ptr ptls_message_emitter_t,
|
||||
key_sched: ptr ptls_key_schedule_t, context: ptls_iovec_t,
|
||||
push_status_request: cint, compress_algos: uint16,
|
||||
num_compress_algos: csize_t): cint {.cdecl.}
|
||||
|
||||
ptls_sign_certificate_t* {.bycopy.} = object
|
||||
ptls_sign_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_sign_certificate_t, tls: ptr ptls_t,
|
||||
selected_algorithm: uint16, output: ptr ptls_buffer_t,
|
||||
input: ptls_iovec_t, algorithms: uint16,
|
||||
num_algorithms: csize_t): cint {.cdecl.}
|
||||
|
||||
ptls_verify_certificate_t* {.bycopy.} = object
|
||||
ptls_verify_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_verify_certificate_t, tls: ptr ptls_t,
|
||||
verify_sign: ptr VerifySignCb, verify_data: ptr pointer,
|
||||
certs: ptls_iovec_t, numCerts: csize_t): cint {.cdecl.}
|
||||
|
||||
ptls_encrypt_ticket_t* {.bycopy.} = object
|
||||
ptls_encrypt_ticket_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_encrypt_ticket_t, tls: ptr ptls_t, is_encrypt: cint,
|
||||
dst: ptr ptls_buffer_t, src: ptls_iovec_t): cint {.cdecl.}
|
||||
|
||||
ptls_save_ticket_t* {.bycopy.} = object
|
||||
ptls_save_ticket_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_save_ticket_t, tls: ptr ptls_t, input: ptls_iovec_t):
|
||||
cint {.cdecl.}
|
||||
|
||||
ptls_log_event_t* {.bycopy.} = object
|
||||
ptls_log_event_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_log_event_t, tls: ptr ptls_t, `type`: cstring,
|
||||
fmt: cstring) {.cdecl, varargs.}
|
||||
|
||||
ptls_update_open_count_t* {.bycopy.} = object
|
||||
ptls_update_open_count_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_update_open_count_t, delta: BiggestInt) {.cdecl.}
|
||||
|
||||
ptls_update_traffic_key_t* {.bycopy.} = object
|
||||
ptls_update_traffic_key_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_update_traffic_key_t, tls: ptr ptls_t, is_enc: cint,
|
||||
epoch: csize_t, secret: pointer): cint {.cdecl.}
|
||||
|
||||
ptls_decompress_certificate_t* {.bycopy.} = object
|
||||
ptls_decompress_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
supported_algorithms*: uint16
|
||||
cb: proc(self: ptr ptls_decompress_certificate_t, tls: ptr ptls_t,
|
||||
algorithm: uint16, output: ptls_iovec_t, input: ptls_iovec_t): cint
|
||||
{.cdecl.}
|
||||
|
||||
ptls_update_esni_key_t* {.bycopy.} = object
|
||||
ptls_update_esni_key_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_update_esni_key_t, tls: ptr ptls_t, secret: ptls_iovec_t,
|
||||
hash: ptls_hash_algorithm_t, hashed_esni_contents: pointer): cint
|
||||
{.cdecl.}
|
||||
|
||||
ptls_on_extension_t* {.bycopy.} = object
|
||||
ptls_on_extension_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
cb: proc(self: ptr ptls_on_extension_t, tls: ptr ptls_t, hstype: uint8,
|
||||
exttype: uint16, extdata: ptls_iovec_t): cint {.cdecl.}
|
||||
|
||||
ptls_context_t* {.bycopy.} = object
|
||||
ptls_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
random_bytes*: proc (buf: pointer, len: csize_t) {.cdecl.}
|
||||
get_time*: ptr ptls_get_time_t
|
||||
key_exchanges*: ptr ptr ptls_key_exchange_algorithm_t
|
||||
|
@ -203,19 +203,19 @@ type
|
|||
update_esni_key*: ptr ptls_update_esni_key_t
|
||||
on_extension*: ptr ptls_on_extension_t
|
||||
|
||||
ptls_cipher_context_t* {.bycopy.} = object
|
||||
ptls_cipher_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
algo*: ptr ptls_cipher_algorithm_t
|
||||
do_dispose*: proc(ctx: ptr ptls_cipher_context_t) {.cdecl.}
|
||||
do_init*: proc(ctx: ptr ptls_cipher_context_t, iv: pointer) {.cdecl.}
|
||||
do_transform*: proc(ctx: ptr ptls_cipher_context_t, output: pointer,
|
||||
input: pointer, len: csize_t) {.cdecl.}
|
||||
|
||||
ptls_aead_supplementary_encryption_t* {.bycopy.} = object
|
||||
ptls_aead_supplementary_encryption_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
ctx*: ptr ptls_cipher_context_t
|
||||
input*: pointer
|
||||
output*: array[16, uint8]
|
||||
|
||||
ptls_aead_context_t* {.bycopy.} = object
|
||||
ptls_aead_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
algo*: ptr ptls_aead_algorithm_t
|
||||
dispose_crypto*: proc(ctx: ptr ptls_aead_context_t) {.cdecl.}
|
||||
do_encrypt_init*: proc(ctx: ptr ptls_aead_context_t, seq: uint64,
|
||||
|
@ -229,7 +229,7 @@ type
|
|||
aadlen: csize_t,
|
||||
supp: ptr ptls_aead_supplementary_encryption_t) {.cdecl.}
|
||||
|
||||
ClientProperties* {.bycopy.} = object
|
||||
ClientProperties* {.importc, header: "picotls.h", bycopy.} = object
|
||||
negotiated_protocols*: List[ptls_iovec_t]
|
||||
session_ticket*: ptls_iovec_t
|
||||
max_early_data_size*: ptr csize_t
|
||||
|
@ -237,15 +237,15 @@ type
|
|||
negotiate_before_key_exchange* {.bitsize: 1.}: cuint
|
||||
esni_keys*: ptls_iovec_t
|
||||
|
||||
PskBinder* {.bycopy.} = object
|
||||
PskBinder* {.importc, header: "picotls.h", bycopy.} = object
|
||||
base*: array[64, uint8]
|
||||
len*: csize_t
|
||||
|
||||
Cookie* {.bycopy.} = object
|
||||
Cookie* {.importc, header: "picotls.h", bycopy.} = object
|
||||
key*: pointer
|
||||
additional_data*: ptls_iovec_t
|
||||
|
||||
ServerProperties* {.bycopy.} = object
|
||||
ServerProperties* {.importc, header: "picotls.h", bycopy.} = object
|
||||
selected_psk_binder*: PskBinder
|
||||
cookie*: Cookie
|
||||
enforce_retry* {.bitsize: 1.}: cuint
|
||||
|
@ -255,16 +255,16 @@ type
|
|||
client*: ClientProperties
|
||||
server*: ServerProperties
|
||||
|
||||
ptls_raw_extension_t* {.bycopy.} = object
|
||||
ptls_raw_extension_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
`type`*: uint16
|
||||
data*: ptls_iovec_t
|
||||
|
||||
ptls_early_data_acceptance_t* {.bycopy.} = enum
|
||||
ptls_early_data_acceptance_t* {.importc, header: "picotls.h", bycopy.} = enum
|
||||
PTLS_EARLY_DATA_ACCEPTANCE_UNKNOWN = 0,
|
||||
PTLS_EARLY_DATA_REJECTED,
|
||||
PTLS_EARLY_DATA_ACCEPTED
|
||||
|
||||
ptls_handshake_properties_t* {.bycopy.} = object
|
||||
ptls_handshake_properties_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||
properties*: ClientOrServer
|
||||
additional_extensions*: ptr ptls_raw_extension_t
|
||||
collect_extension*: proc (tls: ptr ptls_t;
|
||||
|
@ -274,9 +274,9 @@ type
|
|||
properties: ptr ptls_handshake_properties_t;
|
||||
extensions: ptr ptls_raw_extension_t): cint {.cdecl.}
|
||||
|
||||
var ptls_get_time* {.importc.}: ptls_get_time_t
|
||||
var ptls_get_time* {.importc, header: "picotls.h".}: ptls_get_time_t
|
||||
|
||||
proc ptls_iovec_init*(p: pointer, len: csize_t): ptls_iovec_t {.cdecl, importc.}
|
||||
proc ptls_iovec_init*(p: pointer, len: csize_t): ptls_iovec_t {.importc, header: "picotls.h", cdecl.}
|
||||
|
||||
proc ptls_load_certificates*(ctx: ptr ptls_context_t, cert_pem_file: cstring):
|
||||
cint {.cdecl, importc.}
|
||||
cint {.importc, header: "picotls.h", cdecl.}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type
|
||||
quicly_cc_t* {.bycopy.} = enum
|
||||
quicly_cc_t* {.importc, header: "quicly/cc.h", bycopy.} = enum
|
||||
CC_RENO_MODIFIED,
|
||||
#CUBIC (RFC 8312)
|
||||
CC_CUBIC
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
type
|
||||
quicly_cid_t* {.bycopy.} = object
|
||||
quicly_cid_t* {.importc, header: "quicly/cid.h", bycopy.} = object
|
||||
cid*: array[20, uint8]
|
||||
len*: uint8
|
||||
|
||||
quicly_cid_plaintext_t* {.bycopy.} = object
|
||||
quicly_cid_plaintext_t* {.importc, header: "quicly/cid.h", bycopy.} = object
|
||||
master_id*: uint32
|
||||
path_id* {.bitsize: 8.}: uint32
|
||||
thread_id* {.bitsize: 24.}: uint32
|
||||
node_id*: uint64
|
||||
|
||||
quicly_cid_encryptor_t* {.bycopy.} = object
|
||||
quicly_cid_encryptor_t* {.importc, header: "quicly/cid.h", bycopy.} = object
|
||||
encrypt_cid*: proc (self: ptr quicly_cid_encryptor_t;
|
||||
encrypted: ptr quicly_cid_t; stateless_reset_token: pointer;
|
||||
plaintext: ptr quicly_cid_plaintext_t) {.cdecl.}
|
||||
|
|
|
@ -12,11 +12,12 @@ from sendstate import
|
|||
const QUICLY_ERROR_FREE_CONNECTION* = 0xff03
|
||||
|
||||
type
|
||||
quicly_stream_id_t* {.bycopy.} = int64
|
||||
quicly_stream_id_t* {.importc, header: "quicly/constants.h", bycopy.} = int64
|
||||
|
||||
quicly_conn_t* {.bycopy, incompleteStruct.} = object
|
||||
quicly_conn_t* {.bycopy, header: "quicly/constants.h", incompleteStruct.} = object
|
||||
|
||||
quicly_stream_callbacks_t* {.bycopy.} = object
|
||||
# quicly.h definitions moved here to resolve recursive dependency
|
||||
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,
|
||||
|
@ -26,21 +27,21 @@ type
|
|||
len: csize_t) {.cdecl.}
|
||||
on_receive_reset*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.}
|
||||
|
||||
quicly_sender_state_t* {.bycopy.} = enum
|
||||
quicly_sender_state_t* {.importc, header: "quicly.h", bycopy.} = enum
|
||||
QUICLY_SENDER_STATE_NONE,
|
||||
QUICLY_SENDER_STATE_SEND,
|
||||
QUICLY_SENDER_STATE_UNACKED,
|
||||
QUICLY_SENDER_STATE_ACKED,
|
||||
|
||||
StreamSendError* {.bycopy.} = object
|
||||
StreamSendError* {.importc, header: "quicly.h", bycopy.} = object
|
||||
sender_state*: quicly_sender_state_t
|
||||
error_code: uint16
|
||||
|
||||
StreamSendPendingLink* {.bycopy.} = object
|
||||
StreamSendPendingLink* {.importc, header: "quicly.h", bycopy.} = object
|
||||
control*: quicly_linklist_t
|
||||
default_scheduler*: quicly_linklist_t
|
||||
|
||||
StreamSendAux* {.bycopy.} = object
|
||||
StreamSendAux* {.importc, header: "quicly.h", bycopy.} = object
|
||||
max_stream_data*: uint64
|
||||
stop_sending*: StreamSendError
|
||||
reset_stream*: StreamSendError
|
||||
|
@ -48,11 +49,11 @@ type
|
|||
blocked*: quicly_sender_state_t
|
||||
pending_link*: StreamSendPendingLink
|
||||
|
||||
StreamRecvAux* {.bycopy.} = object
|
||||
StreamRecvAux* {.importc, header: "quicly.h", bycopy.} = object
|
||||
window*: uint32
|
||||
max_ranges*: uint32
|
||||
|
||||
quicly_stream_t* {.bycopy.} = object
|
||||
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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from quicly import quicly_context_t
|
||||
|
||||
var quicly_spec_context* {.importc.}: quicly_context_t
|
||||
var quicly_spec_context* {.importc, header: "quicly/defaults.h".}: quicly_context_t
|
||||
|
||||
var quicly_performant_context* {.importc.}: quicly_context_t
|
||||
var quicly_performant_context* {.importc, header: "quicly/defaults.h".}: quicly_context_t
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type
|
||||
quicly_linklist_t* {.bycopy.} = object
|
||||
quicly_linklist_t* {.importc, header: "quicly/linklist.h", bycopy.} = object
|
||||
prev*: ptr quicly_linklist_t
|
||||
next*: ptr quicly_linklist_t
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type
|
||||
quicly_loss_conf_t* {.bycopy.} = object
|
||||
quicly_loss_conf_t* {.importc, header: "quicly/loss.h", bycopy.} = object
|
||||
time_reordering_percentile*: cuint
|
||||
min_pto*: uint32
|
||||
default_initial_rtt*: uint32
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
type
|
||||
quicly_maxsender_t* {.bycopy.} = object
|
||||
quicly_maxsender_t* {.importc, header: "quicly/maxsender.h", bycopy.} = object
|
||||
max_committed*: int64
|
||||
max_acked*: int64
|
||||
num_inflight*: csize_t
|
||||
force_send* {.bitsize: 1.}: cuint
|
||||
|
||||
quicly_maxsender_sent_t* {.bycopy.} = object
|
||||
quicly_maxsender_sent_t* {.importc, header: "quicly/maxsender.h", bycopy.} = object
|
||||
inflight* {.bitsize: 1.}: uint64
|
||||
value* {.bitsize: 63.}: uint64
|
||||
|
|
|
@ -31,7 +31,7 @@ export
|
|||
quicly_stream_id_t
|
||||
|
||||
type
|
||||
quicly_address_t* {.bycopy.} = object
|
||||
quicly_address_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
sa*: SockAddr
|
||||
sin*: Sockaddr_in
|
||||
sin6*: Sockaddr_in6
|
||||
|
@ -57,7 +57,7 @@ type
|
|||
QUICLY_ADDRESS_TOKEN_TYPE_RETRY
|
||||
QUICLY_ADDRESS_TOKEN_TYPE_RESUMPTION
|
||||
|
||||
quicly_address_token_plaintext_t* {.bycopy.} = object
|
||||
quicly_address_token_plaintext_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
`type`: AddressTokenType
|
||||
issued_at*: uint64
|
||||
local*: quicly_address_t
|
||||
|
@ -65,41 +65,41 @@ type
|
|||
type_specific*: RetryOrResumption
|
||||
appdata*: AppData
|
||||
|
||||
quicly_stream_open_t* {.bycopy.} = object
|
||||
quicly_stream_open_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_stream_open_t, stream: ptr quicly_stream_t): cint
|
||||
{.cdecl.}
|
||||
|
||||
quicly_receive_datagram_frame_t* {.bycopy.} = object
|
||||
quicly_receive_datagram_frame_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_receive_datagram_frame_t, conn: ptr quicly_conn_t,
|
||||
payload: ptls_iovec_t) {.cdecl.}
|
||||
|
||||
quicly_closed_by_remote_t* {.bycopy.} = object
|
||||
quicly_closed_by_remote_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_closed_by_remote_t, conn: ptr quicly_conn_t,
|
||||
err: cint, frame_type: uint64, reason: cstring,
|
||||
reason_len: csize_t) {.cdecl.}
|
||||
|
||||
quicly_now_t* {.bycopy.} = object
|
||||
quicly_now_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_now_t): int64 {.cdecl.}
|
||||
|
||||
quicly_save_resumption_token_t* {.bycopy.} = object
|
||||
quicly_save_resumption_token_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_save_resumption_token_t, conn: ptr quicly_conn_t,
|
||||
token: ptls_iovec_t): cint {.cdecl.}
|
||||
|
||||
quicly_generate_resumption_token_t* {.bycopy.} = object
|
||||
quicly_generate_resumption_token_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_generate_resumption_token_t,
|
||||
conn: ptr quicly_conn_t, buf: ptr ptls_buffer_t,
|
||||
token: ptr quicly_address_token_plaintext_t): cint {.cdecl.}
|
||||
|
||||
quicly_init_cc_t* {.bycopy.} = object
|
||||
quicly_init_cc_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
cb*: proc(self: ptr quicly_init_cc_t, cc: ptr quicly_cc_t, initcwnd: uint32,
|
||||
now: int64) {.cdecl.}
|
||||
|
||||
quicly_max_stream_data_t* {.bycopy.} = object
|
||||
quicly_max_stream_data_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
bidi_local*: uint64
|
||||
bidi_remote*: uint64
|
||||
uni*: uint64
|
||||
|
||||
quicly_transport_parameters_t* {.bycopy.} = object
|
||||
quicly_transport_parameters_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
max_stream_data*: quicly_max_stream_data_t
|
||||
max_data*: uint64
|
||||
max_idle_timeout*: uint64
|
||||
|
@ -113,7 +113,7 @@ type
|
|||
active_connection_id_limit*: uint64
|
||||
max_datagram_frame_size*: uint16
|
||||
|
||||
quicly_stream_scheduler_t* {.bycopy.} = object
|
||||
quicly_stream_scheduler_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
can_send*: proc(sched: ptr quicly_stream_scheduler_t,
|
||||
conn: ptr quicly_conn_t, conn_is_saturated: cint): cint
|
||||
{.cdecl.}
|
||||
|
@ -122,7 +122,7 @@ type
|
|||
update_state*: proc(sched: ptr quicly_stream_scheduler_t,
|
||||
stream: ptr quicly_stream_t): cint {.cdecl.}
|
||||
|
||||
quicly_crypto_engine_t* {.bycopy.} = object
|
||||
quicly_crypto_engine_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
setup_cipher*: proc(engine: ptr quicly_crypto_engine_t,
|
||||
conn: ptr quicly_conn_t, epoch: csize_t, is_enc: cint,
|
||||
header_protect_ctx: ptr ptr ptls_cipher_context_t,
|
||||
|
@ -137,7 +137,7 @@ type
|
|||
datagram: ptls_iovec_t, first_byte_at: csize_t)
|
||||
{.cdecl.}
|
||||
|
||||
quicly_context_t* {.bycopy.} = object
|
||||
quicly_context_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
tls*: ptr ptls_context_t
|
||||
initial_egress_max_udp_payload_size*: uint16
|
||||
loss*: quicly_loss_conf_t
|
||||
|
@ -159,25 +159,25 @@ type
|
|||
crypto_engine*: ptr quicly_crypto_engine_t
|
||||
init_cc*: ptr quicly_init_cc_t
|
||||
|
||||
CidDest* {.bycopy.} = object
|
||||
CidDest* {.importc, header: "quicly.h", bycopy.} = object
|
||||
encrypted*: ptls_iovec_t
|
||||
plaintext*: quicly_cid_plaintext_t
|
||||
might_be_client_generated* {.bitsize: 1.}: cuint
|
||||
|
||||
Cid* {.bycopy.} = object
|
||||
Cid* {.importc, header: "quicly.h", bycopy.} = object
|
||||
dest: CidDest
|
||||
src: ptls_iovec_t
|
||||
|
||||
Decrypted* {.bycopy.} = object
|
||||
Decrypted* {.importc, header: "quicly.h", bycopy.} = object
|
||||
pn: uint64
|
||||
key_phase: uint64
|
||||
|
||||
IsStatelessReset* {.bycopy.} = enum
|
||||
IsStatelessReset* {.importc, header: "quicly.h", bycopy.} = enum
|
||||
QUICLY_DECODED_PACKET_CACHED_MAYBE_STATELESS_RESET = 0,
|
||||
QUICLY_DECODED_PACKET_CACHED_IS_STATELESS_RESET,
|
||||
QUICLY_DECODED_PACKET_CACHED_NOT_STATELESS_RESET
|
||||
|
||||
quicly_decoded_packet_t* {.bycopy.} = object
|
||||
quicly_decoded_packet_t* {.importc, header: "quicly.h", bycopy.} = object
|
||||
octets*: ptls_iovec_t
|
||||
cid*: Cid
|
||||
version*: uint32
|
||||
|
@ -188,35 +188,35 @@ type
|
|||
is_stateless_reset_cached: IsStatelessReset
|
||||
|
||||
proc quicly_get_stream*(conn: ptr quicly_conn_t, stream_id: quicly_stream_id_t):
|
||||
ptr quicly_stream_t {.cdecl, importc.}
|
||||
ptr quicly_stream_t {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_close*(conn: ptr quicly_conn_t, err: cint, reason_phrase: cstring):
|
||||
cint {.cdecl, importc.}
|
||||
cint {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_free*(conn: ptr quicly_conn_t): cint {.cdecl, importc.}
|
||||
proc quicly_free*(conn: ptr quicly_conn_t) {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_decode_packet*(ctx: ptr quicly_context_t,
|
||||
packet: ptr quicly_decoded_packet_t,
|
||||
datagram: ptr uint8, datagram_size: csize_t,
|
||||
off: ptr csize_t): csize_t
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_is_destination*(conn: ptr quicly_conn_t,
|
||||
dest_addr: ptr SockAddr | ptr Sockaddr_storage,
|
||||
src_addr: ptr SockAddr | ptr Sockaddr_storage,
|
||||
decoded: ptr quicly_decoded_packet_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_receive*(conn: ptr quicly_conn_t,
|
||||
dest_addr: ptr SockAddr | ptr Sockaddr_storage,
|
||||
src_addr: ptr SockAddr | ptr Sockaddr_storage,
|
||||
packet: ptr quicly_decoded_packet_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_send*(conn: ptr quicly_conn_t, dest: ptr quicly_address_t,
|
||||
src: ptr quicly_address_t, datagrams: ptr IOVec,
|
||||
num_diagrams: ptr csize_t, buf: pointer, bufsize: csize_t):
|
||||
cint {.cdecl, importc.}
|
||||
cint {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_accept*(conn: ptr ptr quicly_conn_t, ctx: ptr quicly_context_t,
|
||||
dest_addr: ptr SockAddr | ptr Sockaddr_storage,
|
||||
|
@ -225,7 +225,7 @@ proc quicly_accept*(conn: ptr ptr quicly_conn_t, ctx: ptr quicly_context_t,
|
|||
address_token: ptr quicly_address_token_plaintext_t,
|
||||
new_cid: ptr quicly_cid_plaintext_t,
|
||||
handshake_properties: ptr ptls_handshake_properties_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_connect*(conn: ptr ptr quicly_conn_t, ctx: ptr quicly_context_t,
|
||||
server_name: cstring,
|
||||
|
@ -235,17 +235,17 @@ proc quicly_connect*(conn: ptr ptr quicly_conn_t, ctx: ptr quicly_context_t,
|
|||
address_token: ptls_iovec_t,
|
||||
handshake_properties: ptr ptls_handshake_properties_t,
|
||||
resumed_transport_params: ptr quicly_transport_parameters_t):
|
||||
cint {.cdecl, importc.}
|
||||
cint {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_open_stream*(conn: ptr quicly_conn_t,
|
||||
stream: ptr ptr quicly_stream_t, unidirectional: cint):
|
||||
cint {.cdecl, importc.}
|
||||
cint {.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_amend_ptls_context*(ptls: ptr ptls_context_t)
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_get_socklen*(sa: ptr SockAddr | ptr Sockaddr_storage): SockLen
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
||||
proc quicly_get_first_timeout*(conn: ptr quicly_conn_t): int64
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly.h", cdecl.}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
type
|
||||
quicly_range_t* {.bycopy.} = object
|
||||
quicly_range_t* {.importc, header: "quicly/ranges.h", bycopy.} = object
|
||||
start*: uint64
|
||||
`end`*: uint64
|
||||
|
||||
quicly_ranges_t* {.bycopy.} = object
|
||||
quicly_ranges_t* {.importc, header: "quicly/ranges.h", bycopy.} = object
|
||||
ranges*: ptr quicly_range_t
|
||||
num_ranges*: csize_t
|
||||
capacity*: csize_t
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from ranges import quicly_ranges_t
|
||||
|
||||
type
|
||||
quicly_recvstate_t* {.bycopy.} = object
|
||||
quicly_recvstate_t* {.importc, header: "quicly/recvstate.h", bycopy.} = object
|
||||
received*: quicly_ranges_t
|
||||
data_off*: uint64
|
||||
eos*: uint64
|
||||
|
||||
proc quicly_recvstate_transfer_complete*(state: ptr quicly_recvstate_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/recvstate.h", cdecl.}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
from ranges import quicly_ranges_t
|
||||
|
||||
type
|
||||
quicly_sendstate_t* {.bycopy.} = object
|
||||
quicly_sendstate_t* {.importc, header: "quicly/sendstate.h", bycopy.} = object
|
||||
acked*: quicly_ranges_t
|
||||
pending*: quicly_ranges_t
|
||||
size_inflight*: uint64
|
||||
final_size*: uint64
|
||||
|
||||
quicly_sendstate_sent_t* {.bycopy.} = object
|
||||
quicly_sendstate_sent_t* {.importc, header: "quicly/sendstate.h", bycopy.} = object
|
||||
start*: uint64
|
||||
`end`*: uint64
|
||||
|
||||
proc quicly_sendstate_is_open*(state: ptr quicly_sendstate_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/sendstate.h", cdecl.}
|
||||
|
|
|
@ -2,58 +2,58 @@ from ../picotls/picotls import ptls_buffer_t, ptls_iovec_t
|
|||
from constants import quicly_stream_t
|
||||
|
||||
type
|
||||
quicly_streambuf_sendvec_callbacks_t* {.bycopy.} = object
|
||||
quicly_streambuf_sendvec_callbacks_t* {.importc, header: "quicly/streambuf.h", bycopy.} = object
|
||||
flatten_vec*: proc(vec: ptr quicly_sendbuf_vec_t, dst: pointer, off: csize_t,
|
||||
len: csize_t): cint {.cdecl.}
|
||||
discard_vec*: proc(vec: ptr quicly_sendbuf_vec_t) {.cdecl.}
|
||||
|
||||
quicly_sendbuf_vec_t* {.bycopy.} = object
|
||||
quicly_sendbuf_vec_t* {.importc, header: "quicly/streambuf.h", bycopy.} = object
|
||||
cb*: ptr quicly_streambuf_sendvec_callbacks_t
|
||||
`len`*: csize_t
|
||||
cbdata*: pointer
|
||||
|
||||
VecList* {.bycopy.} = object
|
||||
VecList* {.importc, header: "quicly/streambuf.h", bycopy.} = object
|
||||
entries*: ptr quicly_sendbuf_vec_t
|
||||
size*: csize_t
|
||||
capacity*: csize_t
|
||||
|
||||
quicly_sendbuf_t* {.bycopy.} = object
|
||||
quicly_sendbuf_t* {.importc, header: "quicly/streambuf.h", bycopy.} = object
|
||||
vecs*: VecList
|
||||
off_in_first_vec*: csize_t
|
||||
bytes_written*: uint64
|
||||
|
||||
quicly_streambuf_t* {.bycopy.} = object
|
||||
quicly_streambuf_t* {.importc, header: "quicly/streambuf.h", bycopy.} = object
|
||||
egress*: quicly_sendbuf_t
|
||||
ingress: ptls_buffer_t
|
||||
|
||||
proc quicly_streambuf_create*(stream: ptr quicly_stream_t, sz: csize_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_destroy*(stream: ptr quicly_stream_t, err: cint)
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_egress_shutdown*(stream: ptr quicly_stream_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_egress_write*(stream: ptr quicly_stream_t, src: pointer,
|
||||
len: csize_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_egress_emit*(stream: ptr quicly_stream_t, off: csize_t,
|
||||
dst: pointer, len: csize_t, wrote_all: cint)
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_egress_shift*(stream: ptr quicly_stream_t, delta: csize_t)
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_ingress_receive*(stream: ptr quicly_stream_t,
|
||||
off: csize_t, src: pointer,
|
||||
len: csize_t): cint
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_ingress_get*(stream: ptr quicly_stream_t): ptls_iovec_t
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
||||
proc quicly_streambuf_ingress_shift*(stream: ptr quicly_stream_t,
|
||||
delta: csize_t)
|
||||
{.cdecl, importc.}
|
||||
{.importc, header: "quicly/streambuf.h", cdecl.}
|
||||
|
|
Loading…
Reference in New Issue