#ifndef HEADER_CURL_ALTSVC_H1#define HEADER_CURL_ALTSVC_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) Daniel Stenberg, <[email protected]>, et al.10*11* This software is licensed as described in the file COPYING, which12* you should have received as part of this distribution. The terms13* are also available at https://curl.se/docs/copyright.html.14*15* You may opt to use, copy, modify, merge, publish, distribute and/or sell16* copies of the Software, and permit persons to whom the Software is17* furnished to do so, under the terms of the COPYING file.18*19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY20* KIND, either express or implied.21*22* SPDX-License-Identifier: curl23*24***************************************************************************/25#include "curl_setup.h"2627#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC)28#include "llist.h"2930struct althost {31char *host;32unsigned short port;33enum alpnid alpnid;34};3536struct altsvc {37struct althost src;38struct althost dst;39time_t expires;40struct Curl_llist_node node;41unsigned int prio;42BIT(persist);43};4445struct altsvcinfo {46char *filename;47struct Curl_llist list; /* list of entries */48long flags; /* the publicly set bitmask */49};5051const char *Curl_alpnid2str(enum alpnid id);52struct altsvcinfo *Curl_altsvc_init(void);53CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file);54CURLcode Curl_altsvc_save(struct Curl_easy *data,55struct altsvcinfo *asi, const char *file);56CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl);57void Curl_altsvc_cleanup(struct altsvcinfo **altsvc);58CURLcode Curl_altsvc_parse(struct Curl_easy *data,59struct altsvcinfo *altsvc, const char *value,60enum alpnid srcalpn, const char *srchost,61unsigned short srcport);62bool Curl_altsvc_lookup(struct altsvcinfo *asi,63enum alpnid srcalpnid, const char *srchost,64int srcport,65struct altsvc **dstentry,66const int versions, /* CURLALTSVC_H* bits */67bool *psame_destination);68#else69/* disabled */70#define Curl_altsvc_save(a, b, c)71#define Curl_altsvc_cleanup(x)72#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */73#endif /* HEADER_CURL_ALTSVC_H */747576