Skip to content

Commit

Permalink
change rr atributte from class to rclass
Browse files Browse the repository at this point in the history
change get_class to get_rclass
change set_class to set_rclass functions
  • Loading branch information
Litr0 committed Oct 6, 2023
1 parent 06f82c7 commit bae1a62
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ mod message_test {

assert_eq!(answer[0].get_name().get_name(), String::from("dcc.cl"));
assert_eq!(Rtype::from_rtype_to_int(answer[0].get_rtype()), 16);
assert_eq!(Rclass::from_rclass_to_int(answer[0].get_class()), 1);
assert_eq!(Rclass::from_rclass_to_int(answer[0].get_rclass()), 1);
assert_eq!(answer[0].get_ttl(), 5642);
assert_eq!(answer[0].get_rdlength(), 6);
assert_eq!(
Expand Down Expand Up @@ -1114,7 +1114,7 @@ mod message_test {

resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::TXT);
resource_record.set_class(Rclass::IN);
resource_record.set_rclass(Rclass::IN);
resource_record.set_ttl(5642);
resource_record.set_rdlength(6);

Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/a_ch_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl AChRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::A);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(name.len() as u16 + 4);

Expand Down Expand Up @@ -312,7 +312,7 @@ mod a_ch_rdata_test {
"admin.googleplex".to_string(),
"edu".to_string());

assert_eq!(ach_rr.get_class(), Rclass::CH);
assert_eq!(ach_rr.get_rclass(), Rclass::CH);
assert_eq!(ach_rr.get_name().get_name(), String::from("admin.googleplex"));
assert_eq!(ach_rr.get_rtype(), Rtype::A);
assert_eq!(ach_rr.get_ttl(), 0);
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/a_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl ARdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::A);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(4);

Expand Down Expand Up @@ -236,7 +236,7 @@ mod a_rdata_test {
"admin1.googleplex.edu".to_string(),
);

assert_eq!(a_rr.get_class(), Rclass::IN);
assert_eq!(a_rr.get_rclass(), Rclass::IN);
assert_eq!(
a_rr.get_name().get_name(),
String::from("admin1.googleplex.edu")
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/cname_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl CnameRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::CNAME);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(name.len() as u16 + 2);

Expand Down Expand Up @@ -186,7 +186,7 @@ mod cname_rdata_test {
"admin1.googleplex.edu".to_string(),
);

assert_eq!(cname_rr.get_class(), Rclass::IN);
assert_eq!(cname_rr.get_rclass(), Rclass::IN);
assert_eq!(
cname_rr.get_name().get_name(),
String::from("admin1.googleplex.edu")
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/hinfo_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl HinfoRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::HINFO);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(cpu.len() as u16 + os.len() as u16);

Expand Down Expand Up @@ -258,7 +258,7 @@ mod hinfo_rdata_test {

let hinfo_rdata = hinfo_rr.get_rdata();

assert_eq!(hinfo_rr.get_class(), Rclass::IN);
assert_eq!(hinfo_rr.get_rclass(), Rclass::IN);
assert_eq!(hinfo_rr.get_name().get_name(), "dcc.cl");
assert_eq!(hinfo_rr.get_ttl(), 15);
assert_eq!(hinfo_rr.get_rtype(), Rtype::HINFO);
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/mx_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl MxRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::MX);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(name.len() as u16 + 4);

Expand Down Expand Up @@ -289,7 +289,7 @@ mod mx_rdata_test {
String::from("uchile.cl"),
String::from("uchile.cl"));

assert_eq!(mxrdata_rr.get_class(), Rclass::IN);
assert_eq!(mxrdata_rr.get_rclass(), Rclass::IN);
assert_eq!(mxrdata_rr.get_rtype(), Rtype::MX);
assert_eq!(mxrdata_rr.get_ttl(), 20);
assert_eq!(mxrdata_rr.get_name().get_name(), String::from("uchile.cl"));
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/ns_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl NsRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::NS);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(name.len() as u16 + 2);

Expand Down Expand Up @@ -211,7 +211,7 @@ mod ns_rdata_test {
String::from("uchile.cl"),
String::from("uchile.cl"));

assert_eq!(nsrdata_rr.get_class(), Rclass::IN);
assert_eq!(nsrdata_rr.get_rclass(), Rclass::IN);
assert_eq!(nsrdata_rr.get_ttl(), 35);
assert_eq!(nsrdata_rr.get_name().get_name(), String::from("uchile.cl"));
assert_eq!(nsrdata_rr.get_rdlength(), 5);
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/ptr_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl PtrRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::PTR);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(name.len() as u16 + 2);

Expand Down Expand Up @@ -217,7 +217,7 @@ mod ptr_rdata_test {
String::from("uchile.cl"),
String::from("uchile.cl"));

assert_eq!(ptr_rdata_rr.get_class(), Rclass::IN);
assert_eq!(ptr_rdata_rr.get_rclass(), Rclass::IN);
assert_eq!(ptr_rdata_rr.get_ttl(), 35);
assert_eq!(ptr_rdata_rr.get_name().get_name(), String::from("uchile.cl"));
assert_eq!(ptr_rdata_rr.get_rdlength(), 5);
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/soa_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl SoaRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::SOA);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(20 + m_name_str.len() as u16 + r_name_str.len() as u16 + 4);

Expand Down Expand Up @@ -713,7 +713,7 @@ mod soa_rdata_test {
let (soardata_rr, minimum) = soardata_rr_min;

assert_eq!(minimum, 150);
assert_eq!(soardata_rr.get_class(), Rclass::IN);
assert_eq!(soardata_rr.get_rclass(), Rclass::IN);
assert_eq!(soardata_rr.get_ttl(), 56);
assert_eq!(soardata_rr.get_name().get_name(), String::from("uchile.cl"));
assert_eq!(soardata_rr.get_rdlength(), 35);
Expand Down
4 changes: 2 additions & 2 deletions src/message/rdata/txt_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl TxtRdata {
resource_record.set_name(domain_name);
resource_record.set_type_code(Rtype::TXT);
let rclass = Rclass::from_str_to_rclass(class);
resource_record.set_class(rclass);
resource_record.set_rclass(rclass);
resource_record.set_ttl(ttl);
resource_record.set_rdlength(rd_lenght as u16);

Expand Down Expand Up @@ -202,7 +202,7 @@ mod txt_rdata_test {
"IN",
String::from("uchile.cl"));

assert_eq!(txtrdata_rr.get_class(), Rclass::IN);
assert_eq!(txtrdata_rr.get_rclass(), Rclass::IN);
assert_eq!(txtrdata_rr.get_ttl(), 25);
assert_eq!(txtrdata_rr.get_rdlength(), 3);
assert_eq!(txtrdata_rr.get_name().get_name(), String::from("uchile.cl"));
Expand Down
Loading

0 comments on commit bae1a62

Please sign in to comment.