A Discrete-Event Network Simulator
API
ns3::IpcsClassifierRecord Class Reference

IpcsClassifierRecord class. More...

#include "ipcs-classifier-record.h"

+ Collaboration diagram for ns3::IpcsClassifierRecord:

Classes

struct  Ipv4Addr
 Ipv4Addr structure. More...
 
struct  PortRange
 PortRange structure. More...
 

Public Member Functions

 IpcsClassifierRecord ()
 
 IpcsClassifierRecord (Ipv4Address srcAddress, Ipv4Mask srcMask, Ipv4Address dstAddress, Ipv4Mask dstMask, uint16_t srcPortLow, uint16_t srcPortHigh, uint16_t dstPortLow, uint16_t dstPortHigh, uint8_t protocol, uint8_t priority)
 creates a classifier records and sets all its parameters More...
 
 IpcsClassifierRecord (Tlv tlv)
 Decodes a TLV and creates a classifier. More...
 
 ~IpcsClassifierRecord ()
 
void AddDstAddr (Ipv4Address dstAddress, Ipv4Mask dstMask)
 add a new destination ip address to the classifier More...
 
void AddDstPortRange (uint16_t dstPortLow, uint16_t dstPortHigh)
 add a range of destination port to the classifier More...
 
void AddProtocol (uint8_t proto)
 add a protocol to the classifier More...
 
void AddSrcAddr (Ipv4Address srcAddress, Ipv4Mask srcMask)
 add a new source ip address to the classifier More...
 
void AddSrcPortRange (uint16_t srcPortLow, uint16_t srcPortHigh)
 add a range of source port to the classifier More...
 
bool CheckMatch (Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
 check if a packets can be used with this classifier More...
 
uint16_t GetCid () const
 
uint16_t GetIndex () const
 
uint8_t GetPriority () const
 
void SetCid (uint16_t cid)
 Set the cid associated to this classifier. More...
 
void SetIndex (uint16_t index)
 Set the index of the classifier. More...
 
void SetPriority (uint8_t prio)
 Set the priority of this classifier. More...
 
Tlv ToTlv () const
 Creates a TLV from this classifier. More...
 

Private Member Functions

bool CheckMatchDstAddr (Ipv4Address dstAddress) const
 Check match destination address function. More...
 
bool CheckMatchDstPort (uint16_t dstPort) const
 Check match destination port function. More...
 
bool CheckMatchProtocol (uint8_t proto) const
 Check match protocol function. More...
 
bool CheckMatchSrcAddr (Ipv4Address srcAddress) const
 Check match source address function. More...
 
bool CheckMatchSrcPort (uint16_t srcPort) const
 Check match source port function. More...
 

Private Attributes

uint16_t m_cid
 the CID More...
 
std::vector< Ipv4Addrm_dstAddr
 destination address More...
 
std::vector< PortRangem_dstPortRange
 destination port range More...
 
uint16_t m_index
 index More...
 
uint8_t m_priority
 priority More...
 
std::vector< uint8_t > m_protocol
 protocol More...
 
std::vector< Ipv4Addrm_srcAddr
 source address More...
 
std::vector< PortRangem_srcPortRange
 source port range More...
 
uint8_t m_tosHigh
 TOS high. More...
 
uint8_t m_tosLow
 TOS low. More...
 
uint8_t m_tosMask
 TOS mask. More...
 

Detailed Description

IpcsClassifierRecord class.

Definition at line 37 of file ipcs-classifier-record.h.

Constructor & Destructor Documentation

◆ IpcsClassifierRecord() [1/3]

ns3::IpcsClassifierRecord::IpcsClassifierRecord ( )

Definition at line 32 of file ipcs-classifier-record.cc.

References AddDstAddr(), AddDstPortRange(), AddSrcAddr(), AddSrcPortRange(), m_cid, m_index, m_priority, m_protocol, m_tosHigh, m_tosLow, and m_tosMask.

+ Here is the call graph for this function:

◆ ~IpcsClassifierRecord()

ns3::IpcsClassifierRecord::~IpcsClassifierRecord ( )

Definition at line 49 of file ipcs-classifier-record.cc.

◆ IpcsClassifierRecord() [2/3]

ns3::IpcsClassifierRecord::IpcsClassifierRecord ( Ipv4Address  srcAddress,
Ipv4Mask  srcMask,
Ipv4Address  dstAddress,
Ipv4Mask  dstMask,
uint16_t  srcPortLow,
uint16_t  srcPortHigh,
uint16_t  dstPortLow,
uint16_t  dstPortHigh,
uint8_t  protocol,
uint8_t  priority 
)

creates a classifier records and sets all its parameters

Parameters
srcAddressthe source ip address
srcMaskthe mask to apply on the source ip address
dstAddressthe destination ip address
dstMaskthe mask to apply on the destination ip address
srcPortLowthe lower boundary of the source port range
srcPortHighthe higher boundary of the source port range
dstPortLowthe lower boundary of the destination port range
dstPortHighthe higher boundary of the destination port range
protocolthe L4 protocol
prioritythe priority of this classifier

Definition at line 125 of file ipcs-classifier-record.cc.

References AddDstAddr(), AddDstPortRange(), AddSrcAddr(), AddSrcPortRange(), m_cid, m_index, m_priority, m_protocol, m_tosHigh, m_tosLow, and m_tosMask.

+ Here is the call graph for this function:

◆ IpcsClassifierRecord() [3/3]

Member Function Documentation

◆ AddDstAddr()

void ns3::IpcsClassifierRecord::AddDstAddr ( Ipv4Address  dstAddress,
Ipv4Mask  dstMask 
)

add a new destination ip address to the classifier

Parameters
dstAddressthe destination ip address
dstMaskthe mask to apply on the destination ip address

Definition at line 159 of file ipcs-classifier-record.cc.

References ns3::IpcsClassifierRecord::Ipv4Addr::Address, m_dstAddr, and ns3::IpcsClassifierRecord::Ipv4Addr::Mask.

Referenced by IpcsClassifierRecord(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ AddDstPortRange()

void ns3::IpcsClassifierRecord::AddDstPortRange ( uint16_t  dstPortLow,
uint16_t  dstPortHigh 
)

add a range of destination port to the classifier

Parameters
dstPortLowthe lower boundary of the destination port range
dstPortHighthe higher boundary of the destination port range

Definition at line 177 of file ipcs-classifier-record.cc.

References m_dstPortRange, ns3::IpcsClassifierRecord::PortRange::PortHigh, and ns3::IpcsClassifierRecord::PortRange::PortLow.

Referenced by IpcsClassifierRecord(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ AddProtocol()

void ns3::IpcsClassifierRecord::AddProtocol ( uint8_t  proto)

add a protocol to the classifier

Parameters
protothe L4 protocol to add

Definition at line 186 of file ipcs-classifier-record.cc.

References m_protocol.

Referenced by IpcsClassifierRecord(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ AddSrcAddr()

void ns3::IpcsClassifierRecord::AddSrcAddr ( Ipv4Address  srcAddress,
Ipv4Mask  srcMask 
)

add a new source ip address to the classifier

Parameters
srcAddressthe source ip address
srcMaskthe mask to apply on the source ip address

Definition at line 150 of file ipcs-classifier-record.cc.

References ns3::IpcsClassifierRecord::Ipv4Addr::Address, m_srcAddr, and ns3::IpcsClassifierRecord::Ipv4Addr::Mask.

Referenced by IpcsClassifierRecord(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ AddSrcPortRange()

void ns3::IpcsClassifierRecord::AddSrcPortRange ( uint16_t  srcPortLow,
uint16_t  srcPortHigh 
)

add a range of source port to the classifier

Parameters
srcPortLowthe lower boundary of the source port range
srcPortHighthe higher boundary of the source port range

Definition at line 168 of file ipcs-classifier-record.cc.

References m_srcPortRange, ns3::IpcsClassifierRecord::PortRange::PortHigh, and ns3::IpcsClassifierRecord::PortRange::PortLow.

Referenced by IpcsClassifierRecord(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ CheckMatch()

bool ns3::IpcsClassifierRecord::CheckMatch ( Ipv4Address  srcAddress,
Ipv4Address  dstAddress,
uint16_t  srcPort,
uint16_t  dstPort,
uint8_t  proto 
) const

check if a packets can be used with this classifier

Parameters
srcAddressthe source ip address of the packet
dstAddressthe destination ip address of the packet
srcPortthe source port of the packet
dstPortthe destination port of the packet
protoThe L4 protocol of the packet
Returns
true if there is a match

Definition at line 307 of file ipcs-classifier-record.cc.

References CheckMatchDstAddr(), CheckMatchDstPort(), CheckMatchProtocol(), CheckMatchSrcAddr(), and CheckMatchSrcPort().

Referenced by ns3::ServiceFlow::CheckClassifierMatch(), and Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckMatchDstAddr()

bool ns3::IpcsClassifierRecord::CheckMatchDstAddr ( Ipv4Address  dstAddress) const
private

Check match destination address function.

Parameters
dstAddressdestination IP address to check
Returns
true if a match

Definition at line 244 of file ipcs-classifier-record.cc.

References ns3::Ipv4Address::CombineMask(), m_dstAddr, and NS_LOG_INFO.

Referenced by CheckMatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckMatchDstPort()

bool ns3::IpcsClassifierRecord::CheckMatchDstPort ( uint16_t  dstPort) const
private

Check match destination port function.

Parameters
dstPortdestination port to check
Returns
true if a match

Definition at line 276 of file ipcs-classifier-record.cc.

References m_dstPortRange, NS_LOG_INFO, and port.

Referenced by CheckMatch().

+ Here is the caller graph for this function:

◆ CheckMatchProtocol()

bool ns3::IpcsClassifierRecord::CheckMatchProtocol ( uint8_t  proto) const
private

Check match protocol function.

Parameters
protoprotocol number to check
Returns
true if a match

Definition at line 292 of file ipcs-classifier-record.cc.

References m_protocol, and NS_LOG_INFO.

Referenced by CheckMatch().

+ Here is the caller graph for this function:

◆ CheckMatchSrcAddr()

bool ns3::IpcsClassifierRecord::CheckMatchSrcAddr ( Ipv4Address  srcAddress) const
private

Check match source address function.

Parameters
srcAddresssource IP address to check
Returns
true if a match

Definition at line 228 of file ipcs-classifier-record.cc.

References ns3::Ipv4Address::CombineMask(), m_srcAddr, and NS_LOG_INFO.

Referenced by CheckMatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckMatchSrcPort()

bool ns3::IpcsClassifierRecord::CheckMatchSrcPort ( uint16_t  srcPort) const
private

Check match source port function.

Parameters
srcPortsource port to check
Returns
true if a match

Definition at line 260 of file ipcs-classifier-record.cc.

References m_srcPortRange, NS_LOG_INFO, and port.

Referenced by CheckMatch().

+ Here is the caller graph for this function:

◆ GetCid()

uint16_t ns3::IpcsClassifierRecord::GetCid ( ) const
Returns
the cid associated with this classifier

Definition at line 216 of file ipcs-classifier-record.cc.

References m_cid.

◆ GetIndex()

uint16_t ns3::IpcsClassifierRecord::GetIndex ( ) const
Returns
the index of this classifier

Definition at line 210 of file ipcs-classifier-record.cc.

References m_index.

◆ GetPriority()

uint8_t ns3::IpcsClassifierRecord::GetPriority ( ) const
Returns
the priority of this classifier

Definition at line 222 of file ipcs-classifier-record.cc.

References m_priority.

◆ SetCid()

void ns3::IpcsClassifierRecord::SetCid ( uint16_t  cid)

Set the cid associated to this classifier.

Parameters
cidthe connection identifier

Definition at line 198 of file ipcs-classifier-record.cc.

References m_cid.

◆ SetIndex()

void ns3::IpcsClassifierRecord::SetIndex ( uint16_t  index)

Set the index of the classifier.

Parameters
indexthe index of the classifier

Definition at line 204 of file ipcs-classifier-record.cc.

References m_index.

Referenced by Ns3WimaxCsParamTlvTestCase::DoRun().

+ Here is the caller graph for this function:

◆ SetPriority()

void ns3::IpcsClassifierRecord::SetPriority ( uint8_t  prio)

Set the priority of this classifier.

Parameters
priothe priority of the classifier

Definition at line 192 of file ipcs-classifier-record.cc.

References m_priority.

◆ ToTlv()

Member Data Documentation

◆ m_cid

uint16_t ns3::IpcsClassifierRecord::m_cid
private

the CID

Definition at line 204 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord(), GetCid(), and SetCid().

◆ m_dstAddr

std::vector<Ipv4Addr> ns3::IpcsClassifierRecord::m_dstAddr
private

destination address

Definition at line 200 of file ipcs-classifier-record.h.

Referenced by AddDstAddr(), CheckMatchDstAddr(), and ToTlv().

◆ m_dstPortRange

std::vector<PortRange> ns3::IpcsClassifierRecord::m_dstPortRange
private

destination port range

Definition at line 202 of file ipcs-classifier-record.h.

Referenced by AddDstPortRange(), CheckMatchDstPort(), and ToTlv().

◆ m_index

uint16_t ns3::IpcsClassifierRecord::m_index
private

index

Definition at line 194 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord(), GetIndex(), and SetIndex().

◆ m_priority

uint8_t ns3::IpcsClassifierRecord::m_priority
private

priority

Definition at line 193 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord(), GetPriority(), SetPriority(), and ToTlv().

◆ m_protocol

std::vector<uint8_t> ns3::IpcsClassifierRecord::m_protocol
private

protocol

Definition at line 198 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord(), AddProtocol(), CheckMatchProtocol(), and ToTlv().

◆ m_srcAddr

std::vector<Ipv4Addr> ns3::IpcsClassifierRecord::m_srcAddr
private

source address

Definition at line 199 of file ipcs-classifier-record.h.

Referenced by AddSrcAddr(), CheckMatchSrcAddr(), and ToTlv().

◆ m_srcPortRange

std::vector<PortRange> ns3::IpcsClassifierRecord::m_srcPortRange
private

source port range

Definition at line 201 of file ipcs-classifier-record.h.

Referenced by AddSrcPortRange(), CheckMatchSrcPort(), and ToTlv().

◆ m_tosHigh

uint8_t ns3::IpcsClassifierRecord::m_tosHigh
private

TOS high.

Definition at line 196 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord().

◆ m_tosLow

uint8_t ns3::IpcsClassifierRecord::m_tosLow
private

TOS low.

Definition at line 195 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord().

◆ m_tosMask

uint8_t ns3::IpcsClassifierRecord::m_tosMask
private

TOS mask.

Definition at line 197 of file ipcs-classifier-record.h.

Referenced by IpcsClassifierRecord().


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