a netfilter mark/mask pair More...

#include <NfMarkConfig.h>

Collaboration diagram for Ip::NfMarkConfig:

Public Member Functions

 NfMarkConfig ()
 creates an empty object More...
 
 NfMarkConfig (nfmark_t mark_val, nfmark_t mask_val)
 creates an object with specified mark and mask More...
 
bool matches (const nfmark_t m) const
 whether the 'm' matches the configured mark/mask More...
 
bool isEmpty () const
 whether the netfilter mark is unset More...
 
bool hasMask () const
 whether the mask is set More...
 
nfmark_t applyToMark (nfmark_t m) const
 

Static Public Member Functions

static NfMarkConfig Parse (const SBuf &token)
 parses a token and returns an object, expects a "mark[/mask]" format More...
 

Public Attributes

nfmark_t mark = 0
 
nfmark_t mask = 0xffffffff
 

Detailed Description

Definition at line 22 of file NfMarkConfig.h.

Constructor & Destructor Documentation

◆ NfMarkConfig() [1/2]

Ip::NfMarkConfig::NfMarkConfig ( )
inline

Definition at line 26 of file NfMarkConfig.h.

◆ NfMarkConfig() [2/2]

Ip::NfMarkConfig::NfMarkConfig ( nfmark_t  mark_val,
nfmark_t  mask_val 
)
inline

Definition at line 28 of file NfMarkConfig.h.

Member Function Documentation

◆ applyToMark()

nfmark_t Ip::NfMarkConfig::applyToMark ( nfmark_t  m) const

Applies configured mark/mask to previously set mark (m). m is ANDed with the negated mask and then ORed with the configured mark.

Returns
new mark. This is similar to what iptables –set-mark does.

Definition at line 46 of file NfMarkConfig.cc.

Referenced by Ip::Qos::setNfConnmark().

◆ hasMask()

bool Ip::NfMarkConfig::hasMask ( ) const
inline

Definition at line 37 of file NfMarkConfig.h.

References mask.

◆ isEmpty()

bool Ip::NfMarkConfig::isEmpty ( ) const
inline

Definition at line 35 of file NfMarkConfig.h.

References mark.

Referenced by Ip::Qos::Config::isAclNfmarkActive().

◆ matches()

bool Ip::NfMarkConfig::matches ( const nfmark_t  m) const
inline

Definition at line 33 of file NfMarkConfig.h.

References mark, and mask.

◆ Parse()

Ip::NfMarkConfig Ip::NfMarkConfig::Parse ( const SBuf token)
static

Member Data Documentation

◆ mark

nfmark_t Ip::NfMarkConfig::mark = 0

Definition at line 43 of file NfMarkConfig.h.

Referenced by isEmpty(), matches(), and Parse().

◆ mask

nfmark_t Ip::NfMarkConfig::mask = 0xffffffff

Definition at line 44 of file NfMarkConfig.h.

Referenced by hasMask(), matches(), and Parse().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors