make cb fields visible; add some constants
This commit is contained in:
parent
490664b1f5
commit
c6a0127244
|
@ -1,4 +1,6 @@
|
||||||
const PTLS_MAX_DIGEST_SIZE = 64
|
const PTLS_MAX_DIGEST_SIZE* = 64
|
||||||
|
const PTLS_ALERT_BAD_CERTIFICATE* = 42
|
||||||
|
const PTLS_ALERT_UNKNOWN_CA* = 48
|
||||||
|
|
||||||
type
|
type
|
||||||
List*[T] = object
|
List*[T] = object
|
||||||
|
@ -116,62 +118,62 @@ type
|
||||||
is_allocated*: cint
|
is_allocated*: cint
|
||||||
|
|
||||||
ptls_get_time_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_get_time_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
cb: proc(self: ptr ptls_get_time_t): uint64 {.cdecl.}
|
cb*: proc(self: ptr ptls_get_time_t): uint64 {.cdecl.}
|
||||||
|
|
||||||
ptls_on_client_hello_t* {.importc, header: "picotls.h", 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,
|
cb*: proc(self: ptr ptls_on_client_hello_t, tls: ptr ptls_t,
|
||||||
params: ptr ptls_on_client_hello_parameters_t): cint {.cdecl.}
|
params: ptr ptls_on_client_hello_parameters_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_emit_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_emit_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
cb: proc(self: ptr ptls_emit_certificate_t, tls: ptr ptls_t,
|
cb*: proc(self: ptr ptls_emit_certificate_t, tls: ptr ptls_t,
|
||||||
emitter: ptr ptls_message_emitter_t,
|
emitter: ptr ptls_message_emitter_t,
|
||||||
key_sched: ptr ptls_key_schedule_t, context: ptls_iovec_t,
|
key_sched: ptr ptls_key_schedule_t, context: ptls_iovec_t,
|
||||||
push_status_request: cint, compress_algos: uint16,
|
push_status_request: cint, compress_algos: uint16,
|
||||||
num_compress_algos: csize_t): cint {.cdecl.}
|
num_compress_algos: csize_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_sign_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_sign_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
cb: proc(self: ptr ptls_sign_certificate_t, tls: ptr ptls_t,
|
cb*: proc(self: ptr ptls_sign_certificate_t, tls: ptr ptls_t,
|
||||||
selected_algorithm: uint16, output: ptr ptls_buffer_t,
|
selected_algorithm: uint16, output: ptr ptls_buffer_t,
|
||||||
input: ptls_iovec_t, algorithms: uint16,
|
input: ptls_iovec_t, algorithms: uint16,
|
||||||
num_algorithms: csize_t): cint {.cdecl.}
|
num_algorithms: csize_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_verify_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_verify_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
cb: proc(self: ptr ptls_verify_certificate_t, tls: ptr ptls_t,
|
cb*: proc(self: ptr ptls_verify_certificate_t, tls: ptr ptls_t,
|
||||||
verify_sign: ptr VerifySignCb, verify_data: ptr pointer,
|
verify_sign: ptr VerifySignCb, verify_data: ptr pointer,
|
||||||
certs: ptls_iovec_t, numCerts: csize_t): cint {.cdecl.}
|
certs: ptr ptls_iovec_t, numCerts: csize_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_encrypt_ticket_t* {.importc, header: "picotls.h", 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,
|
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.}
|
dst: ptr ptls_buffer_t, src: ptls_iovec_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_save_ticket_t* {.importc, header: "picotls.h", 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):
|
cb*: proc(self: ptr ptls_save_ticket_t, tls: ptr ptls_t,
|
||||||
cint {.cdecl.}
|
input: ptls_iovec_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_log_event_t* {.importc, header: "picotls.h", 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,
|
cb*: proc(self: ptr ptls_log_event_t, tls: ptr ptls_t, `type`: cstring,
|
||||||
fmt: cstring) {.cdecl, varargs.}
|
fmt: cstring) {.cdecl, varargs.}
|
||||||
|
|
||||||
ptls_update_open_count_t* {.importc, header: "picotls.h", 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.}
|
cb*: proc(self: ptr ptls_update_open_count_t, delta: BiggestInt) {.cdecl.}
|
||||||
|
|
||||||
ptls_update_traffic_key_t* {.importc, header: "picotls.h", 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,
|
cb*: proc(self: ptr ptls_update_traffic_key_t, tls: ptr ptls_t, is_enc: cint,
|
||||||
epoch: csize_t, secret: pointer): cint {.cdecl.}
|
epoch: csize_t, secret: pointer): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_decompress_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_decompress_certificate_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
supported_algorithms*: uint16
|
supported_algorithms*: uint16
|
||||||
cb: proc(self: ptr ptls_decompress_certificate_t, tls: ptr ptls_t,
|
cb*: proc(self: ptr ptls_decompress_certificate_t, tls: ptr ptls_t,
|
||||||
algorithm: uint16, output: ptls_iovec_t, input: ptls_iovec_t): cint
|
algorithm: uint16, output: ptls_iovec_t, input: ptls_iovec_t): cint
|
||||||
{.cdecl.}
|
{.cdecl.}
|
||||||
|
|
||||||
ptls_update_esni_key_t* {.importc, header: "picotls.h", 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,
|
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
|
hash: ptls_hash_algorithm_t, hashed_esni_contents: pointer): cint
|
||||||
{.cdecl.}
|
{.cdecl.}
|
||||||
|
|
||||||
ptls_on_extension_t* {.importc, header: "picotls.h", 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,
|
cb*: proc(self: ptr ptls_on_extension_t, tls: ptr ptls_t, hstype: uint8,
|
||||||
exttype: uint16, extdata: ptls_iovec_t): cint {.cdecl.}
|
exttype: uint16, extdata: ptls_iovec_t): cint {.cdecl.}
|
||||||
|
|
||||||
ptls_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
ptls_context_t* {.importc, header: "picotls.h", bycopy.} = object
|
||||||
|
|
Loading…
Reference in New Issue