Tun

Package: inet.linklayer.tun

Tun

simple module

(no description)

Used in compound modules

Name Type Description
TunInterface compound module

This module implements a TUN network interface.

Parameters

Name Type Default value Description
interfaceTableModule string

The path to the InterfaceTable module

mtu int 1500B

Properties

Name Value Description
display i=block/tunnel

Gates

Name Direction Size Description
upperLayerIn input

from upper layers

upperLayerOut output

to upper layers

Signals

Name Type Unit
packetReceivedFromLower cPacket
packetReceivedFromUpper cPacket
packetSentToLower cPacket
packetSentToUpper cPacket

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
upperLayerInPacket0Ipv4DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag
upperLayerInPacket4 (TunCommandCode::TUN_C_DATA)TunnelAppInterfaceReq, SocketReq
upperLayerInRequest1 (TunCommandCode::TUN_C_OPEN)TunOpenCommandTunnelAppInterfaceReq, SocketReq

Outgoing messages (observed)

gatemsgkindctrldestModuletags
upperLayerOutPacket4 (TunSocketIndication::TUN_I_DATA)TunnelAppInterfaceInd, NetworkProtocolInd, PacketProtocolTag, SocketInd
upperLayerOutPacket4 (TunSocketIndication::TUN_I_DATA)Ipv4DispatchProtocolReq, InterfaceInd, PacketProtocolTag

Shared Tagging operations (observed)

tagTypetagAction
clearTags
DispatchProtocolReqaddTag
InterfaceIndaddTag
NetworkProtocolIndaddTag, getTag
PacketProtocolTagaddTag, getTag
SocketIndaddTag
SocketReqfindTag, getTag

Source code

simple Tun
{
    parameters:
        string interfaceTableModule;    // The path to the InterfaceTable module
        int mtu @unit(B) = default(1500B);
        @display("i=block/tunnel");

        @signal[packetSentToLower](type=cPacket);
        @signal[packetReceivedFromLower](type=cPacket);
        @signal[packetSentToUpper](type=cPacket);
        @signal[packetReceivedFromUpper](type=cPacket);

    gates:
        input upperLayerIn @messageKinds(inet::TunCommandCode);    // from upper layers
        output upperLayerOut @messageKinds(inet::TunSocketIndication);  // to upper layers
}

File: src/inet/linklayer/tun/Tun.ned