xorp

MfeaDfe Class Reference

Multicast dataflow entry class. More...

#include <mfea_dataflow.hh>

List of all members.

Public Member Functions

 MfeaDfe (MfeaDfeLookup &mfea_dfe_lookup, const TimeVal &threshold_interval, uint32_t threshold_packets, uint32_t threshold_bytes, bool is_threshold_in_packets, bool is_threshold_in_bytes, bool is_geq_upcall, bool is_leq_upcall)
 Constructor with information with the dataflow condition to satisfy.
 ~MfeaDfe ()
 Destructor.
MfeaDfeLookupmfea_dfe_lookup () const
 Get a reference to the MfeaDfeLookup entry this entry belongs to.
MfeaDftmfea_dft () const
 Get a reference to the MfeaDft dataflow table this entry belongs to.
EventLoopeventloop () const
 Get a reference to the EventLoop.
int family () const
 Get the address family.
const IPvXsource_addr () const
 Get the source address.
const IPvXgroup_addr () const
 Get the group address.
bool is_valid () const
 Test if this entry is valid.
bool is_same (const TimeVal &threshold_interval_test, uint32_t threshold_packets_test, uint32_t threshold_bytes_test, bool is_threshold_in_packets_test, bool is_threshold_in_bytes_test, bool is_geq_upcall_test, bool is_leq_upcall_test) const
 Compare whether the information contained within this MfeaDfe entry is same as the specified information.
void init_sg_count ()
 Initialize this entry with the current multicast forwarding information.
bool test_sg_count ()
 Test if the dataflow bandwidth satisfies the pre-defined condition.
void start_measurement ()
 Start bandwidth measurement.
void dataflow_signal_send ()
 Send a dataflow signal that the pre-defined condition is true.
const TimeValthreshold_interval () const
 Get the threshold interval.
uint32_t threshold_packets () const
 Get the threshold packets.
uint32_t threshold_bytes () const
 Get the threshold bytes.
bool is_threshold_in_packets () const
 Test if the threshold is in number of packets.
bool is_threshold_in_bytes () const
 Test if the threshold is in number of bytes.
bool is_geq_upcall () const
 Test if the threshold type is "greater-or-equal" (i.e., ">=").
bool is_leq_upcall () const
 Test if the threshold type is "less-or-equal" (i.e., "<=").
const TimeValstart_time () const
 Get the start time for the most recent measurement interval window.
uint32_t measured_packets () const
 Get the number of packets measured in the most recent interval window.
uint32_t measured_bytes () const
 Get the number of bytes measured in the most recent interval window.

Private Member Functions

void measurement_timer_timeout ()

Private Attributes

MfeaDfeLookup_mfea_dfe_lookup
TimeVal _threshold_interval
uint32_t _threshold_packets
uint32_t _threshold_bytes
bool _is_threshold_in_packets
bool _is_threshold_in_bytes
bool _is_geq_upcall
bool _is_leq_upcall
SgCount _last_sg_count
SgCount _measured_sg_count
SgCount _delta_sg_count [MFEA_DATAFLOW_TEST_FREQUENCY]
size_t _delta_sg_count_index
bool _is_bootstrap_completed
TimeVal _measurement_interval
XorpTimer _measurement_timer
TimeVal _start_time [MFEA_DATAFLOW_TEST_FREQUENCY]

Detailed Description

Multicast dataflow entry class.

This entry contains all the information about the condition a dataflow must satisfy to deliver a signal. It is (S,G)-specific, but there could be more than one MfeaDfe entries per (S,G).


Constructor & Destructor Documentation

MfeaDfe::MfeaDfe ( MfeaDfeLookup mfea_dfe_lookup,
const TimeVal threshold_interval,
uint32_t  threshold_packets,
uint32_t  threshold_bytes,
bool  is_threshold_in_packets,
bool  is_threshold_in_bytes,
bool  is_geq_upcall,
bool  is_leq_upcall 
)

Constructor with information with the dataflow condition to satisfy.

Note: either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. Note: either is_geq_upcall or is_leq_upcall (but not both) must be true.

Parameters:
mfea_dfe_lookupthe MfeaDfeLookup entry this entry belongs to.
threshold_intervalthe dataflow threshold interval.
threshold_packetsthe threshold (in number of packets) to compare against.
threshold_bytesthe threshold (in number of bytes) to compare against.
is_threshold_in_packetsif true, threshold_packets is valid.
is_threshold_in_bytesif true, threshold_bytes is valid.
is_geq_upcallif true, the operation for comparison is ">=".
is_leq_upcallif true, the operation for comparison is "<=".

Member Function Documentation

EventLoop & MfeaDfe::eventloop ( ) const

Get a reference to the EventLoop.

Returns:
a reference to the EventLoop.
int MfeaDfe::family ( ) const

Get the address family.

Returns:
the address family (e.g., AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
const IPvX& MfeaDfe::group_addr ( ) const [inline]

Get the group address.

Returns:
the group address.
void MfeaDfe::init_sg_count ( )

Initialize this entry with the current multicast forwarding information.

The current multicast forwarding bandwidth information is read from the kernel.

bool MfeaDfe::is_geq_upcall ( ) const [inline]

Test if the threshold type is "greater-or-equal" (i.e., ">=").

Returns:
true if the threshold type is "greater-or-equal" (i.e., ">=").
bool MfeaDfe::is_leq_upcall ( ) const [inline]

Test if the threshold type is "less-or-equal" (i.e., "<=").

Returns:
true if the threshold type is "less-or-equal" (i.e., "<=").
bool MfeaDfe::is_same ( const TimeVal threshold_interval_test,
uint32_t  threshold_packets_test,
uint32_t  threshold_bytes_test,
bool  is_threshold_in_packets_test,
bool  is_threshold_in_bytes_test,
bool  is_geq_upcall_test,
bool  is_leq_upcall_test 
) const

Compare whether the information contained within this MfeaDfe entry is same as the specified information.

Parameters:
threshold_interval_testthe dataflow threshold interval.
threshold_packets_testthe threshold (in number of packets) to compare against.
threshold_bytes_testthe threshold (in number of bytes) to compare against.
is_threshold_in_packets_testif true, threshold_packets is valid.
is_threshold_in_bytes_testif true, threshold_bytes is valid.
is_geq_upcall_testif true, the operation for comparison is ">=".
is_leq_upcall_testif true, the operation for comparison is "<=".
Returns:
true if the information contained within this MfeaDfe entry is same as the specified information, otherwise false.
bool MfeaDfe::is_threshold_in_bytes ( ) const [inline]

Test if the threshold is in number of bytes.

Returns:
true if the threshold is in number of bytes.
bool MfeaDfe::is_threshold_in_packets ( ) const [inline]

Test if the threshold is in number of packets.

Returns:
true if the threshold is in number of packets.
bool MfeaDfe::is_valid ( ) const

Test if this entry is valid.

An entry is valid if, for example: (a) either is_threshold_in_packets or is_threshold_in_bytes (or both) must be true. (b) either is_geq_upcall or is_leq_upcall (but not both) must be true. (c) the threshold interval is not too small. (d) the bandwidth-related statistics do not contain invalid values.

Returns:
true if this entry is valid, otherwise false.
uint32_t MfeaDfe::measured_bytes ( ) const

Get the number of bytes measured in the most recent interval window.

Returns:
the number of bytes measured in the most recent interval window.
uint32_t MfeaDfe::measured_packets ( ) const

Get the number of packets measured in the most recent interval window.

Returns:
the number of packets measured in the most recent interval window.
MfeaDfeLookup& MfeaDfe::mfea_dfe_lookup ( ) const [inline]

Get a reference to the MfeaDfeLookup entry this entry belongs to.

Returns:
a reference to the MfeaDfeLookup entry this entry belongs to.
MfeaDft & MfeaDfe::mfea_dft ( ) const

Get a reference to the MfeaDft dataflow table this entry belongs to.

Returns:
a reference to the MfeaDft dataflow table this entry belongs to.
const IPvX& MfeaDfe::source_addr ( ) const [inline]

Get the source address.

Returns:
the source address.
const TimeVal & MfeaDfe::start_time ( ) const

Get the start time for the most recent measurement interval window.

Returns:
the start time for the most recent measurement interval window.
bool MfeaDfe::test_sg_count ( )

Test if the dataflow bandwidth satisfies the pre-defined condition.

The multicast forwarding bandwidth information is read from the kernel, and then is tested whether is above/below the pre-defined threshold.

Returns:
true if the dataflow bandwidth satisifes the pre-defined condition, otherwise false. Note: if both "is_threshold_in_packets" and "is_threshold_in_bytes" are true, then return true if the test is positive for either unit (i.e., packets or bytes).
uint32_t MfeaDfe::threshold_bytes ( ) const [inline]

Get the threshold bytes.

Returns:
the threshold bytes for this dataflow entry.
const TimeVal& MfeaDfe::threshold_interval ( ) const [inline]

Get the threshold interval.

Returns:
the threshold interval for this dataflow entry.
uint32_t MfeaDfe::threshold_packets ( ) const [inline]

Get the threshold packets.

Returns:
the threshold packets for this dataflow entry.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations