Skip to content

Commit

Permalink
docs: add some more docs to IR types
Browse files Browse the repository at this point in the history
  • Loading branch information
SichangHe committed Sep 13, 2024
1 parent 482b8f6 commit 5a17859
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions route_verification/ir/src/mp_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use itertools::chain;

use super::*;

/// Clustered by their IP versions, a collection of rule entries.
#[derive(Clone, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(default)]
pub struct Versions {
Expand Down Expand Up @@ -48,6 +49,8 @@ impl std::fmt::Debug for Versions {
}
}

/// Clustered by their cast types (unicast vs. multicast),
/// a collection of rule entries.
#[derive(Clone, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(default)]
pub struct Casts {
Expand Down Expand Up @@ -90,6 +93,8 @@ impl Casts {
}
}

/// Representation of an RPSL rule entry, consisting of one or
/// more `<mp-peering> [<actions>]` and a `<mp-filter>`.
#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub struct Entry {
#[serde(default)]
Expand Down
3 changes: 3 additions & 0 deletions route_verification/ir/src/peering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn parse_single_as_expr(single: String) -> AsExpr {
}
}

/// > ```ignore
/// > The syntax of a peering specification is:
/// >
/// > <as-expression> [<router-expression-1>] [at <router-expression-2>]
Expand All @@ -37,6 +38,7 @@ pub fn parse_single_as_expr(single: String) -> AsExpr {
/// > local AS that peer with ASes in <as-expression>. If <router-
/// > expression-1> is not specified, it defaults to all routers of the
/// > peer ASes in <as-expression> that peer with the local AS.
/// > ```
///
/// <https://www.rfc-editor.org/rfc/rfc2622#section-5.6>
#[derive(Clone, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
Expand Down Expand Up @@ -66,6 +68,7 @@ impl std::fmt::Debug for Peering {
}
}

/// Representation of `<mp-peering> [<actions>]` in an RPSL rule.
#[derive(Clone, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub struct PeeringAction {
pub mp_peering: Peering,
Expand Down

0 comments on commit 5a17859

Please sign in to comment.