ContentBasedClassifier

Package: inet.queueing.classifier

ContentBasedClassifier

simple module

This module connects one packet producer to multiple packet consumers. It can be pushed with packets from the connected packet producer. When this happens, the classifier pushes the packet to one of its connected packet consumers based on the configured packet filters. The first matching expression determines the index of the output gate.

ContentBasedClassifier

Inheritance diagram

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

Extends

Name Type Description
PacketClassifierBase simple module

This is a base module for various packet classifier modules. Derived modules must implement a single packet classifier function which determines the index of the output gate for the next pushed packet.

Parameters

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

determines the text that is written on top of the submodule

defaultGateIndex int 0

default gate index if no matching labels are found

packetFilters string

semicolon separated list of packet filter expressions (e.g. ping-*;udp-*), matches all packets by default

packetDataFilters string

semicolon separated list of packet data filter expressions (e.g. inet::Ipv4Header and srcAddress = "10.0.0.1"), matches all packets by default

Properties

Name Value Description
display i=block/classifier
class ContentBasedClassifier

Gates

Name Direction Size Description
in input
out [ ] output

Signals

Name Type Unit
packetPushed inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode
packetPushed packets pushed count, sum(packetBytes), vector(packetBytes) none

Source code

//
// This module connects one packet producer to multiple packet consumers. It
// can be pushed with packets from the connected packet producer. When this
// happens, the classifier pushes the packet to one of its connected packet
// consumers based on the configured packet filters. The first matching expression
// determines the index of the output gate.
//
simple ContentBasedClassifier extends PacketClassifierBase like IPacketClassifier
{
    parameters:
        int defaultGateIndex = default(0); // default gate index if no matching labels are found
        string packetFilters; // semicolon separated list of packet filter expressions (e.g. ping-*;udp-*), matches all packets by default
        string packetDataFilters; // semicolon separated list of packet data filter expressions (e.g. inet::Ipv4Header and srcAddress = "10.0.0.1"), matches all packets by default
        @class(ContentBasedClassifier);
}
File: src/inet/queueing/classifier/ContentBasedClassifier.ned