• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef HEADER_CURL_VQUIC_QUIC_INT_H
2 #define HEADER_CURL_VQUIC_QUIC_INT_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at https://curl.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * SPDX-License-Identifier: curl
24  *
25  ***************************************************************************/
26 
27 #include "curl_setup.h"
28 
29 #ifdef ENABLE_QUIC
30 
31 struct vquic_blocked_pkt {
32   const uint8_t *pkt;
33   size_t pktlen;
34   size_t gsolen;
35 };
36 
37 struct cf_quic_ctx {
38   curl_socket_t sockfd;
39   struct sockaddr_storage local_addr;
40   socklen_t local_addrlen;
41   struct vquic_blocked_pkt blocked_pkt[2];
42   uint8_t *pktbuf;
43   /* the number of entries in blocked_pkt */
44   size_t num_blocked_pkt;
45   size_t num_blocked_pkt_sent;
46   /* the packets blocked by sendmsg (EAGAIN or EWOULDBLOCK) */
47   size_t pktbuflen;
48   /* the number of processed entries in blocked_pkt */
49   bool no_gso;
50 };
51 
52 CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx, size_t pktbuflen);
53 void vquic_ctx_free(struct cf_quic_ctx *qctx);
54 
55 CURLcode vquic_send_packet(struct Curl_cfilter *cf,
56                            struct Curl_easy *data,
57                            struct cf_quic_ctx *qctx,
58                            const uint8_t *pkt, size_t pktlen, size_t gsolen,
59                            size_t *psent);
60 
61 void vquic_push_blocked_pkt(struct Curl_cfilter *cf,
62                             struct cf_quic_ctx *qctx,
63                             const uint8_t *pkt, size_t pktlen, size_t gsolen);
64 
65 CURLcode vquic_send_blocked_pkt(struct Curl_cfilter *cf,
66                                 struct Curl_easy *data,
67                                 struct cf_quic_ctx *qctx);
68 
69 
70 #endif /* !ENABLE_QUIC */
71 
72 #endif /* HEADER_CURL_VQUIC_QUIC_INT_H */
73