#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 <curl/curl.h>29#include "llist.h"3031struct althost {32char *host;33unsigned short port;34enum alpnid alpnid;35};3637struct altsvc {38struct althost src;39struct althost dst;40time_t expires;41struct Curl_llist_node node;42unsigned int prio;43BIT(persist);44};4546struct altsvcinfo {47char *filename;48struct Curl_llist list; /* list of entries */49long flags; /* the publicly set bitmask */50};5152const char *Curl_alpnid2str(enum alpnid id);53struct altsvcinfo *Curl_altsvc_init(void);54CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file);55CURLcode Curl_altsvc_save(struct Curl_easy *data,56struct altsvcinfo *asi, const char *file);57CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl);58void Curl_altsvc_cleanup(struct altsvcinfo **altsvc);59CURLcode Curl_altsvc_parse(struct Curl_easy *data,60struct altsvcinfo *altsvc, const char *value,61enum alpnid srcalpn, const char *srchost,62unsigned short srcport);63bool Curl_altsvc_lookup(struct altsvcinfo *asi,64enum alpnid srcalpnid, const char *srchost,65int srcport,66struct altsvc **dstentry,67const int versions); /* CURLALTSVC_H* bits */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