X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Ftlspicotls%2Ftls_picotls.h;h=29b279c7a83e674d16befd5ae21dc69feaa78cc1;hb=20399f8f3a27d54f65c4aff92998a2a345a7adab;hp=835f4a6b071ecc415517c842de29d7c8836e65ea;hpb=f83194c2f45bcc736edc8246b510a29c1df15756;p=vpp.git diff --git a/src/plugins/tlspicotls/tls_picotls.h b/src/plugins/tlspicotls/tls_picotls.h index 835f4a6b071..29b279c7a83 100644 --- a/src/plugins/tlspicotls/tls_picotls.h +++ b/src/plugins/tlspicotls/tls_picotls.h @@ -7,6 +7,19 @@ #include #include +#define TLS_RX_LEN(x) ((x)->rx_content + (x)->rx_len) +#define TLS_RX_OFFSET(x) ((x)->rx_content + (x)->rx_offset) +#define TLS_RX_IS_LEFT(x) ((x)->rx_len != 0 && (x)->rx_len != (x)->rx_offset) +#define TLS_RX_LEFT_LEN(x) ((x)->rx_len - (x)->rx_offset) + +#define TLS_READ_OFFSET(x) ((x)->read_buffer.base + (x)->read_buffer_offset) +#define TLS_READ_IS_LEFT(x) ((x)->read_buffer.off != 0 && (x)->read_buffer.off != (x)->read_buffer_offset) +#define TLS_READ_LEFT_LEN(x) ((x)->read_buffer.off - (x)->read_buffer_offset) + +#define TLS_WRITE_OFFSET(x) ((x)->write_buffer.base + (x)->write_buffer_offset) +#define TLS_WRITE_IS_LEFT(x) ((x)->write_buffer.off != 0 && (x)->write_buffer.off != (x)->write_buffer_offset) + + typedef struct tls_ctx_picotls_ { tls_ctx_t ctx; @@ -15,6 +28,11 @@ typedef struct tls_ctx_picotls_ u8 *rx_content; int rx_offset; int rx_len; + ptls_buffer_t read_buffer; + ptls_buffer_t write_buffer; + uint8_t *write_content; + int read_buffer_offset; + int write_buffer_offset; } picotls_ctx_t; typedef struct tls_listen_ctx_picotls_ @@ -27,6 +45,8 @@ typedef struct picotls_main_ { picotls_ctx_t ***ctx_pool; picotls_listen_ctx_t *lctx_pool; + ptls_context_t *client_ptls_ctx; + clib_rwlock_t crypto_keys_rw_lock; } picotls_main_t; #endif /* __included_quic_certs_h__ */