Skip to content

Commit

Permalink
Add documentation for DnsRawEvent
Browse files Browse the repository at this point in the history
Close: #964
  • Loading branch information
danbi2990 committed Feb 19, 2025
1 parent 5b643fa commit 9a3433e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Documentation of the following GraphQL APIs is updated:
- `connRawEvents`
- `networkRawEvents`
- `dnsRawEvents`
- `ftpRawEvents`
- `httpRawEvents`
- `tlsRawEvents`
Expand Down
42 changes: 42 additions & 0 deletions src/graphql/client/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -389,25 +389,67 @@ type DnsEventEventEdge {
cursor: String!
}

# Represents an event extracted from the DNS protocol.
type DnsRawEvent {
# Start Time
time: DateTime!

# Source IP address
origAddr: String!

# Source Port Number
origPort: Int!

# Destination IP Address
respAddr: String!

# Destination Port Number
respPort: Int!

# Protocol Number
#
# TCP is 6, and UDP is 17.
proto: Int!

# End Time
#
# It is measured in nanoseconds.
lastTime: StringNumberI64!

# Query
query: String!

# Answer
answer: [String!]!

# Transaction ID
transId: Int!

# Round-Trip Time
rtt: StringNumberI64!

# Query Class
qclass: Int!

# Query Type
qtype: Int!

# Response Code
rcode: Int!

# Authoritative Answer Flag
aaFlag: Boolean!

# Truncated Flag
tcFlag: Boolean!

# Recursion Desired Flag
rdFlag: Boolean!

# Recursion Available Flag
raFlag: Boolean!

# Time to Live
ttl: [Int!]!
}

Expand Down
24 changes: 24 additions & 0 deletions src/graphql/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,52 @@ struct ConnRawEvent {
resp_l2_bytes: StringNumberU64,
}

/// Represents an event extracted from the DNS protocol.
#[allow(clippy::struct_excessive_bools)]
#[derive(SimpleObject, Debug, ConvertGraphQLEdgesNode)]
#[graphql_client_type(names = [dns_raw_events::DnsRawEventsDnsRawEventsEdgesNode, network_raw_events::NetworkRawEventsNetworkRawEventsEdgesNodeOnDnsRawEvent])]
struct DnsRawEvent {
/// Start Time
time: DateTime<Utc>,
/// Source IP address
orig_addr: String,
/// Source Port Number
orig_port: u16,
/// Destination IP Address
resp_addr: String,
/// Destination Port Number
resp_port: u16,
/// Protocol Number
///
/// TCP is 6, and UDP is 17.
proto: u8,
/// End Time
///
/// It is measured in nanoseconds.
last_time: StringNumberI64,
/// Query
query: String,
/// Answer
answer: Vec<String>,
/// Transaction ID
trans_id: u16,
/// Round-Trip Time
rtt: StringNumberI64,
/// Query Class
qclass: u16,
/// Query Type
qtype: u16,
/// Response Code
rcode: u16,
/// Authoritative Answer Flag
aa_flag: bool,
/// Truncated Flag
tc_flag: bool,
/// Recursion Desired Flag
rd_flag: bool,
/// Recursion Available Flag
ra_flag: bool,
/// Time to Live
ttl: Vec<i32>,
}

Expand Down

0 comments on commit 9a3433e

Please sign in to comment.