PacketHistory

Package: inet.queueing.common

compound module PacketHistory

Connects one packet producer to one packet consumer. It can be pushed with packets from the connected packet producer. It keeps a copy of the last N packets pushed into its input. The packets are available in the runtime user interface (Qtenv) for inspection.

Usage diagram

Inheritance diagram

Parameters

Name

Type

Default value

Description

size

int

100

The number of packets to remember

Properties

Name

Value

Description

display

i=block/passiveq

Gates

Name

Direction

Size

Description

in

input

out

output

Unassigned submodule parameters

Name

Type

Default value

Description

cloner.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

queue.displayStringTextFormat

string

“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

queue.packetCapacity

int

size

Maximum number of packets in the queue, no limit by default

queue.dataCapacity

int

-1b

Maximum total length of packets in the queue, no limit by default

queue.dropperClass

string

“inet::queueing::PacketAtCollectionBeginDropper”

Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class

queue.comparatorClass

string

“”

Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class

queue.bufferModule

string

“”

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

Source code

//
// Connects one packet producer to one packet consumer. It can be
// pushed with packets from the connected packet producer. It keeps a copy of
// the last N packets pushed into its input. The packets are available in the
// runtime user interface (Qtenv) for inspection.
//
module PacketHistory like IPassivePacketSink, IActivePacketSource
{
    parameters:
        int size = default(100); // The number of packets to remember
        @display("i=block/passiveq");
    gates:
        input in @labels(push);
        output out @labels(push);
    submodules:
        cloner: PacketCloner {
            parameters:
                @display("p=100,100");
        }
        queue: <default("DropHeadQueue")> like IPacketQueue {
            parameters:
                packetCapacity = default(size);
                @display("p=100,200");
        }
    connections:
        in --> { @display("m=w"); } --> cloner.in;
        cloner.out++ --> { @display("m=e"); } --> out;
        cloner.out++ --> queue.in;
}

File: src/inet/queueing/common/PacketHistory.ned