PacketDuplicator

Package: inet.queueing.common

PacketDuplicator

simple module

This module connects one packet producer to one packet consumer. It can be pushed with packets from the connected packet producer. When this happens, one or more copy of the packet is pushed to the output gate.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
PacketDuplicatorBase simple module (no description)

Parameters

Name Type Default value Description
displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

numDuplicates int 1

number of duplicates, 0 means only the original packet is forwarded

Properties

Name Value Description
display i=block/star
class PacketDuplicator

Gates

Name Direction Size Description
in input
out output

Direct method calls (observed)

call tofunctioninfo
PassivePacketSinkinet::queueing::PassivePacketSink::pushPacketpushPacket
ActivePacketSourceinet::queueing::ActivePacketSource::handleCanPushPacketChangedhandleCanPushPacketChanged

Called methods (observed)

functioninfocall from
inet::queueing::PacketDuplicator::handleCanPushPacketChangedhandleCanPushPacketChangedPassivePacketSink
inet::queueing::PacketDuplicator::pushPacketpushPacketActivePacketSource

Pushed in messages (observed)

gatemsgkindctrlsrcModuletags
inPacket0ActivePacketSourceDirectionTag, PacketProtocolTag

Push out messages (observed)

gatemsgkindctrldestModuletags
outPacket0PassivePacketSinkDirectionTag, PacketProtocolTag

Source code

//
// This module connects one packet producer to one packet consumer. It can be
// pushed with packets from the connected packet producer. When this happens,
// one or more copy of the packet is pushed to the output gate.
//
simple PacketDuplicator extends PacketDuplicatorBase like IPassivePacketSink, IActivePacketSource
{
    parameters:
        volatile int numDuplicates = default(1); // number of duplicates, 0 means only the original packet is forwarded
        @class(PacketDuplicator);
        @display("i=block/star");
    gates:
        input in @labels(push);
        output out @labels(push);
}
File: src/inet/queueing/common/PacketDuplicator.ned