Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tailhook/dns-parser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: stanford-esrg/dns-parser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 6 files changed
  • 1 contributor

Commits on Dec 24, 2021

  1. add serialize, public TXT

    thegwan committed Dec 24, 2021
    Copy the full SHA
    583ed07 View commit details
Showing with 12 additions and 10 deletions.
  1. +3 −5 Cargo.toml
  2. +2 −1 src/enums.rs
  3. +2 −1 src/lib.rs
  4. +2 −1 src/rdata/a.rs
  5. +2 −1 src/rdata/aaaa.rs
  6. +1 −1 src/rdata/txt.rs
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,15 +13,13 @@ documentation = "https://docs.rs/dns-parser"
version = "0.8.0"
authors = ["Paul Colomiets <paul@colomiets.name>"]

[features]
with-serde = ["serde", "serde_derive"]
# [features]
# with-serde = ["serde", "serde_derive"]

[dependencies]
quick-error = "1.0.0"
byteorder = "1"

serde = { version = "1.0", optional = true }
serde_derive = { version = "1.0", optional = true }
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies]
matches = "0.1.2"
3 changes: 2 additions & 1 deletion src/enums.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use {Error};
use rdata::Record;
use rdata::*;
use serde::Serialize;

/// The TYPE value according to RFC 1035
///
@@ -143,7 +144,7 @@ pub enum Opcode {

quick_error! {
/// The RCODE value according to RFC 1035
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize)]
#[allow(missing_docs)] // names are from spec
pub enum ResponseCode {
NoError
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -16,9 +16,10 @@
#![warn(missing_debug_implementations)]

extern crate byteorder;
extern crate serde;
#[cfg(test)] #[macro_use] extern crate matches;
#[macro_use(quick_error)] extern crate quick_error;
#[cfg(feature = "with-serde")] #[macro_use] extern crate serde_derive;
//#[cfg(feature = "with-serde")] #[macro_use] extern crate serde_derive;

mod enums;
mod structs;
3 changes: 2 additions & 1 deletion src/rdata/a.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,9 @@ use std::net::Ipv4Addr;

use Error;
use byteorder::{BigEndian, ByteOrder};
use serde::Serialize;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize)]
pub struct Record(pub Ipv4Addr);

impl<'a> super::Record<'a> for Record {
3 changes: 2 additions & 1 deletion src/rdata/aaaa.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,9 @@ use std::net::Ipv6Addr;

use Error;
use byteorder::{BigEndian, ByteOrder};
use serde::Serialize;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize)]
pub struct Record(pub Ipv6Addr);

impl<'a> super::Record<'a> for Record {
2 changes: 1 addition & 1 deletion src/rdata/txt.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ use Error;

#[derive(Debug, Clone)]
pub struct Record<'a> {
bytes: &'a [u8],
pub bytes: &'a [u8],
}

#[derive(Debug)]