Skip to main content

asterust_junos/system/services/
xnm_clear_text.rs

1//! `system { services { xnm-clear-text { ... } } }`.
2
3use crate::arg_of;
4use asterust::config::ConfigLine;
5
6/// The `xnm-clear-text` block.
7#[derive(Clone, Debug, PartialEq, Eq)]
8#[non_exhaustive]
9pub struct XnmClearText {
10    pub connection_limit: Option<String>,
11    pub rate_limit: Option<String>,
12}
13
14pub(super) fn parse_xnm_clear_text(xnm: &ConfigLine) -> XnmClearText {
15    XnmClearText {
16        connection_limit: arg_of(xnm, "connection-limit").map(str::to_string),
17        rate_limit: arg_of(xnm, "rate-limit").map(str::to_string),
18    }
19}