PacketDuplicator

Package: inet.queueing.common

simple module PacketDuplicator

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 copies of the packet are pushed to the output gate.

inet.queueing.common.PacketDuplicatorPacketDuplicatorsimple

Inheritance diagram

Extends

Name

Type

Description

PacketDuplicatorBase

simple module

Base type for packet duplicator implementations. Provides common functionality for creating and forwarding multiple copies of incoming packets.

Parameters

Name

Type

Default value

Description

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

numDuplicates

int

1

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

Properties

Name

Value

Description

class

PacketDuplicator

display

i=block/star

Gates

Name

Direction

Size

Description

in

input

out

output

Source code

//
// 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 copies of the packet are 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