asterust_junos/policy_options/
as_path.rs1use crate::{has_leaf, split_name, unquote};
9use asterust::config::ConfigLine;
10
11#[derive(Clone, Debug, PartialEq, Eq)]
13#[non_exhaustive]
14pub struct AsPath {
15 pub name: String,
16 pub regex: String,
17 pub dynamic_db: bool,
19}
20
21pub(super) fn parse_as_path(line: &ConfigLine) -> Option<AsPath> {
22 let (name, regex) = split_name(line.arg("as-path")?);
23 Some(AsPath {
24 name: name.to_string(),
25 regex: unquote(regex).to_string(),
26 dynamic_db: has_leaf(line, "dynamic-db"),
27 })
28}