| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
use alloc::{ |
| 11 |
string::{String, ToString}, |
| 12 |
vec::Vec, |
| 13 |
}; |
| 14 |
use core::str::FromStr; |
| 15 |
|
| 16 |
use crate::{ |
| 17 |
rr::{ |
| 18 |
Name, |
| 19 |
rdata::{A, AAAA, svcb::*}, |
| 20 |
}, |
| 21 |
serialize::txt::{ |
| 22 |
Lexer, Token, |
| 23 |
errors::{ParseError, ParseResult}, |
| 24 |
}, |
| 25 |
}; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
pub(crate) fn parse<'i, I: Iterator<Item = &'i str>>(mut tokens: I) -> ParseResult<SVCB> { |
| 78 |
|
| 79 |
let svc_priority: u16 = tokens |
| 80 |
.next() |
| 81 |
.ok_or_else(|| ParseError::MissingToken("SvcPriority".to_string())) |
| 82 |
.and_then(|s| s.parse().map_err(Into::into))?; |
| 83 |
|
| 84 |
|
| 85 |
let target_name: Name = tokens |
| 86 |
.next() |
| 87 |
.ok_or_else(|| ParseError::MissingToken("Target".to_string())) |
| 88 |
.and_then(|s| Name::from_str(s).map_err(ParseError::from))?; |
| 89 |
|
| 90 |
|
| 91 |
let mut svc_params = Vec::new(); |
| 92 |
for token in tokens { |
| 93 |
|
| 94 |
let mut key_value = token.splitn(2, '='); |
| 95 |
let key = key_value |
| 96 |
.next() |
| 97 |
.ok_or_else(|| ParseError::MissingToken("SVCB SvcbParams missing".to_string()))?; |
| 98 |
|
| 99 |
|
| 100 |
let mut value = key_value.next(); |
| 101 |
if let Some(value) = value.as_mut() { |
| 102 |
if value.starts_with('"') && value.ends_with('"') { |
| 103 |
*value = &value[1..value.len() - 1]; |
| 104 |
} |
| 105 |
} |
| 106 |
svc_params.push(into_svc_param(key, value)?); |
| 107 |
} |
| 108 |
|
| 109 |
Ok(SVCB::new(svc_priority, target_name, svc_params)) |
| 110 |
} |
| 111 |
|
| 112 |
|
| 113 |
fn into_svc_param( |
| 114 |
key: &str, |
| 115 |
value: Option<&str>, |
| 116 |
) -> Result<(SvcParamKey, SvcParamValue), ParseError> { |
| 117 |
let key = SvcParamKey::from_str(key)?; |
| 118 |
let value = parse_value(key, value)?; |
| 119 |
|
| 120 |
Ok((key, value)) |
| 121 |
} |
| 122 |
|
| 123 |
fn parse_value(key: SvcParamKey, value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 124 |
match key { |
| 125 |
SvcParamKey::Mandatory => parse_mandatory(value), |
| 126 |
SvcParamKey::Alpn => parse_alpn(value), |
| 127 |
SvcParamKey::NoDefaultAlpn => parse_no_default_alpn(value), |
| 128 |
SvcParamKey::Port => parse_port(value), |
| 129 |
SvcParamKey::Ipv4Hint => parse_ipv4_hint(value), |
| 130 |
SvcParamKey::Ipv6Hint => parse_ipv6_hint(value), |
| 131 |
SvcParamKey::EchConfigList => parse_ech_config(value), |
| 132 |
SvcParamKey::Key(_) => parse_unknown(value), |
| 133 |
SvcParamKey::Key65535 | SvcParamKey::Unknown(_) => Err(ParseError::Message( |
| 134 |
"Bad Key type or unsupported, see generic key option, e.g. key1234", |
| 135 |
)), |
| 136 |
} |
| 137 |
} |
| 138 |
|
| 139 |
fn parse_char_data(value: &str) -> Result<String, ParseError> { |
| 140 |
let mut lex = Lexer::new(value); |
| 141 |
let ch_data = lex |
| 142 |
.next_token()? |
| 143 |
.ok_or(ParseError::Message("expected character data"))?; |
| 144 |
|
| 145 |
match ch_data { |
| 146 |
Token::CharData(data) => Ok(data), |
| 147 |
_ => Err(ParseError::Message("expected character data")), |
| 148 |
} |
| 149 |
} |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
fn parse_mandatory(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 171 |
let value = value.ok_or(ParseError::Message("expected at least one Mandatory field"))?; |
| 172 |
|
| 173 |
let mandatories = parse_list::<SvcParamKey>(value)?; |
| 174 |
Ok(SvcParamValue::Mandatory(Mandatory(mandatories))) |
| 175 |
} |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
fn parse_alpn(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 191 |
let value = value.ok_or(ParseError::Message("expected at least one ALPN code"))?; |
| 192 |
|
| 193 |
let alpns = parse_list::<String>(value).expect("infallible"); |
| 194 |
Ok(SvcParamValue::Alpn(Alpn(alpns))) |
| 195 |
} |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
fn parse_no_default_alpn(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 206 |
if value.is_some() { |
| 207 |
return Err(ParseError::Message("no value expected for NoDefaultAlpn")); |
| 208 |
} |
| 209 |
|
| 210 |
Ok(SvcParamValue::NoDefaultAlpn) |
| 211 |
} |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
fn parse_port(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 222 |
let value = value.ok_or(ParseError::Message("a port number for the port option"))?; |
| 223 |
|
| 224 |
let value = parse_char_data(value)?; |
| 225 |
let port = u16::from_str(&value)?; |
| 226 |
Ok(SvcParamValue::Port(port)) |
| 227 |
} |
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
fn parse_ipv4_hint(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 238 |
let value = value.ok_or(ParseError::Message("expected at least one ipv4 hint"))?; |
| 239 |
|
| 240 |
let hints = parse_list::<A>(value)?; |
| 241 |
Ok(SvcParamValue::Ipv4Hint(IpHint(hints))) |
| 242 |
} |
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
fn parse_ipv6_hint(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 253 |
let value = value.ok_or(ParseError::Message("expected at least one ipv6 hint"))?; |
| 254 |
|
| 255 |
let hints = parse_list::<AAAA>(value)?; |
| 256 |
Ok(SvcParamValue::Ipv6Hint(IpHint(hints))) |
| 257 |
} |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
fn parse_ech_config(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 270 |
let value = value.ok_or(ParseError::Message( |
| 271 |
"expected a base64 encoded string for EchConfig", |
| 272 |
))?; |
| 273 |
|
| 274 |
let value = parse_char_data(value)?; |
| 275 |
let ech_config_bytes = data_encoding::BASE64.decode(value.as_bytes())?; |
| 276 |
Ok(SvcParamValue::EchConfigList(EchConfigList( |
| 277 |
ech_config_bytes, |
| 278 |
))) |
| 279 |
} |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
fn parse_unknown(value: Option<&str>) -> Result<SvcParamValue, ParseError> { |
| 297 |
let unknown: Vec<u8> = if let Some(value) = value { |
| 298 |
value.as_bytes().to_vec() |
| 299 |
} else { |
| 300 |
Vec::new() |
| 301 |
}; |
| 302 |
|
| 303 |
Ok(SvcParamValue::Unknown(Unknown(unknown))) |
| 304 |
} |
| 305 |
|
| 306 |
fn parse_list<T>(value: &str) -> Result<Vec<T>, ParseError> |
| 307 |
where |
| 308 |
T: FromStr, |
| 309 |
T::Err: Into<ParseError>, |
| 310 |
{ |
| 311 |
let mut result = Vec::new(); |
| 312 |
let mut current_value = String::new(); |
| 313 |
let mut escaping = false; |
| 314 |
|
| 315 |
for c in value.chars() { |
| 316 |
match (c, escaping) { |
| 317 |
|
| 318 |
(',', false) => { |
| 319 |
result.push(T::from_str(&parse_char_data(¤t_value)?).map_err(Into::into)?); |
| 320 |
current_value.clear() |
| 321 |
} |
| 322 |
|
| 323 |
('\\', false) => escaping = true, |
| 324 |
|
| 325 |
(',', true) => { |
| 326 |
current_value.push(','); |
| 327 |
escaping = false |
| 328 |
} |
| 329 |
|
| 330 |
(_, true) => { |
| 331 |
current_value.push(c); |
| 332 |
escaping = false |
| 333 |
} |
| 334 |
|
| 335 |
(_, false) => current_value.push(c), |
| 336 |
} |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
if !current_value.is_empty() { |
| 341 |
result.push(T::from_str(&parse_char_data(¤t_value)?).map_err(Into::into)?); |
| 342 |
} |
| 343 |
|
| 344 |
Ok(result) |
| 345 |
} |
| 346 |
|
| 347 |
#[cfg(test)] |
| 348 |
mod tests { |
| 349 |
use alloc::borrow::ToOwned; |
| 350 |
use alloc::string::ToString; |
| 351 |
|
| 352 |
use crate::{ |
| 353 |
rr::{RecordData, rdata::HTTPS}, |
| 354 |
serialize::txt::Parser, |
| 355 |
}; |
| 356 |
|
| 357 |
use super::*; |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
fn parse_record<D: RecordData>(txt: &str) -> D { |
| 362 |
let records = Parser::new(txt, None, Some(Name::root())) |
| 363 |
.parse() |
| 364 |
.expect("failed to parse record") |
| 365 |
.1; |
| 366 |
let record_set = records.into_iter().next().expect("no record found").1; |
| 367 |
D::try_borrow(&record_set.into_iter().next().unwrap().data) |
| 368 |
.expect("Not the correct record") |
| 369 |
.clone() |
| 370 |
} |
| 371 |
|
| 372 |
#[test] |
| 373 |
fn test_parsing() { |
| 374 |
let svcb: HTTPS = parse_record(CF_HTTPS_RECORD); |
| 375 |
|
| 376 |
assert_eq!(svcb.svc_priority, 1); |
| 377 |
assert_eq!(svcb.target_name, Name::root()); |
| 378 |
|
| 379 |
let mut params = svcb.svc_params.iter(); |
| 380 |
|
| 381 |
|
| 382 |
let param = params.next().expect("not alpn"); |
| 383 |
assert_eq!(param.0, SvcParamKey::Alpn); |
| 384 |
let SvcParamValue::Alpn(value) = ¶m.1 else { |
| 385 |
panic!("expected alpn"); |
| 386 |
}; |
| 387 |
assert_eq!(value.0, &["http/1.1", "h2"]); |
| 388 |
|
| 389 |
|
| 390 |
let param = params.next().expect("ipv4hint"); |
| 391 |
assert_eq!(SvcParamKey::Ipv4Hint, param.0); |
| 392 |
let SvcParamValue::Ipv4Hint(value) = ¶m.1 else { |
| 393 |
panic!("expected ipv4hint"); |
| 394 |
}; |
| 395 |
assert_eq!( |
| 396 |
value.0, |
| 397 |
&[A::new(162, 159, 137, 85), A::new(162, 159, 138, 85)] |
| 398 |
); |
| 399 |
|
| 400 |
|
| 401 |
let param = params.next().expect("echconfig"); |
| 402 |
assert_eq!(SvcParamKey::EchConfigList, param.0); |
| 403 |
let SvcParamValue::EchConfigList(value) = ¶m.1 else { |
| 404 |
panic!("expected echconfig"); |
| 405 |
}; |
| 406 |
assert_eq!( |
| 407 |
value.0, |
| 408 |
data_encoding::BASE64.decode(b"AEX+DQBBtgAgACBMmGJQR02doup+5VPMjYpe5HQQ/bpntFCxDa8LT2PLAgAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=").unwrap() |
| 409 |
); |
| 410 |
|
| 411 |
|
| 412 |
let param = params.next().expect("ipv6hint"); |
| 413 |
assert_eq!(SvcParamKey::Ipv6Hint, param.0); |
| 414 |
let SvcParamValue::Ipv6Hint(value) = ¶m.1 else { |
| 415 |
panic!("expected ipv6hint"); |
| 416 |
}; |
| 417 |
assert_eq!( |
| 418 |
value.0, |
| 419 |
&[ |
| 420 |
AAAA::new(0x2606, 0x4700, 0x7, 0, 0, 0, 0xa29f, 0x8955), |
| 421 |
AAAA::new(0x2606, 0x4700, 0x7, 0, 0, 0, 0xa29f, 0x8a5) |
| 422 |
] |
| 423 |
); |
| 424 |
} |
| 425 |
|
| 426 |
#[test] |
| 427 |
fn test_parse_display() { |
| 428 |
let svcb: SVCB = parse_record(CF_SVCB_RECORD); |
| 429 |
|
| 430 |
let svcb_display = svcb.to_string(); |
| 431 |
|
| 432 |
|
| 433 |
let svcb_display = format!("crypto.cloudflare.com. 299 IN SVCB {svcb_display}"); |
| 434 |
let svcb_display = parse_record(&svcb_display); |
| 435 |
|
| 436 |
assert_eq!(svcb, svcb_display); |
| 437 |
} |
| 438 |
|
| 439 |
|
| 440 |
#[test] |
| 441 |
fn test_parsing_https() { |
| 442 |
let records = [GOOGLE_HTTPS_RECORD, CF_HTTPS_RECORD]; |
| 443 |
for record in records.iter() { |
| 444 |
let svcb: HTTPS = parse_record(record); |
| 445 |
|
| 446 |
assert_eq!(svcb.svc_priority, 1); |
| 447 |
assert_eq!(svcb.target_name, Name::root()); |
| 448 |
} |
| 449 |
} |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
#[test] |
| 455 |
fn test_rfc9460_vectors() { |
| 456 |
#[derive(Debug)] |
| 457 |
struct TestVector { |
| 458 |
record: &'static str, |
| 459 |
record_type: RecordType, |
| 460 |
target_name: Name, |
| 461 |
priority: u16, |
| 462 |
params: Vec<(SvcParamKey, SvcParamValue)>, |
| 463 |
} |
| 464 |
|
| 465 |
#[derive(Debug)] |
| 466 |
enum RecordType { |
| 467 |
SVCB, |
| 468 |
HTTPS, |
| 469 |
} |
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
let vectors: [TestVector; 9] = [ |
| 474 |
|
| 475 |
|
| 476 |
TestVector { |
| 477 |
record: "example.com. 42 HTTPS 0 foo.example.com.", |
| 478 |
record_type: RecordType::HTTPS, |
| 479 |
target_name: Name::from_str("foo.example.com.").unwrap(), |
| 480 |
priority: 0, |
| 481 |
params: Vec::new(), |
| 482 |
}, |
| 483 |
|
| 484 |
|
| 485 |
TestVector { |
| 486 |
record: "example.com. 42 SVCB 1 .", |
| 487 |
record_type: RecordType::SVCB, |
| 488 |
target_name: Name::from_str(".").unwrap(), |
| 489 |
priority: 1, |
| 490 |
params: Vec::new(), |
| 491 |
}, |
| 492 |
|
| 493 |
TestVector { |
| 494 |
record: "example.com. 42 SVCB 16 foo.example.com. port=53", |
| 495 |
record_type: RecordType::SVCB, |
| 496 |
target_name: Name::from_str("foo.example.com.").unwrap(), |
| 497 |
priority: 16, |
| 498 |
params: vec![(SvcParamKey::Port, SvcParamValue::Port(53))], |
| 499 |
}, |
| 500 |
|
| 501 |
TestVector { |
| 502 |
record: "example.com. 42 SVCB 1 foo.example.com. key667=hello", |
| 503 |
record_type: RecordType::SVCB, |
| 504 |
target_name: Name::from_str("foo.example.com.").unwrap(), |
| 505 |
priority: 1, |
| 506 |
params: vec![( |
| 507 |
SvcParamKey::Key(667), |
| 508 |
SvcParamValue::Unknown(Unknown(b"hello".into())), |
| 509 |
)], |
| 510 |
}, |
| 511 |
|
| 512 |
TestVector { |
| 513 |
record: r#"example.com. 42 SVCB 1 foo.example.com. key667="hello\210qoo""#, |
| 514 |
record_type: RecordType::SVCB, |
| 515 |
target_name: Name::from_str("foo.example.com.").unwrap(), |
| 516 |
priority: 1, |
| 517 |
params: vec![( |
| 518 |
SvcParamKey::Key(667), |
| 519 |
SvcParamValue::Unknown(Unknown(b"hello\\210qoo".into())), |
| 520 |
)], |
| 521 |
}, |
| 522 |
|
| 523 |
TestVector { |
| 524 |
record: r#"example.com. 42 SVCB 1 foo.example.com. (ipv6hint="2001:db8::1,2001:db8::53:1")"#, |
| 525 |
record_type: RecordType::SVCB, |
| 526 |
target_name: Name::from_str("foo.example.com.").unwrap(), |
| 527 |
priority: 1, |
| 528 |
params: vec![( |
| 529 |
SvcParamKey::Ipv6Hint, |
| 530 |
SvcParamValue::Ipv6Hint(IpHint(vec![ |
| 531 |
AAAA::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1), |
| 532 |
AAAA::new(0x2001, 0xdb8, 0, 0, 0, 0, 0x53, 1), |
| 533 |
])), |
| 534 |
)], |
| 535 |
}, |
| 536 |
|
| 537 |
TestVector { |
| 538 |
record: r#"example.com. 42 SVCB 1 example.com. (ipv6hint="2001:db8:122:344::192.0.2.33")"#, |
| 539 |
record_type: RecordType::SVCB, |
| 540 |
target_name: Name::from_str("example.com.").unwrap(), |
| 541 |
priority: 1, |
| 542 |
params: vec![( |
| 543 |
SvcParamKey::Ipv6Hint, |
| 544 |
SvcParamValue::Ipv6Hint(IpHint(vec![AAAA::new( |
| 545 |
0x2001, 0xdb8, 0x122, 0x344, 0, 0, 0xc000, 0x221, |
| 546 |
)])), |
| 547 |
)], |
| 548 |
}, |
| 549 |
|
| 550 |
TestVector { |
| 551 |
record: r#"example.com. 42 SVCB 16 foo.example.org. (alpn=h2,h3-19 mandatory=ipv4hint,alpn ipv4hint=192.0.2.1)"#, |
| 552 |
record_type: RecordType::SVCB, |
| 553 |
target_name: Name::from_str("foo.example.org.").unwrap(), |
| 554 |
priority: 16, |
| 555 |
params: vec![ |
| 556 |
( |
| 557 |
SvcParamKey::Alpn, |
| 558 |
SvcParamValue::Alpn(Alpn(vec!["h2".to_owned(), "h3-19".to_owned()])), |
| 559 |
), |
| 560 |
( |
| 561 |
SvcParamKey::Mandatory, |
| 562 |
SvcParamValue::Mandatory(Mandatory(vec![ |
| 563 |
SvcParamKey::Ipv4Hint, |
| 564 |
SvcParamKey::Alpn, |
| 565 |
])), |
| 566 |
), |
| 567 |
( |
| 568 |
SvcParamKey::Ipv4Hint, |
| 569 |
SvcParamValue::Ipv4Hint(IpHint(vec![A::new(192, 0, 2, 1)])), |
| 570 |
), |
| 571 |
], |
| 572 |
}, |
| 573 |
|
| 574 |
TestVector { |
| 575 |
record: r#"example.com. 42 SVCB 16 foo.example.org. alpn="f\\\\oo\,bar,h2""#, |
| 576 |
record_type: RecordType::SVCB, |
| 577 |
target_name: Name::from_str("foo.example.org.").unwrap(), |
| 578 |
priority: 16, |
| 579 |
params: vec![( |
| 580 |
SvcParamKey::Alpn, |
| 581 |
SvcParamValue::Alpn(Alpn(vec![r#"f\\oo,bar"#.to_owned(), "h2".to_owned()])), |
| 582 |
)], |
| 583 |
}, |
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
]; |
| 599 |
|
| 600 |
for record in vectors { |
| 601 |
let expected_scvb = SVCB::new(record.priority, record.target_name, record.params); |
| 602 |
match record.record_type { |
| 603 |
RecordType::SVCB => { |
| 604 |
let parsed: SVCB = parse_record(record.record); |
| 605 |
assert_eq!(parsed, expected_scvb); |
| 606 |
} |
| 607 |
RecordType::HTTPS => { |
| 608 |
let parsed: HTTPS = parse_record(record.record); |
| 609 |
assert_eq!(parsed, HTTPS(expected_scvb)); |
| 610 |
} |
| 611 |
}; |
| 612 |
} |
| 613 |
} |
| 614 |
|
| 615 |
const CF_SVCB_RECORD: &str = "crypto.cloudflare.com. 1664 IN SVCB 1 . alpn=\"http/1.1,h2\" ipv4hint=162.159.137.85,162.159.138.85 ech=AEX+DQBBtgAgACBMmGJQR02doup+5VPMjYpe5HQQ/bpntFCxDa8LT2PLAgAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA= ipv6hint=2606:4700:7::a29f:8955,2606:4700:7::a29f:8a5"; |
| 616 |
const CF_HTTPS_RECORD: &str = "crypto.cloudflare.com. 1664 IN HTTPS 1 . alpn=\"http/1.1,h2\" ipv4hint=162.159.137.85,162.159.138.85 ech=AEX+DQBBtgAgACBMmGJQR02doup+5VPMjYpe5HQQ/bpntFCxDa8LT2PLAgAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA= ipv6hint=2606:4700:7::a29f:8955,2606:4700:7::a29f:8a5"; |
| 617 |
const GOOGLE_HTTPS_RECORD: &str = "google.com 21132 IN HTTPS 1 . alpn=\"h2,h3\""; |
| 618 |
} |