Skip to content

Commit

Permalink
Rule: function to set fw_mark when adding rule
Browse files Browse the repository at this point in the history
  • Loading branch information
richardstephens authored and JohnTitor committed Nov 23, 2023
1 parent 454fc58 commit dabef43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rule/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ impl<T> RuleAddRequest<T> {
self
}

/// Set the fwmark
pub fn fw_mark(mut self, fw_mark: u32) -> Self {
self.message.nlas.push(Nla::FwMark(fw_mark));
self
}

/// Build an IP v4 rule
pub fn v4(mut self) -> RuleAddRequest<Ipv4Addr> {
self.message.header.family = AF_INET as u8;
Expand Down

0 comments on commit dabef43

Please sign in to comment.