TunLoopbackApp

Package: inet.applications.tunapp

TunLoopbackApp

simple module

C++ definition

Provides loopback functionality for a TUN interface by receiving packets, swapping source and destination addresses and ports, and sending them back through the same interface. Processes both network and transport layer headers to properly reverse packet direction. Useful for testing network configurations and protocols without requiring external connections.

<b>See also:</b> TunInterface

Inheritance diagram

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

Extends

Name Type Description
SimpleModule simple module

Base module for all INET simple modules.

Parameters

Name Type Default value Description
displayStringTextFormat string ""

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

interfaceTableModule string
tunInterface string

Properties

Name Value Description
class TunLoopbackApp
display i=block/app

Gates

Name Direction Size Description
socketIn input
socketOut output

Source code

//
// Provides loopback functionality for a TUN interface by receiving packets,
// swapping source and destination addresses and ports, and sending them back
// through the same interface. Processes both network and transport layer
// headers to properly reverse packet direction. Useful for testing network
// configurations and protocols without requiring external connections.
//
// @see TunInterface
//
simple TunLoopbackApp extends SimpleModule like IApp
{
    parameters:
        @class(TunLoopbackApp);
        string interfaceTableModule;
        string tunInterface;
        @display("i=block/app");
    gates:
        input socketIn @labels(TunInterface/up);
        output socketOut @labels(TunInterface/down);
}

File: src/inet/applications/tunapp/TunLoopbackApp.ned