A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::IpcsClassifierRecord Class Reference

Classes

struct  ipv4Addr
 
struct  PortRange
 

Public Member Functions

 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...
 
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 (void) const
 
uint16_t GetIndex (void) const
 
uint8_t GetPriority (void) 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 (void) const
 Creates a TLV from this classifier. More...
 

Private Member Functions

bool CheckMatchDstAddr (Ipv4Address dstAddress) const
 
bool CheckMatchDstPort (uint16_t dstPort) const
 
bool CheckMatchProtocol (uint8_t proto) const
 
bool CheckMatchSrcAddr (Ipv4Address srcAddress) const
 
bool CheckMatchSrcPort (uint16_t srcPort) const
 

Private Attributes

uint16_t m_cid
 
std::vector< struct ipv4Addrm_dstAddr
 
std::vector< struct PortRangem_dstPortRange
 
uint16_t m_index
 
uint8_t m_priority
 
std::vector< uint8_t > m_protocol
 
std::vector< struct ipv4Addrm_srcAddr
 
std::vector< struct PortRangem_srcPortRange
 
uint8_t m_tosHigh
 
uint8_t m_tosLow
 
uint8_t m_tosMask
 

Detailed Description

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

Constructor & Destructor Documentation

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 127 of file ipcs-classifier-record.cc.

References AddDstAddr(), AddDstPortRange(), AddSrcAddr(), and AddSrcPortRange().

ns3::IpcsClassifierRecord::IpcsClassifierRecord ( Tlv  tlv)

Decodes a TLV and creates a classifier.

Parameters
tlvthe TLV to decode and from which the classifier parameters will be extracted

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

References AddDstAddr(), AddDstPortRange(), AddProtocol(), AddSrcAddr(), AddSrcPortRange(), NS_ASSERT_MSG, and NS_FATAL_ERROR.

Member Function Documentation

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 160 of file ipcs-classifier-record.cc.

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

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.

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

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

add a protocol to the classifier

Parameters
protothe L4 protocol to add

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

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

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 152 of file ipcs-classifier-record.cc.

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

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.

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

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

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

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

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

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

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

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

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

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

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

Set the cid associated to this classifier.

Parameters
cidthe connection identifier

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

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

Set the index of the classifier.

Parameters
indexthe index of the classifier

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

Referenced by Ns3WimaxCsParamTlvTestCase::DoRun().

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

Set the priority of this classifier.

Parameters
priothe priority of the classifier

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

Tlv ns3::IpcsClassifierRecord::ToTlv ( void  ) const

Creates a TLV from this classifier.

Returns
the created TLV

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

Referenced by ns3::CsParameters::ToTlv().


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