#include <InterfaceEntry.h>
Public Member Functions | |
| InterfaceEntry () | |
| virtual | ~InterfaceEntry () |
| virtual std::string | info () const |
| virtual std::string | detailedInfo () const |
| int | interfaceId () const |
| const char * | name () const |
| int | networkLayerGateIndex () const |
| int | nodeOutputGateId () const |
| int | nodeInputGateId () const |
| int | peerNamId () const |
| int | mtu () const |
| bool | isDown () const |
| bool | isBroadcast () const |
| bool | isMulticast () const |
| bool | isPointToPoint () const |
| bool | isLoopback () const |
| double | datarate () const |
| const MACAddress & | macAddress () const |
| const InterfaceToken & | interfaceToken () const |
| void | setName (const char *s) |
| void | setNetworkLayerGateIndex (int i) |
| void | setNodeOutputGateId (int i) |
| void | setNodeInputGateId (int i) |
| void | setPeerNamId (int ni) |
| void | setMtu (int m) |
| void | setDown (bool b) |
| void | setBroadcast (bool b) |
| void | setMulticast (bool b) |
| void | setPointToPoint (bool b) |
| void | setLoopback (bool b) |
| void | setDatarate (double d) |
| void | setMACAddress (const MACAddress &macAddr) |
| void | setInterfaceToken (const InterfaceToken &token) |
| IPv4InterfaceData * | ipv4 () |
| IPv6InterfaceData * | ipv6 () |
| cPolymorphic * | protocol3 () |
| cPolymorphic * | protocol4 () |
| void | setIPv4Data (IPv4InterfaceData *p) |
| void | setIPv6Data (IPv6InterfaceData *p) |
| void | setProtocol3Data (cPolymorphic *p) |
| void | setProtocol4Data (cPolymorphic *p) |
Private Member Functions | |
| InterfaceEntry (const InterfaceEntry &obj) | |
| InterfaceEntry & | operator= (const InterfaceEntry &obj) |
Private Attributes | |
| int | _interfaceId |
| identifies the interface in the InterfaceTable | |
| std::string | _name |
| interface name (must be unique) | |
| int | _nwLayerGateIndex |
| index of ifIn[],ifOut[] gates to that interface (or -1 if virtual interface) | |
| int | _nodeOutputGateId |
| id of the output gate of this host/router (or -1 if this is a virtual interface) | |
| int | _nodeInputGateId |
| id of the input gate of this host/router (or -1 if this is a virtual interface) | |
| int | _peernamid |
| used only when writing ns2 nam traces | |
| int | _mtu |
| Maximum Transmission Unit (e.g. 1500 on Ethernet). | |
| bool | _down |
| current state (up or down) | |
| bool | _broadcast |
| interface supports broadcast | |
| bool | _multicast |
| interface supports multicast | |
| bool | _pointToPoint |
| interface is point-to-point link | |
| bool | _loopback |
| interface is loopback interface | |
| double | _datarate |
| data rate in bit/s | |
| MACAddress | _macAddr |
| link-layer address (for now, only IEEE 802 MAC addresses are supported) | |
| InterfaceToken | _token |
| for IPv6 stateless autoconfig (RFC 1971) | |
| IPv4InterfaceData * | _ipv4data |
| IPv4-specific interface info (IP address, etc). | |
| IPv6InterfaceData * | _ipv6data |
| IPv6-specific interface info (IPv6 addresses, etc). | |
| cPolymorphic * | _protocol3data |
| extension point: data for a 3rd network-layer protocol | |
| cPolymorphic * | _protocol4data |
| extension point: data for a 4th network-layer protocol | |
Friends | |
| class | InterfaceTable |
|
|
|
|
|
00032 {
00033 _nwLayerGateIndex = -1;
00034 _nodeOutputGateId = -1;
00035 _nodeInputGateId = -1;
00036 _peernamid = -1;
00037
00038 _mtu = 0;
00039
00040 _down = false;
00041 _broadcast = false;
00042 _multicast = false;
00043 _pointToPoint= false;
00044 _loopback = false;
00045 _datarate = 0;
00046
00047 _ipv4data = NULL;
00048 _ipv6data = NULL;
00049 _protocol3data = NULL;
00050 _protocol4data = NULL;
00051 }
|
|
|
00073 {}
|
|
|
00089 {return _datarate;}
|
|
|
00085 {
00086 std::stringstream out;
00087 out << "name:" << (!_name.empty() ? name() : "*");
00088 if (networkLayerGateIndex()==-1)
00089 out << " on:-";
00090 else
00091 out << " on:nwLayer.ifOut[" << networkLayerGateIndex() << "]";
00092 out << "MTU: " << mtu() << " \t";
00093 if (isDown()) out << "DOWN ";
00094 if (isBroadcast()) out << "BROADCAST ";
00095 if (isMulticast()) out << "MULTICAST ";
00096 if (isPointToPoint()) out << "POINTTOPOINT ";
00097 if (isLoopback()) out << "LOOPBACK ";
00098 out << "\n";
00099 out << " macAddr:";
00100 if (macAddress().isUnspecified())
00101 out << "n/a";
00102 else
00103 out << macAddress();
00104 out << "\n";
00105 if (_ipv4data)
00106 out << " " << ((cPolymorphic*)_ipv4data)->info() << "\n"; // Khmm...
00107 if (_ipv6data)
00108 out << " " << ((cPolymorphic*)_ipv6data)->info() << "\n"; // Khmm...
00109 if (_protocol3data)
00110 out << " " << _protocol3data->info() << "\n";
00111 if (_protocol4data)
00112 out << " " << _protocol4data->info() << "\n";
00113
00114 return out.str();
00115 }
|
|
|
00054 {
00055 std::stringstream out;
00056 out << (!_name.empty() ? name() : "*");
00057 if (networkLayerGateIndex()==-1)
00058 out << " on:-";
00059 else
00060 out << " on:nwLayer.ifOut[" << networkLayerGateIndex() << "]";
00061 out << " MTU:" << mtu();
00062 if (isDown()) out << " DOWN";
00063 if (isBroadcast()) out << " BROADCAST";
00064 if (isMulticast()) out << " MULTICAST";
00065 if (isPointToPoint()) out << " POINTTOPOINT";
00066 if (isLoopback()) out << " LOOPBACK";
00067 out << " macAddr:";
00068 if (macAddress().isUnspecified())
00069 out << "n/a";
00070 else
00071 out << macAddress();
00072
00073 if (_ipv4data)
00074 out << " " << ((cPolymorphic*)_ipv4data)->info(); // Khmm...
00075 if (_ipv6data)
00076 out << " " << ((cPolymorphic*)_ipv6data)->info(); // Khmm...
00077 if (_protocol3data)
00078 out << " " << _protocol3data->info();
00079 if (_protocol4data)
00080 out << " " << _protocol4data->info();
00081 return out.str();
00082 }
|
|
|
00077 {return _interfaceId;}
|
|
|
00091 {return _token;}//FIXME: Shouldn't this be interface identifier?
|
|
|
00108 {return _ipv4data;}
|
|
|
00109 {return _ipv6data;}
|
|
|
00085 {return _broadcast;}
|
|
|
00084 {return _down;}
|
|
|
00088 {return _loopback;}
|
|
|
00086 {return _multicast;}
|
|
|
00087 {return _pointToPoint;}
|
|
|
00090 {return _macAddr;}
|
|
|
00083 {return _mtu;}
|
|
|
00078 {return _name.c_str();}
|
|
|
00079 {return _nwLayerGateIndex;}
|
|
|
00081 {return _nodeInputGateId;}
|
|
|
00080 {return _nodeOutputGateId;}
|
|
|
|
|
|
00082 {return _peernamid;}
|
|
|
00110 {return _protocol3data;}
|
|
|
00111 {return _protocol4data;}
|
|
|
00100 {_broadcast = b;}
|
|
|
00104 {_datarate = d;}
|
|
|
00099 {_down = b;}
|
|
|
00106 {_token=token;}
|
|
|
00113 {_ipv4data = p;}
|
|
|
00114 {_ipv6data = p;}
|
|
|
00103 {_loopback = b;}
|
|
|
00105 {_macAddr=macAddr;}
|
|
|
00098 {_mtu = m;}
|
|
|
00101 {_multicast = b;}
|
|
|
00093 {_name = s;}
|
|
|
00094 {_nwLayerGateIndex = i;}
|
|
|
00096 {_nodeInputGateId = i;}
|
|
|
00095 {_nodeOutputGateId = i;}
|
|
|
00097 {_peernamid = ni;}
|
|
|
00102 {_pointToPoint = b;}
|
|
|
00115 {_protocol3data = p;}
|
|
|
00116 {_protocol4data = p;}
|
|
|
|
|
|
interface supports broadcast
|
|
|
data rate in bit/s
|
|
|
current state (up or down)
|
|
|
identifies the interface in the InterfaceTable
|
|
|
IPv4-specific interface info (IP address, etc).
|
|
|
IPv6-specific interface info (IPv6 addresses, etc).
|
|
|
interface is loopback interface
|
|
|
link-layer address (for now, only IEEE 802 MAC addresses are supported)
|
|
|
Maximum Transmission Unit (e.g. 1500 on Ethernet).
|
|
|
interface supports multicast
|
|
|
interface name (must be unique)
|
|
|
id of the input gate of this host/router (or -1 if this is a virtual interface)
|
|
|
id of the output gate of this host/router (or -1 if this is a virtual interface)
|
|
|
index of ifIn[],ifOut[] gates to that interface (or -1 if virtual interface)
|
|
|
used only when writing ns2 nam traces
|
|
|
interface is point-to-point link
|
|
|
extension point: data for a 3rd network-layer protocol
|
|
|
extension point: data for a 4th network-layer protocol
|
|
|
for IPv6 stateless autoconfig (RFC 1971)
|
1.4.1