change internal usage from set_rr_type to set_record_type

This commit is contained in:
Benjamin Fry
2023-10-26 17:10:15 -07:00
parent c0c2b2fa89
commit e2c82f6991
15 changed files with 117 additions and 117 deletions

View File

@@ -186,7 +186,7 @@ impl<'a> From<&'a Edns> for Record {
let mut record = Self::new();
record.set_name(Name::root());
record.set_rr_type(RecordType::OPT);
record.set_record_type(RecordType::OPT);
record.set_dns_class(DNSClass::for_opt(value.max_payload()));
// rebuild the TTL field

View File

@@ -546,7 +546,7 @@ impl MessageFinalizer for SigSigner {
let expiration_time: u32 = current_time + (5 * 60); // +5 minutes in seconds
sig0.set_rr_type(RecordType::SIG);
sig0.set_record_type(RecordType::SIG);
let pre_sig0 = SIG::new(
// type covered in SIG(0) is 0 which is what makes this SIG0 vs a standard SIG
RecordType::ZERO,
@@ -695,7 +695,7 @@ mod tests {
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -706,7 +706,7 @@ mod tests {
Record::new()
.set_name(origin)
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"b.iana-servers.net.",
@@ -832,7 +832,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -843,7 +843,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"b.iana-servers.net.",
@@ -860,7 +860,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::CNAME)
.set_record_type(RecordType::CNAME)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::CNAME(CNAME(
Name::parse("a.iana-servers.net.", None).unwrap(),
@@ -869,7 +869,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(Name::parse("www.example.com.", None).unwrap())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -880,7 +880,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::CH)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -891,7 +891,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -902,7 +902,7 @@ MC0CAQACBQC+L6pNAgMBAAECBQCYj0ZNAgMA9CsCAwDHZwICeEUCAnE/AgMA3u0=
Record::new()
.set_name(origin)
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"b.iana-servers.net.",

View File

@@ -860,7 +860,7 @@ mod tests {
let mut record = Record::new();
record
.set_name(Name::from_str("www.example.com").unwrap())
.set_rr_type(RecordType::A)
.set_record_type(RecordType::A)
.set_dns_class(DNSClass::IN)
.set_ttl(5)
.set_data(Some(RData::A(A::new(192, 168, 0, 1))));

View File

@@ -629,7 +629,7 @@ mod test {
let insert = Record::new()
.set_name(name.clone())
.set_ttl(86400)
.set_rr_type(record_type)
.set_record_type(record_type)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 24).into())))
.clone();
@@ -647,7 +647,7 @@ mod test {
let insert1 = Record::new()
.set_name(name)
.set_ttl(86400)
.set_rr_type(record_type)
.set_record_type(record_type)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 25).into())))
.clone();
@@ -667,7 +667,7 @@ mod test {
let insert = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::SOA)
.set_record_type(RecordType::SOA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::SOA(SOA::new(
Name::from_str("sns.dns.icann.org.").unwrap(),
@@ -682,7 +682,7 @@ mod test {
let same_serial = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::SOA)
.set_record_type(RecordType::SOA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::SOA(SOA::new(
Name::from_str("sns.dns.icann.net.").unwrap(),
@@ -697,7 +697,7 @@ mod test {
let new_serial = Record::new()
.set_name(name)
.set_ttl(3600)
.set_rr_type(RecordType::SOA)
.set_record_type(RecordType::SOA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::SOA(SOA::new(
Name::from_str("sns.dns.icann.net.").unwrap(),
@@ -744,14 +744,14 @@ mod test {
let insert = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::CNAME)
.set_record_type(RecordType::CNAME)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::CNAME(CNAME(cname))))
.clone();
let new_record = Record::new()
.set_name(name)
.set_ttl(3600)
.set_rr_type(RecordType::CNAME)
.set_record_type(RecordType::CNAME)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::CNAME(CNAME(new_cname))))
.clone();
@@ -776,14 +776,14 @@ mod test {
let insert = Record::new()
.set_name(name.clone())
.set_ttl(86400)
.set_rr_type(record_type)
.set_record_type(record_type)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 24).into())))
.clone();
let insert1 = Record::new()
.set_name(name)
.set_ttl(86400)
.set_rr_type(record_type)
.set_record_type(record_type)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 25).into())))
.clone();
@@ -807,7 +807,7 @@ mod test {
let insert = Record::new()
.set_name(name)
.set_ttl(3600)
.set_rr_type(RecordType::SOA)
.set_record_type(RecordType::SOA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::SOA(SOA::new(
Name::from_str("sns.dns.icann.org.").unwrap(),
@@ -834,7 +834,7 @@ mod test {
let ns1 = Record::new()
.set_name(name.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(
Name::from_str("a.iana-servers.net.").unwrap()
@@ -843,7 +843,7 @@ mod test {
let ns2 = Record::new()
.set_name(name)
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(
Name::from_str("b.iana-servers.net.").unwrap()
@@ -921,28 +921,28 @@ mod test {
let rrsig_rsa = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::RRSIG)
.set_record_type(RecordType::RRSIG)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::DNSSEC(DNSSECRData::RRSIG(rsasha256))))
.clone();
let rrsig_ecp256 = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::RRSIG)
.set_record_type(RecordType::RRSIG)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::DNSSEC(DNSSECRData::RRSIG(ecp256))))
.clone();
let rrsig_ecp384 = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::RRSIG)
.set_record_type(RecordType::RRSIG)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::DNSSEC(DNSSECRData::RRSIG(ecp384))))
.clone();
let rrsig_ed25519 = Record::new()
.set_name(name.clone())
.set_ttl(3600)
.set_rr_type(RecordType::RRSIG)
.set_record_type(RecordType::RRSIG)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::DNSSEC(DNSSECRData::RRSIG(ed25519))))
.clone();
@@ -950,7 +950,7 @@ mod test {
let a = Record::new()
.set_name(name)
.set_ttl(3600)
.set_rr_type(RecordType::A)
.set_record_type(RecordType::A)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 24).into())))
.clone();

View File

@@ -376,7 +376,7 @@ impl<'a> Parser<'a> {
record.set_name(current_name.clone().ok_or_else(|| {
ParseError::from(ParseErrorKind::Message("record name not specified"))
})?);
record.set_rr_type(rtype);
record.set_record_type(rtype);
record.set_dns_class(class);
// slightly annoying, need to grab the TTL, then move rdata into the record,

View File

@@ -551,7 +551,7 @@ mod test {
Record::new()
.set_name(name)
.set_ttl(86400)
.set_rr_type(RecordType::A)
.set_record_type(RecordType::A)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 34).into())))
.clone(),
@@ -583,7 +583,7 @@ mod test {
let soa = Record::new()
.set_name(origin.clone())
.set_ttl(3600)
.set_rr_type(RecordType::SOA)
.set_record_type(RecordType::SOA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::SOA(SOA::new(
Name::parse("sns.dns.icann.org.", None).unwrap(),
@@ -601,7 +601,7 @@ mod test {
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"a.iana-servers.net.",
@@ -612,7 +612,7 @@ mod test {
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::NS)
.set_record_type(RecordType::NS)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::NS(NS(Name::parse(
"b.iana-servers.net.",
@@ -623,14 +623,14 @@ mod test {
Record::new()
.set_name(origin.clone())
.set_ttl(86400)
.set_rr_type(RecordType::A)
.set_record_type(RecordType::A)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::A(Ipv4Addr::new(93, 184, 216, 34).into())))
.clone(),
Record::new()
.set_name(origin)
.set_ttl(86400)
.set_rr_type(RecordType::AAAA)
.set_record_type(RecordType::AAAA)
.set_dns_class(DNSClass::IN)
.set_data(Some(RData::AAAA(
Ipv6Addr::new(0x2606, 0x2800, 0x220, 0x1, 0x248, 0x1893, 0x25c8, 0x1946).into(),

View File

@@ -185,7 +185,7 @@ impl SqliteAuthority {
info!("persisting zone to journal at SOA.serial: {}", serial);
// TODO: THIS NEEDS TO BE IN A TRANSACTION!!!
journal.insert_record(serial, Record::new().set_rr_type(RecordType::AXFR))?;
journal.insert_record(serial, Record::new().set_record_type(RecordType::AXFR))?;
for rr_set in self.in_memory.records().await.values() {
// TODO: should we preserve rr_sets or not?

View File

@@ -726,7 +726,7 @@ pub fn test_delete_all<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys
assert!(update_authority(message, key, &mut authority).expect("create failed"));
let mut record = record.clone();
record.set_rr_type(RecordType::AAAA);
record.set_record_type(RecordType::AAAA);
record.set_data(Some(RData::AAAA(AAAA::new(1, 2, 3, 4, 5, 6, 7, 8))));
let message = update_message::create(
record.clone().into(),

View File

@@ -34,7 +34,7 @@ fn create_test_journal() -> (Record, Journal) {
let mut record = Record::new();
record.set_name(www);
record.set_rr_type(RecordType::A);
record.set_record_type(RecordType::A);
record.set_data(Some(RData::A(A::from_str("127.0.0.1").unwrap())));
// test that this message can be inserted