简体   繁体   English

如何在Omnet ++ INET的示例中找到工具.cc文件

[英]How can I find the implement .cc file in Omnet++ INET's examples

I'm a fresh newer studying INET in Omnet now. 我现在是在Omnet学习INET的新手。 I try to find out how the INET's examples like tutorial wireless networks work, but there are only ned and ini file in that directory without cc file. 我试图找出INET的示例(如教程无线网络)如何工作,但是该目录中只有ned和ini文件,而没有cc文件。 So I am very confused how this network works. 所以我很困惑这个网络是如何工作的。 Anyone can tell me how can i find it ? 任何人都可以告诉我如何找到它?

There are no C++ files in INET examples because the whole behaviour of every module, protocol, channel, packet etc. used by INET has already been defined in C++ files in src directory. 没有C++中的文件INET因为每个模块,协议,信道的整个行为,包等通过使用实施例INET已经在定义的C++中的文件src目录。 The compiled and ready to use code is present in file src\\libINET.dll (or src/libINET.so for Linux). 编译后的代码可以在文件src\\libINET.dll (对于Linux, src/libINET.so )。
To get to know how a protocol was modelled look inside a module and look for simple modules. 要了解一个协议是如何建模的模块里面看看,寻找简单的模块。 (In OMNeT++ the behaviour is defined only for simple modules.) (在OMNeT++ ,行为仅针对简单模块定义。)
For example: 例如:

  1. In the examples\\wireless\\lan80211 there is Lan80211.ned . examples\\wireless\\lan80211存在Lan80211.ned Open it in source (text) format. 以源(文本)格式打开它。 This network uses (between other things) WirelessHost . 该网络使用(在其他之间) WirelessHost
  2. Go to declaration of WirelessHost (Hint: select this word and press F3 or click this word holding Ctrl). 转到WirelessHost声明(提示:选择此单词,然后按F3或在按住Ctrl的同时单击此单词)。 One can see that WirelessHost inherits from StandardHost and from NodeBase . 可以看到WirelessHostStandardHostNodeBase继承。 Moreover: numRadios=1 and mgmtType = "Ieee80211MgmtSTASimplified" . 此外: numRadios=1mgmtType = "Ieee80211MgmtSTASimplified"
  3. In NodeBase.ned one can see that it uses Ieee80211Nic wlan module by default. NodeBase.ned可以看到默认情况下它使用Ieee80211Nic wlan模块。 The module Ieee80211Nic is defined in src\\inet\\linklayer\\ieee80211\\Ieee80211Nic.ned . Ieee80211Nic模块在src\\inet\\linklayer\\ieee80211\\Ieee80211Nic.ned
  4. Looking inside Ieee80211Nic one can see that it uses Ieee80211Mac (between other things). Ieee80211Nic内部查看,可以看到它使用了Ieee80211Mac (介于其他东西之间)。 This is a simple module defined in \\src\\inet\\linklayer\\ieee80211\\mac\\Ieee80211Mac.ned . 这是\\src\\inet\\linklayer\\ieee80211\\mac\\Ieee80211Mac.ned定义的简单模块。 And its behaviour is defined in \\src\\inet\\linklayer\\ieee80211\\mac\\Ieee80211Mac.cc . 其行为在\\src\\inet\\linklayer\\ieee80211\\mac\\Ieee80211Mac.cc

This way one can discover a simple module and its C++ code of every compound module. 这样,您可以发现一个简单的模块及其每个复合模块的C++代码。 However, take into account that to understand how the compound module works the connections between simple modules should be considered too. 但是,要考虑到要理解复合模块是如何工作的,也应该考虑简单模块之间的连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM