1 #ifndef HEADER_CURL_ALTSVC_H
2 #define HEADER_CURL_ALTSVC_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
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.
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.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
24 #include "curl_setup.h"
26 #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC)
27 #include <curl/curl.h>
32 ALPN_h1 = CURLALTSVC_H1,
33 ALPN_h2 = CURLALTSVC_H2,
34 ALPN_h3 = CURLALTSVC_H3
49 struct Curl_llist_element node;
54 struct Curl_llist list; /* list of entries */
55 long flags; /* the publicly set bitmask */
58 const char *Curl_alpnid2str(enum alpnid id);
59 struct altsvcinfo *Curl_altsvc_init(void);
60 CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file);
61 CURLcode Curl_altsvc_save(struct Curl_easy *data,
62 struct altsvcinfo *asi, const char *file);
63 CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl);
64 void Curl_altsvc_cleanup(struct altsvcinfo **altsvc);
65 CURLcode Curl_altsvc_parse(struct Curl_easy *data,
66 struct altsvcinfo *altsvc, const char *value,
67 enum alpnid srcalpn, const char *srchost,
68 unsigned short srcport);
69 bool Curl_altsvc_lookup(struct altsvcinfo *asi,
70 enum alpnid srcalpnid, const char *srchost,
72 struct altsvc **dstentry,
73 const int versions); /* CURLALTSVC_H* bits */
76 #define Curl_altsvc_save(a,b,c)
77 #define Curl_altsvc_cleanup(x)
78 #endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */
79 #endif /* HEADER_CURL_ALTSVC_H */