Artifactspublic-v0

curl

master
ply4 git calls194 ms289 KiB2 cachedprotocol v2
168 lines4.9 KiBRaw
1#ifndef HEADER_CURL_DOH_H
2#define HEADER_CURL_DOH_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#include "urldata.h"
28/* enums outside of the #ifdef to make the types work in unitprotos.h even on
29 builds without DoH support */
31struct Curl_resolv_async;
33typedef enum {
34 DOH_OK,
35 DOH_DNS_BAD_LABEL, /* 1 */
36 DOH_DNS_OUT_OF_RANGE, /* 2 */
37 DOH_DNS_LABEL_LOOP, /* 3 */
38 DOH_TOO_SMALL_BUFFER, /* 4 */
39 DOH_OUT_OF_MEM, /* 5 */
40 DOH_DNS_RDATA_LEN, /* 6 */
41 DOH_DNS_MALFORMAT, /* 7 */
42 DOH_DNS_BAD_RCODE, /* 8 - unsuccessful rcode, not NXDOMAIN */
43 DOH_DNS_UNEXPECTED_TYPE, /* 9 */
44 DOH_DNS_UNEXPECTED_CLASS, /* 10 */
45 DOH_NO_CONTENT, /* 11 */
46 DOH_DNS_BAD_ID, /* 12 */
47 DOH_DNS_NAME_TOO_LONG, /* 13 */
48 DOH_DNS_NXDOMAIN, /* 14 - no such name */
49 DOH_HTTP_FAILED, /* failure at the HTTP level */
50 DOH_OOM, /* out of memory */
51 DOH_CODE_LAST /* Not used, limit */
52} DOHcode;
54typedef enum {
55 CURL_DNS_TYPE_A = 1,
56 CURL_DNS_TYPE_NS = 2,
57 CURL_DNS_TYPE_CNAME = 5,
58 CURL_DNS_TYPE_AAAA = 28,
59 CURL_DNS_TYPE_DNAME = 39, /* RFC6672 */
60 CURL_DNS_TYPE_HTTPS = 65
61} DNStype;
63struct dohentry; /* forward-declare for non-DoH builds */
65#ifndef CURL_DISABLE_DOH
67enum doh_slot_num {
68 /* Explicit values for first two symbols so as to match hard-coded
69 * constants in existing code
70 */
71 DOH_SLOT_IPV4 = 0, /* make 'V4' stand out for readability */
72 DOH_SLOT_IPV6 = 1, /* 'V6' likewise */
74 /* Space here for (possibly build-specific) additional slot definitions */
75#ifdef USE_HTTPSRR
76 DOH_SLOT_HTTPS_RR = 2, /* for HTTPS RR */
77#endif
79 /* for example */
80 /* #ifdef WANT_DOH_FOOBAR_TXT */
81 /* DOH_PROBE_SLOT_FOOBAR_TXT, */
82 /* #endif */
84 /* AFTER all slot definitions, establish how many we have */
85 DOH_SLOT_COUNT
86};
88#define CURL_EZM_DOH_PROBE "ezm:doh-p"
90/* the largest one we can make, based on RFCs 1034, 1035 */
91#define DOH_MAX_DNSREQ_SIZE (256 + 16)
93/* each DoH probe request has this
94 * as easy meta for CURL_EZM_DOH_PROBE */
95struct doh_request {
96 unsigned char req_body[DOH_MAX_DNSREQ_SIZE];
97 struct curl_slist *req_hds;
98 struct dynbuf resp_body;
99 size_t req_body_len;
100 uint32_t resolv_id; /* id of the resolve operation */
101 DNStype dnstype;
102};
104/* each transfer firing off DoH requests has this
105 * as easy meta for CURL_EZM_DOH_MASTER */
106struct doh_probes {
107 uint32_t probe_mid[DOH_SLOT_COUNT];
108 DOHcode probe_rc[DOH_SLOT_COUNT];
109};
111/*
112 * Curl_doh() starts a name resolve using DoH (DNS-over-HTTPS). It resolves a
113 * name and returns a 'Curl_addrinfo *' with the address information.
114 */
115CURLcode Curl_doh(struct Curl_easy *data,
116 struct Curl_resolv_async *async);
118CURLcode Curl_doh_take_result(struct Curl_easy *data,
119 struct Curl_resolv_async *async,
120 struct Curl_dns_entry **pdns);
122#define DOH_MAX_ADDR 24
123#define DOH_MAX_HTTPS 4
125struct dohaddr {
126 int type;
127 union {
128 unsigned char v4[4]; /* network byte order */
129 unsigned char v6[16];
130 } ip;
131};
133#ifdef USE_HTTPSRR
135/*
136 * These may need escaping when found within an ALPN string
137 * value.
138 */
139#define COMMA_CHAR ','
140#define BACKSLASH_CHAR '\\'
142struct dohhttps_rr {
143 uint16_t len; /* raw encoded length */
144 unsigned char *val; /* raw encoded octets */
145};
146#endif
148struct dohentry {
149 struct dohaddr addr[DOH_MAX_ADDR];
150 int numaddr;
151 unsigned int ttl;
152#ifdef USE_HTTPSRR
153 struct dohhttps_rr https_rrs[DOH_MAX_HTTPS];
154 int numhttps_rrs;
155#endif
156};
158void Curl_doh_cleanup(struct Curl_easy *data,
159 struct Curl_resolv_async *async);
160#define Curl_doh_wanted(d) (!!(d)->set.doh)
162#else /* CURL_DISABLE_DOH */
163#define Curl_doh(a, b) NULL
164#define Curl_doh_take_result(x, y, z) CURLE_COULDNT_RESOLVE_HOST
165#define Curl_doh_wanted(d) FALSE
166#endif /* !CURL_DISABLE_DOH */
168#endif /* HEADER_CURL_DOH_H */
Diagnostics4 git calls · 194 ms
CallStatusSizeTime0194 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit21 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=21
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2002.1 KiB170 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=170
git.response.bytes=2148
git.response.cache=MISS
git.response.duration_ms=170
git.fetch.wants=a6358027a7c48b051cc5f4ef51b415c7b5e17246
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=2148
git.pkt.payload.max=2127
git.sideband.band1.bytes=2126
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e9ef9e38880acb
Request
2aa9690d…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format