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 to | function | info |
|---|---|---|
| MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
Incoming messages (observed)
| gate | msg | kind | ctrl | srcModule | tags |
|---|---|---|---|---|---|
| upperLayerIn | Packet | 0 | Ipv4 | DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag | |
| upperLayerIn | Packet | 4 (TunCommandCode::TUN_C_DATA) | TunnelApp | InterfaceReq, SocketReq | |
| upperLayerIn | Request | 1 (TunCommandCode::TUN_C_OPEN) | TunOpenCommand | TunnelApp | InterfaceReq, SocketReq |
Outgoing messages (observed)
| gate | msg | kind | ctrl | destModule | tags |
|---|---|---|---|---|---|
| upperLayerOut | Packet | 4 (TunSocketIndication::TUN_I_DATA) | TunnelApp | InterfaceInd, NetworkProtocolInd, PacketProtocolTag, SocketInd | |
| upperLayerOut | Packet | 4 (TunSocketIndication::TUN_I_DATA) | Ipv4 | DispatchProtocolReq, InterfaceInd, PacketProtocolTag |
Shared Tagging operations (observed)
| tagType | tagAction |
|---|---|
| clearTags | |
| DispatchProtocolReq | addTag |
| InterfaceInd | addTag |
| NetworkProtocolInd | addTag, getTag |
| PacketProtocolTag | addTag, getTag |
| SocketInd | addTag |
| SocketReq | findTag, 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