Compare commits

...
3017 Commits
Author SHA1 Message Date
Craig Dowell 370c7f7215 update RELEASE_NOTES known issues 2008-09-12 10:19:40 -07:00
Craig Dowell d0696fd776 release_steps.txt nits 2008-09-12 10:12:50 -07:00
Craig Dowell a7f445f460 fix bug 338, MTU overflows frameSize 2008-09-11 15:32:39 -07:00
Mathieu Lacage f5bb4c3302 bug 333:The Position attribute is not constructable anymore. 2008-09-11 11:08:22 -07:00
Mathieu Lacage d82bf3abd6 make sample run. 2008-09-11 10:08:18 -07:00
Mathieu Lacage 75cba72257 Do not assert. Use NS_FATAL_ERROR. 2008-09-11 09:54:19 -07:00
Gustavo J. A. M. Carneiro 7c2c80af1b Check the return value of read(); Fixes #336. 2008-09-11 15:21:19 +01:00
Gustavo J. A. M. Carneiro a4aeb6e815 Check for mercurial in configuration stage; also fixes OSError exception when mercurial was not available. 2008-09-11 11:44:39 +01:00
Gustavo J. A. M. Carneiro f13ffe2ed2 Make the WAF env available to regression tests 2008-09-11 11:35:42 +01:00
Florian Westphal 7fb1cd3b38 nsc: rework tcp-nsc-zoo example
- fix segfault when nodes argument <=3
- reduce data rate and run time to get smaller pcap files
- add rng seed to make output stable
2008-09-11 01:34:46 +02:00
Craig Dowell 0d8bed8b04 Added tag ns-3.2-RC2 for changeset 319eb29611b1 2008-09-10 12:38:48 -07:00
Florian Westphal 9f901c8ef1 nsc: fix liblinux2.6.18.so sym link creation
changeset 3628:a9c05c7e54f2 ('Move all NSC related build code into
src/internet-stack') erronoulsy moved the sym link creation outside
of the loop.

closes bug #328.
2008-09-10 13:11:35 +02:00
Florian Westphal 9f2e63f535 nsc: remove nsc builddir symlink
changeset 3635:cddd59578812 ('compile nsc code unconditionally')
added the nsc header files to ns-3 and fixed up the include paths,
so we no longer need to create a builddir/nsc symlink to find them.
2008-09-10 12:46:59 +02:00
Gustavo J. A. M. Carneiro ffe65494c4 merge 2008-09-10 11:34:33 +01:00
Gustavo J. A. M. Carneiro b0f7bbf060 Stop the /dev/null redirection abuse 2008-09-10 11:33:30 +01:00
Craig Dowell cb9b816af0 enable nsc when nsc enabled 2008-09-09 17:09:37 -07:00
Mathieu Lacage c8929f34e6 fix typo to allow cloning traces when they are not there yet 2008-09-09 12:35:11 -07:00
Craig Dowell 311955363b prep for ns-3.2-RC2 2008-09-09 11:34:44 -07:00
Gustavo J. A. M. Carneiro 72d3e7353a merge 2008-09-09 18:43:21 +01:00
Gustavo J. A. M. Carneiro 6f10c6c828 Use subprocess.Popen instead of os.system to improve portability of the regression testing framework 2008-09-09 18:43:03 +01:00
Mathieu Lacage e5870d73cb bug 322: download nsc from released location if in 'release' mode. 2008-09-09 10:15:40 -07:00
Gustavo J. A. M. Carneiro 808a874b45 Problem of Python bindings in MinGW has been fixed 2008-09-09 12:13:23 +01:00
Mathieu Lacage cd64cbad48 initialize sta listen interval 2008-09-08 14:45:11 -07:00
Mathieu Lacage 69aa96cfe8 initialize m_ctrlPwrMgt 2008-09-08 14:40:48 -07:00
Mathieu Lacage 18f4a0f940 don't use bitfields: they are evil. 2008-09-08 14:40:27 -07:00
Mathieu Lacage 9b48ec2c9c should set retry bit in rts and acks. 2008-09-08 14:39:59 -07:00
Mathieu Lacage d654a7c67a should set retry bit in acks. 2008-09-08 14:37:54 -07:00
Mathieu Lacage 6f2fba35ab make mobility helper ascii output more robust to formatting portability problems. 2008-09-08 13:13:09 -07:00
Mathieu Lacage 356b8a4d5c make sure to destroy all left-over memory before exit 2008-09-08 12:26:00 -07:00
Mathieu Lacage f75a46a16c do not reserve space for unwritten data to avoid memory initialization problems 2008-09-08 12:22:29 -07:00
Mathieu Lacage b62d2131d5 add msvc to set of platforms known to not work 2008-09-08 11:32:22 -07:00
Mathieu Lacage b024a19fe1 update build matrix 2008-09-08 11:29:12 -07:00
Mathieu Lacage 17adb4fab8 update release notes 2008-09-08 10:43:03 -07:00
Mathieu Lacage 320dcbbfee bug 316: make nsc compilation conditional again 2008-09-08 09:22:45 -07:00
Gustavo J. A. M. Carneiro 8bb361bcba Missing include 2008-09-08 12:54:47 +01:00
Gustavo J. A. M. Carneiro 986a63bbb4 merge 2008-09-08 12:35:08 +01:00
Gustavo J. A. M. Carneiro e1f187d38a Detect the pthread.h header file and automatically disable components that cannot build without it. 2008-09-08 12:19:46 +01:00
Gustavo J. A. M. Carneiro 8b080ef574 Python bindings generation does not need to depend on the 'everything.h' file, only API scanning and compilation of the generated sources. 2008-09-08 11:20:17 +01:00
Unknown ae217b0eaa Don't build realtime simulator if required core components aren't built 2008-09-07 20:13:51 -07:00
Raj Bhattacharjea 61947e25a7 Update CHANGES.html to reflect the last two changesets 2008-09-07 21:58:50 -04:00
Raj Bhattacharjea 1b605147ce Implement TCP finite rx buffer (bug 239) 2008-09-07 20:23:24 -04:00
Raj Bhattacharjea 48ac0501a0 Fix TCP closedown FINs, and remove broken tcp-erros example (bug 242) 2008-09-07 19:38:26 -04:00
Unknown d8dc981267 just remove hires clocks from wall-clock-synchronizer until they are needed 2008-09-06 21:15:59 -07:00
Unknown e84289cff4 fix MinGW build 2008-09-06 21:04:39 -07:00
Gustavo J. A. M. Carneiro 2284d3d545 merge 2008-09-06 19:25:26 +01:00
Gustavo J. A. M. Carneiro dcce81147d Use the information provided by conf.report_optional_feature() to enable/disable python bindings for optional APIs 2008-09-06 19:24:32 +01:00
Unknown fd149a38f3 no references to timespec if CLOCK_REALTIME undef 2008-09-06 10:41:13 -07:00
Gustavo J. A. M. Carneiro 80ba473c52 For better consistency, option --nsc becomes --enable-nsc, --python-disable becomes --disable-python. 2008-09-06 14:46:01 +01:00
Mathieu Lacage 9e629d895f make sure aid is initialized 2008-09-05 21:36:20 -07:00
Mathieu Lacage fb24a25673 compile nsc code unconditionally. 2008-09-05 21:12:00 -07:00
Mathieu Lacage 618313f44c add AddIpv4Stack, splt functions in independent chunks 2008-09-05 20:00:40 -07:00
Unknown d8ec3bb638 flip LLC to DIX framing switch in csma 2008-09-05 15:57:46 -07:00
Unknown f4ea04de0b apply MTU/FrameSize treatment to point-to-point 2008-09-05 15:18:20 -07:00
Unknown a618b8efaa branch merge 2008-09-05 11:57:56 -07:00
Unknown 55279b18b4 MTU, encap mode cleanup for csma 2008-09-05 11:56:17 -07:00
Gustavo J. A. M. Carneiro b9a4eaca8e Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript 2008-09-05 19:55:21 +01:00
Gustavo J. A. M. Carneiro f77da8c755 Exclude any possible 'nsc' folder from the dist tarball (nsc is ~= 100MB). 2008-09-05 18:42:59 +01:00
Gustavo J. A. M. Carneiro e4bd4773e8 We don't want mercurial -q option when fetching nsc, user feedback is important. 2008-09-05 18:37:00 +01:00
Gustavo J. A. M. Carneiro 453dd8a294 Add a summary of optional features at the end of the configuration stage. 2008-09-05 18:16:29 +01:00
Gustavo J. A. M. Carneiro 6e375eee8e New pybindgen, should fix bug #308. 2008-09-05 16:47:15 +01:00
Unknown d2dd9c358f further cleanup of MTU in CSMA 2008-09-04 22:38:52 -07:00
Mathieu Lacage f759d0c1d2 bug 312: ./waf check fails. 2008-09-04 13:29:13 -07:00
Mathieu Lacage b641c0d9b2 merge with HEAD 2008-09-04 12:20:02 -07:00
Mathieu Lacage ca8ec27fdc forgot to add test file 2008-09-04 12:19:44 -07:00
Gustavo J. A. M. Carneiro 4b5aa5ccca merge 2008-09-04 18:46:56 +01:00
Gustavo J. A. M. Carneiro 2c7865d6f2 Disable Python support on the CygWin platform, at least until/if the problems are fixed. 2008-09-04 18:45:21 +01:00
Mathieu Lacage a8dca1e3d3 merge with HEAD 2008-09-04 10:35:04 -07:00
Mathieu Lacage 18b6ad7263 add wifi+wired bridge example 2008-09-04 10:34:42 -07:00
Gustavo J. A. M. Carneiro fd7fc3f80e Adjust LD_LIBRARY_PATH for FreeBSD also; fallback to adjusting LD_LIBRARY_PATH when we don't know any better. 2008-09-04 18:30:38 +01:00
Mathieu Lacage c0dcf4a2cd testcase for wifi bridging 2008-09-04 10:08:02 -07:00
Mathieu Lacage bf1e64236f add NetDeviceContainer constructors 2008-09-04 10:04:14 -07:00
Mathieu Lacage 9d1d6b890e bug 309: GtkConfigStore does not build on freebsd. 2008-09-04 08:59:50 -07:00
Gustavo J. A. M. Carneiro d801092405 Update PyBindGen, fixes compilation with python 2.4. 2008-09-04 14:15:32 +01:00
Mathieu Lacage aafd298bde merge with HEAD 2008-09-03 14:28:26 -07:00
Florian Westphal 720a407b59 nsc: Fix build problem if gtk config store is disabled
gtk config store pulled in libdl.so for us, so things fail
to link of the config store isn't enabled. This makes nsc
pull in libdl itself when its enabled.
2008-09-03 23:24:59 +02:00
Craig Dowell b3525f35af Added tag ns-3.2-RC1 for changeset dfd634417b8d 2008-09-03 11:54:46 -07:00
Craig Dowell ea0a5cf285 update AUTHORS, CHANGES, RELEASE_NOTES for ns-3.2 2008-09-03 11:38:18 -07:00
Mathieu Lacage 51d62156f5 merge with HEAD 2008-09-03 10:42:18 -07:00
Mathieu Lacage d24895bdd1 forward a frame back to the wireless network only if the destination is associated, is a broadcast or multicast packet. 2008-09-03 10:37:22 -07:00
Gustavo J. A. M. Carneiro 0dc8bc3e86 merge 2008-09-03 18:01:40 +01:00
Mathieu Lacage f423b864b0 add missing aggregate removed by previous commit 2008-09-03 09:59:04 -07:00
Gustavo J. A. M. Carneiro 9c48b2460c Fix build when ns3_module_*__local.py files are used. 2008-09-03 17:42:28 +01:00
Mathieu Lacage 21dcddef88 make nsc build again. 2008-09-02 21:19:27 -07:00
Mathieu Lacage cd39d96f2b bug 282: remove Ipv4L4Demux 2008-09-02 17:20:32 -07:00
Mathieu Lacage c063465ce6 from and to addresses were inverted 2008-09-02 16:31:41 -07:00
Mathieu Lacage 1a78f415ce make sure we convey the right 'to' address to the NetDevice layer. 2008-09-02 16:08:54 -07:00
Mathieu Lacage 76147944c3 make sure to propagation the address down to the MacLow 2008-09-02 15:47:49 -07:00
Mathieu Lacage 7d81d3a381 use std::string instead of raw string 2008-09-02 15:17:54 -07:00
Mathieu Lacage d7fb97eac0 improve debugging output 2008-09-02 15:17:43 -07:00
Mathieu Lacage 4cfeba2bf7 We cannot default-construct the position of a mobility model. 2008-09-02 14:44:25 -07:00
Mathieu Lacage 39daae1374 implement promisc mode 2008-09-02 13:37:59 -07:00
Mathieu Lacage 79f85cdf94 implement SupportsSendFrom 2008-09-02 13:19:21 -07:00
Mathieu Lacage 65206529fb implement SendFrom correctly 2008-09-02 13:16:34 -07:00
Mathieu Lacage 2ef4eeb41a remove unecessary include 2008-09-02 13:16:14 -07:00
Mathieu Lacage 5788fe5e8f move GetBssid down to MacLow 2008-09-02 13:08:47 -07:00
Mathieu Lacage 77b1692293 move slot and pifs down to MacLow 2008-09-02 12:36:37 -07:00
Mathieu Lacage c5710262c4 move sifs down to MacLow 2008-09-02 12:13:24 -07:00
Mathieu Lacage c7406f3722 move cts timeout down to MacLow 2008-09-02 12:06:46 -07:00
Mathieu Lacage 3f1514a867 move Address and ack timeout down to MacLow 2008-09-02 12:00:11 -07:00
Mathieu Lacage 9b5145b5a0 use Mac48Address::GetMulticast to avoid code duplication 2008-09-02 11:39:26 -07:00
Mathieu Lacage 8f7b450103 bug 274: bridge must detect compatibility of devices with bridging mode 2008-09-02 11:28:03 -07:00
Mathieu Lacage 5fd19292ea merge with HEAD 2008-09-02 10:45:06 -07:00
Mathieu Lacage 87dc4f304d catch KeyError exception to avoid failing when sqlite or gtk are not installed 2008-09-02 10:44:28 -07:00
Craig Dowell 67313dc308 merge nsc phase one 2008-09-02 10:39:45 -07:00
Mathieu Lacage 732bc9d257 bug 303: return value should not be const 2008-09-02 10:12:14 -07:00
Gustavo J. A. M. Carneiro 1ace78069a Fix compilation of Python bindings when libsqlite3 is not available (and so the class SqliteDataOutput is omitted). 2008-09-02 17:32:19 +01:00
Gustavo J. A. M. Carneiro 0adbfb8047 New pybindgen and API rescan. Extensive API description files changes because pybindgen now handles consts differently. 2008-09-02 11:12:42 +01:00
Gustavo J. A. M. Carneiro 7570be25c5 Python: fix constructor wrapper name for templated ns3::Objects. 2008-08-31 22:33:23 +01:00
Craig Dowell e8cc479c4f branch merge 2008-08-29 20:50:17 -07:00
Mathieu Lacage 3878eac508 merge with HEAD 2008-08-29 20:41:37 -07:00
Mathieu Lacage 05b8fed716 bug 299: packet socket broken by promiscuous update 2008-08-29 20:40:54 -07:00
Florian Westphal d6dd23547b nsc: example files.
This adds two example files that will use the Linux
2.6.18 and 2.6.26 stacks provided by NSC.
2008-08-29 23:11:41 +02:00
Florian Westphal 235ac2801f nsc: enable network simulation cradle
This adds the hooks to allow the nsc code to be compiled into ns-3 if
the --nsc flag is specified during 'waf configure'.
2008-08-29 23:10:00 +02:00
Florian Westphal 4591673b99 nsc: core files.
This adds the core network simulation cradle support
code.
2008-08-29 23:08:18 +02:00
Florian Westphal 11c4bec9e8 ipv4-end-point-demux: add method to fetch list of all endpoints
GetAllEndPoints() will be used by the network simulation cradle.
After a wakeup event, all sockets (Endpoints) have to be checked
for state changes.
2008-08-29 23:07:21 +02:00
Unknown 64e7d5cd17 Some cleanup. 2008-08-29 13:36:12 -04:00
Unknown 168361462f Stats module and example merged in. 2008-08-29 13:22:09 -04:00
Gustavo J. A. M. Carneiro 90c70d1a39 Require new PyBindGen (now ignores the badly scanned anonymous containers that cause problems on cygwin) and rescan API. 2008-08-29 14:56:24 +01:00
Gustavo J. A. M. Carneiro b88b399635 RealTimeSimulatorImpl::EnableLogTo() is not implemented, remove it from the header file. 2008-08-29 14:53:38 +01:00
Unknown caa878e725 expunge any mention of the possibility that the real-time simlator could operate in real-time mode 2008-08-28 15:11:55 -07:00
Unknown 15766219de don't assume posix compatibility means posix clocks 2008-08-28 15:06:49 -07:00
Mathieu Lacage a54f875690 forgot to remove uneeded copy 2008-08-27 11:39:31 -07:00
Craig Dowell 08833cb918 branch merge 2008-08-26 23:16:31 -07:00
Craig Dowell c466a1d098 ifdef out ability to feed real-time through simulator 2008-08-26 23:11:11 -07:00
Craig Dowell 3ba8dce954 add realtime simulator and associated tests 2008-08-26 15:34:57 -07:00
Gustavo J. A. M. Carneiro c0ee4eb2a0 Pull in Mathieu's PyBindGen fix. 2008-08-26 22:20:30 +01:00
Mathieu Lacage 8027faacca doxygen OnOffHelper. 2008-08-26 11:17:31 -07:00
Mathieu Lacage dab7ef6871 merge with HEAD 2008-08-26 08:42:28 -07:00
Mathieu Lacage bf3ad68c92 remove dead code. 2008-08-26 08:41:21 -07:00
Gustavo J. A. M. Carneiro 8cdde7b8f2 merge 2008-08-26 12:25:59 +01:00
Gustavo J. A. M. Carneiro cb5d18a929 Bridge documentation (#286) 2008-08-26 12:25:08 +01:00
Mathieu Lacage 0500b5353e bug 279: Packets need metadata support for printing without header checking 2008-08-25 15:21:01 -07:00
Mathieu Lacage 3ba086cef6 bug 273: fix python bindings. 2008-08-25 15:16:35 -07:00
Mathieu Lacage bd37d93222 document API change 2008-08-25 15:00:56 -07:00
Mathieu Lacage f5f3b3f057 repeat enum keyword. 2008-08-25 10:03:38 -07:00
Mathieu Lacage 5f63fe35ba shared Mac48 multicast code 2008-08-25 10:02:52 -07:00
Mathieu Lacage cfdb301bee bug 273: constify packet pointers. 2008-08-25 09:13:05 -07:00
Mathieu Lacage 21b5431c24 bug 285: NetDevice base class should define an attribute Mtu. 2008-08-25 09:05:41 -07:00
Gustavo J. A. M. Carneiro abd6647112 New PyBindGen, fixes python wrapper identity issue. 2008-08-23 22:35:10 +01:00
Raj Bhattacharjea cd95f66344 Fix a unit test typo (thanks Providence Salumu Munga 2008-08-19 14:13:01 -04:00
Gustavo J. A. M. Carneiro fd774c3fb6 New PyBindGen version and API rescan: adds missing copy constructors, and generates __copy__ methods so that python's copy.copy() works on our objects. 2008-08-19 17:48:09 +01:00
Gustavo J. A. M. Carneiro 097f338632 Make copy constructors of some wifi classes private so that pybindgen won't use them (they are not usable) 2008-08-19 17:45:41 +01:00
Gustavo J. A. M. Carneiro 433c4e2eea New pybindgen version, fixes a couple of bugs caught by regression testing. 2008-08-19 12:53:44 +01:00
Gustavo J. A. M. Carneiro 7c7b4e12fb Don't scan python bindings until the everything.h file to be scanned is generated. Closes #288. 2008-08-18 23:04:49 +01:00
Gustavo J. A. M. Carneiro f051f8fb19 New PyBindGen version needed. 2008-08-18 16:03:31 +01:00
Gustavo J. A. M. Carneiro 0717db6ed0 Rescan Python bindings 2008-08-18 16:02:54 +01:00
Gustavo J. A. M. Carneiro a128c2f70a Python: fix bad parameter passed into pybindgen. 2008-08-18 16:00:47 +01:00
Gustavo J. A. M. Carneiro 0335beed14 Python: ignore TracedCallback classes for the time being: they were never usable and were triggering pybindgen generate code compilation problems. 2008-08-18 16:00:10 +01:00
Mathieu Lacage c71981e5a2 remove uneeded EnableMetadata calls 2008-08-15 10:15:54 -07:00
Raj Bhattacharjea 35c5966c45 Refactor OnOff so Start doesn't immediate close the socket (bug 259) 2008-08-15 12:58:53 -04:00
Raj Bhattacharjea 471112db7e Use scheduler to call up the stack in SimpleNetDevice (bug 287) 2008-08-15 11:25:18 -04:00
Raj Bhattacharjea a55316e4f7 Add another test to TcpSocketImplTest 2008-08-14 18:25:33 -04:00
Raj Bhattacharjea 4ad7f52f7c Add a test to TcpSocketImpl unit tests 2008-08-14 17:39:43 -04:00
Raj Bhattacharjea 2231b56ebe Make TypeId(const char * name) explicit (bug 281) 2008-08-14 13:04:18 -04:00
Mathieu Lacage d0ff359d01 fully qualify class name to use macro outside of ns3 namespace. 2008-08-13 10:11:41 -07:00
Mathieu Lacage 66c9294134 make it build with gcc 4.1.3 2008-08-13 10:08:03 -07:00
Raj Bhattacharjea f9cb0f5a7e Stub TcpSocketImpl unit test 2008-08-11 16:47:46 -04:00
Mathieu Lacage 524435da19 allow attribute setters to fail. 2008-08-12 12:55:11 -07:00
Mathieu Lacage 728f6ad65d make sure we don't attempt to read outside of ourselves when deserializing a header for printing. 2008-08-11 15:18:40 -07:00
Mathieu Lacage b591ee4053 bug 275: Queue::Peek should return Ptr<const Packet> 2008-08-11 10:40:31 -07:00
Mathieu Lacage 222c989f79 bug 276: bridge netdevice has no helper class. 2008-08-11 10:30:46 -07:00
Raj Bhattacharjea 68f0b97baa rm examples/tcp-2way.cc 2008-08-10 15:45:27 -04:00
Mathieu Lacage 404cdb6f49 use the right log component name for PacketSink. use NS_LOG_FUNCTION. 2008-08-09 10:52:36 -07:00
Mathieu Lacage f6044dc0b4 remove uneeded virtual keyword 2008-08-08 16:29:15 -07:00
Gustavo J. A. M. Carneiro 39f080feba Rescan API (due to wifi changes to support bridging) 2008-08-08 10:49:18 +01:00
Mathieu Lacage 3ca49e8f39 ensure type is registered 2008-08-07 12:22:38 -07:00
Mathieu Lacage 1327e45a41 merge with HEAD 2008-08-07 11:14:32 -07:00
Mathieu Lacage bfd084bde7 implement WifiNetDevice::SendFrom 2008-08-07 11:14:15 -07:00
Mathieu Lacage 29151f4ec2 remove Node::GetFirstApplication checked in changeset 38b8549b1ad3 by mistake. 2008-08-07 10:13:54 -07:00
Gustavo J. A. M. Carneiro 161adc2a4e Bug #270: Simulator::RunOneEvent 2008-08-06 11:37:52 +01:00
Gustavo J. A. M. Carneiro bf060fddf8 Oops, typo (evil copy-paste) 2008-08-06 16:11:44 +01:00
Gustavo J. A. M. Carneiro 3883a5e095 Add bounds checking asserts to Node::GetApplication, NodeList::GetNode, and Node::GetDevice. 2008-08-06 16:06:44 +01:00
Gustavo J. A. M. Carneiro 1eecaa6abd merge 2008-08-05 19:46:05 +01:00
Gustavo J. A. M. Carneiro 2d872a846d Python: re-scan API; unblock python threads during Simulator::Run; new pybindgen brings improved thread safety for virtual methods. 2008-08-05 19:42:53 +01:00
Craig Dowell 2966ca33b9 Comment to clarify MTU policy was insufficiently clear 2008-08-05 10:34:26 -07:00
Mathieu Lacage 162194c37f repeat the virtual keyword in the subclass 2008-08-05 10:06:40 -07:00
Craig Dowell 13bdfdf131 actually use CHANGES.html 2008-08-04 17:44:53 -07:00
Craig Dowell 6116a532db branch merge 2008-08-04 17:32:49 -07:00
Craig Dowell 6c7bdf5845 sort out various MTU options 2008-08-04 17:32:32 -07:00
Tom Henderson b6a0e35db1 Add CHANGES.html 2008-08-04 14:43:53 -07:00
Craig Dowell 3a519a71da 128 column pages 2008-08-03 21:55:49 -07:00
Mathieu Lacage 7a711ae53e bug 269: revert parts of 9e763021e045 and add comments to avoid getting these again. 2008-08-03 09:14:07 -07:00
Gustavo J. A. M. Carneiro 1e654fa962 merge 2008-08-01 23:15:00 +01:00
Gustavo J. A. M. Carneiro 27df0a5c92 Python: use hash() as temporary workaround to check if two objects with different wrappers are underneath the same. 2008-08-01 23:11:42 +01:00
Tom Henderson af0efdeab3 branch merge 2008-08-01 07:40:22 -07:00
Mathieu Lacage 4ba6e58745 bug 266: src/wscript unconditionally sets conf.env['NS3_MODULE_PATH'] 2008-07-31 15:04:01 -07:00
Raj Bhattacharjea 172db792a8 Misspelling in AUTHORS file 2008-07-30 16:36:57 -04:00
Mathieu Lacage 51d31554c4 merge with HEAD 2008-07-30 12:44:56 -07:00
Mathieu Lacage 660c536a49 use fully-qualified c++ typename to allow using macros outside of the ns3 namespace. 2008-07-30 12:44:34 -07:00
Mathieu Lacage 317878411a kill dead code 2008-07-30 12:43:43 -07:00
Tom Henderson 3af1dc7235 revised patch to fix bug 253 2008-07-30 06:30:42 -07:00
Raj Bhattacharjea caaae1c1dd Fix TcpSocketImpl rx buffer logic (closes 248) 2008-07-29 15:36:41 -04:00
Mathieu Lacage 1f86e826e5 bug 264: NS_BREAKPOINT never stops the debugger at the right location. 2008-07-29 11:19:16 -07:00
Mathieu Lacage 5857618635 bug 251: mobility helper has no ascii output 2008-07-28 09:03:10 -07:00
Mathieu Lacage 89cb48c524 bug 252: make python bindings compile 2008-07-28 08:59:05 -07:00
Mathieu Lacage 36f196a9a0 bug 252: get rid of dead code. 2008-07-28 08:54:20 -07:00
Sebastien Vincent 8d844b7502 bug 262: fix g++ 4.3 build 2008-07-28 08:30:32 -07:00
Gustavo J. A. M. Carneiro b157853a0c OLSR: HELLO messages hold time should be 3 times hello interval, not hello interval. 2008-07-28 16:06:46 +01:00
Gustavo J. A. M. Carneiro 91f0ef0320 Only generate everything.h if python bindings are enabled. Based on patch by Mathieu Lacage. Closes #260. 2008-07-26 15:23:41 +01:00
Gustavo J. A. M. Carneiro c95c773d17 When generating the everything.h header file for Python, handle ns3 headers inside subdirectories properly. 2008-07-26 15:10:34 +01:00
Gustavo J. A. M. Carneiro 5e24aed9dd When python scanning API, remove again the NS3_LOG_ENABLE define; it is no longer needed. 2008-07-25 16:54:29 +01:00
Gustavo J. A. M. Carneiro fbf681955e Make the LogComponent* utility functions available for optimized builds as well, albeit as noops. Closes #258. 2008-07-25 16:51:40 +01:00
Gustavo J. A. M. Carneiro 565483bc09 hg ignore the pybindgen checkout dir 2008-07-24 17:24:01 +01:00
Gustavo J. A. M. Carneiro 2aceead32f merge 2008-07-24 11:41:56 +01:00
Gustavo J. A. M. Carneiro ca2fef3bd8 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence. 2008-07-24 11:41:15 +01:00
Gustavo J. A. M. Carneiro 732b7994de Add empty implementation of Simulator::SetImplementation, to make Python bindings work. 2008-07-24 11:37:56 +01:00
Gustavo J. A. M. Carneiro f573eaa47a Add helper waf proxy script 2008-07-24 11:27:57 +01:00
Craig Dowell c51f635cfb fix supidity in mtu stuff 2008-07-23 18:29:13 -07:00
Craig Dowell dbb7f0f738 begin sorting out mtu woes 2008-07-23 17:09:12 -07:00
Raj Bhattacharjea 0ad768c938 Make PacketSink multitasking for TCP (closes bug 244) 2008-07-23 16:09:17 -04:00
Gustavo J. A. M. Carneiro 5a71f60c7a Define NS3_ASSERT_ENABLE and NS3_LOG_ENABLE, to make sure we pick up all definitions (such as the logging APIs) 2008-07-23 11:48:17 +01:00
Gustavo J. A. M. Carneiro b9722796d7 Require new PyBindGen; make it work for Python 2.3. 2008-07-22 16:54:24 +01:00
Craig Dowell c415957dfc branch merge 2008-07-21 15:53:03 -07:00
Gustavo J. A. M. Carneiro f890b8e138 Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read 2008-07-21 15:30:15 +01:00
Gustavo J. A. M. Carneiro fd2cf07d30 python scanning: remove redundant incref/decref_method annotations 2008-07-21 11:43:05 +01:00
Tom Henderson d711e853d0 more details for 3.2 release notes 2008-07-20 07:59:21 -07:00
Craig Dowell 44c48d41e3 update on-demand RELEASE_NOTES 2008-07-18 21:59:43 -07:00
Craig Dowell 9c8ee223b3 make simulator implementation replaceable via global default value 2008-07-18 21:51:31 -07:00
Gustavo J. A. M. Carneiro a303c4bfad Add release notes. 2008-07-18 12:12:43 +01:00
Gustavo J. A. M. Carneiro ae074d9e03 No need to make NetDevice::SendFrom pure virtual; instead just give a fatal error if used in runtime (it's only used by the learning bridge, anyway, so...). 2008-07-18 11:41:22 +01:00
Gustavo J. A. M. Carneiro 0632b05ed9 merge 2008-07-18 11:23:29 +01:00
Gustavo J. A. M. Carneiro 06a4d72721 merge 2008-07-18 11:12:31 +01:00
Craig Dowell b1af5815b0 factor simulator into interface and (multiple) implementation pieces 2008-07-17 23:52:59 -07:00
Unknown d369fc0c61 fix darwin build break 2008-07-17 18:57:08 -07:00
Craig Dowell e567e5fec5 fix darwin build break 2008-07-17 18:45:58 -07:00
Gustavo J. A. M. Carneiro 4144eccd4f merge 2008-07-17 17:58:14 +01:00
Gustavo J. A. M. Carneiro f7fc598240 A couple of attribute python unit tests 2008-07-17 17:57:18 +01:00
Tom Henderson 4914c4afcb Add NS_LOG_FUNCTION calls in arp implementation 2008-07-16 22:33:51 -07:00
Gustavo J. A. M. Carneiro 8cc54510ba Don't run python unit tests if python bindings not enabled. Closes #254. 2008-07-16 17:44:42 +01:00
Gustavo J. A. M. Carneiro a8d461f29e Remove some useless code 2008-07-16 16:17:21 +01:00
Gustavo J. A. M. Carneiro c33568c079 New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag. 2008-07-16 16:06:50 +01:00
Gustavo J. A. M. Carneiro ccb5ec4d4d merge 2008-07-16 14:33:44 +01:00
Gustavo J. A. M. Carneiro 6b9023ebf4 merge 2008-07-16 10:46:51 +01:00
Gustavo J. A. M. Carneiro ef5b621566 Patch WAF to make output redirection work again (Utils.get_term_cols() bug) 2008-07-16 10:45:13 +01:00
Craig Dowell 36a4bc8c40 update RELEASE_NOTES 2008-07-15 16:14:57 -07:00
Craig Dowell db748a0000 add system threads and synchronization primitives 2008-07-15 15:59:57 -07:00
Gustavo J. A. M. Carneiro 2ca65219de Add csma-bridge example ported to Python. 2008-07-14 15:41:51 +01:00
Gustavo J. A. M. Carneiro 65d4f0972c Rescan API 2008-07-14 11:42:49 +01:00
Gustavo J. A. M. Carneiro 41fab0b441 merge 2008-07-14 11:39:41 +01:00
Gustavo J. A. M. Carneiro cfa12b46c4 Again, make Python depend only on scanned modules (last fix was incomplete). 2008-07-14 11:35:58 +01:00
Gustavo J. A. M. Carneiro ff82231ef4 merge 2008-07-14 11:29:31 +01:00
Gustavo J. A. M. Carneiro 6afc4f8d7f Again, make Python depend only on scanned modules (last fix was incomplete). 2008-07-14 11:29:13 +01:00
Gustavo J. A. M. Carneiro f1e627aec7 merge 2008-07-14 11:25:59 +01:00
Gustavo J. A. M. Carneiro 69dc042ec7 Make Python bindings depend only on NS-3 modules that have been API-scanned, not all modules. 2008-07-14 11:25:10 +01:00
Gustavo J. A. M. Carneiro d1a7261479 merge 2008-07-14 11:12:30 +01:00
Gustavo J. A. M. Carneiro 2aff99d749 Add mixed-wireless example ported to Python. 2008-07-13 18:08:48 +01:00
Gustavo J. A. M. Carneiro 10ee9b9e01 Python: make helper class methods using attribute optional parameters work. 2008-07-13 17:55:48 +01:00
Gustavo J. A. M. Carneiro 1132bcbd99 If GtkConfigStore support is disabled, disable the python bindings for it, or else compilation fails. 2008-07-12 22:06:15 +01:00
Gustavo J. A. M. Carneiro 90e5f8cf0e Add WAF option --pyrun, to make it easier to run Python programs. 2008-07-12 19:33:29 +01:00
Gustavo J. A. M. Carneiro 7fb6a81b59 merge 2008-07-11 19:32:45 +01:00
Gustavo J. A. M. Carneiro 8356645d0a Make sure we don't trigger deprecation warnings while compiling the python bindings. 2008-07-11 19:32:22 +01:00
Gustavo J. A. M. Carneiro 9b8db57a00 Check that the compiler accepts -Wno-error=deprecated-declarations before using it 2008-07-11 19:24:33 +01:00
Gustavo J. A. M. Carneiro 9d5d168444 Rescan APIs 2008-07-11 18:39:19 +01:00
Gustavo J. A. M. Carneiro 7dce1174ba merge 2008-07-11 18:15:52 +01:00
Gustavo J. A. M. Carneiro 6911a69356 Add compilation flag -Wno-error=deprecated-declarations, or else the NS_DEPRECATED macro becomes useless. 2008-07-11 11:36:59 +01:00
Raj Bhattacharjea 14beae6e8d Remove tcp-2way as a regression test 2008-07-10 21:32:33 -04:00
Mathieu Lacage 731a76246f bug 247: tcp checksum crashes when enabled. 2008-07-10 15:58:24 -07:00
Mathieu Lacage 7f07acc254 use NS_DEPRECATED for bug 232. 2008-07-09 20:12:05 -07:00
Mathieu Lacage 7b34f76ef7 define NS_DEPRECATED 2008-07-09 20:11:16 -07:00
Mathieu Lacage fb17731cab more cleanups based on bug 249. 2008-07-09 19:52:15 -07:00
Raj Bhattacharjea c3a8ec5555 Add David Evensky's tcp-2way regression test 2008-07-09 17:04:29 -04:00
Raj Bhattacharjea be9e5ced39 Add some additional TCP dox about RFC compliance 2008-07-09 14:10:18 -04:00
Gustavo J. A. M. Carneiro ee19e57741 Rescan API; fix and enable the socket unit test, as it now works. 2008-07-09 18:50:28 +01:00
Gustavo J. A. M. Carneiro 1f1ffe7372 merge 2008-07-09 18:36:10 +01:00
Gustavo J. A. M. Carneiro 5f9b651ba8 Don't re-declare pure virtual methods from the parent Socket class. Fixes bug #249. 2008-07-09 18:34:42 +01:00
Gustavo J. A. M. Carneiro a6ccafbed7 Fix a problem with callback proxies with zero or one parameters. 2008-07-09 18:33:16 +01:00
Gustavo J. A. M. Carneiro fd2cdaf7ac Redirect the stderr of pybindgen to a log file (ns3modulegen.log). 2008-07-09 17:31:37 +01:00
Gustavo J. A. M. Carneiro 3ff7e83dd0 Upgrade to a patched WAF 1.4.2; needed for redirecting stderr of command-output objects. 2008-07-09 17:31:01 +01:00
Gustavo J. A. M. Carneiro 0f045371a3 The 'everything.h' header file is only used for Python bindings and should be generated into bindings/python/, not ns3/. 2008-07-09 14:58:02 +01:00
Mathieu Lacage 3d6e4532ae avoid direct access to Object::m_tid. Use ObjectBase::GetInstanceTypeId instead. 2008-07-08 14:27:45 -07:00
Gustavo J. A. M. Carneiro 5f994081d5 python bindings 2008-07-08 10:43:58 -07:00
Mathieu Lacage 178567b32b add PythonCompleteConstruct friend for python bindings 2008-07-08 10:19:34 -07:00
Mathieu Lacage 11ddb61d96 avoid uneeded inline 2008-07-08 10:17:18 -07:00
Mathieu Lacage 24693d3bbd add Object::GetReferenceCount 2008-07-08 10:16:53 -07:00
Mathieu Lacage 5a35637ab9 add RefCountBase::GetReferenceCount. 2008-07-08 10:12:38 -07:00
Mathieu Lacage b07781eead coding style 2008-07-08 10:11:55 -07:00
Mathieu Lacage 7f8fcbc547 add CalbackImplBase::GetReferenceCount 2008-07-08 10:10:26 -07:00
Mathieu Lacage c1f8cff710 kill dead unimplemented API 2008-07-08 10:02:57 -07:00
Mathieu Lacage 864923164b add missing implementations 2008-07-08 10:02:46 -07:00
Mathieu Lacage 8e0738b5ba add missing implementations 2008-07-08 10:02:28 -07:00
Mathieu Lacage 8b1b7b25a2 kill dead code 2008-07-08 10:02:11 -07:00
Mathieu Lacage dfc7509dd6 kill dead code 2008-07-08 10:01:53 -07:00
Mathieu Lacage 3c16c7d6d0 kill dead code 2008-07-08 10:01:42 -07:00
Raj Bhattacharjea d236aad5e5 Check in a tcp example which has rate error models 2008-07-08 11:09:22 -04:00
Gustavo J. A. M. Carneiro eb3d502a49 Adapt to evil API breakage 2008-07-08 14:40:01 +01:00
Gustavo J. A. M. Carneiro fe73953148 sync with ns-3-dev 2008-07-08 14:18:50 +01:00
Gustavo J. A. M. Carneiro c5ec154ea1 Add BridgeChannel 2008-07-07 12:52:48 +01:00
Gustavo J. A. M. Carneiro cb491541ac Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type. 2008-07-07 12:18:05 +01:00
Gustavo J. A. M. Carneiro bcae4f9ea1 Move the csma packet-from-self receive filtering away from the CsmaChannel into the CsmaNetDevice, with the help of an extra Ptr<CsmaNetDevice> parameter in Receive(). As discussed in the mailing list. 2008-07-07 10:37:09 +01:00
Gustavo J. A. M. Carneiro 95be482f24 Backed out changeset ae9f7d5e2d56 2008-07-07 10:26:00 +01:00
Gustavo J. A. M. Carneiro ab714db3a9 Try to preserve API compatibility, after SendFrom / promiscuous mode changes. 2008-07-04 19:15:00 +01:00
Gustavo J. A. M. Carneiro 1c8622e4f8 Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like). 2008-07-04 18:48:10 +01:00
Gustavo J. A. M. Carneiro a97acf9ac0 Use NetDevice::SendFrom where appropriate, in order to preserve source address of bridged mac frames. 2008-07-04 18:04:13 +01:00
Gustavo J. A. M. Carneiro df677111d4 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now. 2008-07-04 18:03:26 +01:00
Gustavo J. A. M. Carneiro f3d8a5eb6d Don't allow csma devices to receive packets sent by themselves. 2008-07-04 17:58:31 +01:00
Gustavo J. A. M. Carneiro d00d6e123c Start of a BridgeNetDevice example, using csma (basically an Ethernet Switch). 2008-07-04 15:40:29 +01:00
Gustavo J. A. M. Carneiro f8a561c16a Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames. 2008-07-04 15:39:24 +01:00
Gustavo J. A. M. Carneiro 8a0bcd18ba Implement the promiscuous receive callback for CsmaNetDevice. 2008-07-04 15:37:54 +01:00
Gustavo J. A. M. Carneiro 629a5b02da Changes in the promiscuous mode API: now the callback receives everything, both 'for me' and 'not for me', with an additional 'forMe' parameter. 2008-07-04 15:37:03 +01:00
Gustavo J. A. M. Carneiro 45334ff8de For csma, set a sensible netdevice name, if none has been set. 2008-07-04 12:35:13 +01:00
Craig Dowell d8a6c6f336 some slips of the keyboard in tutorial 2008-07-03 20:03:03 -07:00
Craig Dowell 26b91a3c6c fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress. 2008-07-03 17:37:32 -07:00
Craig Dowell b2b5de9d22 bug 232, references to Parameter obsolete 2008-07-03 15:44:54 -07:00
Unknown 12c6c43d57 Minor doc notes added to ipv4.h 2008-07-03 09:44:23 -04:00
Tom Henderson 0f27dc1b81 close socket upon PacketSink::StopApplication() 2008-07-02 21:07:36 -07:00
Mathieu Lacage 74e8ce7845 no need for protected members 2008-07-02 13:23:54 -07:00
Mathieu Lacage cf37954b04 no need to export this header 2008-07-02 13:23:44 -07:00
Mathieu Lacage 7c7cfcc865 avoid pygccxml warning. 2008-07-02 13:23:23 -07:00
Mathieu Lacage ab3a728ba5 no need for protected variables 2008-07-02 13:22:46 -07:00
Mathieu Lacage f7c6438560 no need for protected variables 2008-07-02 13:22:32 -07:00
Mathieu Lacage 94ee9fd47e no need for protected variables 2008-07-02 13:22:14 -07:00
Mathieu Lacage 925136697a avoid pygccxml warning 2008-07-02 13:21:56 -07:00
Mathieu Lacage 2d76aafcfb do not make m_enable protected 2008-07-02 13:21:43 -07:00
Mathieu Lacage 056c8a7855 merge with HEAD 2008-07-02 13:21:01 -07:00
Raj Bhattacharjea ff8c38b5ac Fix trace names to match documents in tcp-star-server 2008-07-02 15:57:33 -04:00
Raj Bhattacharjea 7e12d28439 Add a tcp server example 2008-07-02 15:45:35 -04:00
Mathieu Lacage 572ee9e3c9 export new methods for language bindings 2008-07-02 08:37:57 -07:00
Mathieu Lacage 7f91bd111e avoid pygccxml warning. 2008-07-02 08:33:47 -07:00
Mathieu Lacage b93a9aeef4 bug 245: build failure with gcc 4.3.x 2008-07-02 03:16:36 -07:00
Mathieu Lacage 67c5dfa611 implement Packet::PeekHeader and Packet::PeekTrailer to avoid evil workarounds when receiving tcp packets. 2008-07-01 11:00:29 -07:00
Sebastien Vincent 75fab6d1b0 bug 236: add optional support for tcp and udp checksum. 2008-07-01 10:52:11 -07:00
Tom Henderson fbc3554c2c chapter on Node and internet stack, for manual 2008-06-30 22:41:22 -07:00
Craig Dowell 5b9d211ab9 update RELEASE_NOTES 2008-06-30 14:17:19 -07:00
Craig Dowell a52bde7d46 Added tag ns-3.1 for changeset 5768685f9fdb 2008-06-30 13:47:05 -07:00
Craig Dowell 46dced7f48 Added tag ns-3.1 for changeset 42504fb1f7be 2008-06-30 13:46:33 -07:00
Craig Dowell 4196578e98 new convention for release tags 2008-06-30 13:44:27 -07:00
Craig Dowell 89f5373c27 Prepare for 3.1 2008-06-30 13:35:33 -07:00
Craig Dowell b271ea5c87 Tutorial TOC tweaks 2008-06-30 13:16:31 -07:00
Craig Dowell 31417e808d some final tweaks to the tutorial 2008-06-30 13:06:34 -07:00
Craig Dowell d714797804 tweak, tweak the tutorial 2008-06-30 11:42:38 -07:00
Gustavo J. A. M. Carneiro bf513e45d2 Sketching a new promiscuous mode protocol handlers API; Netdevices implementation missing, though. 2008-06-30 19:25:58 +01:00
Craig Dowell 8a6ed9603e remote browsing from tutorial menus 2008-06-30 10:25:46 -07:00
Craig Dowell 03975f8102 remove section in tutorial, move browsing part to where it makes more sense. 2008-06-30 10:23:04 -07:00
Craig Dowell 26972f3917 address helpful tutorial comments by reviewers 2008-06-29 23:25:32 -07:00
Craig Dowell 1d5803e8f3 minor tweaks for menus on tutorial 2008-06-29 23:14:16 -07:00
Craig Dowell 24e907d036 more editing passes through tutorial 2008-06-29 23:11:25 -07:00
Craig Dowell 2f840a4f54 cleaning up tutorial 2008-06-29 22:14:22 -07:00
Craig Dowell df2984b28c mispeeling in tutorial command sequence 2008-06-29 21:26:04 -07:00
Craig Dowell ee9129e71e merge 2008-06-29 21:22:33 -07:00
Craig Dowell bdb123bbc4 editing pass through the tutorial 2008-06-29 21:16:35 -07:00
Tom Henderson c094200ef6 a few section 8 nits 2008-06-29 20:48:18 -07:00
Tom Henderson 28117fd049 branch merge 2008-06-29 20:39:33 -07:00
Craig Dowell 73e368454d finish up with a wifi example 2008-06-29 15:05:22 -07:00
Tom Henderson 45f203f09f formatting nits on the Tweaking chapter 2008-06-29 14:38:49 -07:00
Tom Henderson 133bf0b651 nits on Sections 1-4 2008-06-29 14:28:11 -07:00
Tom Henderson d5423b88a2 Table of content fixes 2008-06-29 14:20:40 -07:00
Craig Dowell 898ce6b375 cleanup tutorial third.cc a bit 2008-06-29 11:13:27 -07:00
Craig Dowell 20865bfde0 finish off csma tutorial example words 2008-06-29 10:44:24 -07:00
Craig Dowell 9bb182aa54 work through second tutorial example 2008-06-28 22:39:06 -07:00
Craig Dowell 9f205e0fba external dependency on figures 2008-06-28 20:02:25 -07:00
Craig Dowell f201618a5f ignore moved figures dir 2008-06-28 19:55:58 -07:00
Craig Dowell eb848bb719 swapping in all of tutorial would be better 2008-06-28 19:48:14 -07:00
Craig Dowell 5cf2aa1ebf swap in new tutorial 2008-06-28 19:46:55 -07:00
Craig Dowell f58dda2fcb add updated tutorial examples 2008-06-28 19:39:46 -07:00
Craig Dowell 246b544cb3 remove tutorial directory 2008-06-28 19:29:54 -07:00
Mathieu Lacage 500b5c1fd4 cleanup tag names 2008-06-27 15:29:11 -07:00
Craig Dowell 31fc532913 Added tag release ns-3.1-RC3 for changeset ea16c44eb90d 2008-06-27 15:07:04 -07:00
Craig Dowell 8869dc9630 Apply Patch for Bug 237 2008-06-27 14:56:18 -07:00
Craig Dowell 62c2e46c37 reposition trace hook in csma to address bug 241. 2008-06-27 14:38:08 -07:00
Craig Dowell 89e20b56c9 Patch for bug 240 2008-06-27 09:32:34 -07:00
Craig Dowell 2b1bc24321 Apply patch for bug 231 2008-06-24 19:09:49 -07:00
Craig Dowell cb19bb1404 Added tag release ns-3.1-RC2 for changeset 951296e9a277 2008-06-24 15:47:04 -07:00
Craig Dowell 92c9208ea6 Apply Patch for Bug 235 2008-06-24 15:40:24 -07:00
Craig Dowell 8c7759dc6b bug 233 2008-06-24 09:21:02 -07:00
Mathieu Lacage b9aeaf3650 more typos. 2008-06-23 16:03:08 -07:00
Mathieu Lacage 87c68d5a58 fix lots of typos 2008-06-23 15:46:04 -07:00
Mathieu Lacage 77d2f50c2f update ignore list 2008-06-23 15:45:52 -07:00
Mathieu Lacage ddef596d2f merge with HEAD 2008-06-23 15:24:27 -07:00
Mathieu Lacage fcf9b4cf5b application howto 2008-06-23 15:24:12 -07:00
Mathieu Lacage bdf0896c2a add helper code 2008-06-23 14:15:41 -07:00
Tom Henderson 3aa9ce9efd Add chapter on random numbers to manual 2008-06-23 13:58:30 -07:00
Mathieu Lacage 73f7efb2f2 a very simple howto for implementing NetDevice/Channel subclasses 2008-06-23 12:49:51 -07:00
Mathieu Lacage e10db3d576 add missing copyright statement 2008-06-23 12:45:01 -07:00
Mathieu Lacage daaed2d5e6 add small comment, fix typo, add missing copyright statement 2008-06-23 12:44:45 -07:00
Mathieu Lacage f1019e4026 dox missing SetNode method 2008-06-23 12:44:21 -07:00
Mathieu Lacage 398ffd3d58 avoid dox warning 2008-06-23 12:44:05 -07:00
Mathieu Lacage ae661f53e0 update doxygen to match the reality of the code 2008-06-23 12:43:54 -07:00
Mathieu Lacage 4b3b79be2f add packet header howto 2008-06-23 10:21:59 -07:00
Mathieu Lacage 2fb03d7aa3 testcase and fix, symmetric to changeset c861a47407a8 2008-06-21 21:20:38 -07:00
Mathieu Lacage 14c3cac1d1 fix testcase from changeset e367e86d7886 2008-06-21 21:14:28 -07:00
Mathieu Lacage c4ea047cb9 add documentation comment. 2008-06-21 21:08:16 -07:00
Mathieu Lacage 6746cc48eb bug 217: another testcase. 2008-06-21 21:07:45 -07:00
Mathieu Lacage 1fe76d94f1 remove tcp-2way from examples. mistake from changeset c8011a2a0c60 2008-06-21 13:22:39 -07:00
Mathieu Lacage 6d739bf2b5 bug 217: yet another testcase: make sure we handle degenerate testcases with tags which refer to non-existant data. 2008-06-21 10:30:47 -07:00
Mathieu Lacage c3fb9059ac another testcase for bug 217. Make sure we do not report tags outside of the current range 2008-06-21 08:55:04 -07:00
Mathieu Lacage 0c35c2b60f bug 217: avoid unsigned/signed confusion. Used signed all the time. 2008-06-21 08:11:10 -07:00
Mathieu Lacage 9008e089ae bug 217: add failing testcase 2008-06-21 08:05:21 -07:00
Mathieu Lacage ad46f21982 merge testcase 2008-06-20 19:21:11 -07:00
Mathieu Lacage 8a78bf66ae testcase for changeset 133490cf0210 2008-06-20 19:20:58 -07:00
Mathieu Lacage da514b5edb bug 217: Handle gracefully the case where a packet aggregated contains nothing. 2008-06-20 15:06:23 -07:00
Unknown 4743c2ff7c Patch addresses bug 227. 2008-06-19 14:58:46 -07:00
Unknown 7c05c10381 same messages for all versions of getting traces 2008-06-19 14:53:53 -07:00
Unknown 544f9d1a81 Bug 181 2008-06-19 14:46:27 -07:00
Unknown c7e37d1a18 move m_wouldBlock assignment to fix bug 226 2008-06-18 21:29:21 -07:00
Unknown b357866655 GetNNodes() in NodeList fixes bug 225 2008-06-18 21:17:56 -07:00
Craig Dowell aefd3e3371 tweaks after actually doing it 2008-06-18 11:57:43 -07:00
Craig Dowell 4587183489 tweak release steps 2008-06-18 11:04:07 -07:00
Craig Dowell 6f2e42050f print out which repo is used for regression 2008-06-18 10:39:30 -07:00
Craig Dowell a86ec45ec9 branch merge 2008-06-18 10:36:06 -07:00
Craig Dowell d99df782e9 regression 2008-06-18 10:34:05 -07:00
Craig Dowell e1d52991b6 fixes for regression numbering 2008-06-18 10:29:19 -07:00
Gustavo J. A. M. Carneiro 2d2675e6f8 Bug 223: Regression using other than mercurial traces no longer works 2008-06-18 18:07:48 +01:00
Gustavo J. A. M. Carneiro d4a0ae2a74 Add a WAF workaround for the 'Input line is too long.' error in win32/mingw. 2008-06-18 15:21:08 +01:00
Craig Dowell b5cfed2178 use dev traces 2008-06-17 13:37:04 -07:00
Craig Dowell a6aed94fe8 plug more holes in release steps 2008-06-17 12:52:46 -07:00
Craig Dowell 9da2bfa832 bump 2008-06-17 11:57:27 -07:00
Craig Dowell 098186e7e6 fill in some blanks 2008-06-17 11:53:20 -07:00
Craig Dowell 452bb57c9f Added tag release candidate ns-3.1-RC1 for changeset 8869a79a391f 2008-06-17 10:36:56 -07:00
Craig Dowell 1b8812d558 Changes for bug 205, unlisted FIN bug 2008-06-16 16:25:52 -07:00
Gustavo J. A. M. Carneiro 4a73b2abd0 [Bug 221] need a scratch directory 2008-06-16 14:17:27 +01:00
Tom Henderson c11554b553 Split out non-tutorial sections from tutorial; place into a doc/manual directory 2008-06-15 21:38:13 -07:00
Tom Henderson da05aa1327 split out manual sections from tutorial 2008-06-15 21:27:13 -07:00
Mathieu Lacage 2edda56a6f merge bug 213 repo 2008-06-13 17:20:55 -07:00
Mathieu Lacage 9ed0f04944 merge with HEAD 2008-06-13 17:20:06 -07:00
Raj Bhattacharjea 1aef4543cc bug 181: Normal Variable Infinite Value & Bounds 2008-06-13 17:19:53 -07:00
Raj Bhattacharjea 9ccd6dadcb Update the internet-stack documentation 2008-06-13 16:47:07 -04:00
Gustavo J. A. M. Carneiro 8ae203ce50 Correct the OLSR documentation; remove dead API declarations and source file. 2008-06-13 15:35:07 +01:00
Tom Henderson 1e4c17bc9f doxygen for applications 2008-06-13 06:32:54 -07:00
Tom Henderson cbc938e2bf OLSR doxygen 2008-06-12 22:21:19 -07:00
Tom Henderson cdb5cc083f Doxygen for global routing 2008-06-12 06:11:18 -07:00
Tom Henderson de189d447c tutorial: s/internet-node/internet-stack 2008-06-10 06:08:16 -07:00
Tom Henderson aebdb9fbfd Move other applications to RecvFrom () 2008-06-09 20:42:31 -07:00
Mathieu Lacage 82e92545aa bug 186: internet-node directory must be renamed to internet-stack 2008-06-09 15:40:22 -07:00
Mathieu Lacage 8559d575f5 bug 61: warning must be fatal. 2008-06-09 11:39:29 -07:00
Craig Dowell 5a3fbf3637 documentation to resolve bug 75 2008-06-09 08:53:47 -07:00
Tom Henderson 9ca1253956 Change OLSR to use RecvFrom 2008-06-09 07:01:12 -07:00
Tom Henderson de69fcb842 RecvFrom() expansion, add flags parameter to some Send calls 2008-06-09 06:40:21 -07:00
Craig Dowell 88d12f80eb CSMA Cleanup, XXX in echo apps, clarification of point-to-point data rates in dox 2008-06-07 10:38:39 -07:00
Raj Bhattacharjea a37b419abd Merge 2008-06-06 16:30:28 -04:00
Raj Bhattacharjea 6c4692ea55 Restore tcp example to full size, also a bugfix 2008-06-06 16:10:54 -04:00
Raj Bhattacharjea 97d98fa1ce bug 195: naming inconsistency. 2008-06-06 11:42:19 -07:00
Raj Bhattacharjea 6bcd10f205 Merge last two changesets 2008-06-06 14:19:05 -04:00
Raj Bhattacharjea 36ac76b49c Merge last 6 changesets 2008-06-06 13:58:28 -04:00
Raj Bhattacharjea d003d6a34f Fix compile warning 2008-06-06 13:57:59 -04:00
Mathieu Lacage 3b217b603e a few new testcases, bug fixes. 2008-06-06 10:44:43 -07:00
Mathieu Lacage 43263bc0e7 add some logging 2008-06-06 10:22:05 -07:00
Raj Bhattacharjea 525969ca64 Part of bug 198 2008-06-06 12:22:50 -04:00
Mathieu Lacage fb9ca8f381 add support for attribtues to bug 34 2008-06-05 15:56:23 -07:00
Raj Bhattacharjea 1f9b7723b8 Update tcpsocket to use Ptr<Packet> in Send 2008-06-05 17:59:36 -04:00
Raj Bhattacharjea 60c2ddafa8 Tcp tx buffer (pendingdata) uses Ptr<Packet> internally; tagging should work 2008-06-05 16:49:59 -04:00
Florian Westphal 64e2c2bb8f Add ipv4 header checksum support. 2008-06-05 01:08:33 +02:00
Gustavo J. A. M. Carneiro b469955b1e Add OLSR attribute documentation; make Willingness an enum attribute instead of uint. Closes #211 2008-06-05 11:46:15 +01:00
Gustavo J. A. M. Carneiro c3557faf08 Add waf proxy script 2008-06-05 11:21:50 +01:00
Mathieu Lacage 4d144c5ec8 merge with HEAD 2008-06-04 16:59:58 -07:00
Mathieu Lacage 2b7b6628f3 bug 212: Packet::PrintTags fails 2008-06-04 16:59:41 -07:00
Raj Bhattacharjea de2475ddc3 Merge with ns-3-dev 2008-06-04 17:19:32 -04:00
Raj Bhattacharjea 4d2bbed418 Fix for bug 174 2008-06-04 16:14:49 -04:00
Mathieu Lacage 7ef64dd6ce mark internal class 2008-06-04 12:31:23 -07:00
Mathieu Lacage 90bbabf52f fix typo 2008-06-04 12:31:14 -07:00
Mathieu Lacage c43918d4c2 doxygen a couple of missing functions. Add acouple of more comments to existing mobility models 2008-06-04 12:29:07 -07:00
Mathieu Lacage 14562c914d this code is not wrong. 2008-06-04 11:59:31 -07:00
Mathieu Lacage 017b3b191d RemoveTag does not exist 2008-06-04 11:59:11 -07:00
Mathieu Lacage 49a48f01e8 remove un-implemented code 2008-06-04 11:58:51 -07:00
Mathieu Lacage 12ae07ddab bug 202: classes disappeared from doxygen output 2008-06-04 11:48:52 -07:00
Mathieu Lacage d86a521ff1 fix bug 208 for true. 2008-06-04 11:35:14 -07:00
Mathieu Lacage 3e3f102d62 remove misleading doxygen comment 2008-06-04 11:01:01 -07:00
Mathieu Lacage 45f9ff0ddc bug 210: must take device mtu into account. 2008-06-04 10:59:30 -07:00
Mathieu Lacage 44478e378d bug 209: remove buggy test for open state in PacketSocket::SendTo 2008-06-04 10:47:34 -07:00
Mathieu Lacage 1eb07aeaef bug 208: must clear flags bits in fragment offset deserialization. 2008-06-04 10:39:36 -07:00
Mathieu Lacage 10a7924d63 bug 207: ipv4-header.h needed in src/node module. 2008-06-04 10:18:57 -07:00
Mathieu Lacage d3b35a295c bug 206: allow comparing addresses of different types. 2008-06-04 10:09:29 -07:00
Mathieu Lacage 1a5577bc3d bug 204: implement Queue::DequeueAll. 2008-06-04 09:22:37 -07:00
Mathieu Lacage 92f2ed110a bug 203: Listen must be implemented for Udp and Packet sockets. 2008-06-04 09:19:16 -07:00
Mathieu Lacage 8b7d6955e6 improve attribute documentation 2008-06-04 09:18:44 -07:00
Gustavo J. A. M. Carneiro 1ae7ba74b9 merge 2008-06-04 14:02:06 +01:00
Gustavo J. A. M. Carneiro 94b7fd9434 Re-format the NQSTA state machine diagram so that it displays correctly with a fixed width font. 2008-06-04 14:00:41 +01:00
Mathieu Lacage 1ca824b340 merge with HEAD 2008-06-03 16:20:32 -07:00
Mathieu Lacage 94587dd4f3 bug 200: Packet::PrintTags is not implemented. 2008-06-03 16:20:17 -07:00
Gustavo J. A. M. Carneiro 6495130641 merge 2008-06-03 21:19:36 +01:00
Gustavo J. A. M. Carneiro d1cc848f30 Change default WiFi ProbeRequestTimeout to 50 ms; closes bug #199. 2008-06-03 21:16:21 +01:00
Mathieu Lacage 39b7522f4c merge with HEAD 2008-06-03 12:46:37 -07:00
Gustavo J. A. M. Carneiro 1840dfe6b1 Change the default beacon interval to a more realistic value (100 ms); closes bug #177. 2008-06-03 18:15:08 +01:00
Tom Henderson 5307dcfd48 Gustavo's API warnings 2008-06-03 07:09:40 -07:00
Tom Henderson 9dfc592a26 Added tag release ns-3.0.13 for changeset 79dba133b5f8 2008-06-02 21:21:26 -07:00
Tom Henderson be9d919a58 update RELEASE_NOTES and a few other files 2008-06-02 21:21:16 -07:00
Mathieu Lacage 937f78e7bc doxygen updates 2008-06-02 10:51:55 -07:00
Mathieu Lacage d9a606c58d update doxygen 2008-06-02 10:38:19 -07:00
Mathieu Lacage d3942cd4d0 remove dead code. 2008-06-02 10:38:10 -07:00
Mathieu Lacage 6badc137d9 add some doxygen, remove a couple of XXX 2008-06-02 10:30:24 -07:00
Mathieu Lacage 2eafd4b9b1 merge with HEAD 2008-06-02 09:42:29 -07:00
Mathieu Lacage add091ea23 bug197: fix infinite loop 2008-05-31 14:12:40 -07:00
Mathieu Lacage 92ebbd036d a testcase for bug 197 2008-05-31 14:12:24 -07:00
Mathieu Lacage f08ea71825 add small comment 2008-05-31 11:00:01 -07:00
Mathieu Lacage a5c312cb1c some more cleanup 2008-05-31 10:57:49 -07:00
Mathieu Lacage e20525cad9 add small comment 2008-05-31 10:47:24 -07:00
Mathieu Lacage 00d36e836c add logging, cleanup AddAtEnd. 2008-05-31 10:46:23 -07:00
Gustavo J. A. M. Carneiro 312b8da3a3 Check for the 'diff' command, don't allow running regression tests without it. 2008-05-31 16:14:49 +01:00
Raj Bhattacharjea 05a27250c1 Get rid of dead code from GTNetS 2008-05-30 15:31:50 -04:00
Raj Bhattacharjea a7a0a3de70 Change log output to be more consistent 2008-05-30 15:14:38 -04:00
Mathieu Lacage 26d46a960d fix a couple of XXX 2008-05-30 11:11:00 -07:00
Mathieu Lacage 2a323473e4 doxygen 2008-05-30 11:03:18 -07:00
Mathieu Lacage 4904c44f15 merge with HEAD 2008-05-30 10:39:43 -07:00
Mathieu Lacage e4ec46dd52 fix dox warnings 2008-05-30 10:38:59 -07:00
Tom Henderson a947ff3967 more doxygen 2008-05-30 10:36:02 -07:00
Mathieu Lacage bbf1d7cce3 fix dox warning 2008-05-30 10:35:25 -07:00
Tom Henderson dfb9b7360a Doxygen organization 2008-05-29 23:24:10 -07:00
Craig Dowell 554fcfda0d point-to-point cleanup 2008-05-29 19:09:56 -07:00
Mathieu Lacage 16d1d635a0 new Packet testcases, bug fix. 2008-05-29 12:13:42 -07:00
Mathieu Lacage 62d8743f1c bug 146: s/HostOrder// 2008-05-29 09:37:07 -07:00
Mathieu Lacage 5872949e0a make sure we output the right diff command 2008-05-29 09:06:42 -07:00
Mathieu Lacage f173b434dd DequeuePending returns 0 upon error, not the other way round. 2008-05-29 09:01:31 -07:00
Mathieu Lacage 48fa3d344c fix valgrind-reported leak 2008-05-29 08:16:53 -07:00
Gustavo J. A. M. Carneiro b9d448c83b Fix TCP valgrind problem (bug #194): TcpSocketImpl::m_wouldBlock was not always being initialized. 2008-05-29 15:10:40 +01:00
Gustavo J. A. M. Carneiro 6152ba1a89 Make Application::Start/Stop times relative, Simulator::StopAt(time) renamed to Simulator::Stop(time) and time also made relative, to improve consistency of the API which uses relative times everywhere else. Closes bug #191. 2008-05-29 11:45:57 +01:00
Gustavo J. A. M. Carneiro 08f2b87daa merge 2008-05-29 09:34:47 +01:00
Gustavo J. A. M. Carneiro 39c1412e3e Don't register IPv4 protocol handler for all interfaces, only for IPv4-enabled interfaces. 2008-05-29 09:34:31 +01:00
Tom Henderson 41b7eadd33 undo changeset 3161 (to pass unit tests) 2008-05-28 22:45:59 -07:00
Tom Henderson b851cc5b0b Undo changeset 3163 (breaks multicast) 2008-05-28 22:06:14 -07:00
Mathieu Lacage 08961f4883 make sure that the mac low listener is destroyed _after_ the mac low itself. 2008-05-28 13:59:53 -07:00
Mathieu Lacage c9ccce91ed remove dead code 2008-05-28 13:22:50 -07:00
Mathieu Lacage 76dd4d1db4 Fix off-by-2 errors 2008-05-28 13:03:29 -07:00
Mathieu Lacage 27e5640201 the TypeId for Packet sockets is PacketSocketFactory, not PacketSocket. fix bug introduced by changeset c33b6d2775b7. 2008-05-28 11:28:06 -07:00
Mathieu Lacage fdc3e27c11 merge with HEAD 2008-05-28 10:49:01 -07:00
Mathieu Lacage 709f6a6d5b document 2008-05-28 10:47:21 -07:00
Mathieu Lacage 45793c3a02 fix new packet bug 2008-05-28 10:47:14 -07:00
Mathieu Lacage 137ff47a46 fix the testcase 2008-05-28 10:31:09 -07:00
Mathieu Lacage ab01dd65a4 a failing testcase. 2008-05-28 10:11:25 -07:00
Mathieu Lacage 31870b3bc0 more logging code 2008-05-28 10:11:08 -07:00
Mathieu Lacage 0c34dea05b kill dead code 2008-05-28 10:10:47 -07:00
Gustavo J. A. M. Carneiro b135ced7aa Bug #154: Attach sockets to nodes. Patch by Rajib Bhattacharjea. 2008-05-28 17:52:42 +01:00
Mathieu Lacage 16018e8d7e add logging 2008-05-28 08:51:27 -07:00
Craig Dowell 0ef25b59c4 CSMA Model Description 2008-05-27 22:30:11 -07:00
Mathieu Lacage 20b1d65d07 avoid segfault 2008-05-27 15:57:51 -07:00
Mathieu Lacage eaf4fb4a6d doxygen. 2008-05-27 15:32:08 -07:00
Mathieu Lacage f86b2de0af merge with HEAD 2008-05-27 15:01:11 -07:00
Tom Henderson 4182edbc93 fix optimized build 2008-05-27 06:03:48 -07:00
Tom Henderson 6af434b9f9 branch merge 2008-05-26 21:41:23 -07:00
Mathieu Lacage f79ac9e373 fix optimized build 2008-05-26 21:03:59 -07:00
Mathieu Lacage c352b35d3f add NS_LOG_APPEND_CONTEXT 2008-05-26 21:00:25 -07:00
Mathieu Lacage b91e3b0e4c ATTRIBUTE_HELPER_HEADER_2 -> ATTRIBUTE_HELPER_HEADER 2008-05-26 20:48:54 -07:00
Mathieu Lacage 0d86d03be0 kill ATTRIBUTE_HELPER_HEADER_1 2008-05-26 20:44:19 -07:00
Tom Henderson 9a94ef7a2d some doxygen cleanup 2008-05-26 11:48:18 -07:00
Tom Henderson 791e9ae464 Receive raw buffer variant 2008-05-26 11:22:42 -07:00
Tom Henderson c2a543f568 Tutorial material for sockets 2008-05-26 11:07:41 -07:00
Mathieu Lacage b3390aaa3e report packet drops in ARP. 2008-05-25 14:58:22 -07:00
Mathieu Lacage 3d0264e3a3 fix bug 185 2008-05-25 14:44:36 -07:00
Mathieu Lacage 42fbffdbdb more logging. Make sure we do dispose attached Ipv4Interface 2008-05-25 14:44:14 -07:00
Mathieu Lacage f83b6c7ab1 more logging. Make sure we invoke parent's Dispose method 2008-05-25 14:43:41 -07:00
Mathieu Lacage 2f1e4574c0 more logging output 2008-05-25 14:42:55 -07:00
Mathieu Lacage de351e9388 re-organize the ARP code to expose arp cache attributes. 2008-05-25 11:07:08 -07:00
Mathieu Lacage 20f5f62292 add attributes to ArpCache 2008-05-25 10:27:34 -07:00
Tom Henderson 0008eeebce branch merge 2008-05-25 08:05:26 -07:00
Tom Henderson ca7b76ef27 Add tag serialize methods; add serialize routines to Address 2008-05-25 08:04:57 -07:00
Tom Henderson a41edb2fa1 remove std::endl from PPP header print 2008-05-25 05:35:22 -07:00
Craig Dowell ffd1766adc fix bug 183 2008-05-23 17:03:51 -07:00
Tom Henderson f9e025ad81 add dia to the supported figure generation tools for the tutorial; clean up 2008-05-23 15:50:00 -07:00
Tom Henderson b62c394703 dia command line options 2008-05-23 14:51:05 -07:00
Tom Henderson 4ba092f3aa branch merge 2008-05-23 12:26:21 -07:00
Tom Henderson 93126f3a55 tutorial work (add back packet chapter) 2008-05-23 12:25:55 -07:00
Raj Bhattacharjea 62ff82d0ca Fix up recv buffer stuff some more 2008-05-22 17:08:19 -04:00
Raj Bhattacharjea e62a059f05 Fix tcp rx buffer semantics; fromaddress tagging is broken at the moment 2008-05-22 11:55:42 -04:00
Tom Henderson 5f94a4cf59 merge with ns-3-dev 2008-05-21 22:40:18 -07:00
Craig Dowell 888a3bdad6 ppp model description 2008-05-21 21:20:30 -07:00
Tom Henderson 72dba0d456 branch merge 2008-05-21 19:00:38 -07:00
Raj Bhattacharjea 3bd417f4e5 Merge with tomh/ns-3-dev-socket 2008-05-21 12:01:24 -04:00
Tom Henderson 72d054a867 Move Tcp attributes from factory to TcpSocket 2008-05-21 00:38:49 -07:00
Gustavo J. A. M. Carneiro e9e87c3232 Require gtk+ >= 2.12; closes #182 2008-05-20 22:04:38 +01:00
Tom Henderson ef99300eff Add missing files 2008-05-20 12:55:23 -07:00
Tom Henderson 49d5404bfc Add abstract base class TcpSocket 2008-05-20 12:36:05 -07:00
Tom Henderson c21d79a87b change TcpImpl to TcpSocketFactoryImpl 2008-05-20 12:27:30 -07:00
Tom Henderson 8dc2460416 move Tcp to TcpSocketFactory 2008-05-20 12:16:55 -07:00
Tom Henderson e6bd2a7a6a change TcpSocket to TcpSocketImpl 2008-05-20 11:52:25 -07:00
Raj Bhattacharjea 3a34c3fff1 Merge with tomh/ns-3-dev-socket 2008-05-20 14:40:36 -04:00
Tom Henderson ad374c8d87 rename UdpSocket to UdpSocketImpl 2008-05-20 10:30:40 -07:00
Tom Henderson 935532822b Move UdpSocket to UdpSocketImpl 2008-05-20 10:16:03 -07:00
Mathieu Lacage 45d6dcd5f4 avoid warning with g++ 4.1.2 2008-05-20 08:01:11 -07:00
Mathieu Lacage e4c1b22090 fix build for g++ 3.4.6 2008-05-20 07:56:59 -07:00
Tom Henderson 2a14b1c408 remove spurious test line 2008-05-20 07:27:16 -07:00
Tom Henderson 5b119aa40d Add attributes to new abstract base class for UdpSocket 2008-05-20 07:25:17 -07:00
Tom Henderson 25de2ff3c4 s/UdpImpl/UdpSocketFactoryImpl 2008-05-17 22:02:09 -07:00
Tom Henderson 4c4ef85a93 s/ns3::Udp/ns3::UdpSocketFactory 2008-05-17 12:08:20 -07:00
Tom Henderson 67d54a7f8a Implement IPTTL socket option for UDP 2008-05-17 11:15:02 -07:00
Tom Henderson 0a476b4f04 undo SocketDefaults class; plumb in new UdpSocket option attributes 2008-05-16 21:28:07 -07:00
Mathieu Lacage 2c57f536e3 merge with HEAD 2008-05-16 15:52:04 -07:00
Mathieu Lacage a1882f8e10 merge from HEAD 2008-05-16 15:48:09 -07:00
Mathieu Lacage 7c509777e5 forgot to remove dead includes 2008-05-16 10:40:37 -07:00
Mathieu Lacage d5a75f0cec merge with HEAD 2008-05-16 10:29:34 -07:00
Mathieu Lacage 91c4ef481f remove dead code. 2008-05-16 10:25:24 -07:00
Craig Dowell d034ec3e08 fix bug 180 2008-05-16 10:11:49 -07:00
Mathieu Lacage dd4979ef89 merge with HEAD 2008-05-16 08:52:40 -07:00
Mathieu Lacage 84c9dd96db merge with HEAD 2008-05-16 08:41:19 -07:00
Tom Henderson 18011ba4eb improve send semantics, documentation 2008-05-15 23:06:58 -07:00
Tom Henderson aa7b91f890 branch merge 2008-05-15 21:35:55 -07:00
Mathieu Lacage 0e05b107fd avoid un-initialized bits 2008-05-15 11:37:36 -07:00
Mathieu Lacage 05c3383610 remove XXX 2008-05-15 11:25:17 -07:00
Mathieu Lacage 43c64f656b ensure that the list of positions is long enough 2008-05-15 10:39:44 -07:00
Mathieu Lacage 2b4b265b60 re-enable editing 2008-05-15 10:29:58 -07:00
Mathieu Lacage 0efe19fe76 cleanup the model memory. 2008-05-15 10:22:53 -07:00
Mathieu Lacage 1a990a1877 bug 179: Packet fragmentation bug 2008-05-15 09:49:04 -07:00
Gustavo J. A. M. Carneiro 6547b9222c GlobalRoutingManager: don't segfault for NetDevices that have no associated Channel (e.g. virtual NetDevices); just skip them. 2008-05-15 12:56:10 +01:00
Gustavo J. A. M. Carneiro a4a8086580 GlobalRoutingManager: don't abort with non-IP NetDevices, just skip them. 2008-05-15 12:54:28 +01:00
Unknown 8d3dfb1df9 Merged nonotifier with main branch. 2008-05-15 07:47:17 -04:00
Unknown 3226ce7f09 Changed MobilityModel::m_trace to be more descriptive. 2008-05-15 07:46:03 -04:00
Unknown 1b12b95ee9 Removed TraceContext and TraceResolver references, removed MobilityModelNotifier class, and minor changes on samples/main-random-walk.cc. 2008-05-14 19:24:17 -04:00
Mathieu Lacage ffdff79112 improve doxygen doc. 2008-05-14 15:47:44 -07:00
Mathieu Lacage 4b7bfc9b77 tweak log output 2008-05-14 15:47:35 -07:00
Mathieu Lacage ccb704ffc7 close the writer before deleting it 2008-05-14 15:00:58 -07:00
Mathieu Lacage ce87f97994 reset the output stream to get a proper trace path 2008-05-14 14:59:16 -07:00
Mathieu Lacage 8a7187fba3 also handle parent attributes. 2008-05-14 13:54:39 -07:00
Mathieu Lacage 3a8df9f3d6 make sure we iterate over the parent's attributes. 2008-05-14 13:54:27 -07:00
Mathieu Lacage 31a31ffc07 add missing TypeId::HasParent method 2008-05-14 13:54:23 -07:00
Mathieu Lacage 63dccc1973 make the iteration code more flexible. add tooltips to gtk config store 2008-05-14 13:33:55 -07:00
Gustavo J. A. M. Carneiro 36e6b69aaf PacketSocket bind-to-interface bug 2008-05-14 19:15:00 +01:00
Gustavo J. A. M. Carneiro dc624d46b3 merge 2008-05-14 18:16:02 +01:00
Gustavo J. A. M. Carneiro 1cecfe5548 Missing Packet::Copy in Node::ReceiveFromDevice for the multiple protocol handlers scenario. 2008-05-14 18:15:26 +01:00
Mathieu Lacage a54122b4e8 set a default window size. 2008-05-14 10:06:04 -07:00
Mathieu Lacage 693099a950 add scroll area and alternating row colors. 2008-05-14 09:51:25 -07:00
Mathieu Lacage ae1fed72b1 add missing getters 2008-05-14 09:44:39 -07:00
Mathieu Lacage b5e22fdc37 merge with HEAD 2008-05-14 09:37:53 -07:00
Mathieu Lacage 47e58be578 update pcap trace setup filename 2008-05-14 09:37:00 -07:00
Mathieu Lacage 833506428b merge with HEAD 2008-05-13 17:07:20 -07:00
Mathieu Lacage ca3c48f8e8 a basic but useful Gtk+-based config-store 2008-05-13 17:02:52 -07:00
Tom Henderson b00892cae7 swap SendTo parameters 2008-05-13 07:22:03 -07:00
Tom Henderson 2e116e5f74 Fix semantics of NotifySend() for Tcp 2008-05-13 06:57:57 -07:00
Tom Henderson 9eb007fd26 Add SocketDefaults to store socket option attributes (missing files) 2008-05-12 23:02:44 -07:00
Tom Henderson 6be343530f Add SocketDefaults to store socket option attributes 2008-05-12 23:02:23 -07:00
Gustavo J. A. M. Carneiro 9ee8930726 WAF: add uselib_local to the ns3 library to pull in library dependencies from the ns-3 modules into the main library. 2008-05-13 01:04:42 +01:00
Raj Bhattacharjea 0add09088e Use the correct semantics for sendcallback 2008-05-12 15:12:26 -04:00
Raj Bhattacharjea 006ac07f97 Tcp large transfer modified to keep sending for 10 seconds 2008-05-12 13:27:45 -04:00
Raj Bhattacharjea 5d5fd895f1 Add a socket callback that can unblock a blocked close 2008-05-12 13:13:50 -04:00
Tom Henderson a042d0bbef Move API for socket factory to a Socket::CreateSocket () factory method 2008-05-12 06:39:00 -07:00
Tom Henderson 3ebec1046c Some tcp socket cleanup for buffer limits 2008-05-11 22:12:16 -07:00
Tom Henderson 4340da4ca6 branch merge 2008-05-11 21:55:17 -07:00
Tom Henderson 6ec88588f1 tweak UdpSocket buffer limit behavior 2008-05-11 21:55:00 -07:00
Tom Henderson 32bc3d3664 Fix point-to-point unit tests 2008-05-11 21:43:55 -07:00
Tom Henderson ee62b6d04e Enable receive buffer limit for packet socket 2008-05-11 20:59:08 -07:00
Tom Henderson fc73accacd branch merge from ns-3-dev 2008-05-11 15:17:18 -07:00
Tom Henderson 9da8e1bb03 branch merge from Raj 2008-05-11 15:16:58 -07:00
Craig Dowell 515183caae fix bug 161 2008-05-11 11:18:21 -07:00
Tom Henderson 0f55fefaba API for SocketOptions class 2008-05-10 21:27:32 -07:00
Tom Henderson ddda864b77 branch merge 2008-05-10 20:22:27 -07:00
Craig Dowell 5a16ff1df4 bug 153 applied to CSMA 2008-05-08 13:26:49 -07:00
Raj Bhattacharjea 53841f6170 NotifySend ONLY when data is acked 2008-05-08 16:17:16 -04:00
Craig Dowell 3c8bfe6ae6 bug 153 2008-05-08 12:43:36 -07:00
Mathieu Lacage 2e699a4704 attempt to document some of the internal details 2008-05-08 12:40:44 -07:00
Raj Bhattacharjea 7089f682d6 Finite send buffer first cut 2008-05-08 15:31:44 -04:00
Mathieu Lacage 371ed54dc9 bench tags 2008-05-08 11:23:22 -07:00
Mathieu Lacage 0b6e955a24 help return-value-optimization 2008-05-08 11:22:40 -07:00
Mathieu Lacage f5bb823415 avoid doing the work twice. 2008-05-08 11:22:25 -07:00
Mathieu Lacage 83cd996471 inline a couple of tag methods. 2008-05-08 11:16:32 -07:00
Craig Dowell 418a3fae42 bug 170 2008-05-08 11:16:12 -07:00
Mathieu Lacage 66229167d2 enable metadata only on second run 2008-05-07 15:23:46 -07:00
Mathieu Lacage 164e8c83bc simplify code logic 2008-05-07 15:18:33 -07:00
Mathieu Lacage 2865203612 simplify code logic 2008-05-07 15:02:07 -07:00
Mathieu Lacage f2a37c6ca4 avoid stupid string allocation all the time. 2008-05-07 15:01:45 -07:00
Mathieu Lacage 6236cbf9a3 avoid useless ifdefs 2008-05-07 14:40:03 -07:00
Craig Dowell 58ab30c53c fix optimized build, bug 169 2008-05-07 14:24:45 -07:00
Mathieu Lacage beaf8569c0 add missing license headers 2008-05-07 13:47:19 -07:00
Mathieu Lacage 9679a25783 typos 2008-05-07 13:45:57 -07:00
Mathieu Lacage aaccadb46a a couple more tests. 2008-05-07 13:45:04 -07:00
Mathieu Lacage 4c424da911 add comments about previous bug fix 2008-05-07 11:33:40 -07:00
Mathieu Lacage 623d9898b7 avoid signed/unsigned comparison warning. 2008-05-07 11:28:17 -07:00
Mathieu Lacage 1c05220bba test self-assignment of packets 2008-05-06 15:04:36 -07:00
Mathieu Lacage ccd72825dd add dox doc 2008-05-06 14:54:52 -07:00
Mathieu Lacage 29169d42b6 add missing include for optimized builds 2008-05-06 14:54:44 -07:00
Mathieu Lacage 43ecf40b5a use a free list for tag buffers 2008-05-06 14:44:09 -07:00
Mathieu Lacage 119cf2035b use a shared buffer 2008-05-06 14:18:05 -07:00
Mathieu Lacage 73aec9c9b1 avoid segfault when setting NS_LOG=* 2008-05-06 12:20:10 -07:00
Gustavo J. A. M. Carneiro 04c8831510 merge 2008-05-04 22:46:31 +01:00
Gustavo J. A. M. Carneiro fbabf8129a Upgrade to WAF 1.4.1 2008-05-04 22:43:18 +01:00
Tom Henderson 08511f30c5 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional 2008-05-03 11:11:24 -07:00
Tom Henderson daddd90d07 Implement GetRxAvailable () 2008-05-02 10:55:07 -07:00
Tom Henderson bfe0533aa3 overloaded Recv() method suggested by Gustavo 2008-05-02 09:38:18 -07:00
Tom Henderson f8a2add627 more cleanup 2008-05-02 09:21:01 -07:00
Tom Henderson af58cc3026 remove more dead code 2008-04-28 21:54:48 -07:00
Tom Henderson c6f7bb2d3e remove previous socket receive methods 2008-04-28 21:45:55 -07:00
Tom Henderson 075851985f Move tcp socket to receive pull model 2008-04-28 21:33:15 -07:00
Gustavo J. A. M. Carneiro e4eeeb18f5 WAF: use os.path.join in the message 'Entering directory ...' 2008-04-26 22:02:12 +01:00
Gustavo J. A. M. Carneiro b61d0ff5f2 WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled. 2008-04-26 21:54:36 +01:00
Tom Henderson 288d193daa Cut over UDP applications to use the new receive API 2008-04-25 14:29:28 -07:00
Mathieu Lacage 0996a38b84 mtag -> tag 2008-04-24 16:06:33 -07:00
Mathieu Lacage 18ee064a79 Mtag -> Tag 2008-04-24 16:03:13 -07:00
Mathieu Lacage 96c43a7e26 remove now-unused Tags class 2008-04-24 16:01:53 -07:00
Mathieu Lacage 5c7b34db46 convert to new tag API. 2008-04-24 15:44:35 -07:00
Mathieu Lacage d3623e2142 add a couple of serialization/deserialization methods 2008-04-24 15:44:15 -07:00
Mathieu Lacage 062a2dcc42 add a couple of dox comments 2008-04-24 14:58:17 -07:00
Mathieu Lacage 2d581766fd a new tag implementation: Mtag 2008-04-24 14:52:59 -07:00
Tom Henderson d7a038431f Plumb in socket receive pull model, in parallel to existing Receive framework 2008-04-24 08:18:01 -07:00
Mathieu Lacage e17282f995 move test code to anon namespace 2008-04-23 15:01:27 -07:00
Mathieu Lacage 78829ba702 add a couple of helper test macros 2008-04-23 14:56:58 -07:00
Mathieu Lacage 4a78ce68d1 add adjustment report to overloaded Buffer::AddAtEnd method 2008-04-23 09:11:55 -07:00
Mathieu Lacage ad54b2ce62 make the code more consistent across AddAtStart and AddAtEnd 2008-04-23 09:05:18 -07:00
Mathieu Lacage f79e7581b6 report the adjustment delta in Buffer::AddAtEnd and Buffer::AddAtStart. 2008-04-23 08:54:29 -07:00
Mathieu Lacage aeffbb31d7 kill dead code 2008-04-23 08:35:59 -07:00
Tom Henderson b998a05cce A few minor cleanups to socket.h/cc 2008-04-22 22:39:17 -07:00
Tom Henderson 3752943c22 bug 131 partial fix: split out Send and DataSent callbacks 2008-04-22 22:29:16 -07:00
Tom Henderson 9fd7fbb86c Fix two nits that escaped checkin 2008-04-22 22:08:53 -07:00
Tom Henderson 829a6dd8bb branch merge 2008-04-22 21:19:39 -07:00
Tom Henderson 1f0dd55d8d EnablePcap()->EnablePcapAll(); EnableAscii()->EnableAsciiAll() 2008-04-22 21:18:04 -07:00
Mathieu Lacage 28bf2500e9 merge with HEAD 2008-04-22 14:36:24 -07:00
Mathieu Lacage 63d6b14d45 optimize case where fake payload is fragmented and re-assembled. 2008-04-22 14:35:42 -07:00
Mathieu Lacage 815f3721b7 move Packet::AddAtEnd implementation to the Buffer code. 2008-04-22 14:18:33 -07:00
Mathieu Lacage 0dab5235c9 kill unused code 2008-04-22 13:54:05 -07:00
Gustavo J. A. M. Carneiro eb9fa68703 Missing hg update when 'Synchronizing reference traces using Mercurial' 2008-04-21 17:31:01 +01:00
Mathieu Lacage 7be1b92968 merge with HEAD 2008-04-21 09:04:08 -07:00
Mathieu Lacage d1ddd3c89b merge 2008-04-21 08:58:23 -07:00
Mathieu Lacage 9b153c313b avoid crash due to mis-spelled data rate unit 2008-04-21 08:32:50 -07:00
Mathieu Lacage ea6e067812 merge with HEAD 2008-04-21 08:05:34 -07:00
Mathieu Lacage 6a93edb24e use CopyObject and not Create to copy RttMeanDeviation. Implement the copy constructor correctly. 2008-04-18 14:35:38 -07:00
Mathieu Lacage a6321aac60 add const version of CopyObject 2008-04-18 14:35:10 -07:00
Mathieu Lacage 450b10b597 merge with HEAD 2008-04-17 16:24:43 -07:00
Mathieu Lacage f91e2ff5a4 fix regression introduced by changeset 6244ea5e7831 to fix bug #173 2008-04-17 16:24:13 -07:00
Mathieu Lacage 35170aed54 merge with HEAD 2008-04-17 15:54:35 -07:00
Mathieu Lacage 2c1b7db441 merge with HEAD 2008-04-17 15:50:49 -07:00
Mathieu Lacage a557f1c064 output the initial value of the attributes 2008-04-17 15:40:25 -07:00
Mathieu Lacage f2b7b1795b small tweak to generated dox 2008-04-17 15:33:39 -07:00
Mathieu Lacage 3b711f9852 improve the auto-generated doxygen output. 2008-04-17 15:30:18 -07:00
Mathieu Lacage a890500150 add doxygen class definitions for native type Value classes. 2008-04-17 14:33:45 -07:00
Mathieu Lacage 7468230ede improve the doxygen output. 2008-04-17 14:15:33 -07:00
Mathieu Lacage 6a3326e529 fix dox warning 2008-04-17 14:13:27 -07:00
Mathieu Lacage 4ff40c4a07 get rid of Attribute class. Use AttributeValue subclasses directly. 2008-04-17 13:42:25 -07:00
Gustavo J. A. M. Carneiro 254057bd80 Add assertion to detect TimeUnit<N> divide by zero (if not detected, it creates an infinite loop) 2008-04-17 17:19:24 +01:00
Mathieu Lacage f5f32e0ea3 merge 2008-04-16 10:52:38 -07:00
Mathieu Lacage 39ef17d6a4 bug 107 2008-04-16 10:52:26 -07:00
Gustavo J. A. M. Carneiro 505de0c685 Address instances of different m_type's should compare differently; closes #173. 2008-04-16 18:37:20 +01:00
Raj Bhattacharjea bb10734d66 Fix for bug 166 2008-04-16 12:40:46 -04:00
Gustavo J. A. M. Carneiro edb480ad29 Fix bad usage of std container iteration and erase () all over OLSR code; closes #171; thanks to Liu Jian for spotting and submitting an initial patch. 2008-04-16 11:32:55 +01:00
Mathieu Lacage f4cff0e194 fix optimized build 2008-04-15 15:56:42 -07:00
Mathieu Lacage 78a2df8963 use function logging macros 2008-04-15 15:53:54 -07:00
Mathieu Lacage f8ec434cdb code was dead. 2008-04-15 15:29:43 -07:00
Mathieu Lacage 1649c1dc65 NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION 2008-04-15 15:10:53 -07:00
Mathieu Lacage 5c5ab1f1f0 bug 150: CommandLine::Parse argc parameter should not be a reference 2008-04-15 11:01:13 -07:00
Mathieu Lacage 53be11fe6f update testcase to deal with the return value of Socket::Send. Make sure udp packets are copied before going down the ip stack. 2008-04-15 10:49:09 -07:00
Mathieu Lacage 6fd8b6c572 bug 143: rename scheduler files 2008-04-15 10:09:42 -07:00
Liu Jian 61375f8ef5 Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets. 2008-04-15 09:41:58 -07:00
Mathieu Lacage 8a32b1e369 fix bug reported by Gustavo Carneiro: AP does not reply to ARP request. 2008-04-14 17:12:52 -07:00
Mathieu Lacage 22d1a6046d change NS_LOG= syntax and default behavior to be more useful by default. 2008-04-14 16:39:26 -07:00
Mathieu Lacage db81db32a8 generate list of trace sources and attributes in separate dox groups. 2008-04-14 16:19:17 -07:00
Mathieu Lacage c9d422bbb6 fix some dox warnings 2008-04-14 16:18:50 -07:00
Mathieu Lacage bd1ef984cc improve doxygen 2008-04-14 16:18:30 -07:00
Mathieu Lacage 6d53b47cae improve documentation 2008-04-14 16:06:44 -07:00
Mathieu Lacage 09f00c5b34 remove old non-relevant documentation. 2008-04-14 16:06:08 -07:00
Mathieu Lacage fbe5e3949f add missing license statement. 2008-04-14 15:44:43 -07:00
Mathieu Lacage 43dbc0b4d1 fix optimized build 2008-04-14 12:21:24 -07:00
Mathieu Lacage 5e9344d2d4 add doxygen. 2008-04-14 12:15:05 -07:00
Mathieu Lacage 2b0056553c add time logging support 2008-04-14 11:30:15 -07:00
Mathieu Lacage 6cf0d2e645 cleanup to avoid too many #ifdefs 2008-04-14 10:40:46 -07:00
Mathieu Lacage 822e13a7df align with the semantics of _PARAMS 2008-04-14 10:28:42 -07:00
Mathieu Lacage a62f9d7771 do not use __PRETTY_PRINT__ 2008-04-14 10:26:26 -07:00
Mathieu Lacage 112b278854 kill NS_LOG_PARAMS_BEGIN/END. 2008-04-14 10:10:17 -07:00
Gustavo Carneiro 14c60f7ad3 Remove the restriction of waf option --command-template requiring option --run; it no longer makes sense. 2008-04-14 14:19:12 +01:00
Tom Henderson e855838ed1 Align helper API use of Install() 2008-04-13 15:46:17 -07:00
Mathieu Lacage 8a4b416428 ConfigStore allows you to dump and read from a file a simulation configuration 2008-04-11 16:58:50 -07:00
Mathieu Lacage ca687b56f6 avoid trailing | 2008-04-11 16:58:00 -07:00
Mathieu Lacage 556d973168 implement operator >> 2008-04-11 16:52:22 -07:00
Mathieu Lacage 42282f5512 implement operator >> 2008-04-11 16:52:12 -07:00
Mathieu Lacage 0e65d73baa implement operator >> 2008-04-11 16:51:58 -07:00
Mathieu Lacage f7691237f5 -1 cuts the trailing s if the time postfix is longer than 1 char. 2008-04-11 12:23:19 -07:00
Mathieu Lacage ed0dcc982b merge 2008-04-11 11:30:05 -07:00
Mathieu Lacage a390b13f86 Backed out changeset 9fa2f44cdafa 2008-04-11 11:29:49 -07:00
Mathieu Lacage 5d91e8c2d2 implement operator << for ObjectFactory. 2008-04-11 11:27:09 -07:00
Mathieu Lacage 0789c9b435 use HasSetter/HasGetter to improve doxygen output. 2008-04-11 11:25:44 -07:00
Mathieu Lacage 03b4114b20 add AttributeAccessor::HasGetter/HasSetter and implement it. 2008-04-11 11:25:21 -07:00
Mathieu Lacage fda39900e3 allow an std::string to be an attribute 2008-04-11 11:24:42 -07:00
Mathieu Lacage 9167a8b308 merge with HEAD 2008-04-11 11:20:05 -07:00
Mathieu Lacage 60c81de8b5 ensure that out PcapTraces are generated in a consistant format to allow simple comparison of traces against a single set of reference traces. 2008-04-11 11:19:54 -07:00
Mathieu Lacage 3211fbb0bf allocate/deallocate buffer by hand. 2008-04-10 14:08:14 -07:00
Raj Bhattacharjea 3327b9da92 Shorten Tcp attribute names (bug 163) 2008-04-10 16:33:44 -04:00
Mathieu Lacage 72b496b9ef use RefCountBase 2008-04-10 13:01:53 -07:00
Mathieu Lacage 8bfd88b80b get rid of scary implementation details of Attribute. 2008-04-10 12:59:31 -07:00
Mathieu Lacage c456128c6d add copy constructor and assignment operator to ensure proper initialization of refcount. 2008-04-10 12:59:15 -07:00
Mathieu Lacage dd283f6ead print list of trace sources 2008-04-10 12:24:36 -07:00
Raj Bhattacharjea 271ea4bc75 Add support for TCP cwnd tracing 2008-04-10 15:04:47 -04:00
Craig Dowell e7c2292d7b make duplicate aggregations fail; avoid duplicate aggregations 2008-04-10 13:16:43 -07:00
Mathieu Lacage c883517a1d generate path information for each type. 2008-04-10 11:50:47 -07:00
Mathieu Lacage 696859e936 add a few missing ns3:: prefixes in TypeId names. 2008-04-10 11:50:08 -07:00
Mathieu Lacage 267a3ca69d add missing registration macro call 2008-04-10 11:11:55 -07:00
Mathieu Lacage 27c1fab7fc add functions to access list of root namespace objects 2008-04-10 11:11:34 -07:00
Mathieu Lacage be27a1c03d add missing TypeId in base class 2008-04-10 10:24:18 -07:00
Mathieu Lacage ba319c457d make IsChildOf not return true for test against self. Add operator < for TypeId. 2008-04-10 10:23:56 -07:00
Mathieu Lacage 4a556dbf91 iterate over the _aggregated_ objects: this does not include the initial pointer. 2008-04-10 09:23:24 -07:00
Mathieu Lacage 923b1180f9 iterate over aggregated objects dynamically. 2008-04-09 17:35:18 -07:00
Mathieu Lacage f6ba778fc9 define a TypeId for ns3::Ipv4Interface 2008-04-09 17:28:19 -07:00
Mathieu Lacage cff773b8d2 use a specific type if you can 2008-04-09 17:27:56 -07:00
Mathieu Lacage 776a594c3c typos in WifiChannel 2008-04-09 17:27:12 -07:00
Mathieu Lacage a75e91cc03 add ObjectVector::GetItemTypeId 2008-04-09 14:58:52 -07:00
Mathieu Lacage dc271270a8 allow access to the pointee's TypeId. 2008-04-09 14:28:16 -07:00
Mathieu Lacage cc927f907f improve type linking behavior. 2008-04-09 13:05:20 -07:00
Mathieu Lacage 53fb65aea7 add doxygen documentation to avoid doxygen warnings. 2008-04-09 13:04:37 -07:00
Mathieu Lacage 560a34ba97 add space to ensure doxygen reference generation. 2008-04-09 13:04:18 -07:00
Mathieu Lacage e0570ec0b0 add doxygen anchors to avoid warnings. 2008-04-09 13:03:58 -07:00
Mathieu Lacage e110fea8ff get rid of implicit conversion of Attribute to/from Ptr<>. Replace this with an explicit Pointer class. 2008-04-09 12:15:24 -07:00
Mathieu Lacage d4cd3c92fd Pointer class for primitive type pointer. 2008-04-09 11:46:04 -07:00
Mathieu Lacage b807dfa090 Make sure that we really attempt to destroy everything upon process exit. Gets rid of spurious leak reports in valgrind. 2008-04-09 10:04:16 -07:00
Mathieu Lacage 5a16b2cad8 add destructor. Easier to plant a breakpoint in there. 2008-04-09 10:03:28 -07:00
Mathieu Lacage 9ea56ac66a add pcap files to ignore list. 2008-04-09 10:02:54 -07:00
Mathieu Lacage 478e810ad5 add some debugging 2008-04-09 10:01:16 -07:00
Mathieu Lacage bf90dded3c avoid compilation warning about undefined MobilityModel class. 2008-04-09 09:08:54 -07:00
Tom Henderson c22d5c5733 revive mixed-wireless example from Simutools tutorial 2008-04-08 23:12:19 -07:00
Tom Henderson bb5f9f1a50 Prevent internet stack helper from overwriting internet stack 2008-04-08 23:10:39 -07:00
Tom Henderson 3f1c2d2653 some additional debugging for addressing conflicts 2008-04-08 23:10:11 -07:00
Tom Henderson f6dcb76287 Added tag release ns-3.0.12 for changeset b17f2928291e 2008-04-07 21:39:40 -07:00
Tom Henderson 6740fc4627 note that waf generates reference trace tarball now 2008-04-07 21:35:54 -07:00
Tom Henderson edc7af8a02 nits for 3.0.12 release 2008-04-07 21:07:38 -07:00
Craig Dowell 80c8937a01 rework app constructors 2008-04-07 18:29:38 -07:00
Mathieu Lacage 4400054ebe SetupUdp -> SetUdpLocal, SetupTcp -> SetTcpLocal 2008-04-07 10:44:06 -07:00
Mathieu Lacage 3a43bd4987 Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign 2008-04-07 10:41:21 -07:00
Mathieu Lacage c140066890 Build -> Install 2008-04-07 10:38:37 -07:00
Gustavo J. A. M. Carneiro c3f0505ddc Create regression traces tarball automatically on waf dist. 2008-04-06 21:57:11 +01:00
Gustavo J. A. M. Carneiro 8501ca807c Ignore .py[co] files (python bytecodes) 2008-04-06 21:41:31 +01:00
Gustavo J. A. M. Carneiro 75643a53ef Fix a diff|head race condition; Fix regression error messages to indicate the new waf commands to run regression tests. 2008-04-06 19:58:29 +01:00
Gustavo J. A. M. Carneiro b6471a7749 merge 2008-04-06 19:54:39 +01:00
Gustavo J. A. M. Carneiro 0c393e38c4 Fix case of 'diff xxx | head' appearing to succeed even if the diff command returned non-zero exit statux. 2008-04-06 19:22:39 +01:00
Raj Bhattacharjea 05019b6214 Add TCP delayed acks 2008-04-04 17:20:36 -04:00
Gustavo J. A. M. Carneiro 737bc7cd00 Integrate regression testing into the main waf script. 2008-04-04 19:33:39 +01:00
Raj Bhattacharjea 31d26c1e84 Small fix to tcp example 2008-04-04 14:00:41 -04:00
Mathieu Lacage ec7c5d2dd6 merge with HEAD 2008-04-04 19:02:34 +02:00
Mathieu Lacage b34fbc477b fix bug 159 2008-04-04 19:02:03 +02:00
Tom Henderson a8acd5c5f0 try to improve obj->png conversion 2008-04-04 08:47:41 -07:00
Tom Henderson 621f07f0d2 revert figure directory change 2008-04-03 23:15:16 -07:00
Tom Henderson 11468a4235 Remove filename 2008-04-03 23:04:25 -07:00
Tom Henderson 441b674f96 workaround texinfo problem with non-local images 2008-04-03 23:03:25 -07:00
Tom Henderson 2c273b86cd fixes for Makefile due to tgif command-line limitations 2008-04-03 22:42:10 -07:00
Mathieu Lacage d4347bc1b5 testcase from bug 159 2008-04-04 07:28:27 +02:00
Tom Henderson 5a8c75187d Makefile tweaks 2008-04-03 21:08:28 -07:00
Tom Henderson 36049254af a few tutorial updates; tutorial Makefile; tutorial figures directory 2008-04-03 20:58:40 -07:00
Tom Henderson 18dd6edda3 branch merge 2008-04-03 09:07:28 -07:00
Tom Henderson c802635595 Some doxygen work 2008-04-03 09:07:15 -07:00
Gustavo J. A. M. Carneiro 56b59c5905 Add a --no-task-lines WAF option; together with -v it makes WAF just print executed commands, like 'make' does. 2008-04-03 14:15:17 +01:00
Craig Dowell 6490c81cf8 Point regression tests to final locations, update release steps, bug 158 2008-04-02 21:33:31 -07:00
Raj Bhattacharjea ec3d666f3b Add IP layer tracing helpers to InternetStackHelper 2008-04-02 14:09:36 -04:00
Craig Dowell 8dc44fbfaf helpful hint 2008-04-01 17:05:54 -07:00
Craig Dowell 5a8d264371 address some list comments 2008-04-01 16:30:08 -07:00
Craig Dowell 3faceb9149 minor cleanup 2008-03-31 18:20:33 -07:00
Craig Dowell aad4e224e5 test test 2008-03-31 18:14:47 -07:00
Craig Dowell 5bd019aba0 use global seed in examples, new regression tests 2008-03-31 17:48:21 -07:00
Craig Dowell 9fe0c49344 some examples disappeared 2008-03-31 16:31:34 -07:00
Craig Dowell bcc362cd11 branch merge 2008-03-31 16:22:24 -07:00
Craig Dowell 34c057c351 quiet clone and pull 2008-03-31 16:22:06 -07:00
Craig Dowell 9c1922aebe fix diffs 2008-03-31 16:16:43 -07:00
Craig Dowell 058f508927 move reference traces out of main repo 2008-03-31 16:03:44 -07:00
Mathieu Lacage 24863d5368 add guillaume vu-brugier to author list 2008-03-31 15:39:50 -07:00
Mathieu Lacage e103bc0ded add Federico to author list. 2008-03-31 15:38:44 -07:00
Mathieu Lacage 766efc6d0e initial draft of release notes. 2008-03-31 15:33:19 -07:00
Mathieu Lacage e4fa093d5f update platform build matrix and example program. 2008-03-31 15:33:05 -07:00
Mathieu Lacage cb1e1d0023 bump up version number. 2008-03-31 15:32:46 -07:00
Mathieu Lacage dc96b531b1 generate .pcap postfix for pcap filenames 2008-03-31 15:19:31 -07:00
Mathieu Lacage a4a18943f7 change pcap filename template to be slightly more coherent. 2008-03-31 15:19:11 -07:00
Mathieu Lacage a87eed74c2 change pcap filename template to be slightly more coherent. 2008-03-31 15:19:08 -07:00
Mathieu Lacage 5a614715ea quiet dox warning 2008-03-31 15:00:39 -07:00
Mathieu Lacage 27d2380327 remove unused code. 2008-03-31 14:57:30 -07:00
Mathieu Lacage d1d683ee21 remove 'All rigts reserved' keyword per tom's suggestion 2008-03-31 14:56:41 -07:00
Mathieu Lacage 812fc3be75 add missing license headers 2008-03-31 14:50:25 -07:00
Mathieu Lacage ae4529b819 fix typo 2008-03-31 14:44:13 -07:00
Mathieu Lacage 2c1c5afe91 get rid of channel during dispose 2008-03-31 14:43:38 -07:00
Mathieu Lacage b41554c18f kill dead code. 2008-03-31 14:36:21 -07:00
Mathieu Lacage 40349f92d8 do not include internet-node.h 2008-03-31 14:36:15 -07:00
Mathieu Lacage 6935a997e6 do not use InternetNode 2008-03-31 14:34:38 -07:00
Mathieu Lacage 41f6573c8d do not include internet-node.h 2008-03-31 14:34:27 -07:00
Mathieu Lacage 2b44913a70 convert to helper API 2008-03-31 14:34:06 -07:00
Mathieu Lacage 64f72686aa merge with HEAD 2008-03-31 14:23:44 -07:00
Mathieu Lacage d06c2b4fae add back max simulation time on olsr example 2008-03-31 14:23:07 -07:00
Mathieu Lacage 889e333a35 add ns2's stupid prefix on each ascii line output. 2008-03-31 14:09:46 -07:00
Mathieu Lacage 379c3d5390 port to helper API 2008-03-31 14:00:40 -07:00
Craig Dowell 02273c7da7 branch merge 2008-03-31 13:54:57 -07:00
Craig Dowell 2bb663d011 branch merge 2008-03-31 13:54:41 -07:00
Mathieu Lacage 0dfe8fa5df use static method syntax to setup tracing 2008-03-31 13:49:45 -07:00
Mathieu Lacage e173bb868d remove example of p2p static routing: this requires using the low-level API and we don't want to show how to do this. 2008-03-31 13:44:08 -07:00
Mathieu Lacage c5ffe4c9dc remove dead comment 2008-03-31 13:41:09 -07:00
Mathieu Lacage a053ff6896 port to helper API 2008-03-31 13:25:01 -07:00
Mathieu Lacage 537e375fe1 port to helper API 2008-03-31 13:21:22 -07:00
Mathieu Lacage 879b2cb91d port to helper API 2008-03-31 13:20:26 -07:00
Mathieu Lacage c0d60678d9 port to helper API 2008-03-31 13:18:31 -07:00
Raj Bhattacharjea 521c43eb23 Fix the fin retransmission; 2008-03-31 16:18:03 -04:00
Mathieu Lacage 627813fe6c port to helper API. 2008-03-31 13:10:59 -07:00
Mathieu Lacage 16f7931992 port to helper API 2008-03-31 13:10:17 -07:00
Mathieu Lacage 76847a02ca port to helper API. 2008-03-31 11:40:48 -07:00
Mathieu Lacage 935a7896e1 use src/node/ipv4-address-generator.h 2008-03-31 11:40:40 -07:00
Mathieu Lacage 7f6f6ba6a7 improve warning output 2008-03-31 11:40:17 -07:00
Mathieu Lacage 8977a827b2 kill now-useless code. 2008-03-31 11:39:55 -07:00
Mathieu Lacage 11608c6b16 convert to helper API 2008-03-31 11:07:19 -07:00
Mathieu Lacage 6ac2042e55 tweak doxygen 2008-03-31 09:51:30 -07:00
Mathieu Lacage 4ff7264001 add missing tracing helpers and doxygen 2008-03-31 09:49:22 -07:00
Mathieu Lacage 9bcf1cdac5 add wifi helper tracing. 2008-03-31 09:34:51 -07:00
Raj Bhattacharjea f2769ba5a5 Remove the TCP examples that aren't in line with the helper API 2008-03-31 12:22:05 -04:00
Tom Henderson db02706e4c Prepend ascii trace lines with action and time 2008-03-30 22:39:27 -07:00
Tom Henderson 78bfd610d9 Move csma-one-subnet to helper api 2008-03-30 21:41:25 -07:00
Tom Henderson 20726f8201 move csma-multicast to new tracing helpers 2008-03-30 21:12:02 -07:00
Tom Henderson 4fc3138b1e Prepend ascii trace lines with action and time 2008-03-30 21:05:50 -07:00
Tom Henderson b6932288ae csma-multicast helper-ized (w/o tracing cutover yet) 2008-03-30 14:04:57 -07:00
Tom Henderson 6397957980 documentation for class RngStream 2008-03-29 13:28:54 -07:00
Tom Henderson 8810ebfe02 Fix multicast forwarding problem 2008-03-29 08:47:25 -07:00
Tom Henderson 7771ab6562 enable csma multicast 2008-03-29 06:33:19 -07:00
Mathieu Lacage 27615d70d1 use lsb order rather than network order 2008-03-28 18:45:52 -07:00
Mathieu Lacage 1a443df051 initialize no more fragment flag 2008-03-28 18:45:26 -07:00
Mathieu Lacage ff4dfc3009 add Htolsb and Lsbtoh write/read methods 2008-03-28 18:45:10 -07:00
Mathieu Lacage a349c602db basic pcap output 2008-03-28 17:35:50 -07:00
Mathieu Lacage 62308cf1ce delete a packet chunk after deserializing it from a packet. 2008-03-28 17:03:03 -07:00
Mathieu Lacage 511e11e9be configure tracing post-topology construction, not before. 2008-03-28 16:58:44 -07:00
Mathieu Lacage 6de12cc9d2 port to new pcap/ascii trace helpers 2008-03-28 13:40:08 -07:00
Mathieu Lacage 9ad6948605 use new pcap/ascii api 2008-03-28 13:19:14 -07:00
Mathieu Lacage 7e17f8d7e1 add ascii/pcap trace helpers 2008-03-28 13:05:44 -07:00
Mathieu Lacage 67c8f12b67 add doxygen 2008-03-28 12:49:39 -07:00
Federico Maguolo e0346ac124 GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission 2008-03-28 12:14:02 -07:00
Providence SALUMU MUNGA 46cc3fab6d make sure dev is initialized correctly when binding to more than one interface. 2008-03-28 11:26:59 -07:00
Providence SALUMU MUNGA 02dc54f597 tx power shoudl reflect the user-selected power level, not be always the power level zero. 2008-03-28 11:25:07 -07:00
Mathieu Lacage a7677d77de use new csma pcap and ascii tracing 2008-03-28 11:20:02 -07:00
Mathieu Lacage e963c05aeb add ascii and pcap tracing support to csma helper. 2008-03-28 11:19:38 -07:00
Mathieu Lacage cb475c1750 improve doxygen documentation. 2008-03-28 10:38:03 -07:00
Mathieu Lacage 4202275d10 give refcounting powers to PcapWriter. 2008-03-28 10:23:31 -07:00
Mathieu Lacage e9c67a3ada Rx traces report the full packet and make sure we set the length field correctly in case of LLC encapsulation 2008-03-28 10:21:57 -07:00
Mathieu Lacage ba70c90271 export header. 2008-03-27 15:32:15 -07:00
George F. Riley 8d084573dc bug: 147. Add RefCountBase 2008-03-27 15:28:54 -07:00
Mathieu Lacage 9644e5ee88 remove include 2008-03-27 15:22:04 -07:00
Mathieu Lacage 74541b0d23 remove useless trailing ; 2008-03-27 15:21:08 -07:00
Mathieu Lacage fa2983e8a4 remove useless trailing ; 2008-03-27 15:21:05 -07:00
Mathieu Lacage a280c30a20 remove dead member 2008-03-27 15:20:47 -07:00
Mathieu Lacage a85420cd34 merge with HEAD 2008-03-27 12:21:58 -07:00
Mathieu Lacage 982fe8454b port to helper API 2008-03-27 12:20:26 -07:00
Mathieu Lacage b5cfd48e9a helper for UdpEcho client and server 2008-03-27 12:20:14 -07:00
Mathieu Lacage b7f945f750 add UdpEchoClient::SetRemote 2008-03-27 12:19:22 -07:00
Mathieu Lacage 942f3404a3 improve attribute help string 2008-03-27 12:19:00 -07:00
Mathieu Lacage fd49891782 fix missing includes 2008-03-27 11:47:58 -07:00
Raj Bhattacharjea 6191bda098 Implement TcpHeader::Print (bug 151) 2008-03-27 12:27:41 -04:00
Mathieu Lacage ac7ef5158d merge with HEAD 2008-03-27 09:13:41 -07:00
Mathieu Lacage c61932afc5 port to helper API 2008-03-27 09:13:29 -07:00
Raj Bhattacharjea 473ea28f10 Cleanup of RandomVariable doxygen (bug 110) 2008-03-27 11:36:23 -04:00
Craig Dowell 2158f87125 branch merge 2008-03-26 21:28:27 -07:00
Craig Dowell b4aaac11c6 olsr test 2008-03-26 21:28:13 -07:00
Mathieu Lacage 1d78ea62e8 port to helper API 2008-03-26 16:12:46 -07:00
Mathieu Lacage 37f1478f00 use an attribute name which matches the member variable and method 2008-03-26 16:12:36 -07:00
Mathieu Lacage 2fe2751c9e do not aggregate error model to device 2008-03-26 14:53:00 -07:00
Mathieu Lacage 80e0d082b4 convert to helper API 2008-03-26 14:51:03 -07:00
Mathieu Lacage 011e2bbb70 add extra convenience constructors 2008-03-26 14:50:56 -07:00
Mathieu Lacage 26fba17dc2 port to helper API 2008-03-26 14:18:22 -07:00
Mathieu Lacage 4e2a41ae85 add SetMetric 2008-03-26 14:18:12 -07:00
Mathieu Lacage cb3bcff3a6 fallout from gustavo's header inclusion policy change. 2008-03-26 14:17:58 -07:00
Mathieu Lacage 72f7ffdb6d merge with head 2008-03-26 13:51:46 -07:00
Mathieu Lacage 050af31b95 use Ipv4InterfaceContainer to avoid hardcoding ip addresses. 2008-03-26 13:51:24 -07:00
Mathieu Lacage 89d089c506 introduce Ipv4InterfaceContainer and make Ipv4AddressHelper::Allocate return it. 2008-03-26 13:51:07 -07:00
Craig Dowell 3d0e59cd05 branch merge 2008-03-26 11:42:12 -07:00
Gustavo J. A. M. Carneiro 83dea96517 merge 2008-03-26 18:20:56 +00:00
Gustavo J. A. M. Carneiro e1d6ca18e1 Don't generate module dependencies includes in module headers. 2008-03-26 18:20:30 +00:00
Raj Bhattacharjea 7020d1611e A CSMA channel typo (Bug 152 reported by Guillaume Vu-Brugier) 2008-03-26 11:15:42 -04:00
Craig Dowell 0a3da46adc some tests and known traces 2008-03-26 01:33:41 -07:00
Craig Dowell ed271f5954 quiet diffs 2008-03-26 00:36:58 -07:00
Craig Dowell a3628b44c1 trace generation and comparison 2008-03-26 00:30:11 -07:00
Craig Dowell 23edc105e2 start of regression tests 2008-03-25 23:17:24 -07:00
Mathieu Lacage 44afb107ba convert to helper API. 2008-03-25 17:14:33 -07:00
Mathieu Lacage 5fe039c6a6 use the factories. 2008-03-25 17:13:32 -07:00
Mathieu Lacage cabb264eef initialize factories correctly. 2008-03-25 17:02:14 -07:00
Mathieu Lacage ab8a395c49 ensure type is registered 2008-03-25 17:01:56 -07:00
Mathieu Lacage da1d232338 make MaxBytes an attribute 2008-03-25 16:05:59 -07:00
Mathieu Lacage 08eb0aef35 use auto-generated headers 2008-03-25 14:48:37 -07:00
Mathieu Lacage d869416a92 merge with HEAD 2008-03-25 14:17:35 -07:00
Mathieu Lacage 77bf878ea8 convert PacketSocket scripts to PacketSocketHelper. 2008-03-25 14:16:40 -07:00
Mathieu Lacage 4966231237 add new files to build. 2008-03-25 14:16:26 -07:00
Mathieu Lacage 1724e3ceec aggregate PacketSocketFactory unconditionally. 2008-03-25 14:16:10 -07:00
Mathieu Lacage 58dd143df7 aggregate PacketSocketFactory when requested to. 2008-03-25 14:15:56 -07:00
Mathieu Lacage a6979a7bb9 remove PacketSocketFactory aggregation from Node base class 2008-03-25 14:15:34 -07:00
Raj Bhattacharjea 7b8b8e8de3 Fix a typo that caused stack overflow 2008-03-25 11:51:22 -04:00
Mathieu Lacage 7f56378951 merge with head 2008-03-24 16:32:16 -07:00
Mathieu Lacage b21f71e568 port to helper API 2008-03-24 16:31:19 -07:00
Mathieu Lacage 8872354a55 a bunch of new helpers. 2008-03-24 16:31:14 -07:00
Mathieu Lacage 69dfbe8707 port to helper API. 2008-03-24 16:30:37 -07:00
Mathieu Lacage 5117b61f63 create an ipv4 interface if there is none. 2008-03-24 16:30:25 -07:00
Mathieu Lacage bb59c6a9fb register constructor 2008-03-24 16:30:05 -07:00
Mathieu Lacage c6868e0961 ensure registration. 2008-03-24 16:29:43 -07:00
Craig Dowell ff02feb0b7 quiet unused variable warning 2008-03-24 15:48:09 -07:00
Craig Dowell 991e83fe2c address generator, address collision checker 2008-03-24 15:31:54 -07:00
Mathieu Lacage 0a9ad0c47c use auto-generated per-module headers 2008-03-24 13:57:26 -07:00
Mathieu Lacage dafc9f88ae doxygen 2008-03-24 13:57:14 -07:00
Mathieu Lacage 9b4661c799 add missing include 2008-03-24 13:57:07 -07:00
Mathieu Lacage 69ddf50d98 merge 2008-03-24 13:33:56 -07:00
Mathieu Lacage 386b5fe6eb make ns3::Channel wholy pure. 2008-03-24 13:33:41 -07:00
Mathieu Lacage 25374b7325 improve doxygen. 2008-03-24 13:25:08 -07:00
Mathieu Lacage da3541e88d cleanup. 2008-03-24 13:15:53 -07:00
Mathieu Lacage 3bf71817cf remove undeeded include. 2008-03-24 13:11:48 -07:00
Mathieu Lacage 8acd8baa33 use FailSafe postfix in a more rigorous way. 2008-03-24 13:04:55 -07:00
Mathieu Lacage 7c1cda0ccb doxygen 2008-03-24 13:04:27 -07:00
Craig Dowell a12b08bd3a branch merge 2008-03-24 12:57:32 -07:00
Craig Dowell 341ef1908c fix unit tests 2008-03-24 12:56:39 -07:00
Craig Dowell 18bfce3a97 typos in doxygen, default to 0.0.0.1, avoid broadcast address 2008-03-24 12:45:02 -07:00
Mathieu Lacage 35729f1717 merge 2008-03-24 12:21:20 -07:00
Mathieu Lacage f44690e9af doxygen 2008-03-24 12:12:22 -07:00
Mathieu Lacage 14690d8553 InternetStackHelper. 2008-03-24 12:11:30 -07:00
Gustavo J. A. M. Carneiro 44d0c56680 Fix swapped comments in wifi-ap.cc. 2008-03-24 19:00:18 +00:00
Mathieu Lacage 3a19364b1b introduce AddInternetStack 2008-03-24 11:56:50 -07:00
Mathieu Lacage 9ad409452b fix dox warnings. 2008-03-24 11:50:58 -07:00
Mathieu Lacage 47775d87da doxygen. 2008-03-24 11:49:58 -07:00
Mathieu Lacage 41bbee50af doxygen 2008-03-24 11:43:49 -07:00
Mathieu Lacage 80fec1898e do not use templates. 2008-03-24 11:28:42 -07:00
Mathieu Lacage 0ccf783437 doxygen 2008-03-24 11:14:05 -07:00
Mathieu Lacage 35d9ec1c8e change signature of MobilityHelper::Layout and MobilityHelper::LayoutAll. 2008-03-24 10:42:18 -07:00
Mathieu Lacage 4e5eab77e2 add NodeContainer::GetGlobal 2008-03-24 10:41:44 -07:00
Mathieu Lacage 29f19e164e doxygen. 2008-03-24 10:14:35 -07:00
Craig Dowell e1c0003987 ip helper and find ip interface for device method on ipv4 2008-03-21 17:26:01 -07:00
Mathieu Lacage 4404c371af doxygen 2008-03-21 15:58:20 -07:00
Mathieu Lacage 83ac55585c doxygen. 2008-03-21 15:52:49 -07:00
Mathieu Lacage e9a8648ae9 add \ref to get links. 2008-03-21 15:52:42 -07:00
Mathieu Lacage f17df2c2dc some more doxygen 2008-03-21 15:33:01 -07:00
Mathieu Lacage 18c92e855d TypeId::GetAttributeListN -> TypeId::GetAttributeN 2008-03-21 13:41:16 -07:00
Mathieu Lacage 048ffbe7d3 move another helper to the helper dir 2008-03-21 13:24:15 -07:00
Mathieu Lacage e5818f9865 remove references to non-existant code. 2008-03-21 13:24:01 -07:00
Mathieu Lacage 09b0afe3d5 fix the build, again. 2008-03-21 13:19:37 -07:00
Mathieu Lacage 4f3921d1bf remove reference to trace resolver. 2008-03-21 13:14:00 -07:00
Mathieu Lacage 48a799a6ac fix dox warnings 2008-03-21 13:06:34 -07:00
Mathieu Lacage 08ce187c6b doxygen. 2008-03-21 12:56:40 -07:00
Mathieu Lacage d3fb648979 fix build 2008-03-21 12:56:33 -07:00
Mathieu Lacage 2759411565 merge 2008-03-21 12:34:11 -07:00
Mathieu Lacage fa8f4bf528 improve doxygen 2008-03-21 12:33:35 -07:00
Tom Henderson eeaea6f03b tutorial updates for attributes 2008-03-21 12:14:07 -07:00
Mathieu Lacage 8125fab8c3 add missing header 2008-03-21 11:04:29 -07:00
Mathieu Lacage 7fe3f102ff remove dead header 2008-03-21 09:57:27 -07:00
Mathieu Lacage 53b38a05ea remove dead header 2008-03-21 09:56:48 -07:00
Mathieu Lacage 8aada40095 merge 2008-03-21 09:09:32 -07:00
Mathieu Lacage 621b84064a AllocateUid/Search seem to not calculate correctly mode uids. 2008-03-21 09:09:10 -07:00
Gustavo J. A. M. Carneiro 91cf6bfccd Fix the udp socket unit test problem discovered by Mathieu. 2008-03-21 14:17:58 +00:00
src/devices/wifi/Federico Maguolo c9785a0ef0 Composite and Jakes propagation loss models. 2008-03-21 04:51:36 +01:00
Federico Maguolo 73ea5d6192 PropagationLossModel::GetRxPower -> PropagationLossModel::GetLoss 2008-03-21 04:49:23 +01:00
Federico Maguolo 752658119f add missing prefix. 2008-03-21 04:38:09 +01:00
Mathieu Lacage 53b3d2bb1f SimpleChannel/SimpleNetDevice. Use them where needed. 2008-03-20 15:27:48 -07:00
Mathieu Lacage e22584cd79 merge with head 2008-03-20 13:37:27 -07:00
Raj Bhattacharjea 05b6cf11a8 Fix TCP handshake sequence numbers 2008-03-20 16:25:35 -04:00
Mathieu Lacage 960bc0d1ba add missing license headers. 2008-03-20 13:25:08 -07:00
Mathieu Lacage 745520c03d some doxygen work. 2008-03-20 13:23:03 -07:00
Raj Bhattacharjea de80ab4910 Pass TcpSockets as smart pointers into demux callbacks
fixes TcpSocket memory leaks
2008-03-20 14:04:24 -04:00
Mathieu Lacage c995c98e85 Add an explicit copy constructor. Bug reported by Raj. 2008-03-20 10:25:59 -07:00
Mathieu Lacage fc3824059b point to point smoke tests 2008-03-20 10:14:02 -07:00
Mathieu Lacage ef44869539 merge TypeId in headers and trailers branch 2008-03-20 09:56:03 -07:00
Gustavo J. A. M. Carneiro 4ef540a4e6 Fix parsing of GlobalValues as command line options. 2008-03-20 15:16:17 +00:00
Gustavo J. A. M. Carneiro 56299308b6 Fix deserialization for Constant and Uniform random variables. 2008-03-20 15:10:56 +00:00
Mathieu Lacage f7aa0eb745 static-ify 2008-03-19 15:43:08 -07:00
Mathieu Lacage 881590b6d7 A bunch of wifi smoke tests. 2008-03-19 15:30:41 -07:00
Mathieu Lacage c78d5b071a fix typename 2008-03-19 15:30:18 -07:00
Mathieu Lacage 6974ce4f24 get the typename right. make sure the object is registered with our type system. 2008-03-19 15:14:17 -07:00
Mathieu Lacage 627a2048f1 remove trailing ; 2008-03-19 13:11:25 -07:00
Mathieu Lacage 5cd592fe06 remove template methods. 2008-03-19 13:10:01 -07:00
Mathieu Lacage 295c1cd3d5 move wifi examples to example directory 2008-03-19 12:42:54 -07:00
Mathieu Lacage 931e5140e2 add a bunch of trace sinks for demonstration 2008-03-19 12:41:06 -07:00
Mathieu Lacage 574ed67011 convert Packet::Print to use Chunk::Print 2008-03-19 12:36:27 -07:00
Mathieu Lacage 5b42ef5b02 make sure the trace hooks get a full packet as input. 2008-03-19 12:36:09 -07:00
Mathieu Lacage c6aa4c8fb4 fix failing tests 2008-03-19 12:30:19 -07:00
Mathieu Lacage 6534020b54 add failing tests 2008-03-19 12:30:00 -07:00
Mathieu Lacage a3ed490b7f call SetAddress during construction to assign MAC-level addresses. 2008-03-19 11:19:29 -07:00
Mathieu Lacage 10bbdc4176 add SetAddress methods. 2008-03-19 11:19:05 -07:00
Mathieu Lacage 26f046edd5 fragmentEnd is not zero when this is a fragment. 2008-03-19 11:11:34 -07:00
Mathieu Lacage cabfd83031 improve pretty-printing output. 2008-03-19 11:10:37 -07:00
Mathieu Lacage 1518a1dbd1 add extra trace sources 2008-03-19 11:10:02 -07:00
Mathieu Lacage e5b7c28375 add Print to the Chunk base class. 2008-03-19 10:32:06 -07:00
Mathieu Lacage 2f666d9622 make sure all headers and trailers gets a constructor registered in their TypeId. 2008-03-19 10:31:50 -07:00
Mathieu Lacage 30525bef9a make sure the Rx trace event also gets the llc header to be symetric with the tx event. 2008-03-19 10:30:59 -07:00
Tom Henderson e14aaceabe Add sample file for attribute values 2008-03-19 07:10:01 -07:00
Mathieu Lacage c8f4d234ea improve doxygen. 2008-03-17 17:47:45 -07:00
Mathieu Lacage 8dc5510518 implement Packet::Print 2008-03-17 17:37:25 -07:00
Mathieu Lacage 6b9fc231e1 remove dead code. 2008-03-17 14:49:52 -07:00
Mathieu Lacage a0a7c6d88c stop using ChunkRegistry to get header and trailer uids 2008-03-17 14:01:55 -07:00
Mathieu Lacage f6438556ef add TypeId::SetUid/GetUid 2008-03-17 13:31:08 -07:00
Mathieu Lacage 5d4ecfc62c define a TypeId for each Header/Trailer. 2008-03-17 13:12:17 -07:00
Mathieu Lacage de502593ef make the base Header and Trailer classes virtual. 2008-03-17 12:12:17 -07:00
Mathieu Lacage b5bfc150e3 add TypeId::IsChildOf 2008-03-17 11:55:46 -07:00
Mathieu Lacage bcf92901ac really kill dead code. 2008-03-17 11:47:50 -07:00
Mathieu Lacage c7be59d0c1 replace PacketPrinter with an iterator 2008-03-17 11:45:36 -07:00
Mathieu Lacage 218c66592a move more code around 2008-03-17 05:42:20 +01:00
Mathieu Lacage 96e4874bdb move attribute code to ObjectBase. 2008-03-17 05:22:29 +01:00
Mathieu Lacage 0ef1e6b866 return the _current_ tid, not the Object tid. 2008-03-16 21:52:15 +01:00
Mathieu Lacage 0bfc594407 remove Object::m_collecting 2008-03-16 21:00:31 +01:00
Mathieu Lacage fd014845f7 introduce ObjectBase::GetInstanceTypeId 2008-03-16 20:59:04 +01:00
Mathieu Lacage 660e414f36 split code from object.h/object.cc 2008-03-16 20:55:18 +01:00
Mathieu Lacage 1806cbede9 get rid of unneeded object-base include 2008-03-16 20:47:46 +01:00
Mathieu Lacage 3aa9706150 replace TypeId::CreateObject with TypeId::GetConstructor 2008-03-16 19:24:50 +01:00
Mathieu Lacage 939cee7ac3 do not use ObjectBase as a base class. 2008-03-16 18:42:23 +01:00
Gustavo J. A. M. Carneiro 0f79c7d754 Make waf dist much more efficient. 2008-03-16 14:35:32 +00:00
Mathieu Lacage 6a96f3f3ea improve doxygen and add explicit getters/setters 2008-03-15 23:25:13 +01:00
Mathieu Lacage ef0a14d093 make sure that all the Setters can be invoked in any order without memory leak 2008-03-15 23:04:01 +01:00
Mathieu Lacage b66b302a6a add missing accessor construction functions. 2008-03-15 23:03:40 +01:00
Mathieu Lacage b685071f5a release the channel. 2008-03-15 22:27:42 +01:00
Mathieu Lacage 2ea43c9729 avoid double-frees. 2008-03-15 22:27:35 +01:00
Mathieu Lacage eb89e875f7 don't forget to setup propagation delay and loss models on channel. 2008-03-15 19:51:40 +01:00
Mathieu Lacage 7ecce753a6 use the right position attribute name. 2008-03-15 19:38:00 +01:00
Mathieu Lacage 8ab25173a1 more ns3:: prefix fixes. 2008-03-15 19:31:57 +01:00
Mathieu Lacage ac16151d22 need to use ns3:: prefix for TypeId names now. 2008-03-15 19:29:22 +01:00
Gustavo J. A. M. Carneiro b68fa9919b Fix 'deprecated conversion of string literal to char*' warning with GCC 4.2 2008-03-15 16:26:39 +00:00
Gustavo J. A. M. Carneiro 516eb971a3 Generate foo-module.h module aggreator header files, for use in user scripts. 2008-03-15 16:13:18 +00:00
Gustavo J. A. M. Carneiro 22a66ef917 Missing headers.module attribute in the new 'helper' module... 2008-03-15 15:30:37 +00:00
Gustavo J. A. M. Carneiro 9cf6137916 Add a 'module' attribute to the ns3header object specifying which module each set of headers belongs to. 2007-12-26 13:40:39 +00:00
Mathieu Lacage 36995793fb merge with HEAD 2008-03-14 16:37:02 -07:00
Mathieu Lacage 0ddbe50a61 add CopyObject 2008-03-14 16:36:55 -07:00
Raj Bhattacharjea 0d839a85c0 Merge in forking tcp servers 2008-03-14 16:50:37 -04:00
Mathieu Lacage be10286ae5 merge with HEAD 2008-03-13 14:35:54 -07:00
Mathieu Lacage 4163debdfb merge 2008-03-13 14:28:22 -07:00
Mathieu Lacage c4b1bff412 move helpers to their own dir. 2008-03-13 14:24:45 -07:00
Mathieu Lacage 848cb7cfb5 add back support for introspected doxygen. 2008-03-13 12:56:49 -07:00
Gustavo J. A. M. Carneiro 6df47b4d19 OLSR: fix default willingness value, cleanup and fix the MPR computation algorithm. 2008-03-13 19:00:30 +00:00
Raj Bhattacharjea c09319cab9 This callback is supposed to happen later 2008-03-13 14:32:46 -04:00
Raj Bhattacharjea 175518d248 Undo changes to the packet sink to accept incoming connections; change the default behavior of the socket connection request notifier instead 2008-03-13 14:22:26 -04:00
Mathieu Lacage 14ccd72505 rework the Wifi API to not use a single WifiNetDevice::Setup method 2008-03-13 11:21:12 -07:00
Mathieu Lacage fb452286e6 add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes. 2008-03-13 11:10:38 -07:00
Mathieu Lacage aa3db11715 Add sufficient information to AttributeChecker to generate nice-looking doxygen documentation. 2008-03-12 11:35:00 -07:00
Mathieu Lacage 250eed3667 Add sufficient information to AttributeChecker to generate nice-looking documentation. 2008-03-12 11:17:16 -07:00
Mathieu Lacage 5a7be54e31 make sure attributes always start with a capital letter. 2008-03-12 10:18:14 -07:00
Mathieu Lacage 4227fc706d fix typo 2008-03-12 10:17:52 -07:00
Mathieu Lacage 3e4aa96665 kill valueref dox macro. 2008-03-12 09:32:02 -07:00
Mathieu Lacage b97dfc9450 fix doxygen errors 2008-03-12 09:31:50 -07:00
Mathieu Lacage 3c32879211 Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect 2008-03-11 13:46:22 -07:00
Mathieu Lacage 5d2044ae93 TraceSourceConnect -> TraceConnect && TraceSourceDisconnect -> TraceDisconnect 2008-03-11 13:34:29 -07:00
Mathieu Lacage b5a8d46096 get rid of CreateObjectWith 2008-03-11 13:30:12 -07:00
Mathieu Lacage 7a1c14372c do not set attributes if they have their default value. 2008-03-11 11:35:26 -07:00
Mathieu Lacage 9cac5c71ee check all errors. 2008-03-11 11:35:03 -07:00
Mathieu Lacage ef8ee7e7ef kill multiple constructors per TypeId 2008-03-11 11:29:21 -07:00
Mathieu Lacage ae62a57f4e dox doc 2008-03-10 14:59:49 -07:00
Mathieu Lacage e3fe5ec788 dox doc 2008-03-10 14:57:04 -07:00
Mathieu Lacage bd1c208097 add missing copyright/license headers 2008-03-10 14:52:08 -07:00
Mathieu Lacage 56c82ac742 dox doc 2008-03-10 14:51:15 -07:00
Mathieu Lacage 321b953877 doxygen doc 2008-03-10 14:05:26 -07:00
Mathieu Lacage 603615d2d0 doxygen doc 2008-03-10 13:09:32 -07:00
Mathieu Lacage a4c5f55812 rename old VALUE leftovers 2008-03-10 00:46:44 +01:00
Mathieu Lacage 517c5e5bfd add missing copyright statements. 2008-03-10 00:38:48 +01:00
Mathieu Lacage 514685e9a6 attribute should be Uinteger, not Integer 2008-03-10 00:32:36 +01:00
Mathieu Lacage 9b1a38aa42 kill dead code. 2008-03-10 00:32:24 +01:00
Mathieu Lacage 9af9500a0c forgot to ensure registration of GridPositionAllocator. 2008-03-10 00:29:41 +01:00
Mathieu Lacage eb4fb0cb5d kill DefaultValue 2008-03-10 00:27:53 +01:00
Mathieu Lacage 415eb2496a handle string input in GlobalValue code. Improve tests. 2008-03-10 00:26:54 +01:00
Mathieu Lacage bb5e793580 rewrite CommandLine to not handle DefaultValues anymore. 2008-03-09 23:43:52 +01:00
Mathieu Lacage fcc2066d01 ensure that device is reported in node. 2008-03-09 23:43:29 +01:00
Mathieu Lacage ad625de65a make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp 2008-03-09 22:55:25 +01:00
Mathieu Lacage 6f26975964 more FailSafe methods 2008-03-09 21:28:27 +01:00
Mathieu Lacage 9a8cbe189f disable mobility visualizer temporarily. 2008-03-09 21:07:35 +01:00
Mathieu Lacage 782dd6d45b add FailSafe versions of setters which could fail. 2008-03-09 21:07:14 +01:00
Mathieu Lacage 5ed6f37ad9 make Disconnect work with trace contexts. 2008-03-07 12:18:34 -08:00
Guillaume Vu-Brugier fceeaca439 store length type field in ethernet packets in network order. 2008-03-07 11:36:33 -08:00
Gustavo J. A. M. Carneiro f46a1041b8 OLSR optimization: avoid doing routing table computation if no local DB changed after receiving a OLSR packet. 2008-03-06 19:14:52 +00:00
Mathieu Lacage 90a26d4d51 another typo in Attribute names. 2008-03-05 00:16:39 +01:00
Mathieu Lacage 90a367e2e1 use the right attribute names 2008-03-04 23:48:18 +01:00
Mathieu Lacage 5273535527 ensure proper initialization 2008-03-04 23:23:37 +01:00
Mathieu Lacage c777a6802f start the OLSR agent 2008-03-03 22:38:26 +01:00
Mathieu Lacage 267b3e487b avoid typeid initialization ordering pb. 2008-03-03 21:52:51 +01:00
Mathieu Lacage 4ca05b7aad initialize properly the max msdu field. 2008-03-03 21:22:05 +01:00
Mathieu Lacage b1d7592e34 initialize properly mtu field. 2008-03-03 21:21:48 +01:00
Mathieu Lacage b6d8a11148 avoid infinite loop. 2008-03-03 21:00:50 +01:00
Mathieu Lacage 8ca8824655 avoid optimized build warning. 2008-03-03 21:00:27 +01:00
Mathieu Lacage 59df24f63f do not use DefaultValues in simulator 2008-03-03 20:47:12 +01:00
Mathieu Lacage 81b8f0f159 kill DataRateDefaultValue 2008-03-03 20:01:24 +01:00
Mathieu Lacage e4a7b6e868 revert to previous behavior: windowSize is initialized by default to 0xffff 2008-03-03 19:57:56 +01:00
Mathieu Lacage 773b4d80a5 get rid of DefaultValue usage in internet-node 2008-03-03 19:38:05 +01:00
Mathieu Lacage b14aab2fe4 give Attribute power to ObjectFactory class. 2008-03-03 19:33:28 +01:00
Mathieu Lacage a02c29d25b remove from build removed files 2008-03-03 19:01:25 +01:00
Mathieu Lacage ec5c7742d9 kill usage of default-value.h 2008-03-03 18:49:21 +01:00
Mathieu Lacage 6916fd5c3b kill dead code 2008-03-03 18:48:10 +01:00
Mathieu Lacage 06e1a61fab make pac, phy, et al available through Attributes 2008-03-03 18:31:07 +01:00
Mathieu Lacage 93f5de21b1 typo is code unused until then. 2008-03-03 18:30:48 +01:00
Mathieu Lacage 8350d5d0af port propagation models and channel to attributes. 2008-03-03 18:30:29 +01:00
Gustavo J. A. M. Carneiro 0fa7cbe6a3 Small OLSR memory optimisation. 2008-03-03 15:02:33 +00:00
Mathieu Lacage 45d5f42ca3 kill dead files. 2008-03-03 05:11:11 +01:00
Mathieu Lacage f15c11d440 remove unused code 2008-03-03 05:10:49 +01:00
Mathieu Lacage 20d6fdf375 more renamed files 2008-03-03 05:10:12 +01:00
Mathieu Lacage c3d5b77c96 renamed files 2008-03-03 04:42:16 +01:00
Mathieu Lacage 9b37416720 port last rate control algorithms 2008-03-03 04:03:39 +01:00
Mathieu Lacage 163c32fc28 kill old code. 2008-03-03 02:07:40 +01:00
Mathieu Lacage a786828ddf kill TraceResolver et al. 2008-03-03 01:58:57 +01:00
Mathieu Lacage 23bfe3fe09 remove old trace system 2008-03-02 22:53:11 +01:00
Mathieu Lacage 732c7f1d0b use Config-based trace system 2008-03-02 22:52:55 +01:00
Mathieu Lacage ce83863f87 convert to new trace system 2008-03-02 22:52:21 +01:00
Mathieu Lacage 713c893939 get rid of uneeded TraceResolver 2008-03-02 22:34:27 +01:00
Mathieu Lacage 7951713874 be consistant in how lists of objects are named. 2008-03-02 22:34:09 +01:00
Mathieu Lacage 42c7a8c6ab port pcap trace to Config. 2008-03-02 22:33:44 +01:00
Mathieu Lacage 99f4928d7c port AsciiTrace to Config::ConnectWithContext 2008-03-02 22:08:17 +01:00
Mathieu Lacage 356b89e672 re-implement tracing using Attributes. 2008-03-02 21:57:51 +01:00
Mathieu Lacage 7b79b4cdef do not use Queue::CreateDefault 2008-03-02 21:57:28 +01:00
Mathieu Lacage db4e999d61 register and unregister the NodeList as a config root namespace 2008-03-02 21:12:21 +01:00
Mathieu Lacage 346b857c6c implement context-based trace connection 2008-03-02 21:00:37 +01:00
Mathieu Lacage 936b124ff7 avoid memory leaks 2008-03-02 06:43:12 +01:00
Mathieu Lacage ed22af820c ensure that Dispose is invoked at one point. 2008-03-02 06:32:03 +01:00
Mathieu Lacage a5e8bdf451 avoid crashing AP wifi sample 2008-03-02 01:53:26 +01:00
Mathieu Lacage 8b2caa1a2a give Attribute powers to ssid 2008-03-02 01:53:06 +01:00
Mathieu Lacage c43e0ecb14 make sure the default behavior does not crash. 2008-03-02 01:18:07 +01:00
Mathieu Lacage 4c40782b30 add missing include 2008-03-02 01:17:37 +01:00
Mathieu Lacage 5c83be026b port wifi model to Attributes 2008-03-01 21:21:53 +01:00
Mathieu Lacage 0a3b46fdf5 improve debugging output. 2008-03-01 20:41:08 +01:00
Mathieu Lacage af58f11739 report attribute setting errors as early as possible. 2008-03-01 20:20:14 +01:00
Mathieu Lacage 58d05259cb add some debugging output 2008-03-01 19:55:16 +01:00
Mathieu Lacage 662bf63f87 introduce AttributeChecker::Create and use it instead of AttributeValue::Copy. 2008-03-01 19:54:48 +01:00
Mathieu Lacage 947e86f4fa add default constructor 2008-03-01 05:42:14 +01:00
Mathieu Lacage a0f5714f8a add ListPositionAllocator 2008-03-01 05:41:17 +01:00
Mathieu Lacage b7ab54776d setup a working behavior by default 2008-03-01 05:40:57 +01:00
Mathieu Lacage 4a1cb62fce add extra NodeContainer constructors 2008-03-01 05:40:06 +01:00
Mathieu Lacage bf1aad6a7d add ATTRIBUTE_VALUE_IMPLEMENT_NO_SERIALIZE 2008-03-01 05:39:25 +01:00
Mathieu Lacage 93ee85a925 output correct information about non-matching types. 2008-03-01 05:37:56 +01:00
Mathieu Lacage 69a95852ba typos in untested code path. 2008-02-29 17:27:14 +01:00
Mathieu Lacage 8e4605294a avoid macro namespace polution. 2008-02-29 00:45:02 +01:00
Mathieu Lacage 289cf2170e merge with HEAD 2008-02-28 18:15:07 +01:00
Mathieu Lacage 8f6d84e669 Use a temporary to avoid confusing the compiler. 2008-02-28 08:59:35 -08:00
Mathieu Lacage 21466b9afe Copy is not needed anymore. 2008-02-28 08:59:06 -08:00
Mathieu Lacage de39c3b77a convert WifiMacParameters to Attributes. 2008-02-28 07:17:53 +01:00
Mathieu Lacage 374362b25c small typo 2008-02-28 06:18:39 +01:00
Mathieu Lacage 7965ccd65c MacParameters -> WifiMacParameters 2008-02-28 06:18:02 +01:00
Mathieu Lacage 893a2d0859 do not use anonymous namespace in header 2008-02-27 20:39:06 -08:00
Mathieu Lacage fea84ff0f2 add example for trace connect/disconnection with trace paths 2008-02-28 04:28:34 +01:00
Mathieu Lacage e06e3096cb merge with HEAD 2008-02-27 22:19:39 +01:00
Mathieu Lacage 0c586271e5 introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes 2008-02-27 21:41:34 +01:00
Mathieu Lacage 1d4187bd0f add missing NS_OBJECT_ENSURE_REGISTERED calls. 2008-02-27 20:48:43 +01:00
Mathieu Lacage fe07d43e5d convert CsmaNetDevice to Attributes. 2008-02-27 20:23:57 +01:00
Mathieu Lacage 9e40bb3bfd fix optimized build 2008-02-27 19:51:34 +01:00
Mathieu Lacage 4704c9d427 convert InternetNode to Attributes. 2008-02-27 19:44:22 +01:00
Mathieu Lacage 49087105ad do not use operator []. Use iterators instead to work with std::list. 2008-02-27 19:36:03 +01:00
Mathieu Lacage dd0ae959fe re-organize the code to avoid link-time errors due to duplicate symbols. 2008-02-27 19:35:37 +01:00
Mathieu Lacage 8f8639aa7a fix compilation bug on osx 2008-02-27 17:39:32 +01:00
Mathieu Lacage e5e35f6545 port Applications to Attributes 2008-02-27 00:05:23 +01:00
Mathieu Lacage 1ae525bf0e use names closer to those used in the previous DefaultValues. 2008-02-26 23:27:19 +01:00
Mathieu Lacage fb2f498e54 make Ipv4Address/Ipv4Mask attributes 2008-02-26 23:26:59 +01:00
Mathieu Lacage cf2466f185 typo. 2008-02-26 22:41:25 +01:00
Mathieu Lacage 5ea4a79c06 forgot to uncomment code. 2008-02-26 22:41:02 +01:00
Mathieu Lacage ed32045dc6 do not use the private constructor to avoid overload resolution confusions. 2008-02-26 22:40:20 +01:00
Mathieu Lacage 1fe93d4e86 add an extra overload of SetTypeId to avoid overload resolution confusions. 2008-02-26 22:39:57 +01:00
Mathieu Lacage e933b3091d add extra checker construction function 2008-02-26 20:23:47 +01:00
Mathieu Lacage 0a8fd09acf add extra checker construction function 2008-02-26 20:23:43 +01:00
Mathieu Lacage 200a9c69ff add extra checker construction function 2008-02-26 20:22:13 +01:00
Mathieu Lacage bfc21a4e47 port Olsr code to attributes/helpers 2008-02-26 19:52:17 +01:00
Mathieu Lacage 276147ac65 add templated version of ObjectFactory::Create 2008-02-26 19:51:58 +01:00
Mathieu Lacage 9094ef8b1b EventTraceSource -> TracedCallback, ValueTraceSource -> TracedValue. 2008-02-26 19:51:33 +01:00
Mathieu Lacage b4ca4f9cf3 use Attributes in ErrorModel. 2008-02-26 18:33:10 +01:00
Mathieu Lacage a5c397f21b convert NodeList to Attributes. 2008-02-26 18:17:29 +01:00
Mathieu Lacage d5221dcfe4 fix tests 2008-02-26 18:17:10 +01:00
Mathieu Lacage 847f7587ff application and netdevice lists are attributes now. 2008-02-26 18:03:59 +01:00
Mathieu Lacage 061f5a8426 export public header 2008-02-26 18:03:44 +01:00
Mathieu Lacage 6a2d2601fc Release all events left upon Simulator::Destroy 2008-02-26 01:39:59 +01:00
Federico Maguolo 0d49574056 Sync event must be properly canceled upon tx during sync. 2008-02-26 01:23:27 +01:00
Federico Maguolo 10d2a5b770 Use the physical rate where needed. 2008-02-26 01:22:44 +01:00
Mathieu Lacage 9b0290012f merge 2008-02-26 01:09:16 +01:00
Mathieu Lacage 9db1cd07e3 merge 2008-02-26 01:08:58 +01:00
Mathieu Lacage 5b36ba86ad A Config class which hooks into the Object Attribute/Tracing system. 2008-02-26 01:07:16 +01:00
Raj Bhattacharjea f38dfb4e28 Fix memory leaks in PendingData class by returning Ptr<Packet> instead of PendingData* where appropriate 2008-02-25 17:06:18 -05:00
Mathieu Lacage 38d882d889 add a base arg to MakeSimpleAttributeChecker 2008-02-25 22:08:56 +01:00
Mathieu Lacage 4e598bde94 do not attempt to access the AttributeList as a fallback from GlobalValue. 2008-02-25 22:07:19 +01:00
Mathieu Lacage 702a31b06e add a few public methods for the Config code 2008-02-25 22:06:14 +01:00
Raj Bhattacharjea b5664b575d Move TcpSocket::m_retxEvent.Cancel to TcpSocket::Destroy; undoes d4217d7ba4ba 2008-02-25 15:28:03 -05:00
Kulin Shah 0ffaf38602 Fix to make the TCP SYN retransmission do a binary exponential backoff 2008-02-25 14:40:25 -05:00
Mathieu Lacage 2eae2f926c make NetDevice fully virtual. 2008-02-25 19:33:46 +01:00
Mathieu Lacage 96b47442ea test the ValueTraceSource with an arbitrary class. 2008-02-24 20:18:02 +01:00
Mathieu Lacage 93ae3cea51 replace IntegerTraceSource with ValueTraceSource 2008-02-24 20:04:31 +01:00
Mathieu Lacage 6895e23eca InitialValue -> GlobalValue 2008-02-23 05:23:59 +01:00
Federico Maguolo b744916fb8 RRAA implementation. 2008-02-22 23:45:25 +01:00
Mathieu Lacage 0febad916b Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources. 2008-02-22 23:34:53 +01:00
Federico Maguolo 7b44a35460 allow rate control algorithms to control more per-packet parameters. 2008-02-22 23:28:01 +01:00
Federico Maguolo 5e08c5cb5b the NAV should be updated only when the packet is _not_ addressed to us. (see section 9.2.5.4) 2008-02-22 23:16:51 +01:00
Mathieu Lacage c4238a2fb7 make EventTraceSource acceptable to the MakeTraceSourceAccessor function 2008-02-22 00:22:16 +01:00
Mathieu Lacage 2aa6ff8d7d invoke getters on tid temp variable to allow proper iteration over tid list. 2008-02-22 00:12:47 +01:00
Mathieu Lacage 6d05a9e061 get rid of useless accessor maker 2008-02-22 00:11:20 +01:00
Mathieu Lacage f8ca997175 actually allow connection and disconnection to trace sources registered in TypeIds 2008-02-22 00:08:00 +01:00
Mathieu Lacage 377f70de36 add an IntegerTraceSource which behaves just like an Integer. 2008-02-21 23:15:00 +01:00
Mathieu Lacage 0dbeed4691 remove accessor BASE arg to MakeAccessorHelper 2008-02-21 21:57:38 +01:00
Mathieu Lacage ca3a3794bf Object::Set/Get -> Object::SetAttribute/GetAttribute 2008-02-21 19:46:39 +01:00
Mathieu Lacage 1bcb523456 Attributes -> AttributeList 2008-02-21 19:31:17 +01:00
Mathieu Lacage 68a81eed0b AddParameter -> AddAttribute 2008-02-21 19:28:41 +01:00
Mathieu Lacage f9538ea708 enum-value -> enum 2008-02-21 19:16:00 +01:00
Mathieu Lacage 03cc15ebdd fp-value -> double 2008-02-21 19:13:39 +01:00
Mathieu Lacage 37b0481304 uint-value -> uinteger 2008-02-21 19:09:05 +01:00
Mathieu Lacage c1d4c1d4c5 int-value -> integer 2008-02-21 19:04:18 +01:00
Mathieu Lacage a7f4957c02 small typo 2008-02-21 18:58:08 +01:00
Mathieu Lacage e039942a02 boolean-value -> boolean 2008-02-21 18:57:34 +01:00
Mathieu Lacage 1706273d74 value-helper.h -> attribute-helper.h 2008-02-21 18:54:02 +01:00
Mathieu Lacage 23d972d9dd value-test.cc -> attribute-test.cc 2008-02-21 18:46:48 +01:00
Mathieu Lacage 3b50a66d0b param-spec-helper.h -> attribute-accessor-helper.h 2008-02-21 18:44:27 +01:00
Mathieu Lacage 969a41048d remove old helpers 2008-02-21 18:35:55 +01:00
Mathieu Lacage 5fc7981de6 convert to new helpers 2008-02-21 18:35:44 +01:00
Mathieu Lacage d041abd435 fix includes 2008-02-21 18:35:34 +01:00
Mathieu Lacage 9a0f0f438f convert RandomVariable to new helpers. 2008-02-21 18:28:05 +01:00
Mathieu Lacage baca67f7a3 fpValue -> Double 2008-02-21 00:54:05 +01:00
Mathieu Lacage cb069a418f indent align 2008-02-21 00:28:22 +01:00
Mathieu Lacage ae4e6226cf small typo: use the Value type for simple checking. 2008-02-21 00:19:43 +01:00
Mathieu Lacage fda20b8236 BooleanValue -> Boolean 2008-02-21 00:19:31 +01:00
Mathieu Lacage c5dc486e2c EnumValue -> Value 2008-02-21 00:00:18 +01:00
Mathieu Lacage 144e84154b UintValue -> Uinteger, IntValue -> Integer 2008-02-21 00:09:16 +01:00
Mathieu Lacage 5de083e234 value.h -> attribute.h 2008-02-20 21:45:42 +01:00
Mathieu Lacage e4529f9217 Value -> AttributeValue 2008-02-20 21:17:34 +01:00
Mathieu Lacage b511f31d39 Accessor -> AttributeAccessor 2008-02-20 20:57:59 +01:00
Raj Bhattacharjea 4d6e41a185 fix rtt::copy's signature 2008-02-20 14:26:42 -05:00
Raj Bhattacharjea 73740bdbc6 undoes 2326:eec07777d1a2 because localInterface is no longer needed (see bug 136) 2008-03-12 16:05:31 -04:00
Raj Bhattacharjea b30c9ee4b3 Cleanup of ipv4endpointdemux and tcpl4protocol 2008-03-12 15:33:11 -04:00
Raj Bhattacharjea 386b63ceb9 Fixes to tcp and to the ipv4endpointdemux to allow forking to work correctly 2008-03-12 14:52:29 -04:00
Raj Bhattacharjea ebbea8ae40 First cut at making the socket clone 2008-03-12 11:55:08 -04:00
Mathieu Lacage ad7d70ae34 ParamSpec -> Accessor 2008-02-20 20:24:52 +01:00
Mathieu Lacage c182f4d479 use helpr macro where needed. 2008-02-20 19:58:46 +01:00
Mathieu Lacage 6353d911c0 PValue -> Attribute 2008-02-20 19:57:31 +01:00
Mathieu Lacage 8c4ce99b89 add extra StopAt call to ensure that the simulation ends at some point. 2008-02-20 19:40:36 +01:00
Mathieu Lacage 6c34a2f48e PARAM -> ATTR 2008-02-20 19:33:59 +01:00
Mathieu Lacage f95a872d12 add missing include. 2008-02-20 19:30:12 +01:00
Tom Henderson 95c59da336 Update NS_LOG documentation 2008-02-19 21:33:08 -08:00
Gustavo J. A. M. Carneiro 78a151d337 Fix the WAF --run option for running a program with command line options 2008-02-19 21:43:28 +00:00
Mathieu Lacage cccdb1f6d6 small tweaking 2008-02-18 05:53:51 +01:00
Mathieu Lacage 4dce1b28b8 InitialValue support 2008-02-18 03:01:52 +01:00
Mathieu Lacage 8bac0c2ba3 move checker creation function to .cc file. 2008-02-18 03:01:42 +01:00
Mathieu Lacage c194579f5e split checker from ParamSpec. 2008-02-18 00:18:45 +01:00
Gustavo J. A. M. Carneiro 2a3e635cd1 Fix a typo in the WAF scripts; don't access m_linktask directly, use the get_target_name() method instead (to make it work with waf trunk). 2008-02-17 14:02:45 +00:00
Mathieu Lacage 82c3fa3aaa merge 2008-02-17 04:38:52 +01:00
Mathieu Lacage 2830225b2c Backed out changeset 7b145012b2eb 2008-02-17 04:38:41 +01:00
Mathieu Lacage cf9ed2855f split initial value from ParamSpec. 2008-02-17 04:38:34 +01:00
Mathieu Lacage b4edd36ec5 get rid of ParamSpec::CreateValue. 2008-02-17 00:46:24 +01:00
Tom Henderson 49d1a39d16 a few tweaks to the release steps document 2008-02-16 13:24:08 -08:00
Tom Henderson 23a8d8bf1b Added tag release-3.0.11 for changeset ee5e1da76ecc 2008-02-16 12:01:48 -08:00
Tom Henderson 1e70c7ac38 add Joe Kopena to AUTHORS list 2008-02-16 11:51:58 -08:00
Tom Henderson bf0d4e7154 avoid infinite recursion in Tcp callback (bug 131) 2008-02-15 19:54:34 -08:00
Mathieu Lacage e8fc6ec946 fix doxygen. 2008-02-15 20:53:07 +01:00
Mathieu Lacage be2b52ac8f update version number 2008-02-15 20:37:34 +01:00
Mathieu Lacage 7bb06e0661 initial release notes 2008-02-15 20:37:19 +01:00
Mathieu Lacage b56cad3cbc bug 133: automate RandomVariable memory management. 2008-02-15 20:03:48 +01:00
Mathieu Lacage 5bec43f720 fix bug 137: Make Ipv4Address (uint32_t) constructor explicit. patch by Gustavo. 2008-02-15 19:14:35 +01:00
Mathieu Lacage 25bb76ce20 macro-ify 2008-02-15 05:38:29 +01:00
Mathieu Lacage e94efb4a11 get rid of Value::ConvertFrom method. 2008-02-15 03:52:56 +01:00
Mathieu Lacage de438d035b helper getters and setters for c++ native types. 2008-02-15 02:08:55 +01:00
Mathieu Lacage 88c9b123ee add node/device containers to build 2008-02-14 23:57:18 +01:00
Mathieu Lacage 2c234e63e7 an initial draft of helper classes. don't work yet. 2008-02-14 23:56:54 +01:00
Mathieu Lacage bd94258500 add device/node containers for helper API. 2008-02-14 23:56:21 +01:00
Gustavo J. A. M. Carneiro ee5f2a5475 Make the OLSR routing protocol priority higher, not lower, than static routing.
The reason for this change is related to the fact that sockets now send
broadcast (255.255.255.255) packets as subnetwork directed broadcasts.  With
wireless OLSR nodes with only a single interface, in order for OLSR to hear
each other's broadcasts they all need to be in the same network.  On the other
hand, if the nodes are all in the same network then the static routing module
will mistakenly believe it has direct conectivity to all other nodes, thereby
bypassing OLSR completely.
2008-02-14 19:01:01 +00:00
Gustavo J. A. M. Carneiro 2806d0edbe Add support for tracing the OLSR routing table size. 2008-02-14 18:55:11 +00:00
Mathieu Lacage c51821715f convert DropTailQueue to parameters 2008-02-14 19:47:19 +01:00
Gustavo J. A. M. Carneiro 85cbeccd3e Check for malformed trace paths that do not start with '/'. 2008-02-14 18:15:26 +00:00
Gustavo J. A. M. Carneiro 147510bb00 Make Packet::RemoveTag behave as documented (bug #139) 2008-02-14 17:48:15 +00:00
Mathieu Lacage 450ca7325d replace ambiguous constructor with separate construction function. 2008-02-14 01:08:45 +01:00
Mathieu Lacage 3f5fa2d889 fix an old typo. 2008-02-14 00:43:46 +01:00
Mathieu Lacage 2e4860e39e add Value support to Address 2008-02-14 00:36:39 +01:00
Mathieu Lacage 392c7581eb add Value support to DataRate 2008-02-14 00:36:25 +01:00
Mathieu Lacage 81f0d2464c add Value support to Mac48Address 2008-02-14 00:36:14 +01:00
Mathieu Lacage 58a93485de introduce top-level ParamSpec for bindings. 2008-02-13 23:37:46 +01:00
Mathieu Lacage 23c4395731 convert RandomVariable, Rectangle, Vector, and Time to the new Class Helper 2008-02-13 22:39:17 +01:00
Mathieu Lacage 0a20822e64 rework param-spec-helper code to avoid having to deal with pointers to member functions et al. 2008-02-13 21:00:33 +01:00
Raj Bhattacharjea cdc9002e41 Fix TCP server socket connection notification (part of bug 132) 2008-02-13 09:55:15 -05:00
Gustavo J. A. M. Carneiro f8ae534480 A couple more OLSR bug fixes 2008-02-13 18:23:20 +00:00
Gustavo J. A. M. Carneiro c6f3793178 OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now. 2008-02-13 17:44:05 +00:00
Gustavo J. A. M. Carneiro 96451fdb37 Make the OLSR example a bit more complete, adding a 5th node, to exercise 3-hop routing. 2008-02-13 17:42:08 +00:00
Gustavo J. A. M. Carneiro feb47b3bb1 Fix broadcast packet reception for locally bound sockets (bug #136) 2008-02-13 17:37:43 +00:00
Gustavo J. A. M. Carneiro 4f02439cb1 Add the IPv4 header before deciding whether to drop packets. Closes bug #135. 2008-02-11 14:46:44 +00:00
Mathieu Lacage b0e8f9ff56 add XXX markers. 2008-02-11 05:11:55 +01:00
Mathieu Lacage 74a7f5d065 add big warning 2008-02-11 05:11:45 +01:00
Mathieu Lacage 8cc988f172 add ObjectVector value support. 2008-02-11 04:26:09 +01:00
Gustavo J. A. M. Carneiro a14e1de6cc The message "Unable to determine outbound interface. No default route set"
should not be fatal; just return false instead.
2008-02-10 22:34:04 +00:00
Gustavo J. A. M. Carneiro a30e3a7e94 Upgrade WAF to version 1.3.2 2008-02-10 13:19:07 +00:00
Gustavo J. A. M. Carneiro 450f9db5c6 RandomWalk2dMobilityModel changed name to RandomWalkMobilityModel (typo or intentional?) 2008-02-10 11:51:53 +00:00
Gustavo J. A. M. Carneiro eca7dc5b27 Make sequence-number.h a public header file (because it is included by another public header, tcp-header.h) 2008-02-09 18:37:58 +00:00
Mathieu Lacage e51df22a48 kill non-existant method 2008-02-09 02:35:38 +01:00
Mathieu Lacage fa3b613148 report more get/set errors 2008-02-09 02:28:21 +01:00
Mathieu Lacage d4a6b3ab85 merge with HEAD 2008-02-08 18:24:35 +01:00
Mathieu Lacage c295b15d7e add hierarchical support to MobilityHelper 2008-02-08 17:52:20 +01:00
Mathieu Lacage cf48df0f49 rework slightly ns2 mobility support 2008-02-08 17:27:38 +01:00
Mathieu Lacage 16a94230d2 convert Mobility subsystem to Value framework 2008-02-08 04:11:48 +01:00
Mathieu Lacage d226ebb036 fix typo: non-matching delaration/implementation 2008-02-08 04:11:29 +01:00
Mathieu Lacage 2c658704eb add automatic conversion from string to PValue. 2008-02-08 04:11:08 +01:00
Mathieu Lacage ea1eacc952 implement missing methods 2008-02-08 02:22:36 +01:00
Mathieu Lacage 161ff1c6b0 a pretty simple wrapper around TypeId+Parameters: ObjectFactory 2008-02-08 02:22:04 +01:00
Mathieu Lacage eec4df655d add a default constructor for the TypeId class 2008-02-08 02:21:23 +01:00
Mathieu Lacage bd0ca7917a untested templates rarely work. 2008-02-08 00:53:40 +01:00
Mathieu Lacage 5af34cc0da add missing Make functions 2008-02-08 00:53:16 +01:00
Mathieu Lacage 69f491c008 fix Value support 2008-02-08 00:52:57 +01:00
Mathieu Lacage 1f848288d8 add Value support to Time 2008-02-08 00:52:32 +01:00
Mathieu Lacage 9cd8e34252 make headers public. 2008-02-07 23:57:07 +01:00
Mathieu Lacage 5137b37f86 add Value support to Rectangle 2008-02-07 23:56:03 +01:00
Mathieu Lacage 16086b3349 add Value support to Vector 2008-02-07 23:55:43 +01:00
Mathieu Lacage 153e0f6d48 make param-spec-helper.h public 2008-02-07 23:55:23 +01:00
Mathieu Lacage f44a019aed add back FpValue support 2008-02-07 23:23:33 +01:00
Mathieu Lacage f826fbc2d9 add Value support to RandomVariable. 2008-02-07 22:40:46 +01:00
Mathieu Lacage f03f1c237b bug 133: automate RandomVariable memory management. 2008-02-07 19:57:21 +01:00
Craig Dowell b4c23f8ebf branch merge 2008-02-06 10:03:46 -08:00
Craig Dowell dd8985b92d further ns-3-obj changes 2008-02-06 10:03:09 -08:00
Mathieu Lacage bf9d59fe21 enforce TypeId::PARAM_* flags 2008-02-06 18:31:15 +01:00
Gustavo J. A. M. Carneiro 9fcd20505c Move TcpSocket's m_retxEvent.Cancel() to ~TcpSocket(), so that it is executed by all possible code paths leading up to a TcpSocket deallocation. 2008-02-06 17:11:56 +00:00
Raj Bhattacharjea a142d30a9d Merge 2008-02-05 15:30:16 -05:00
Raj Bhattacharjea c3658bd810 Slight refactor of TCP code so two way connections don't bug out 2008-02-05 15:29:17 -05:00
Raj Bhattacharjea 6e7d9062cb Patch for bug 130 from Gustavo 2008-02-05 09:54:32 -05:00
Tom Henderson a6438d91b4 some more edits to the front part of the tutorial 2008-02-04 23:09:07 -08:00
Craig Dowell d2d16360c1 fix instances of stale names 2008-02-04 19:17:45 -08:00
Craig Dowell 3b277785c0 object model section of tutorial needed to be rewritten due to ns-3-object changes. 2008-02-04 19:04:01 -08:00
Mathieu Lacage c94bc0c5c8 add back EnumValue 2008-02-04 23:13:54 +01:00
Mathieu Lacage b1495e485e split ParamSpec::CreateInitialValue -> ParamSpec::GetInitialValue + ParamSpec::CreateValue 2008-02-04 22:48:26 +01:00
Mathieu Lacage 6d6ba0c668 forgot to add new files 2008-02-04 22:47:26 +01:00
Mathieu Lacage 0bc09d7d86 add back UintValue 2008-02-04 22:32:21 +01:00
Mathieu Lacage 563f2e3594 remove un-needed object.h include. 2008-02-04 22:32:13 +01:00
Mathieu Lacage 6ba83d0891 weird leftover from the ClassId changes. 2008-02-04 22:19:20 +01:00
Mathieu Lacage f21962defc add back IntValue support 2008-02-04 22:18:07 +01:00
Craig Dowell c3719a2eca tutorial now agrees with ns3-object changes 2008-02-04 12:56:08 -08:00
Craig Dowell 3b58cf8c0e half of example describing how to plumb in new model without plumbing 2008-02-04 12:27:18 -08:00
Tom Henderson b390f1ef73 Further alignment of simple-point-to-point.cc with ns-2/simple.tcl (add TCP) 2008-02-03 14:34:10 -08:00
Gustavo J. A. M. Carneiro 02fd903228 OLSR: remove the 'Link tuple has no corresponding neighbor tuple' assertion; it happens now because MID messages may occasionally not arrive in time, but it's normal. 2008-02-03 19:09:35 +00:00
Gustavo J. A. M. Carneiro 52ca0dd3f6 merge 2008-02-03 19:05:37 +00:00
Gustavo J. A. M. Carneiro 6a874b283c OLSR: get main address of the peer from the UDP source address and the 'interface association' table; this way the UDP source address need not be the same as the main address. 2008-02-03 18:50:55 +00:00
Gustavo J. A. M. Carneiro fd238f3e40 Backed out changeset 055ff23aa034 (Tom does not like it turns out OLSR does not need it) 2008-02-03 18:29:25 +00:00
Tom Henderson 438036550f Fix tutorial TOC 2008-02-02 20:46:04 -08:00
Tom Henderson a0e14bd523 formatting cleanup 2008-02-02 15:52:54 -08:00
Tom Henderson c8a76b7dd5 typos and formatting of Introduction section 2008-02-01 21:31:15 -08:00
Gustavo J. A. M. Carneiro c86c3ce16d UDP sockets are fixed, remove the hack and note. 2008-02-01 19:37:27 +00:00
Gustavo J. A. M. Carneiro dd48772c9e Fix UDP source address, make it honor Bind(). 2008-02-01 19:29:56 +00:00
Gustavo J. A. M. Carneiro 53833582b7 Some more udp socket debug messages 2008-02-01 18:40:14 +00:00
Gustavo J. A. M. Carneiro f262b76a41 Put back the simulation time in 30 seconds, else we generate huge trace files. 2008-02-01 18:39:37 +00:00
Gustavo J. A. M. Carneiro 441e17174d Add more debug info to olsr routing table 2008-02-01 18:24:39 +00:00
Gustavo J. A. M. Carneiro defd58bc77 In OLSR agent, work around newly introduced bug in UDP sockets prenting Bind from working as e.g. Linux. Add note explaining what's wrong. 2008-02-01 18:07:45 +00:00
Gustavo J. A. M. Carneiro 38f2897c29 Fix OLSR example: don't add static routes, increase simulation time to 300 seconds. 2008-02-01 17:17:24 +00:00
Gustavo J. A. M. Carneiro d9d019c5d4 Unbreak ParameterLogger 2008-02-01 15:16:44 +00:00
Gustavo J. A. M. Carneiro f23152d7a7 Start the Olsr agent (accidentally removed during last code refactoring) 2008-02-01 14:05:59 +00:00
Mathieu Lacage d625837eb9 merge with HEAD 2008-02-01 08:50:03 +01:00
Mathieu Lacage cecd35e20b AddInterface -> AggregateObject 2008-01-31 22:23:46 +01:00
Mathieu Lacage 5ade799440 QueryInterface -> GetObject 2008-01-31 22:11:03 +01:00
Mathieu Lacage 2786b195ee merge with HEAD again 2008-01-31 21:58:13 +01:00
Mathieu Lacage ad6f51646d make Ptr<T> convertible to a Value. 2008-01-31 15:10:21 +01:00
Mathieu Lacage 328190ca63 get rid of very long constructor 2008-01-30 19:13:21 +01:00
Mathieu Lacage 5b5649de74 attempt to perform correctly automatic conversions. 2008-01-30 19:13:06 +01:00
Mathieu Lacage 78003d863a initial work on Value code 2008-01-30 17:28:18 +01:00
Mathieu Lacage 71c635dedc introduce ObjectBase 2008-01-30 17:25:06 +01:00
Mathieu Lacage 5f5518e05b merge with HEAD 2008-01-30 17:20:55 +01:00
Mathieu Lacage bd33305e5b remove dependency on Callbacks from Ptr test code 2008-01-30 15:33:48 +01:00
Tom Henderson aa8bd8a8ba some more tutorial updates 2008-01-27 10:58:22 -08:00
Tom Henderson 84cdad7f7d fix optimized build 2008-01-26 06:01:45 -08:00
Tom Henderson 3c38ca5a1b Fix uninitialized member 2008-01-25 15:41:47 -08:00
Tom Henderson ffaf3e7d91 Merge TCP implementation (raj/ns-3-tcp) 2008-01-25 15:21:40 -08:00
Tom Henderson a81a6fc0ec Add chapter on callbacks to the tutorial 2008-01-25 11:58:17 -08:00
Raj Bhattacharjea 6c3559792c Added in ns-3-tcp (second try) 2008-01-25 13:57:38 -05:00
Tom Henderson 6292ead1f7 add hyperlinks to wiki, Doxygen 2008-01-19 21:03:18 -08:00
Tom Henderson 9a15ceadf6 Split tutorial.texi into multiple files; some work on the tracing section 2008-01-19 20:58:01 -08:00
Mathieu Lacage f61e9a9941 interface-id -> type-id 2008-01-16 10:27:07 +01:00
Craig Dowell 21a113f38f Added tag release ns-3.0.10 for changeset b5bf2588cde2 2008-01-15 16:01:26 -08:00
Craig Dowell 4f3bd6f9dd bump version and add release notes 2008-01-15 15:43:00 -08:00
Gustavo J. A. M. Carneiro d2c80f4d1a Print the correct type in the callback assign error message (instead of Ptr<const CallbackImplBase>) 2008-01-15 15:14:24 +00:00
Mathieu Lacage 2949d86908 add an extra link to the PHY model paper 2008-01-15 13:29:41 +01:00
Mathieu Lacage 0fcbdbf0fe fix doxygen warnings 2008-01-15 13:27:45 +01:00
Mathieu Lacage 1dc22a9e8f merge with head 2008-01-15 12:58:27 +01:00
Mathieu Lacage 5c769d2d24 iid -> tid 2008-01-15 12:44:09 +01:00
Mathieu Lacage a2e63b7f0b iid (void) -> GetTypeId (void) 2008-01-15 12:43:07 +01:00
Mathieu Lacage 44c33f1618 InterfaceId -> TypeId 2008-01-15 12:36:22 +01:00
Mathieu Lacage 4730d7087f merge with HEAD 2008-01-15 12:07:31 +01:00
Tom Henderson 3b31a0234e Doxygen organization 2008-01-10 07:31:40 -08:00
Tom Henderson cac5b2ca97 Missing subsection text 2008-01-11 08:31:38 -08:00
Tom Henderson 3b08f13bf3 remove executable bit from file mode 2008-01-09 22:17:02 -08:00
Tom Henderson e51bb180d4 Fix bug 125 (make helper function non-virtual) 2008-01-09 22:09:21 -08:00
Gustavo J. A. M. Carneiro 4e97b6b47c Document the iid parameter of OnOffApplication. 2008-01-08 17:45:57 +00:00
Gustavo J. A. M. Carneiro ed6ee71ded Don't print 'Entering directory xxx' when running waf --shell; it is misleading. 2008-01-08 14:06:49 +00:00
Craig Dowell 6c69295696 fix node and up 2008-01-07 16:48:53 -08:00
Craig Dowell fb72939392 figures 2008-01-07 16:29:54 -08:00
Craig Dowell b61692f121 interfaces 2008-01-07 16:03:32 -08:00
Mathieu Lacage 9ff2549315 copy the packet before sending it down or up 2008-01-07 18:20:18 +01:00
Gustavo J. A. M. Carneiro 3a4eb97315 Add a --valgrind WAF option (bug #124) 2008-01-03 14:14:17 +00:00
Mathieu Lacage 4f58be6548 replace ComponentManager::Create and ClassId with InterfaceId::CreateObjest and InterfaceId 2008-01-03 11:39:45 +01:00
Mathieu Lacage 33bd62d32f typo 2008-01-03 11:37:23 +01:00
Mathieu Lacage c547c88e89 use NS_OBJECT_ENSURE_REGISTERED and fix off-by-one in IidManager::GetRegistered 2008-01-03 11:37:09 +01:00
Mathieu Lacage 2a4dcce444 add NS_OBJECT_ENSURE_REGISTERED 2008-01-03 11:30:02 +01:00
Mathieu Lacage b41d008223 go to the next element in search loop 2008-01-03 11:29:35 +01:00
Mathieu Lacage a144ad9a1e work around weird compiler warning/error. 2008-01-03 10:37:50 +01:00
Mathieu Lacage 93be0562cc check constructor with reference arguments 2008-01-03 10:15:41 +01:00
Mathieu Lacage 64bb988613 a replacement for ClassIdDefaultValue 2008-01-03 09:10:40 +01:00
Mathieu Lacage 3fcff1b1b3 add InterfaceId::HasConstructor 2008-01-03 09:10:23 +01:00
Mathieu Lacage 6150ba4860 make the internal InterfaceId constructor explicit 2008-01-03 08:42:04 +01:00
Mathieu Lacage 676307027c add support to browse the list of existing InterfaceId 2008-01-03 08:41:15 +01:00
Mathieu Lacage 976f16c4d9 get rid of MakeInterfaceId 2008-01-03 08:34:31 +01:00
Mathieu Lacage b88e90fec3 add 'factory' support to InterfaceId 2008-01-02 15:54:53 +01:00
Mathieu Lacage 2103459845 merge with callback improvements. 2008-01-02 13:40:37 +01:00
Mathieu Lacage 348eb1e187 Make the CallbackBase class more useful than it was. 2008-01-02 13:39:56 +01:00
Mathieu Lacage 1fb6ad5488 rewrite interface id metadata 2008-01-02 12:24:25 +01:00
Mathieu Lacage 328aa2cc45 remove some remnants from the iid-a-variable era. 2008-01-02 11:08:11 +01:00
Mathieu Lacage 2deb2ea0f0 add some separation markers 2008-01-02 10:57:25 +01:00
Mathieu Lacage bc1ab2d79b replace static const Interface iid; with static InterfaceId iid (void); 2008-01-02 10:33:39 +01:00
Mathieu Lacage f3e77eea3d fix bug 122: get rid of duplicate argument to QueryInterface 2008-01-02 09:25:31 +01:00
Mathieu Lacage 6b0e717a19 add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>. 2008-01-02 09:09:24 +01:00
Tom Henderson 906a9748b5 fix bug in PacketSink 2007-12-30 19:36:44 -08:00
Tom Henderson 414c33ffc9 remove const qualifier from uint16_t 2007-12-28 06:50:47 -08:00
Tom Henderson 77f8c5cbf2 Fix small typo 2007-12-26 20:08:48 -08:00
Tom Henderson 3f5d7030cb update doc/tracing.h to Ptr<Packet> 2007-12-26 13:02:09 -08:00
Tom Henderson c53c3afd46 back out doc/tutorial.h (not yet) 2007-12-26 11:41:47 -08:00
Tom Henderson 33fd7f0c67 Doxygen for internet-node.h 2007-12-26 11:39:52 -08:00
Mathieu Lacage 853f0a13e9 add missing copyright/license header 2007-12-26 15:41:48 +01:00
Mathieu Lacage 9569ad645b fix bug 98 2007-12-25 11:09:15 +01:00
Gustavo J. A. M. Carneiro 3a98117aa5 Remove ghost declaration of function AllocateClassId. 2007-12-22 18:46:43 +00:00
Gustavo J. A. M. Carneiro 42092bc91e Don't include the 'global-route-manager-impl.h' private header from the public header 'candidate-queue.h'. 2007-12-20 15:19:57 +00:00
Mathieu Lacage 2d6f46dfa8 forward only packets for ourselves. 2007-12-19 13:24:52 +01:00
Mathieu Lacage f1f400bcee it is possible to receive packets which are not tagged. ignore them rather than crash. 2007-12-19 13:24:30 +01:00
Mathieu Lacage a6e289c8ef ensure m_listener is initialized properly 2007-12-19 13:22:55 +01:00
Gustavo J. A. M. Carneiro a83ec513a1 const fixes (new GCC 4.2 warning) 2007-12-17 14:53:14 +00:00
Mathieu Lacage f043a8789c doxygen 2007-12-17 13:41:51 +01:00
Mathieu Lacage 30bbef4b14 add a few comments here and there 2007-12-17 13:27:22 +01:00
Mathieu Lacage 26fb62c748 more doxygen 2007-12-17 13:20:02 +01:00
Mathieu Lacage 77c0e85775 add some doxygen 2007-12-17 13:07:41 +01:00
Tom Henderson ac45276835 update release_steps.txt 2007-12-15 15:08:30 -08:00
Tom Henderson cfa242a6a5 Added tag release ns-3.0.9 for changeset 4db981a0d9eb 2007-12-15 14:58:58 -08:00
Tom Henderson 26599981a0 bump VERSION and finish RELEASE_NOTES 2007-12-15 14:01:36 -08:00
Tom Henderson 8fe2191d04 Repair doxygen errors 2007-12-15 13:59:33 -08:00
Tom Henderson 35b4c6c6b8 add internal keyword to udp-impl documentation 2007-12-15 13:52:00 -08:00
Mathieu Lacage e42ccef4a7 fix optimized build 2007-12-15 11:58:14 +01:00
Mathieu Lacage 8449139061 fix optimized build 2007-12-15 11:57:43 +01:00
Craig Dowell 16e7e60cab packet pointer police patrolled product preventing presence of prior pattern proactively 2007-12-14 16:05:37 -08:00
Mathieu Lacage c53988d01e success heuristic was inverted. 2007-12-14 17:42:16 +01:00
Mathieu Lacage 1fea8b38fc fix optimized build 2007-12-14 17:26:18 +01:00
Mathieu Lacage 7d6cd9ae7c some debugging. Max rate test was inverted. 2007-12-14 15:43:52 +01:00
Mathieu Lacage bd70c33606 avoid uninitialized variables. 2007-12-14 15:18:14 +01:00
Craig Dowell f2a0ca2b0e put updated tutorial.texi in doc directory 2007-12-13 23:50:16 -08:00
Raj Bhattacharjea 282543b759 Add uint8_t* based API for sockets 2007-12-13 09:40:21 -05:00
Mathieu Lacage 15748575d8 implement the MRR portion of AMRR 2007-12-13 15:07:08 +01:00
Mathieu Lacage cc9655af45 return the computed rate 2007-12-13 15:04:11 +01:00
Mathieu Lacage 465bf1c10a implement AMRR for true. 2007-12-13 14:43:56 +01:00
Mathieu Lacage eb1200a2cd AMRR rate control algorithm 2007-12-13 13:00:02 +01:00
Mathieu Lacage c1a71e53f9 the meat of the onoe rate control algorithm. 2007-12-13 09:26:20 +01:00
Mathieu Lacage f5fe661c13 Onoe rate control 2007-12-13 08:39:08 +01:00
Mathieu Lacage f42e5c4814 use the new MacStation::Report*Failed methods. 2007-12-12 13:36:16 +01:00
Mathieu Lacage 135a4ab58c add MacStation::ReportFinal* methods for onoe rate control model 2007-12-12 13:17:04 +01:00
Mathieu Lacage b192207132 introduce a low latency parameter for rate control algorithms 2007-12-12 12:03:38 +01:00
Mathieu Lacage 3464e84e90 initial release notes for upcoming release 2007-12-12 11:03:35 +01:00
Mathieu Lacage a0ee98cb4b add legend support to gnuplot output 2007-12-12 09:33:22 +01:00
Mathieu Lacage 01d7a64670 add legend support to gnuplot output 2007-12-12 09:33:22 +01:00
Mathieu Lacage cbafcb5aa6 updated doxygen 2007-12-11 17:53:54 +01:00
Mathieu Lacage b604bf2d7a estimation delay and jitter 2007-12-11 17:48:09 +01:00
Mathieu Lacage 05efca8430 merge with HEAD 2007-12-11 15:54:58 +01:00
Mathieu Lacage 007f125e46 add support for gnuplot error bars 2007-12-11 15:49:23 +01:00
Mathieu Lacage 83dd618e5b add tracing support to PacketSink 2007-12-11 14:03:20 +01:00
Mathieu Lacage ffc992893f fix small typo 2007-12-11 14:03:02 +01:00
Mathieu Lacage b04e3d6cd6 add tx packet trace support 2007-12-11 13:51:18 +01:00
Mathieu Lacage 5e19f9707b add application tracing support 2007-12-11 13:51:03 +01:00
Mathieu Lacage 457d07a50f make Packet::AddTag a const method 2007-12-11 13:42:09 +01:00
Mathieu Lacage 3262a4e103 add application tracing support 2007-12-11 13:51:03 +01:00
Mathieu Lacage df27c80c72 merge with HEAD 2007-12-12 08:15:04 +01:00
Tom Henderson bc54e34375 Doxygen the SocketFactory classes 2007-12-11 23:02:47 -08:00
Mathieu Lacage 49deb08b81 make Packet::AddTag a const method 2007-12-11 13:42:09 +01:00
Mathieu Lacage b8fbe8341f merge with HEAD 2007-12-11 10:25:34 +01:00
Tom Henderson 07e46fb8aa fix bug 113 on m_node parameter for GlobalRouter 2007-12-09 21:39:28 -08:00
Gustavo J. A. M. Carneiro 0ee86b72fb New waf snapshot; move the ns3 library back to the top build dir (the 'lib' was only a workaround for a waf problem); allow --enable-modules on a per build run basis. 2007-12-09 14:39:07 +00:00
Mathieu Lacage b54c43b966 the check was not really inverted after all. Damned. 2007-12-07 10:06:29 +01:00
Mathieu Lacage 1b82e5cba7 make sure we never set a negative duration 2007-12-07 09:51:59 +01:00
Mathieu Lacage 8a825ee775 merge with HEAD 2007-12-07 08:43:55 +01:00
Mathieu Lacage c91b667c13 use contrib gnuplot code 2007-12-07 08:41:52 +01:00
Mathieu Lacage 32611749b2 Gnuplot output class for contrib module 2007-12-06 13:30:26 +01:00
Federico Maguolo dd9e29c425 Avoid integer division 2007-12-06 13:12:27 +01:00
Gustavo J. A. M. Carneiro 8debe6ef1d Create a new contrib module; move event-garbage-collector.{h,cc} to the contrib module. 2007-12-06 11:05:17 +00:00
Gustavo J. A. M. Carneiro bab56b0d88 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it) 2007-12-05 11:51:10 +00:00
Mathieu Lacage 0b43b4fdc2 the bool check was inverted. reported by Federico Maguolo. 2007-11-29 16:28:16 +01:00
Mathieu Lacage 210fb3539c fix typo 2007-11-29 16:03:01 +01:00
Mathieu Lacage 026f3f2aef MaxSeconds -> Simulator::GetMaximumSimulationTime 2007-11-29 15:59:31 +01:00
Mathieu Lacage 9b5d0a50f7 ConnectTo -> Attach 2007-11-29 15:50:15 +01:00
Mathieu Lacage d3df13225d remove references to WifiNetDeviceFactory 2007-11-29 15:45:12 +01:00
Mathieu Lacage fb2ebab793 speed vector -> velocity vector 2007-11-29 01:03:41 +01:00
Mathieu Lacage 2f71efe6a7 merge 2007-11-29 01:01:46 +01:00
Mathieu Lacage 7813d6fdd7 fix typo due to Packet & -> Ptr<Packet> change 2007-11-29 00:59:00 +01:00
Gustavo J. A. M. Carneiro 8ce92e1bc2 Fix bad Message Size value in OLSR headers (which prevented wireshark from decoding most OLSR packets). 2007-11-27 10:36:27 +00:00
Federico Maguolo 9316a5c23f re-use the CaculateTxDuration method where it is needed. 2007-11-23 10:29:27 +01:00
Federico Maguolo 64684b6b71 Improve the accuracy of 802.11a tx duration calculations. 2007-11-23 10:23:55 +01:00
Mathieu Lacage f133bfaf9f avoid memory leak 2007-11-23 11:36:16 +01:00
Mathieu Lacage 3f174e0bd0 avoid confusion between code and uncoded rates. 2007-11-22 16:40:35 +01:00
Mathieu Lacage 39a0e3b29c fix a small style issue 2007-11-22 16:07:45 +01:00
Mathieu Lacage ac8e86643e initialize variable 2007-11-22 16:06:05 +01:00
Mathieu Lacage 6a51ea96c0 make sure that the retry bit is correctly initialized 2007-11-22 15:00:32 +01:00
Mathieu Lacage 94e2d9059a merge obvious fix from mainline 2007-11-22 14:52:57 +01:00
Mathieu Lacage 85c67ca048 the intent was to always send data if maxbytes is zero. 2007-11-22 14:50:59 +01:00
Mathieu Lacage 99a5a8370f port to Ptr<Packet> branch 2007-11-22 14:27:22 +01:00
Mathieu Lacage 284ebcc23f merge with Ptr<Packet> branch 2007-11-22 10:44:48 +01:00
Mathieu Lacage c156f29c86 merge 2007-11-22 10:30:29 +01:00
Mathieu Lacage e075fcd4f3 bug 104: add a method to retrive the maximum simulation time. 2007-11-21 15:54:34 +01:00
Mathieu Lacage 49a8c459a8 simplify the parsing logic and remove buggy comment and code. 2007-11-21 14:14:12 +01:00
Mathieu Lacage 1e45a4c9f5 bug 91: add print-list support to NS_LOG env var. 2007-11-21 14:06:46 +01:00
Mathieu Lacage dd825831c7 bug 109: improve the doxygen documentation for RandomVariable 2007-11-21 13:36:47 +01:00
Mathieu Lacage 1b17161758 code layout fix 2007-11-21 11:12:02 +01:00
Mathieu Lacage 908971e48b improve log output 2007-11-21 11:11:27 +01:00
Mathieu Lacage ca76e83370 add WifiPhy::GetDevice 2007-11-21 11:11:05 +01:00
Mathieu Lacage 4774f44062 fix small typo in debug log output 2007-11-21 10:02:17 +01:00
Mathieu Lacage f198acda79 use packet sockets for AP scenario too. 2007-11-21 09:54:43 +01:00
Mathieu Lacage 86a564094c use packet sockets and generate all graphics 2007-11-21 09:44:17 +01:00
Mathieu Lacage f2c5dd8d71 add constructors to specify the address of a device 2007-11-21 09:43:57 +01:00
Mathieu Lacage ed8ef96a61 add some info logs, improve snr vs ber curve output, linearize the ber calculations. 2007-11-20 16:45:52 +01:00
Mathieu Lacage 87a1ae56d7 plot the goodput for each data rate separately 2007-11-20 13:10:30 +01:00
Mathieu Lacage 63331e705a replace a buggy assert with a check with warning. 2007-11-20 12:48:51 +01:00
Mathieu Lacage 6f447c2b6a merge with HEAD 2007-11-19 16:54:04 +01:00
Mathieu Lacage f415e99a36 replace Dcf with DcfManager 2007-11-19 16:53:05 +01:00
Mathieu Lacage b699ad9ae1 use a simple request/grant scheme for dcf accesses 2007-11-19 16:20:30 +01:00
Mathieu Lacage 632a762654 The AIFSN has been taken into account in GetBackoffStartFor 2007-11-19 14:32:14 +01:00
Mathieu Lacage a4a3bc72fc test a backoff with an AIFSN != 1 2007-11-19 14:31:24 +01:00
Mathieu Lacage b809739d8c avoid decrementing by too many backoff slots 2007-11-19 14:22:45 +01:00
Mathieu Lacage 7ad2a4c3f2 another DCF test 2007-11-19 14:20:19 +01:00
Mathieu Lacage 4c4332c88b debugging output is more verbose. 2007-11-19 12:58:36 +01:00
Mathieu Lacage 6c0ef59a30 add WifiPhy::GetLastRxStart 2007-11-19 09:22:17 +01:00
Mathieu Lacage 83714d4d03 make the GetCw method public to allow DcaTxop to pick a random backoff duration 2007-11-19 08:38:48 +01:00
Mathieu Lacage 7498ef647c merge with HEAD 2007-11-17 18:58:47 +01:00
Mathieu Lacage 321dfcf741 add XXX for two bugs 2007-11-17 18:57:33 +01:00
Mathieu Lacage bdc6fcf5dd another more complex NAV test 2007-11-16 08:58:55 +01:00
Mathieu Lacage 50cd61e7c3 more comment on the test 2007-11-16 08:56:03 +01:00
Mathieu Lacage 125796fec7 simple NAV test 2007-11-16 08:54:16 +01:00
Mathieu Lacage d1d0e1c732 merge with HEAD 2007-11-16 08:48:57 +01:00
Mathieu Lacage 820fd1c13a merge with HEAD 2007-11-16 08:47:17 +01:00
Craig Dowell 577373aed9 Added tag release ns-3.0.8 for changeset 560a5091e0e6 2007-11-15 19:52:53 -08:00
Craig Dowell d1865a2c1e release files 2007-11-15 19:21:06 -08:00
Craig Dowell 60efef0caf branch merge 2007-11-15 18:57:07 -08:00
Craig Dowell 71c53d9f3d move in topo 2007-11-15 18:56:34 -08:00
Gustavo J. A. M. Carneiro 11a58a55c3 Add a few NS_LOG_LOGIC calls in PacketSocket::SendTo () 2007-11-15 16:08:28 +00:00
Gustavo J. A. M. Carneiro fc099a35ab Add DropTailQueue unit tests. 2007-11-15 15:42:07 +00:00
Mathieu Lacage f992fe0b8d test internal collisions. 2007-11-15 16:34:53 +01:00
Mathieu Lacage ac99f9e46c we need to accumulate a record of all changes before applying them in one go. 2007-11-15 16:34:41 +01:00
Mathieu Lacage 225df7593f backoff end time is never in the past. 2007-11-15 16:23:26 +01:00
Mathieu Lacage 5ecad32251 if the backoff end is now, the backoff is expired. 2007-11-15 14:50:27 +01:00
Mathieu Lacage cfd44fc50c even if an access timer is running, we need to start a backoff if needed 2007-11-15 14:42:16 +01:00
Mathieu Lacage 20f47863bf ignore cwmin/cwmax parameters since we set the backoff slots for every collision. 2007-11-15 14:29:06 +01:00
Mathieu Lacage c6cfbd4e8c test interupted eifs 2007-11-15 14:26:40 +01:00
Mathieu Lacage 8422056873 more working tests. 2007-11-15 14:23:01 +01:00
Mathieu Lacage 80ba651375 add a small comment 2007-11-15 14:22:54 +01:00
Mathieu Lacage 18e5bf9c07 keep track of the last time a backoff was updated. 2007-11-15 14:21:48 +01:00
Mathieu Lacage 0394180213 a new test-case with some comments 2007-11-15 13:44:58 +01:00
Mathieu Lacage b52be989ed start a backoff only if no backoff is started 2007-11-15 13:37:51 +01:00
Mathieu Lacage b15597dbe7 forgot sifs + aifsn for test 2007-11-15 13:37:38 +01:00
Mathieu Lacage 6aa4ae880a add a new test-case 2007-11-15 13:24:09 +01:00
Mathieu Lacage 01d2d77a76 backoff is finished when the end of backoff is _equal_ to now. 2007-11-15 13:03:09 +01:00
Gustavo J. A. M. Carneiro 640a49e1ce Bug 105: Queue getter methods should be const 2007-11-15 11:41:42 +00:00
Mathieu Lacage c8cf6df4cd allow OnOffApplication to send more than 0xffffffff bytes 2007-11-21 09:08:32 +01:00
Gustavo J. A. M. Carneiro 7f0a1a1caf WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build. 2007-11-20 18:27:43 +00:00
Mathieu Lacage d9942c0c32 merge with HEAD 2007-11-15 11:22:41 +01:00
Gustavo J. A. M. Carneiro 587d573a04 Add some missing NS_LOG_PARAM* definitions in optimized build 2007-11-15 10:16:26 +00:00
Mathieu Lacage 391adea516 update ignore list 2007-11-15 10:37:38 +01:00
Mathieu Lacage aad088e588 print-trace-sources.cc -> print-introspected-doxygen.cc 2007-11-15 10:35:55 +01:00
Mathieu Lacage ed31e39491 use the \valueref macro 2007-11-15 10:25:35 +01:00
Mathieu Lacage 34345b47d0 print default value list in trace source list doxygen output. 2007-11-15 10:24:51 +01:00
Mathieu Lacage 873a2c8dda add a valueref macro 2007-11-15 10:23:54 +01:00
Mathieu Lacage 838bef63b3 merge with Position -> Vector rename 2007-11-15 10:22:35 +01:00
Mathieu Lacage 6d97118181 merge with HEAD 2007-11-15 10:18:17 +01:00
Mathieu Lacage c1544ba7c4 check for Time bounds 2007-11-15 10:15:16 +01:00
Mathieu Lacage 008e02b03c add a new test 2007-11-15 09:44:23 +01:00
Tom Henderson 2e68155c6d nicer logging of parameters (bug 79 patch from Gustavo) 2007-11-14 21:59:14 -08:00
Tom Henderson a53e880346 Change default scheduler to Map from List (bug 90) 2007-11-14 21:29:27 -08:00
Tom Henderson 79f4bb679e get rid of non-const operators in DataRate 2007-11-14 21:17:43 -08:00
Mathieu Lacage 21baa41ccf timestep is a signed quantity. 2007-11-14 14:16:42 +01:00
Mathieu Lacage d20ccf186e handle NAV correctly 2007-11-14 14:11:11 +01:00
Mathieu Lacage 3128aadfe0 remove buggy test asserts 2007-11-14 14:03:38 +01:00
Mathieu Lacage 03da97b0b8 do not use GetBackoffSlots directly anymore 2007-11-14 14:02:03 +01:00
Mathieu Lacage 2d39b3c2d0 remove buggy assert and comment 2007-11-14 13:53:32 +01:00
Mathieu Lacage dada8dc1db improve debugging output. introduce GetBackoffStartFor and GetBackoffEndFor 2007-11-14 13:50:19 +01:00
Mathieu Lacage 5b47785ae4 add a ns3::MaxSeconds function 2007-11-14 13:45:17 +01:00
Mathieu Lacage c18e92df67 get rid of MacParameters from DcfManager 2007-11-14 12:43:01 +01:00
Mathieu Lacage 8828ac5d30 more debugging. 2007-11-14 12:36:08 +01:00
Mathieu Lacage 83d717bcae add debugging output 2007-11-14 12:23:56 +01:00
Mathieu Lacage 21f9524b3e a few more test asserts 2007-11-13 18:02:46 +01:00
Mathieu Lacage c7078a3e10 simplify memory management 2007-11-13 17:58:34 +01:00
Mathieu Lacage 1bbd9675b6 initialize more state variables 2007-11-13 17:58:22 +01:00
Mathieu Lacage 87db306da0 initialize state variables 2007-11-13 17:44:02 +01:00
Unknown c41da878f9 setup a simple test scenario 2007-11-13 17:40:39 +01:00
Unknown 0a17e5ab7f dcf test framework 2007-11-13 17:26:36 +01:00
Unknown 2f356fd916 add missing method implementations 2007-11-13 17:26:24 +01:00
Unknown 1bf52bda9e a new (wholy untested) Dcf implementation 2007-11-13 16:32:39 +01:00
Mathieu Lacage 89117a326c do nothing on cancel and explain why. 2007-11-09 13:25:01 +01:00
Mathieu Lacage 51bc877b4e update the last sequence control only for non-broadcast frames. 2007-11-09 13:24:38 +01:00
Mathieu Lacage f5772f0423 set the retry bit and use it to filter duplicates 2007-11-09 09:35:13 +01:00
Mathieu Lacage 95596a53b0 handle cancel events 2007-11-09 08:44:03 +01:00
Tom Henderson c114ad9aa7 minor fix for bug95; also const operators for DataRate 2007-11-08 23:08:00 -08:00
Craig Dowell bb9c35ffea baranch merge 2007-11-08 17:05:37 -08:00
Craig Dowell 6b426b5f83 branch merge 2007-11-08 16:58:24 -08:00
Mathieu Lacage 9e215a3493 calculate the delay, not -delay. 2007-11-08 15:25:57 +01:00
Mathieu Lacage 3321873fc6 implement AP beaconing 2007-11-08 15:23:06 +01:00
Mathieu Lacage fc57cac746 make sure that m_listener is not reset to zero _after_ calling a user-provided callback. This allows the user-provided callback to set the m_listener member to a new value if it wants to start a new transmission 2007-11-08 15:22:22 +01:00
Mathieu Lacage dbdd00fef8 zeroify the members after deleting them to improve debugging. 2007-11-08 13:58:26 +01:00
Mathieu Lacage 0986cb46d9 make debug build work 2007-11-08 13:57:50 +01:00
Mathieu Lacage e55384067b add WifiMacHeader::SetBeacon 2007-11-08 13:57:30 +01:00
Mathieu Lacage c905f0658d dox typo 2007-11-08 12:39:21 +01:00
Mathieu Lacage 99fca41f02 GetSpeed -> GetVelocity 2007-11-08 12:36:15 +01:00
Mathieu Lacage eb666a62ac replace Position and Speed by Vector 2007-11-08 12:33:30 +01:00
Mathieu Lacage 6e660e4c27 rename MobilityModel::Get/Set to GetPosition/SetPosition 2007-11-08 11:24:41 +01:00
Mathieu Lacage 00bf89e1d2 a vector class 2007-11-08 10:24:33 +01:00
Tom Henderson 48a98d8b1f update bench-packets.cc program 2007-11-06 15:45:05 -08:00
Mathieu Lacage 1a8421bbfe use the holland set of modes. 2007-11-06 16:16:18 +01:00
Mathieu Lacage ecc4bab8f2 add the holland 802.11a set of modes. 2007-11-06 16:16:06 +01:00
Mathieu Lacage b5a64f2fae a real test 2007-11-06 15:11:22 +01:00
Mathieu Lacage 7e11cfb891 use the new style support 2007-11-06 15:05:56 +01:00
Mathieu Lacage cdcfbd8ab2 add style support 2007-11-06 15:05:47 +01:00
Mathieu Lacage 9964005525 use the gnuplot machinery to output a set of plots 2007-11-06 14:50:20 +01:00
Mathieu Lacage 3dd8898aaf generate correct output. avoid infinite loop. 2007-11-06 14:48:49 +01:00
Mathieu Lacage d3acfdfa07 fix optimized builds 2007-11-06 14:48:31 +01:00
Mathieu Lacage cb0eeaeb32 generate gnuplot-compatible data script files 2007-11-06 13:30:40 +01:00
Mathieu Lacage b114ba4ec6 print the throughput vs distance curve 2007-11-06 12:32:58 +01:00
Mathieu Lacage 688683fdaf change the default tx and gain to be 1db again. 2007-11-06 12:32:42 +01:00
Mathieu Lacage f0740d8235 simplify the code a bit. Make sure we handle correctly the calculation of the reference rx power 2007-11-06 10:37:12 +01:00
Mathieu Lacage bf33ac89eb remove dead method 2007-11-06 10:36:07 +01:00
Tom Henderson baeee68d27 move ipv4 static to member functions 2007-11-05 21:08:02 -08:00
Tom Henderson 25d1f542d7 implement StringDefaultValue; bug93 patch from Mathieu 2007-11-14 21:05:31 -08:00
Tom Henderson 1b919575f2 fix bug 100 DefaultValue::Bind for floats 2007-11-08 22:31:54 -08:00
Tom Henderson f7e49cfb04 GetNetDevice method in PointToPointTopology class 2007-11-14 20:50:53 -08:00
Tom Henderson c3cbbcacd7 Add src/common/error-model implementation and example script, and add to NetDevices 2007-11-14 20:40:05 -08:00
Mathieu Lacage d030b978ab use dB instead of dbm where appropriate 2007-11-05 18:55:49 +01:00
Mathieu Lacage 1acb811437 clarify the formulas 2007-11-05 18:55:14 +01:00
Mathieu Lacage 1bf7be4d2a make the default match yans for debugging purposes 2007-11-05 17:41:58 +01:00
Mathieu Lacage 44096d2f95 add throughput printer 2007-11-05 16:45:22 +01:00
Mathieu Lacage 136cb036b4 test the friis model 2007-11-05 16:33:54 +01:00
Mathieu Lacage a1bfcd1216 test propagation losses 2007-11-05 16:31:52 +01:00
Mathieu Lacage 277173ae0f calculate correctly rx power 2007-11-05 16:31:16 +01:00
Mathieu Lacage 28e6e63c5d handle min distance for friis model in a saner way 2007-11-05 15:53:24 +01:00
Mathieu Lacage a49623136a document log distance propagation loss model. 2007-11-05 15:41:02 +01:00
Mathieu Lacage 9041f3ed1f Document the friis propagation model. 2007-11-05 14:54:40 +01:00
Tom Henderson bc759b5bb3 Minor change to doxygen due to debug-to-log cutover 2007-11-02 08:41:50 -07:00
Tom Henderson 0d70b12c75 update doxygen.conf to 1.5.4 2007-11-02 08:28:45 -07:00
Raj Bhattacharjea b471e74ef8 Fixed randomvariable memory bug that caused a segfault 2007-11-01 14:59:00 -04:00
Mathieu Lacage 745412ffb8 define a new dox module 2007-10-31 16:39:16 +01:00
Mathieu Lacage 680c125dde fix dox warnings 2007-10-31 16:27:37 +01:00
Mathieu Lacage d072cdd527 doxygen 2007-10-31 16:26:31 +01:00
Mathieu Lacage 570126f8ff use Time for the beacon interval. 2007-10-31 16:26:18 +01:00
Mathieu Lacage 5de828fa15 dox for WifiPhy 2007-10-31 13:17:45 +01:00
Mathieu Lacage 32f3411eca remove unused loggers 2007-10-31 12:29:28 +01:00
Mathieu Lacage 7509e66617 phy state logger 2007-10-31 12:27:20 +01:00
Mathieu Lacage 92d65a529f derive WifiPhy from Object and manage it with a Ptr<> 2007-10-31 12:05:25 +01:00
Mathieu Lacage 51590ad30f basic tracing support 2007-10-31 11:45:04 +01:00
Mathieu Lacage 7af70745f3 add missing default constructor 2007-10-31 11:39:26 +01:00
Mathieu Lacage 936c25c98b add missing type specifier in sample code 2007-10-31 11:35:06 +01:00
Mathieu Lacage fcbfa307ef merge with tip 2007-10-31 11:30:51 +01:00
Mathieu Lacage 534b655291 fix typo 2007-10-31 11:28:40 +01:00
Raj Bhattacharjea 5a0fa236cb Fixed randomvariable bugs and modified unit tests so that there is no non-deterministic failure on the tests 2007-10-30 13:27:33 -04:00
Gustavo J. A. M. Carneiro d17845d767 Remove empty OlsrTest unit test class. 2007-10-30 15:55:50 +00:00
Mathieu Lacage ecd20983e8 merge with tip 2007-10-30 10:31:20 +01:00
Mathieu Lacage 66b200178f bug 96: debug.h duplicates functionality from log.h 2007-10-30 10:09:39 +01:00
Craig Dowell 7dca6e0b04 olsr gets new packet 2007-10-29 13:40:25 -07:00
Craig Dowell 60b6fb3d39 merge in packet.bundle 2007-10-29 12:48:01 -07:00
Mathieu Lacage 9d1a3eff16 port to new Channel API. 2007-10-29 16:34:26 +01:00
Gustavo J. A. M. Carneiro e560f2329d Add OLSR message tracing, as discussed on ns-developers list. 2007-10-29 14:11:20 +00:00
Mathieu Lacage d58602289d merge with tip again 2007-10-29 15:04:47 +01:00
Mathieu Lacage 8845f347d3 merge with tip 2007-10-29 15:04:23 +01:00
Mathieu Lacage d6611f02ba rename print-trace-sources to print-introspected-doxygen 2007-10-29 15:01:36 +01:00
Mathieu Lacage 3ed9dc6a94 fix a few missing \valueref 2007-10-29 15:01:14 +01:00
Mathieu Lacage dbfc58c5ed move default value output to print-trace-sources utility 2007-10-29 14:55:16 +01:00
Mathieu Lacage aedad2ccb0 use valueref where needed. 2007-10-29 14:45:43 +01:00
Mathieu Lacage 1aa79965c7 make the default value names more coherent. 2007-10-29 14:40:25 +01:00
Gustavo J. A. M. Carneiro a7ec5d9b71 Make olsr-header.h a public header. 2007-10-29 12:45:02 +00:00
Gustavo J. A. M. Carneiro 4afb2919fa Put everything OLSR into the 'olsr' C++ namespace, for consistency. 2007-10-29 12:39:34 +00:00
Gustavo J. A. M. Carneiro 52d6092ffd merge 2007-10-29 11:01:46 +00:00
Mathieu Lacage 4bef99703a define valueref alias 2007-10-29 10:44:56 +01:00
Mathieu Lacage 1afa21922f update config file to latest doxygen 2007-10-29 10:44:46 +01:00
Tom Henderson d3cb3eccff Add Doxygen cleanup as a release step 2007-10-27 16:19:06 -07:00
Mathieu Lacage 937d727011 merge 2007-10-27 13:17:55 +02:00
Mathieu Lacage ca7f175fb7 add missing copyright header 2007-10-26 22:11:48 +02:00
Mathieu Lacage 81f5e4c039 remove extraneous empty line 2007-10-26 22:10:52 +02:00
Mathieu Lacage 2f4ed00c93 get rid of doxygen warnings 2007-10-26 22:06:46 +02:00
Mathieu Lacage cb1b1daacd change <table> to <ul> 2007-10-26 17:11:02 +02:00
Mathieu Lacage 6862cc0ce9 output a default value list 2007-10-26 17:05:39 +02:00
Mathieu Lacage 6ff8bda568 utility program to print the list of default values 2007-10-26 14:16:40 +02:00
Mathieu Lacage 8e78937160 add missing copyright headers 2007-10-26 14:14:20 +02:00
Mathieu Lacage d7bfb88be9 add missing headers 2007-10-26 14:03:22 +02:00
Mathieu Lacage 46654ba28a add missing headers 2007-10-26 14:02:19 +02:00
Mathieu Lacage 34889dfb6a doxygen PropagationDelayModel 2007-10-26 14:00:13 +02:00
Mathieu Lacage e2a3b89175 doxygen PropagationLossModel 2007-10-26 13:49:33 +02:00
Mathieu Lacage 6a51a05171 replace distance by a pair of mobility models 2007-10-26 13:31:17 +02:00
Mathieu Lacage 09bfa883ac start of work towards a wifi documentation 2007-10-26 13:14:29 +02:00
Mathieu Lacage 6f0268171d basic doxygen documentation for users 2007-10-26 13:14:14 +02:00
Tom Henderson e0da616e37 miscellaneous point-to-point-channel.h cleanups 2007-10-24 17:19:17 -07:00
Tom Henderson 224f0a0684 some cleanup of point-to-point-net-device.h 2007-10-24 17:11:59 -07:00
Tom Henderson f928f6c161 Make GetDevice return pointer to appropriately subclassed NetDevice 2007-10-24 16:17:19 -07:00
Mathieu Lacage 4e5203a3dd set the supported rates in assoc resp frames 2007-10-24 20:43:22 +02:00
Mathieu Lacage 58363c9dab do not add a basic mode more than once. 2007-10-24 20:42:11 +02:00
Mathieu Lacage 0e7024488d handle basic rate support 2007-10-24 20:41:49 +02:00
Mathieu Lacage 6310a6040b fix coding style 2007-10-24 20:00:30 +02:00
Mathieu Lacage ec31e714d6 add size to logging output 2007-10-24 16:43:09 +02:00
Mathieu Lacage a80d3bcf38 simplify logging output 2007-10-24 16:28:28 +02:00
Mathieu Lacage ad9b41e45e try to simplify duration calculations 2007-10-24 16:02:10 +02:00
Mathieu Lacage 9d643387fb initialize the m_length field. 2007-10-24 15:05:17 +02:00
Mathieu Lacage c570beefbd check the ssid length 2007-10-23 14:00:53 +02:00
Mathieu Lacage 6f97972582 enable packet metadata for debugging 2007-10-23 13:40:08 +02:00
Mathieu Lacage 736368f441 improve slightly the SupportedRates print output 2007-10-23 13:39:49 +02:00
Mathieu Lacage 8975be38ae add missing space separator 2007-10-23 13:38:03 +02:00
Mathieu Lacage 7aede726ca add missing space separator 2007-10-23 13:38:03 +02:00
Mathieu Lacage 228150cd72 add printing support 2007-10-23 13:12:04 +02:00
Mathieu Lacage 9f4f9e7b2f add printing support 2007-10-23 13:11:41 +02:00
Mathieu Lacage 629de5c931 add logging support 2007-10-23 13:11:23 +02:00
Mathieu Lacage 30af256bb6 add printing support 2007-10-23 13:11:10 +02:00
Mathieu Lacage 7340c86c61 enable logging 2007-10-23 12:49:09 +02:00
Mathieu Lacage 187c6692d8 avoid off by one effect when laying out objects in a grid. (reported by Joseph Kopena) 2007-10-21 12:54:18 +02:00
Mathieu Lacage 0c5de08870 ap/sta sample 2007-10-19 12:10:01 +02:00
Mathieu Lacage 36a6d0c93c handle the BasicRateSet in the AP 2007-10-18 17:19:53 +02:00
Mathieu Lacage 2d66b73e34 dynamically update the list of supported rates based on the ap supported rates 2007-10-18 15:59:33 +02:00
Mathieu Lacage 18517c1fe5 implement Reset and AddBasicMode 2007-10-18 15:58:19 +02:00
Mathieu Lacage 69dfc4fe32 add support for set/get supported rates in assoc resp packets 2007-10-18 15:12:39 +02:00
Mathieu Lacage d7fe272673 make sure we record all needed supported modes 2007-10-18 14:38:09 +02:00
Mathieu Lacage 40add040f9 convert int to uint32_t 2007-10-18 14:32:42 +02:00
Mathieu Lacage 766d7138ac control the rate control algorithms with default values. 2007-10-18 14:27:43 +02:00
Mathieu Lacage dc3fb38cbb support BRAND_NEW station in adhoc code. initialize the supported rates. 2007-10-18 13:37:22 +02:00
Mathieu Lacage eb1e734628 add dispose methods in subclasses of WifiNetDevice 2007-10-18 12:20:41 +02:00
Mathieu Lacage ba95d49a67 get rid of the dcf 2007-10-18 12:20:24 +02:00
Mathieu Lacage a90aee32a0 clear the list of NetDevice 2007-10-18 12:20:17 +02:00
Mathieu Lacage 8a9502ce01 dispose everything from WifiNetDevice::DoDispose 2007-10-18 11:53:35 +02:00
Mathieu Lacage 8d46c4debc dispose the channel from WifiNetDevice 2007-10-18 11:50:35 +02:00
Mathieu Lacage fe2ab99c52 remove buggy asserts 2007-10-18 11:25:33 +02:00
Mathieu Lacage a5467f201c cts, rts, and ack sizes must take into account fcs padding 2007-10-18 11:22:19 +02:00
Mathieu Lacage 976c3bbe98 eifs calculation is wrong: match the spec. 2007-10-18 11:21:40 +02:00
Mathieu Lacage 551de62f42 make sure that ack and cts delay take into account the fcs padding. 2007-10-18 11:21:14 +02:00
Gustavo J. A. M. Carneiro 860df74295 more const optimisations 2007-10-17 18:16:09 +01:00
Gustavo J. A. M. Carneiro eca4117497 Make OlsrAgentImpl::GetMainAddress const 2007-10-17 17:25:19 +01:00
Mathieu Lacage 434226dd01 add time to debug output 2007-10-17 17:49:56 +02:00
Mathieu Lacage e770997d09 do not call Unref directly anymore. 2007-10-17 17:01:51 +02:00
Mathieu Lacage 52d42bca30 fix valgrind warning: initialize RngStream correctly 2007-10-17 16:26:42 +02:00
Mathieu Lacage 3b5eba1c85 make sure we pass the Rts duration to the SendCtsAfterRts method. fix debugging output. 2007-10-17 16:20:30 +02:00
Mathieu Lacage 76af0aa6ed make sure that each new MacStation is correctly initialized 2007-10-17 16:19:51 +02:00
Mathieu Lacage 4a6e000a07 convert to and from dbms when needed 2007-10-17 15:52:11 +02:00
Mathieu Lacage cf2fbcb6e3 log channel behavior 2007-10-17 15:51:37 +02:00
Mathieu Lacage 11c2f8c991 tx and rx gain should have no impact by default 2007-10-17 15:51:20 +02:00
Mathieu Lacage 0d3182c278 use dbms consistently in the propagation loss models 2007-10-17 15:50:38 +02:00
Mathieu Lacage 1d2a21fa1f initialize uniqueUid field 2007-10-17 13:39:05 +02:00
Mathieu Lacage c6763e76ee index starts at zero 2007-10-17 13:38:44 +02:00
Mathieu Lacage 818c1ea9e9 specify real type 2007-10-17 13:38:33 +02:00
Mathieu Lacage 0b4d0fcf67 implement operator << and an assert 2007-10-17 12:01:08 +02:00
Mathieu Lacage 384c4b998e add asserts and some debug log 2007-10-17 12:00:43 +02:00
Mathieu Lacage 449bd78db7 convert TRACE to NS_LOG 2007-10-16 18:09:49 +02:00
Mathieu Lacage 5d2227d3a6 remove 'all rights reserved' 2007-10-16 17:22:13 +02:00
Mathieu Lacage 0058449576 remove uneeded trailing ';' 2007-10-16 17:20:09 +02:00
Mathieu Lacage 2059a57d96 goto the right location before serializing the wifi trailer 2007-10-16 17:18:29 +02:00
Mathieu Lacage 8bb9ab629f remove bogus assert 2007-10-16 17:15:30 +02:00
Mathieu Lacage 73c536fa04 replace cassert by ns3/assert.h 2007-10-16 15:57:45 +02:00
Mathieu Lacage 2d07bbdf2c configure correctly the ipv4 layer 2007-10-16 15:43:26 +02:00
Mathieu Lacage 83e7cf54f4 merge with HEAD 2007-10-16 14:44:36 +02:00
Mathieu Lacage 54725d30b1 fix position printing code 2007-10-16 14:43:40 +02:00
Mathieu Lacage e688cc520b convert tracing to log system 2007-10-16 14:43:08 +02:00
Mathieu Lacage ec5e79f86b fix valgrind warning 2007-10-16 14:29:23 +02:00
Mathieu Lacage 87d56eb866 use the new RandomStream class and fix a small bug in the testsuite 2007-10-16 13:32:48 +02:00
Mathieu Lacage 2922488eb9 add wrapper class around RngStream for testing. 2007-10-16 13:32:19 +02:00
Mathieu Lacage b8230bf5e6 fix bogus assert 2007-10-16 13:31:51 +02:00
Mathieu Lacage e66a3625b4 make sure to terminate vararg list correctly 2007-10-16 10:54:50 +02:00
Tom Henderson 61ed256846 more detail in release_steps.txt 2007-10-15 21:59:41 -07:00
Tom Henderson 31bafccb6c updates for 3.0.7 2007-10-15 21:13:21 -07:00
Tom Henderson db709dc4dc bump version number 2007-10-15 21:12:55 -07:00
Tom Henderson 9461d8ec13 updates for 3.0.7 2007-10-15 21:12:48 -07:00
Tom Henderson 834eb4c1b6 Release notes for 3.0.7 2007-10-15 21:10:46 -07:00
Craig Dowell 21ab738c72 Added tag release ns-3.0.7 for changeset 36472385a1cc 2007-10-15 15:09:56 -07:00
Craig Dowell 620a465f84 NS_LOG parsing changes to address bug 91 2007-10-15 14:54:32 -07:00
Mathieu Lacage 0c760dc107 build and link 2007-10-15 16:47:53 +02:00
Mathieu Lacage ad7ea01ee8 add some tests 2007-10-15 16:17:15 +02:00
Mathieu Lacage 1026821e33 add StringDefaultValue 2007-10-15 12:58:53 +02:00
Tom Henderson 302bdd366c Clarify pkt-uid field in doxygen 2007-10-13 15:14:00 -07:00
Tom Henderson e5241d93e5 back out unrelated changes 2007-10-13 15:10:23 -07:00
Tom Henderson 6804f40bc4 Clarify pkt-uid field in doxygen 2007-10-13 15:06:35 -07:00
Gustavo J. A. M. Carneiro a18fc4fd93 Fix OLSR agent finalization issues. 2007-10-13 14:21:27 +01:00
Gustavo J. A. M. Carneiro 315dfd2041 Remove 'All rights reserved.' GPL-incompatible phrase from OLSR sources. 2007-10-13 13:09:55 +01:00
Tom Henderson f5513abfc8 Reverting a few OLSR changes that leaked into simple-point-to-point.cc 2007-10-12 21:28:02 -07:00
Mathieu Lacage 0296999ec8 remove dead code 2007-10-11 16:53:42 +02:00
Mathieu Lacage b2a44942a8 use the default propagation models 2007-10-11 16:51:59 +02:00
Mathieu Lacage 268e4d5ec9 support DefaultValue 2007-10-11 16:16:31 +02:00
Mathieu Lacage 4f562dbbfb add missing trailing 0/(void *)0 2007-10-11 16:16:14 +02:00
Mathieu Lacage e9127c0427 add default value support 2007-10-11 15:43:47 +02:00
Mathieu Lacage b2545f4d89 missing file 2007-10-11 13:27:39 +02:00
Mathieu Lacage 9c922e0c73 use new WifiNetDevice naming 2007-10-11 13:23:33 +02:00
Mathieu Lacage d6721ea8ef add WifiNetDevice to build 2007-10-11 13:20:55 +02:00
Mathieu Lacage c8503d149e merge with HEAD 2007-10-11 13:15:21 +02:00
Mathieu Lacage cd045df1c3 bug 86: add missing functions to manipulate Mac48Address 2007-10-11 13:11:45 +02:00
Mathieu Lacage 20b226769f constify more conversion operators 2007-10-11 13:02:47 +02:00
Mathieu Lacage 8460428f2e constify conversion operator 2007-10-11 13:00:12 +02:00
Mathieu Lacage d7f63afae7 do not use the Watchdog class 2007-10-11 10:47:01 +02:00
Craig Dowell 6ad1a5b57f don't use any for starting address 2007-10-10 12:25:52 -07:00
Craig Dowell a2388cc4b4 improve obj design example 2007-10-10 11:55:07 -07:00
Mathieu Lacage f79ee4b582 fix build 2007-10-10 16:04:25 +02:00
Mathieu Lacage 03fd848f18 merge watchdog fix 2007-10-10 16:03:45 +02:00
Mathieu Lacage 258a44de1a build STA code 2007-10-10 16:03:26 +02:00
Mathieu Lacage 20a04408a6 install watchdog.h 2007-10-10 15:59:34 +02:00
Mathieu Lacage 662356311a merge with head 2007-10-10 15:49:59 +02:00
Mathieu Lacage 806cba6352 test the watchdog 2007-10-10 15:32:17 +02:00
Mathieu Lacage b42e00961b add missing call to Simulator::Destroy to cleanup after test 2007-10-10 15:32:04 +02:00
Mathieu Lacage fc0089c0f4 add missing call to Simulator::Destroy to cleanup after test 2007-10-10 15:32:04 +02:00
Mathieu Lacage 2c9b70a674 a Watchdog class 2007-10-10 15:04:46 +02:00
Mathieu Lacage 0bb0cb7b93 implement TimerImpl::Invoke 2007-10-10 14:28:37 +02:00
Mathieu Lacage 0e9a8e6c3d move traits definition down 2007-10-10 13:30:35 +02:00
Mathieu Lacage c7d39c7975 split timer implementation outside of Timer class 2007-10-10 13:18:15 +02:00
Gustavo J. A. M. Carneiro 86abaf4009 Fix CommandLine::AddArgCommand memory leak. 2007-10-10 11:14:16 +01:00
Mathieu Lacage 382c3d1787 add NQap to build 2007-10-10 11:23:28 +02:00
Mathieu Lacage 2ac8e7e496 add management frame implementations 2007-10-10 11:18:19 +02:00
Craig Dowell 2425ad39ef bus network 2007-10-09 21:54:03 -07:00
Craig Dowell 6b5b86f343 tutorial topologies 2007-10-09 18:02:32 -07:00
Mathieu Lacage 230645ffa5 add serialization/deserialization support to Ssid/SupportedRates 2007-10-09 17:19:13 +02:00
Mathieu Lacage 3861eada88 add new code to build 2007-10-09 16:47:34 +02:00
Mathieu Lacage a1691fda9b add SupportedRates to build 2007-10-09 16:40:24 +02:00
Mathieu Lacage ec7d64d30d avoid calling un-implemented method 2007-10-09 16:15:38 +02:00
Mathieu Lacage 8cda08d41c fix coding style 2007-10-09 16:11:37 +02:00
Mathieu Lacage 05fe040f88 add MacHighAdhoc to build 2007-10-09 16:11:08 +02:00
Mathieu Lacage 756cc86a23 add Mac48Address::GetBroadcast 2007-10-09 16:09:37 +02:00
Mathieu Lacage 9e470dffc3 remove all rights reserved mention 2007-10-09 16:03:09 +02:00
Mathieu Lacage 6e2080f092 rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build 2007-10-09 16:02:21 +02:00
Mathieu Lacage 24a0b73ce3 add DcaTxop to build 2007-10-09 12:42:45 +02:00
Mathieu Lacage 473c0eecb1 add missing class prefix 2007-10-09 12:42:20 +02:00
Gustavo J. A. M. Carneiro 10baa77dbc Bug 81 (CommandLine::AddArgValue not working correctly) 2007-10-09 11:38:01 +01:00
Mathieu Lacage dec333d063 add MacRxMiddle to build 2007-10-09 12:30:51 +02:00
Mathieu Lacage 61d85c75d3 add operator < 2007-10-09 12:30:37 +02:00
Mathieu Lacage 8dab22328c add MacTxMiddle to build 2007-10-09 12:23:14 +02:00
Mathieu Lacage ac0991a7cc add WifiMacQueue to build 2007-10-09 12:20:43 +02:00
Mathieu Lacage bc276b2bc1 add Dcf to build 2007-10-09 12:17:02 +02:00
Mathieu Lacage 1e6415ce45 add MacLow to build 2007-10-09 11:36:13 +02:00
Mathieu Lacage e4f6408939 do not include dead header 2007-10-09 11:07:18 +02:00
Mathieu Lacage 497bb74d5a replace header mode with preamble mode 2007-10-09 11:07:05 +02:00
Mathieu Lacage dee939e78c remove extra WifiPhy::SendPacket argument. Add header mode support 2007-10-09 10:21:46 +02:00
Craig Dowell 79aa1535f3 topologies 2007-10-08 22:00:04 -07:00
Craig Dowell 9f2902e9d2 support for star network, example in tutorial 2007-10-08 20:51:21 -07:00
Craig Dowell ace6574179 branch merge 2007-10-08 18:52:08 -07:00
Craig Dowell 8ac82843af tutorial file names 2007-10-08 18:51:48 -07:00
Craig Dowell 3e4acb6921 more descriptive name 2007-10-08 14:50:00 -07:00
Gustavo J. A. M. Carneiro 3a41b51160 Bug 82 (Add convenience API to retrieve default values) 2007-10-08 17:49:18 +01:00
Gustavo J. A. M. Carneiro c0ed9be287 Fix bug 80 (valgrind error when finalizing PacketMetadata). 2007-10-08 17:44:17 +01:00
Mathieu Lacage bb9a9fb06d port to new MacStation API 2007-10-08 17:04:34 +02:00
Mathieu Lacage 1a0edab86e port ArfMacStations to new MacStation API 2007-10-08 17:02:20 +02:00
Mathieu Lacage 673ac3faa9 remove 'All rights reserved' 2007-10-08 16:04:59 +02:00
Mathieu Lacage 3833b9b585 remove 'All rights reserved' 2007-10-08 16:04:57 +02:00
Mathieu Lacage 6ba9224f32 port to new MacStation API 2007-10-08 16:04:12 +02:00
Mathieu Lacage d138a49895 implement broadcast/multicast MacStation 2007-10-08 15:58:07 +02:00
Mathieu Lacage 0e434f0212 fix copyright statement 2007-10-08 15:44:08 +02:00
Mathieu Lacage f807067337 use WifiMode rather than mode indexes in MacStations API. 2007-10-08 15:43:19 +02:00
Mathieu Lacage 5e5800363e add operator == for WifiMode 2007-10-08 15:42:07 +02:00
Mathieu Lacage d643cf8c1d add WifiMode mandatory flag 2007-10-08 15:36:37 +02:00
Gustavo J. A. M. Carneiro 7a37ee7c30 merge 2007-10-08 14:14:24 +01:00
Mathieu Lacage d42e7a6d0a remove 'All rights reserved' mention 2007-10-08 15:54:36 +02:00
Mathieu Lacage 115506476b add missing copyright 2007-10-08 15:50:25 +02:00
Gustavo J. A. M. Carneiro fab9df7825 Use 'const Ptr<T>' rather than 'Ptr<T> const' 2007-10-08 14:13:58 +01:00
Mathieu Lacage 0873562023 add MacStations::LookupNonUnicast 2007-10-08 14:43:53 +02:00
Mathieu Lacage ca890b509a add Mac48Address::IsBroadcast/IsMulticast 2007-10-08 14:43:29 +02:00
Mathieu Lacage 59fc14c57c move mac-station code in mac-stations 2007-10-08 14:33:29 +02:00
Mathieu Lacage 907ad64f96 merge with HEAD 2007-10-08 10:28:52 +02:00
Tom Henderson c96ad24a35 Add support for non-unit-cost metrics for Ipv4Interfaces (for use in routing); add example script simple-alternate-routing.cc 2007-10-06 21:21:07 -07:00
Craig Dowell 9a7694f32a deal with static constructor problem 2007-10-12 13:41:24 -07:00
Craig Dowell 73e9110b64 branch merge 2007-10-12 12:31:29 -07:00
Craig Dowell 90439fc8c4 env var changes 2007-10-12 12:30:19 -07:00
Mathieu Lacage 1a480445c9 make sure we cleanup after ourselves in DefaultValueTests 2007-10-12 15:49:04 +02:00
Gustavo J. A. M. Carneiro adf066acdd Add a missing const. 2007-10-11 18:34:15 +01:00
Gustavo J. A. M. Carneiro a2d11d8100 Optimize EventGarbageCollector by using std::multiset with EventIds sorted by expiration time. 2007-10-11 17:26:32 +01:00
Gustavo J. A. M. Carneiro f77b8a9137 Make EventGarbageCollector private to the olsr module; adapt olsr to Timer API changes. 2007-10-11 16:17:27 +01:00
Gustavo J. A. M. Carneiro ad0241047d merge 2007-10-11 15:51:36 +01:00
Gustavo J. A. M. Carneiro 6218b00486 Bug #88 (Ipv4Address operator ==, !=, < should be inline for performance reasons) 2007-10-11 15:39:39 +01:00
Mathieu Lacage 4585f14b5f bug 87: do not export the garbage collection facility from the Timer class. 2007-10-11 17:59:59 +02:00
Gustavo J. A. M. Carneiro c0af9c2bf1 merge 2007-10-09 13:25:30 +01:00
Craig Dowell bf2adc6861 log verbosity changes 2007-10-08 18:13:26 -07:00
Gustavo J. A. M. Carneiro 743a4eaf02 Adapt the OLSR agent code to use the new Timer class. 2007-10-08 11:37:03 +01:00
Gustavo J. A. M. Carneiro 4df07ae61f merge 2007-10-08 11:24:16 +01:00
Gustavo J. A. M. Carneiro 6c1d1db4b4 Fix typo 2007-10-08 11:23:53 +01:00
Craig Dowell 11ac94d449 exercise 2007-10-05 18:52:22 -07:00
Craig Dowell a84a41bc75 add seed calls 2007-10-05 18:17:18 -07:00
Craig Dowell 5f61c348c2 prototype address and network allocation 2007-10-05 16:00:04 -07:00
Gustavo J. A. M. Carneiro ffdc440926 Add operator < to Ptr smart pointers, to make them behave well with STL containers. 2007-10-05 19:13:36 +01:00
Gustavo J. A. M. Carneiro 3457fcb48b Fix race condition in mobility-visualizer-view; reduce refresh rate to 30fps. 2007-10-04 11:24:05 +01:00
Mathieu Lacage f70700c330 add Timer::GetDelayLeft 2007-10-04 09:22:05 +02:00
Mathieu Lacage b28727ef8c make the timer a tristate object 2007-10-04 09:14:16 +02:00
Craig Dowell 3af33c8b75 enable log prefix 2007-10-03 13:34:06 -07:00
Craig Dowell 9059dd7e3e log changes 2007-10-03 12:41:17 -07:00
Gustavo J. A. M. Carneiro 2d0f686964 Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221 2007-10-03 19:38:03 +01:00
Gustavo J. A. M. Carneiro cf896e8064 Use GStaticMutex instead of G_DEFINE_LOCK 2007-10-03 19:36:56 +01:00
Gustavo J. A. M. Carneiro 2422ec276d Fix a couple more warnings in OLSR 2007-10-03 19:11:46 +01:00
Gustavo J. A. M. Carneiro c00aa2d807 Fix unused variable warning in optimized build. 2007-10-03 19:06:31 +01:00
Gustavo J. A. M. Carneiro ab400de069 merge 2007-10-03 17:54:38 +01:00
Gustavo J. A. M. Carneiro 829a28c986 merge 2007-10-03 17:38:49 +01:00
Gustavo J. A. M. Carneiro 666850a6bc Hide the velocity vector if it is null. 2007-10-03 17:38:05 +01:00
Gustavo J. A. M. Carneiro 89ff51cc09 mereg 2007-10-03 17:33:45 +01:00
Gustavo J. A. M. Carneiro c0ea316f44 Draw the velocity vector 2007-10-03 17:29:27 +01:00
Gustavo J. A. M. Carneiro 7fae03e300 Add a small mobility model visualization tool 2007-10-03 16:38:17 +01:00
Mathieu Lacage 728d858f15 add CrMacStations to build 2007-10-03 15:46:28 +02:00
Mathieu Lacage 2029981f00 build MacParameters 2007-10-03 15:44:02 +02:00
Gustavo J. A. M. Carneiro 3e2e67d88d hg ignore doc/trace-source-list.h 2007-10-03 13:59:32 +01:00
Gustavo J. A. M. Carneiro 4fd5e3dc74 Now run doxygen again before the build, but the doc/trace-source-list.h is generated during waf check; make doxygen less verbose, and give a warning when doc/trace-source-list.h is missing. 2007-10-03 13:58:01 +01:00
Mathieu Lacage 17a02b8fbb install header 2007-10-03 14:22:41 +02:00
Mathieu Lacage 75a174bc7b no need for ns3 prefix 2007-10-03 14:22:03 +02:00
Mathieu Lacage 086e01fcb8 no need for ns3 prefix 2007-10-03 14:21:19 +02:00
Mathieu Lacage a219428887 add missing header 2007-10-03 14:20:07 +02:00
Mathieu Lacage ca86b0acf9 add missing header 2007-10-03 14:19:54 +02:00
Mathieu Lacage f20df8a492 build WifiMacTrailer 2007-10-03 14:19:24 +02:00
Mathieu Lacage d742b306d7 forgot to add wscript file 2007-10-03 14:11:10 +02:00
Mathieu Lacage 119c647097 build WifiMacHeader 2007-10-03 14:08:31 +02:00
Mathieu Lacage 64c6fa6525 add more files to build 2007-10-03 13:12:26 +02:00
Mathieu Lacage 5a7965468d add MacStation to build 2007-10-03 13:11:28 +02:00
Mathieu Lacage 855ccbf300 add MacStations to build 2007-10-03 13:10:44 +02:00
Mathieu Lacage 855d52908b add Timer::Suspend/Resume/IsSuspended 2007-10-03 13:01:29 +02:00
Mathieu Lacage 1440302ab3 add Simulator::GetDelayLeft 2007-10-03 13:01:12 +02:00
Mathieu Lacage 9e055bd52f implement WifiPhy::GetChunkSuccessRate 2007-10-03 11:35:07 +02:00
Mathieu Lacage d4a36c2e0f use WifiMode rather than TransmissionMode 2007-10-03 11:01:17 +02:00
Craig Dowell ef9c8a4716 tutorial 2007-10-02 15:34:00 -07:00
Gustavo J. A. M. Carneiro cd21a5ed8a In trace sources list documentation, make the trace path stand out better, as it is extremely important but previously easy to miss. 2007-10-02 11:51:45 +01:00
Mathieu Lacage 1d0c9511a5 Phy80211 -> WifiPhy 2007-10-02 12:42:16 +02:00
Mathieu Lacage cd73b37673 WifiPhy class 2007-10-02 12:41:04 +02:00
Gustavo J. A. M. Carneiro f970ede20b merge 2007-10-02 11:11:27 +01:00
Gustavo J. A. M. Carneiro 9308382295 Run the program print-trace-sources to generate doc/trace-source-list.h when generating docs. As a side effect, --doxygen is now has to be processed at the end of the build. 2007-10-02 11:10:31 +01:00
Mathieu Lacage caf0a2c143 add ssid to build 2007-10-02 11:38:47 +02:00
Mathieu Lacage 06cb649b55 add missing implementations 2007-10-02 11:36:12 +02:00
Mathieu Lacage e216675ca1 remove uneeded forward declaration 2007-10-02 11:32:16 +02:00
Tom Henderson fec546e939 Fix callbacks in packet-sink 2007-10-01 21:04:46 -07:00
Gustavo J. A. M. Carneiro e7fb2a2c7c According to the literature, in RandomWaypointMobilityModel the pause should come before the walk, not after; fixed. 2007-10-01 18:55:04 +01:00
Gustavo J. A. M. Carneiro 1bc6f6eeda Add ns2-mobility-file-topology sources 2007-10-01 18:01:38 +01:00
Gustavo J. A. M. Carneiro afc46ac1d3 Adapt to StaticSpeedHelper change 2007-10-01 17:11:06 +01:00
Gustavo J. A. M. Carneiro 636e47d219 Adapt to StaticSpeedHelper change 2007-10-01 17:10:46 +01:00
Gustavo J. A. M. Carneiro 9c219d647d Refactor handling of pauses in StaticSpeedHelper to fix bug (must return null speed when paused) 2007-10-01 17:10:15 +01:00
Gustavo J. A. M. Carneiro 99da16b834 Improve the precision of the RandomDirection2dMobilityModel::PI constant (value copied from glibc's math.h header file). 2007-10-01 15:11:16 +01:00
Gustavo J. A. M. Carneiro d8e5697bfe Add the random-direction-2d-mobility-model.cc,h sources to the build. 2007-10-01 15:05:43 +01:00
Gustavo J. A. M. Carneiro b504a88459 Add a bit of function name logging. 2007-10-01 15:05:03 +01:00
Mathieu Lacage 3745686f38 merge with trunk 2007-10-01 15:41:19 +02:00
Gustavo J. A. M. Carneiro fda2e2d34d merge 2007-10-01 14:34:47 +01:00
Gustavo J. A. M. Carneiro 2f4da0f0b0 Make Object::QueryInterface and AddInterface check for the aggregate refcount instead of the object refcount, reason explained in a comment near Object::CheckLoose. Add the same check also to TraceConnect/Disconnect and GetTraceResolver. 2007-10-01 14:33:17 +01:00
Mathieu Lacage 327e60b275 do not use Packet objects directly. Use Ptr<Packet> instead 2007-10-01 14:15:56 +02:00
Mathieu Lacage 2450bac944 add Packet::Ref/Unref methods 2007-10-01 14:14:31 +02:00
Mathieu Lacage 46fe0fbc29 Simplify and optimize Create template function. Add Ptr::operator * 2007-10-01 14:07:53 +02:00
Gustavo J. A. M. Carneiro 8f30f628a0 Minor code readability improvements. 2007-10-01 12:45:27 +01:00
Gustavo J. A. M. Carneiro 27ba7608db Use this-> to access member variables of Rectangle, for clarity. 2007-10-01 12:34:32 +01:00
Gustavo J. A. M. Carneiro d2cd341615 merge 2007-10-01 12:01:26 +01:00
Gustavo J. A. M. Carneiro 978e3e6e81 merge 2007-10-01 12:00:31 +01:00
Gustavo J. A. M. Carneiro 5099bebba5 Put back an assertion in Object::DoQueryInterface, erroneously removed during branch merging. 2007-10-01 11:42:41 +01:00
Gustavo J. A. M. Carneiro 6951f13ce4 On course-change, print velocity in addition to position. 2007-09-28 19:13:19 +01:00
Gustavo J. A. M. Carneiro ea76a9f88e Create real nodes, not just mobility models. 2007-09-28 19:04:11 +01:00
Gustavo J. A. M. Carneiro 35ed9727d3 Add NotifyCourseChange support to RandomWaypointMobilityModel, and fix a bug in GetSpeed. 2007-09-28 18:17:25 +01:00
Gustavo J. A. M. Carneiro b7ddc30244 Fix bad RandomWaypointPosition default value 2007-09-28 17:33:18 +01:00
Gustavo J. A. M. Carneiro e525cd4465 Fix infinite loop in CommandLine::Parse when trying to ignore a badly formed parameter. 2007-09-28 17:13:20 +01:00
Gustavo J. A. M. Carneiro 3898752f67 Fix infinite loop in CommandLine::Parse when trying to ignore a badly formed parameter. 2007-09-28 17:13:20 +01:00
Gustavo J. A. M. Carneiro c0b11f6eab Update random mobility sample to new API 2007-09-28 16:54:04 +01:00
Gustavo J. A. M. Carneiro b6d9bf7319 Fix the enumeration value list end marker (0 and (void*)0 are very different things in amd64) 2007-09-28 16:51:34 +01:00
Gustavo J. A. M. Carneiro 16e4a3c10e Compile the random-walk-2d-mobility-model sources. 2007-09-28 16:50:15 +01:00
Mathieu Lacage 4b00999550 add a Timer::Schedule (delay) method 2007-09-28 16:14:16 +02:00
Mathieu Lacage c5797b916f add tests 2007-09-28 13:27:37 +02:00
Mathieu Lacage 7a6385b614 add support for 6-arg Timer::SetFunction 2007-09-28 13:19:43 +02:00
Mathieu Lacage 5391aa0fa2 add support for 6-arg SetArguments 2007-09-28 13:02:14 +02:00
Gustavo J. A. M. Carneiro 06659f1dfc merge 2007-09-28 11:59:46 +01:00
Mathieu Lacage eec001cad4 add 6 arg support to pointer to function traits 2007-09-28 12:49:05 +02:00
Mathieu Lacage d953614fe4 add 6 arg support to pointer to member traits 2007-09-28 12:46:17 +02:00
Mathieu Lacage 82070b999c simplicy policy handling 2007-09-28 10:42:29 +02:00
Mathieu Lacage cbf46c9ec4 re-implement the Timer class with the new type traits 2007-09-28 10:33:19 +02:00
Mathieu Lacage 13347878df implement the helper IntToType template 2007-09-28 10:32:59 +02:00
Mathieu Lacage 343d9fd63f forgot to add the nArgs enum in FunctionPtrTraits 2007-09-28 10:32:15 +02:00
Mathieu Lacage 4d1ab8f4ba rewrite the TypeTraits and add some tests 2007-09-28 09:27:57 +02:00
Gustavo J. A. M. Carneiro f7ff4d6cc7 merge 2007-09-27 12:49:17 +01:00
Mathieu Lacage c1717498f4 add testcase, make it work 2007-09-27 13:48:32 +02:00
Mathieu Lacage 74a57d9e12 implement the member function version of Timer::SetFunction (a1) 2007-09-27 13:45:55 +02:00
Gustavo J. A. M. Carneiro df3bfb2771 WAF: set env['INCLUDEDIR'] to PREFIX/include so that ns3 headers get installed on 'waf install' (also shuts up the warnings in waf distcheck) 2007-09-27 12:44:29 +01:00
Gustavo J. A. M. Carneiro 76dc77106f WAF: update to WAF trunk to get bug fixes and smaller script. 2007-09-27 12:40:01 +01:00
Mathieu Lacage 265df9d0f2 add some doxygen 2007-09-27 13:31:20 +02:00
Mathieu Lacage e4352e3c5a add doxygen for Timer class and implement the policy flags 2007-09-27 13:27:18 +02:00
Mathieu Lacage da44de59b9 Implement a Timer API 2007-09-27 12:51:17 +02:00
Mathieu Lacage 8180ca7a9d add TypeTraits<T>::NonConstType 2007-09-27 12:50:55 +02:00
Gustavo J. A. M. Carneiro 71125e4833 Event Garbage Collector 2007-09-27 12:50:26 +02:00
Craig Dowell 5408c387ba branch merge 2007-09-26 19:55:35 -07:00
Craig Dowell 8df3425a2e tutorial files 2007-09-26 19:55:09 -07:00
Gustavo J. A. M. Carneiro eb4e4b6b05 Enable ASCII tracing unconditionally, now that the associated problem is fixed in OLSR. 2007-09-26 18:28:42 +01:00
Gustavo J. A. M. Carneiro 166563d343 Make the OLSR headers usable from the AciiTracing point of view 2007-09-26 18:27:52 +01:00
Gustavo J. A. M. Carneiro f6dcef3b49 Add a couple of NS_LOG_PARAM calls for debugging. 2007-09-26 18:09:19 +01:00
Gustavo J. A. M. Carneiro 299015ae5d Add a couple of NS_LOG_PARAM calls for debugging. 2007-09-26 18:09:19 +01:00
Gustavo J. A. M. Carneiro dbc4beb71a merge 2007-09-25 17:16:57 +01:00
Gustavo J. A. M. Carneiro 7d23d0c5b0 Cleanup copyright headers and some unused includes. 2007-09-25 16:26:02 +01:00
Craig Dowell ac9d618188 add tutorial files 2007-09-24 13:28:27 -07:00
Gustavo J. A. M. Carneiro 87cd21f1f8 Need to enable packet metadata early, else we trigger an assertion. 2007-09-24 18:54:14 +01:00
Gustavo J. A. M. Carneiro a54dc98fad merge 2007-09-24 16:32:03 +01:00
Gustavo J. A. M. Carneiro 392b535cf0 Check for the common error of enabling packet metadata in the middle of a simulation, and give appropriate advice in this case. Closes #78. 2007-09-24 16:11:43 +01:00
Gustavo J. A. M. Carneiro eecce3f414 Move EventCollector and SingleEvent classes, making them private to the OLSR code. 2007-09-24 11:39:31 +01:00
Gustavo J. A. M. Carneiro bea31d6487 merge with ns-3-dev 2007-09-24 11:09:17 +01:00
Gustavo J. A. M. Carneiro bd51ec2c87 Fix a regression in handling of broadcast packets and UDP sockets (closes bug #51). 2007-09-24 11:00:08 +01:00
Gustavo J. A. M. Carneiro 75c461c8f9 Remove a redundant log message 2007-09-21 18:07:54 +01:00
Gustavo J. A. M. Carneiro c8d4f578af Call Simulator::Destroy () before running simulator unit tests, to force time to start from zero (some tests check for absolute times) 2007-09-21 18:04:53 +01:00
Gustavo J. A. M. Carneiro 4b242b57c8 Use NS_TEST_* macros for simulator unit tests 2007-09-21 17:57:06 +01:00
Gustavo J. A. M. Carneiro 6a5e3bf70d Fix a small error in the unit test added recently (though it doesn't change the result) 2007-09-21 15:57:20 +01:00
Gustavo J. A. M. Carneiro 43bb81fd82 Add a couple of Udp socket unit tests: unicast (passing) and broadcast (failing, bug #51). 2007-09-21 15:54:00 +01:00
Gustavo J. A. M. Carneiro 1f6d0347cc Update OLSR example. 2007-09-21 14:28:05 +01:00
Gustavo J. A. M. Carneiro 0826d6de53 merge with ns-3-dev 2007-09-21 13:59:03 +01:00
Tom Henderson df5905ace6 Added tag release ns-3.0.6 for changeset 606df29888e7 2007-09-15 14:07:35 -07:00
Tom Henderson acadb46e6c bump version number 2007-09-15 13:56:21 -07:00
Tom Henderson ccee2254e0 release notes for 3.0.6 2007-09-15 13:52:59 -07:00
Tom Henderson e26b497ccc Add PacketSink to receive multicast 2007-09-14 16:23:49 -07:00
Tom Henderson 5e49ae47a9 change port number used by example scripts to 'discard' or 'echo' instead of '80' 2007-09-14 16:17:10 -07:00
Tom Henderson 1d79c8dc53 change ephemeral port range to 49152-65535 (IANA recommendation) 2007-09-14 16:11:36 -07:00
Tom Henderson 7bf7f4bbe5 add PacketSinks, change port number to UDP discard port, fix comment on onoff-application, delete logic for setting a default route 2007-09-14 15:57:49 -07:00
Tom Henderson bba1cb3859 remove local address setting from UdpSocket::Connect() 2007-09-14 15:46:04 -07:00
Tom Henderson 36b77224c5 Remove temporary module documentation 2007-09-14 14:55:18 -07:00
Tom Henderson b310b6745d Revert accidental tweaks of example files (not intended for checkin) 2007-09-14 14:52:09 -07:00
Tom Henderson 9ef345f02d Enable enqueue/dequeue tracing for point-to-point links 2007-09-14 14:42:31 -07:00
Craig Dowell 8649c899db allow discrete levels 2007-09-14 09:57:53 -07:00
Craig Dowell ed9f98bda1 disable log unless debug build 2007-09-13 22:17:29 -07:00
Craig Dowell 2e1dcf1479 debug to log 2007-09-13 21:36:32 -07:00
Craig Dowell 90b02a4f6c checkpoint debug to log 2007-09-13 17:47:42 -07:00
Craig Dowell 16b634a7fc sorting out logging 2007-09-13 12:37:30 -07:00
Craig Dowell 873176a3e6 add tutorial directory and hello-simulator 2007-09-13 11:04:47 -07:00
Craig Dowell 6c30d76401 merge with trunk 2007-09-13 10:53:24 -07:00
Craig Dowell 9bc6fe4e7a finish up basic echo apps 2007-09-13 10:52:41 -07:00
Gustavo J. A. M. Carneiro 013a31afdb merge 2007-09-13 15:31:55 +01:00
Tom Henderson 57b0050ae7 change NS_DEBUG component name in simple-point-to-point.cc 2007-09-12 21:32:26 -07:00
Craig Dowell 61a105af21 working one way echo app 2007-09-12 16:54:21 -07:00
Craig Dowell 51a6c25e16 log rides along for free 2007-09-12 16:24:31 -07:00
Craig Dowell 0e3ff45eb9 server half 2007-09-12 16:20:07 -07:00
Craig Dowell 77e7c6f60f start of udp echo applications 2007-09-12 15:23:25 -07:00
Gustavo J. A. M. Carneiro d09deab2f1 Adapt OLSR to routing API changes 2007-09-12 18:28:18 +01:00
Gustavo J. A. M. Carneiro 3e77a6301d merge with ns-3-dev 2007-09-12 18:06:09 +01:00
Mathieu Lacage 3e89ecfdf6 rename Euixx to Macxx 2007-09-12 11:39:46 +02:00
Mathieu Lacage 644fffd69f merge with trunk 2007-09-12 11:22:32 +02:00
Mathieu Lacage a84dd0068c enable buffer heuristics 2007-09-12 11:22:05 +02:00
Mathieu Lacage eb05af8e74 add 'internal' documentation, cleanup a bit 2007-09-12 11:16:18 +02:00
Mathieu Lacage 7c6c5fe445 fix non-optimized build 2007-09-12 10:11:57 +02:00
Mathieu Lacage 191c80211b fix copyright statements 2007-09-12 09:34:38 +02:00
Tom Henderson b13164b2c0 turn off DEBUG on simple-point-to-point 2007-09-11 23:38:18 -07:00
Tom Henderson 28456d5486 branch merge 2007-09-11 22:47:13 -07:00
Tom Henderson eb99e12003 Copyrights/licenses for routing code 2007-09-11 22:46:29 -07:00
Tom Henderson 058529526c Remove m_quiet variable, fix copyright 2007-09-11 22:40:04 -07:00
Craig Dowell 49cf104a12 variable unused in optimized build -- fixed via attribute 2007-09-11 19:40:50 -07:00
Craig Dowell b639466adb turn off debugging flags 2007-09-11 19:11:03 -07:00
Craig Dowell 1cf86b9641 integrating broadcast with multicast and sockets with multiple interfaces required default route for disambiguation 2007-09-11 19:09:49 -07:00
Craig Dowell f894771e7d socket update broke multicast 2007-09-11 18:29:26 -07:00
Craig Dowell 451a4762df merge with trunk again 2007-09-11 12:20:09 -07:00
Gustavo J. A. M. Carneiro 92313a2d64 merge 2007-09-11 15:09:55 +01:00
Gustavo J. A. M. Carneiro 94743678a9 Use NS_DEBUG instead of NS_DEBUG_UNCOND in PacketSink code. 2007-09-11 15:09:00 +01:00
Gustavo J. A. M. Carneiro 4a6e5ee331 merge with ns-3-dev 2007-09-11 14:52:15 +01:00
Gustavo J. A. M. Carneiro b284eab745 WAF: in optimized builds, replace -O2 with -O3 2007-09-11 14:44:23 +01:00
Mathieu Lacage 6969cf239a optimize Iterator::ReadU8 2007-09-11 15:06:27 +02:00
Mathieu Lacage 2b3b68605e optimize Buffer::WriteU8 variants 2007-09-11 14:56:10 +02:00
Gustavo J. A. M. Carneiro 738735b808 WAF: fix debug level to be 'ultradebug' by default, instead of 'debug'. 2007-09-11 13:37:23 +01:00
Gustavo J. A. M. Carneiro c1034b9344 WAF: remove redundant -Wall (was appearing twice) 2007-09-11 13:33:06 +01:00
Mathieu Lacage 42e6c413b6 optimize Buffer::WriteU8 2007-09-11 14:10:02 +02:00
Mathieu Lacage 4e75362d4b move around Iterator code 2007-09-11 13:53:39 +02:00
Mathieu Lacage 9bbfa99b4c print some statistics about free list efficiency 2007-09-11 13:47:17 +02:00
Mathieu Lacage 1f49f40faa add a few missing doxygen method documentations 2007-09-11 12:42:37 +02:00
Mathieu Lacage 69735ce1a5 merge gustavo's changes 2007-09-11 12:13:16 +02:00
Mathieu Lacage 8d1ac59134 merge tracing overhaul in trunk 2007-09-11 12:11:00 +02:00
Gustavo J. A. M. Carneiro 3407a01845 Update and fix (entries are searched regexps, not globs) the hg ignored files list. 2007-09-11 11:04:06 +01:00
Mathieu Lacage 485a114a2d merge with trunk 2007-09-11 10:36:25 +02:00
Mathieu Lacage 4ae082bfc7 avoid allocating strings all the time. 2007-09-11 10:35:56 +02:00
Mathieu Lacage cbd6277844 merge with trunk 2007-09-11 10:01:23 +02:00
Mathieu Lacage 96f04b41cb re-enable packet benchmarking 2007-09-11 08:27:27 +02:00
Mathieu Lacage ba9338c522 ignore waf crap 2007-09-11 08:27:15 +02:00
Craig Dowell b39cf878a0 name changes missed 2007-09-10 15:57:33 -07:00
Craig Dowell 20bf1d71bb merge with trunk 2007-09-10 15:50:07 -07:00
Mathieu Lacage 313a167729 we handle gustavo's testcase now. Fix for bug 72 2007-09-10 18:52:48 +02:00
Mathieu Lacage ca342d8de2 fix buggy assert 2007-09-10 18:49:00 +02:00
Mathieu Lacage 0c2dd78f3b update carefully m_maxZeroAreaSize and update correctly m_end and m_zeroAreaEnd in RemoveAtStart 2007-09-10 18:43:29 +02:00
Mathieu Lacage 3c81d0423e it is possible to zeroAreaStart to be bigger than the data buffer size 2007-09-10 17:55:39 +02:00
Mathieu Lacage 3fcc420e08 CreateFullCopy: the data area at the end of the buffer starts at m_zeroAreaStart. AddAtStart: the assert should be used only when the optimization is enabled. 2007-09-10 17:43:33 +02:00
Mathieu Lacage 65c099c02a max zero area start can be bigger than m_end if data is removed from end of buffer 2007-09-10 16:57:25 +02:00
Mathieu Lacage c197a4a62c add state checking and fix Buffer::CreateFullCopy 2007-09-10 16:55:26 +02:00
Mathieu Lacage 60fbe881c1 improve debugging output 2007-09-10 16:55:03 +02:00
Mathieu Lacage e96365a4bc rewrite the buffer code extensively 2007-09-10 16:45:52 +02:00
Mathieu Lacage 1e865deaaf add Buffer::m_zeroAreaStart 2007-09-10 08:54:11 +02:00
Mathieu Lacage df98467eaf Added tag buffer-working-before-breaking for changeset 267e2ebc28e4 2007-09-10 08:53:55 +02:00
Tom Henderson 7265a5f3c0 adapt some example scripts to use the new PacketSink 2007-09-09 23:24:31 -07:00
Tom Henderson 0ac1983b66 Add PacketSink application 2007-09-09 23:21:47 -07:00
Mathieu Lacage a0e8906575 make Buffer::m_end really represent the end of the data rather than its size 2007-09-09 21:16:05 +02:00
Mathieu Lacage f13dc2777d Buffer::m_size -> Buffer::m_end 2007-09-09 10:38:22 +02:00
Mathieu Lacage 0f588a8d97 add testcase 2007-09-07 19:51:46 +02:00
Mathieu Lacage 6ce3443a34 add failing testcase 2007-09-07 19:50:40 +02:00
Mathieu Lacage 1e448915d1 get rid of GetIndex 2007-09-07 19:47:06 +02:00
Mathieu Lacage a9124f0a4a re-implement all Iterator::Write and Iterator::Read methods 2007-09-07 19:39:47 +02:00
Mathieu Lacage bd1adba17e rewrite Iterator::WriteU8 2007-09-07 19:22:20 +02:00
Mathieu Lacage 39cb30a4be simplify Iterator::GetDistanceFrom method 2007-09-07 18:49:47 +02:00
Mathieu Lacage 6ced31f8b5 add a m_dataStart member in Buffer::Iterator 2007-09-07 18:45:00 +02:00
Mathieu Lacage 74ceb06336 small typo 2007-09-07 17:39:18 +02:00
Mathieu Lacage ee35d8ada2 move inline code from header to .cc file prior to rework of Buffer 2007-09-07 08:34:46 +02:00
Craig Dowell 4e92674be7 monster changeset 2007-09-06 16:24:17 -07:00
Craig Dowell a39d25f6c1 readme file includes APIs 2007-09-06 15:57:53 -07:00
Mathieu Lacage 0147e59899 move include to implementation file 2007-09-06 18:19:22 +02:00
Gustavo J. A. M. Carneiro a08faa038f Stop OLSR simulation after 10 seconds (since OLSR never stops generating events) 2007-09-06 15:18:14 +01:00
Gustavo J. A. M. Carneiro 42189e5c52 Update OLSR code to NS-3 API changes. 2007-09-06 13:34:54 +01:00
Mathieu Lacage 6c05ba06ff rename ConnectPrinterToAll to TraceAll 2007-09-06 13:32:29 +02:00
Mathieu Lacage 1a75a82523 add support for NodeList::ConnectPrinterToAll 2007-09-06 12:56:31 +02:00
Mathieu Lacage 8b5b6d3636 add bound callback tests and make them work 2007-09-06 12:33:22 +02:00
Mathieu Lacage fd8b0ba57d an euclidian distance is always positive 2007-09-06 11:18:35 +02:00
Mathieu Lacage 187ae2fe0e add tests, fix the failing tests and add support for 6-arg callbacks 2007-09-06 10:04:19 +02:00
Gustavo J. A. M. Carneiro 4a6a601b5a fix olsr wscript 2007-09-05 18:46:13 +01:00
Gustavo J. A. M. Carneiro 5631c4d214 merge 2007-09-05 18:42:41 +01:00
Gustavo J. A. M. Carneiro 6be5ea55ce merge with ns-3-dev 2007-09-05 18:35:39 +01:00
Mathieu Lacage b43e2f9190 add failing test and fix for assignment to self 2007-09-05 16:28:55 +02:00
Mathieu Lacage eb81a302b0 fix a small typo 2007-09-05 12:39:11 +02:00
Mathieu Lacage 6b8f9a0d07 add missing section on simple trace connection 2007-09-05 12:36:21 +02:00
Mathieu Lacage 7d8b071049 add an overload of the TraceSource::AddCallback method 2007-09-05 12:34:53 +02:00
Mathieu Lacage e143b5d142 re-organize the tutorial and use sections 2007-09-05 12:08:57 +02:00
Tom Henderson 929e23b74e Fix for bug69: set local address correctly upon UDP connect; apply correct UDP connect() semantics (that sendto cannot override addresses on a connected socket); if destination is IPv4 limited broadcast address, convert to subnet-directed broadcast and send out on each interface; provide example csma-broadcast.cc script 2007-09-04 21:26:54 -07:00
Craig Dowell 07fb4b1e5b clarify use of wildcards in multicast routes versus default mulicast routes. 2007-09-04 18:06:06 -07:00
Craig Dowell f652969936 Don't flood multicasts if no route found 2007-09-04 15:10:47 -07:00
Craig Dowell 65c0b60e5f piles of doxygen, changes to SetDefaultMulticastRoute plumbing 2007-09-04 14:38:40 -07:00
Mathieu Lacage 5b76e3e70f merge with trunk 2007-09-04 15:35:23 +02:00
Mathieu Lacage 99d7c597b6 move tracing tutorial to doc directory 2007-09-04 15:34:04 +02:00
Tom Henderson 5e7e0d7b2a Fold the two patches for bu6 69 together, building on the bug 65 patch 2007-09-03 23:32:23 -07:00
Tom Henderson e377cbad38 Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function 2007-09-03 14:55:51 -07:00
Gustavo J. A. M. Carneiro 0824ceacd9 WAF: as suggested by George, add a bunch of helper waf scripts that call the toplevel waf script, so that it is possible to compile with ./waf from emacs regardless of which buffer you are visiting (the other alternative is to install waf system wide and run 'waf'. 2007-09-08 19:24:39 +01:00
Mathieu Lacage 4ddb327597 finish trace tutorial 2007-08-30 16:38:41 +02:00
Mathieu Lacage e068eb8bd1 add missing requirement to doxygen 2007-08-30 16:38:26 +02:00
Mathieu Lacage 0a9cb8d248 start section on registering new TraceSource objects 2007-08-30 16:00:26 +02:00
Mathieu Lacage bb1711de60 add section on TraceContexts in tutorial 2007-08-30 15:45:46 +02:00
Mathieu Lacage 8c85cc598d add missing const 2007-08-30 15:20:08 +02:00
Mathieu Lacage 5883e3db52 make sure that l4 protocols are correctly registered within the tracing namespace 2007-08-30 15:14:26 +02:00
Mathieu Lacage 2894f50005 add explanatory diagram 2007-08-30 14:57:59 +02:00
Mathieu Lacage 87a9c29cf7 add doxygen for each TraceSourceElement subclass 2007-08-30 14:54:05 +02:00
Mathieu Lacage 471e30d85e fix dox warnings 2007-08-30 14:42:38 +02:00
Mathieu Lacage 3330ba77b1 GetName -> GetTypeName 2007-08-30 14:35:44 +02:00
Mathieu Lacage 62df1e933b rewrite the TraceContext::SourceCollection::Iterator class 2007-08-30 14:25:09 +02:00
Mathieu Lacage d23b3123ba move printing to client code 2007-08-30 13:58:15 +02:00
Craig Dowell 2d73bd9927 Move MakeMulticastAddress to NetDevice 2007-08-29 12:11:11 -07:00
Mathieu Lacage ca379f0814 reference the proper trace source list group 2007-08-29 16:43:19 +02:00
Mathieu Lacage c5b3ed12a0 add PrintDoxygen method 2007-08-29 16:43:04 +02:00
Mathieu Lacage 0e177e766a add iterator to go through available list 2007-08-29 16:42:55 +02:00
Mathieu Lacage 15234069fe add trace-source-file.h to doxygen list 2007-08-29 16:42:18 +02:00
Mathieu Lacage 45c531c463 ignore empty file 2007-08-29 16:42:00 +02:00
Mathieu Lacage 01d0b1767c empty file for doxygen generation 2007-08-29 16:41:23 +02:00
Mathieu Lacage 45f247393e add some text on trace sink signatures 2007-08-29 15:11:29 +02:00
Mathieu Lacage c8967b4b5e add some tracing documentation 2007-08-29 14:43:31 +02:00
Mathieu Lacage cd40e70901 improve output of list of existing traces 2007-08-29 14:41:21 +02:00
Mathieu Lacage ec3c5c7774 s/lowleveltracing/tracing/ 2007-08-29 14:30:58 +02:00
Mathieu Lacage 69c4f021c9 make the output of the list of existing traces more readable 2007-08-29 14:30:44 +02:00
Gustavo J. A. M. Carneiro a2fb5d5cbe merge 2007-08-29 12:32:18 +01:00
Gustavo J. A. M. Carneiro 0261a0b795 New WAF, avoids the bright yellow color (hard to read on light background terminals) problem. 2007-08-29 12:31:17 +01:00
Mathieu Lacage 3b2ffd1a07 merge with trunk 2007-08-29 09:36:28 +02:00
Mathieu Lacage e20b40ee61 backout 9856d1175cbb:642d6798feaa:27dd3e15308a 2007-08-29 09:35:53 +02:00
Gustavo J. A. M. Carneiro a882435757 Add some tweaks to enable building under emacs. 2007-08-28 16:54:07 +01:00
Gustavo J. A. M. Carneiro afbb95d987 Build the ns3 library in the build/<variant> root, not in build/<variant>/src. 2007-08-28 16:53:01 +01:00
Raj Bhattacharjea 74f9163b24 Remove references to really-simple-point-to-point, fix build 2007-08-28 10:20:13 -04:00
Mathieu Lacage cda26929bd some doxygen additions 2007-08-28 16:06:12 +02:00
Mathieu Lacage f9a6120685 avoid method naming ambiguity in CompositeTraceResolver 2007-08-28 15:59:49 +02:00
George Riley 979da57982 Reconcile changes with Mathieu's latest 2007-08-28 09:55:21 -04:00
Mathieu Lacage 33e923540a add some doxygen 2007-08-28 15:04:37 +02:00
Mathieu Lacage c384b746f7 add doxygen documentation and rename TraceContext::Get to TraceContext::GetElement 2007-08-28 14:51:13 +02:00
Mathieu Lacage 4d9cf433ff constify 2007-08-28 14:33:53 +02:00
Mathieu Lacage 380cdf687a merge with trunk 2007-08-28 14:32:44 +02:00
Mathieu Lacage 722fb64245 use more NodeList::Iterator types 2007-08-28 14:31:53 +02:00
Mathieu Lacage 67b0c98578 merge with trunk 2007-08-28 14:10:54 +02:00
Mathieu Lacage 9f6f56f3ff use the NodeList::Iterator type 2007-08-28 14:09:52 +02:00
Mathieu Lacage 91a6beb749 api doxygen for Object base class 2007-08-28 13:14:43 +02:00
Mathieu Lacage a5cf22af80 document trace source signatures 2007-08-28 13:10:18 +02:00
Mathieu Lacage cc6d4c0c06 constify 2007-08-28 13:03:08 +02:00
Mathieu Lacage 0b0a187967 document trace source signature 2007-08-28 12:42:27 +02:00
Mathieu Lacage 966643a542 improve trace list output 2007-08-28 12:06:15 +02:00
Mathieu Lacage 04569d27b7 merge with trunk 2007-08-28 12:05:35 +02:00
Mathieu Lacage f55a3c0b3d document also mobility model notifier 2007-08-28 11:22:01 +02:00
Mathieu Lacage 579a173fbf avoid problems with recursive use of Object::DoCollectSources 2007-08-28 11:21:42 +02:00
Mathieu Lacage fa4bcd0cd4 make sure to get to the parent during trace resolution 2007-08-28 11:20:55 +02:00
Mathieu Lacage 8acd0300cd keep track of trace source help strings 2007-08-28 11:01:00 +02:00
Mathieu Lacage 65f12f1df5 replace TraceResolver::PrintAvailable with TraceResolver::CollectSources 2007-08-28 09:37:10 +02:00
Craig Dowell 551fe6ebc5 real multicast enet addr, more source routes, default multicast route 2007-08-27 23:46:14 -07:00
Mathieu Lacage 95c06276cf add TraceResolver::CollectSources 2007-08-27 20:46:10 +02:00
Mathieu Lacage 403ece5588 add TraceContext::IsSimilar 2007-08-27 20:45:49 +02:00
Mathieu Lacage fce27dc4de add TraceResolver::PrintAvailable method 2007-08-27 20:25:15 +02:00
Mathieu Lacage b41cef3631 add TraceContext::PrintAvailable 2007-08-27 16:02:55 +02:00
Mathieu Lacage 3eeae90472 replace enum with virtual class and subclasses 2007-08-27 15:34:57 +02:00
Mathieu Lacage e366a6eed4 remove dead code 2007-08-27 15:07:39 +02:00
Mathieu Lacage 90c8be1fa3 add TraceContextElement::GetName method 2007-08-27 14:59:50 +02:00
Mathieu Lacage 669ce539dd cleanup a bit 2007-08-27 14:06:11 +02:00
Mathieu Lacage ccef3f6d9f remove TraceRoot 2007-08-27 13:36:40 +02:00
Mathieu Lacage c1b38a9203 rename TraceContext::Add to AddElement and Union 2007-08-27 13:21:59 +02:00
Mathieu Lacage 3f159872c0 add operator << for Packet and TraceContext 2007-08-27 13:15:27 +02:00
Mathieu Lacage 9a836af0d0 add image path 2007-08-27 13:15:13 +02:00
Craig Dowell 4e486b1f59 semi-real multicast hardware addresses 2007-08-24 17:38:49 -07:00
Craig Dowell 217edad33c add ipv4 methods, remove source multicast route requirement, fix udp socket source address prob 2007-08-24 16:57:54 -07:00
Craig Dowell 89a326ebc5 merge with trunk 2007-08-24 13:29:51 -07:00
Raj Bhattacharjea bce75ae3a8 Removed SConstruct file 2007-08-24 16:05:17 -04:00
Raj Bhattacharjea 9bf17256fb Fixed inet-socket-address's opening IFDEF to be consistent with the filename 2007-08-24 14:00:52 -04:00
Raj Bhattacharjea 027cd21aa1 Added GPL and emacs modeline to inet-socket-address.h/cc 2007-08-24 13:21:33 -04:00
George Riley 391b3eef11 Change the protocol stack processing to pass packets by non-const
reference, rather than const reference and value as was previously done.
Also change  the queue semantics to return the packet on a deque, rather
than requiring a packet as a parameter.  The problem with the original
approach was that packet UID's were getting skipped.  The fix handles
the uid properly, and we get sequential packet uid's on the trace file.
2007-08-24 11:44:11 -04:00
Mathieu Lacage 4bf8491d01 get a few more files to compile 2007-08-24 16:27:59 +02:00
Mathieu Lacage a62ac4df3a build wifi sample code 2007-08-24 15:19:20 +02:00
Mathieu Lacage 9a7206b971 merge 2007-08-24 15:12:23 +02:00
Mathieu Lacage e23f26a8f3 start of work towards port of wifi code 2007-08-24 15:12:12 +02:00
Mathieu Lacage 490d38c9f1 fix last errors for new tests 2007-08-24 15:11:08 +02:00
Mathieu Lacage 02418f7498 fix first part of errors introduced by new tests 2007-08-24 15:05:34 +02:00
Mathieu Lacage ca21c26638 add failing tests 2007-08-24 14:45:25 +02:00
Mathieu Lacage 00a9973ca8 use a Ptr<> where needed. 2007-08-24 12:45:45 +02:00
Mathieu Lacage 2ee1d5fca6 the protocol number field is a 16 bit integer, not a 32 bit integer 2007-08-24 10:33:58 +02:00
Mathieu Lacage d8b046a69f add missing include 2007-08-24 10:32:35 +02:00
Raj Bhattacharjea 08bcb4249d clarified a comment 2007-08-22 12:02:42 -04:00
Gustavo J. A. M. Carneiro 35f5503e26 WAF: fix compatibility with Python 2.3 2007-08-21 18:04:48 +01:00
Craig Dowell c0b90df335 branch merge 2007-08-20 13:40:15 -07:00
Tom Henderson bea15392ec Added tag release ns-3.0.5 for changeset 08046b6aef37 2007-08-15 23:31:51 -07:00
Tom Henderson 52de20c3b6 Add Emmanuelle to authors list 2007-08-15 23:03:06 -07:00
Tom Henderson 365e662472 update release_steps.txt 2007-08-15 22:50:31 -07:00
Tom Henderson 89758558cf bump version number 2007-08-15 22:49:06 -07:00
Tom Henderson 8d5ddc0ddf Release notes updated 2007-08-15 22:48:40 -07:00
Craig Dowell 9d2617d9a0 Fix bug 68. Implement IsMulticast 2007-08-14 12:00:03 -07:00
Craig Dowell 6b17652197 fix non-unique ethernet addresses 2007-08-13 23:40:51 -07:00
Tom Henderson 6c2a73ebda cleanup valgrind errors 2007-08-13 23:06:25 -07:00
Tom Henderson ad45701790 restore ns-2 .tr format 2007-08-13 22:53:20 -07:00
Tom Henderson ad3b6a04cc Doxygen cleanup 2007-08-13 20:53:29 -07:00
Craig Dowell caab4a3f41 Silliness for optimized version 2007-08-13 20:14:36 -07:00
Craig Dowell aecc283cb5 set source IP address in udp-socket packets 2007-08-13 19:54:47 -07:00
Craig Dowell 87c9e523c7 set source address in socket 2007-08-13 16:21:39 -07:00
Craig Dowell 90451d9635 cleanup. more complex multicast example 2007-08-13 14:58:06 -07:00
Craig Dowell e567af9b24 more multicast plumbing 2007-08-13 12:08:01 -07:00
Craig Dowell dfae0be7d0 branch merge 2007-08-12 22:43:25 -07:00
Craig Dowell d62a38e533 many debug prints 2007-08-12 22:41:24 -07:00
Craig Dowell bc8ee80491 debug prints to make validation easier 2007-08-12 15:51:12 -07:00
Tom Henderson 915e34b32b fix optimized build; remove old comment 2007-08-12 14:24:49 -07:00
Craig Dowell 5099a91a21 untested multicast support 2007-08-12 13:59:49 -07:00
Mathieu Lacage 6f9ab0dea5 move includes down to where they are really needed 2007-08-12 22:45:24 +02:00
Mathieu Lacage f90c3d0350 more tests 2007-08-12 22:44:21 +02:00
Mathieu Lacage 66d375b3b3 add forgotten virtual keyword 2007-08-12 22:44:12 +02:00
Mathieu Lacage 233d71fec7 CompositeTraceResolver::Add -> CompositeTraceResolver::AddSource 2007-08-12 22:31:16 +02:00
Mathieu Lacage 14f3f82555 remove useless code 2007-08-12 22:24:45 +02:00
Mathieu Lacage 22fec82616 replace CallbackTraceSourceBase with TraceSource base class 2007-08-12 22:23:08 +02:00
Mathieu Lacage fcfdb18914 add some debugging for disconnect 2007-08-12 21:23:55 +02:00
Mathieu Lacage 23d17d56e9 test object-based tracing 2007-08-12 21:23:40 +02:00
Mathieu Lacage 4d50d21f78 rewrite tests with test.h macros 2007-08-12 21:08:28 +02:00
Mathieu Lacage 722285bd8f rewrite Object tests with test.h macros 2007-08-12 18:43:15 +02:00
Mathieu Lacage 2bd8f97709 add NS_TEST_ASSERT_UNEQUAL 2007-08-12 18:37:38 +02:00
Mathieu Lacage b4aae47556 replace the adhoc mobility course change callbacks with a trace source 2007-08-12 18:28:37 +02:00
Mathieu Lacage 1d546dbd83 an untested interface id trace resolver 2007-08-12 18:28:13 +02:00
Mathieu Lacage 9fbb2607a1 use the abstract base of CallbackTraceSource to avoid pushing too much code in the header 2007-08-12 18:27:52 +02:00
Mathieu Lacage 442d4c9e35 add an abstract base to CallbackTraceSource 2007-08-12 18:27:30 +02:00
Mathieu Lacage de7999c932 constify 2007-08-12 18:00:15 +02:00
Mathieu Lacage 03cf88211e constify 2007-08-12 17:59:56 +02:00
Mathieu Lacage ec4d9bbcb9 use the Object::GetTraceResolver tracing support rather than the old adhoc tracing code 2007-08-12 16:28:29 +02:00
Mathieu Lacage 2df1260c87 remove const keyword and add a TraceConnect method which takes a TraceContext argument 2007-08-12 16:27:42 +02:00
Mathieu Lacage 6e762c1ae3 the TerminalTraceResolver is not used anymore by the CompositeTraceResolver implementation 2007-08-12 16:26:53 +02:00
Mathieu Lacage 2db3a828d6 rewrite the CompositeTraceResolver to use a simpler implementation, not based on callbacks 2007-08-12 16:26:25 +02:00
Mathieu Lacage c62cf3c82d rewrite the ArrayTraceResolver to use iterators 2007-08-12 16:25:19 +02:00
Tom Henderson 5da9cd2205 remove spurious examples/simple-p2p.cc 2007-08-10 13:49:41 -07:00
Tom Henderson 883d92940f global routing csma patch 2007-08-10 13:33:45 -07:00
Craig Dowell f53e19589d merge ns-3-csma with tip 2007-08-10 10:52:30 -07:00
Craig Dowell 8e6b694d6e move m_rxTrace to trace enet header 2007-08-10 10:45:59 -07:00
Craig Dowell c298892833 print length/type in hex 2007-08-10 10:44:02 -07:00
Mathieu Lacage 971997fbc1 use implicit conversion rather than private explicit conversion: fixes build 2007-08-10 19:18:19 +02:00
Mathieu Lacage 8b87d39c72 merge with trunk 2007-08-10 16:28:09 +02:00
Mathieu Lacage 1124cf3a03 add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods 2007-08-10 16:05:20 +02:00
Mathieu Lacage 3691c3cc98 fix includes 2007-08-10 15:57:33 +02:00
Mathieu Lacage 072734f7e8 move trace code to core module 2007-08-10 15:53:43 +02:00
Mathieu Lacage 0b34c336f7 convert TraceResolver * to Ptr<TraceResolver> 2007-08-10 15:47:13 +02:00
Mathieu Lacage 6b64959309 avoid problems by converting back and forth between pointers and references 2007-08-10 15:47:00 +02:00
Mathieu Lacage 704cab010d remove dead code 2007-08-10 15:08:50 +02:00
Mathieu Lacage 3153bfd916 add refcounting to TraceResolver 2007-08-10 14:43:15 +02:00
Mathieu Lacage 493c34dfb9 remove dead code 2007-08-10 14:28:52 +02:00
Mathieu Lacage 346cdbfb18 override Connect from ArrayTraceResolver 2007-08-10 14:25:58 +02:00
Mathieu Lacage cb9fdc66e3 override Connect and Disconnect in Composite and Terminal Trace resolvers 2007-08-10 14:14:29 +02:00
Mathieu Lacage 07aedd4bb2 allow resolvers to override Connect and Disconnect directly 2007-08-10 14:13:47 +02:00
Mathieu Lacage 8881f8bd91 avoid more spurious whitespaces during testing 2007-08-10 13:24:36 +02:00
Mathieu Lacage ee2b9fc885 avoid output of spurious whitespaces during testing 2007-08-10 13:17:57 +02:00
Craig Dowell 250109b215 remove old file 2007-08-09 15:58:13 -07:00
Craig Dowell aaa8a45658 rename to csma 2007-08-09 15:56:28 -07:00
Mathieu Lacage e683e1ab1c remove TraceContext argument from TraceResolver constructor and move it to Connect 2007-08-09 21:25:23 +02:00
Mathieu Lacage 23a116b96e merge with win32 tree 2007-08-09 13:42:42 +02:00
Mathieu Lacage 29014acd87 add missing space in default PacketPrinter 2007-08-09 13:38:04 +02:00
Mathieu Lacage c4ccb4a8ca merge 2007-08-09 09:39:29 +02:00
Mathieu Lacage b392b2a867 merge with trunk 2007-08-09 09:36:59 +02:00
Tom Henderson a7de7bcf31 Removing (again?) src/devices/p2p 2007-08-08 20:56:59 -07:00
Craig Dowell 371b1b01cb fix race in csma-cd channel 2007-08-08 14:19:56 -07:00
Gustavo J. A. M. Carneiro 08062bc3c5 By popular demand, add the working waf snapshot to the ns-3 source tree. 2007-08-08 21:17:48 +01:00
Gustavo J. A. M. Carneiro bac11af00e Build all modules as a single ns3 shared library. 2007-08-08 21:07:52 +01:00
Mathieu Lacage 69ccebd108 avoid initialization ordering problem 2007-08-08 23:23:24 +02:00
Mathieu Lacage 7f3f471f12 rename Bind to DefaultValue::Bind. fix bug 62 2007-08-08 16:41:59 +02:00
Mathieu Lacage 9f7eb9eecb merge 2007-08-08 16:29:26 +02:00
Gustavo J. A. M. Carneiro 86f50b36d6 merge 2007-08-08 15:25:00 +01:00
Gustavo J. A. M. Carneiro 0eca73234a WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file. 2007-08-08 15:10:36 +01:00
Mathieu Lacage f346815b18 use fixed-width types to avoid portability problems 2007-08-08 15:59:08 +02:00
Mathieu Lacage 5e9325fad1 merge with trunk 2007-08-08 15:49:41 +02:00
Mathieu Lacage d668f7749f use NS_TEST_ASSERT macros 2007-08-08 15:43:05 +02:00
Gustavo J. A. M. Carneiro a34d15da01 Revert experimental code in src/wscript accidentally committed. 2007-08-08 14:11:29 +01:00
Mathieu Lacage 7bc4564029 merge with trunk 2007-08-08 14:00:45 +02:00
Gustavo J. A. M. Carneiro f302d055e9 WAF: handle --doxygen before building; now only generates docs and does not build anything. 2007-08-08 12:36:59 +01:00
Mathieu Lacage 9cb258d920 doxygen API documentation for TraceContextElement base class 2007-08-08 13:13:24 +02:00
Mathieu Lacage 4b8e9cf7d1 use full reference for \relates tag 2007-08-08 13:13:09 +02:00
Mathieu Lacage 9b33c46995 make sure assert macros are documented 2007-08-08 12:54:21 +02:00
Mathieu Lacage 6ae06014c5 fix dox warning 2007-08-08 12:51:12 +02:00
Mathieu Lacage 32cd28829a fix dox warning 2007-08-08 12:34:18 +02:00
Mathieu Lacage aceebd88bb fix dox warning 2007-08-08 12:33:33 +02:00
Mathieu Lacage 7ad0b27460 revert part of gustavo's patch for 'better breakpoints' 2007-08-08 12:33:14 +02:00
Mathieu Lacage 635374075f re-write header and trailer doxygen API doc 2007-08-08 12:18:11 +02:00
Mathieu Lacage d3672ded33 beautify packet API doxygen 2007-08-08 11:27:17 +02:00
Mathieu Lacage b5f68770a3 move header sample and build tag sample 2007-08-08 11:20:49 +02:00
Mathieu Lacage 1bd35c2b55 make sure udp-header.h is exported for main-packet-printer 2007-08-08 11:20:35 +02:00
Mathieu Lacage 1242430e2f improve print output 2007-08-08 11:20:09 +02:00
Mathieu Lacage 771bf92f78 Tag doxygen documentation 2007-08-08 11:19:39 +02:00
Mathieu Lacage 042f455113 add Packet::PrintTags and move tag documentation to tag.h 2007-08-08 11:19:19 +02:00
Mathieu Lacage 57464209b8 update reference to header sample code 2007-08-08 11:18:49 +02:00
Mathieu Lacage d6f35d7c5c make sure we include a space between tag printed output 2007-08-08 11:16:41 +02:00
Mathieu Lacage 1f73d0d258 remove dead code 2007-08-08 11:16:11 +02:00
Mathieu Lacage 7f9545754c sample packet tag code 2007-08-08 11:15:45 +02:00
Mathieu Lacage 1e22e6d203 rework the NS_XX_ENSURE_REGISTERED macros and make sure we typecheck the input to TraceContext::Add and TraceContext::Get methods 2007-08-08 10:18:55 +02:00
Mathieu Lacage 496f1d91d0 TraceContextElement::Register -> TraceContextElement::AllocateUid 2007-08-08 10:06:58 +02:00
Mathieu Lacage 5a38178db2 Trailer::Register -> Trailer::AllocateUid and Header::Register -> Header::AllocateUid 2007-08-08 10:01:19 +02:00
Mathieu Lacage 55b4291df0 introduce Tag base class similar to Header and Trailer 2007-08-08 09:49:56 +02:00
Mathieu Lacage 5c419ea37f remove Chunk base class 2007-08-08 09:12:55 +02:00
Tom Henderson 02ccad8fbc add unreachable statement to solve gcc-4.0.x compiler bug for optimized builds on os x 2007-08-07 20:37:52 -07:00
Mathieu Lacage 9a8e9dc34b merge with trunk 2007-08-07 08:36:31 +02:00
Gustavo J. A. M. Carneiro e6aae4aa5f Fix compilation of BreakpointFallback on win32/mingw, which has signal.h but does not define SIGTRAP. 2007-08-07 00:16:13 +01:00
Craig Dowell b8458246b8 fix opt warnings, let compiler do tail call optimization in csma nd, remove protected access from router iface 2007-08-06 14:40:43 -07:00
Mathieu Lacage 287416006a tweak ascii trace output 2007-08-06 19:43:09 +02:00
Mathieu Lacage 1a1dda1796 build with the new TraceContextElement API 2007-08-06 19:40:18 +02:00
Mathieu Lacage 3fd0b3ba42 merge with trunk 2007-08-06 17:21:57 +02:00
Mathieu Lacage 77712a63ad work in progress towards a working trace context 2007-08-06 17:19:13 +02:00
Mathieu Lacage caf9c39afa make the previous merge actually work 2007-08-06 15:45:29 +02:00
Mathieu Lacage 0db07e14d6 merge implicit conversion tree 2007-08-06 15:32:27 +02:00
Gustavo J. A. M. Carneiro 988d512b77 Correct misspelled BreakpointFallback function implementation; fixes OS X build. 2007-08-06 11:55:17 +01:00
Mathieu Lacage 06c632fa50 merge from trunk 2007-08-06 12:35:06 +02:00
Mathieu Lacage f750bcefab fix memory leak 2007-08-06 10:29:28 +02:00
Mathieu Lacage 4946bbcf97 main should return a value 2007-08-06 10:29:19 +02:00
Mathieu Lacage dcdca3338d fix memory leak 2007-08-06 10:09:18 +02:00
Mathieu Lacage fbbd5dc9a6 use the InetSocketAddress API for ip sockets 2007-08-06 10:06:25 +02:00
Mathieu Lacage 913319d9e3 merge packet socket with trunk 2007-08-06 09:59:29 +02:00
Mathieu Lacage 3919d03f97 merge with trunk 2007-08-06 09:58:03 +02:00
Mathieu Lacage 5c19b67791 fix optimized build 2007-08-05 14:34:23 +02:00
Mathieu Lacage a55fa0d833 merge with trunk 2007-08-04 17:17:23 +02:00
Mathieu Lacage 8e1489d85b update the Tag API to match the Header/Trailer API 2007-08-04 17:14:54 +02:00
Mathieu Lacage 797d537cb8 update dox 2007-08-04 16:58:16 +02:00
Mathieu Lacage b6618577c7 add doxygen 2007-08-04 16:52:01 +02:00
Mathieu Lacage 0cb76eb275 macros to ensure proper initialization 2007-08-04 16:49:06 +02:00
Mathieu Lacage 93cea27ad8 force users to register their header/trailer uid strings by hand rather than do lazy uid allocation. 2007-08-04 16:37:16 +02:00
Mathieu Lacage 263326ecbe fix packet serialization/deserialization 2007-08-04 16:07:46 +02:00
Mathieu Lacage 61c85465b9 ci fix metadata serialization/deserialization 2007-08-04 16:07:31 +02:00
Mathieu Lacage 25c33df302 test packet serialization/deserialization 2007-08-04 16:06:59 +02:00
Mathieu Lacage 7d5a47afe9 make sure we return a correct uid from ChunkRegistry::GetUidFromUidString 2007-08-04 16:06:38 +02:00
Mathieu Lacage fc7802ea0f avoid fatal error if NS_DEBUG is used before the 'main' function is reached 2007-08-04 16:03:08 +02:00
Mathieu Lacage b2ddd93191 test Tags serialization/deserialization 2007-08-04 14:51:09 +02:00
Mathieu Lacage d9a9624c6c finish packet serialization/deserialization 2007-08-04 14:41:33 +02:00
Mathieu Lacage aff09e3e34 implement packet metadata serialization/deserialization 2007-08-04 14:10:49 +02:00
Mathieu Lacage 6db993b589 add doxygen documentation, constify 2007-08-04 13:28:17 +02:00
Mathieu Lacage a454a51939 rework the PacketPrinter API and implementation 2007-08-04 13:22:08 +02:00
Mathieu Lacage 6a1e38d831 forgot to use std::string instead of const char * 2007-08-04 13:21:55 +02:00
Mathieu Lacage cb6943010a remove dead forward declaration 2007-08-04 10:05:51 +02:00
Mathieu Lacage 6929464500 use CreateFullCopy and implement Serialize/Deserialize 2007-08-04 09:32:10 +02:00
Mathieu Lacage 6e956f6cc3 add Buffer::CreateFullCopy and make TransformInto private 2007-08-04 09:31:52 +02:00
Tom Henderson b080a339a6 remove README.routing file 2007-08-03 21:39:19 -07:00
Tom Henderson 5de2add9c3 fix compilation problems and test 2007-08-03 09:49:02 -07:00
Tom Henderson de77db64fc interim 2007-08-03 09:29:57 -07:00
Mathieu Lacage 555885a3b0 add Tag documentation 2007-08-03 17:52:58 +02:00
Mathieu Lacage f6ec749e96 update sample code to use a std::string rather than a const char * 2007-08-03 17:52:39 +02:00
Mathieu Lacage a5b8f5af68 split test code out of the main PacketMetadata code 2007-08-03 17:52:21 +02:00
Tom Henderson fce7c3cc39 merge with ns-3-dev 2007-08-03 08:29:24 -07:00
Mathieu Lacage 4050d495ed fix valgrind warnings 2007-08-03 17:26:10 +02:00
Tom Henderson 3378f0de19 remove Channel::GetType 2007-08-03 08:23:23 -07:00
Mathieu Lacage c05e7134ed doxygen improvements to Packet, Tags, and Headers/Trailers 2007-08-03 17:00:40 +02:00
Mathieu Lacage f8a6287322 improve dox 2007-08-03 14:09:04 +02:00
Mathieu Lacage 6c6a9a073f implement Tags::Serialize and Tags::Deserialize 2007-08-03 13:58:53 +02:00
Mathieu Lacage 9c309707a7 add internal documentation 2007-08-03 13:07:10 +02:00
Mathieu Lacage 9c1e4a0e70 rework the Tags API to ensure proper uid generation for tags 2007-08-03 13:00:38 +02:00
Mathieu Lacage 7298cd1110 make sure we return the right integer uid if the header of trailer was already registered. 2007-08-03 10:39:55 +02:00
Mathieu Lacage e672f9711f add GetUid methods to all headers and trailers 2007-08-03 09:23:41 +02:00
Mathieu Lacage 740ad8c1b2 remove redundant printing output 2007-08-03 09:15:25 +02:00
Mathieu Lacage 62310f6b21 fix coding style 2007-08-03 09:15:11 +02:00
Mathieu Lacage 9c2de843b5 move constants to private section 2007-08-03 09:09:19 +02:00
Gustavo J. A. M. Carneiro a905bf35a7 Send PacketMetadataTest unit test output to Failure (), not std::cout. 2007-08-02 14:56:04 +01:00
Gustavo J. A. M. Carneiro bd1932f12c In some places, print debug messages / errors to stderr, not stdout. 2007-08-02 14:48:36 +01:00
Gustavo J. A. M. Carneiro d272bd4e05 Replace the stdout "warning" with a NS_FATAL_ERROR 2007-08-02 14:47:51 +01:00
Gustavo J. A. M. Carneiro 67e42e8600 Bug #7: Better breakpoints. 2007-08-02 13:59:08 +01:00
Mathieu Lacage 078d8b607c do not access the iterator after erasing it 2007-08-02 08:55:56 +02:00
Gustavo J. A. M. Carneiro 7c001bf468 Detect when running waf --shell with stale environment variables and give an error when it happens. 2007-08-01 21:35:34 +01:00
Mathieu Lacage 2eef3ac5fb small bug in InetSocketAddress deserialization 2007-08-01 20:17:28 +02:00
Gustavo J. A. M. Carneiro 63cc2150a0 WAF: when changing environment (e.g. LD_LIBRARY_PATH for --run and --shell), make the new paths take precedence over the old ones. 2007-08-01 18:34:23 +01:00
Mathieu Lacage 2476dd4474 merge with trunk 2007-08-01 19:52:59 +02:00
Mathieu Lacage b954d65b8f remove uint8_t * from the send path of the socket API 2007-08-01 19:19:42 +02:00
Mathieu Lacage 1b62aa5a79 consitify the API a bit 2007-08-01 19:19:28 +02:00
Mathieu Lacage 48d1219f5c remove uint8_t * buffers from socket receive API 2007-08-01 19:09:11 +02:00
Mathieu Lacage 210e88b511 split callback registration from socket operations in socket.h API. 2007-08-01 18:48:24 +02:00
Mathieu Lacage 21960157ae merge 2007-08-01 17:24:55 +02:00
Mathieu Lacage 73322272fe fix trace output 2007-08-01 17:22:10 +02:00
Mathieu Lacage 4d12a0bfdf merge with trunk 2007-08-01 13:56:30 +02:00
Mathieu Lacage b632880fde update address size 2007-08-01 13:54:09 +02:00
Mathieu Lacage 707b722c36 fix tracing 2007-08-01 13:53:48 +02:00
Mathieu Lacage dd3ca3aa63 replace Node::DoCreateTraceResolver with Node::DoFillTraceResolver 2007-08-01 12:33:44 +02:00
Mathieu Lacage a4c3028881 example code. 2007-08-01 10:29:40 +02:00
Mathieu Lacage b4b0d52ffb add an extra constructor 2007-08-01 10:29:22 +02:00
Mathieu Lacage 492afc0f9d PacketSocketAddress serialization code was buggy. 2007-08-01 10:29:03 +02:00
Mathieu Lacage 38b3f73a85 merge 2007-08-01 09:38:55 +02:00
Mathieu Lacage 2319629592 fix bug 59: debug output now goes to stderr. 2007-08-01 09:38:09 +02:00
Mathieu Lacage 802ac99d0d remove extra includes 2007-08-01 09:15:48 +02:00
Mathieu Lacage e91a1198a0 fix build: missing const 2007-08-01 09:14:31 +02:00
Mathieu Lacage b835a6b564 a packet socket 2007-08-01 09:02:03 +02:00
Mathieu Lacage 2687579986 add Address::IsInvalid 2007-08-01 09:01:54 +02:00
Mathieu Lacage e05f635db5 rework the NetDevice <-> Node interface 2007-08-01 08:58:18 +02:00
Tom Henderson d3f1f2a341 remove manual routing commands from example script 2007-07-31 09:45:13 -07:00
Gustavo J. A. M. Carneiro 4886a7c0fe Add emacs C++ mode selection line, missing from some header files. 2007-07-31 13:49:11 +01:00
Gustavo J. A. M. Carneiro 93ad9161ec Fix the OLSR documentation. 2007-07-31 11:53:11 +01:00
Mathieu Lacage 39633a0f09 packet socket address 2007-07-31 11:42:25 +02:00
Mathieu Lacage f8baaaf617 extra Address API to be used by packet socket address 2007-07-31 11:42:10 +02:00
Mathieu Lacage 354e017a33 fix build 2007-07-31 11:33:44 +02:00
Mathieu Lacage 3d9d4ce7be I wonder what the point of that code was: why should you test for zero _after_ using the pointer ? It needs to be tested _before_. 2007-07-31 10:47:29 +02:00
Mathieu Lacage 530b65e51d add license headers 2007-07-31 10:46:43 +02:00
Mathieu Lacage af6bed4995 an eui 64 address type 2007-07-31 10:45:37 +02:00
Mathieu Lacage f7f981d549 fix bugless in address allocation 2007-07-31 10:45:15 +02:00
Mathieu Lacage 1454050eef forgot to set the interface id 2007-07-31 09:21:40 +02:00
Mathieu Lacage 8c80e6c2f8 remove now-unused ArpPrivate class 2007-07-31 09:17:05 +02:00
Mathieu Lacage b4237e51dc implement the Node::ProtocolHandler support. 2007-07-31 09:09:31 +02:00
Mathieu Lacage 7af432c313 small cleanups 2007-07-31 07:54:26 +02:00
Craig Dowell 833462a84e add simple-global-routing.cc 2007-07-30 15:50:20 -07:00
Gustavo J. A. M. Carneiro 222eea66fa Patch from Mathieu, makes EnableNodes templated 2007-07-30 19:11:21 +01:00
Gustavo J. A. M. Carneiro 072626d390 Add documentation for the (few) OLSR public APIs 2007-07-30 17:43:52 +01:00
Gustavo J. A. M. Carneiro e4dedb226f Add a simpler olsr::EnableAllNodes API as suggested by Mathieu. 2007-07-30 17:33:12 +01:00
Gustavo J. A. M. Carneiro acde0b6311 fix indentation in some places (was broken due to class rename) 2007-07-30 17:15:35 +01:00
Gustavo J. A. M. Carneiro 8cb57d43d6 Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl. 2007-07-30 17:06:06 +01:00
Gustavo J. A. M. Carneiro f597f96152 solve some merge problems 2007-07-30 15:03:45 +01:00
Gustavo J. A. M. Carneiro 0f5b5f1f6c merge 2007-07-30 15:01:18 +01:00
Gustavo J. A. M. Carneiro ea0a9ae7ab EventCollector: tune the parameters and add a shrinking heuristic. 2007-07-30 14:48:56 +01:00
Gustavo J. A. M. Carneiro 98abf1d812 Add simple EventCollector benchmark 2007-07-30 14:22:12 +01:00
Mathieu Lacage f1b9327123 remove implicit conversion from Address to Eui48Address, to Ipv4Address and to InetSocketAddress 2007-07-30 14:57:49 +02:00
Mathieu Lacage 497b9deadc add implicit conversion to Ipv4Address 2007-07-30 14:20:10 +02:00
Mathieu Lacage 2e723a700d add implicit conversion to Eui48Address 2007-07-30 14:17:12 +02:00
Gustavo J. A. M. Carneiro 5b558714de EventCollector: move methods to the .cc file 2007-07-30 13:09:02 +01:00
Mathieu Lacage 2641f7fe88 InetSocketAddress: replace explicit conversion to implicit conversion 2007-07-30 14:07:39 +02:00
Mathieu Lacage 80bf1491e1 add doxygen 2007-07-30 13:59:13 +02:00
Mathieu Lacage 22cf3afdfa add Ipv4Address::IsMatchingType and Eui48Address::IsMatchingType 2007-07-30 13:58:39 +02:00
Mathieu Lacage f2084098e2 add InetSocketAddress::IsMatchingType and use it 2007-07-30 13:55:28 +02:00
Gustavo J. A. M. Carneiro 00e998e5f9 SingleEvent: move methods to .cc file; add EventId proxy methods, instead of a single GetEventId method. 2007-07-30 12:50:13 +01:00
Mathieu Lacage df7f115415 InetAddress -> InetSocketAddress 2007-07-30 13:29:36 +02:00
Gustavo J. A. M. Carneiro 0467d48201 merge with ns-3-dev 2007-07-30 11:04:11 +01:00
Mathieu Lacage 41074331ed fix optimized build 2007-07-30 11:07:56 +02:00
Mathieu Lacage 034469197c fix address deserialization 2007-07-30 11:03:13 +02:00
Mathieu Lacage c80acdf88f remove dead files after merge 2007-07-30 10:35:40 +02:00
Mathieu Lacage 7b9fbc36e1 merge 2007-07-30 10:35:03 +02:00
Tom Henderson ecd4f30e41 Fix lengthType initialization for optimized build 2007-07-28 23:20:58 -07:00
Gustavo J. A. M. Carneiro 8682d0293a WAF: remove the obj.includes = '.' part from modules, since it causes build failure in OS X, and waf was just fixed to enable header files dependency tracking by default without needing to change obj.includes 2007-07-28 14:14:16 +01:00
Mathieu Lacage 28ddc5db69 start filling release notes with merged items 2007-07-28 14:50:56 +02:00
Mathieu Lacage 9e23045867 fix basic coding style issues 2007-07-28 13:25:10 +02:00
Mathieu Lacage 08758e9129 fix indent, basic coding style issues 2007-07-28 13:22:47 +02:00
Mathieu Lacage 14404dff66 protocol number is a 16 bit unsigned integer 2007-07-28 13:20:47 +02:00
Mathieu Lacage 7b0e63b123 param is a 16 bit integer. implement proper llc encapsulation/decapsulation 2007-07-28 13:15:04 +02:00
Mathieu Lacage 3b52247058 small cleanups 2007-07-28 13:14:24 +02:00
Mathieu Lacage 4c5fe41f2b pktType -> encapMode 2007-07-28 12:41:53 +02:00
Mathieu Lacage b4ebd87229 disable copy constructor and operator = for CsmaCdNetDevice 2007-07-28 12:30:31 +02:00
Craig Dowell d5086e07a0 small readability change 2007-07-27 21:58:19 -07:00
Craig Dowell b4698b7cca doxygen update (@internal) 2007-07-27 20:48:21 -07:00
Craig Dowell 510083f0ea remove routing environment, move router interface creation to global-route-manager 2007-07-27 20:34:25 -07:00
Tom Henderson e7f300bc7c fix tracing 2007-07-27 14:54:41 -07:00
Tom Henderson 45773a987d disable tracing; fix ifIndex assignment 2007-07-27 14:43:56 -07:00
Tom Henderson 9f8910c258 return ifIndex when adding netdevice to node (topology) 2007-07-27 14:40:50 -07:00
Craig Dowell ef462dbb5e copywrongs 2007-07-27 14:09:02 -07:00
Craig Dowell d38da7ae3d rename party 2007-07-27 14:04:54 -07:00
Tom Henderson a9fe0f2d23 rename example from p2p to point-to-point 2007-07-27 13:07:36 -07:00
Tom Henderson 5e4dbc66dc new script for csma-cd 2007-07-27 12:50:31 -07:00
Gustavo J. A. M. Carneiro e85f337b2f Adapt OLSR code to use SingleEvent instead of Timer, and EventCollector. 2007-07-27 19:21:35 +01:00
Gustavo J. A. M. Carneiro a7d36f9f9f merge with ns-3-olsr-support 2007-07-27 18:54:01 +01:00
Gustavo J. A. M. Carneiro e6ef4109c8 Remove Timer, made mostly redundant with the introduction of SingleEvent. 2007-07-27 18:50:45 +01:00
Gustavo J. A. M. Carneiro fc7b62e329 Add a SingleEvent class. 2007-07-27 18:45:12 +01:00
Gustavo J. A. M. Carneiro 3cfda55a69 Add an EventCollector class, based on concepts discussed in the mailing list 2007-07-27 17:15:30 +01:00
Mathieu Lacage 64a8418674 optmize slightly Ptr<T>::Acquire 2007-07-27 17:49:04 +02:00
Mathieu Lacage c3e1f137e1 remove GetEventImpl 2007-07-27 17:44:15 +02:00
Mathieu Lacage 0b1819cdc8 be more consistant in the handling of references 2007-07-27 17:36:14 +02:00
Mathieu Lacage dcf642ffb0 more optimizations 2007-07-27 17:28:17 +02:00
Mathieu Lacage 21be3e3912 optimize EventImpl refcounting 2007-07-27 17:18:14 +02:00
Gustavo J. A. M. Carneiro d6cb167a0c Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority. 2007-07-27 15:38:04 +01:00
Gustavo J. A. M. Carneiro 1177dc94b8 WAF: handle the option --doxygen before building the entire project. 2007-07-27 15:04:25 +01:00
Mathieu Lacage daa9c3c13c use a Ptr<> to manage EventImpl instances 2007-07-27 15:37:22 +02:00
Mathieu Lacage 9d5184bae4 add an extra constructor to use when the Create template cannot be used 2007-07-27 15:37:05 +02:00
Mathieu Lacage c7906b2d61 add refcounting to EventImpl 2007-07-27 09:53:15 +02:00
Mathieu Lacage 0b1ddb45a2 GetEventImpl -> PeekEventImpl 2007-07-27 09:50:21 +02:00
Mathieu Lacage 3cec6af4a8 add doxygen 2007-07-27 09:44:24 +02:00
Mathieu Lacage 8474486b74 add extra conveniance constructors and use them 2007-07-27 08:47:58 +02:00
Mathieu Lacage 695119b3a5 Ipv4TransportAddress -> InetAddress 2007-07-27 08:44:26 +02:00
Mathieu Lacage 863de62880 ipv4-transport-address -> inet-address 2007-07-27 08:32:34 +02:00
Mathieu Lacage c716994cab convert Socket to use Address class 2007-07-27 08:23:20 +02:00
Mathieu Lacage db6a90d956 replace MacAddress by Address 2007-07-26 17:36:53 +02:00
Mathieu Lacage 4d847a04a7 merge 2007-07-26 17:23:55 +02:00
Mathieu Lacage a60ac679a0 disable copying PointToPointNetDevice 2007-07-26 16:04:54 +02:00
Mathieu Lacage 8a5f927d8d improve type checking 2007-07-26 14:47:05 +02:00
Mathieu Lacage 073e685b0d new address types 2007-07-26 14:03:41 +02:00
Gustavo J. A. M. Carneiro a7089873e9 Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia). 2007-07-26 12:49:00 +01:00
Gustavo J. A. M. Carneiro c2c7f7d71c Allow UDP sockets to receive broadcast (bug #51) 2007-07-26 12:27:49 +01:00
Gustavo J. A. M. Carneiro c2c923ba11 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Support sending IP broadcast (255.255.255.255) packets (bug #36).
2007-07-26 12:26:21 +01:00
Gustavo J. A. M. Carneiro e45d934cb6 Allow ARP resolution to work with broadcast IPv4 (dest=255.255.255.255) packets; Partially fixes bug #36. 2007-07-26 12:12:51 +01:00
Gustavo J. A. M. Carneiro f35ff8f583 Add Ipv4Address::CombineMask, and implement Ipv4Address::IsBroadcast. 2007-07-26 12:11:37 +01:00
Gustavo J. A. M. Carneiro 6b29b3c817 Add documentation for the dynamic routing interfaces. Change Ipv4::AddRoutingProtocol priority parameter type from int to int16_t to make way for in the future providing stable sorting of routing protocols of the same priority. 2007-07-27 15:38:04 +01:00
Gustavo J. A. M. Carneiro 317f336c76 Allow UDP sockets to receive broadcast (bug #51) 2007-07-26 12:27:49 +01:00
Gustavo J. A. M. Carneiro ddd0dc6dff Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Support sending IP broadcast (255.255.255.255) packets (bug #36).
2007-07-26 12:26:21 +01:00
Gustavo J. A. M. Carneiro 1da64ebbd6 Allow ARP resolution to work with broadcast IPv4 (dest=255.255.255.255) packets; Partially fixes bug #36. 2007-07-26 12:12:51 +01:00
Gustavo J. A. M. Carneiro 48cf146a6f Add Ipv4Address::CombineMask, and implement Ipv4Address::IsBroadcast. 2007-07-26 12:11:37 +01:00
Gustavo J. A. M. Carneiro ccd6240e23 Add a Timer class (bug #46) 2007-07-26 12:08:22 +01:00
Gustavo J. A. M. Carneiro 41c4b6453a EvenId const fixes. 2007-07-26 12:05:31 +01:00
Tom Henderson fda49d72c1 merge 2007-07-27 10:49:29 -07:00
Mathieu Lacage 230b3840ad cleanup simple example 2007-07-27 21:39:58 +02:00
Emmanuelle Laprise 31530c7311 a csma/cd NetDevice subclass and a test script 2007-07-27 21:17:14 +02:00
Emmanuelle Laprise ad5f36f2ac ethernet Header and Trailer classes 2007-07-27 21:16:40 +02:00
Emmanuelle Laprise 718ec64593 Move LLC encapsulation from NetDevice to subclasses. 2007-07-27 20:45:18 +02:00
Emmanuelle Laprise b078d91894 cleanup the wscripts 2007-07-27 20:45:07 +02:00
Emmanuelle Laprise 0e21d85be1 src/devices/point-to-point/p2p-* -> src/devices/point-to-point/point-to-point-* 2007-07-27 20:26:36 +02:00
Emmanuelle Laprise 54af49fe40 src/devices/p2p -> src/devices/point-to-point 2007-07-27 20:17:23 +02:00
Tom Henderson 2d950869f8 Add patch 49 (add/remove network route when bringing interface up/down) 2007-07-27 10:48:10 -07:00
Gustavo J. A. M. Carneiro d3ec8f8791 EvenId const fixes. 2007-07-26 12:05:31 +01:00
Mathieu Lacage 9033830375 fix optimized build 2007-07-26 08:18:11 +02:00
Gustavo J. A. M. Carneiro 35e5c48814 WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration. 2007-07-24 16:13:31 +01:00
Tom Henderson b16efc8c0b a few edits on the doxygen 2007-07-23 20:06:00 -07:00
Tom Henderson bdf28a79fc revise README 2007-07-23 19:27:01 -07:00
Tom Henderson bc634975d4 remove old routing code 2007-07-23 19:02:55 -07:00
Craig Dowell 2f682ca9f8 single populate call 2007-07-23 15:53:37 -07:00
Craig Dowell bb8c8e5fa8 remove doxygen warnings, make waf work 2007-07-23 14:31:24 -07:00
Mathieu Lacage 014bc9ed79 mobility models 2007-07-23 15:53:54 +02:00
Mathieu Lacage a89dbfad01 a small typo 2007-07-23 15:24:17 +02:00
Mathieu Lacage b53716bd7f add operator << (std::ostream)for Ptr<T> 2007-07-23 15:23:14 +02:00
Mathieu Lacage 6e9b3d811b add dirtyness tracking to DefaultValueBase 2007-07-23 15:22:36 +02:00
Mathieu Lacage 3fa85ade3a make sure IsExpired handles destroy events correctly 2007-07-23 15:16:45 +02:00
Mathieu Lacage 1bd05e4561 add support to cancel Now and Destroy events. 2007-07-23 14:52:51 +02:00
Mathieu Lacage a38a0d5b81 add operator == and != t o EventId 2007-07-23 14:51:57 +02:00
Mathieu Lacage efcf28b96b TimeDefaultValue 2007-07-23 14:41:53 +02:00
Mathieu Lacage 6b827886a0 RandomVariableDefaultValue 2007-07-23 14:41:34 +02:00
Mathieu Lacage f6712c7cbd IntegerDefaultValue -> NumericDefaultValue 2007-07-23 14:13:03 +02:00
Mathieu Lacage 3e11da04df merge 2007-07-23 14:01:43 +02:00
Mathieu Lacage 56d6ee9a1c fix bug 57 2007-07-23 13:58:53 +02:00
Craig Dowell 897a518750 parenthesis police were here 2007-07-20 14:28:18 -07:00
Craig Dowell c9b7590dd9 turn off debug flag 2007-07-20 14:22:46 -07:00
Craig Dowell 4d3d250d5e make static router a singleton, make implementation details private 2007-07-20 14:21:21 -07:00
Gustavo J. A. M. Carneiro 43d93b87bc Update README to mention WAF instead of SCons. 2007-07-20 14:51:25 +01:00
Gustavo J. A. M. Carneiro f0a90a46ed WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default. 2007-07-20 11:38:16 +01:00
Gustavo J. A. M. Carneiro d379c41d72 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes. 2007-07-20 11:27:34 +01:00
Gustavo J. A. M. Carneiro 57688559b1 WAF: add obj.includes = '.' to command waf to do dependency tracking on private header files. 2007-07-20 11:12:43 +01:00
Mathieu Lacage fa26073882 update ignore rules for waf generated files 2007-07-20 09:13:51 +02:00
Mathieu Lacage b37ca7868a remove scons scripts 2007-07-20 09:10:49 +02:00
Mathieu Lacage 767621d2cb forgot to update waf build scripts 2007-08-09 21:16:39 +02:00
Craig Dowell ab93e1f56d overlooked one 2007-07-19 23:04:09 -07:00
Craig Dowell f3523e8381 last parts of general cleaup and commenting 2007-07-19 22:48:50 -07:00
Mathieu Lacage 0eeaf31270 merge 2007-07-19 19:08:43 +02:00
Mathieu Lacage 5703b95d0e finish support for references as arguments to event handlers 2007-07-19 18:57:19 +02:00
Mathieu Lacage 7acaffa841 fix testcase 2007-07-19 15:10:59 +02:00
Mathieu Lacage ea7652677d rename traits to handle Ptr<> object pointers 2007-07-19 13:53:14 +02:00
Gustavo J. A. M. Carneiro b239441ff9 Buffer::Iterator::Write (buffer, size) should have a uint32_t parameter, not
uint16_t, else integer overflow may occur.  Fixes bug #54.
2007-07-19 12:48:22 +01:00
Mathieu Lacage 8bea90280f failing testcases to for events with references as arguments 2007-07-19 13:45:07 +02:00
Mathieu Lacage 4fef0935fb revert george's fix to support events with references as arguments 2007-07-19 13:44:42 +02:00
Mathieu Lacage 421e19ca4b make sure that dox generates html links 2007-07-19 13:17:35 +02:00
Mathieu Lacage 3e00c2d842 fix dox warnings 2007-07-19 13:11:08 +02:00
Mathieu Lacage 3fe8f75d1b a dox summary header for the mobility support 2007-07-19 13:02:02 +02:00
Mathieu Lacage 8e0837b6a1 fix link 2007-07-19 12:43:32 +02:00
Mathieu Lacage 347b7238dc create a mobility module 2007-07-19 12:38:30 +02:00
Mathieu Lacage fdb89d13ef more dox 2007-07-19 12:29:21 +02:00
Mathieu Lacage f3060d8a33 RandomDirection2dParameters -> RandomDirection2dMobilityModelParameters 2007-07-19 12:23:12 +02:00
Mathieu Lacage be743da973 more dox 2007-07-19 12:21:48 +02:00
Mathieu Lacage de8d7725be more dox 2007-07-19 11:31:17 +02:00
Mathieu Lacage 7033df8c0c Ns2Mobile -> Ns2Mobility 2007-07-19 11:31:07 +02:00
Mathieu Lacage 2e6e200962 fix typo 2007-07-19 11:30:47 +02:00
Mathieu Lacage b7a44adca0 remove dead code 2007-07-19 11:09:13 +02:00
Mathieu Lacage e831a050cd more dox 2007-07-19 11:05:47 +02:00
Mathieu Lacage 4e2af32bcf doxygen for mobility models 2007-07-19 10:46:50 +02:00
Mathieu Lacage 198b031d03 remove dead code 2007-07-19 10:43:41 +02:00
Mathieu Lacage 5ec60a6a2c RandomDirection -> RandomDirection2d 2007-07-19 10:31:04 +02:00
Mathieu Lacage eadaabbe62 random-direction -> random-direction-2d 2007-07-19 10:30:18 +02:00
Mathieu Lacage b2d7640a1d add MobilityModel::GetSpeed method and implement it in all mobility models 2007-07-19 10:28:48 +02:00
Mathieu Lacage 39ba117abf remove dead code 2007-07-19 10:21:27 +02:00
Mathieu Lacage 7a3849ffdb remove dead code 2007-07-19 10:21:23 +02:00
Mathieu Lacage 9a367b2be7 use the helper from the static speed mobility model 2007-07-19 10:17:02 +02:00
Mathieu Lacage f671c11773 remove mobility model helper, re-enable random direction model with new helper 2007-07-19 10:05:07 +02:00
Mathieu Lacage bb7208b754 move delay calculation code from helper to random walk class 2007-07-19 10:01:42 +02:00
Mathieu Lacage 3ae6f849ac move rebound code from helper to random walk model 2007-07-19 09:54:57 +02:00
Mathieu Lacage e682be574b move intersection code to rectangle class 2007-07-19 09:48:10 +02:00
Mathieu Lacage ab084a9399 move around rectangle class and move IsInside method from Position to Rectangle 2007-07-19 09:34:36 +02:00
Mathieu Lacage 3f4edebda6 remove 'now' events 2007-07-19 08:43:43 +02:00
Mathieu Lacage a59e3bb3cd remove schedule API to allow canceling and removing now and destroy events 2007-07-19 08:43:28 +02:00
Mathieu Lacage e62ea4cdb4 add operator == and != to EventId 2007-07-19 08:29:48 +02:00
Craig Dowell e3283739ce general cleanup of routing 2007-07-18 16:57:54 -07:00
Raj Bhattacharjea 600aa2ec16 Added Triangularly distributed random variables 2007-07-18 17:43:45 -04:00
Craig Dowell 0921355a74 General cleanup -- const correctness, encapsulation, documentation, etc. 2007-07-18 14:35:06 -07:00
Mathieu Lacage 1ac757bd60 get rid of old buggy random walk model 2007-07-18 17:56:43 +02:00
Mathieu Lacage 9c46074145 do not try to remove invalid events 2007-07-18 17:55:58 +02:00
Mathieu Lacage 2ad239b6c9 more debugging, make sure to save value string if it is value after parsing. 2007-07-18 17:52:18 +02:00
Mathieu Lacage 9bc8eb952b fix typos 2007-07-18 17:45:53 +02:00
Mathieu Lacage 83cbc1f450 be consistant with the rest of the code 2007-07-18 17:45:35 +02:00
Mathieu Lacage 5ef0970789 add disc center position and debugging 2007-07-18 17:45:07 +02:00
Mathieu Lacage 41920cc74f add debugging output 2007-07-18 17:44:32 +02:00
Mathieu Lacage bda63626d2 a real random walk model 2007-07-18 17:07:25 +02:00
Mathieu Lacage d0d364d729 add Rectangle class and use it. 2007-07-18 17:07:15 +02:00
Mathieu Lacage e896c2576b make sure we schedule the start event correctly 2007-07-18 17:06:36 +02:00
Emmanuelle Laprise 8b417ebd25 Fixed a typo in the documentation. Had to change NodeList::Index to
NodeList::NodeIndex
2007-07-18 09:27:22 -05:00
Emmanuelle Laprise 6d93d700bb trying to merge again 2007-07-18 09:11:48 -05:00
Mathieu Lacage 88b0af83b5 add cid support to waypoint model 2007-07-18 14:11:33 +02:00
Mathieu Lacage 5e3d0126e3 add default value support to random waypoint 2007-07-18 14:08:34 +02:00
Mathieu Lacage aef4192d6a add a 3d random waypoint model 2007-07-18 13:56:37 +02:00
Gustavo J. A. M. Carneiro 30b8b3c61f WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc. 2007-07-18 12:20:31 +01:00
Gustavo J. A. M. Carneiro 7a1c6388c2 Backed out changeset df68dad55087ea649a33f04e78b4ff4cf324acdd 2007-07-18 12:17:53 +01:00
Gustavo J. A. M. Carneiro a694ccb39e WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc. 2007-07-18 11:43:39 +01:00
Mathieu Lacage a85bcfc0d7 Random2dPosition -> RandomPosition 2007-07-18 11:04:54 +02:00
Mathieu Lacage 5cc787f648 move Position class in own header 2007-07-18 11:03:01 +02:00
Mathieu Lacage a011792fb6 RandomRectangleTopology -> RandomTopology 2007-07-18 10:53:53 +02:00
Mathieu Lacage 2bd88ed300 use Random2dPosition from RandomRectangleTopology 2007-07-18 10:46:44 +02:00
Mathieu Lacage bd234eafe3 add iid and cid support to Random2dPosition 2007-07-18 10:46:26 +02:00
Mathieu Lacage 0405be5bb0 a random position helper class 2007-07-18 10:13:28 +02:00
Craig Dowell f8616ba0b5 routing documentation 2007-07-17 22:20:48 -07:00
Mathieu Lacage c40b0f6f63 start support for random walk and random waypoint models 2007-07-17 16:11:49 +02:00
Mathieu Lacage b10c76a3a6 cleanup the header 2007-07-17 14:37:11 +02:00
Mathieu Lacage 683b301fb7 split useful code out of random direction mobility model 2007-07-17 14:32:19 +02:00
Gustavo J. A. M. Carneiro 76223227ba Allow compiling the 'routing' module and example with WAF 2007-07-17 11:02:14 +01:00
Craig Dowell 04e59f26b9 checkpoint documentation 2007-07-17 12:17:17 -07:00
Mathieu Lacage ba0f81e65c remove unused class declarations 2007-07-17 11:13:34 +02:00
Mathieu Lacage 204352ca8b fix small typo 2007-07-17 11:12:24 +02:00
Mathieu Lacage 8b07f89d13 remove extraneous setters/getters 2007-07-17 10:58:13 +02:00
Mathieu Lacage 2f01154847 fix small typo 2007-07-17 10:54:50 +02:00
Mathieu Lacage 24458b4bf1 a topology class to read ns2's mobility files and a mobility generator. 2007-07-17 10:47:25 +02:00
Tom Henderson 52049833fd update release checklist 2007-07-16 22:49:48 -07:00
Tom Henderson 3ec27d06ec Added tag release ns-3.0.4 for changeset 5701e60bf01a 2007-07-16 22:44:02 -07:00
Tom Henderson 2c813805e7 Remove doc/build-waf.txt 2007-07-16 22:43:10 -07:00
Tom Henderson 0583ab3bc8 changes for 3.0.4 release 2007-07-16 21:41:19 -07:00
Craig Dowell 510d234611 checkpoint 2007-07-16 16:59:23 -07:00
Emmanuelle Laprise 3006bcb3f7 Testing 2007-07-16 18:42:40 -05:00
Mathieu Lacage b9c2580f22 a hierarchical mobility model 2007-07-16 15:27:56 +02:00
Tom Henderson 2684031ff2 Fix SPFVertex destructor; make unit tests succeed again 2007-07-15 22:47:58 -07:00
Gustavo J. A. M. Carneiro ae8f10ae47 WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though. 2007-07-15 13:04:47 +01:00
Craig Dowell de2866fe38 merge 2007-07-13 14:37:00 -07:00
Craig Dowell 2f2b10d22b remove inappropriate assertions that popped when routing disabled 2007-07-13 14:35:24 -07:00
Tom Henderson 2065013a04 Small readme for the routing 2007-07-13 14:22:40 -07:00
Tom Henderson 57b3448019 Check for static routing flag before instantiating a StaticRouteManager 2007-07-13 14:21:44 -07:00
Craig Dowell 65faee4e7b fix merge problem that lost candidate queue changes 2007-07-13 14:05:12 -07:00
Craig Dowell e1c4bbed1d remove debug prints 2007-07-13 13:49:10 -07:00
Craig Dowell 420fb5f6cc merge probs 2007-07-13 13:46:01 -07:00
Tom Henderson c4ee764dd8 Debugged; works 2007-07-13 13:33:56 -07:00
Craig Dowell 3e0167a9e9 delete vertices, fix candidate queue pop/top semantics 2007-07-13 12:21:48 -07:00
Craig Dowell be74b3dca8 implement SPFIntraAddRouter 2007-07-12 22:15:59 -07:00
Tom Henderson ba94df76e1 Finish function prototypes 2007-07-12 11:41:59 -07:00
Tom Henderson 6361dd3f6e Initial logic for SPFNexthopCalculation 2007-07-12 11:05:23 -07:00
Craig Dowell 9f44a9d6a4 dox for candidate queue 2007-07-12 10:47:12 -07:00
Gustavo J. A. M. Carneiro b6c0155487 Make Simulator::IsExpired parameter const, to reflect the fact that the EventId is not changed. EventId::IsExpired and EventId::IsRunning also made const. 2007-07-12 12:41:37 +01:00
George F. Riley 42d93b9872 Simplifications to the point to point devices and channel 2007-07-13 10:40:10 +02:00
Tom Henderson 534ab7a030 finish SPFNext logic; add declaration for NexthopCalculation 2007-07-11 23:43:09 -07:00
Tom Henderson e0399adca9 Non-default constructor for SPFVertex 2007-07-11 22:54:47 -07:00
Tom Henderson 33a0cc3759 move m_stat flag to LSA 2007-07-11 22:37:48 -07:00
Tom Henderson 9ff955496e Replace SPFVertexPriorityQueue with CandidateQueue 2007-07-11 17:31:43 -07:00
Tom Henderson 9424ed9669 Make LSDB back into a storage for LSAs 2007-07-11 17:13:11 -07:00
Tom Henderson 248122670f Adjust candidate queue implementation: rename Fetch to Find, and make Find based on m_vertexId 2007-07-11 16:45:19 -07:00
Craig Dowell 9dc9be484f candidate queue 2007-07-11 13:18:01 -07:00
Tom Henderson 3fc88faa51 merge the minor tweaks 2007-07-10 23:11:24 -07:00
Tom Henderson 8168ddcb40 Add candidate list (priority queue) 2007-07-10 23:10:18 -07:00
Craig Dowell d57291777f minor tweaks 2007-07-10 22:17:25 -07:00
Craig Dowell e47dd4f054 One RouterLSA per node 2007-07-10 17:59:11 -07:00
Tom Henderson 4e86f62a64 end of day checkin 2007-07-10 17:56:46 -07:00
Craig Dowell 711276e62b SPFVertex Priority Queue 2007-07-10 17:35:44 -07:00
Tom Henderson a2acacebe0 Iterate link records (16.1(2)) 2007-07-10 15:03:39 -07:00
Tom Henderson 40e70fc6e9 Dummy test node for unit testing 2007-07-10 13:58:13 -07:00
Tom Henderson f4d5687704 Branch merge 2007-07-10 13:40:36 -07:00
Tom Henderson 3adfd850c7 Initialize SPFCalculate 2007-07-10 13:39:54 -07:00
Tom Henderson 42019fca7c Initialize LSDB for SPF runs 2007-07-10 13:34:23 -07:00
Tom Henderson 0fc2f3d86d SPFVertex constructor 2007-07-10 13:28:07 -07:00
Craig Dowell b10355c846 made GetNumLSAs cheap, added DiscoverLSAs as expensive call. 2007-07-10 13:01:43 -07:00
Craig Dowell 05d649ef54 doxygen 2007-07-10 12:38:51 -07:00
Tom Henderson 71d55ebf18 more plumbing around SPFCalculate() 2007-07-10 11:29:08 -07:00
Tom Henderson dc80efa426 convert LSDB to class SPFVertex 2007-07-10 10:56:27 -07:00
Craig Dowell 0068da44d4 first working router 2007-07-10 09:31:07 -07:00
Gustavo J. A. M. Carneiro d757f69479 WAF: explain in the docs how to change the compilation flags. 2007-07-10 13:45:20 +01:00
Gustavo J. A. M. Carneiro 5629eae3ae WAF: don't change CXXFLAGS if CXXFLAGS is set in the OS environment (so that user CXXFLAGS take precedence). 2007-07-10 13:42:23 +01:00
Gustavo J. A. M. Carneiro 496313f56b WAF: add debugging symbols to optimized builds 2007-07-10 13:37:17 +01:00
Craig Dowell 3640d302e1 checkpoint 2007-07-10 01:28:19 -07:00
Tom Henderson d07e17d85c Add LSDB destructor 2007-07-09 23:07:51 -07:00
Tom Henderson a87c498af8 branch merge 2007-07-09 22:21:31 -07:00
Tom Henderson 75070e1bfa Add LSDB functions 2007-07-09 22:21:01 -07:00
Craig Dowell 5487c20beb forgot to remove a header include 2007-07-09 22:12:58 -07:00
Craig Dowell bcedf25ebf checkpoint 2007-07-09 22:04:55 -07:00
Craig Dowell 7ce874f5d0 checkpoint 2007-07-09 22:03:41 -07:00
Craig Dowell bd0cbfb5b8 checkpoint 2007-07-09 15:16:27 -07:00
Tom Henderson 67fa3a8c82 WAF: --update build-waf.txt; add note about waf configure, add waf dist/distclean, remove ./ as part of system path to waf 2007-07-09 06:43:11 -07:00
Gustavo J. A. M. Carneiro 3ce169b4e2 WAF: ignore errors on shutil.rmtree in dist_hook, so that waf dist works even when no docs were previously generated. 2007-07-09 14:36:40 +01:00
Gustavo J. A. M. Carneiro 441a8868a0 Fix unit test assertion failure error message (was printing the value instead of the expression itself) 2007-07-09 14:31:52 +01:00
Tom Henderson dfb744bdf1 Fill out self-tests example 2007-07-09 02:41:33 -07:00
Tom Henderson 849c347d2e Remove m_numLinks LSA member (redundant with list.size() method) 2007-07-08 15:30:17 -07:00
Tom Henderson 9c3fa17ce2 Remove NS_DEBUG in destructor 2007-07-08 15:17:45 -07:00
Tom Henderson 37783c3446 Add ctor/dtor to StaticRouterLSA, add the Add() method to add link records, misc. cleanup 2007-07-08 15:12:50 -07:00
Tom Henderson 2447ea37ca Add Set methods to class Ipv4Address (like the non-default ctors) 2007-07-08 13:55:39 -07:00
Tom Henderson 4d0e208a2e Add routing module to run_tests; add node module as dependency to routing 2007-07-08 13:55:03 -07:00
Gustavo J. A. M. Carneiro 65f894b7ac WAF: --run now runs the specified program from the directory where waf was invoked. 2007-07-08 12:24:22 +01:00
Gustavo J. A. M. Carneiro de608e90c1 WAF: option --run now filters out programs not in the subtree starting at the launch dir 2007-07-07 18:10:54 +01:00
Tom Henderson 3aa83b20ff include node.h 2007-07-06 17:13:49 -07:00
Tom Henderson 1194823a73 Add more scaffolding 2007-07-06 16:57:35 -07:00
Tom Henderson 60685f35d8 Add static-route-manager scaffolding 2007-07-06 16:44:58 -07:00
Tom Henderson 4d9b0f6157 Add routing dependency to inode in SConstruct 2007-07-06 16:21:50 -07:00
Craig Dowell e2428486b1 merge ns3-dev 2007-07-06 15:10:01 -07:00
Craig Dowell 5a7dd75687 static routing 2007-07-06 15:07:03 -07:00
Craig Dowell 42bc462559 static routing 2007-07-06 15:06:26 -07:00
Craig Dowell d0ff4c3306 static routing 2007-07-06 15:05:47 -07:00
Craig Dowell 2f5acd74d9 static routing 2007-07-06 15:04:33 -07:00
Craig Dowell 7979a01371 static routing 2007-07-06 15:03:59 -07:00
Tom Henderson 59633b8ba6 remove p2p strings in simple-static-routing example 2007-07-06 14:47:01 -07:00
Tom Henderson 1eecfd24f6 merge ns-3-dev 2007-07-06 14:39:59 -07:00
Tom Henderson fdda9161fe a few fixes to the LSAs 2007-07-06 14:19:40 -07:00
Tom Henderson 4156e28d78 add example static routing script; a few changes to static-router LSAs 2007-07-06 13:13:43 -07:00
Craig Dowell 418275589c beginnings of static routing 2007-07-05 23:27:28 -07:00
Gustavo J. A. M. Carneiro 0b32b0109f WAF: fix simple typo in error message. 2007-07-05 14:48:21 +01:00
Gustavo J. A. M. Carneiro 0f246d7f69 WAF: when the program specified by --run is not found, print a list of all available program names in the error message. 2007-07-05 14:44:00 +01:00
Gustavo J. A. M. Carneiro d30f4d66de WAF: make the --run option work again 2007-07-05 14:38:39 +01:00
Mathieu Lacage be946aab50 new version of DoGet and DoSet 2007-07-04 13:52:12 +02:00
Mathieu Lacage 2aca908685 use new MobilityModel::Get and remove old one. 2007-07-04 10:27:49 +02:00
Mathieu Lacage 99ec33418a add Position class and Get/Set methods on MobilityModel 2007-07-04 10:24:45 +02:00
Mathieu Lacage c416887542 POSITION_H -> MOBILITY_MODEL_H 2007-07-04 10:18:14 +02:00
Mathieu Lacage dd0ff29f66 position.h -> mobility-model.h 2007-07-04 10:15:18 +02:00
Mathieu Lacage 3e22f47624 Position -> MobilityModel 2007-07-04 10:04:08 +02:00
Mathieu Lacage bda20507bd PositionSetNotifier -> MobilityModelNotifier 2007-07-04 09:56:22 +02:00
Mathieu Lacage 9111697a0b add missing constructor declaration 2007-07-04 09:48:49 +02:00
Emmanuelle Laprise 97ac1394fa Needed to push const changes 2007-07-03 22:28:45 -05:00
Emmanuelle Laprise 6966d2633a Remove the const after the DoAddDevice function 2007-07-03 22:25:42 -05:00
Craig Dowell 58d341cea3 test 2007-07-03 12:43:39 -07:00
Mathieu Lacage f27587f391 build the new code 2007-07-03 17:14:09 +02:00
Mathieu Lacage ce6536c1d8 RandomDirection model 2007-07-03 17:12:44 +02:00
Mathieu Lacage c0420dfa2a add a few constructors 2007-07-03 17:12:28 +02:00
Mathieu Lacage 0c77aa5a69 implement Dispose 2007-07-03 17:11:53 +02:00
Mathieu Lacage 96698c5783 In some cases, when an event is scheduled against a subclass of Object, and if no one owns a reference directly to this object, the object is alive, has a refcount of zero and the method ran when the event expires runs against the raw pointer which means that we are manipulating an object with a refcount of zero. So, we must disable this check. This is really evil but I see no way to work around this. 2007-07-03 17:05:23 +02:00
Mathieu Lacage 038bc809cb add operator << (std::ostream)for Ptr<T> 2007-07-03 16:11:40 +02:00
Mathieu Lacage 71d559e1f2 add dirtyness tracking to DefaultValueBase 2007-07-03 13:19:09 +02:00
Mathieu Lacage 184d929521 parse command-line arguments 2007-07-03 12:36:01 +02:00
Mathieu Lacage 5e975db36e a bunch of new DefaultValue subclasses 2007-07-03 12:34:26 +02:00
Mathieu Lacage 9a89cf1978 change GridTopology API and add RandomRectangle topology with similar API. 2007-07-03 10:04:16 +02:00
Mathieu Lacage 94c1f03300 test random walk position model with grid topology 2007-07-03 09:15:20 +02:00
Mathieu Lacage 872df4e54e RandomWalk is a Position 2007-07-03 08:56:40 +02:00
Mathieu Lacage 5fdde955b3 change default values and add some debugging 2007-07-03 08:54:37 +02:00
Emmanuelle Laprise 826d8e0303 Removed the const after the DoAddDevice function because it is used to
add a callback on the packet receive function. But, in some cases (ie
ethernet learning), it is going to be needed to have a non-const
function that is called on packet reception.
2007-07-02 19:59:40 -05:00
Mathieu Lacage 3f87b85886 add cid/iid support to RandomWalk 2007-07-02 20:25:25 +02:00
Mathieu Lacage af6777397c rename GridTopology::Create to GridTopology::ArrangeHorizontally 2007-07-02 20:17:06 +02:00
Mathieu Lacage 2f29b73496 improve grid topology sample code and add dox documentation 2007-07-02 20:12:01 +02:00
Mathieu Lacage 7bed39940e merge with head 2007-07-02 19:47:03 +02:00
Mathieu Lacage 5625551898 append correct unit when printing Time objects 2007-07-02 19:44:18 +02:00
Gustavo J. A. M. Carneiro fd479088ec WAF scripts update 2007-07-02 18:23:52 +01:00
Mathieu Lacage c14499b211 add dox documentation 2007-07-02 18:14:20 +02:00
Mathieu Lacage 57b5993f8d add dox documentation 2007-07-02 18:12:27 +02:00
Mathieu Lacage 2f8fdae0db increase sample simulation run 2007-07-02 15:28:28 +02:00
Mathieu Lacage e57869a38e add some debugging output. initialize the time argument correctly. 2007-07-02 15:27:53 +02:00
Mathieu Lacage e4d291802b make the sample code actually do something 2007-07-02 15:15:25 +02:00
Mathieu Lacage 77eb4ec65a improve sample code, make it build 2007-07-02 15:08:10 +02:00
Mathieu Lacage d27798e797 rework the notification mechanism to allow its optional use with every position model 2007-07-02 14:57:19 +02:00
Mathieu Lacage fca6b52fba random walk position model (untested) 2007-07-02 14:07:51 +02:00
Mathieu Lacage 04ebac2279 forgot to add TypeName implementation for float and double 2007-07-02 14:07:27 +02:00
Mathieu Lacage fb968dccdf forgot to add missing constructor implementation 2007-07-02 14:02:57 +02:00
Mathieu Lacage 1271ada6e1 TimeDefaultValue class 2007-07-02 14:02:02 +02:00
Mathieu Lacage 7a86a8a8e7 make default constructor private to avoid potential problems 2007-07-02 14:01:49 +02:00
Mathieu Lacage e9ee638ae9 grid topology 2007-07-02 12:14:24 +02:00
Mathieu Lacage 965e14c3f9 add cid support 2007-07-02 12:14:12 +02:00
Mathieu Lacage a2ca638f47 add cid support to position subclasses 2007-07-02 11:29:54 +02:00
Mathieu Lacage 0197e59eb1 DoSet should not be const 2007-07-02 11:29:27 +02:00
Mathieu Lacage 418adb52a4 add Position::DoSet et al. 2007-07-02 10:50:18 +02:00
Mathieu Lacage 8894524474 add floating point support to type names 2007-07-02 10:50:07 +02:00
Unknown 8b7716b380 Add payload size to UDP 2007-07-01 00:35:59 -07:00
Unknown 96a92d230e more verbose commenting of the sample 2007-07-01 00:21:14 -07:00
Mathieu Lacage 6ec6318d5f position models 2007-06-29 09:41:37 +02:00
Mathieu Lacage bedbfd18d7 add dox doc for header and trailer PrintTo and DoGetName 2007-06-29 08:18:16 +02:00
Craig Dowell a5e90a8dea test 2007-06-28 14:54:42 -07:00
Craig Dowell b22e98aa01 test 2007-06-28 14:39:56 -07:00
Craig Dowell 89ea0a9911 test 2007-06-28 14:29:46 -07:00
Mathieu Lacage 2756732458 add more internal documentation 2007-06-28 13:59:51 +02:00
Mathieu Lacage 3bb28c049f test and fix backward printing 2007-06-28 13:43:27 +02:00
Mathieu Lacage ce57b5d156 more asserts, add failing tests, fix them 2007-06-28 13:01:40 +02:00
Mathieu Lacage 23f4e85f87 fix basic tests, add new test, add a bunch of asserts, add XXX comment 2007-06-28 12:29:21 +02:00
Mathieu Lacage b937ec5a87 add failing assert 2007-06-28 12:00:00 +02:00
Mathieu Lacage 103a2527ce use pretty printing in ascii output 2007-06-28 11:52:50 +02:00
Mathieu Lacage 18e53720d1 change arp pretty printing to new format 2007-06-28 11:52:16 +02:00
Mathieu Lacage 35f80fc5c3 modify sample packet printer to use ipv4 and udp headers 2007-06-28 11:48:37 +02:00
Mathieu Lacage 993dc85f8f change default pretty printing output format, add doc to metadata data structures 2007-06-28 11:07:38 +02:00
Mathieu Lacage 99bd5418bc merge with head 2007-06-27 20:51:07 +02:00
Gustavo J. A. M. Carneiro 7c1e148ffa WAF: add a warning to the --high-precision-as-double option help text saying they it works in configure. 2007-06-21 12:33:50 +01:00
Gustavo J. A. M. Carneiro ffa52a935a WAF: simplify --debug-level option to only have debug and optimized as possible values (debug becomes the former ultradebug); Add a warning to some options help text saying they only work in configure. 2007-06-21 12:26:46 +01:00
Gustavo J. A. M. Carneiro 4b4b121366 WAF: be careful not to set gcc-specific flags (like -Werror) when using a non-gcc compiler. 2007-06-21 11:59:55 +01:00
Mathieu Lacage 2964b90925 add testcase, fix bug 2007-06-21 11:07:04 +02:00
Mathieu Lacage 50f2fc5a16 fix small variable name typo 2007-06-21 11:01:15 +02:00
Mathieu Lacage d879c3c54a merge from head 2007-06-21 09:40:57 +02:00
Gustavo J. A. M. Carneiro 3012f74206 WAF: configure dynamic path for the cygwin platform. 2007-06-21 00:38:58 +01:00
Craig Dowell 7fec46aecf test 2007-06-20 12:07:31 -07:00
Gustavo J. A. M. Carneiro 91aa5250de Add Ipv4Address operator <, to allow Ipv4Address to be used in std::set; Closes #39. 2007-06-19 16:59:44 +01:00
Mathieu Lacage 75d762c0b9 fix small typos 2007-06-18 19:31:27 +02:00
Gustavo J. A. M. Carneiro 67454b117b Add Ipv4Mask == and != operators, similarly to Ipv4Address. 2007-06-18 18:01:28 +01:00
Gustavo J. A. M. Carneiro 3b96881ba2 Bug 37: NS_TEST_ASSERT_EQUAL 2007-06-18 15:55:47 +01:00
Mathieu Lacage 87c5cb5706 add separator support to backward printing 2007-06-13 00:20:53 +02:00
Mathieu Lacage f4911e544b update packet benchmark 2007-06-13 00:10:40 +02:00
Mathieu Lacage 10d053a838 comment the sample code a little bit 2007-06-13 00:07:17 +02:00
Mathieu Lacage c4ab5ba8ff add separator support to PacketPrinter 2007-06-13 00:02:57 +02:00
Mathieu Lacage 75bc2e9b0b sample code for pretty printing 2007-06-12 23:40:14 +02:00
Mathieu Lacage c2fda9ce09 do not forget payload printer for default printer 2007-06-12 23:23:31 +02:00
Mathieu Lacage 8e2ee88b93 merge 2007-06-12 22:54:43 +02:00
Mathieu Lacage d27fe9ac8e merge 2007-06-12 22:54:10 +02:00
Mathieu Lacage 0d7b0e26ee history -> metadata 2007-06-12 22:52:56 +02:00
Gustavo J. A. M. Carneiro da531b4aef WAF: process --run and --shell command-line options sooner, before running the build, since we may need a shell before the build finishes, in case the program to debug is part of the build itself. 2007-06-12 19:04:38 +01:00
Gustavo J. A. M. Carneiro 4772e79fee Define env['NS3_MODULE_PATH'] in configure rather than build. 2007-06-12 18:52:58 +01:00
Gustavo J. A. M. Carneiro 72622c0755 Re-sync WAF build with the latest SConstruct changes. 2007-06-12 14:05:01 +01:00
Mathieu Lacage 55f2084e86 avoid duplicating the packet uid 2007-06-12 13:21:06 +02:00
Mathieu Lacage f34463d1cc add release notes 2007-06-12 11:37:56 +02:00
Mathieu Lacage 76b31adc2f fix bug 29 2007-06-12 11:04:00 +02:00
Mathieu Lacage 641ecb2736 fix bug 28 2007-06-12 10:53:38 +02:00
Mathieu Lacage 3dbf735aeb fix main dox entry point 2007-06-11 17:54:06 +02:00
Mathieu Lacage 33a493fe5d IIpv4 -> Ipv4 2007-06-11 17:50:16 +02:00
Mathieu Lacage 1ec3ab4a1f merge with HEAD 2007-06-11 17:47:49 +02:00
Gustavo J. A. M. Carneiro 005d9c9877 Add my institutional email address (gjc@inescporto.pt), in addition to the GMail one. 2007-06-08 18:58:34 +01:00
Mathieu Lacage 102dcfd4bc do not crash is the payload printer is null 2007-06-07 13:19:25 +02:00
Mathieu Lacage e89ad0a86b fix uleb128 reading bug 2007-06-07 13:16:15 +02:00
Mathieu Lacage b7ded4e595 PacketHistory -> PacketMetadata 2007-06-07 12:51:57 +02:00
Mathieu Lacage b61417101f rename packet-history.h to packet-metadata.h 2007-06-07 12:48:52 +02:00
Mathieu Lacage 6e2d898443 add an option to control the history implementation 2007-06-07 12:44:44 +02:00
Mathieu Lacage 1ba5c01281 more dox 2007-06-07 12:42:44 +02:00
Mathieu Lacage c6f42b1cff constify Callback::IsNull 2007-06-07 12:30:52 +02:00
Mathieu Lacage 2b3882fb1a make the code match the dox doc 2007-06-07 12:29:38 +02:00
Mathieu Lacage 12476595ad improve dox doc 2007-06-07 12:29:27 +02:00
Mathieu Lacage 8435bfc4fe add back optimization option 2007-06-07 12:25:40 +02:00
Mathieu Lacage 9cec524f88 rename History::Enable to Packet::EnableMetadata 2007-06-07 12:17:25 +02:00
Mathieu Lacage fb3786c137 remove dead code 2007-06-07 11:38:06 +02:00
Mathieu Lacage 40e654dd22 store chunkUid and packetUid as fixed-size fields 2007-06-07 11:21:21 +02:00
Mathieu Lacage d5087e2d90 unconditionally set m_data 2007-06-07 11:00:49 +02:00
Mathieu Lacage adf49bbc32 fix gcov link 2007-06-07 10:51:25 +02:00
Mathieu Lacage 8361cbab71 try alternative implementation of AddSmall 2007-06-07 10:38:48 +02:00
Mathieu Lacage 49abdbd009 fix Append and optimize GetUleb128Size 2007-06-07 09:38:51 +02:00
Mathieu Lacage 4b95d67bea optimize a bit AddHeader 2007-06-07 09:18:04 +02:00
Mathieu Lacage a6382422df remove atStart arg to AddBig 2007-06-07 08:13:19 +02:00
Mathieu Lacage e77c211955 remove ReadSmall and ReadExtra 2007-06-07 07:39:47 +02:00
Mathieu Lacage 8a3e4b7b14 ReadItems does not depend on ReadSmall & ReadExtra 2007-06-07 07:32:10 +02:00
Mathieu Lacage a0901958a8 make some methods inline 2007-06-06 14:40:48 +02:00
Mathieu Lacage 8e0ccbb45a Update -> UpdateHead + UpdateTail 2007-06-06 14:38:52 +02:00
Mathieu Lacage 1608934b89 simplify a bit the small item logic 2007-06-06 14:32:17 +02:00
Mathieu Lacage 02763bf7cb fix bug introduced in commit 767 2007-06-06 14:19:21 +02:00
Mathieu Lacage e5b63ce34d add counters 2007-06-06 14:14:22 +02:00
Mathieu Lacage 4ed6463d22 remove Update call from within AddSmall and AddBig 2007-06-06 14:11:22 +02:00
Mathieu Lacage f348fc4fbc remove useless CanAdd 2007-06-06 13:56:42 +02:00
Mathieu Lacage 07489e7e9c a few micro-optimizations 2007-06-06 13:51:15 +02:00
Mathieu Lacage eb6eea0f72 make all tests pass 2007-06-06 13:02:00 +02:00
Mathieu Lacage b0a30b32bb implement ReplaceTail 2007-06-06 12:39:33 +02:00
Mathieu Lacage 2caaf90037 simplify calls to AddBig and AddSmall 2007-06-06 11:30:17 +02:00
Mathieu Lacage 929ea4dab0 share some code, implement AddAtEnd 2007-06-06 11:01:59 +02:00
Mathieu Lacage f5ce4791d2 IUdp -> Udp 2007-06-06 10:54:58 +02:00
Mathieu Lacage 5698e745c9 fix a few bugs in ::RemoveAtEnd 2007-06-06 10:04:02 +02:00
Mathieu Lacage 8c03ce9e0c remove data from end of trailer, not start of header 2007-06-06 09:55:01 +02:00
Mathieu Lacage 113e6255ea simplify GetTotalSize 2007-06-06 09:45:23 +02:00
Mathieu Lacage cbac246ffb fix simple bugs in RemoveAtEnd 2007-06-06 09:43:54 +02:00
Mathieu Lacage e829515b02 fix fragment printing 2007-06-06 09:23:47 +02:00
Mathieu Lacage 3e511d1457 rewrite PacketHistory::RemoveAtstart 2007-06-06 09:13:21 +02:00
Mathieu Lacage aabed928b1 make sure that we set the low bit for typeUid when writing a 'big' item 2007-06-06 08:54:11 +02:00
Mathieu Lacage 6816e303ec implement PacketHistory::RemoveAtStart 2007-06-06 08:49:15 +02:00
Mathieu Lacage 1bbf7ce1a2 when doing a copy of a buffer, make sure to clear the prev and next fields 2007-06-05 21:48:26 +02:00
Mathieu Lacage 969ff1267e the mask to filter out the low bit is 0xfe, not 0xfd 2007-06-05 18:28:37 +02:00
Mathieu Lacage 3634046dc7 fix a bunch of buggy asserts 2007-06-05 17:35:22 +02:00
Mathieu Lacage c3ff0ad584 fix the list iteration logic 2007-06-05 16:40:05 +02:00
Mathieu Lacage ebfe75384c rename begin to head and end to tail 2007-06-05 16:36:53 +02:00
Mathieu Lacage bd1dcf3f97 fix field ordering. 2007-06-05 16:33:45 +02:00
Mathieu Lacage d5e147d400 deal with packet with zero headers correctly 2007-06-05 15:59:07 +02:00
Mathieu Lacage 35dbade0a9 implement PacketHistory::Print 2007-06-05 15:47:29 +02:00
Mathieu Lacage dc62fabc0b fix addition of a trailer or a header 2007-06-05 14:06:58 +02:00
Mathieu Lacage 47f2db1e23 a new implementation of the PacketHistory API 2007-06-05 13:44:43 +02:00
Mathieu Lacage 967b3f34e9 IIpv4 -> Ipv4 2007-06-04 18:25:43 +02:00
Mathieu Lacage 09ed1c9575 i-ipv4.h -> ipv4.h 2007-06-04 18:05:36 +02:00
Mathieu Lacage f71d6fd74f IUdp -> Udp 2007-06-04 18:03:26 +02:00
Mathieu Lacage b9c4fa85f1 i-udp.h -> udp.h 2007-06-04 18:01:09 +02:00
Mathieu Lacage c32fa46161 ISocketFactory -> SocketFactory 2007-06-04 17:57:01 +02:00
Mathieu Lacage d0bd4ea161 i-socket-factory.h -> socket-factory.h 2007-06-04 17:54:56 +02:00
Mathieu Lacage 7b6d5c4e97 IIpv4Private -> Ipv4Private 2007-06-04 17:42:37 +02:00
Mathieu Lacage 0459737b00 IIpv4Impl -> Ipv4Impl 2007-06-04 17:40:09 +02:00
Mathieu Lacage 372ecb8430 preprocessor update 2007-06-04 17:24:45 +02:00
Mathieu Lacage 9a852e442e IUdpImpl -> UdpImpl 2007-06-04 17:24:18 +02:00
Mathieu Lacage 92757ef5c3 Udp -> UdpL4Protocol 2007-06-04 17:22:52 +02:00
Mathieu Lacage 297692d88b udp.h -> udp-l4-protocol.h 2007-06-04 17:18:02 +02:00
Mathieu Lacage 4ead4618e6 i-arp-private.h -> arp-private.h 2007-06-04 17:14:59 +02:00
Mathieu Lacage 96f1c67bfe i-udp-impl.h -> udp-impl.h 2007-06-04 17:13:21 +02:00
Mathieu Lacage 9db1449b4b i-ipv4-private.h ipv4-private.h 2007-06-04 17:06:03 +02:00
Mathieu Lacage 9421bfcfee i-ipv4-impl.h -> ipv4-impl.h 2007-06-04 16:59:51 +02:00
Mathieu Lacage a5a1152e95 Arp -> ArpL3Protocol 2007-06-04 16:57:24 +02:00
Mathieu Lacage 3a97fce182 arp.h -> arp-l3-protocol.h 2007-06-04 16:54:36 +02:00
Mathieu Lacage e8ab5afb41 Ipv4 -> Ipv4L3Protocol 2007-06-04 16:51:59 +02:00
Mathieu Lacage 1d0658dc85 rename ipv4.h to ipv4-l3-protocol.h 2007-06-04 16:42:10 +02:00
Mathieu Lacage 01f37ccb65 rename MakeNewObject to Create 2007-06-04 16:32:37 +02:00
Mathieu Lacage 4d5a66d6e5 remove MakeInternetNode 2007-06-04 16:28:18 +02:00
Mathieu Lacage c4234041bc remove file 2007-06-04 16:24:05 +02:00
Mathieu Lacage 359a2f98a8 rename i-node to node 2007-06-04 16:21:05 +02:00
Mathieu Lacage 1225b1623e rename INode to Node 2007-06-04 16:17:01 +02:00
Mathieu Lacage 62aa29999b remove dead typedef 2007-06-04 09:33:38 +02:00
Mathieu Lacage a4f727f68d a bunch of optimizations 2007-06-03 20:09:56 +02:00
Mathieu Lacage a6c8a11881 fix the packet benchmark and enable it 2007-06-02 19:10:35 +02:00
Mathieu Lacage ce4bcba2e6 Added tag packet-history-working for changeset 0dc81e76166c 2007-06-02 18:36:56 +02:00
Mathieu Lacage a88ff1f2c4 more tests, fix 2007-06-02 18:32:31 +02:00
Mathieu Lacage a986e81353 more tests, initial fix. 2007-06-02 18:24:44 +02:00
Mathieu Lacage b9899de6df more tests 2007-06-02 18:13:19 +02:00
Mathieu Lacage bebb4eb281 fix build for g++ 4.1 2007-06-02 18:08:04 +02:00
Mathieu Lacage 03ca60cd50 merge with trunk 2007-06-02 17:59:14 +02:00
Mathieu Lacage 1c46ed54e5 merge with trunk 2007-06-02 17:58:39 +02:00
Mathieu Lacage 34c6957f95 more tests 2007-06-01 15:26:21 +02:00
Mathieu Lacage 8a62c228b2 ensure that packets are real buffers before concatenating them 2007-06-01 15:23:30 +02:00
Mathieu Lacage 4c92dfe914 add more asserts, make TransformIntoRealBuffer public for Packet class 2007-06-01 15:23:07 +02:00
Mathieu Lacage 5f2b952521 enable more tests 2007-06-01 14:50:04 +02:00
Mathieu Lacage 3485d9829c more tests 2007-06-01 14:35:18 +02:00
Mathieu Lacage 00d6bb5c8a add more tests 2007-06-01 13:06:35 +02:00
Mathieu Lacage 89fc9310db calculate the correct size of header and trailer to remove from buffer 2007-06-01 13:06:21 +02:00
Mathieu Lacage 26e52f0da4 more tests 2007-06-01 12:49:10 +02:00
Mathieu Lacage 99c235760e new test and fix to make it pass 2007-06-01 12:46:23 +02:00
Mathieu Lacage 0dfdcfbdc3 add test and fix buggy assert 2007-06-01 12:42:29 +02:00
Gustavo J. A. M. Carneiro 5f48c4e7f3 add waf.bat for convenience (waf itself still has to be manually copied from outside, though) 2007-06-18 10:53:48 +01:00
Tom Henderson 5e703c70f7 Added tag release ns-3.0.3 for changeset 38099dd26e94 2007-06-17 16:04:52 -07:00
Tom Henderson e9ae18f809 bump VERSION number 2007-06-17 16:04:12 -07:00
Tom Henderson 396c76892c release_steps.txt document 2007-06-17 14:17:22 -07:00
Mathieu Lacage c329d7dd4e improve Packet Header/Trailer API dox 2007-06-16 17:15:58 +02:00
Tom Henderson ca3871e4f6 Backed out changeset 767 for the release (not ready) 2007-06-15 13:30:40 -07:00
Tom Henderson d1c6c9a348 back out unfinished p2p changes 2007-06-15 13:19:57 -07:00
Gustavo J. A. M. Carneiro d5260811dc Add a Packet::AddAtEnd unit test. 2007-06-15 18:10:40 +01:00
Gustavo J. A. M. Carneiro ce155b4d35 WAF: remove debugging print accidentally left in. 2007-06-15 15:25:01 +01:00
Gustavo J. A. M. Carneiro 65aca43f3f WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list. 2007-06-15 15:19:38 +01:00
Gustavo J. A. M. Carneiro 96418f577d re-sync cairo-wideint.c with upstream cairo's version (also fixes the recent compiler warning, but in a different way) 2007-06-14 13:09:56 +01:00
Gustavo J. A. M. Carneiro 2ee9064175 merge 2007-06-14 12:55:24 +01:00
George F. Riley 4042681e83 Simplification to p2p-net-device and p2p-channel (work in progress) 2007-06-14 10:41:47 +02:00
Tom Henderson cdf13df87d Add main-query-interface.cc sample file 2007-06-13 23:13:21 -07:00
Gustavo J. A. M. Carneiro 50037ae611 Fix compilier warning/error: src/simulator/cairo-wideint.c:789: warning: comparison between signed and unsigned integer expressions. 2007-06-13 18:40:38 +01:00
Gustavo J. A. M. Carneiro e38244e7c0 WAF: add -Wall and -Werror to CXXFLAGS, like in the SCons build. 2007-06-13 18:34:05 +01:00
Mathieu Lacage 4f0eae4a6d add a rationale for the way Trailers work 2007-06-13 16:37:04 +02:00
Mathieu Lacage 438e58cc1c add test and fix buggy assert 2007-06-01 12:42:29 +02:00
Mathieu Lacage 4bfd1c4a2a Packet API must call Trailer::DoSerialize on end of trailer, not start of trailer 2007-06-01 11:37:19 +02:00
Mathieu Lacage abfdb4befc test payload 2007-06-01 11:17:59 +02:00
Mathieu Lacage 5a1ffabd03 test fragments 2007-06-01 11:12:55 +02:00
Mathieu Lacage 66bf48b6e6 make the tests pass again 2007-06-01 11:03:56 +02:00
Mathieu Lacage bf7acebc30 fix buggy assert 2007-06-01 10:49:17 +02:00
Mathieu Lacage 975c1dc46f build the ItemList into the input list, not a temporary stack variable. 2007-06-01 10:35:05 +02:00
Mathieu Lacage 8cf2162121 remove PrintSimple and revert order of history data written in data buffer 2007-06-01 10:06:35 +02:00
Mathieu Lacage 9980528f1e make chunkUid zero and invalid uid to improve debugging 2007-06-01 09:55:47 +02:00
Tom Henderson 0e34f6cfb8 Touch file for test checkin 2007-05-31 08:20:09 -07:00
Mathieu Lacage 581b34b586 force use of the ItemList to test it 2007-05-31 14:52:15 +02:00
Mathieu Lacage 20581afe80 re-implement PacketHistory to use the PacketPrinter and work on ItemList::Print 2007-05-31 14:30:34 +02:00
Mathieu Lacage 3861a96d5a implement forgotten PacketPrinter::AddDefaultPrinter 2007-05-31 14:30:07 +02:00
Mathieu Lacage af44bde349 fix off-by-one in uid allocation 2007-05-31 14:00:03 +02:00
Mathieu Lacage 4736067ed2 avoid recursive initialization of uid static variable 2007-05-31 13:52:29 +02:00
Mathieu Lacage 2e686bcca7 use Callback::GetImpl rather than Callback::PeekImpl 2007-05-31 13:45:03 +02:00
Mathieu Lacage 8eef599aa6 add public Callback::GetImpl 2007-05-31 13:44:40 +02:00
Mathieu Lacage afb85320bf constify, allow ItemList access to private methods 2007-05-31 13:37:05 +02:00
Mathieu Lacage 4b8dabddae add support for a default PacketPrinter 2007-05-31 12:34:33 +02:00
Mathieu Lacage ab5c0a43bd rework the PacketPrinter code 2007-05-31 11:03:42 +02:00
Mathieu Lacage 65f215eee2 add a new overloaded Assign method 2007-05-31 11:03:26 +02:00
Mathieu Lacage e7abed2def try to design a packer printer class 2007-05-30 12:45:32 +02:00
Mathieu Lacage 66c3a25fe1 add Chunk::GetName and implement it 2007-05-30 10:03:15 +02:00
Mathieu Lacage d9f03cafbe implement ItemList::AddAtEnd 2007-05-30 09:48:53 +02:00
Mathieu Lacage 639231388c implement ItemList construction 2007-05-30 07:42:56 +02:00
Mathieu Lacage fe44d27cde prepare for forward iteration of history. 2007-05-29 16:53:53 +02:00
Mathieu Lacage b71248e0f3 keep track of the aggregation state 2007-05-29 16:24:40 +02:00
Mathieu Lacage 4db6e9a69a merge unfinished packet history code 2007-05-29 16:09:20 +02:00
Mathieu Lacage a6d6859aab sample code for component manager 2007-05-25 21:53:24 +02:00
Mathieu Lacage 55f8e04570 add more code to sample code 2007-05-25 21:47:59 +02:00
Mathieu Lacage a1f206804c sample code for Object base class 2007-05-25 21:43:23 +02:00
Mathieu Lacage 18c3f768a3 small typo 2007-05-25 21:28:38 +02:00
Mathieu Lacage 0e277a28d8 improve dox 2007-05-25 21:27:58 +02:00
Gustavo J. A. M. Carneiro 081e70c7f3 Add the waf files and scripts to the scons dist 2007-05-25 19:14:05 +01:00
Mathieu Lacage 44007809fd size of element is pointer, not value 2007-05-25 18:51:04 +02:00
Mathieu Lacage 827e1c879e avoid checking for the Object::iid value from within ComponentManager::Register 2007-05-25 18:39:02 +02:00
Mathieu Lacage 1a7e6629fb more tests 2007-05-25 18:22:22 +02:00
Mathieu Lacage 4164903d0e eliminate memory leak 2007-05-25 18:13:01 +02:00
Mathieu Lacage 5bedcf0a1c add dox 2007-05-25 18:00:50 +02:00
Mathieu Lacage f1db331e5d fix buggy assert 2007-05-25 17:42:53 +02:00
Mathieu Lacage 3df39a1f78 add DefaultValue support for ClassId 2007-05-25 15:28:24 +02:00
Mathieu Lacage 59459fc6ca a new ComponentManager API 2007-05-25 14:15:03 +02:00
Mathieu Lacage 83dcd91223 make Callback use a separate empty type 2007-05-25 14:13:23 +02:00
Mathieu Lacage ca530216ec add a m_disposed field and check it 2007-05-25 12:27:40 +02:00
Mathieu Lacage c2ac40ca00 use a 16 bit interface id 2007-05-25 12:23:51 +02:00
Mathieu Lacage 14e59ca91a remove buggy assert 2007-05-25 12:19:58 +02:00
Mathieu Lacage 643522774e port code from Interface to Object 2007-05-25 10:56:03 +02:00
Mathieu Lacage cb3ec490a5 make QueryInterface const 2007-05-25 10:52:58 +02:00
Mathieu Lacage 4358b2fd71 port ComponentManager to Object from Interface 2007-05-25 10:32:34 +02:00
Mathieu Lacage 6c6a0073bf remove Interface 2007-05-25 10:04:38 +02:00
Mathieu Lacage f86cf8b9c3 rename InterfaceObject to Object 2007-05-25 10:02:50 +02:00
Mathieu Lacage 0444eb1f80 remove Object base class 2007-05-25 09:44:57 +02:00
Mathieu Lacage 45d2ebfc69 merge 2007-05-25 09:44:18 +02:00
Gustavo J. A. M. Carneiro acbfbc29b3 WAF: add a dist_hook function to exclude the generated documentation from waf dist 2007-05-24 19:21:50 +01:00
Gustavo J. A. M. Carneiro 923f4aeb8f WAF: correct values of VERSION and APPNAME, for waf dist 2007-05-24 17:59:30 +01:00
Gustavo J. A. M. Carneiro 381103678d WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript 2007-05-24 17:54:51 +01:00
Mathieu Lacage 80247a993d uniformize the DefaultValues used by the Event Schedulers 2007-05-24 16:15:41 +02:00
Mathieu Lacage 29026f00db merge 2007-05-24 16:12:20 +02:00
Mathieu Lacage 25c6350a88 fix bug 24 2007-05-24 16:08:03 +02:00
Gustavo J. A. M. Carneiro c0af811d13 WAF: reference-list* were removed 2007-05-24 14:53:43 +01:00
Mathieu Lacage 01d21b3ea2 add tests and fix leak 2007-05-24 15:37:00 +02:00
Mathieu Lacage df1cd3d5da remove ReferenceList: fix bug 27 2007-05-24 15:23:11 +02:00
Mathieu Lacage 1bab5a3625 add Callback::Nullify method 2007-05-24 14:58:24 +02:00
Mathieu Lacage 911daba417 fix bug 23 2007-05-24 14:53:10 +02:00
Mathieu Lacage 9b4e7f4cfc add DefaultValue support for TimeStepPrecision 2007-05-24 09:34:58 +02:00
Mathieu Lacage 8c4e057c91 add EnumDefaultValue::SetValue 2007-05-24 09:34:43 +02:00
Mathieu Lacage cd0c502986 more dox improvements 2007-05-24 09:22:48 +02:00
Mathieu Lacage 7436c51592 improve dox 2007-05-24 09:18:42 +02:00
Mathieu Lacage 95863b81a3 add reference to Emmanuelle in Authors/Copyright 2007-05-24 09:11:46 +02:00
Mathieu Lacage 49fbbec138 avoid cyclic dependency between Simulator and Time code 2007-05-24 09:08:24 +02:00
Mathieu Lacage cc2d1399ab fix small typos 2007-05-24 09:04:19 +02:00
Mathieu Lacage fcf02a427c namespace the precision values properly 2007-05-24 09:02:17 +02:00
Emmanuelle Laprise 73a66e5b1a Fixed the problems that were found by Mathieu Lacage in the first
implementation. Biggest change is to not allow any conversions to
double with the GetXxxSeconds and XxxSeconds functions. (see Bug 22
for more information)
2007-05-21 22:14:09 -05:00
Mathieu Lacage 8b48c39675 rename ::Add to ::AddInterface 2007-05-19 13:41:50 +02:00
Mathieu Lacage 055f6d06ae yet another optimization to cut even more on memory allocations 2007-05-19 13:25:45 +02:00
Emmanuelle Laprise 23ab5ba436 The header file ns3/cairo-wideint-private.h was added since the type int32_t was used. 2007-05-17 12:12:44 -05:00
Mathieu Lacage a655f02fcc merge ns-3.0.2 tag 2007-05-24 08:34:41 +02:00
Mathieu Lacage 92aa47e0bc Added tag release ns-3.0.2 for changeset 7ac5a4b0969b 2007-05-24 08:33:44 +02:00
Gustavo J. A. M. Carneiro 8cdcda24e1 WAF: remove the rpath options, and add --run and --shell as replacements; additionally, the new options "should" work on Mac OS X, as well as linux2 and win32. 2007-05-23 19:20:54 +01:00
Gustavo J. A. M. Carneiro a28dd7dbc3 WAF: cleanup code by putting lcov and doxygen handling into their own separate functions 2007-05-23 17:32:32 +01:00
Raj Bhattacharjea cd7fdcf026 Added comparison operators for DataRate 2007-05-21 13:22:37 -04:00
Gustavo J. A. M. Carneiro 81b081c67d WAF: sync with the last SConstruct change (smartvector.h and smartset.h removed) 2007-05-20 18:06:31 +01:00
Gustavo J. A. M. Carneiro fb07f84709 WAF: fix problem in --enable/disable-rpath options 2007-05-20 18:05:30 +01:00
Mathieu Lacage b1bc31ae0e optimization suggested by gustavo 2007-05-17 17:21:49 +02:00
Mathieu Lacage b3d1e90132 add benchmark by gustavo 2007-05-17 16:45:03 +02:00
Mathieu Lacage f2c02fe3bb a replacement for the Interface base class 2007-05-17 14:39:54 +02:00
767 changed files with 137969 additions and 20505 deletions

No files matched your search

+29 -9
View File
@@ -1,9 +1,29 @@
.*.orig$
.*\.o$
.*~$
build-dir
build
.*\.sconsign
doc/html.*
doc/latex.*
.lock-wscript
\.rej$
\.orig$
\.o$
~$
^build-dir
^build
^doc/html
^doc/latex
^\.lock-wscript
^\.waf
^doc/introspected-doxygen\.h$
.*\.py[co]$
\.pcap$
^doc/manual/manual/
doc/manual/manual.aux
doc/manual/manual.cp
doc/manual/manual.fn
doc/manual/manual.html
doc/manual/manual.ky
doc/manual/manual.log
doc/manual/manual.pdf
doc/manual/manual.pg
doc/manual/manual.toc
doc/manual/manual.tp
doc/manual/manual.vr
^doc/manual/figures/.*eps
^doc/manual/figures/.*pdf
^doc/manual/figures/.*png
^bindings/python/pybindgen/
+20 -1
View File
@@ -1 +1,20 @@
56928998e05c9c11f5f3aefe79be8d2843e0db88 release ns-3.0.1
56928998e05c9c11f5f3aefe79be8d2843e0db88 ns-3.0.1
7ac5a4b0969b255c4824c926c2b37ef450136ce9 ns-3.0.2
38099dd26e9467b8f49f8632f22789858149a6e7 ns-3.0.3
5701e60bf01a8ac1308945e69001e0cc07948faf ns-3.0.4
08046b6aef37932507696a2f2f427b42d693781e ns-3.0.5
606df29888e7573b825fc891a002f0757166b616 ns-3.0.6
36472385a1cc7c44d34fb7a5951b930010f4e8d2 ns-3.0.7
560a5091e0e6ded47d269e2f2dee780f13950a63 ns-3.0.8
4db981a0d9eb135e3e1c07765cff8d66f7a55cca ns-3.0.9
b5bf2588cde2f1273b1095cc5c83a0c272e55370 ns-3.0.10
ee5e1da76ecc52337f097cd90ebb50a3d49ec541 ns-3.0.11
b17f2928291eec5bf5b1c59a4a5fd583f704ac40 ns-3.0.12
79dba133b5f8a2d6f6f678a22e8519bc155e6a4e ns-3.0.13
8869a79a391f49d0c787f0558cc9329b4e7ee40e ns-3.1-RC1
951296e9a277e14113a0d3ba86a9688b222569ae ns-3.1-RC2
ea16c44eb90db579c83d3434fc8a960be506a7f5 ns-3.1-RC3
42504fb1f7be7817b8be513cdcd3d9bc8f3660e8 ns-3.1
5768685f9fdba9fbf2e9561a840f085142c73575 ns-3.1
dfd634417b8d1896d981b6f44d8f71030611596a ns-3.2-RC1
319eb29611b18998abbad01548825643a8017bcb ns-3.2-RC2
+8 -2
View File
@@ -1,6 +1,12 @@
Raj Bhattarcharjea (raj.b@gatech.edu)
Gustavo Carneiro (gjcarneiro@gmail.com)
Raj Bhattacharjea (raj.b@gatech.edu)
Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
Craig Dowell (craigdo@ee.washington.edu)
Tom Henderson (tomhend@u.washington.edu)
Joe Kopena (tjkopena@cs.drexel.edu)
Mathieu Lacage (mathieu.lacage@sophia.inria.fr)
Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
Federico Maguolo (maguolof@dei.unipd.it)
George F. Riley (riley@ece.gatech.edu)
Guillaume Vu-Brugier (gvubrugier@gmail.com)
Florian Westphal (fw@strlen.de)
+305
View File
@@ -0,0 +1,305 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ns-3 Change Log</title>
</head>
<body>
<h1>
ns-3: API and model change history</h1>
<!--
This ChangeLog is updated in the reverse order
with the most recent changes coming first. Date format: DD-MM-YYYY
-->
<p>
ns-3 is an evolving system and there will be API or behavioral changes
from time to time. Users who try to use scripts or models across
versions of ns-3 may encounter problems at compile time, run time, or
may see the simulation output change. </p>
<p>
We have adopted the development policy that we are going to try to ease
the impact of these changes on users by documenting these changes in a
single place (this file), and not by providing a temporary or permanent
backward-compatibility software layer. </p>
<p>
The goal is that users who encounter a problem when trying to use older
code with newer code should be able to consult this file to find
guidance as to how to fix the problem. For instance, if a method name
or signature has changed, it should be stated what the new replacement
name is. </p>
<p>
Note that users who upgrade the simulator across versions, or who work
directly out of the development tree, may find that simulation output
changes even when the compilation doesn't break, such as when a
simulator default value is changed. Therefore, it is good practice for
_anyone_ using code across multiple ns-3 releases to consult this file,
as well as the RELEASE_NOTES, to understand what has changed over time.
</p>
<p>
This file is a best-effort approach to solving this issue; we will do
our best but can guarantee that there will be things that fall through
the cracks, unfortunately. If you, as a user, can suggest improvements
to this file based on your experience, please contribute a patch or drop
us a note on ns-developers mailing list. </p>
<hr>
<h1>changes from ns-3.1 to ns-3.2</h1>
<h2>new API:</h2>
<li>26-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/5aa65b1ea001">5aa65b1ea001</a></li>
<ul>
<li>
Add multithreaded and real-time simulator implementation. Allows for emulated
net devices running in threads other than the main simulation thread to schedule
events. Allows for pacing the simulation clock at 1x real-time.
</li>
</ul>
</li>
<li>26-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/c69779f5e51e">c69779f5e51e</a></li>
<ul>
<li>
Add threading and synchronization primitives. Enabling technology for
multithreaded simulator implementation.
</li>
</ul>
</li>
<h2>new API in existing classes:</h2>
<ul>
<li>01-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/a18520551cdf">a18520551cdf</a></li>
<ul>
<li>class ArpCache has two new attributes: MaxRetries
and a Drop trace. It also has some new public methods but these are
mostly for internal use.
</ul>
</li>
</ul>
<h2>changes to existing API:</h2>
<li>05-09-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/aa1fb0f43571">aa1fb0f43571</a></li>
<ul>
<li>
Change naming of MTU and packet size attributes in CSMA and Point-to-Point devices<br>
After much discussion it was decided that the preferred way to think about
the different senses of transmission units and encapsulations was to call the
MAC MTU simply MTU and to use the overall packet size as the PHY-level attribute
of interest. See the Doxygen of CsmaNetDevice::SetFrameSize and
PointToPointNetDevice::SetFrameSize for a detailed description.
</li>
</ul>
</li>
<ul>
<li>25-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/e5ab96db540e">e5ab96db540e</a></li>
<ul>
<li>
bug 273: constify packet pointers.<br>
The normal and the promiscuous receive callbacks of the NetDevice API
have been changed from:
<pre>
Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &>
Callback<bool,Ptr<NetDevice>, Ptr<Packet>, uint16_t,
const Address &, const Address &, enum PacketType >
</pre>
to:
<pre>
Callback<bool,Ptr<NetDevice>,Ptr<const Packet>,uint16_t,const Address &>
Callback<bool,Ptr<NetDevice>, Ptr<const Packet>, uint16_t,
const Address &, const Address &, enum PacketType >
</pre>
to avoid the kind of bugs reported in
<a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=273">bug 273</a>.
Users who implement a subclass of the NetDevice base class need to change the signature
of their SetReceiveCallback and SetPromiscReceiveCallback methods.
</li>
</ul>
</li>
<li>04-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/cba7b2b80fe8">cba7b2b80fe8</a></li>
<ul>
<li>
Cleanup of MTU confusion and initialization in CsmaNetDevice<br>
The MTU of the CsmaNetDevice defaulted to 65535. This did not correspond with
the expected MTU found in Ethernet-like devices. Also there was not clear
documentation regarding which MTU was being set. There are two MTU here, one
at the MAC level and one at the PHY level. We split out the MTU setting to make
this more clear and set the default PHY level MTU to 1500 to be more like
Ethernet. The encapsulation mode defaults to LLC/SNAP which then puts the
MAC level MTU at 1492 by default. We allow users to now set the encapsulation
mode, MAC MTU and PHY MTU while keeping the three values consistent. See the
Doxygen of CsmaNetDevice::SetMaxPayloadLength for a detailed description of the
issues and solution.
</li>
</ul>
</li>
<li>21-07-2008; changeset
<a href="
http://code.nsnam.org/ns-3-dev/rev/99698bc858e8">99698bc858e8</a></li>
<ul>
<li> class NetDevice has added a pure virtual method that
must be implemented by all subclasses:
<pre>
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb) = 0;
</pre>
All NetDevices must support this method, and must call this callback
when processing packets in the receive direction (the appropriate place
to call this is device-dependent). An approach to stub this out
temporarily, if you do not care about immediately enabling this
functionality, would be to add this to your device:
<pre>
void
ExampleNetDevice::SetPromiscReceiveCallback
(NetDevice::PromiscReceiveCallback cb)
{
NS_ASSERT_MSG (false, "No implementation yet for
SetPromiscReceiveCallback");
}
</pre>
To implement this properly, consult the CsmaNetDevice for examples of
when the m_promiscRxCallback is called.
</li>
</ul>
</li>
<li>03-07-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/d5f8e5fae1c6">d5f8e5fae1c6</a></li>
<ul>
<li>
Miscellaneous cleanup of Udp Helper API, to fix bug 234
<pre>
class UdpEchoServerHelper
{
public:
- UdpEchoServerHelper ();
- void SetPort (uint16_t port);
+ UdpEchoServerHelper (uint16_t port);
+
+ void SetAttribute (std::string name, const AttributeValue &value);
ApplicationContainer Install (NodeContainer c);
class UdpEchoClientHelper
{
public:
- UdpEchoClientHelper ();
+ UdpEchoClientHelper (Ipv4Address ip, uint16_t port);
- void SetRemote (Ipv4Address ip, uint16_t port);
- void SetAppAttribute (std::string name, const AttributeValue &value);
+ void SetAttribute (std::string name, const AttributeValue &value);
ApplicationContainer Install (NodeContainer c);
</pre>
</li>
</ul>
</li>
<li>03-07-2008; changeset
<a href="
http://code.nsnam.org/ns-3-dev/rev/3cdd9d60f7c7">3cdd9d60f7c7</a></li>
<ul>
<li>
Rename all instances method names using "Set..Parameter" to "Set..Attribute"
(bug 232)
</li>
<li> How to fix your code: Any use of helper API that was using a method
"Set...Parameter()" should be changed to read "Set...Attribute()". e.g.
<pre>
- csma.SetChannelParameter ("DataRate", DataRateValue (5000000));
- csma.SetChannelParameter ("Delay", TimeValue (MilliSeconds (2)));
+ csma.SetChannelAttribute ("DataRate", DataRateValue (5000000));
+ csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
</pre>
</li>
</ul>
</li>
</ul>
<h2>changed behavior:</h2>
<ul>
<li>07-09-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/5d836ab1523b">5d836ab1523b</a></li>
<ul>
<li>
Implement a finite receive buffer for TCP<br>
The native TCP model in TcpSocketImpl did not support a finite receive buffer.
This changeset adds the following functionality in this regard:
<ul>
<li>
Being able to set the receiver buffer size through the attributes system.
</li>
<li>
This receiver buffer size is now correctly exported in the TCP header as the
advertised window. Prior to this changeset, the TCP header advertised window
was set to the maximum size of 2^16 bytes.
window
</li>
<li>
The aforementioned window size is correctly used for flow control, i.e. the
sending TCP will not send more data than available space in the receiver's
buffer.
</li>
<li>
In the case of a receiver window collapse, when a advertised zero-window
packet is received, the sender enters the persist probing state in which
it sends probe packets with one payload byte at exponentially backed-off
intervals up to 60s. The reciever will continue to send advertised
zero-window ACKs of the old data so long as the receiver buffer remains full.
When the receiver window clears up due to an application read, the TCP
will finally ACK the probe byte, and update its advertised window appropriately.
</li>
</ul>
See
<a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=239"> bug 239 </a> for
more.
</li>
</ul>
</li>
<li>07-09-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/7afa66c2b291">7afa66c2b291</a></li>
<ul>
<li>
Add correct FIN exchange behavior during TCP closedown<br>
The behavior of the native TcpSocketImpl TCP model was such that the final
FIN exchange was not correct, i.e. calling Socket::Close didn't send a FIN
packet, and even if it had, the ACK never came back, and even if it had, the
ACK would have incorrect sequence number. All these various problems have been
addressed by this changeset. See
<a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=242"> bug 242 </a> for
more.
</li>
</ul>
</li>
<li> 28-07-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/6f68f1044df1">6f68f1044df1</a>
<ul>
<li>
OLSR: HELLO messages hold time changed to 3*hello
interval from hello interval. This is an important bug fix as
hold time == refresh time was never intentional, as it leads to
instability in neighbor detection.
</ul>
</li>
</ul>
</body>
</html>
+36 -53
View File
@@ -23,7 +23,7 @@ will be contributed by the community in an open collaboration
process.
Contributing to the ns-3 project is still a very informal
process because that process depends heavily on the personality
process because that process depends heavily on the background
of the people involved, the amount of time they can invest
and the type of model they want to work on.
@@ -34,27 +34,28 @@ project. These steps are described in doc/contributing.txt
2) An overview of the ns-3 project
----------------------------------
This package contains the latest version of ns-3 which is aims
This package contains the latest version of ns-3 which aims
at being a replacement for ns-2. Currently, ns-3 provides a
number of very simple network simulation models:
- an ipv4 and udp stack
number of simple network simulation models:
- an ipv4 and tcp and udp stack
- arp support at the bottom of the stack
- point-to-point physical-layer links
- static global and OLSR unicast routing
- point-to-point, CSMA, and Wifi links
- mobility
- OnOff traffic generator
Our focus to date has been on getting an overall software
framework in place. The framework is there to make adding
new models as simple as possible:
- an extensive tracing system can be used to connect
any number of arbitrary trace sources to any number
of trace sinks. This tracing system is decoupled
from the act of serializing the trace events to a
file: users can and should provide their own
trace handling routines.
- an extensive callback-based tracing system
- simple file trace serialization support is included
to both text and pcap files.
- an attribute system for configuring parameters in the
models
- adding new MAC-level models simply requires subclassing
the pair of classes NetDevice and Channel.
@@ -71,32 +72,36 @@ use of these ns-3 libraries.
To build the set of default libraries and the example
programs included in this package, you need to use the
tool 'scons'. Detailed information on how to install
and use scons is included in the file doc/build.txt
tool 'waf'. Detailed information on how use waf is
included in the file doc/build.txt
However, the real quick and dirty way to get started is to
type the command "scons" the the directory which contains
type the command "./waf" the the directory which contains
this README file. The files built will be copied in the
build-dir/dbg-shared/bin and build-dir/dbg-shared/lib
directories. build-dir/dbg-shared/bin will contain
one binary for each of the sample code in the 'samples'
directory and one binary for each of the detailed examples
found in the 'examples' directory.
build/debug or build/optimized.
The current codebase is expected to build and run on the
following set of platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.
- linux x86_64 gcc 4.0
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.1.3, 4.2.1, 3.4.6
- MacOS X ppc and x86
- mingw gcc 3.4.5 (debug only)
- cygwin gcc 3.4.4 (debug only)
The current codebase is expected to fail to build on
the following platforms:
- gcc 3.3 and earlier
- optimized builds on gcc 3.4.4 and 3.4.5
- optimized builds on linux x86 gcc 4.0
- msvc
Other platforms may or may not work: we welcome
patches to improve the portability of the code to these
other platforms.
The following optional features are known to not work on
these platforms:
- mingw: nsc, realtime scheduler
- cygwin: python bindings, nsc
Other platforms may or may not work: we welcome patches to
improve the portability of the code to these other platforms.
4) Running ns-3
---------------
@@ -105,22 +110,17 @@ On recent Linux systems, once you have built ns-3, it
should be easy to run the sample programs with the
following command:
./build-dir/dbg-shared/bin/simple-p2p
./waf --run simple-global-routing
or:
cd build-dir/dbg-shared/bin
./simple-p2p
That program should generate a simple-p2p.tr text
trace file and a set of simple-p2p-xx-xx.pcap binary
pcap trace files, which can be read by tcpdump.
That program should generate a simple-global-routing.tr text
trace file and a set of simple-global-routing-xx-xx.pcap binary
pcap trace files, which can be read by tcpdump -tt -r filename.pcap
5) Getting access to the ns-3 documentation
-------------------------------------------
Once you have verified that your build of ns-3 works by running
the simple-p2p example as outlined in 4) above, it is
the simple-point-to-point example as outlined in 4) above, it is
quite likely that you will want to get started on reading
some ns-3 documentation.
@@ -130,12 +130,7 @@ include some of it in this release for ease of use.
This documentation includes:
- an architecture document which describes a very
high-level view of ns-3: it tries to explain the
use-cases the ns-3 developers really focused on when
doing the initial design and then goes on to explain
the structure of the resulting framework.
See the file doc/architecture.pdf
- a tutorial
- a wiki for user-contributed tips: http://www.nsnam.org/wiki/
@@ -144,17 +139,6 @@ This documentation includes:
as introductory text:
http://www.nsnam.org/doxygen/index.html
If you want to re-generate this documentation, you can
easily do so:
- doc/architecture.pdf is generated from the architecture.tex
file in http://code.nsnam.org/docs
- the doxygen documentation is generated from the doc/doxygen.conf
configuration file. The command "scons doc" will generate it
as doc/html/index.html if you have installed the doxygen tools
(see http://www.doxygen.org)
6) Working with the development version of ns-3
-----------------------------------------------
@@ -166,6 +150,5 @@ mercurial website is usually a good idea if you are not
familiar with it.
If you have successfully installed mercurial, you can get
a copy of the development version with the following
command:
a copy of the development version with the following command:
"hg clone http://code.nsnam.org/ns-3-dev"
+268 -2
View File
@@ -3,9 +3,275 @@
This file contains ns-3 release notes (most recent releases first).
Release 3.0.2 (2007/05/18)
Release 3.2 (pending)
=====================
Availability
------------
This release is immediately available from:
http://www.nsnam.org/releases/ns-3.2.tar.bz2
What is ns-3 ?
--------------
ns-3 is a new discrete-event network simulator designed for supporting network
research and education. ns-3 features a solid, well documented C++ core and
models for TCP/IP (IPv4), several link types including WiFi, and mobility
models.
ns-3 is an open source project released under the GNU GPLv2 license which
allows anyone to use ns-3 without having to pay any license fee or royalties.
ns-3 is actively seeking new contributors to extend the range of supported
models and/or to maintain existing models.
New user-visible features
-------------------------
a) Learning bridge (IEEE 802.1D)
It is now possible to bridge together multiple layer 2 devices to
create larger layer 2 networks. The Wifi and Csma models support
this new mode of operation. (contributed by Gustavo Carneiro)
b) Python bindings
It is now possible to write simulation scripts in python using our
python bindings (contributed by Gustavo Carneiro).
c) Real-time simulator
It is now possible to run simulations synchronized on the real-world
wall-clock time (contributed by Craig Dowell).
d) Network Simulation Craddle
It is now possible to use the Network Simulation Craddle
(http://www.wand.net.nz/~stj2/nsc/) in ns-3 and run simulations
using various versions of kernel TCP network stacks. (contributed
by Florian Westphal as part of his Google Summer of Code work)
e) A statistics framework
Joseph Kopena contributed a statistics framework which can be used
keep track of simulation data in persistent storage across multiple
runs (database and ascii file backends are available).
More information on the wiki:
http://www.nsnam.org/wiki/index.php/Statistical_Framework_for_Network_Simulation
Where to get more information about ns-3
----------------------------------------
All the ns-3 documentation, is accessible from the ns-3 website:
http://www.nsnam.org
Including, tutorials:
http://www.nsnam.org/tutorials.html
Supported platforms
-------------------
ns-3 is regularly tested on the following platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.1.3, 4.2.1, 3.4.6
- MacOS X ppc and x86
- cygwin gcc 3.4.4 (debug only)
Known issues
------------
ns-3 is known to fail on the following platforms:
- gcc 3.3 and earlier
- optimized builds on gcc 3.4.4 and 3.4.5
- optimized builds on linux x86 gcc 4.0.x
- optimized builds on Ubuntu 8.10 alpha 5 x86 gcc4.3.2
- MinGW
The IPv4 API defined in src/node/ipv4.h is expected to undergo major changes
in preparation of the merge of the IPv6 API and implementation.
API changes for this release are documented in CHANGES.html
Future releases
---------------
Our next release, which is expected to happen in 2 to 4 months from now, will
feature the merging of some of our projects currently in development: IPv6,
emulation, and synchronous posix sockets.
Release 3.1 (2008/06/30)
========================
The first ns-3 stable release
-----------------------------
This release is immediately available from:
http://www.nsnam.org/releases/ns-3.1.tar.bz2
We dedicate this initial ns-3 release to our late contributor and friend,
Federico Maguolo.
What is ns-3 ?
--------------
ns-3 is a new discrete-event network simulator designed for supporting network
research and education. ns-3 features a solid, well documented C++ core and
models for TCP/IP (IPv4), several link types including WiFi, and mobility
models.
ns-3 is an open source project released under the GNU GPLv2 license which
allows anyone to use ns-3 without having to pay any license fee or royalties.
ns-3 is actively seeking new contributors to extend the range of supported
models and/or to maintain existing models.
Where to get more information about ns-3
----------------------------------------
All the ns-3 documentation, is accessible from the ns-3 website:
http://www.nsnam.org
Including, tutorials:
http://www.nsnam.org/tutorials.html
Supported platforms
-------------------
ns-3 is regularly tested on the following platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.1.3, 4.2.1, 3.4.6
- MacOS X ppc and x86
- cygwin gcc 3.4.4 (debug only)
Known issues
------------
ns-3 is known to fail on the following platforms:
- gcc 3.3 and earlier
- optimized builds on gcc 3.4.4 and 3.4.5
- optimized builds on linux x86 gcc 4.0.x
The IPv4 API defined in src/node/ipv4.h is expected to undergo major changes
in preparation of the merge of the IPv6 API and implementation.
Future releases
---------------
Our next release, which is expected to happen in 2 to 4 months from now, will
feature the merging of some of our projects currently in development: python
scripting, IPv6, emulation, a statistics framework and synchronous posix
sockets.
Release 3.0.13 (2008/06/02)
===========================
- point to point links generate ppp pcap traces
- point to point links support asymmetrical data rates.
- generate doxygen documentation for all attributes and trace sources
- add ConfigStore and GtkConfigStore to contrib module
- socket API now support tx and rx buffers: implemented for UDP and TCP
- ARP cache now supports per-entry pending queues
- lots of bugfixes and implementation and API cleanups
Warning: among API changes in this release, Application::Start and
Application::Stop now interprets the time argument as a relative
instead of absolute simulation time, to align with how Simulator::Schedule
behaves. Any code that calls these APIs in the middle of the simulation
will need to be adapted.
The API of Simulator::StopAt (time) has also changed. Now it is
called Simulator::Stop (time), and takes a relative time, instead of
absolute.
Release 3.0.12 (2008/04/07)
===========================
- Add Attribute support to the TypeId metadata system and add
attribute support to all in-tree models
- Add a mid-level helper API to build simulation topologies
and perform simple ascii and pcap link-level tracing.
- Large amount of structural changes to accomodate the needs
of the upcoming python bindings
- new rate control algorithm (RRAA) and a jakes propagation model
in the 802.11 model (Federico Maguolo).
- regression test framework added
- TCP delayed acknowledgements and multitasking server
Release 3.0.11 (2008/02/15)
===========================
- Initial port of GTNetS TCP implementation (initial version
that does not support multitasking or delayed acknowledgments yet,
but supports a reliable stream service)
- Changes to the ns-3 object model to create a TypeId-based
metadata system
- lots of bug fixes throughout the system
- tutorial updates
Release 3.0.10 (2008/01/15)
===========================
- Add tutorial document content;
- Valgrind option for "waf" tool;
- Doxygen organization changes.
Release 3.0.9 (2007/12/15)
==========================
- A 802.11 model ported from Yans. This model supports:
* a rather extensive PHY model
* log-distance and friis propagation model
* a simple set of rate control algorithms (ARF, Ideal,
AARF, constant-rate)
* adhoc and infrastructure mode (beacon+assoc)
- Use smart pointer for Packet in the APIs
- A new contrib directory with helper classes:
EventGarbageCollector, Gnuplot
- Tracing support for Applications
- many bugs fixed
Release 3.0.8 (2007/11/15)
==========================
- A simple error model
- Source files for ns-3 tutorial
Release 3.0.7 (2007/10/15)
==========================
- OLSR routing protocol
- A timer class
- Additional mobility models (random waypoint, random 2D walk)
- A mobility visualization tool
Release 3.0.6 (2007/09/15)
==========================
- Static multicast IPv4 routing
- Logging overhaul (NS_LOG macros)
- Refactoring of tracing subsystem
- Tutorial document started
Release 3.0.5 (2007/08/15)
==========================
- Refactoring to support win32-based unix environments (Cygwin, mingw)
- "Packet socket" for allowing applications to access NetDevices directly
- Generalized, polymorphic Address class
- Add CSMA NetDevice model (from Emmanuelle Laprise)
- Modularize IPv4 routing support (from Gustavo Carneiro)
- Add mobility framework and basic mobility models
- Global unicast centralized routing
Release 3.0.4 (2007/07/15)
==========================
- Enable waf as the default build system.
- Per-packet metadata: a system to track which headers and trailers
are added to a packet
- Simplifications to point-to-point devices and channel
Release 3.0.3 (2007/06/15)
==========================
- Enable Waf for release tarballs: users can now build ns-3
with the "waf" tool. See doc/build-waf.txt.
- Add support for variable time precision: it is now possible
to run a simulation with an accuracy which is higher or lower
than a nanosecond: seconds, milliseconds, microseconds,
femtoseconds and picoseconds are supported.
- Optimize and rework the COM framework, solidify the component
manager
- Many small API cleanups
Release 3.0.2 (2007/05/18)
==========================
- Implement a new memory management infrastructure based
on reference counting and smart pointers (the latter being
optional)
@@ -16,7 +282,7 @@ Release 3.0.2 (2007/05/18)
- Add support for a BSD-style socket API for user applications
Release 3.0.1 (2007/03/31)
========================
==========================
- First public release; not yet pre-alpha.
-435
View File
@@ -1,435 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path
import build
version_file = open ('VERSION', 'r')
version = version_file.readline ()
version_file.close ()
version = version.strip ()
ns3 = build.Ns3()
ns3.build_dir = 'build-dir'
ns3.version = version
ns3.name = 'ns3'
ns3.distname = 'ns'
ns3.doxygen_config = os.path.join('doc', 'doxygen.conf')
ns3.add_extra_dist(os.path.join('doc', 'main.txt'))
ns3.add_extra_dist ('doc/architecture.pdf')
ns3.add_extra_dist ('doc/contributing.txt')
ns3.add_extra_dist ('doc/build.txt')
ns3.add_extra_dist ('doc/codingstd.txt')
ns3.add_extra_dist ('doc/mercurial.txt')
ns3.add_extra_dist ('README')
ns3.add_extra_dist ('RELEASE_NOTES')
ns3.add_extra_dist ('AUTHORS')
ns3.add_extra_dist ('VERSION')
#
# The Core module
#
core = build.Ns3Module('core', 'src/core')
ns3.add(core)
core.add_sources([
'reference-list-test.cc',
'callback-test.cc',
'debug.cc',
'assert.cc',
'ptr.cc',
'object.cc',
'test.cc',
'random-variable.cc',
'rng-stream.cc',
'interface.cc',
'uid-manager.cc',
'default-value.cc',
'command-line.cc',
'type-name.cc',
'component-manager.cc',
])
env = Environment()
if env['PLATFORM'] == 'posix' or env['PLATFORM'] == 'darwin' or env['PLATFORM'] == 'cygwin':
core.add_external_dep('pthread')
core.add_sources([
'unix-system-wall-clock-ms.cc',
])
elif env['PLATFORM'] == 'win32':
core.add_sources([
'win32-system-wall-clock-ms.cc',
])
core.add_headers ([
'uid-manager.h',
'singleton.h',
])
core.add_inst_headers([
'system-wall-clock-ms.h',
'reference-list.h',
'callback.h',
'ptr.h',
'object.h',
'debug.h',
'assert.h',
'fatal-error.h',
'test.h',
'random-variable.h',
'rng-stream.h',
'interface.h',
'default-value.h',
'command-line.h',
'type-name.h',
'component-manager.h',
])
def config_core (env, config):
retval = []
# XXX This check is primitive but it should be
# good enough for now.
if config.CheckCHeader ('stdlib.h') == 1:
retval.append ('#define HAVE_STDLIB_H 1')
retval.append ('#define HAVE_GETENV 1')
else:
retval.append ('#undef HAVE_STDLIB_H')
retval.append ('#undef HAVE_GETENV')
return retval
core.add_config (config_core)
#
# The Simu module
#
simu = build.Ns3Module('simulator', 'src/simulator')
ns3.add(simu)
simu.add_dep('core')
simu.add_external_dep('m')
simu.add_sources([
'high-precision.cc',
'time.cc',
'event-id.cc',
'scheduler.cc',
'scheduler-factory.cc',
'scheduler-list.cc',
'scheduler-heap.cc',
'scheduler-map.cc',
'event-impl.cc',
'simulator.cc',
])
simu.add_headers([
'scheduler-heap.h',
'scheduler-map.h',
'scheduler-list.h'
])
simu.add_inst_headers([
'high-precision.h',
'nstime.h',
'event-id.h',
'event-impl.h',
'simulator.h',
'scheduler.h',
'scheduler-factory.h',
'simulation-singleton.h',
])
high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
if high_precision_as_double == 'y':
simu.add_inst_header ('high-precision-double.h')
simu.add_source ('high-precision-double.cc')
else:
simu.add_inst_headers ([
'high-precision-128.h',
'cairo-wideint-private.h'
])
simu.add_sources ([
'high-precision-128.cc',
'cairo-wideint.c',
])
def config_simulator (env, config):
retval = []
high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
if high_precision_as_double == 'y':
retval.append ('#define USE_HIGH_PRECISION_DOUBLE 1')
else:
retval.append ('#undef USE_HIGH_PRECISION_DOUBLE')
if config.CheckCHeader ('stdint.h') == 1:
retval.append ('#define HAVE_STDINT_H 1')
elif config.CheckCHeader ('inttypes.h') == 1:
retval.append ('#define HAVE_INTTYPES_H 1')
elif config.CheckCHeader ('sys/inttypes.h') == 1:
retval.append ('#define HAVE_SYS_INT_TYPES_H 1')
return retval
simu.add_config (config_simulator)
#
# The Common module
#
common = build.Ns3Module('common', 'src/common')
common.add_deps(['core', 'simulator'])
ns3.add(common)
common.add_sources([
'buffer.cc',
'chunk.cc',
'header.cc',
'trailer.cc',
'packet.cc',
'tags.cc',
'pcap-writer.cc',
'variable-tracer-test.cc',
'trace-context.cc',
'trace-resolver.cc',
'callback-trace-source.cc',
'empty-trace-resolver.cc',
'composite-trace-resolver.cc',
'trace-root.cc',
'data-rate.cc',
])
common.add_headers ([
])
common.add_inst_headers([
'buffer.h',
'chunk.h',
'header.h',
'trailer.h',
'tags.h',
'packet.h',
'uv-trace-source.h',
'sv-trace-source.h',
'fv-trace-source.h',
'pcap-writer.h',
'callback-trace-source.h',
'trace-context.h',
'trace-resolver.h',
'empty-trace-resolver.h',
'composite-trace-resolver.h',
'array-trace-resolver.h',
'trace-root.h',
'terminal-trace-resolver.h',
'data-rate.h',
])
node = build.Ns3Module ('node', 'src/node')
ns3.add (node)
node.add_deps (['core', 'common', 'simulator'])
node.add_sources ([
'i-node.cc',
'ipv4-address.cc',
'net-device.cc',
'mac-address.cc',
'llc-snap-header.cc',
'ipv4-route.cc',
'queue.cc',
'drop-tail.cc',
'channel.cc',
'node-list.cc',
'socket.cc',
'i-socket-factory.cc',
'i-udp.cc',
'i-ipv4.cc',
'application.cc',
])
node.add_inst_headers ([
'i-node.h',
'ipv4-address.h',
'net-device.h',
'mac-address.h',
'ipv4-route.h',
'queue.h',
'drop-tail.h',
'llc-snap-header.h',
'channel.h',
'node-list.h',
'socket.h',
'i-socket-factory.h',
'i-udp.h',
'i-ipv4.h',
'application.h',
])
applications = build.Ns3Module ('applications', 'src/applications')
ns3.add (applications)
applications.add_deps (['node'])
applications.add_sources ([
'onoff-application.cc',
])
applications.add_inst_headers ([
'onoff-application.h',
])
inode = build.Ns3Module ('internet-node', 'src/internet-node')
ns3.add (inode)
inode.add_deps (['node'])
inode.add_sources ([
'internet-node.cc',
'i-node-impl.cc',
'l3-demux.cc',
'l3-protocol.cc',
'ipv4-l4-demux.cc',
'ipv4-l4-protocol.cc',
'ipv4-header.cc',
'udp-header.cc',
'ipv4-checksum.cc',
'ipv4-interface.cc',
'ipv4.cc',
'ipv4-end-point.cc',
'udp.cc',
'arp-header.cc',
'arp-cache.cc',
'arp-ipv4-interface.cc',
'arp.cc',
'ipv4-loopback-interface.cc',
'header-utils.cc',
'udp-socket.cc',
'ipv4-end-point-demux.cc',
'i-arp-private.cc',
'i-ipv4-impl.cc',
'i-ipv4-private.cc',
'ascii-trace.cc',
'pcap-trace.cc',
'i-udp-impl.cc',
])
inode.add_headers ([
'ipv4-header.h',
'udp-header.h',
'ipv4-checksum.h',
'arp-header.h',
'arp-cache.h',
'arp.h',
'ipv4-loopback-interface.h',
'l3-demux.h',
'header-utils.h',
'arp-ipv4-interface.h',
'udp-socket.h',
'udp.h',
'i-arp-private.h',
'i-ipv4-impl.h',
'i-ipv4-private.h',
'ipv4.h',
'l3-protocol.h',
'ipv4-l4-protocol.h',
'ipv4-l4-demux.h',
'ipv4-end-point-demux.h',
'ipv4-end-point.h',
'ipv4-header.h',
'udp-header.h',
'ipv4-interface.h',
'sgi-hashmap.h',
'i-node-impl.h',
'i-udp-impl.h',
])
inode.add_inst_headers ([
'internet-node.h',
'ascii-trace.h',
'pcap-trace.h',
])
p2p = build.Ns3Module ('p2p', 'src/devices/p2p')
ns3.add (p2p)
p2p.add_deps (['node'])
p2p.add_sources ([
'p2p-net-device.cc',
'p2p-channel.cc',
'p2p-topology.cc',
])
p2p.add_inst_headers ([
'p2p-net-device.h',
'p2p-channel.h',
'p2p-topology.h',
])
# utils
run_tests = build.Ns3Module('run-tests', 'utils')
ns3.add(run_tests)
run_tests.set_executable()
run_tests.add_deps(['core', 'simulator', 'common'])
run_tests.add_source('run-tests.cc')
bench_packets = build.Ns3Module('bench-packets', 'utils')
#ns3.add(bench_packets)
bench_packets.set_executable()
bench_packets.add_dep('core')
bench_packets.add_source('bench-packets.cc')
bench_simu = build.Ns3Module('bench-simulator', 'utils')
ns3.add(bench_simu)
bench_simu.set_executable()
bench_simu.add_dep('simulator')
bench_simu.add_source('bench-simulator.cc')
replay_simu = build.Ns3Module('replay-simulation', 'utils')
ns3.add(replay_simu)
replay_simu.set_executable()
replay_simu.add_dep('simulator')
replay_simu.add_source('replay-simulation.cc')
# samples
sample_debug = build.Ns3Module('sample-debug', 'samples')
sample_debug.set_executable()
ns3.add(sample_debug)
sample_debug.add_dep('core')
sample_debug.add_source('main-debug.cc')
sample_debug.add_source('main-debug-other.cc')
sample_callback = build.Ns3Module('sample-callback', 'samples')
sample_callback.set_executable()
ns3.add(sample_callback)
sample_callback.add_dep('core')
sample_callback.add_source('main-callback.cc')
sample_ptr = build.Ns3Module('sample-ptr', 'samples')
sample_ptr.set_executable()
ns3.add(sample_ptr)
sample_ptr.add_dep('core')
sample_ptr.add_source('main-ptr.cc')
sample_trace = build.Ns3Module('sample-trace', 'samples')
#ns3.add(sample_trace)
sample_trace.add_dep('common')
sample_trace.set_executable()
sample_trace.add_source('main-trace.cc')
sample_simu = build.Ns3Module('sample-simulator', 'samples')
ns3.add(sample_simu)
sample_simu.set_executable()
sample_simu.add_dep('simulator')
sample_simu.add_source('main-simulator.cc')
sample_packet = build.Ns3Module('sample-packet', 'samples')
ns3.add(sample_packet)
sample_packet.set_executable()
sample_packet.add_dep('common')
sample_packet.add_source('main-packet.cc')
sample_test = build.Ns3Module('sample-test', 'samples')
sample_test.set_executable()
ns3.add(sample_test)
sample_test.add_dep('core')
sample_test.add_source('main-test.cc')
sample_simple = build.Ns3Module('sample-simple', 'samples')
sample_simple.set_executable()
ns3.add(sample_simple)
sample_simple.add_deps(['core', 'simulator', 'node', 'internet-node'])
sample_simple.add_source('main-simple.cc')
sample_sp2p = build.Ns3Module('sample-simple-p2p', 'samples')
sample_sp2p.set_executable()
#n3.add(sample_sp2p)
sample_sp2p.add_deps(['core', 'simulator', 'node', 'internet-node', 'p2p'])
sample_sp2p.add_source('main-simple-p2p.cc')
sample_default_value = build.Ns3Module('sample-default-value', 'samples')
sample_default_value.set_executable()
ns3.add(sample_default_value)
sample_default_value.add_deps(['core', 'simulator', 'node', 'p2p'])
sample_default_value.add_source('main-default-value.cc')
# examples
example_simple_p2p = build.Ns3Module('simple-p2p', 'examples')
example_simple_p2p.set_executable()
ns3.add(example_simple_p2p)
example_simple_p2p.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node', 'applications'])
example_simple_p2p.add_source('simple-p2p.cc')
ns3.generate_dependencies()
+1 -1
View File
@@ -1 +1 @@
3.0.2
3-dev
+13
View File
@@ -0,0 +1,13 @@
callback_classes = [
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType'],
['void', 'ns3::Ptr<ns3::Packet>', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Packet>', 'double', 'ns3::WifiMode', 'ns3::WifiPreamble', 'ns3::empty', 'ns3::empty'],
]
@@ -0,0 +1,13 @@
from pybindgen import Module, FileCodeSink, write_preamble, param, retval
def register_types(module):
module.add_class('MyClass')
def register_methods(root_module):
MyClass = root_module['MyClass']
MyClass.add_constructor([], visibility='public')
MyClass.add_constructor([param('double', 's'), param('double', 'l'), param('double', 'mean')], visibility='public')
def register_functions(module):
module.add_function('SomeFunction', 'int', [param('int', 'xpto')])
+4
View File
@@ -0,0 +1,4 @@
from _ns3 import *
+267
View File
@@ -0,0 +1,267 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## bridge-net-device.h: ns3::BridgeNetDevice [class]
module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice'])
## bridge-channel.h: ns3::BridgeChannel [class]
module.add_class('BridgeChannel', parent=root_module['ns3::Channel'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice'])
register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel'])
return
def register_Ns3BridgeNetDevice_methods(root_module, cls):
## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice(ns3::BridgeNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::BridgeNetDevice const &', 'arg0')])
## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice() [constructor]
cls.add_constructor([])
## bridge-net-device.h: void ns3::BridgeNetDevice::AddBridgePort(ns3::Ptr<ns3::NetDevice> bridgePort) [member function]
cls.add_method('AddBridgePort',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')])
## bridge-net-device.h: void ns3::BridgeNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
[param('std::string const', 'name')],
is_virtual=True)
## bridge-net-device.h: std::string ns3::BridgeNetDevice::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_virtual=True)
## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Ptr<ns3::Channel> ns3::BridgeNetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_virtual=True)
## bridge-net-device.h: uint16_t ns3::BridgeNetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('SetLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast() const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## bridge-net-device.h: ns3::Ptr<ns3::Node> ns3::BridgeNetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::ReceiveFromDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function]
cls.add_method('ReceiveFromDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< const ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'destination'), param('ns3::NetDevice::PacketType', 'packetType')],
visibility='protected')
## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardUnicast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
cls.add_method('ForwardUnicast',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< const ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')],
visibility='protected')
## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardBroadcast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<const ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function]
cls.add_method('ForwardBroadcast',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< const ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')],
visibility='protected')
## bridge-net-device.h: void ns3::BridgeNetDevice::Learn(ns3::Mac48Address source, ns3::Ptr<ns3::NetDevice> port) [member function]
cls.add_method('Learn',
'void',
[param('ns3::Mac48Address', 'source'), param('ns3::Ptr< ns3::NetDevice >', 'port')],
visibility='protected')
## bridge-net-device.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeNetDevice::GetLearnedState(ns3::Mac48Address source) [member function]
cls.add_method('GetLearnedState',
'ns3::Ptr< ns3::NetDevice >',
[param('ns3::Mac48Address', 'source')],
visibility='protected')
return
def register_Ns3BridgeChannel_methods(root_module, cls):
## bridge-channel.h: ns3::BridgeChannel::BridgeChannel(ns3::BridgeChannel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::BridgeChannel const &', 'arg0')])
## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## bridge-channel.h: ns3::BridgeChannel::BridgeChannel() [constructor]
cls.add_constructor([])
## bridge-channel.h: void ns3::BridgeChannel::AddChannel(ns3::Ptr<ns3::Channel> bridgedChannel) [member function]
cls.add_method('AddChannel',
'void',
[param('ns3::Ptr< ns3::Channel >', 'bridgedChannel')])
## bridge-channel.h: uint32_t ns3::BridgeChannel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True, is_virtual=True)
## bridge-channel.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeChannel::GetDevice(uint32_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large. Load diff
+204
View File
@@ -0,0 +1,204 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## gnuplot.h: ns3::Gnuplot [class]
module.add_class('Gnuplot')
## event-garbage-collector.h: ns3::EventGarbageCollector [class]
module.add_class('EventGarbageCollector')
## gtk-config-store.h: ns3::GtkConfigStore [class]
module.add_class('GtkConfigStore')
## gnuplot.h: ns3::GnuplotDataset [class]
module.add_class('GnuplotDataset')
## gnuplot.h: ns3::GnuplotDataset::Style [enumeration]
module.add_enum('Style', ['LINES', 'POINTS', 'LINES_POINTS', 'DOTS', 'IMPULSES', 'STEPS', 'FSTEPS', 'HISTEPS'], outer_class=root_module['ns3::GnuplotDataset'])
## gnuplot.h: ns3::GnuplotDataset::ErrorBars [enumeration]
module.add_enum('ErrorBars', ['NONE', 'X', 'Y', 'XY'], outer_class=root_module['ns3::GnuplotDataset'])
## config-store.h: ns3::ConfigStore [class]
module.add_class('ConfigStore', parent=root_module['ns3::ObjectBase'])
## delay-jitter-estimation.h: ns3::DelayJitterEstimation [class]
module.add_class('DelayJitterEstimation')
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3Gnuplot_methods(root_module, root_module['ns3::Gnuplot'])
register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
register_Ns3GtkConfigStore_methods(root_module, root_module['ns3::GtkConfigStore'])
register_Ns3GnuplotDataset_methods(root_module, root_module['ns3::GnuplotDataset'])
register_Ns3ConfigStore_methods(root_module, root_module['ns3::ConfigStore'])
register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation'])
return
def register_Ns3Gnuplot_methods(root_module, cls):
## gnuplot.h: ns3::Gnuplot::Gnuplot(ns3::Gnuplot const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Gnuplot const &', 'arg0')])
## gnuplot.h: ns3::Gnuplot::Gnuplot(std::string pngFilename) [constructor]
cls.add_constructor([param('std::string', 'pngFilename')])
## gnuplot.h: void ns3::Gnuplot::SetLegend(std::string xLegend, std::string yLegend) [member function]
cls.add_method('SetLegend',
'void',
[param('std::string', 'xLegend'), param('std::string', 'yLegend')])
## gnuplot.h: void ns3::Gnuplot::AddDataset(ns3::GnuplotDataset const & dataset) [member function]
cls.add_method('AddDataset',
'void',
[param('ns3::GnuplotDataset const &', 'dataset')])
## gnuplot.h: void ns3::Gnuplot::GenerateOutput(std::ostream & os) [member function]
cls.add_method('GenerateOutput',
'void',
[param('std::ostream &', 'os')])
return
def register_Ns3EventGarbageCollector_methods(root_module, cls):
## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [copy constructor]
cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')])
## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector() [constructor]
cls.add_constructor([])
## event-garbage-collector.h: void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function]
cls.add_method('Track',
'void',
[param('ns3::EventId', 'event')])
return
def register_Ns3GtkConfigStore_methods(root_module, cls):
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore(ns3::GtkConfigStore const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GtkConfigStore const &', 'arg0')])
## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore() [constructor]
cls.add_constructor([])
## gtk-config-store.h: void ns3::GtkConfigStore::Configure() [member function]
cls.add_method('Configure',
'void',
[])
return
def register_Ns3GnuplotDataset_methods(root_module, cls):
## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset(ns3::GnuplotDataset const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GnuplotDataset const &', 'arg0')])
## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset() [constructor]
cls.add_constructor([])
## gnuplot.h: ns3::GnuplotDataset::GnuplotDataset(std::string title) [constructor]
cls.add_constructor([param('std::string', 'title')])
## gnuplot.h: void ns3::GnuplotDataset::SetStyle(ns3::GnuplotDataset::Style style) [member function]
cls.add_method('SetStyle',
'void',
[param('ns3::GnuplotDataset::Style', 'style')])
## gnuplot.h: void ns3::GnuplotDataset::SetErrorBars(ns3::GnuplotDataset::ErrorBars errorBars) [member function]
cls.add_method('SetErrorBars',
'void',
[param('ns3::GnuplotDataset::ErrorBars', 'errorBars')])
## gnuplot.h: void ns3::GnuplotDataset::Add(double x, double y) [member function]
cls.add_method('Add',
'void',
[param('double', 'x'), param('double', 'y')])
## gnuplot.h: void ns3::GnuplotDataset::Add(double x, double y, double errorDelta) [member function]
cls.add_method('Add',
'void',
[param('double', 'x'), param('double', 'y'), param('double', 'errorDelta')])
return
def register_Ns3ConfigStore_methods(root_module, cls):
## config-store.h: ns3::ConfigStore::ConfigStore(ns3::ConfigStore const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ConfigStore const &', 'arg0')])
## config-store.h: static ns3::TypeId ns3::ConfigStore::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## config-store.h: ns3::TypeId ns3::ConfigStore::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## config-store.h: ns3::ConfigStore::ConfigStore() [constructor]
cls.add_constructor([])
## config-store.h: void ns3::ConfigStore::Configure() [member function]
cls.add_method('Configure',
'void',
[])
return
def register_Ns3DelayJitterEstimation_methods(root_module, cls):
## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [copy constructor]
cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')])
## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation() [constructor]
cls.add_constructor([])
## delay-jitter-estimation.h: static void ns3::DelayJitterEstimation::PrepareTx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PrepareTx',
'void',
[param('ns3::Ptr< const ns3::Packet >', 'packet')],
is_static=True)
## delay-jitter-estimation.h: void ns3::DelayJitterEstimation::RecordRx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('RecordRx',
'void',
[param('ns3::Ptr< const ns3::Packet >', 'packet')])
## delay-jitter-estimation.h: ns3::Time ns3::DelayJitterEstimation::GetLastDelay() const [member function]
cls.add_method('GetLastDelay',
'ns3::Time',
[],
is_const=True)
## delay-jitter-estimation.h: ns3::Time ns3::DelayJitterEstimation::GetLastJitter() const [member function]
cls.add_method('GetLastJitter',
'ns3::Time',
[],
is_const=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large. Load diff
+437
View File
@@ -0,0 +1,437 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## csma-channel.h: ns3::WireState [enumeration]
module.add_enum('WireState', ['IDLE', 'TRANSMITTING', 'PROPAGATING'])
## csma-channel.h: ns3::CsmaDeviceRec [class]
module.add_class('CsmaDeviceRec')
## backoff.h: ns3::Backoff [class]
module.add_class('Backoff')
## csma-channel.h: ns3::CsmaChannel [class]
module.add_class('CsmaChannel', parent=root_module['ns3::Channel'])
## csma-net-device.h: ns3::CsmaNetDevice [class]
module.add_class('CsmaNetDevice', parent=root_module['ns3::NetDevice'])
## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode [enumeration]
module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3CsmaDeviceRec_methods(root_module, root_module['ns3::CsmaDeviceRec'])
register_Ns3Backoff_methods(root_module, root_module['ns3::Backoff'])
register_Ns3CsmaChannel_methods(root_module, root_module['ns3::CsmaChannel'])
register_Ns3CsmaNetDevice_methods(root_module, root_module['ns3::CsmaNetDevice'])
return
def register_Ns3CsmaDeviceRec_methods(root_module, cls):
## csma-channel.h: ns3::CsmaDeviceRec::devicePtr [variable]
cls.add_instance_attribute('devicePtr', 'ns3::Ptr< ns3::CsmaNetDevice >', is_const=False)
## csma-channel.h: ns3::CsmaDeviceRec::active [variable]
cls.add_instance_attribute('active', 'bool', is_const=False)
## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::CsmaDeviceRec const & arg0) [copy constructor]
cls.add_constructor([param('ns3::CsmaDeviceRec const &', 'arg0')])
## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec() [constructor]
cls.add_constructor([])
## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::Ptr<ns3::CsmaNetDevice> device) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
## csma-channel.h: bool ns3::CsmaDeviceRec::IsActive() [member function]
cls.add_method('IsActive',
'bool',
[])
return
def register_Ns3Backoff_methods(root_module, cls):
## backoff.h: ns3::Backoff::m_minSlots [variable]
cls.add_instance_attribute('m_minSlots', 'uint32_t', is_const=False)
## backoff.h: ns3::Backoff::m_maxSlots [variable]
cls.add_instance_attribute('m_maxSlots', 'uint32_t', is_const=False)
## backoff.h: ns3::Backoff::m_ceiling [variable]
cls.add_instance_attribute('m_ceiling', 'uint32_t', is_const=False)
## backoff.h: ns3::Backoff::m_maxRetries [variable]
cls.add_instance_attribute('m_maxRetries', 'uint32_t', is_const=False)
## backoff.h: ns3::Backoff::m_slotTime [variable]
cls.add_instance_attribute('m_slotTime', 'ns3::Time', is_const=False)
## backoff.h: ns3::Backoff::Backoff(ns3::Backoff const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Backoff const &', 'arg0')])
## backoff.h: ns3::Backoff::Backoff() [constructor]
cls.add_constructor([])
## backoff.h: ns3::Backoff::Backoff(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries) [constructor]
cls.add_constructor([param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'ceiling'), param('uint32_t', 'maxRetries')])
## backoff.h: ns3::Time ns3::Backoff::GetBackoffTime() [member function]
cls.add_method('GetBackoffTime',
'ns3::Time',
[])
## backoff.h: void ns3::Backoff::ResetBackoffTime() [member function]
cls.add_method('ResetBackoffTime',
'void',
[])
## backoff.h: bool ns3::Backoff::MaxRetriesReached() [member function]
cls.add_method('MaxRetriesReached',
'bool',
[])
## backoff.h: void ns3::Backoff::IncrNumRetries() [member function]
cls.add_method('IncrNumRetries',
'void',
[])
return
def register_Ns3CsmaChannel_methods(root_module, cls):
## csma-channel.h: ns3::CsmaChannel::CsmaChannel(ns3::CsmaChannel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::CsmaChannel const &', 'arg0')])
## csma-channel.h: static ns3::TypeId ns3::CsmaChannel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## csma-channel.h: ns3::CsmaChannel::CsmaChannel() [constructor]
cls.add_constructor([])
## csma-channel.h: int32_t ns3::CsmaChannel::Attach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
cls.add_method('Attach',
'int32_t',
[param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
## csma-channel.h: bool ns3::CsmaChannel::Detach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
cls.add_method('Detach',
'bool',
[param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
## csma-channel.h: bool ns3::CsmaChannel::Detach(uint32_t deviceId) [member function]
cls.add_method('Detach',
'bool',
[param('uint32_t', 'deviceId')])
## csma-channel.h: bool ns3::CsmaChannel::Reattach(uint32_t deviceId) [member function]
cls.add_method('Reattach',
'bool',
[param('uint32_t', 'deviceId')])
## csma-channel.h: bool ns3::CsmaChannel::Reattach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
cls.add_method('Reattach',
'bool',
[param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
## csma-channel.h: bool ns3::CsmaChannel::TransmitStart(ns3::Ptr<ns3::Packet> p, uint32_t srcId) [member function]
cls.add_method('TransmitStart',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'srcId')])
## csma-channel.h: bool ns3::CsmaChannel::TransmitEnd() [member function]
cls.add_method('TransmitEnd',
'bool',
[])
## csma-channel.h: void ns3::CsmaChannel::PropagationCompleteEvent() [member function]
cls.add_method('PropagationCompleteEvent',
'void',
[])
## csma-channel.h: int32_t ns3::CsmaChannel::GetDeviceNum(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
cls.add_method('GetDeviceNum',
'int32_t',
[param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
## csma-channel.h: ns3::WireState ns3::CsmaChannel::GetState() [member function]
cls.add_method('GetState',
'ns3::WireState',
[])
## csma-channel.h: bool ns3::CsmaChannel::IsBusy() [member function]
cls.add_method('IsBusy',
'bool',
[])
## csma-channel.h: bool ns3::CsmaChannel::IsActive(uint32_t deviceId) [member function]
cls.add_method('IsActive',
'bool',
[param('uint32_t', 'deviceId')])
## csma-channel.h: uint32_t ns3::CsmaChannel::GetNumActDevices() [member function]
cls.add_method('GetNumActDevices',
'uint32_t',
[])
## csma-channel.h: uint32_t ns3::CsmaChannel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True, is_virtual=True)
## csma-channel.h: ns3::Ptr<ns3::NetDevice> ns3::CsmaChannel::GetDevice(uint32_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
## csma-channel.h: ns3::Ptr<ns3::CsmaNetDevice> ns3::CsmaChannel::GetCsmaDevice(uint32_t i) const [member function]
cls.add_method('GetCsmaDevice',
'ns3::Ptr< ns3::CsmaNetDevice >',
[param('uint32_t', 'i')],
is_const=True)
## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function]
cls.add_method('GetDataRate',
'ns3::DataRate',
[],
is_virtual=True)
## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function]
cls.add_method('GetDelay',
'ns3::Time',
[],
is_virtual=True)
return
def register_Ns3CsmaNetDevice_methods(root_module, cls):
## csma-net-device.h: static ns3::TypeId ns3::CsmaNetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## csma-net-device.h: ns3::CsmaNetDevice::CsmaNetDevice() [constructor]
cls.add_constructor([])
## csma-net-device.h: void ns3::CsmaNetDevice::SetInterframeGap(ns3::Time t) [member function]
cls.add_method('SetInterframeGap',
'void',
[param('ns3::Time', 't')])
## csma-net-device.h: void ns3::CsmaNetDevice::SetBackoffParams(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t maxRetries, uint32_t ceiling) [member function]
cls.add_method('SetBackoffParams',
'void',
[param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'maxRetries'), param('uint32_t', 'ceiling')])
## csma-net-device.h: bool ns3::CsmaNetDevice::Attach(ns3::Ptr<ns3::CsmaChannel> ch) [member function]
cls.add_method('Attach',
'bool',
[param('ns3::Ptr< ns3::CsmaChannel >', 'ch')])
## csma-net-device.h: void ns3::CsmaNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function]
cls.add_method('SetQueue',
'void',
[param('ns3::Ptr< ns3::Queue >', 'queue')])
## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function]
cls.add_method('SetReceiveErrorModel',
'void',
[param('ns3::Ptr< ns3::ErrorModel >', 'em')])
## csma-net-device.h: void ns3::CsmaNetDevice::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ptr<ns3::CsmaNetDevice> sender) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::CsmaNetDevice >', 'sender')])
## csma-net-device.h: bool ns3::CsmaNetDevice::IsSendEnabled() [member function]
cls.add_method('IsSendEnabled',
'bool',
[])
## csma-net-device.h: void ns3::CsmaNetDevice::SetSendEnable(bool enable) [member function]
cls.add_method('SetSendEnable',
'void',
[param('bool', 'enable')])
## csma-net-device.h: bool ns3::CsmaNetDevice::IsReceiveEnabled() [member function]
cls.add_method('IsReceiveEnabled',
'bool',
[])
## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveEnable(bool enable) [member function]
cls.add_method('SetReceiveEnable',
'void',
[param('bool', 'enable')])
## csma-net-device.h: void ns3::CsmaNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Mac48Address', 'addr')])
## csma-net-device.h: void ns3::CsmaNetDevice::SetFrameSize(uint16_t frameSize) [member function]
cls.add_method('SetFrameSize',
'void',
[param('uint16_t', 'frameSize')])
## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetFrameSize() const [member function]
cls.add_method('GetFrameSize',
'uint16_t',
[],
is_const=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetEncapsulationMode(ns3::CsmaNetDevice::EncapsulationMode mode) [member function]
cls.add_method('SetEncapsulationMode',
'void',
[param('ns3::CsmaNetDevice::EncapsulationMode', 'mode')])
## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode ns3::CsmaNetDevice::GetEncapsulationMode() [member function]
cls.add_method('GetEncapsulationMode',
'ns3::CsmaNetDevice::EncapsulationMode',
[])
## csma-net-device.h: void ns3::CsmaNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
[param('std::string const', 'name')],
is_virtual=True)
## csma-net-device.h: std::string ns3::CsmaNetDevice::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_virtual=True)
## csma-net-device.h: uint32_t ns3::CsmaNetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Ptr<ns3::Channel> ns3::CsmaNetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_virtual=True)
## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('SetLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast() const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## csma-net-device.h: ns3::Ptr<ns3::Node> ns3::CsmaNetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: void ns3::CsmaNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## csma-net-device.h: ns3::Ptr<ns3::Queue> ns3::CsmaNetDevice::GetQueue() const [member function]
cls.add_method('GetQueue',
'ns3::Ptr< ns3::Queue >',
[],
is_const=True, visibility='protected')
## csma-net-device.h: void ns3::CsmaNetDevice::AddHeader(ns3::Ptr<ns3::Packet> p, ns3::Mac48Address source, ns3::Mac48Address dest, uint16_t protocolNumber) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Mac48Address', 'source'), param('ns3::Mac48Address', 'dest'), param('uint16_t', 'protocolNumber')],
visibility='protected')
## csma-net-device.h: bool ns3::CsmaNetDevice::ProcessHeader(ns3::Ptr<ns3::Packet> p, uint16_t & param) [member function]
cls.add_method('ProcessHeader',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t &', 'param')],
visibility='protected')
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
@@ -0,0 +1,280 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## global-route-manager.h: ns3::GlobalRouteManager [class]
module.add_class('GlobalRouteManager')
## global-router-interface.h: ns3::GlobalRoutingLSA [class]
module.add_class('GlobalRoutingLSA')
## global-router-interface.h: ns3::GlobalRoutingLSA::LSType [enumeration]
module.add_enum('LSType', ['Unknown', 'RouterLSA', 'NetworkLSA', 'SummaryLSA', 'SummaryLSA_ASBR', 'ASExternalLSAs'], outer_class=root_module['ns3::GlobalRoutingLSA'])
## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus [enumeration]
module.add_enum('SPFStatus', ['LSA_SPF_NOT_EXPLORED', 'LSA_SPF_CANDIDATE', 'LSA_SPF_IN_SPFTREE'], outer_class=root_module['ns3::GlobalRoutingLSA'])
## global-router-interface.h: ns3::GlobalRoutingLinkRecord [class]
module.add_class('GlobalRoutingLinkRecord')
## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType [enumeration]
module.add_enum('LinkType', ['Unknown', 'PointToPoint', 'TransitNetwork', 'StubNetwork', 'VirtualLink'], outer_class=root_module['ns3::GlobalRoutingLinkRecord'])
## global-router-interface.h: ns3::GlobalRouter [class]
module.add_class('GlobalRouter', is_singleton=True, parent=root_module['ns3::Object'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3GlobalRouteManager_methods(root_module, root_module['ns3::GlobalRouteManager'])
register_Ns3GlobalRoutingLSA_methods(root_module, root_module['ns3::GlobalRoutingLSA'])
register_Ns3GlobalRoutingLinkRecord_methods(root_module, root_module['ns3::GlobalRoutingLinkRecord'])
register_Ns3GlobalRouter_methods(root_module, root_module['ns3::GlobalRouter'])
return
def register_Ns3GlobalRouteManager_methods(root_module, cls):
## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables() [member function]
cls.add_method('PopulateRoutingTables',
'void',
[],
is_static=True)
## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
cls.add_method('AllocateRouterId',
'uint32_t',
[],
is_static=True)
return
def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA() [constructor]
cls.add_constructor([])
## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA::SPFStatus status, ns3::Ipv4Address linkStateId, ns3::Ipv4Address advertisingRtr) [constructor]
cls.add_constructor([param('ns3::GlobalRoutingLSA::SPFStatus', 'status'), param('ns3::Ipv4Address', 'linkStateId'), param('ns3::Ipv4Address', 'advertisingRtr')])
## global-router-interface.h: ns3::GlobalRoutingLSA::GlobalRoutingLSA(ns3::GlobalRoutingLSA & lsa) [constructor]
cls.add_constructor([param('ns3::GlobalRoutingLSA &', 'lsa')])
## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddAttachedRouter(ns3::Ipv4Address addr) [member function]
cls.add_method('AddAttachedRouter',
'uint32_t',
[param('ns3::Ipv4Address', 'addr')])
## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::AddLinkRecord(ns3::GlobalRoutingLinkRecord * lr) [member function]
cls.add_method('AddLinkRecord',
'uint32_t',
[param('ns3::GlobalRoutingLinkRecord *', 'lr')])
## global-router-interface.h: void ns3::GlobalRoutingLSA::ClearLinkRecords() [member function]
cls.add_method('ClearLinkRecords',
'void',
[])
## global-router-interface.h: void ns3::GlobalRoutingLSA::CopyLinkRecords(ns3::GlobalRoutingLSA const & lsa) [member function]
cls.add_method('CopyLinkRecords',
'void',
[param('ns3::GlobalRoutingLSA const &', 'lsa')])
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAdvertisingRouter() const [member function]
cls.add_method('GetAdvertisingRouter',
'ns3::Ipv4Address',
[],
is_const=True)
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetAttachedRouter(uint32_t n) const [member function]
cls.add_method('GetAttachedRouter',
'ns3::Ipv4Address',
[param('uint32_t', 'n')],
is_const=True)
## global-router-interface.h: ns3::GlobalRoutingLSA::LSType ns3::GlobalRoutingLSA::GetLSType() const [member function]
cls.add_method('GetLSType',
'ns3::GlobalRoutingLSA::LSType',
[],
is_const=True)
## global-router-interface.h: ns3::GlobalRoutingLinkRecord * ns3::GlobalRoutingLSA::GetLinkRecord(uint32_t n) const [member function]
cls.add_method('GetLinkRecord',
'ns3::GlobalRoutingLinkRecord *',
[param('uint32_t', 'n')],
is_const=True)
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLSA::GetLinkStateId() const [member function]
cls.add_method('GetLinkStateId',
'ns3::Ipv4Address',
[],
is_const=True)
## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNAttachedRouters() const [member function]
cls.add_method('GetNAttachedRouters',
'uint32_t',
[],
is_const=True)
## global-router-interface.h: uint32_t ns3::GlobalRoutingLSA::GetNLinkRecords() const [member function]
cls.add_method('GetNLinkRecords',
'uint32_t',
[],
is_const=True)
## global-router-interface.h: ns3::Ipv4Mask ns3::GlobalRoutingLSA::GetNetworkLSANetworkMask() const [member function]
cls.add_method('GetNetworkLSANetworkMask',
'ns3::Ipv4Mask',
[],
is_const=True)
## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus() const [member function]
cls.add_method('GetStatus',
'ns3::GlobalRoutingLSA::SPFStatus',
[],
is_const=True)
## global-router-interface.h: bool ns3::GlobalRoutingLSA::IsEmpty() const [member function]
cls.add_method('IsEmpty',
'bool',
[],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLSA::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLSA::SetAdvertisingRouter(ns3::Ipv4Address rtr) [member function]
cls.add_method('SetAdvertisingRouter',
'void',
[param('ns3::Ipv4Address', 'rtr')])
## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLSType(ns3::GlobalRoutingLSA::LSType typ) [member function]
cls.add_method('SetLSType',
'void',
[param('ns3::GlobalRoutingLSA::LSType', 'typ')])
## global-router-interface.h: void ns3::GlobalRoutingLSA::SetLinkStateId(ns3::Ipv4Address addr) [member function]
cls.add_method('SetLinkStateId',
'void',
[param('ns3::Ipv4Address', 'addr')])
## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNetworkLSANetworkMask(ns3::Ipv4Mask mask) [member function]
cls.add_method('SetNetworkLSANetworkMask',
'void',
[param('ns3::Ipv4Mask', 'mask')])
## global-router-interface.h: void ns3::GlobalRoutingLSA::SetStatus(ns3::GlobalRoutingLSA::SPFStatus status) [member function]
cls.add_method('SetStatus',
'void',
[param('ns3::GlobalRoutingLSA::SPFStatus', 'status')])
cls.add_output_stream_operator()
return
def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls):
## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GlobalRoutingLinkRecord const &', 'arg0')])
## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord() [constructor]
cls.add_constructor([])
## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord::LinkType linkType, ns3::Ipv4Address linkId, ns3::Ipv4Address linkData, uint16_t metric) [constructor]
cls.add_constructor([param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType'), param('ns3::Ipv4Address', 'linkId'), param('ns3::Ipv4Address', 'linkData'), param('uint16_t', 'metric')])
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkId() const [member function]
cls.add_method('GetLinkId',
'ns3::Ipv4Address',
[],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkId(ns3::Ipv4Address addr) [member function]
cls.add_method('SetLinkId',
'void',
[param('ns3::Ipv4Address', 'addr')])
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRoutingLinkRecord::GetLinkData() const [member function]
cls.add_method('GetLinkData',
'ns3::Ipv4Address',
[],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkData(ns3::Ipv4Address addr) [member function]
cls.add_method('SetLinkData',
'void',
[param('ns3::Ipv4Address', 'addr')])
## global-router-interface.h: ns3::GlobalRoutingLinkRecord::LinkType ns3::GlobalRoutingLinkRecord::GetLinkType() const [member function]
cls.add_method('GetLinkType',
'ns3::GlobalRoutingLinkRecord::LinkType',
[],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetLinkType(ns3::GlobalRoutingLinkRecord::LinkType linkType) [member function]
cls.add_method('SetLinkType',
'void',
[param('ns3::GlobalRoutingLinkRecord::LinkType', 'linkType')])
## global-router-interface.h: uint16_t ns3::GlobalRoutingLinkRecord::GetMetric() const [member function]
cls.add_method('GetMetric',
'uint16_t',
[],
is_const=True)
## global-router-interface.h: void ns3::GlobalRoutingLinkRecord::SetMetric(uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint16_t', 'metric')])
return
def register_Ns3GlobalRouter_methods(root_module, cls):
## global-router-interface.h: static ns3::TypeId ns3::GlobalRouter::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## global-router-interface.h: ns3::GlobalRouter::GlobalRouter() [constructor]
cls.add_constructor([])
## global-router-interface.h: ns3::Ipv4Address ns3::GlobalRouter::GetRouterId() const [member function]
cls.add_method('GetRouterId',
'ns3::Ipv4Address',
[],
is_const=True)
## global-router-interface.h: uint32_t ns3::GlobalRouter::DiscoverLSAs() [member function]
cls.add_method('DiscoverLSAs',
'uint32_t',
[])
## global-router-interface.h: uint32_t ns3::GlobalRouter::GetNumLSAs() const [member function]
cls.add_method('GetNumLSAs',
'uint32_t',
[],
is_const=True)
## global-router-interface.h: bool ns3::GlobalRouter::GetLSA(uint32_t n, ns3::GlobalRoutingLSA & lsa) const [member function]
cls.add_method('GetLSA',
'bool',
[param('uint32_t', 'n'), param('ns3::GlobalRoutingLSA &', 'lsa')],
is_const=True)
## global-router-interface.h: void ns3::GlobalRouter::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+746
View File
@@ -0,0 +1,746 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## mobility-helper.h: ns3::MobilityHelper [class]
module.add_class('MobilityHelper', allow_subclassing=False)
## internet-stack-helper.h: ns3::InternetStackHelper [class]
module.add_class('InternetStackHelper', allow_subclassing=False)
## node-container.h: ns3::NodeContainer [class]
module.add_class('NodeContainer')
## point-to-point-helper.h: ns3::PointToPointHelper [class]
module.add_class('PointToPointHelper', allow_subclassing=False)
## net-device-container.h: ns3::NetDeviceContainer [class]
module.add_class('NetDeviceContainer')
## csma-helper.h: ns3::CsmaHelper [class]
module.add_class('CsmaHelper', allow_subclassing=False)
## udp-echo-helper.h: ns3::UdpEchoServerHelper [class]
module.add_class('UdpEchoServerHelper', allow_subclassing=False)
## olsr-helper.h: ns3::OlsrHelper [class]
module.add_class('OlsrHelper', allow_subclassing=False)
## packet-socket-helper.h: ns3::PacketSocketHelper [class]
module.add_class('PacketSocketHelper', allow_subclassing=False)
## on-off-helper.h: ns3::OnOffHelper [class]
module.add_class('OnOffHelper', allow_subclassing=False)
## udp-echo-helper.h: ns3::UdpEchoClientHelper [class]
module.add_class('UdpEchoClientHelper', allow_subclassing=False)
## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper [class]
module.add_class('StaticMulticastRouteHelper', allow_subclassing=False)
## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer [class]
module.add_class('Ipv4InterfaceContainer')
## application-container.h: ns3::ApplicationContainer [class]
module.add_class('ApplicationContainer')
## wifi-helper.h: ns3::WifiHelper [class]
module.add_class('WifiHelper', allow_subclassing=False)
## ipv4-address-helper.h: ns3::Ipv4AddressHelper [class]
module.add_class('Ipv4AddressHelper', allow_subclassing=False)
## bridge-helper.h: ns3::BridgeHelper [class]
module.add_class('BridgeHelper', allow_subclassing=False)
## packet-sink-helper.h: ns3::PacketSinkHelper [class]
module.add_class('PacketSinkHelper', allow_subclassing=False)
## ns2-mobility-helper.h: ns3::Ns2MobilityHelper [class]
module.add_class('Ns2MobilityHelper', allow_subclassing=False)
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3MobilityHelper_methods(root_module, root_module['ns3::MobilityHelper'])
register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3PointToPointHelper_methods(root_module, root_module['ns3::PointToPointHelper'])
register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper'])
register_Ns3UdpEchoServerHelper_methods(root_module, root_module['ns3::UdpEchoServerHelper'])
register_Ns3OlsrHelper_methods(root_module, root_module['ns3::OlsrHelper'])
register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper'])
register_Ns3OnOffHelper_methods(root_module, root_module['ns3::OnOffHelper'])
register_Ns3UdpEchoClientHelper_methods(root_module, root_module['ns3::UdpEchoClientHelper'])
register_Ns3StaticMulticastRouteHelper_methods(root_module, root_module['ns3::StaticMulticastRouteHelper'])
register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer'])
register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer'])
register_Ns3WifiHelper_methods(root_module, root_module['ns3::WifiHelper'])
register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper'])
register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper'])
register_Ns3PacketSinkHelper_methods(root_module, root_module['ns3::PacketSinkHelper'])
register_Ns3Ns2MobilityHelper_methods(root_module, root_module['ns3::Ns2MobilityHelper'])
return
def register_Ns3MobilityHelper_methods(root_module, cls):
## mobility-helper.h: ns3::MobilityHelper::MobilityHelper(ns3::MobilityHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MobilityHelper const &', 'arg0')])
## mobility-helper.h: ns3::MobilityHelper::MobilityHelper() [constructor]
cls.add_constructor([])
## mobility-helper.h: void ns3::MobilityHelper::SetPositionAllocator(ns3::Ptr<ns3::PositionAllocator> allocator) [member function]
cls.add_method('SetPositionAllocator',
'void',
[param('ns3::Ptr< ns3::PositionAllocator >', 'allocator')])
## mobility-helper.h: void ns3::MobilityHelper::SetPositionAllocator(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue(), std::string n8="", ns3::AttributeValue const & v8=ns3::EmptyAttributeValue(), std::string n9="", ns3::AttributeValue const & v9=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetPositionAllocator',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n8', default_value='""'), param('ns3::AttributeValue const &', 'v8', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n9', default_value='""'), param('ns3::AttributeValue const &', 'v9', default_value='ns3::EmptyAttributeValue()')])
## mobility-helper.h: void ns3::MobilityHelper::SetMobilityModel(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue(), std::string n8="", ns3::AttributeValue const & v8=ns3::EmptyAttributeValue(), std::string n9="", ns3::AttributeValue const & v9=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetMobilityModel',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n8', default_value='""'), param('ns3::AttributeValue const &', 'v8', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n9', default_value='""'), param('ns3::AttributeValue const &', 'v9', default_value='ns3::EmptyAttributeValue()')])
## mobility-helper.h: void ns3::MobilityHelper::PushReferenceMobilityModel(ns3::Ptr<ns3::Object> reference) [member function]
cls.add_method('PushReferenceMobilityModel',
'void',
[param('ns3::Ptr< ns3::Object >', 'reference')])
## mobility-helper.h: void ns3::MobilityHelper::PopReferenceMobilityModel() [member function]
cls.add_method('PopReferenceMobilityModel',
'void',
[])
## mobility-helper.h: std::string ns3::MobilityHelper::GetMobilityModelType() const [member function]
cls.add_method('GetMobilityModelType',
'std::string',
[],
is_const=True)
## mobility-helper.h: void ns3::MobilityHelper::Install(ns3::NodeContainer container) [member function]
cls.add_method('Install',
'void',
[param('ns3::NodeContainer', 'container')])
## mobility-helper.h: void ns3::MobilityHelper::InstallAll() [member function]
cls.add_method('InstallAll',
'void',
[])
## mobility-helper.h: static void ns3::MobilityHelper::EnableAscii(std::ostream & os, uint32_t nodeid) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('uint32_t', 'nodeid')],
is_static=True)
## mobility-helper.h: static void ns3::MobilityHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
is_static=True)
## mobility-helper.h: static void ns3::MobilityHelper::EnableAsciiAll(std::ostream & os) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('std::ostream &', 'os')],
is_static=True)
return
def register_Ns3InternetStackHelper_methods(root_module, cls):
## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper(ns3::InternetStackHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')])
## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor]
cls.add_constructor([])
## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'void',
[param('ns3::NodeContainer', 'c')])
## internet-stack-helper.h: void ns3::InternetStackHelper::SetNscStack(std::string soname) [member function]
cls.add_method('SetNscStack',
'void',
[param('std::string', 'soname')])
## internet-stack-helper.h: static void ns3::InternetStackHelper::EnablePcapAll(std::string filename) [member function]
cls.add_method('EnablePcapAll',
'void',
[param('std::string', 'filename')],
is_static=True)
return
def register_Ns3NodeContainer_methods(root_module, cls):
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')])
## node-container.h: ns3::NodeContainer::NodeContainer() [constructor]
cls.add_constructor([])
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')])
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')])
## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')])
## node-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::Begin() const [member function]
cls.add_method('Begin',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::End() const [member function]
cls.add_method('End',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h: uint32_t ns3::NodeContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## node-container.h: ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Node >',
[param('uint32_t', 'i')],
is_const=True)
## node-container.h: void ns3::NodeContainer::Create(uint32_t n) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n')])
## node-container.h: void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NodeContainer', 'other')])
## node-container.h: void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h: static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function]
cls.add_method('GetGlobal',
'ns3::NodeContainer',
[],
is_static=True)
return
def register_Ns3PointToPointHelper_methods(root_module, cls):
## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper(ns3::PointToPointHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PointToPointHelper const &', 'arg0')])
## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper() [constructor]
cls.add_constructor([])
## point-to-point-helper.h: void ns3::PointToPointHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetQueue',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')])
## point-to-point-helper.h: void ns3::PointToPointHelper::SetDeviceAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetDeviceAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## point-to-point-helper.h: void ns3::PointToPointHelper::SetChannelAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetChannelAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## point-to-point-helper.h: void ns3::PointToPointHelper::SetDeviceParameter(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetDeviceParameter',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')],
deprecated=True)
## point-to-point-helper.h: void ns3::PointToPointHelper::SetChannelParameter(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetChannelParameter',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')],
deprecated=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NodeContainer', 'n')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcapAll(std::string filename) [member function]
cls.add_method('EnablePcapAll',
'void',
[param('std::string', 'filename')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
is_static=True)
## point-to-point-helper.h: static void ns3::PointToPointHelper::EnableAsciiAll(std::ostream & os) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('std::ostream &', 'os')],
is_static=True)
## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer', 'c')])
## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, ns3::Ptr<ns3::Node> b) [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::Ptr< ns3::Node >', 'a'), param('ns3::Ptr< ns3::Node >', 'b')])
return
def register_Ns3NetDeviceContainer_methods(root_module, cls):
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')])
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer() [constructor]
cls.add_constructor([])
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr<ns3::NetDevice> dev) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::NetDevice >', 'dev')])
## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & a, ns3::NetDeviceContainer const & b) [constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'a'), param('ns3::NetDeviceContainer const &', 'b')])
## net-device-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::NetDevice>*,std::vector<ns3::Ptr<ns3::NetDevice>, std::allocator<ns3::Ptr<ns3::NetDevice> > > > ns3::NetDeviceContainer::Begin() const [member function]
cls.add_method('Begin',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::NetDevice >, std::vector< ns3::Ptr< ns3::NetDevice > > >',
[],
is_const=True)
## net-device-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::NetDevice>*,std::vector<ns3::Ptr<ns3::NetDevice>, std::allocator<ns3::Ptr<ns3::NetDevice> > > > ns3::NetDeviceContainer::End() const [member function]
cls.add_method('End',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::NetDevice >, std::vector< ns3::Ptr< ns3::NetDevice > > >',
[],
is_const=True)
## net-device-container.h: uint32_t ns3::NetDeviceContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## net-device-container.h: ns3::Ptr<ns3::NetDevice> ns3::NetDeviceContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_const=True)
## net-device-container.h: void ns3::NetDeviceContainer::Add(ns3::NetDeviceContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NetDeviceContainer', 'other')])
## net-device-container.h: void ns3::NetDeviceContainer::Add(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
return
def register_Ns3CsmaHelper_methods(root_module, cls):
## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')])
## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor]
cls.add_constructor([])
## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetQueue',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')])
## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetDeviceAttribute',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetChannelAttribute',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
## csma-helper.h: void ns3::CsmaHelper::SetDeviceParameter(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetDeviceParameter',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')],
deprecated=True)
## csma-helper.h: void ns3::CsmaHelper::SetChannelParameter(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetChannelParameter',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')],
deprecated=True)
## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NodeContainer', 'n')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnablePcapAll(std::string filename) [member function]
cls.add_method('EnablePcapAll',
'void',
[param('std::string', 'filename')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
is_static=True)
## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('std::ostream &', 'os')],
is_static=True)
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer const &', 'c')])
## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr<ns3::CsmaChannel> channel) [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')])
return
def register_Ns3UdpEchoServerHelper_methods(root_module, cls):
## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(ns3::UdpEchoServerHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UdpEchoServerHelper const &', 'arg0')])
## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## udp-echo-helper.h: void ns3::UdpEchoServerHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoServerHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
[param('ns3::NodeContainer', 'c')])
return
def register_Ns3OlsrHelper_methods(root_module, cls):
## olsr-helper.h: ns3::OlsrHelper::OlsrHelper(ns3::OlsrHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')])
## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor]
cls.add_constructor([])
## olsr-helper.h: void ns3::OlsrHelper::SetAgent(std::string tid, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetAgent',
'void',
[param('std::string', 'tid'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::NodeContainer container) [member function]
cls.add_method('Install',
'void',
[param('ns3::NodeContainer', 'container')])
## olsr-helper.h: void ns3::OlsrHelper::Install(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Install',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## olsr-helper.h: void ns3::OlsrHelper::InstallAll() [member function]
cls.add_method('InstallAll',
'void',
[])
return
def register_Ns3PacketSocketHelper_methods(root_module, cls):
## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper(ns3::PacketSocketHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')])
## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper() [constructor]
cls.add_constructor([])
## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'void',
[param('ns3::NodeContainer', 'c')])
return
def register_Ns3OnOffHelper_methods(root_module, cls):
## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(ns3::OnOffHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OnOffHelper const &', 'arg0')])
## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(std::string protocol, ns3::Address address) [constructor]
cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')])
## on-off-helper.h: void ns3::OnOffHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## on-off-helper.h: ns3::ApplicationContainer ns3::OnOffHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
[param('ns3::NodeContainer', 'c')])
return
def register_Ns3UdpEchoClientHelper_methods(root_module, cls):
## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::UdpEchoClientHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UdpEchoClientHelper const &', 'arg0')])
## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::Ipv4Address ip, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')])
## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## udp-echo-helper.h: ns3::ApplicationContainer ns3::UdpEchoClientHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
[param('ns3::NodeContainer', 'c')])
return
def register_Ns3StaticMulticastRouteHelper_methods(root_module, cls):
## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper::StaticMulticastRouteHelper(ns3::StaticMulticastRouteHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::StaticMulticastRouteHelper const &', 'arg0')])
## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper::StaticMulticastRouteHelper() [constructor]
cls.add_constructor([])
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(ns3::Ptr<ns3::Node> arg0, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr<ns3::NetDevice> input, ns3::NetDeviceContainer output) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ptr< ns3::Node >', 'arg0'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group'), param('ns3::Ptr< ns3::NetDevice >', 'input'), param('ns3::NetDeviceContainer', 'output')])
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::SetDefaultMulticastRoute(ns3::Ptr<ns3::Node> n, ns3::Ptr<ns3::NetDevice> nd) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ptr< ns3::NetDevice >', 'nd')])
## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::JoinMulticastGroup(ns3::Ptr<ns3::Node> n, ns3::Ipv4Address source, ns3::Ipv4Address group) [member function]
cls.add_method('JoinMulticastGroup',
'void',
[param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group')])
return
def register_Ns3Ipv4InterfaceContainer_methods(root_module, cls):
## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer(ns3::Ipv4InterfaceContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4InterfaceContainer const &', 'arg0')])
## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer() [constructor]
cls.add_constructor([])
## ipv4-interface-container.h: uint32_t ns3::Ipv4InterfaceContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## ipv4-interface-container.h: ns3::Ipv4Address ns3::Ipv4InterfaceContainer::GetAddress(uint32_t i) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4Address',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::SetMetric(uint32_t i, uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'i'), param('uint16_t', 'metric')])
## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(ns3::Ptr<ns3::Ipv4> ipv4, uint32_t interface) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4'), param('uint32_t', 'interface')])
return
def register_Ns3ApplicationContainer_methods(root_module, cls):
## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::ApplicationContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')])
## application-container.h: ns3::ApplicationContainer::ApplicationContainer() [constructor]
cls.add_constructor([])
## application-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Application>*,std::vector<ns3::Ptr<ns3::Application>, std::allocator<ns3::Ptr<ns3::Application> > > > ns3::ApplicationContainer::Begin() const [member function]
cls.add_method('Begin',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::Application >, std::vector< ns3::Ptr< ns3::Application > > >',
[],
is_const=True)
## application-container.h: __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Application>*,std::vector<ns3::Ptr<ns3::Application>, std::allocator<ns3::Ptr<ns3::Application> > > > ns3::ApplicationContainer::End() const [member function]
cls.add_method('End',
'__gnu_cxx::__normal_iterator< const ns3::Ptr< ns3::Application >, std::vector< ns3::Ptr< ns3::Application > > >',
[],
is_const=True)
## application-container.h: uint32_t ns3::ApplicationContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## application-container.h: ns3::Ptr<ns3::Application> ns3::ApplicationContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Application >',
[param('uint32_t', 'i')],
is_const=True)
## application-container.h: void ns3::ApplicationContainer::Add(ns3::ApplicationContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::ApplicationContainer', 'other')])
## application-container.h: void ns3::ApplicationContainer::Add(ns3::Ptr<ns3::Application> application) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Application >', 'application')])
## application-container.h: void ns3::ApplicationContainer::Start(ns3::Time start) [member function]
cls.add_method('Start',
'void',
[param('ns3::Time', 'start')])
## application-container.h: void ns3::ApplicationContainer::Stop(ns3::Time stop) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time', 'stop')])
return
def register_Ns3WifiHelper_methods(root_module, cls):
## wifi-helper.h: ns3::WifiHelper::WifiHelper(ns3::WifiHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::WifiHelper const &', 'arg0')])
## wifi-helper.h: ns3::WifiHelper::WifiHelper() [constructor]
cls.add_constructor([])
## wifi-helper.h: void ns3::WifiHelper::SetRemoteStationManager(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetRemoteStationManager',
'void',
[param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
## wifi-helper.h: void ns3::WifiHelper::SetMac(std::string type, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetMac',
'void',
[param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
## wifi-helper.h: void ns3::WifiHelper::SetPhy(std::string phyType, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetPhy',
'void',
[param('std::string', 'phyType'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
## wifi-helper.h: static void ns3::WifiHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'filename'), param('ns3::NodeContainer', 'n')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnablePcapAll(std::string filename) [member function]
cls.add_method('EnablePcapAll',
'void',
[param('std::string', 'filename')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')],
is_static=True)
## wifi-helper.h: static void ns3::WifiHelper::EnableAsciiAll(std::ostream & os) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('std::ostream &', 'os')],
is_static=True)
## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::NodeContainer c) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer', 'c')],
is_const=True)
## wifi-helper.h: ns3::NetDeviceContainer ns3::WifiHelper::Install(ns3::NodeContainer c, ns3::Ptr<ns3::WifiChannel> channel) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer', 'c'), param('ns3::Ptr< ns3::WifiChannel >', 'channel')],
is_const=True)
return
def register_Ns3Ipv4AddressHelper_methods(root_module, cls):
## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper(ns3::Ipv4AddressHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4AddressHelper const &', 'arg0')])
## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper() [constructor]
cls.add_constructor([])
## ipv4-address-helper.h: void ns3::Ipv4AddressHelper::SetBase(ns3::Ipv4Address network, ns3::Ipv4Mask mask, ns3::Ipv4Address base="0.0.0.1") [member function]
cls.add_method('SetBase',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'mask'), param('ns3::Ipv4Address', 'base', default_value='"0.0.0.1"')])
## ipv4-address-helper.h: ns3::Ipv4Address ns3::Ipv4AddressHelper::NewNetwork() [member function]
cls.add_method('NewNetwork',
'ns3::Ipv4Address',
[])
## ipv4-address-helper.h: ns3::Ipv4Address ns3::Ipv4AddressHelper::NewAddress() [member function]
cls.add_method('NewAddress',
'ns3::Ipv4Address',
[])
## ipv4-address-helper.h: ns3::Ipv4InterfaceContainer ns3::Ipv4AddressHelper::Assign(ns3::NetDeviceContainer const & c) [member function]
cls.add_method('Assign',
'ns3::Ipv4InterfaceContainer',
[param('ns3::NetDeviceContainer const &', 'c')])
return
def register_Ns3BridgeHelper_methods(root_module, cls):
## bridge-helper.h: ns3::BridgeHelper::BridgeHelper(ns3::BridgeHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::BridgeHelper const &', 'arg0')])
## bridge-helper.h: ns3::BridgeHelper::BridgeHelper() [constructor]
cls.add_constructor([])
## bridge-helper.h: void ns3::BridgeHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetDeviceAttribute',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
## bridge-helper.h: ns3::NetDeviceContainer ns3::BridgeHelper::Install(ns3::Ptr<ns3::Node> node, ns3::NetDeviceContainer c) [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::NetDeviceContainer', 'c')])
return
def register_Ns3PacketSinkHelper_methods(root_module, cls):
## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(ns3::PacketSinkHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PacketSinkHelper const &', 'arg0')])
## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(std::string protocol, ns3::Address address) [constructor]
cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')])
## packet-sink-helper.h: void ns3::PacketSinkHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## packet-sink-helper.h: ns3::ApplicationContainer ns3::PacketSinkHelper::Install(ns3::NodeContainer c) [member function]
cls.add_method('Install',
'ns3::ApplicationContainer',
[param('ns3::NodeContainer', 'c')])
return
def register_Ns3Ns2MobilityHelper_methods(root_module, cls):
## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(ns3::Ns2MobilityHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ns2MobilityHelper const &', 'arg0')])
## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(std::string filename) [constructor]
cls.add_constructor([param('std::string', 'filename')])
## ns2-mobility-helper.h: void ns3::Ns2MobilityHelper::Install() const [member function]
cls.add_method('Install',
'void',
[],
is_const=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
@@ -0,0 +1,661 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## ipv4-interface.h: ns3::Ipv4Interface [class]
module.add_class('Ipv4Interface', parent=root_module['ns3::Object'])
## udp-header.h: ns3::UdpHeader [class]
module.add_class('UdpHeader', parent=root_module['ns3::Header'])
## tcp-header.h: ns3::TcpHeader [class]
module.add_class('TcpHeader', parent=root_module['ns3::Header'])
## tcp-header.h: ns3::TcpHeader::Flags_t [enumeration]
module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG'], outer_class=root_module['ns3::TcpHeader'])
## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class]
module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Object'])
## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class]
module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader'])
register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol'])
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
return
def register_Ns3Ipv4Interface_methods(root_module, cls):
## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface(ns3::Ipv4Interface const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4Interface const &', 'arg0')])
## ipv4-interface.h: static ns3::TypeId ns3::Ipv4Interface::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface() [constructor]
cls.add_constructor([])
## ipv4-interface.h: ns3::Ptr<ns3::NetDevice> ns3::Ipv4Interface::GetDevice() const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4-interface.h: void ns3::Ipv4Interface::SetAddress(ns3::Ipv4Address a) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Ipv4Address', 'a')])
## ipv4-interface.h: void ns3::Ipv4Interface::SetNetworkMask(ns3::Ipv4Mask mask) [member function]
cls.add_method('SetNetworkMask',
'void',
[param('ns3::Ipv4Mask', 'mask')])
## ipv4-interface.h: ns3::Ipv4Address ns3::Ipv4Interface::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface.h: ns3::Ipv4Mask ns3::Ipv4Interface::GetNetworkMask() const [member function]
cls.add_method('GetNetworkMask',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-interface.h: void ns3::Ipv4Interface::SetMetric(uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint16_t', 'metric')])
## ipv4-interface.h: uint16_t ns3::Ipv4Interface::GetMetric() const [member function]
cls.add_method('GetMetric',
'uint16_t',
[],
is_const=True)
## ipv4-interface.h: ns3::Ipv4Address ns3::Ipv4Interface::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface.h: uint16_t ns3::Ipv4Interface::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True)
## ipv4-interface.h: bool ns3::Ipv4Interface::IsUp() const [member function]
cls.add_method('IsUp',
'bool',
[],
is_const=True)
## ipv4-interface.h: bool ns3::Ipv4Interface::IsDown() const [member function]
cls.add_method('IsDown',
'bool',
[],
is_const=True)
## ipv4-interface.h: void ns3::Ipv4Interface::SetUp() [member function]
cls.add_method('SetUp',
'void',
[])
## ipv4-interface.h: void ns3::Ipv4Interface::SetDown() [member function]
cls.add_method('SetDown',
'void',
[])
## ipv4-interface.h: void ns3::Ipv4Interface::Send(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Address dest) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')])
## ipv4-interface.h: void ns3::Ipv4Interface::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## ipv4-interface.h: void ns3::Ipv4Interface::SendTo(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Address dest) [member function]
cls.add_method('SendTo',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')],
is_pure_virtual=True, visibility='private', is_virtual=True)
return
def register_Ns3UdpHeader_methods(root_module, cls):
## udp-header.h: ns3::UdpHeader::UdpHeader(ns3::UdpHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UdpHeader const &', 'arg0')])
## udp-header.h: ns3::UdpHeader::UdpHeader() [constructor]
cls.add_constructor([])
## udp-header.h: void ns3::UdpHeader::EnableChecksums() [member function]
cls.add_method('EnableChecksums',
'void',
[])
## udp-header.h: void ns3::UdpHeader::SetDestinationPort(uint16_t port) [member function]
cls.add_method('SetDestinationPort',
'void',
[param('uint16_t', 'port')])
## udp-header.h: void ns3::UdpHeader::SetSourcePort(uint16_t port) [member function]
cls.add_method('SetSourcePort',
'void',
[param('uint16_t', 'port')])
## udp-header.h: uint16_t ns3::UdpHeader::GetSourcePort() const [member function]
cls.add_method('GetSourcePort',
'uint16_t',
[],
is_const=True)
## udp-header.h: uint16_t ns3::UdpHeader::GetDestinationPort() const [member function]
cls.add_method('GetDestinationPort',
'uint16_t',
[],
is_const=True)
## udp-header.h: void ns3::UdpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
cls.add_method('InitializeChecksum',
'void',
[param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
## udp-header.h: static ns3::TypeId ns3::UdpHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## udp-header.h: ns3::TypeId ns3::UdpHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## udp-header.h: void ns3::UdpHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## udp-header.h: uint32_t ns3::UdpHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## udp-header.h: void ns3::UdpHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## udp-header.h: uint32_t ns3::UdpHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## udp-header.h: bool ns3::UdpHeader::IsChecksumOk() const [member function]
cls.add_method('IsChecksumOk',
'bool',
[],
is_const=True)
return
def register_Ns3TcpHeader_methods(root_module, cls):
## tcp-header.h: ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')])
## tcp-header.h: ns3::TcpHeader::TcpHeader() [constructor]
cls.add_constructor([])
## tcp-header.h: void ns3::TcpHeader::EnableChecksums() [member function]
cls.add_method('EnableChecksums',
'void',
[])
## tcp-header.h: void ns3::TcpHeader::SetSourcePort(uint16_t port) [member function]
cls.add_method('SetSourcePort',
'void',
[param('uint16_t', 'port')])
## tcp-header.h: void ns3::TcpHeader::SetDestinationPort(uint16_t port) [member function]
cls.add_method('SetDestinationPort',
'void',
[param('uint16_t', 'port')])
## tcp-header.h: void ns3::TcpHeader::SetSequenceNumber(SequenceNumber sequenceNumber) [member function]
cls.add_method('SetSequenceNumber',
'void',
[param('SequenceNumber', 'sequenceNumber')])
## tcp-header.h: void ns3::TcpHeader::SetAckNumber(SequenceNumber ackNumber) [member function]
cls.add_method('SetAckNumber',
'void',
[param('SequenceNumber', 'ackNumber')])
## tcp-header.h: void ns3::TcpHeader::SetLength(uint8_t length) [member function]
cls.add_method('SetLength',
'void',
[param('uint8_t', 'length')])
## tcp-header.h: void ns3::TcpHeader::SetFlags(uint8_t flags) [member function]
cls.add_method('SetFlags',
'void',
[param('uint8_t', 'flags')])
## tcp-header.h: void ns3::TcpHeader::SetWindowSize(uint16_t windowSize) [member function]
cls.add_method('SetWindowSize',
'void',
[param('uint16_t', 'windowSize')])
## tcp-header.h: void ns3::TcpHeader::SetUrgentPointer(uint16_t urgentPointer) [member function]
cls.add_method('SetUrgentPointer',
'void',
[param('uint16_t', 'urgentPointer')])
## tcp-header.h: uint16_t ns3::TcpHeader::GetSourcePort() const [member function]
cls.add_method('GetSourcePort',
'uint16_t',
[],
is_const=True)
## tcp-header.h: uint16_t ns3::TcpHeader::GetDestinationPort() const [member function]
cls.add_method('GetDestinationPort',
'uint16_t',
[],
is_const=True)
## tcp-header.h: SequenceNumber ns3::TcpHeader::GetSequenceNumber() const [member function]
cls.add_method('GetSequenceNumber',
'SequenceNumber',
[],
is_const=True)
## tcp-header.h: SequenceNumber ns3::TcpHeader::GetAckNumber() const [member function]
cls.add_method('GetAckNumber',
'SequenceNumber',
[],
is_const=True)
## tcp-header.h: uint8_t ns3::TcpHeader::GetLength() const [member function]
cls.add_method('GetLength',
'uint8_t',
[],
is_const=True)
## tcp-header.h: uint8_t ns3::TcpHeader::GetFlags() const [member function]
cls.add_method('GetFlags',
'uint8_t',
[],
is_const=True)
## tcp-header.h: uint16_t ns3::TcpHeader::GetWindowSize() const [member function]
cls.add_method('GetWindowSize',
'uint16_t',
[],
is_const=True)
## tcp-header.h: uint16_t ns3::TcpHeader::GetUrgentPointer() const [member function]
cls.add_method('GetUrgentPointer',
'uint16_t',
[],
is_const=True)
## tcp-header.h: void ns3::TcpHeader::InitializeChecksum(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
cls.add_method('InitializeChecksum',
'void',
[param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
## tcp-header.h: static ns3::TypeId ns3::TcpHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## tcp-header.h: ns3::TypeId ns3::TcpHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## tcp-header.h: void ns3::TcpHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## tcp-header.h: uint32_t ns3::TcpHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## tcp-header.h: void ns3::TcpHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## tcp-header.h: uint32_t ns3::TcpHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## tcp-header.h: bool ns3::TcpHeader::IsChecksumOk() const [member function]
cls.add_method('IsChecksumOk',
'bool',
[],
is_const=True)
return
def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True)
## ipv4-l3-protocol.h: static ns3::TypeId ns3::Ipv4L3Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::Ipv4L3Protocol() [constructor]
cls.add_constructor([])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Insert(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')])
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::Ipv4L4Protocol >',
[param('int', 'protocolNumber')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultTtl(uint8_t ttl) [member function]
cls.add_method('SetDefaultTtl',
'void',
[param('uint8_t', 'ttl')])
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::FindInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) [member function]
cls.add_method('FindInterfaceForDevice',
'ns3::Ptr< ns3::Ipv4Interface >',
[param('ns3::Ptr< const ns3::NetDevice >', 'device')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< const ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('SetDefaultRoute',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Lookup(ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty> routeReply) [member function]
cls.add_method('Lookup',
'void',
[param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, const ns3::Ipv4Route&, ns3::Ptr< ns3::Packet >, const ns3::Ipv4Header&, ns3::empty, ns3::empty >', 'routeReply')])
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[])
## ipv4-l3-protocol.h: ns3::Ipv4Route * ns3::Ipv4L3Protocol::GetRoute(uint32_t i) [member function]
cls.add_method('GetRoute',
'ns3::Ipv4Route *',
[param('uint32_t', 'i')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultMulticastRoute(uint32_t onputInterface) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('uint32_t', 'onputInterface')])
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNMulticastRoutes() const [member function]
cls.add_method('GetNMulticastRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-l3-protocol.h: ns3::Ipv4MulticastRoute * ns3::Ipv4L3Protocol::GetMulticastRoute(uint32_t i) const [member function]
cls.add_method('GetMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveMulticastRoute(uint32_t i) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddInterface',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::GetInterface(uint32_t i) const [member function]
cls.add_method('GetInterface',
'ns3::Ptr< ns3::Ipv4Interface >',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNInterfaces() const [member function]
cls.add_method('GetNInterfaces',
'uint32_t',
[],
is_const=True)
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr(ns3::Ipv4Address addr) const [member function]
cls.add_method('FindInterfaceForAddr',
'uint32_t',
[param('ns3::Ipv4Address', 'addr')],
is_const=True)
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr(ns3::Ipv4Address addr, ns3::Ipv4Mask mask) const [member function]
cls.add_method('FindInterfaceForAddr',
'uint32_t',
[param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask')],
is_const=True)
## ipv4-l3-protocol.h: int32_t ns3::Ipv4L3Protocol::FindInterfaceIndexForDevice(ns3::Ptr<ns3::NetDevice> device) const [member function]
cls.add_method('FindInterfaceIndexForDevice',
'int32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')],
is_const=True)
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::JoinMulticastGroup(ns3::Ipv4Address origin, ns3::Ipv4Address group) [member function]
cls.add_method('JoinMulticastGroup',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::LeaveMulticastGroup(ns3::Ipv4Address origin, ns3::Ipv4Address group) [member function]
cls.add_method('LeaveMulticastGroup',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetAddress(uint32_t i, ns3::Ipv4Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('uint32_t', 'i'), param('ns3::Ipv4Address', 'address')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetNetworkMask(uint32_t i, ns3::Ipv4Mask mask) [member function]
cls.add_method('SetNetworkMask',
'void',
[param('uint32_t', 'i'), param('ns3::Ipv4Mask', 'mask')])
## ipv4-l3-protocol.h: ns3::Ipv4Mask ns3::Ipv4L3Protocol::GetNetworkMask(uint32_t t) const [member function]
cls.add_method('GetNetworkMask',
'ns3::Ipv4Mask',
[param('uint32_t', 't')],
is_const=True)
## ipv4-l3-protocol.h: ns3::Ipv4Address ns3::Ipv4L3Protocol::GetAddress(uint32_t i) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4Address',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'i'), param('uint16_t', 'metric')])
## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMetric(uint32_t i) const [member function]
cls.add_method('GetMetric',
'uint16_t',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::GetIfIndexForDestination(ns3::Ipv4Address destination, uint32_t & ifIndex) const [member function]
cls.add_method('GetIfIndexForDestination',
'bool',
[param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')],
is_const=True)
## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMtu(uint32_t i) const [member function]
cls.add_method('GetMtu',
'uint16_t',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
cls.add_method('IsUp',
'bool',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetUp(uint32_t i) [member function]
cls.add_method('SetUp',
'void',
[param('uint32_t', 'i')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDown(uint32_t i) [member function]
cls.add_method('SetDown',
'void',
[param('uint32_t', 'i')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol, int priority) [member function]
cls.add_method('AddRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol'), param('int', 'priority')])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')])
## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor]
cls.add_constructor([])
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty> routeReply) [member function]
cls.add_method('RequestRoute',
'bool',
[param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, const ns3::Ipv4Route&, ns3::Ptr< ns3::Packet >, const ns3::Ipv4Header&, ns3::empty, ns3::empty >', 'routeReply')],
is_virtual=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestIfIndex(ns3::Ipv4Address destination, uint32_t & ifIndex) [member function]
cls.add_method('RequestIfIndex',
'bool',
[param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')],
is_virtual=True)
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
cls.add_method('SetDefaultRoute',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetDefaultRoute() [member function]
cls.add_method('GetDefaultRoute',
'ns3::Ipv4Route *',
[])
## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetRoute(uint32_t i) [member function]
cls.add_method('GetRoute',
'ns3::Ipv4Route *',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('uint32_t', 'outputInterface')])
## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function]
cls.add_method('GetNMulticastRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
cls.add_method('GetMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetDefaultMulticastRoute() const [member function]
cls.add_method('GetDefaultMulticastRoute',
'ns3::Ipv4MulticastRoute *',
[],
is_const=True)
## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
cls.add_method('RemoveMulticastRoute',
'bool',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('uint32_t', 'index')])
## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_functions(root_module):
module = root_module
## internet-stack.h: extern void ns3::AddInternetStack(ns3::Ptr<ns3::Node> node) [free function]
module.add_function('AddInternetStack',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## internet-stack.h: extern void ns3::AddNscInternetStack(ns3::Ptr<ns3::Node> node, std::string const & soname) [free function]
module.add_function('AddNscInternetStack',
'void',
[param('ns3::Ptr< ns3::Node >', 'node'), param('std::string const &', 'soname')])
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+723
View File
@@ -0,0 +1,723 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## static-speed-helper.h: ns3::StaticSpeedHelper [class]
module.add_class('StaticSpeedHelper', allow_subclassing=False)
## vector.h: ns3::Vector [class]
module.add_class('Vector')
## vector.h: ns3::VectorChecker [class]
module.add_class('VectorChecker', parent=root_module['ns3::AttributeChecker'])
## rectangle.h: ns3::RectangleChecker [class]
module.add_class('RectangleChecker', parent=root_module['ns3::AttributeChecker'])
## rectangle.h: ns3::Rectangle [class]
module.add_class('Rectangle')
## rectangle.h: ns3::Rectangle::Side [enumeration]
module.add_enum('Side', ['RIGHT', 'LEFT', 'TOP', 'BOTTOM'], outer_class=root_module['ns3::Rectangle'])
## position-allocator.h: ns3::PositionAllocator [class]
module.add_class('PositionAllocator', parent=root_module['ns3::Object'])
## position-allocator.h: ns3::ListPositionAllocator [class]
module.add_class('ListPositionAllocator', parent=root_module['ns3::PositionAllocator'])
## rectangle.h: ns3::RectangleValue [class]
module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue'])
## position-allocator.h: ns3::RandomRectanglePositionAllocator [class]
module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator'])
## vector.h: ns3::VectorValue [class]
module.add_class('VectorValue', parent=root_module['ns3::AttributeValue'])
## position-allocator.h: ns3::RandomDiscPositionAllocator [class]
module.add_class('RandomDiscPositionAllocator', parent=root_module['ns3::PositionAllocator'])
## mobility-model.h: ns3::MobilityModel [class]
module.add_class('MobilityModel', parent=root_module['ns3::Object'])
## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel [class]
module.add_class('RandomDirection2dMobilityModel', parent=root_module['ns3::MobilityModel'])
## position-allocator.h: ns3::GridPositionAllocator [class]
module.add_class('GridPositionAllocator', parent=root_module['ns3::PositionAllocator'])
## position-allocator.h: ns3::GridPositionAllocator::LayoutType [enumeration]
module.add_enum('LayoutType', ['ROW_FIRST', 'COLUMN_FIRST'], outer_class=root_module['ns3::GridPositionAllocator'])
## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel [class]
module.add_class('RandomWaypointMobilityModel', parent=root_module['ns3::MobilityModel'])
## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel [class]
module.add_class('RandomWalk2dMobilityModel', parent=root_module['ns3::MobilityModel'])
## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::Mode [enumeration]
module.add_enum('Mode', ['MODE_DISTANCE', 'MODE_TIME'], outer_class=root_module['ns3::RandomWalk2dMobilityModel'])
## static-speed-mobility-model.h: ns3::StaticSpeedMobilityModel [class]
module.add_class('StaticSpeedMobilityModel', parent=root_module['ns3::MobilityModel'])
## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel [class]
module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel'])
## static-mobility-model.h: ns3::StaticMobilityModel [class]
module.add_class('StaticMobilityModel', parent=root_module['ns3::MobilityModel'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3StaticSpeedHelper_methods(root_module, root_module['ns3::StaticSpeedHelper'])
register_Ns3Vector_methods(root_module, root_module['ns3::Vector'])
register_Ns3VectorChecker_methods(root_module, root_module['ns3::VectorChecker'])
register_Ns3RectangleChecker_methods(root_module, root_module['ns3::RectangleChecker'])
register_Ns3Rectangle_methods(root_module, root_module['ns3::Rectangle'])
register_Ns3PositionAllocator_methods(root_module, root_module['ns3::PositionAllocator'])
register_Ns3ListPositionAllocator_methods(root_module, root_module['ns3::ListPositionAllocator'])
register_Ns3RectangleValue_methods(root_module, root_module['ns3::RectangleValue'])
register_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator'])
register_Ns3VectorValue_methods(root_module, root_module['ns3::VectorValue'])
register_Ns3RandomDiscPositionAllocator_methods(root_module, root_module['ns3::RandomDiscPositionAllocator'])
register_Ns3MobilityModel_methods(root_module, root_module['ns3::MobilityModel'])
register_Ns3RandomDirection2dMobilityModel_methods(root_module, root_module['ns3::RandomDirection2dMobilityModel'])
register_Ns3GridPositionAllocator_methods(root_module, root_module['ns3::GridPositionAllocator'])
register_Ns3RandomWaypointMobilityModel_methods(root_module, root_module['ns3::RandomWaypointMobilityModel'])
register_Ns3RandomWalk2dMobilityModel_methods(root_module, root_module['ns3::RandomWalk2dMobilityModel'])
register_Ns3StaticSpeedMobilityModel_methods(root_module, root_module['ns3::StaticSpeedMobilityModel'])
register_Ns3HierarchicalMobilityModel_methods(root_module, root_module['ns3::HierarchicalMobilityModel'])
register_Ns3StaticMobilityModel_methods(root_module, root_module['ns3::StaticMobilityModel'])
return
def register_Ns3StaticSpeedHelper_methods(root_module, cls):
## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper(ns3::StaticSpeedHelper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::StaticSpeedHelper const &', 'arg0')])
## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper() [constructor]
cls.add_constructor([])
## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper(ns3::Vector const & position) [constructor]
cls.add_constructor([param('ns3::Vector const &', 'position')])
## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper(ns3::Vector const & position, ns3::Vector const & speed) [constructor]
cls.add_constructor([param('ns3::Vector const &', 'position'), param('ns3::Vector const &', 'speed')])
## static-speed-helper.h: void ns3::StaticSpeedHelper::InitializePosition(ns3::Vector const & position) [member function]
cls.add_method('InitializePosition',
'void',
[param('ns3::Vector const &', 'position')])
## static-speed-helper.h: void ns3::StaticSpeedHelper::Reset(ns3::Vector const & speed) [member function]
cls.add_method('Reset',
'void',
[param('ns3::Vector const &', 'speed')])
## static-speed-helper.h: ns3::Vector ns3::StaticSpeedHelper::GetCurrentPosition(ns3::Rectangle const & bounds) const [member function]
cls.add_method('GetCurrentPosition',
'ns3::Vector',
[param('ns3::Rectangle const &', 'bounds')],
is_const=True)
## static-speed-helper.h: ns3::Vector ns3::StaticSpeedHelper::GetCurrentPosition() const [member function]
cls.add_method('GetCurrentPosition',
'ns3::Vector',
[],
is_const=True)
## static-speed-helper.h: ns3::Vector ns3::StaticSpeedHelper::GetVelocity() const [member function]
cls.add_method('GetVelocity',
'ns3::Vector',
[],
is_const=True)
## static-speed-helper.h: void ns3::StaticSpeedHelper::SetSpeed(ns3::Vector const & speed) [member function]
cls.add_method('SetSpeed',
'void',
[param('ns3::Vector const &', 'speed')])
## static-speed-helper.h: void ns3::StaticSpeedHelper::Pause() [member function]
cls.add_method('Pause',
'void',
[])
## static-speed-helper.h: void ns3::StaticSpeedHelper::Unpause() [member function]
cls.add_method('Unpause',
'void',
[])
return
def register_Ns3Vector_methods(root_module, cls):
## vector.h: ns3::Vector::Vector(ns3::Vector const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Vector const &', 'arg0')])
## vector.h: ns3::Vector::Vector(double _x, double _y, double _z) [constructor]
cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')])
## vector.h: ns3::Vector::Vector() [constructor]
cls.add_constructor([])
## vector.h: ns3::Vector::x [variable]
cls.add_instance_attribute('x', 'double', is_const=False)
## vector.h: ns3::Vector::y [variable]
cls.add_instance_attribute('y', 'double', is_const=False)
## vector.h: ns3::Vector::z [variable]
cls.add_instance_attribute('z', 'double', is_const=False)
cls.add_output_stream_operator()
return
def register_Ns3VectorChecker_methods(root_module, cls):
## vector.h: ns3::VectorChecker::VectorChecker(ns3::VectorChecker const & arg0) [copy constructor]
cls.add_constructor([param('ns3::VectorChecker const &', 'arg0')])
## vector.h: ns3::VectorChecker::VectorChecker() [constructor]
cls.add_constructor([])
return
def register_Ns3RectangleChecker_methods(root_module, cls):
## rectangle.h: ns3::RectangleChecker::RectangleChecker(ns3::RectangleChecker const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RectangleChecker const &', 'arg0')])
## rectangle.h: ns3::RectangleChecker::RectangleChecker() [constructor]
cls.add_constructor([])
return
def register_Ns3Rectangle_methods(root_module, cls):
## rectangle.h: ns3::Rectangle::Rectangle(ns3::Rectangle const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Rectangle const &', 'arg0')])
## rectangle.h: ns3::Rectangle::Rectangle(double _xMin, double _xMax, double _yMin, double _yMax) [constructor]
cls.add_constructor([param('double', '_xMin'), param('double', '_xMax'), param('double', '_yMin'), param('double', '_yMax')])
## rectangle.h: ns3::Rectangle::Rectangle() [constructor]
cls.add_constructor([])
## rectangle.h: ns3::Vector ns3::Rectangle::CalculateIntersection(ns3::Vector const & current, ns3::Vector const & speed) const [member function]
cls.add_method('CalculateIntersection',
'ns3::Vector',
[param('ns3::Vector const &', 'current'), param('ns3::Vector const &', 'speed')],
is_const=True)
## rectangle.h: ns3::Rectangle::Side ns3::Rectangle::GetClosestSide(ns3::Vector const & position) const [member function]
cls.add_method('GetClosestSide',
'ns3::Rectangle::Side',
[param('ns3::Vector const &', 'position')],
is_const=True)
## rectangle.h: bool ns3::Rectangle::IsInside(ns3::Vector const & position) const [member function]
cls.add_method('IsInside',
'bool',
[param('ns3::Vector const &', 'position')],
is_const=True)
## rectangle.h: ns3::Rectangle::xMax [variable]
cls.add_instance_attribute('xMax', 'double', is_const=False)
## rectangle.h: ns3::Rectangle::xMin [variable]
cls.add_instance_attribute('xMin', 'double', is_const=False)
## rectangle.h: ns3::Rectangle::yMax [variable]
cls.add_instance_attribute('yMax', 'double', is_const=False)
## rectangle.h: ns3::Rectangle::yMin [variable]
cls.add_instance_attribute('yMin', 'double', is_const=False)
cls.add_output_stream_operator()
return
def register_Ns3PositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::PositionAllocator::PositionAllocator(ns3::PositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::PositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::PositionAllocator::PositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: ns3::Vector ns3::PositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3ListPositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator(ns3::ListPositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::ListPositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::ListPositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::ListPositionAllocator::Add(ns3::Vector v) [member function]
cls.add_method('Add',
'void',
[param('ns3::Vector', 'v')])
## position-allocator.h: ns3::Vector ns3::ListPositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3RectangleValue_methods(root_module, cls):
## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::RectangleValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RectangleValue const &', 'arg0')])
## rectangle.h: ns3::RectangleValue::RectangleValue() [constructor]
cls.add_constructor([])
## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::Rectangle const & value) [constructor]
cls.add_constructor([param('ns3::Rectangle const &', 'value')])
## rectangle.h: void ns3::RectangleValue::Set(ns3::Rectangle const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Rectangle const &', 'value')])
## rectangle.h: ns3::Rectangle ns3::RectangleValue::Get() const [member function]
cls.add_method('Get',
'ns3::Rectangle',
[],
is_const=True)
## rectangle.h: ns3::Ptr<ns3::AttributeValue> ns3::RectangleValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## rectangle.h: std::string ns3::RectangleValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## rectangle.h: bool ns3::RectangleValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
return
def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator(ns3::RandomRectanglePositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomRectanglePositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::RandomRectanglePositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetX(ns3::RandomVariable x) [member function]
cls.add_method('SetX',
'void',
[param('ns3::RandomVariable', 'x')])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetY(ns3::RandomVariable y) [member function]
cls.add_method('SetY',
'void',
[param('ns3::RandomVariable', 'y')])
## position-allocator.h: ns3::Vector ns3::RandomRectanglePositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3VectorValue_methods(root_module, cls):
## vector.h: ns3::VectorValue::VectorValue(ns3::VectorValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::VectorValue const &', 'arg0')])
## vector.h: ns3::VectorValue::VectorValue() [constructor]
cls.add_constructor([])
## vector.h: ns3::VectorValue::VectorValue(ns3::Vector const & value) [constructor]
cls.add_constructor([param('ns3::Vector const &', 'value')])
## vector.h: void ns3::VectorValue::Set(ns3::Vector const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Vector const &', 'value')])
## vector.h: ns3::Vector ns3::VectorValue::Get() const [member function]
cls.add_method('Get',
'ns3::Vector',
[],
is_const=True)
## vector.h: ns3::Ptr<ns3::AttributeValue> ns3::VectorValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## vector.h: std::string ns3::VectorValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## vector.h: bool ns3::VectorValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
return
def register_Ns3RandomDiscPositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::RandomDiscPositionAllocator::RandomDiscPositionAllocator(ns3::RandomDiscPositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomDiscPositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::RandomDiscPositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::RandomDiscPositionAllocator::RandomDiscPositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetTheta(ns3::RandomVariable theta) [member function]
cls.add_method('SetTheta',
'void',
[param('ns3::RandomVariable', 'theta')])
## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetRho(ns3::RandomVariable rho) [member function]
cls.add_method('SetRho',
'void',
[param('ns3::RandomVariable', 'rho')])
## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetX(double x) [member function]
cls.add_method('SetX',
'void',
[param('double', 'x')])
## position-allocator.h: void ns3::RandomDiscPositionAllocator::SetY(double y) [member function]
cls.add_method('SetY',
'void',
[param('double', 'y')])
## position-allocator.h: ns3::Vector ns3::RandomDiscPositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3MobilityModel_methods(root_module, cls):
## mobility-model.h: ns3::MobilityModel::MobilityModel(ns3::MobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MobilityModel const &', 'arg0')])
## mobility-model.h: static ns3::TypeId ns3::MobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## mobility-model.h: ns3::MobilityModel::MobilityModel() [constructor]
cls.add_constructor([])
## mobility-model.h: ns3::Vector ns3::MobilityModel::GetPosition() const [member function]
cls.add_method('GetPosition',
'ns3::Vector',
[],
is_const=True)
## mobility-model.h: void ns3::MobilityModel::SetPosition(ns3::Vector const & position) [member function]
cls.add_method('SetPosition',
'void',
[param('ns3::Vector const &', 'position')])
## mobility-model.h: ns3::Vector ns3::MobilityModel::GetVelocity() const [member function]
cls.add_method('GetVelocity',
'ns3::Vector',
[],
is_const=True)
## mobility-model.h: double ns3::MobilityModel::GetDistanceFrom(ns3::Ptr<const ns3::MobilityModel> position) const [member function]
cls.add_method('GetDistanceFrom',
'double',
[param('ns3::Ptr< const ns3::MobilityModel >', 'position')],
is_const=True)
## mobility-model.h: void ns3::MobilityModel::NotifyCourseChange() const [member function]
cls.add_method('NotifyCourseChange',
'void',
[],
is_const=True, visibility='protected')
## mobility-model.h: ns3::Vector ns3::MobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
## mobility-model.h: void ns3::MobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
is_pure_virtual=True, visibility='private', is_virtual=True)
## mobility-model.h: ns3::Vector ns3::MobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3RandomDirection2dMobilityModel_methods(root_module, cls):
## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel::RandomDirection2dMobilityModel(ns3::RandomDirection2dMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomDirection2dMobilityModel const &', 'arg0')])
## random-direction-2d-mobility-model.h: static ns3::TypeId ns3::RandomDirection2dMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel::RandomDirection2dMobilityModel() [constructor]
cls.add_constructor([])
## random-direction-2d-mobility-model.h: void ns3::RandomDirection2dMobilityModel::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## random-direction-2d-mobility-model.h: void ns3::RandomDirection2dMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3GridPositionAllocator_methods(root_module, cls):
## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator(ns3::GridPositionAllocator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::GridPositionAllocator const &', 'arg0')])
## position-allocator.h: static ns3::TypeId ns3::GridPositionAllocator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator() [constructor]
cls.add_constructor([])
## position-allocator.h: void ns3::GridPositionAllocator::SetMinX(double xMin) [member function]
cls.add_method('SetMinX',
'void',
[param('double', 'xMin')])
## position-allocator.h: void ns3::GridPositionAllocator::SetMinY(double yMin) [member function]
cls.add_method('SetMinY',
'void',
[param('double', 'yMin')])
## position-allocator.h: void ns3::GridPositionAllocator::SetDeltaX(double deltaX) [member function]
cls.add_method('SetDeltaX',
'void',
[param('double', 'deltaX')])
## position-allocator.h: void ns3::GridPositionAllocator::SetDeltaY(double deltaY) [member function]
cls.add_method('SetDeltaY',
'void',
[param('double', 'deltaY')])
## position-allocator.h: void ns3::GridPositionAllocator::SetN(uint32_t n) [member function]
cls.add_method('SetN',
'void',
[param('uint32_t', 'n')])
## position-allocator.h: void ns3::GridPositionAllocator::SetLayoutType(ns3::GridPositionAllocator::LayoutType layoutType) [member function]
cls.add_method('SetLayoutType',
'void',
[param('ns3::GridPositionAllocator::LayoutType', 'layoutType')])
## position-allocator.h: double ns3::GridPositionAllocator::GetMinX() const [member function]
cls.add_method('GetMinX',
'double',
[],
is_const=True)
## position-allocator.h: double ns3::GridPositionAllocator::GetMinY() const [member function]
cls.add_method('GetMinY',
'double',
[],
is_const=True)
## position-allocator.h: double ns3::GridPositionAllocator::GetDeltaX() const [member function]
cls.add_method('GetDeltaX',
'double',
[],
is_const=True)
## position-allocator.h: double ns3::GridPositionAllocator::GetDeltaY() const [member function]
cls.add_method('GetDeltaY',
'double',
[],
is_const=True)
## position-allocator.h: uint32_t ns3::GridPositionAllocator::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## position-allocator.h: ns3::GridPositionAllocator::LayoutType ns3::GridPositionAllocator::GetLayoutType() const [member function]
cls.add_method('GetLayoutType',
'ns3::GridPositionAllocator::LayoutType',
[],
is_const=True)
## position-allocator.h: ns3::Vector ns3::GridPositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'ns3::Vector',
[],
is_const=True, is_virtual=True)
return
def register_Ns3RandomWaypointMobilityModel_methods(root_module, cls):
## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel(ns3::RandomWaypointMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomWaypointMobilityModel const &', 'arg0')])
## random-waypoint-mobility-model.h: static ns3::TypeId ns3::RandomWaypointMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel() [constructor]
cls.add_constructor([])
## random-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## random-waypoint-mobility-model.h: void ns3::RandomWaypointMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## random-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3RandomWalk2dMobilityModel_methods(root_module, cls):
## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::RandomWalk2dMobilityModel(ns3::RandomWalk2dMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::RandomWalk2dMobilityModel const &', 'arg0')])
## random-walk-2d-mobility-model.h: static ns3::TypeId ns3::RandomWalk2dMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::RandomWalk2dMobilityModel() [constructor]
cls.add_constructor([])
## random-walk-2d-mobility-model.h: void ns3::RandomWalk2dMobilityModel::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
## random-walk-2d-mobility-model.h: ns3::Vector ns3::RandomWalk2dMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## random-walk-2d-mobility-model.h: void ns3::RandomWalk2dMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## random-walk-2d-mobility-model.h: ns3::Vector ns3::RandomWalk2dMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3StaticSpeedMobilityModel_methods(root_module, cls):
## static-speed-mobility-model.h: ns3::StaticSpeedMobilityModel::StaticSpeedMobilityModel(ns3::StaticSpeedMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::StaticSpeedMobilityModel const &', 'arg0')])
## static-speed-mobility-model.h: static ns3::TypeId ns3::StaticSpeedMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## static-speed-mobility-model.h: ns3::StaticSpeedMobilityModel::StaticSpeedMobilityModel() [constructor]
cls.add_constructor([])
## static-speed-mobility-model.h: void ns3::StaticSpeedMobilityModel::SetSpeed(ns3::Vector const & speed) [member function]
cls.add_method('SetSpeed',
'void',
[param('ns3::Vector const &', 'speed')])
## static-speed-mobility-model.h: ns3::Vector ns3::StaticSpeedMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## static-speed-mobility-model.h: void ns3::StaticSpeedMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## static-speed-mobility-model.h: ns3::Vector ns3::StaticSpeedMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3HierarchicalMobilityModel_methods(root_module, cls):
## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel::HierarchicalMobilityModel(ns3::HierarchicalMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::HierarchicalMobilityModel const &', 'arg0')])
## hierarchical-mobility-model.h: static ns3::TypeId ns3::HierarchicalMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel::HierarchicalMobilityModel() [constructor]
cls.add_constructor([])
## hierarchical-mobility-model.h: ns3::Ptr<ns3::MobilityModel> ns3::HierarchicalMobilityModel::GetChild() const [member function]
cls.add_method('GetChild',
'ns3::Ptr< ns3::MobilityModel >',
[],
is_const=True)
## hierarchical-mobility-model.h: ns3::Ptr<ns3::MobilityModel> ns3::HierarchicalMobilityModel::GetParent() const [member function]
cls.add_method('GetParent',
'ns3::Ptr< ns3::MobilityModel >',
[],
is_const=True)
## hierarchical-mobility-model.h: ns3::Vector ns3::HierarchicalMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## hierarchical-mobility-model.h: void ns3::HierarchicalMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## hierarchical-mobility-model.h: ns3::Vector ns3::HierarchicalMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3StaticMobilityModel_methods(root_module, cls):
## static-mobility-model.h: ns3::StaticMobilityModel::StaticMobilityModel(ns3::StaticMobilityModel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::StaticMobilityModel const &', 'arg0')])
## static-mobility-model.h: static ns3::TypeId ns3::StaticMobilityModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## static-mobility-model.h: ns3::StaticMobilityModel::StaticMobilityModel() [constructor]
cls.add_constructor([])
## static-mobility-model.h: ns3::Vector ns3::StaticMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
## static-mobility-model.h: void ns3::StaticMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
cls.add_method('DoSetPosition',
'void',
[param('ns3::Vector const &', 'position')],
visibility='private', is_virtual=True)
## static-mobility-model.h: ns3::Vector ns3::StaticMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
is_const=True, visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
## rectangle.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeRectangleChecker() [free function]
module.add_function('MakeRectangleChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVectorChecker() [free function]
module.add_function('MakeVectorChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## vector.h: extern double ns3::CalculateDistance(ns3::Vector const & a, ns3::Vector const & b) [free function]
module.add_function('CalculateDistance',
'double',
[param('ns3::Vector const &', 'a'), param('ns3::Vector const &', 'b')])
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large. Load diff
+466
View File
@@ -0,0 +1,466 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
## olsr-header.h: ns3::olsr::MessageHeader [class]
module.add_class('MessageHeader', parent=root_module['ns3::Header'])
## olsr-header.h: ns3::olsr::MessageHeader::MessageType [enumeration]
module.add_enum('MessageType', ['HELLO_MESSAGE', 'TC_MESSAGE', 'MID_MESSAGE', 'HNA_MESSAGE'], outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Mid [struct]
module.add_class('Mid', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Hello [struct]
module.add_class('Hello', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage [struct]
module.add_class('LinkMessage', outer_class=root_module['ns3::olsr::MessageHeader::Hello'])
## olsr-header.h: ns3::olsr::MessageHeader::Tc [struct]
module.add_class('Tc', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Hna [struct]
module.add_class('Hna', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association [struct]
module.add_class('Association', outer_class=root_module['ns3::olsr::MessageHeader::Hna'])
## olsr-agent.h: ns3::olsr::Agent [class]
module.add_class('Agent', parent=root_module['ns3::Object'])
## olsr-header.h: ns3::olsr::PacketHeader [class]
module.add_class('PacketHeader', parent=root_module['ns3::Header'])
def register_methods(root_module):
register_Ns3OlsrMessageHeader_methods(root_module, root_module['ns3::olsr::MessageHeader'])
register_Ns3OlsrMessageHeaderMid_methods(root_module, root_module['ns3::olsr::MessageHeader::Mid'])
register_Ns3OlsrMessageHeaderHello_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello'])
register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello::LinkMessage'])
register_Ns3OlsrMessageHeaderTc_methods(root_module, root_module['ns3::olsr::MessageHeader::Tc'])
register_Ns3OlsrMessageHeaderHna_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna'])
register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna::Association'])
register_Ns3OlsrAgent_methods(root_module, root_module['ns3::olsr::Agent'])
register_Ns3OlsrPacketHeader_methods(root_module, root_module['ns3::olsr::PacketHeader'])
return
def register_Ns3OlsrMessageHeader_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::MessageHeader(ns3::olsr::MessageHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader const &', 'arg0')])
## olsr-header.h: ns3::olsr::MessageHeader::MessageHeader() [constructor]
cls.add_constructor([])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## olsr-header.h: ns3::olsr::MessageHeader::Hello & ns3::olsr::MessageHeader::GetHello() [member function]
cls.add_method('GetHello',
'ns3::olsr::MessageHeader::Hello &',
[])
## olsr-header.h: ns3::olsr::MessageHeader::Hello const & ns3::olsr::MessageHeader::GetHello() const [member function]
cls.add_method('GetHello',
'ns3::olsr::MessageHeader::Hello const &',
[],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::Hna & ns3::olsr::MessageHeader::GetHna() [member function]
cls.add_method('GetHna',
'ns3::olsr::MessageHeader::Hna &',
[])
## olsr-header.h: ns3::olsr::MessageHeader::Hna const & ns3::olsr::MessageHeader::GetHna() const [member function]
cls.add_method('GetHna',
'ns3::olsr::MessageHeader::Hna const &',
[],
is_const=True)
## olsr-header.h: uint8_t ns3::olsr::MessageHeader::GetHopCount() const [member function]
cls.add_method('GetHopCount',
'uint8_t',
[],
is_const=True)
## olsr-header.h: ns3::TypeId ns3::olsr::MessageHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## olsr-header.h: uint16_t ns3::olsr::MessageHeader::GetMessageSequenceNumber() const [member function]
cls.add_method('GetMessageSequenceNumber',
'uint16_t',
[],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::MessageType ns3::olsr::MessageHeader::GetMessageType() const [member function]
cls.add_method('GetMessageType',
'ns3::olsr::MessageHeader::MessageType',
[],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::Mid & ns3::olsr::MessageHeader::GetMid() [member function]
cls.add_method('GetMid',
'ns3::olsr::MessageHeader::Mid &',
[])
## olsr-header.h: ns3::olsr::MessageHeader::Mid const & ns3::olsr::MessageHeader::GetMid() const [member function]
cls.add_method('GetMid',
'ns3::olsr::MessageHeader::Mid const &',
[],
is_const=True)
## olsr-header.h: ns3::Ipv4Address ns3::olsr::MessageHeader::GetOriginatorAddress() const [member function]
cls.add_method('GetOriginatorAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## olsr-header.h: ns3::olsr::MessageHeader::Tc & ns3::olsr::MessageHeader::GetTc() [member function]
cls.add_method('GetTc',
'ns3::olsr::MessageHeader::Tc &',
[])
## olsr-header.h: ns3::olsr::MessageHeader::Tc const & ns3::olsr::MessageHeader::GetTc() const [member function]
cls.add_method('GetTc',
'ns3::olsr::MessageHeader::Tc const &',
[],
is_const=True)
## olsr-header.h: uint8_t ns3::olsr::MessageHeader::GetTimeToLive() const [member function]
cls.add_method('GetTimeToLive',
'uint8_t',
[],
is_const=True)
## olsr-header.h: static ns3::TypeId ns3::olsr::MessageHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-header.h: ns3::Time ns3::olsr::MessageHeader::GetVTime() const [member function]
cls.add_method('GetVTime',
'ns3::Time',
[],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## olsr-header.h: void ns3::olsr::MessageHeader::SetHopCount(uint8_t hopCount) [member function]
cls.add_method('SetHopCount',
'void',
[param('uint8_t', 'hopCount')])
## olsr-header.h: void ns3::olsr::MessageHeader::SetMessageSequenceNumber(uint16_t messageSequenceNumber) [member function]
cls.add_method('SetMessageSequenceNumber',
'void',
[param('uint16_t', 'messageSequenceNumber')])
## olsr-header.h: void ns3::olsr::MessageHeader::SetMessageType(ns3::olsr::MessageHeader::MessageType messageType) [member function]
cls.add_method('SetMessageType',
'void',
[param('ns3::olsr::MessageHeader::MessageType', 'messageType')])
## olsr-header.h: void ns3::olsr::MessageHeader::SetOriginatorAddress(ns3::Ipv4Address originatorAddress) [member function]
cls.add_method('SetOriginatorAddress',
'void',
[param('ns3::Ipv4Address', 'originatorAddress')])
## olsr-header.h: void ns3::olsr::MessageHeader::SetTimeToLive(uint8_t timeToLive) [member function]
cls.add_method('SetTimeToLive',
'void',
[param('uint8_t', 'timeToLive')])
## olsr-header.h: void ns3::olsr::MessageHeader::SetVTime(ns3::Time time) [member function]
cls.add_method('SetVTime',
'void',
[param('ns3::Time', 'time')])
cls.add_output_stream_operator()
return
def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid() [constructor]
cls.add_constructor([])
## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid(ns3::olsr::MessageHeader::Mid const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Mid const &', 'arg0')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Mid::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Mid::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Mid::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Mid::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::Mid::interfaceAddresses [variable]
cls.add_instance_attribute('interfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
return
def register_Ns3OlsrMessageHeaderHello_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello() [constructor]
cls.add_constructor([])
## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello(ns3::olsr::MessageHeader::Hello const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hello const &', 'arg0')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hello::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h: ns3::Time ns3::olsr::MessageHeader::Hello::GetHTime() const [member function]
cls.add_method('GetHTime',
'ns3::Time',
[],
is_const=True)
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hello::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Hello::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Hello::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Hello::SetHTime(ns3::Time time) [member function]
cls.add_method('SetHTime',
'void',
[param('ns3::Time', 'time')])
## olsr-header.h: ns3::olsr::MessageHeader::Hello::hTime [variable]
cls.add_instance_attribute('hTime', 'uint8_t', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hello::linkMessages [variable]
cls.add_instance_attribute('linkMessages', 'std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hello::willingness [variable]
cls.add_instance_attribute('willingness', 'uint8_t', is_const=False)
return
def register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode [variable]
cls.add_instance_attribute('linkCode', 'uint8_t', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses [variable]
cls.add_instance_attribute('neighborInterfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage(ns3::olsr::MessageHeader::Hello::LinkMessage const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hello::LinkMessage const &', 'arg0')])
## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage() [constructor]
cls.add_constructor([])
return
def register_Ns3OlsrMessageHeaderTc_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc() [constructor]
cls.add_constructor([])
## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc(ns3::olsr::MessageHeader::Tc const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Tc const &', 'arg0')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Tc::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Tc::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Tc::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Tc::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::Tc::ansn [variable]
cls.add_instance_attribute('ansn', 'uint16_t', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Tc::neighborAddresses [variable]
cls.add_instance_attribute('neighborAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
return
def register_Ns3OlsrMessageHeaderHna_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna() [constructor]
cls.add_constructor([])
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna(ns3::olsr::MessageHeader::Hna const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hna const &', 'arg0')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hna::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hna::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Hna::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Hna::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h: ns3::olsr::MessageHeader::Hna::associations [variable]
cls.add_instance_attribute('associations', 'std::vector< ns3::olsr::MessageHeader::Hna::Association >', is_const=False)
return
def register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::address [variable]
cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::mask [variable]
cls.add_instance_attribute('mask', 'ns3::Ipv4Mask', is_const=False)
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association(ns3::olsr::MessageHeader::Hna::Association const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hna::Association const &', 'arg0')])
## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association() [constructor]
cls.add_constructor([])
return
def register_Ns3OlsrAgent_methods(root_module, cls):
## olsr-agent.h: ns3::olsr::Agent::Agent(ns3::olsr::Agent const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::Agent const &', 'arg0')])
## olsr-agent.h: ns3::olsr::Agent::Agent() [constructor]
cls.add_constructor([])
## olsr-agent.h: static ns3::TypeId ns3::olsr::Agent::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-agent.h: void ns3::olsr::Agent::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_pure_virtual=True, is_virtual=True)
## olsr-agent.h: void ns3::olsr::Agent::SetMainInterface(uint32_t interface) [member function]
cls.add_method('SetMainInterface',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## olsr-agent.h: void ns3::olsr::Agent::Start() [member function]
cls.add_method('Start',
'void',
[],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3OlsrPacketHeader_methods(root_module, cls):
## olsr-header.h: ns3::olsr::PacketHeader::PacketHeader(ns3::olsr::PacketHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::PacketHeader const &', 'arg0')])
## olsr-header.h: ns3::olsr::PacketHeader::PacketHeader() [constructor]
cls.add_constructor([])
## olsr-header.h: uint32_t ns3::olsr::PacketHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## olsr-header.h: ns3::TypeId ns3::olsr::PacketHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## olsr-header.h: uint16_t ns3::olsr::PacketHeader::GetPacketLength() const [member function]
cls.add_method('GetPacketLength',
'uint16_t',
[],
is_const=True)
## olsr-header.h: uint16_t ns3::olsr::PacketHeader::GetPacketSequenceNumber() const [member function]
cls.add_method('GetPacketSequenceNumber',
'uint16_t',
[],
is_const=True)
## olsr-header.h: uint32_t ns3::olsr::PacketHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## olsr-header.h: static ns3::TypeId ns3::olsr::PacketHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-header.h: void ns3::olsr::PacketHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## olsr-header.h: void ns3::olsr::PacketHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## olsr-header.h: void ns3::olsr::PacketHeader::SetPacketLength(uint16_t length) [member function]
cls.add_method('SetPacketLength',
'void',
[param('uint16_t', 'length')])
## olsr-header.h: void ns3::olsr::PacketHeader::SetPacketSequenceNumber(uint16_t seqnum) [member function]
cls.add_method('SetPacketSequenceNumber',
'void',
[param('uint16_t', 'seqnum')])
cls.add_output_stream_operator()
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
## olsr-header.h: extern double ns3::olsr::EmfToSeconds(uint8_t emf) [free function]
module.add_function('EmfToSeconds',
'double',
[param('uint8_t', 'emf')])
## olsr-header.h: extern uint8_t ns3::olsr::SecondsToEmf(double seconds) [free function]
module.add_function('SecondsToEmf',
'uint8_t',
[param('double', 'seconds')])
return
+103
View File
@@ -0,0 +1,103 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## onoff-application.h: ns3::OnOffApplication [class]
module.add_class('OnOffApplication', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3OnOffApplication_methods(root_module, root_module['ns3::OnOffApplication'])
return
def register_Ns3OnOffApplication_methods(root_module, cls):
## onoff-application.h: ns3::OnOffApplication::OnOffApplication(ns3::OnOffApplication const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OnOffApplication const &', 'arg0')])
## onoff-application.h: static ns3::TypeId ns3::OnOffApplication::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## onoff-application.h: ns3::OnOffApplication::OnOffApplication() [constructor]
cls.add_constructor([])
## onoff-application.h: void ns3::OnOffApplication::SetMaxBytes(uint32_t maxBytes) [member function]
cls.add_method('SetMaxBytes',
'void',
[param('uint32_t', 'maxBytes')])
## onoff-application.h: void ns3::OnOffApplication::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## onoff-application.h: void ns3::OnOffApplication::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## onoff-application.h: void ns3::OnOffApplication::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+99
View File
@@ -0,0 +1,99 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## packet-sink.h: ns3::PacketSink [class]
module.add_class('PacketSink', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3PacketSink_methods(root_module, root_module['ns3::PacketSink'])
return
def register_Ns3PacketSink_methods(root_module, cls):
## packet-sink.h: ns3::PacketSink::PacketSink(ns3::PacketSink const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PacketSink const &', 'arg0')])
## packet-sink.h: static ns3::TypeId ns3::PacketSink::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-sink.h: ns3::PacketSink::PacketSink() [constructor]
cls.add_constructor([])
## packet-sink.h: void ns3::PacketSink::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## packet-sink.h: void ns3::PacketSink::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## packet-sink.h: void ns3::PacketSink::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
@@ -0,0 +1,275 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## point-to-point-channel.h: ns3::PointToPointChannel [class]
module.add_class('PointToPointChannel', parent=root_module['ns3::Channel'])
## point-to-point-net-device.h: ns3::PointToPointNetDevice [class]
module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3PointToPointChannel_methods(root_module, root_module['ns3::PointToPointChannel'])
register_Ns3PointToPointNetDevice_methods(root_module, root_module['ns3::PointToPointNetDevice'])
return
def register_Ns3PointToPointChannel_methods(root_module, cls):
## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel(ns3::PointToPointChannel const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PointToPointChannel const &', 'arg0')])
## point-to-point-channel.h: static ns3::TypeId ns3::PointToPointChannel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel() [constructor]
cls.add_constructor([])
## point-to-point-channel.h: void ns3::PointToPointChannel::Attach(ns3::Ptr<ns3::PointToPointNetDevice> device) [member function]
cls.add_method('Attach',
'void',
[param('ns3::Ptr< ns3::PointToPointNetDevice >', 'device')])
## point-to-point-channel.h: bool ns3::PointToPointChannel::TransmitStart(ns3::Ptr<ns3::Packet> p, ns3::Ptr<ns3::PointToPointNetDevice> src, ns3::Time txTime) [member function]
cls.add_method('TransmitStart',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::PointToPointNetDevice >', 'src'), param('ns3::Time', 'txTime')])
## point-to-point-channel.h: uint32_t ns3::PointToPointChannel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True, is_virtual=True)
## point-to-point-channel.h: ns3::Ptr<ns3::PointToPointNetDevice> ns3::PointToPointChannel::GetPointToPointDevice(uint32_t i) const [member function]
cls.add_method('GetPointToPointDevice',
'ns3::Ptr< ns3::PointToPointNetDevice >',
[param('uint32_t', 'i')],
is_const=True)
## point-to-point-channel.h: ns3::Ptr<ns3::NetDevice> ns3::PointToPointChannel::GetDevice(uint32_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
return
def register_Ns3PointToPointNetDevice_methods(root_module, cls):
## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice(ns3::PointToPointNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PointToPointNetDevice const &', 'arg0')])
## point-to-point-net-device.h: static ns3::TypeId ns3::PointToPointNetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice() [constructor]
cls.add_constructor([])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetDataRate(ns3::DataRate bps) [member function]
cls.add_method('SetDataRate',
'void',
[param('ns3::DataRate', 'bps')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetInterframeGap(ns3::Time t) [member function]
cls.add_method('SetInterframeGap',
'void',
[param('ns3::Time', 't')])
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Attach(ns3::Ptr<ns3::PointToPointChannel> ch) [member function]
cls.add_method('Attach',
'bool',
[param('ns3::Ptr< ns3::PointToPointChannel >', 'ch')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function]
cls.add_method('SetQueue',
'void',
[param('ns3::Ptr< ns3::Queue >', 'queue')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function]
cls.add_method('SetReceiveErrorModel',
'void',
[param('ns3::Ptr< ns3::ErrorModel >', 'em')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::Receive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Mac48Address', 'addr')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
[param('std::string const', 'name')],
is_virtual=True)
## point-to-point-net-device.h: std::string ns3::PointToPointNetDevice::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_virtual=True)
## point-to-point-net-device.h: uint32_t ns3::PointToPointNetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Ptr<ns3::Channel> ns3::PointToPointNetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_virtual=True)
## point-to-point-net-device.h: uint16_t ns3::PointToPointNetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('SetLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast() const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('MakeMulticastAddress',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## point-to-point-net-device.h: ns3::Ptr<ns3::Node> ns3::PointToPointNetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')],
is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large. Load diff
+410
View File
@@ -0,0 +1,410 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## data-output-interface.h: ns3::DataOutputCallback [class]
module.add_class('DataOutputCallback', allow_subclassing=True)
## data-calculator.h: ns3::DataCalculator [class]
module.add_class('DataCalculator', parent=root_module['ns3::Object'])
## basic-data-calculators.h: ns3::CounterCalculator<unsigned int> [class]
module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
## data-collector.h: ns3::DataCollector [class]
module.add_class('DataCollector', parent=root_module['ns3::Object'])
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class]
module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator'])
## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int> [class]
module.add_class('MinMaxAvgTotalCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
## data-output-interface.h: ns3::DataOutputInterface [class]
module.add_class('DataOutputInterface', parent=root_module['ns3::Object'])
## packet-data-calculators.h: ns3::PacketCounterCalculator [class]
module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class]
module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
## omnet-data-output.h: ns3::OmnetDataOutput [class]
module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
register_Ns3CounterCalculator__Unsigned_int_methods(root_module, root_module['ns3::CounterCalculator< unsigned int >'])
register_Ns3DataCollector_methods(root_module, root_module['ns3::DataCollector'])
register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::TimeMinMaxAvgTotalCalculator'])
register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator'])
register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator'])
register_Ns3OmnetDataOutput_methods(root_module, root_module['ns3::OmnetDataOutput'])
return
def register_Ns3DataOutputCallback_methods(root_module, cls):
## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor]
cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback() [constructor]
cls.add_constructor([])
## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3DataCalculator_methods(root_module, cls):
## data-calculator.h: ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
## data-calculator.h: ns3::DataCalculator::DataCalculator() [constructor]
cls.add_constructor([])
## data-calculator.h: bool ns3::DataCalculator::GetEnabled() const [member function]
cls.add_method('GetEnabled',
'bool',
[],
is_const=True)
## data-calculator.h: void ns3::DataCalculator::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## data-calculator.h: void ns3::DataCalculator::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## data-calculator.h: void ns3::DataCalculator::SetKey(std::string const key) [member function]
cls.add_method('SetKey',
'void',
[param('std::string const', 'key')])
## data-calculator.h: std::string ns3::DataCalculator::GetKey() const [member function]
cls.add_method('GetKey',
'std::string',
[],
is_const=True)
## data-calculator.h: void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
cls.add_method('Start',
'void',
[param('ns3::Time const &', 'startTime')],
is_virtual=True)
## data-calculator.h: void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'stopTime')],
is_virtual=True)
## data-calculator.h: void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h: void ns3::DataCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3CounterCalculator__Unsigned_int_methods(root_module, cls):
## basic-data-calculators.h: ns3::CounterCalculator<unsigned int>::CounterCalculator(ns3::CounterCalculator<unsigned int> const & arg0) [copy constructor]
cls.add_constructor([param('ns3::CounterCalculator< unsigned int >', 'arg0')])
## basic-data-calculators.h: ns3::CounterCalculator<unsigned int>::CounterCalculator() [constructor]
cls.add_constructor([])
## basic-data-calculators.h: void ns3::CounterCalculator<unsigned int>::Update() [member function]
cls.add_method('Update',
'void',
[])
## basic-data-calculators.h: void ns3::CounterCalculator<unsigned int>::Update(unsigned int const i) [member function]
cls.add_method('Update',
'void',
[param('unsigned int const', 'i')])
## basic-data-calculators.h: unsigned int ns3::CounterCalculator<unsigned int>::GetCount() const [member function]
cls.add_method('GetCount',
'unsigned int',
[],
is_const=True)
## basic-data-calculators.h: void ns3::CounterCalculator<unsigned int>::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_const=True, is_virtual=True)
## basic-data-calculators.h: void ns3::CounterCalculator<unsigned int>::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
cls.add_copy_constructor()
return
def register_Ns3DataCollector_methods(root_module, cls):
## data-collector.h: ns3::DataCollector::DataCollector(ns3::DataCollector const & arg0) [copy constructor]
cls.add_constructor([param('ns3::DataCollector const &', 'arg0')])
## data-collector.h: ns3::DataCollector::DataCollector() [constructor]
cls.add_constructor([])
## data-collector.h: void ns3::DataCollector::DescribeRun(std::string experiment, std::string strategy, std::string input, std::string runID, std::string description="") [member function]
cls.add_method('DescribeRun',
'void',
[param('std::string', 'experiment'), param('std::string', 'strategy'), param('std::string', 'input'), param('std::string', 'runID'), param('std::string', 'description', default_value='""')])
## data-collector.h: std::string ns3::DataCollector::GetExperimentLabel() const [member function]
cls.add_method('GetExperimentLabel',
'std::string',
[],
is_const=True)
## data-collector.h: std::string ns3::DataCollector::GetStrategyLabel() const [member function]
cls.add_method('GetStrategyLabel',
'std::string',
[],
is_const=True)
## data-collector.h: std::string ns3::DataCollector::GetInputLabel() const [member function]
cls.add_method('GetInputLabel',
'std::string',
[],
is_const=True)
## data-collector.h: std::string ns3::DataCollector::GetRunLabel() const [member function]
cls.add_method('GetRunLabel',
'std::string',
[],
is_const=True)
## data-collector.h: std::string ns3::DataCollector::GetDescription() const [member function]
cls.add_method('GetDescription',
'std::string',
[],
is_const=True)
## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, std::string value) [member function]
cls.add_method('AddMetadata',
'void',
[param('std::string', 'key'), param('std::string', 'value')])
## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, double value) [member function]
cls.add_method('AddMetadata',
'void',
[param('std::string', 'key'), param('double', 'value')])
## data-collector.h: void ns3::DataCollector::AddMetadata(std::string key, uint32_t value) [member function]
cls.add_method('AddMetadata',
'void',
[param('std::string', 'key'), param('uint32_t', 'value')])
## data-collector.h: std::_List_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::DataCollector::MetadataBegin() [member function]
cls.add_method('MetadataBegin',
'std::_List_iterator< std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > > >',
[])
## data-collector.h: std::_List_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::DataCollector::MetadataEnd() [member function]
cls.add_method('MetadataEnd',
'std::_List_iterator< std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > > >',
[])
## data-collector.h: void ns3::DataCollector::AddDataCalculator(ns3::Ptr<ns3::DataCalculator> datac) [member function]
cls.add_method('AddDataCalculator',
'void',
[param('ns3::Ptr< ns3::DataCalculator >', 'datac')])
## data-collector.h: std::_List_iterator<ns3::Ptr<ns3::DataCalculator> > ns3::DataCollector::DataCalculatorBegin() [member function]
cls.add_method('DataCalculatorBegin',
'std::_List_iterator< ns3::Ptr< ns3::DataCalculator > >',
[])
## data-collector.h: std::_List_iterator<ns3::Ptr<ns3::DataCalculator> > ns3::DataCollector::DataCalculatorEnd() [member function]
cls.add_method('DataCalculatorEnd',
'std::_List_iterator< ns3::Ptr< ns3::DataCalculator > >',
[])
## data-collector.h: void ns3::DataCollector::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, cls):
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator(ns3::TimeMinMaxAvgTotalCalculator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TimeMinMaxAvgTotalCalculator const &', 'arg0')])
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator() [constructor]
cls.add_constructor([])
## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::Update(ns3::Time const i) [member function]
cls.add_method('Update',
'void',
[param('ns3::Time const', 'i')])
## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_const=True, is_virtual=True)
## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, cls):
## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<unsigned int> const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< unsigned int >', 'arg0')])
## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int>::MinMaxAvgTotalCalculator() [constructor]
cls.add_constructor([])
## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator<unsigned int>::Update(unsigned int const i) [member function]
cls.add_method('Update',
'void',
[param('unsigned int const', 'i')])
## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator<unsigned int>::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_const=True, is_virtual=True)
## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator<unsigned int>::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
cls.add_copy_constructor()
return
def register_Ns3DataOutputInterface_methods(root_module, cls):
## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor]
cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface() [constructor]
cls.add_constructor([])
## data-output-interface.h: void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h: void ns3::DataOutputInterface::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3PacketCounterCalculator_methods(root_module, cls):
## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator(ns3::PacketCounterCalculator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PacketCounterCalculator const &', 'arg0')])
## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator() [constructor]
cls.add_constructor([])
## packet-data-calculators.h: void ns3::PacketCounterCalculator::PacketUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PacketUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< const ns3::Packet >', 'packet')])
## packet-data-calculators.h: void ns3::PacketCounterCalculator::FrameUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address realto) [member function]
cls.add_method('FrameUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'realto')])
## packet-data-calculators.h: void ns3::PacketCounterCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls):
## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator(ns3::PacketSizeMinMaxAvgTotalCalculator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PacketSizeMinMaxAvgTotalCalculator const &', 'arg0')])
## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() [constructor]
cls.add_constructor([])
## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PacketUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< const ns3::Packet >', 'packet')])
## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address realto) [member function]
cls.add_method('FrameUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< const ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'realto')])
## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3OmnetDataOutput_methods(root_module, cls):
## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput(ns3::OmnetDataOutput const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OmnetDataOutput const &', 'arg0')])
## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput() [constructor]
cls.add_constructor([])
## omnet-data-output.h: void ns3::OmnetDataOutput::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_virtual=True)
## omnet-data-output.h: void ns3::OmnetDataOutput::SetFilePrefix(std::string const prefix) [member function]
cls.add_method('SetFilePrefix',
'void',
[param('std::string const', 'prefix')])
## omnet-data-output.h: std::string ns3::OmnetDataOutput::GetFilePrefix() const [member function]
cls.add_method('GetFilePrefix',
'std::string',
[],
is_const=True)
## omnet-data-output.h: void ns3::OmnetDataOutput::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+133
View File
@@ -0,0 +1,133 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## udp-echo-client.h: ns3::UdpEchoClient [class]
module.add_class('UdpEchoClient', parent=root_module['ns3::Application'])
## udp-echo-server.h: ns3::UdpEchoServer [class]
module.add_class('UdpEchoServer', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3UdpEchoClient_methods(root_module, root_module['ns3::UdpEchoClient'])
register_Ns3UdpEchoServer_methods(root_module, root_module['ns3::UdpEchoServer'])
return
def register_Ns3UdpEchoClient_methods(root_module, cls):
## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient(ns3::UdpEchoClient const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UdpEchoClient const &', 'arg0')])
## udp-echo-client.h: static ns3::TypeId ns3::UdpEchoClient::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient() [constructor]
cls.add_constructor([])
## udp-echo-client.h: void ns3::UdpEchoClient::SetRemote(ns3::Ipv4Address ip, uint16_t port) [member function]
cls.add_method('SetRemote',
'void',
[param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')])
## udp-echo-client.h: void ns3::UdpEchoClient::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## udp-echo-client.h: void ns3::UdpEchoClient::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## udp-echo-client.h: void ns3::UdpEchoClient::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3UdpEchoServer_methods(root_module, cls):
## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer(ns3::UdpEchoServer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UdpEchoServer const &', 'arg0')])
## udp-echo-server.h: static ns3::TypeId ns3::UdpEchoServer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer() [constructor]
cls.add_constructor([])
## udp-echo-server.h: void ns3::UdpEchoServer::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## udp-echo-server.h: void ns3::UdpEchoServer::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## udp-echo-server.h: void ns3::UdpEchoServer::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large. Load diff
+178
View File
@@ -0,0 +1,178 @@
#include "ns3module.h"
namespace ns3{
void PythonCompleteConstruct (Ptr<Object> object, TypeId typeId, const AttributeList &attributes)
{
object->SetTypeId (typeId);
object->Object::Construct (attributes);
}
}
class PythonEventImpl : public ns3::EventImpl
{
private:
PyObject *m_callback;
PyObject *m_args;
public:
PythonEventImpl (PyObject *callback, PyObject *args)
{
m_callback = callback;
Py_INCREF(m_callback);
m_args = args;
Py_INCREF(m_args);
}
virtual ~PythonEventImpl ()
{
Py_DECREF(m_callback);
Py_DECREF(m_args);
}
virtual void Notify ()
{
PyObject *retval = PyObject_CallObject(m_callback, m_args);
if (retval) {
if (retval != Py_None) {
PyErr_SetString(PyExc_TypeError, "event callback should return None");
PyErr_Print();
}
Py_DECREF(retval);
} else {
PyErr_Print();
}
}
};
PyObject *
_wrap_Simulator_Schedule(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
PyObject *exc_type, *traceback;
PyObject *py_time;
PyObject *py_callback;
PyObject *user_args;
ns3::Ptr<PythonEventImpl> py_event_impl;
PyNs3EventId *py_EventId;
if (kwargs && PyObject_Length(kwargs) > 0) {
PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
goto error;
}
if (PyTuple_GET_SIZE(args) < 2) {
PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 2 arguments");
goto error;
}
py_time = PyTuple_GET_ITEM(args, 0);
py_callback = PyTuple_GET_ITEM(args, 1);
if (!PyObject_IsInstance(py_time, (PyObject*) &PyNs3Time_Type)) {
PyErr_SetString(PyExc_TypeError, "Parameter 1 should be a ns3.Time instance");
goto error;
}
if (!PyCallable_Check(py_callback)) {
PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
goto error;
}
user_args = PyTuple_GetSlice(args, 2, PyTuple_GET_SIZE(args));
py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
Py_DECREF(user_args);
py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
py_EventId->obj = new ns3::EventId(
ns3::Simulator::Schedule(*((PyNs3Time *) py_time)->obj, py_event_impl));
return (PyObject *) py_EventId;
error:
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
return NULL;
}
PyObject *
_wrap_Simulator_ScheduleNow(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
PyObject *exc_type, *traceback;
PyObject *py_callback;
PyObject *user_args;
ns3::Ptr<PythonEventImpl> py_event_impl;
PyNs3EventId *py_EventId;
if (kwargs && PyObject_Length(kwargs) > 0) {
PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
goto error;
}
if (PyTuple_GET_SIZE(args) < 1) {
PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
goto error;
}
py_callback = PyTuple_GET_ITEM(args, 0);
if (!PyCallable_Check(py_callback)) {
PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
goto error;
}
user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
Py_DECREF(user_args);
py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleNow(py_event_impl));
return (PyObject *) py_EventId;
error:
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
return NULL;
}
PyObject *
_wrap_Simulator_ScheduleDestroy(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
PyObject *exc_type, *traceback;
PyObject *py_callback;
PyObject *user_args;
ns3::Ptr<PythonEventImpl> py_event_impl;
PyNs3EventId *py_EventId;
if (kwargs && PyObject_Length(kwargs) > 0) {
PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
goto error;
}
if (PyTuple_GET_SIZE(args) < 1) {
PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
goto error;
}
py_callback = PyTuple_GET_ITEM(args, 0);
if (!PyCallable_Check(py_callback)) {
PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
goto error;
}
user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
Py_DECREF(user_args);
py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleDestroy(py_event_impl));
return (PyObject *) py_EventId;
error:
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
return NULL;
}
+144
View File
@@ -0,0 +1,144 @@
LOCAL_MODULES = [
#'my_extra_api_definitions',
]
import sys
import os
from pybindgen import FileCodeSink, write_preamble
from pybindgen.module import MultiSectionFactory
import pybindgen.settings
from ns3modulegen_generated import module_init, register_types, register_methods, register_functions
import ns3modulegen_core_customizations
import callbacks_list
this_script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
try:
stack = wrapper.stack_where_defined
except AttributeError:
print >> sys.stderr, "??:??: %s / %r" % (wrapper, exception)
else:
stack = list(stack)
stack.reverse()
for (filename, line_number, function_name, text) in stack:
file_dir = os.path.dirname(os.path.abspath(filename))
if file_dir == this_script_dir:
print >> sys.stderr, "%s:%i: %r" % (os.path.join("..", "bindings", "python", os.path.basename(filename)),
line_number, exception)
break
return True
pybindgen.settings.error_handler = ErrorHandler()
pybindgen.settings.wrapper_registry = pybindgen.settings.StdMapWrapperRegistry
class MyMultiSectionFactory(MultiSectionFactory):
def __init__(self, main_file_name, modules):
super(MyMultiSectionFactory, self).__init__()
self.main_file_name = main_file_name
self.main_sink = FileCodeSink(open(main_file_name, "wt"))
self.header_name = "ns3module.h"
header_file_name = os.path.join(os.path.dirname(self.main_file_name), self.header_name)
self.header_sink = FileCodeSink(open(header_file_name, "wt"))
self.section_sinks = {'__main__': self.main_sink}
for module in modules:
section_name = 'ns3_module_%s' % module.replace('-', '_')
file_name = os.path.join(os.path.dirname(self.main_file_name), "%s.cc" % section_name)
sink = FileCodeSink(open(file_name, "wt"))
self.section_sinks[section_name] = sink
def get_section_code_sink(self, section_name):
return self.section_sinks[section_name]
def get_main_code_sink(self):
return self.main_sink
def get_common_header_code_sink(self):
return self.header_sink
def get_common_header_include(self):
return '"%s"' % self.header_name
def close(self):
self.header_sink.file.close()
self.main_sink.file.close()
for sink in self.section_sinks.itervalues():
sink.file.close()
def main():
out = MyMultiSectionFactory(sys.argv[1], sys.argv[2:])
root_module = module_init()
root_module.add_include('"everything.h"')
register_types(root_module)
ns3modulegen_core_customizations.Simulator_customizations(root_module)
ns3modulegen_core_customizations.CommandLine_customizations(root_module)
for local_module in LOCAL_MODULES:
mod = __import__(local_module)
mod.register_types(root_module)
ns3modulegen_core_customizations.generate_callback_classes(root_module.after_forward_declarations,
callbacks_list.callback_classes)
register_methods(root_module)
for local_module in LOCAL_MODULES:
mod = __import__(local_module)
mod.register_methods(root_module)
ns3modulegen_core_customizations.Object_customizations(root_module)
ns3modulegen_core_customizations.Attribute_customizations(root_module)
register_functions(root_module)
for local_module in LOCAL_MODULES:
mod = __import__(local_module)
mod.register_functions(root_module)
enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
# if GtkConfigStore support is disabled, disable the class wrapper
if 'GtkConfigStore' not in enabled_features:
try:
root_module.classes.remove(root_module['ns3::GtkConfigStore'])
except KeyError:
pass
# if no sqlite, the class SqliteDataOutput is disabled
if 'SqliteDataOutput' not in enabled_features:
try:
root_module.classes.remove(root_module['ns3::SqliteDataOutput'])
except KeyError:
pass
if 'Threading' not in enabled_features:
for clsname in ['SystemThread', 'SystemMutex', 'SystemCondition', 'CriticalSection']:
root_module.classes.remove(root_module['ns3::%s' % clsname])
if 'RealTime' not in enabled_features:
for clsname in ['WallClockSynchronizer', 'RealtimeSimulatorImpl', 'RealtimeEventLock']:
root_module.classes.remove(root_module['ns3::%s' % clsname])
root_module.enums.remove(root_module['ns3::RealtimeSimulatorImpl::SynchronizationMode'])
root_module.generate(out, '_ns3')
out.close()
if __name__ == '__main__':
main()
@@ -0,0 +1,519 @@
import re
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.typehandlers import ctypeparser
from pybindgen import cppclass
import warnings
from pybindgen.typehandlers.base import CodeGenerationError
import sys
class SmartPointerTransformation(typehandlers.TypeTransformation):
"""
This class provides a "type transformation" that tends to support
NS-3 smart pointers. Parameters such as "Ptr<Foo> foo" are
transformed into something like Parameter.new("Foo*", "foo",
transfer_ownership=False). Return values such as Ptr<Foo> are
transformed into ReturnValue.new("Foo*",
caller_owns_return=False). Since the underlying objects have
reference counting, PyBindGen does the right thing.
"""
def __init__(self):
super(SmartPointerTransformation, self).__init__()
self.rx = re.compile(r'(ns3::|::ns3::|)Ptr<([^>]+)>')
def _get_untransformed_type_traits(self, name):
m = self.rx.match(name)
is_const = False
if m is None:
return None, False
else:
name1 = m.group(2).strip()
if name1.startswith('const '):
name1 = name1[len('const '):]
is_const = True
if name1.endswith(' const'):
name1 = name1[:-len(' const')]
is_const = True
new_name = name1+' *'
if new_name.startswith('::'):
new_name = new_name[2:]
return new_name, is_const
def get_untransformed_name(self, name):
new_name, dummy_is_const = self._get_untransformed_type_traits(name)
return new_name
def create_type_handler(self, type_handler, *args, **kwargs):
if issubclass(type_handler, Parameter):
kwargs['transfer_ownership'] = False
elif issubclass(type_handler, ReturnValue):
kwargs['caller_owns_return'] = False
else:
raise AssertionError
## fix the ctype, add ns3:: namespace
orig_ctype, is_const = self._get_untransformed_type_traits(args[0])
if is_const:
correct_ctype = 'ns3::Ptr< %s const >' % orig_ctype[:-2]
else:
correct_ctype = 'ns3::Ptr< %s >' % orig_ctype[:-2]
args = tuple([correct_ctype] + list(args[1:]))
handler = type_handler(*args, **kwargs)
handler.set_tranformation(self, orig_ctype)
return handler
def untransform(self, type_handler, declarations, code_block, expression):
return 'const_cast<%s> (ns3::PeekPointer (%s))' % (type_handler.untransformed_ctype, expression)
def transform(self, type_handler, declarations, code_block, expression):
assert type_handler.untransformed_ctype[-1] == '*'
return 'ns3::Ptr< %s > (%s)' % (type_handler.untransformed_ctype[:-1], expression)
## register the type transformation
transf = SmartPointerTransformation()
typehandlers.return_type_matcher.register_transformation(transf)
typehandlers.param_type_matcher.register_transformation(transf)
del transf
class ArgvParam(Parameter):
"""
Converts a python list-of-strings argument to a pair of 'int argc,
char *argv[]' arguments to pass into C.
One Python argument becomes two C function arguments -> it's a miracle!
Note: this parameter type handler is not registered by any name;
must be used explicitly.
"""
DIRECTIONS = [Parameter.DIRECTION_IN]
CTYPES = []
def convert_c_to_python(self, wrapper):
raise NotImplementedError
def convert_python_to_c(self, wrapper):
py_name = wrapper.declarations.declare_variable('PyObject*', 'py_' + self.name)
argc_var = wrapper.declarations.declare_variable('int', 'argc')
name = wrapper.declarations.declare_variable('char**', self.name)
idx = wrapper.declarations.declare_variable('Py_ssize_t', 'idx')
wrapper.parse_params.add_parameter('O!', ['&PyList_Type', '&'+py_name], self.name)
#wrapper.before_call.write_error_check('!PyList_Check(%s)' % py_name) # XXX
wrapper.before_call.write_code("%s = (char **) malloc(sizeof(char*)*PyList_Size(%s));"
% (name, py_name))
wrapper.before_call.add_cleanup_code('free(%s);' % name)
wrapper.before_call.write_code('''
for (%(idx)s = 0; %(idx)s < PyList_Size(%(py_name)s); %(idx)s++)
{
''' % vars())
wrapper.before_call.sink.indent()
wrapper.before_call.write_code('''
PyObject *item = PyList_GET_ITEM(%(py_name)s, %(idx)s);
''' % vars())
#wrapper.before_call.write_error_check('item == NULL')
wrapper.before_call.write_error_check(
'!PyString_Check(item)',
failure_cleanup=('PyErr_SetString(PyExc_TypeError, '
'"argument %s must be a list of strings");') % self.name)
wrapper.before_call.write_code(
'%s[%s] = PyString_AsString(item);' % (name, idx))
wrapper.before_call.sink.unindent()
wrapper.before_call.write_code('}')
wrapper.before_call.write_code('%s = PyList_Size(%s);' % (argc_var, py_name))
wrapper.call_params.append(argc_var)
wrapper.call_params.append(name)
class CallbackImplProxyMethod(typehandlers.ReverseWrapperBase):
"""
Class that generates a proxy virtual method that calls a similarly named python method.
"""
def __init__(self, return_value, parameters):
super(CallbackImplProxyMethod, self).__init__(return_value, parameters)
def generate_python_call(self):
"""code to call the python method"""
build_params = self.build_params.get_parameters(force_tuple_creation=True)
if build_params[0][0] == '"':
build_params[0] = '(char *) ' + build_params[0]
args = self.before_call.declare_variable('PyObject*', 'args')
self.before_call.write_code('%s = Py_BuildValue(%s);'
% (args, ', '.join(build_params)))
self.before_call.add_cleanup_code('Py_DECREF(%s);' % args)
self.before_call.write_code('py_retval = PyObject_CallObject(m_callback, %s);' % args)
self.before_call.write_error_check('py_retval == NULL')
self.before_call.add_cleanup_code('Py_DECREF(py_retval);')
def generate_callback_classes(out, callbacks):
for callback_impl_num, template_parameters in enumerate(callbacks):
sink = MemoryCodeSink()
cls_name = "ns3::Callback< %s >" % ', '.join(template_parameters)
#print >> sys.stderr, "***** trying to register callback: %r" % cls_name
class_name = "PythonCallbackImpl%i" % callback_impl_num
sink.writeln('''
class %s : public ns3::CallbackImpl<%s>
{
public:
PyObject *m_callback;
%s(PyObject *callback)
{
Py_INCREF(callback);
m_callback = callback;
}
virtual ~%s()
{
Py_DECREF(m_callback);
m_callback = NULL;
}
virtual bool IsEqual(ns3::Ptr<const ns3::CallbackImplBase> other_base) const
{
const %s *other = dynamic_cast<const %s*> (ns3::PeekPointer (other_base));
if (other != NULL)
return (other->m_callback == m_callback);
else
return false;
}
''' % (class_name, ', '.join(template_parameters), class_name, class_name, class_name, class_name))
sink.indent()
callback_return = template_parameters[0]
return_ctype = ctypeparser.parse_type(callback_return)
if ('const' in return_ctype.remove_modifiers()):
kwargs = {'is_const': True}
else:
kwargs = {}
try:
return_type = ReturnValue.new(str(return_ctype), **kwargs)
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError), ex:
warnings.warn("***** Unable to register callback; Return value '%s' error (used in %s): %r"
% (callback_return, cls_name, ex),
Warning)
continue
arguments = []
ok = True
callback_parameters = [arg for arg in template_parameters[1:] if arg != 'ns3::empty']
for arg_num, arg_type in enumerate(callback_parameters):
arg_name = 'arg%i' % (arg_num+1)
param_ctype = ctypeparser.parse_type(arg_type)
if ('const' in param_ctype.remove_modifiers()):
kwargs = {'is_const': True}
else:
kwargs = {}
try:
arguments.append(Parameter.new(str(param_ctype), arg_name, **kwargs))
except (typehandlers.TypeLookupError, typehandlers.TypeConfigurationError), ex:
warnings.warn("***** Unable to register callback; parameter '%s %s' error (used in %s): %r"
% (arg_type, arg_name, cls_name, ex),
Warning)
ok = False
if not ok:
continue
wrapper = CallbackImplProxyMethod(return_type, arguments)
wrapper.generate(sink, 'operator()', decl_modifiers=[])
sink.unindent()
sink.writeln('};\n')
sink.flush_to(out)
class PythonCallbackParameter(Parameter):
"Class handlers"
CTYPES = [cls_name]
#print >> sys.stderr, "***** registering callback handler: %r" % ctypeparser.normalize_type_string(cls_name)
DIRECTIONS = [Parameter.DIRECTION_IN]
PYTHON_CALLBACK_IMPL_NAME = class_name
TEMPLATE_ARGS = template_parameters
def convert_python_to_c(self, wrapper):
"parses python args to get C++ value"
assert isinstance(wrapper, typehandlers.ForwardWrapperBase)
py_callback = wrapper.declarations.declare_variable('PyObject*', self.name)
wrapper.parse_params.add_parameter('O', ['&'+py_callback], self.name)
wrapper.before_call.write_error_check(
'!PyCallable_Check(%s)' % py_callback,
'PyErr_SetString(PyExc_TypeError, "parameter \'%s\' must be callbale");' % self.name)
callback_impl = wrapper.declarations.declare_variable(
'ns3::Ptr<%s>' % self.PYTHON_CALLBACK_IMPL_NAME,
'%s_cb_impl' % self.name)
wrapper.before_call.write_code("%s = ns3::Create<%s> (%s);"
% (callback_impl, self.PYTHON_CALLBACK_IMPL_NAME, py_callback))
wrapper.call_params.append(
'ns3::Callback<%s> (%s)' % (', '.join(self.TEMPLATE_ARGS), callback_impl))
def convert_c_to_python(self, wrapper):
raise typehandlers.NotSupportedError("Reverse wrappers for ns3::Callback<...> types "
"(python using callbacks defined in C++) not implemented.")
# def write_preamble(out):
# pybindgen.write_preamble(out)
# out.writeln("#include \"ns3/everything.h\"")
def Simulator_customizations(module):
Simulator = module['ns3::Simulator']
## Simulator::Schedule(delay, callback, ...user..args...)
Simulator.add_custom_method_wrapper("Schedule", "_wrap_Simulator_Schedule",
flags=["METH_VARARGS", "METH_KEYWORDS", "METH_STATIC"])
## Simulator::ScheduleNow(callback, ...user..args...)
Simulator.add_custom_method_wrapper("ScheduleNow", "_wrap_Simulator_ScheduleNow",
flags=["METH_VARARGS", "METH_KEYWORDS", "METH_STATIC"])
## Simulator::ScheduleDestroy(callback, ...user..args...)
Simulator.add_custom_method_wrapper("ScheduleDestroy", "_wrap_Simulator_ScheduleDestroy",
flags=["METH_VARARGS", "METH_KEYWORDS", "METH_STATIC"])
def CommandLine_customizations(module):
CommandLine = module['ns3::CommandLine']
CommandLine.add_method('Parse', None, [ArgvParam(None, 'argv')],
is_static=False)
def Object_customizations(module):
## ---------------------------------------------------------------------
## Here we generate custom constructor code for all classes that
## derive from ns3::Object. The custom constructors are needed in
## order to support kwargs only and to translate kwargs into ns3
## attributes, etc.
## ---------------------------------------------------------------------
Object = module['ns3::Object']
## add a GetTypeId method to all generatd helper classes
def helper_class_hook(helper_class):
decl = """
static ns3::TypeId GetTypeId (void)
{
static ns3::TypeId tid = ns3::TypeId ("%s")
.SetParent< %s > ()
;
return tid;
}""" % (helper_class.name, helper_class.class_.full_name)
helper_class.add_custom_method(decl)
helper_class.add_post_generation_code(
"NS_OBJECT_ENSURE_REGISTERED (%s);" % helper_class.name)
Object.add_helper_class_hook(helper_class_hook)
## Replace all class constructors with a generic constructor based on CreateObject<T> (AttributeList)
module.header.writeln('''
namespace ns3 {
void PythonCompleteConstruct (Ptr<Object> object, TypeId typeId, const AttributeList &attributes);
template <typename T>
Ptr<T> CreateObjectPython (PyObject *pyobj, const AttributeList &attributes)
{
Ptr<T> p = Ptr<T> (new T (), false);
p->set_pyobj (pyobj);
PythonCompleteConstruct (p, T::GetTypeId (), attributes);
return p;
}
} // namespace ns3
''')
for cls in module.classes:
if not cls.is_subclass(Object):
continue
cls.constructors = [] # clear the list of constructors
## add our own custom constructor, if possible
try:
construct_name = cls.get_construct_name()
except CodeGenerationError:
construct_name = None
if construct_name and not cls.helper_class:
construct_code = '''
ns3::Ptr< %(CONSTRUCT_NAME)s > obj = ns3::CreateObject< %(CONSTRUCT_NAME)s > (attrList);
obj->Ref ();
self->obj = ns3::PeekPointer (obj);
''' % dict (CONSTRUCT_NAME=construct_name)
elif not construct_name and not cls.helper_class:
continue
elif not construct_name and cls.helper_class:
construct_code = '''
if (self->ob_type != &%(PYTYPESTRUCT)s)
{
ns3::Ptr< %(HELPER_CLASS_NAME)s > obj = ns3::CreateObjectPython< %(HELPER_CLASS_NAME)s > ((PyObject *)self, attrList);
obj->Ref ();
self->obj = ns3::PeekPointer (obj);
} else {
PyErr_SetString(PyExc_TypeError, "Class cannot be constructed (unless subclassed)");
{
PyObject *exc_type, *traceback;
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
}
return -1;
}
''' % dict (CONSTRUCT_NAME=construct_name, HELPER_CLASS_NAME=cls.helper_class.name,
PYTYPESTRUCT=cls.pytypestruct)
elif construct_name and cls.helper_class:
construct_code = '''
if (self->ob_type != &%(PYTYPESTRUCT)s)
{
ns3::Ptr< %(HELPER_CLASS_NAME)s > obj = ns3::CreateObjectPython< %(HELPER_CLASS_NAME)s > ((PyObject *)self, attrList);
obj->Ref ();
self->obj = ns3::PeekPointer (obj);
} else {
ns3::Ptr< %(CONSTRUCT_NAME)s > obj = ns3::CreateObject< %(CONSTRUCT_NAME)s > (attrList);
obj->Ref ();
self->obj = ns3::PeekPointer (obj);
}
''' % dict (CONSTRUCT_NAME=construct_name, HELPER_CLASS_NAME=cls.helper_class.name,
PYTYPESTRUCT=cls.pytypestruct)
else:
raise AssertionError
wrapper_name = "_wrap_create_object_%s" % (cls.mangled_full_name,)
constructor = '''
static int %(WRAPPER_NAME)s (%(PYSTRUCT)s *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
if (PyTuple_Size(args)) {
PyErr_SetString(PyExc_TypeError, "positional arguments not supported "
"for ns3.Object constructors, only keyword arguments"
" should be used (AttributeName=Value)");
{
PyObject *exc_type, *traceback;
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
}
return -1;
}
ns3::AttributeList attrList;
if (kwargs && KwargsToAttributeList(kwargs, %(CLASS_NAME)s::GetTypeId(), attrList)) {
{
PyObject *exc_type, *traceback;
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
}
return -1;
}
%(CONSTRUCT_CODE)s
return 0;
}
''' % dict(WRAPPER_NAME=wrapper_name, PYSTRUCT=cls.pystruct, CLASS_NAME=cls.full_name,
CONSTRUCT_CODE=construct_code, PURE_VIRTUALS=cls.have_pure_virtual_methods)
cls.add_constructor(CustomCppConstructorWrapper(wrapper_name, constructor))
# Generate conversion function from PyObject* to AttributeValue
# sink = module.body
# sink.writeln('''
# Ptr<AttributeValue> AttributeValueFromPyObject (PyObject *obj)
# {
# // note: needs to check for bool first, because bool is a subclass of int
# if (PyBool_Check(obj)) {
# return Create<BooleanValue>(PyObject_IsTrue(obj));
# } else if (PyInt_Check(obj)) {
# return Create<IntegerValue>(PyInt_AsLong(obj));
# } else if (PyLong_Check(obj)) {
# return Create<IntegerValue>(PyLong_AsLongLong(obj));
# } else if (PyFloat_Check(obj)) {
# return Create<DoubleValue>(PyFloat_AsDouble(obj));
# }
# ''')
## ---------------------------------------------------------------------
## -------------- write the KwargsToAttributeList function -------------
## ---------------------------------------------------------------------
Attribute = module['ns3::AttributeValue']
module.after_forward_declarations.writeln(
'int KwargsToAttributeList(PyObject *kwargs, ns3::TypeId tid, ns3::AttributeList &oAttrList);')
module.body.writeln(
'''
int KwargsToAttributeList(PyObject *kwargs, ns3::TypeId tid, ns3::AttributeList &oAttrList)
{
PyObject *key, *value;
Py_ssize_t pos = 0;
while (PyDict_Next(kwargs, &pos, &key, &value)) {
if (!PyString_Check(key)) {
PyErr_SetString(PyExc_TypeError, "kwargs keys must be strings");
return -1;
}
if (PyObject_IsInstance(value, (PyObject*) &%s)) {
oAttrList.SetWithTid(tid, PyString_AsString(key), *((%s *) value)->obj);''' \
% (Attribute.pytypestruct, Attribute.pystruct))
for conversion_source in Attribute.get_all_implicit_conversions():
module.body.writeln('''
} else if (PyObject_IsInstance(value, (PyObject*) &%s)) {
oAttrList.SetWithTid(tid, PyString_AsString(key), *((%s *) value)->obj);''' \
% (conversion_source.pytypestruct, conversion_source.pystruct))
possible_type_names = ", ".join([cls.name for cls in [Attribute] + Attribute.get_all_implicit_conversions()])
module.body.writeln('''
} else {
PyErr_Format(PyExc_TypeError, \"parameter must an instance of one of the types (%s), not %%s\", value->ob_type->tp_name);
return -1;
}''' % (possible_type_names))
module.body.writeln(
'''
}
return 0;
}
''')
def Attribute_customizations(module):
# Fix up for the "const AttributeValue &v = EmptyAttribute()"
# case, as used extensively by helper classes.
# Here's why we need to do this: pybindgen.gccxmlscanner, when
# scanning parameter default values, is only provided with the
# value as a simple C expression string. (py)gccxml does not
# report the type of the default value.
# As a workaround, here we iterate over all parameters of all
# methods of all classes and tell pybindgen what is the type of
# the default value for attributes.
for cls in module.classes:
for meth in cls.get_all_methods():
for param in meth.parameters:
if isinstance(param, cppclass.CppClassRefParameter):
if param.cpp_class.name == 'AttributeValue' \
and param.default_value is not None \
and param.default_value_type is None:
param.default_value_type = 'ns3::EmptyAttributeValue'
+709
View File
@@ -0,0 +1,709 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
return True
pybindgen.settings.error_handler = ErrorHandler()
import sys
import ns3_module_core
import ns3_module_simulator
import ns3_module_mobility
import ns3_module_common
import ns3_module_contrib
import ns3_module_node
import ns3_module_point_to_point
import ns3_module_stats
import ns3_module_internet_stack
import ns3_module_wifi
import ns3_module_csma
import ns3_module_bridge
import ns3_module_packet_sink
import ns3_module_global_routing
import ns3_module_onoff
import ns3_module_olsr
import ns3_module_udp_echo
import ns3_module_helper
def module_init():
root_module = Module('ns3', cpp_namespace='::ns3')
return root_module
def register_types(module):
root_module = module.get_root()
root_module.begin_section('ns3_module_core')
ns3_module_core.register_types(module)
try:
import ns3_module_core__local
except ImportError:
pass
else:
ns3_module_core__local.register_types(module)
root_module.end_section('ns3_module_core')
root_module.begin_section('ns3_module_simulator')
ns3_module_simulator.register_types(module)
try:
import ns3_module_simulator__local
except ImportError:
pass
else:
ns3_module_simulator__local.register_types(module)
root_module.end_section('ns3_module_simulator')
root_module.begin_section('ns3_module_mobility')
ns3_module_mobility.register_types(module)
try:
import ns3_module_mobility__local
except ImportError:
pass
else:
ns3_module_mobility__local.register_types(module)
root_module.end_section('ns3_module_mobility')
root_module.begin_section('ns3_module_common')
ns3_module_common.register_types(module)
try:
import ns3_module_common__local
except ImportError:
pass
else:
ns3_module_common__local.register_types(module)
root_module.end_section('ns3_module_common')
root_module.begin_section('ns3_module_contrib')
ns3_module_contrib.register_types(module)
try:
import ns3_module_contrib__local
except ImportError:
pass
else:
ns3_module_contrib__local.register_types(module)
root_module.end_section('ns3_module_contrib')
root_module.begin_section('ns3_module_node')
ns3_module_node.register_types(module)
try:
import ns3_module_node__local
except ImportError:
pass
else:
ns3_module_node__local.register_types(module)
root_module.end_section('ns3_module_node')
root_module.begin_section('ns3_module_point_to_point')
ns3_module_point_to_point.register_types(module)
try:
import ns3_module_point_to_point__local
except ImportError:
pass
else:
ns3_module_point_to_point__local.register_types(module)
root_module.end_section('ns3_module_point_to_point')
root_module.begin_section('ns3_module_stats')
ns3_module_stats.register_types(module)
try:
import ns3_module_stats__local
except ImportError:
pass
else:
ns3_module_stats__local.register_types(module)
root_module.end_section('ns3_module_stats')
root_module.begin_section('ns3_module_internet_stack')
ns3_module_internet_stack.register_types(module)
try:
import ns3_module_internet_stack__local
except ImportError:
pass
else:
ns3_module_internet_stack__local.register_types(module)
root_module.end_section('ns3_module_internet_stack')
root_module.begin_section('ns3_module_wifi')
ns3_module_wifi.register_types(module)
try:
import ns3_module_wifi__local
except ImportError:
pass
else:
ns3_module_wifi__local.register_types(module)
root_module.end_section('ns3_module_wifi')
root_module.begin_section('ns3_module_csma')
ns3_module_csma.register_types(module)
try:
import ns3_module_csma__local
except ImportError:
pass
else:
ns3_module_csma__local.register_types(module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_types(module)
try:
import ns3_module_bridge__local
except ImportError:
pass
else:
ns3_module_bridge__local.register_types(module)
root_module.end_section('ns3_module_bridge')
root_module.begin_section('ns3_module_packet_sink')
ns3_module_packet_sink.register_types(module)
try:
import ns3_module_packet_sink__local
except ImportError:
pass
else:
ns3_module_packet_sink__local.register_types(module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_types(module)
try:
import ns3_module_global_routing__local
except ImportError:
pass
else:
ns3_module_global_routing__local.register_types(module)
root_module.end_section('ns3_module_global_routing')
root_module.begin_section('ns3_module_onoff')
ns3_module_onoff.register_types(module)
try:
import ns3_module_onoff__local
except ImportError:
pass
else:
ns3_module_onoff__local.register_types(module)
root_module.end_section('ns3_module_onoff')
root_module.begin_section('ns3_module_olsr')
ns3_module_olsr.register_types(module)
try:
import ns3_module_olsr__local
except ImportError:
pass
else:
ns3_module_olsr__local.register_types(module)
root_module.end_section('ns3_module_olsr')
root_module.begin_section('ns3_module_udp_echo')
ns3_module_udp_echo.register_types(module)
try:
import ns3_module_udp_echo__local
except ImportError:
pass
else:
ns3_module_udp_echo__local.register_types(module)
root_module.end_section('ns3_module_udp_echo')
root_module.begin_section('ns3_module_helper')
ns3_module_helper.register_types(module)
try:
import ns3_module_helper__local
except ImportError:
pass
else:
ns3_module_helper__local.register_types(module)
root_module.end_section('ns3_module_helper')
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
root_module.begin_section('ns3_module_core')
ns3_module_core.register_methods(root_module)
try:
import ns3_module_core__local
except ImportError:
pass
else:
ns3_module_core__local.register_methods(root_module)
root_module.end_section('ns3_module_core')
root_module.begin_section('ns3_module_simulator')
ns3_module_simulator.register_methods(root_module)
try:
import ns3_module_simulator__local
except ImportError:
pass
else:
ns3_module_simulator__local.register_methods(root_module)
root_module.end_section('ns3_module_simulator')
root_module.begin_section('ns3_module_mobility')
ns3_module_mobility.register_methods(root_module)
try:
import ns3_module_mobility__local
except ImportError:
pass
else:
ns3_module_mobility__local.register_methods(root_module)
root_module.end_section('ns3_module_mobility')
root_module.begin_section('ns3_module_common')
ns3_module_common.register_methods(root_module)
try:
import ns3_module_common__local
except ImportError:
pass
else:
ns3_module_common__local.register_methods(root_module)
root_module.end_section('ns3_module_common')
root_module.begin_section('ns3_module_contrib')
ns3_module_contrib.register_methods(root_module)
try:
import ns3_module_contrib__local
except ImportError:
pass
else:
ns3_module_contrib__local.register_methods(root_module)
root_module.end_section('ns3_module_contrib')
root_module.begin_section('ns3_module_node')
ns3_module_node.register_methods(root_module)
try:
import ns3_module_node__local
except ImportError:
pass
else:
ns3_module_node__local.register_methods(root_module)
root_module.end_section('ns3_module_node')
root_module.begin_section('ns3_module_point_to_point')
ns3_module_point_to_point.register_methods(root_module)
try:
import ns3_module_point_to_point__local
except ImportError:
pass
else:
ns3_module_point_to_point__local.register_methods(root_module)
root_module.end_section('ns3_module_point_to_point')
root_module.begin_section('ns3_module_stats')
ns3_module_stats.register_methods(root_module)
try:
import ns3_module_stats__local
except ImportError:
pass
else:
ns3_module_stats__local.register_methods(root_module)
root_module.end_section('ns3_module_stats')
root_module.begin_section('ns3_module_internet_stack')
ns3_module_internet_stack.register_methods(root_module)
try:
import ns3_module_internet_stack__local
except ImportError:
pass
else:
ns3_module_internet_stack__local.register_methods(root_module)
root_module.end_section('ns3_module_internet_stack')
root_module.begin_section('ns3_module_wifi')
ns3_module_wifi.register_methods(root_module)
try:
import ns3_module_wifi__local
except ImportError:
pass
else:
ns3_module_wifi__local.register_methods(root_module)
root_module.end_section('ns3_module_wifi')
root_module.begin_section('ns3_module_csma')
ns3_module_csma.register_methods(root_module)
try:
import ns3_module_csma__local
except ImportError:
pass
else:
ns3_module_csma__local.register_methods(root_module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_methods(root_module)
try:
import ns3_module_bridge__local
except ImportError:
pass
else:
ns3_module_bridge__local.register_methods(root_module)
root_module.end_section('ns3_module_bridge')
root_module.begin_section('ns3_module_packet_sink')
ns3_module_packet_sink.register_methods(root_module)
try:
import ns3_module_packet_sink__local
except ImportError:
pass
else:
ns3_module_packet_sink__local.register_methods(root_module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_methods(root_module)
try:
import ns3_module_global_routing__local
except ImportError:
pass
else:
ns3_module_global_routing__local.register_methods(root_module)
root_module.end_section('ns3_module_global_routing')
root_module.begin_section('ns3_module_onoff')
ns3_module_onoff.register_methods(root_module)
try:
import ns3_module_onoff__local
except ImportError:
pass
else:
ns3_module_onoff__local.register_methods(root_module)
root_module.end_section('ns3_module_onoff')
root_module.begin_section('ns3_module_olsr')
ns3_module_olsr.register_methods(root_module)
try:
import ns3_module_olsr__local
except ImportError:
pass
else:
ns3_module_olsr__local.register_methods(root_module)
root_module.end_section('ns3_module_olsr')
root_module.begin_section('ns3_module_udp_echo')
ns3_module_udp_echo.register_methods(root_module)
try:
import ns3_module_udp_echo__local
except ImportError:
pass
else:
ns3_module_udp_echo__local.register_methods(root_module)
root_module.end_section('ns3_module_udp_echo')
root_module.begin_section('ns3_module_helper')
ns3_module_helper.register_methods(root_module)
try:
import ns3_module_helper__local
except ImportError:
pass
else:
ns3_module_helper__local.register_methods(root_module)
root_module.end_section('ns3_module_helper')
return
def register_functions(root_module):
module = root_module
root_module.begin_section('ns3_module_core')
ns3_module_core.register_functions(root_module)
try:
import ns3_module_core__local
except ImportError:
pass
else:
ns3_module_core__local.register_functions(root_module)
root_module.end_section('ns3_module_core')
root_module.begin_section('ns3_module_simulator')
ns3_module_simulator.register_functions(root_module)
try:
import ns3_module_simulator__local
except ImportError:
pass
else:
ns3_module_simulator__local.register_functions(root_module)
root_module.end_section('ns3_module_simulator')
root_module.begin_section('ns3_module_mobility')
ns3_module_mobility.register_functions(root_module)
try:
import ns3_module_mobility__local
except ImportError:
pass
else:
ns3_module_mobility__local.register_functions(root_module)
root_module.end_section('ns3_module_mobility')
root_module.begin_section('ns3_module_common')
ns3_module_common.register_functions(root_module)
try:
import ns3_module_common__local
except ImportError:
pass
else:
ns3_module_common__local.register_functions(root_module)
root_module.end_section('ns3_module_common')
root_module.begin_section('ns3_module_contrib')
ns3_module_contrib.register_functions(root_module)
try:
import ns3_module_contrib__local
except ImportError:
pass
else:
ns3_module_contrib__local.register_functions(root_module)
root_module.end_section('ns3_module_contrib')
root_module.begin_section('ns3_module_node')
ns3_module_node.register_functions(root_module)
try:
import ns3_module_node__local
except ImportError:
pass
else:
ns3_module_node__local.register_functions(root_module)
root_module.end_section('ns3_module_node')
root_module.begin_section('ns3_module_point_to_point')
ns3_module_point_to_point.register_functions(root_module)
try:
import ns3_module_point_to_point__local
except ImportError:
pass
else:
ns3_module_point_to_point__local.register_functions(root_module)
root_module.end_section('ns3_module_point_to_point')
root_module.begin_section('ns3_module_stats')
ns3_module_stats.register_functions(root_module)
try:
import ns3_module_stats__local
except ImportError:
pass
else:
ns3_module_stats__local.register_functions(root_module)
root_module.end_section('ns3_module_stats')
root_module.begin_section('ns3_module_internet_stack')
ns3_module_internet_stack.register_functions(root_module)
try:
import ns3_module_internet_stack__local
except ImportError:
pass
else:
ns3_module_internet_stack__local.register_functions(root_module)
root_module.end_section('ns3_module_internet_stack')
root_module.begin_section('ns3_module_wifi')
ns3_module_wifi.register_functions(root_module)
try:
import ns3_module_wifi__local
except ImportError:
pass
else:
ns3_module_wifi__local.register_functions(root_module)
root_module.end_section('ns3_module_wifi')
root_module.begin_section('ns3_module_csma')
ns3_module_csma.register_functions(root_module)
try:
import ns3_module_csma__local
except ImportError:
pass
else:
ns3_module_csma__local.register_functions(root_module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_functions(root_module)
try:
import ns3_module_bridge__local
except ImportError:
pass
else:
ns3_module_bridge__local.register_functions(root_module)
root_module.end_section('ns3_module_bridge')
root_module.begin_section('ns3_module_packet_sink')
ns3_module_packet_sink.register_functions(root_module)
try:
import ns3_module_packet_sink__local
except ImportError:
pass
else:
ns3_module_packet_sink__local.register_functions(root_module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_functions(root_module)
try:
import ns3_module_global_routing__local
except ImportError:
pass
else:
ns3_module_global_routing__local.register_functions(root_module)
root_module.end_section('ns3_module_global_routing')
root_module.begin_section('ns3_module_onoff')
ns3_module_onoff.register_functions(root_module)
try:
import ns3_module_onoff__local
except ImportError:
pass
else:
ns3_module_onoff__local.register_functions(root_module)
root_module.end_section('ns3_module_onoff')
root_module.begin_section('ns3_module_olsr')
ns3_module_olsr.register_functions(root_module)
try:
import ns3_module_olsr__local
except ImportError:
pass
else:
ns3_module_olsr__local.register_functions(root_module)
root_module.end_section('ns3_module_olsr')
root_module.begin_section('ns3_module_udp_echo')
ns3_module_udp_echo.register_functions(root_module)
try:
import ns3_module_udp_echo__local
except ImportError:
pass
else:
ns3_module_udp_echo__local.register_functions(root_module)
root_module.end_section('ns3_module_udp_echo')
root_module.begin_section('ns3_module_helper')
ns3_module_helper.register_functions(root_module)
try:
import ns3_module_helper__local
except ImportError:
pass
else:
ns3_module_helper__local.register_functions(root_module)
root_module.end_section('ns3_module_helper')
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
def main():
out = FileCodeSink(sys.stdout)
root_module = module_init()
register_types(root_module)
register_methods(root_module)
register_functions(root_module)
root_module.generate(out)
if __name__ == '__main__':
main()
+298
View File
@@ -0,0 +1,298 @@
#! /usr/bin/env python
import sys
import os.path
import pybindgen.settings
from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning
from pybindgen.typehandlers.codesink import FileCodeSink
from pygccxml.declarations import templates
from pygccxml.declarations.class_declaration import class_t
from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t
## we need the smart pointer type transformation to be active even
## during gccxml scanning.
import ns3modulegen_core_customizations
## silence gccxmlparser errors; we only want error handling in the
## generated python script, not while scanning.
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, dummy_wrapper, dummy_exception, dummy_traceback_):
return True
pybindgen.settings.error_handler = ErrorHandler()
import warnings
warnings.filterwarnings(category=WrapperWarning, action='ignore')
type_annotations = {
'::ns3::RefCountBase': {
'incref_method': 'Ref',
'decref_method': 'Unref',
'peekref_method': 'GetReferenceCount',
'automatic_type_narrowing': 'true',
},
'::ns3::Object': {
'incref_method': 'Ref',
'decref_method': 'Unref',
'peekref_method': 'GetReferenceCount',
'automatic_type_narrowing': 'true',
},
'::ns3::Packet': {
'incref_method': 'Ref',
'decref_method': 'Unref',
'peekref_method': 'GetReferenceCount',
},
'::ns3::CallbackImplBase': {
'incref_method': 'Ref',
'decref_method': 'Unref',
'peekref_method': 'GetReferenceCount',
},
'::ns3::PacketMetadata': {
'ignore': None,
},
'::ns3::AttributeChecker': {
'automatic_type_narrowing': 'true',
'allow_subclassing': 'false',
},
'::ns3::AttributeValue': {
'automatic_type_narrowing': 'true',
'allow_subclassing': 'false',
},
'ns3::RandomVariable::RandomVariable(ns3::RandomVariableBase const & variable) [constructor]': {
'ignore': None,
},
'ns3::RandomVariableBase * ns3::RandomVariable::Peek() const [member function]': {
'ignore': None,
},
'void ns3::RandomVariable::GetSeed(uint32_t * seed) const [member function]': {
'params': {'seed':{'direction':'out',
'array_length':'6'}}
},
'bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInfo * info) const [member function]': {
'params': {'info':{'transfer_ownership': 'false'}}
},
'static bool ns3::TypeId::LookupByNameFailSafe(std::string name, ns3::TypeId * tid) [member function]': {
'params': {'tid': {'transfer_ownership': 'false'}}
},
'bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]': {
'params': {'obj': {'transfer_ownership':'false'}}
},
'bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]': {
'params': {'obj': {'transfer_ownership':'false'}}
},
'bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]': {
'params': {'obj': {'transfer_ownership':'false'}}
},
'bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]': {
'params': {'obj': {'transfer_ownership':'false'}}
},
'bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]': {
'params': {'object': {'transfer_ownership':'false'}}
},
'ns3::EmpiricalVariable::EmpiricalVariable(ns3::RandomVariableBase const & variable) [constructor]': {
'ignore': None
},
'static ns3::AttributeList * ns3::AttributeList::GetGlobal() [member function]': {
'caller_owns_return': 'false'
},
'void ns3::CommandLine::Parse(int argc, char * * argv) const [member function]': {
'ignore': None # manually wrapped
},
'extern void ns3::PythonCompleteConstruct(ns3::Ptr<ns3::Object> object, ns3::TypeId typeId, ns3::AttributeList const & attributes) [free function]': {
'ignore': None # used transparently by, should not be wrapped
},
}
def get_ns3_relative_path(path):
l = []
head = path
while head:
head, tail = os.path.split(head)
if tail == 'ns3':
return os.path.join(*l)
l.insert(0, tail)
raise AssertionError("is the path %r inside ns3?!" % path)
def pre_scan_hook(dummy_module_parser,
pygccxml_definition,
global_annotations,
parameter_annotations):
ns3_header = get_ns3_relative_path(pygccxml_definition.location.file_name)
## Note: we don't include line numbers in the comments because
## those numbers are very likely to change frequently, which would
## cause needless changes, since the generated python files are
## kept under version control.
#global_annotations['pygen_comment'] = "%s:%i: %s" % \
# (ns3_header, pygccxml_definition.location.line, pygccxml_definition)
global_annotations['pygen_comment'] = "%s: %s" % \
(ns3_header, pygccxml_definition)
## handle ns3::Object::GetObject (left to its own devices,
## pybindgen will generate a mangled name containing the template
## argument type name).
if isinstance(pygccxml_definition, member_function_t) \
and pygccxml_definition.parent.name == 'Object' \
and pygccxml_definition.name == 'GetObject':
template_args = templates.args(pygccxml_definition.demangled_name)
if template_args == ['ns3::Object']:
global_annotations['template_instance_names'] = 'ns3::Object=>GetObject'
## Don't wrap Simulator::Schedule* (manually wrapped)
if isinstance(pygccxml_definition, member_function_t) \
and pygccxml_definition.parent.name == 'Simulator' \
and pygccxml_definition.name.startswith('Schedule'):
global_annotations['ignore'] = None
# unblock python threads for Simulator::Run
if isinstance(pygccxml_definition, member_function_t) \
and pygccxml_definition.parent.name == 'Simulator' \
and pygccxml_definition.name == 'Run':
global_annotations['unblock_threads'] = True
## classes
if isinstance(pygccxml_definition, class_t):
# no need for helper classes to allow subclassing in Python, I think...
if pygccxml_definition.name.endswith('Helper'):
global_annotations['allow_subclassing'] = 'false'
if pygccxml_definition.decl_string.startswith('::ns3::Callback<'):
# manually handled in ns3modulegen_core_customizations.py
global_annotations['ignore'] = None
return
if pygccxml_definition.decl_string.startswith('::ns3::TracedCallback<'):
global_annotations['ignore'] = None
return
if pygccxml_definition.decl_string.startswith('::ns3::Ptr<'):
# handled by pybindgen "type transformation"
global_annotations['ignore'] = None
return
# table driven class customization
try:
annotations = type_annotations[pygccxml_definition.decl_string]
except KeyError:
pass
else:
global_annotations.update(annotations)
## free functions
if isinstance(pygccxml_definition, free_function_t):
if pygccxml_definition.name == 'PeekPointer':
global_annotations['ignore'] = None
return
## table driven methods/constructors/functions customization
if isinstance(pygccxml_definition, (free_function_t, member_function_t, constructor_t)):
try:
annotations = type_annotations[str(pygccxml_definition)]
except KeyError:
pass
else:
for key,value in annotations.items():
if key == 'params':
parameter_annotations.update (value)
del annotations['params']
global_annotations.update(annotations)
# def post_scan_hook(dummy_module_parser, dummy_pygccxml_definition, pybindgen_wrapper):
# ## classes
# if isinstance(pybindgen_wrapper, CppClass):
# if pybindgen_wrapper.name.endswith('Checker'):
# print >> sys.stderr, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", pybindgen_wrapper
# #pybindgen_wrapper.set_instance_creation_function(AttributeChecker_instance_creation_function)
def scan_callback_classes(module_parser, callback_classes_file):
callback_classes_file.write("callback_classes = [\n")
for cls in module_parser.module_namespace.classes(function=module_parser.location_filter,
recursive=False):
if not cls.name.startswith("Callback<"):
continue
assert templates.is_instantiation(cls.decl_string), "%s is not a template instantiation" % cls
dummy_cls_name, template_parameters = templates.split(cls.decl_string)
callback_classes_file.write(" %r,\n" % template_parameters)
callback_classes_file.write("]\n")
class MyPygenClassifier(PygenClassifier):
def __init__(self, headers_map):
self.headers_map = headers_map
def classify(self, pygccxml_definition):
name = os.path.basename(pygccxml_definition.location.file_name)
try:
return self.headers_map[name]
except KeyError:
return '__main__'
def ns3_module_scan(top_builddir, pygen_file_name, everything_h):
ns3_modules = eval(sys.stdin.read())
## do a topological sort on the modules graph
from topsort import topsort
graph = []
for ns3_module_name, (ns3_module_deps, dummy) in ns3_modules.iteritems():
for dep in ns3_module_deps:
graph.append((dep, ns3_module_name))
sorted_ns3_modules = topsort(graph)
#print >> sys.stderr, "******* topological sort: ", sorted_ns3_modules
sections = [PygenSection('__main__', FileCodeSink(open(pygen_file_name, "wt")))]
headers_map = {} # header_name -> section_name
for ns3_module in sorted_ns3_modules:
section_name = "ns3_module_%s" % ns3_module.replace('-', '_')
file_name = os.path.join(os.path.dirname(pygen_file_name), "%s.py" % section_name)
sections.append(PygenSection(section_name, FileCodeSink(open(file_name, "wt")),
section_name + "__local"))
for header in ns3_modules[ns3_module][1]:
headers_map[header] = section_name
module_parser = ModuleParser('ns3', 'ns3')
module_parser.add_pre_scan_hook(pre_scan_hook)
#module_parser.add_post_scan_hook(post_scan_hook)
gccxml_options = dict(
include_paths=[top_builddir],
define_symbols={
#'NS3_ASSERT_ENABLE': None,
#'NS3_LOG_ENABLE': None,
}
)
module_parser.parse_init([everything_h],
None, whitelist_paths=[top_builddir, os.path.dirname(everything_h)],
#includes=['"ns3/everything.h"'],
pygen_sink=sections,
pygen_classifier=MyPygenClassifier(headers_map),
gccxml_options=gccxml_options)
module_parser.scan_types()
callback_classes_file = open(os.path.join(os.path.dirname(pygen_file_name), "callbacks_list.py"), "wt")
scan_callback_classes(module_parser, callback_classes_file)
callback_classes_file.close()
module_parser.scan_methods()
module_parser.scan_functions()
module_parser.parse_finalize()
for section in sections:
section.code_sink.file.close()
if __name__ == '__main__':
ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2])
+909
View File
@@ -0,0 +1,909 @@
# Copyright (c) 2007 RADLogic
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Provide various handy Python functions.
Running this script directly will execute the doctests.
Functions:
int2bin(i, n) -- Convert integer to binary string.
bin2int(bin_string) -- Convert binary string to integer.
reverse(input_string) -- Reverse a string.
transpose(matrix) -- Transpose a list of lists.
polygon_area(points_list) -- Calculate the area of an arbitrary polygon.
timestamp() -- Return string containing current time stamp.
pt2str(point) -- Return prettier string version of point tuple.
gcf(a, b) -- Return the greatest common factor of two numbers.
lcm(a, b) -- Return the least common multiple of two numbers.
permutations(input_list) -- Generate all permutations of a list of items.
reduce_fraction(fraction) -- Reduce fraction (num, denom) to simplest form.
quantile(l, p) -- Return p quantile of list l. E.g. p=0.25 for q1.
trim(l) -- Discard values in list more than 1.5*IQR outside IQR.
nice_units(value) -- Return value converted to human readable units.
uniquify(seq) -- Return sequence with duplicate items in sequence seq removed.
reverse_dict(d) -- Return the dictionary with the items as keys and vice-versa.
lsb(x, n) -- Return the n least significant bits of x.
gray_encode(i) -- Gray encode the given integer.
random_vec(bits, max_value=None) -- Return a random binary vector.
binary_range(bits) -- Return list of all possible binary numbers width=bits.
float_range([start], stop, [step]) -- Return range of floats.
find_common_fixes(s1, s2) -- Find common (prefix, suffix) of two strings.
is_rotated(seq1, seq2) -- Return true if the list is a rotation of other list.
getmodule(obj) -- Return the module that contains the object definition of obj.
(use inspect.getmodule instead, though)
get_args(argv) -- Store command-line args in a dictionary.
This module requires Python >= 2.2
"""
__author__ = 'Tim Wegener <twegener@radlogic.com.au>'
__date__ = '$Date: 2007/03/27 03:15:06 $'
__version__ = '$Revision: 0.45 $'
__credits__ = """
David Chandler, for polygon area algorithm.
(http://www.davidchandler.com/AreaOfAGeneralPolygon.pdf)
"""
import re
import sys
import time
import random
try:
True, False
except NameError:
True, False = (1==1, 0==1)
def int2bin(i, n):
"""Convert decimal integer i to n-bit binary number (string).
>>> int2bin(0, 8)
'00000000'
>>> int2bin(123, 8)
'01111011'
>>> int2bin(123L, 8)
'01111011'
>>> int2bin(15, 2)
Traceback (most recent call last):
ValueError: Value too large for given number of bits.
"""
hex2bin = {'0': '0000', '1': '0001', '2': '0010', '3': '0011',
'4': '0100', '5': '0101', '6': '0110', '7': '0111',
'8': '1000', '9': '1001', 'a': '1010', 'b': '1011',
'c': '1100', 'd': '1101', 'e': '1110', 'f': '1111'}
# Convert to hex then map each hex digit to binary equivalent.
result = ''.join([hex2bin[x] for x in hex(i).lower().replace('l','')[2:]])
# Shrink result to appropriate length.
# Raise an error if the value is changed by the truncation.
if '1' in result[:-n]:
raise ValueError("Value too large for given number of bits.")
result = result[-n:]
# Zero-pad if length longer than mapped result.
result = '0'*(n-len(result)) + result
return result
def bin2int(bin_string):
"""Convert binary number string to decimal integer.
Note: Python > v2 has int(bin_string, 2)
>>> bin2int('1111')
15
>>> bin2int('0101')
5
"""
## result = 0
## bin_list = list(bin_string)
## if len(filter(lambda x: x in ('1','0'), bin_list)) < len(bin_list):
## raise Exception ("bin2int: Error - not a binary number: %s"
## % bin_string)
## bit_list = map(int, bin_list)
## bit_list.reverse() # Make most significant bit have highest index.
## for bit_place in range(len(bit_list)):
## result = result + ((2**bit_place) * bit_list[bit_place])
## return result
return int(bin_string, 2)
def reverse(input_string):
"""Reverse a string. Useful for strings of binary numbers.
>>> reverse('abc')
'cba'
"""
str_list = list(input_string)
str_list.reverse()
return ''.join(str_list)
def transpose(matrix):
"""Transpose a list of lists.
>>> transpose([['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']])
[['a', 'd', 'g'], ['b', 'e', 'h'], ['c', 'f', 'i']]
>>> transpose([['a', 'b', 'c'], ['d', 'e', 'f']])
[['a', 'd'], ['b', 'e'], ['c', 'f']]
>>> transpose([['a', 'b'], ['d', 'e'], ['g', 'h']])
[['a', 'd', 'g'], ['b', 'e', 'h']]
"""
result = zip(*matrix)
# Convert list of tuples to list of lists.
# map is faster than a list comprehension since it is being used with
# a built-in function as an argument.
result = map(list, result)
return result
def polygon_area(points_list, precision=100):
"""Calculate area of an arbitrary polygon using an algorithm from the web.
Return the area of the polygon as a positive float.
Arguments:
points_list -- list of point tuples [(x0, y0), (x1, y1), (x2, y2), ...]
(Unclosed polygons will be closed automatically.
precision -- Internal arithmetic precision (integer arithmetic).
>>> polygon_area([(0, 0), (0, 1), (1, 1), (1, 2), (2, 2), (2, 0), (0, 0)])
3.0
Credits:
Area of a General Polygon by David Chandler
http://www.davidchandler.com/AreaOfAGeneralPolygon.pdf
"""
# Scale up co-ordinates and convert them to integers.
for i in range(len(points_list)):
points_list[i] = (int(points_list[i][0] * precision),
int(points_list[i][1] * precision))
# Close polygon if not closed.
if points_list[-1] != points_list[0]:
points_list.append(points_list[0])
# Calculate area.
area = 0
for i in range(len(points_list)-1):
(x_i, y_i) = points_list[i]
(x_i_plus_1, y_i_plus_1) = points_list[i+1]
area = area + (x_i_plus_1 * y_i) - (y_i_plus_1 * x_i)
area = abs(area / 2)
# Unscale area.
area = float(area)/(precision**2)
return area
def timestamp():
"""Return string containing current time stamp.
Note: In Python 2 onwards can use time.asctime() with no arguments.
"""
return time.asctime()
def pt2str(point):
"""Return prettier string version of point tuple.
>>> pt2str((1.8, 1.9))
'(1.8, 1.9)'
"""
return "(%s, %s)" % (str(point[0]), str(point[1]))
def gcf(a, b, epsilon=1e-16):
"""Return the greatest common factor of a and b, using Euclidean algorithm.
Arguments:
a, b -- two numbers
If both numbers are integers return an integer result,
otherwise return a float result.
epsilon -- floats less than this magnitude are considered to be zero
(default: 1e-16)
Examples:
>>> gcf(12, 34)
2
>>> gcf(13.5, 4)
0.5
>>> gcf(-2, 4)
2
>>> gcf(5, 0)
5
By (a convenient) definition:
>>> gcf(0, 0)
0
"""
result = max(a, b)
remainder = min(a, b)
while remainder and abs(remainder) > epsilon:
new_remainder = result % remainder
result = remainder
remainder = new_remainder
return abs(result)
def lcm(a, b, precision=None):
"""Return the least common multiple of a and b, using the gcf function.
Arguments:
a, b -- two numbers. If both are integers return an integer result,
otherwise a return a float result.
precision -- scaling factor if a and/or b are floats.
>>> lcm(21, 6)
42
>>> lcm(2.5, 3.5)
17.5
>>> str(lcm(1.5e-8, 2.5e-8, precision=1e9))
'7.5e-08'
By (an arbitary) definition:
>>> lcm(0, 0)
0
"""
# Note: Dummy precision argument is for backwards compatibility.
# Do the division first.
# (See http://en.wikipedia.org/wiki/Least_common_multiple )
denom = gcf(a, b)
if denom == 0:
result = 0
else:
result = a * (b / denom)
return result
def permutations(input_list):
"""Return a list containing all permutations of the input list.
Note: This is a recursive function.
>>> perms = permutations(['a', 'b', 'c'])
>>> perms.sort()
>>> for perm in perms:
... print perm
['a', 'b', 'c']
['a', 'c', 'b']
['b', 'a', 'c']
['b', 'c', 'a']
['c', 'a', 'b']
['c', 'b', 'a']
"""
out_lists = []
if len(input_list) > 1:
# Extract first item in list.
item = input_list[0]
# Find all permutations of remainder of list. (Recursive call.)
sub_lists = permutations(input_list[1:])
# For every permutation of the sub list...
for sub_list in sub_lists:
# Insert the extracted first item at every position of the list.
for i in range(len(input_list)):
new_list = sub_list[:]
new_list.insert(i, item)
out_lists.append(new_list)
else:
# Termination condition: only one item in input list.
out_lists = [input_list]
return out_lists
def reduce_fraction(fraction):
"""Reduce fraction tuple to simplest form. fraction=(num, denom)
>>> reduce_fraction((14, 7))
(2, 1)
>>> reduce_fraction((-2, 4))
(-1, 2)
>>> reduce_fraction((0, 4))
(0, 1)
>>> reduce_fraction((4, 0))
(1, 0)
"""
(numerator, denominator) = fraction
common_factor = abs(gcf(numerator, denominator))
result = (numerator/common_factor, denominator/common_factor)
return result
def quantile(l, p):
"""Return p quantile of list l. E.g. p=0.25 for q1.
See:
http://rweb.stat.umn.edu/R/library/base/html/quantile.html
"""
l_sort = l[:]
l_sort.sort()
n = len(l)
r = 1 + ((n - 1) * p)
i = int(r)
f = r - i
if i < n:
result = (1-f)*l_sort[i-1] + f*l_sort[i]
else:
result = l_sort[i-1]
return result
def trim(l):
"""Discard values in list more than 1.5*IQR outside IQR.
(IQR is inter-quartile-range)
This function uses rad_util.quantile
1.5*IQR -- mild outlier
3*IQR -- extreme outlier
See:
http://wind.cc.whecn.edu/~pwildman/statnew/section_7_-_exploratory_data_analysis.htm
"""
l_sort = l[:]
l_sort.sort()
# Calculate medianscore (based on stats.py lmedianscore by Gary Strangman)
if len(l_sort) % 2 == 0:
# If even number of scores, average middle 2.
index = int(len(l_sort) / 2) # Integer division correct
median = float(l_sort[index] + l_sort[index-1]) / 2
else:
# int divsion gives mid value when count from 0
index = int(len(l_sort) / 2)
median = l_sort[index]
# Calculate IQR.
q1 = quantile(l_sort, 0.25)
q3 = quantile(l_sort, 0.75)
iqr = q3 - q1
iqr_extra = iqr * 1.5
def in_interval(x, i=iqr_extra, q1=q1, q3=q3):
return (x >= q1-i and x <= q3+i)
l_trimmed = [x for x in l_sort if in_interval(x)]
return l_trimmed
def nice_units(value, dp=0, sigfigs=None, suffix='', space=' ',
use_extra_prefixes=False, use_full_name=False, mode='si'):
"""Return value converted to human readable units eg milli, micro, etc.
Arguments:
value -- number in base units
dp -- number of decimal places to display (rounded)
sigfigs -- number of significant figures to display (rounded)
This overrides dp if set.
suffix -- optional unit suffix to append to unit multiplier
space -- seperator between value and unit multiplier (default: ' ')
use_extra_prefixes -- use hecto, deka, deci and centi as well if set.
(default: False)
use_full_name -- use full name for multiplier symbol,
e.g. milli instead of m
(default: False)
mode -- 'si' for SI prefixes, 'bin' for binary multipliers (1024, etc.)
(Default: 'si')
SI prefixes from:
http://physics.nist.gov/cuu/Units/prefixes.html
(Greek mu changed to u.)
Binary prefixes based on:
http://physics.nist.gov/cuu/Units/binary.html
>>> nice_units(2e-11)
'20 p'
>>> nice_units(2e-11, space='')
'20p'
"""
si_prefixes = {1e24: ('Y', 'yotta'),
1e21: ('Z', 'zetta'),
1e18: ('E', 'exa'),
1e15: ('P', 'peta'),
1e12: ('T', 'tera'),
1e9: ('G', 'giga'),
1e6: ('M', 'mega'),
1e3: ('k', 'kilo'),
1e-3: ('m', 'milli'),
1e-6: ('u', 'micro'),
1e-9: ('n', 'nano'),
1e-12: ('p', 'pico'),
1e-15: ('f', 'femto'),
1e-18: ('a', 'atto'),
1e-21: ('z', 'zepto'),
1e-24: ('y', 'yocto')
}
if use_extra_prefixes:
si_prefixes.update({1e2: ('h', 'hecto'),
1e1: ('da', 'deka'),
1e-1: ('d', 'deci'),
1e-2: ('c', 'centi')
})
bin_prefixes = {2**10: ('K', 'kilo'),
2**20: ('M', 'mega'),
2**30: ('G', 'mega'),
2**40: ('T', 'tera'),
2**50: ('P', 'peta'),
2**60: ('E', 'exa')
}
if mode == 'bin':
prefixes = bin_prefixes
else:
prefixes = si_prefixes
prefixes[1] = ('', '') # Unity.
# Determine appropriate multiplier.
multipliers = prefixes.keys()
multipliers.sort()
mult = None
for i in range(len(multipliers) - 1):
lower_mult = multipliers[i]
upper_mult = multipliers[i+1]
if lower_mult <= value < upper_mult:
mult_i = i
break
if mult is None:
if value < multipliers[0]:
mult_i = 0
elif value >= multipliers[-1]:
mult_i = len(multipliers) - 1
mult = multipliers[mult_i]
# Convert value for this multiplier.
new_value = value / mult
# Deal with special case due to rounding.
if sigfigs is None:
if mult_i < (len(multipliers) - 1) and \
round(new_value, dp) == \
round((multipliers[mult_i+1] / mult), dp):
mult = multipliers[mult_i + 1]
new_value = value / mult
# Concatenate multiplier symbol.
if use_full_name:
label_type = 1
else:
label_type = 0
# Round and truncate to appropriate precision.
if sigfigs is None:
str_value = eval('"%.'+str(dp)+'f" % new_value', locals(), {})
else:
str_value = eval('"%.'+str(sigfigs)+'g" % new_value', locals(), {})
return str_value + space + prefixes[mult][label_type] + suffix
def uniquify(seq, preserve_order=False):
"""Return sequence with duplicate items in sequence seq removed.
The code is based on usenet post by Tim Peters.
This code is O(N) if the sequence items are hashable, O(N**2) if not.
Peter Bengtsson has a blog post with an empirical comparison of other
approaches:
http://www.peterbe.com/plog/uniqifiers-benchmark
If order is not important and the sequence items are hashable then
list(set(seq)) is readable and efficient.
If order is important and the sequence items are hashable generator
expressions can be used (in py >= 2.4) (useful for large sequences):
seen = set()
do_something(x for x in seq if x not in seen or seen.add(x))
Arguments:
seq -- sequence
preserve_order -- if not set the order will be arbitrary
Using this option will incur a speed penalty.
(default: False)
Example showing order preservation:
>>> uniquify(['a', 'aa', 'b', 'b', 'ccc', 'ccc', 'd'], preserve_order=True)
['a', 'aa', 'b', 'ccc', 'd']
Example using a sequence of un-hashable items:
>>> uniquify([['z'], ['x'], ['y'], ['z']], preserve_order=True)
[['z'], ['x'], ['y']]
The sorted output or the non-order-preserving approach should equal
that of the sorted order-preserving approach output:
>>> unordered = uniquify([3, 3, 1, 2], preserve_order=False)
>>> unordered.sort()
>>> ordered = uniquify([3, 3, 1, 2], preserve_order=True)
>>> ordered.sort()
>>> ordered
[1, 2, 3]
>>> int(ordered == unordered)
1
"""
try:
# Attempt fast algorithm.
d = {}
if preserve_order:
# This is based on Dave Kirby's method (f8) noted in the post:
# http://www.peterbe.com/plog/uniqifiers-benchmark
return [x for x in seq if (x not in d) and not d.__setitem__(x, 0)]
else:
for x in seq:
d[x] = 0
return d.keys()
except TypeError:
# Have an unhashable object, so use slow algorithm.
result = []
app = result.append
for x in seq:
if x not in result:
app(x)
return result
# Alias to noun form for backward compatibility.
unique = uniquify
def reverse_dict(d):
"""Reverse a dictionary so the items become the keys and vice-versa.
Note: The results will be arbitrary if the items are not unique.
>>> d = reverse_dict({'a': 1, 'b': 2})
>>> d_items = d.items()
>>> d_items.sort()
>>> d_items
[(1, 'a'), (2, 'b')]
"""
result = {}
for key, value in d.items():
result[value] = key
return result
def lsb(x, n):
"""Return the n least significant bits of x.
>>> lsb(13, 3)
5
"""
return x & ((2 ** n) - 1)
def gray_encode(i):
"""Gray encode the given integer."""
return i ^ (i >> 1)
def random_vec(bits, max_value=None):
"""Generate a random binary vector of length bits and given max value."""
vector = ""
for _ in range(int(bits / 10) + 1):
i = int((2**10) * random.random())
vector += int2bin(i, 10)
if max_value and (max_value < 2 ** bits - 1):
vector = int2bin((int(vector, 2) / (2 ** bits - 1)) * max_value, bits)
return vector[0:bits]
def binary_range(bits):
"""Return a list of all possible binary numbers in order with width=bits.
It would be nice to extend it to match the
functionality of python's range() built-in function.
"""
l = []
v = ['0'] * bits
toggle = [1] + [0] * bits
while toggle[bits] != 1:
v_copy = v[:]
v_copy.reverse()
l.append(''.join(v_copy))
toggle = [1] + [0]*bits
i = 0
while i < bits and toggle[i] == 1:
if toggle[i]:
if v[i] == '0':
v[i] = '1'
toggle[i+1] = 0
else:
v[i] = '0'
toggle[i+1] = 1
i += 1
return l
def float_range(start, stop=None, step=None):
"""Return a list containing an arithmetic progression of floats.
Return a list of floats between 0.0 (or start) and stop with an
increment of step.
This is in functionality to python's range() built-in function
but can accept float increments.
As with range(), stop is omitted from the list.
"""
if stop is None:
stop = float(start)
start = 0.0
if step is None:
step = 1.0
cur = float(start)
l = []
while cur < stop:
l.append(cur)
cur += step
return l
def find_common_fixes(s1, s2):
"""Find common (prefix, suffix) of two strings.
>>> find_common_fixes('abc', 'def')
('', '')
>>> find_common_fixes('abcelephantdef', 'abccowdef')
('abc', 'def')
>>> find_common_fixes('abcelephantdef', 'abccow')
('abc', '')
>>> find_common_fixes('elephantdef', 'abccowdef')
('', 'def')
"""
prefix = []
suffix = []
i = 0
common_len = min(len(s1), len(s2))
while i < common_len:
if s1[i] != s2[i]:
break
prefix.append(s1[i])
i += 1
i = 1
while i < (common_len + 1):
if s1[-i] != s2[-i]:
break
suffix.append(s1[-i])
i += 1
suffix.reverse()
prefix = ''.join(prefix)
suffix = ''.join(suffix)
return (prefix, suffix)
def is_rotated(seq1, seq2):
"""Return true if the first sequence is a rotation of the second sequence.
>>> seq1 = ['A', 'B', 'C', 'D']
>>> seq2 = ['C', 'D', 'A', 'B']
>>> int(is_rotated(seq1, seq2))
1
>>> seq2 = ['C', 'D', 'B', 'A']
>>> int(is_rotated(seq1, seq2))
0
>>> seq1 = ['A', 'B', 'C', 'A']
>>> seq2 = ['A', 'A', 'B', 'C']
>>> int(is_rotated(seq1, seq2))
1
>>> seq2 = ['A', 'B', 'C', 'A']
>>> int(is_rotated(seq1, seq2))
1
>>> seq2 = ['A', 'A', 'C', 'B']
>>> int(is_rotated(seq1, seq2))
0
"""
# Do a sanity check.
if len(seq1) != len(seq2):
return False
# Look for occurrences of second sequence head item in first sequence.
start_indexes = []
head_item = seq2[0]
for index1 in range(len(seq1)):
if seq1[index1] == head_item:
start_indexes.append(index1)
# Check that wrapped sequence matches.
double_seq1 = seq1 + seq1
for index1 in start_indexes:
if double_seq1[index1:index1+len(seq1)] == seq2:
return True
return False
def getmodule(obj):
"""Return the module that contains the object definition of obj.
Note: Use inspect.getmodule instead.
Arguments:
obj -- python obj, generally a class or a function
Examples:
A function:
>>> module = getmodule(random.choice)
>>> module.__name__
'random'
>>> module is random
1
A class:
>>> module = getmodule(random.Random)
>>> module.__name__
'random'
>>> module is random
1
A class inheriting from a class in another module:
(note: The inheriting class must define at least one function.)
>>> class MyRandom(random.Random):
... def play(self):
... pass
>>> module = getmodule(MyRandom)
>>> if __name__ == '__main__':
... name = 'rad_util'
... else:
... name = module.__name__
>>> name
'rad_util'
>>> module is sys.modules[__name__]
1
Discussion:
This approach is slightly hackish, and won't work in various situations.
However, this was the approach recommended by GvR, so it's as good as
you'll get.
See GvR's post in this thread:
http://groups.google.com.au/group/comp.lang.python/browse_thread/thread/966a7bdee07e3b34/c3cab3f41ea84236?lnk=st&q=python+determine+class+module&rnum=4&hl=en#c3cab3f41ea84236
"""
if hasattr(obj, 'func_globals'):
func = obj
else:
# Handle classes.
func = None
for item in obj.__dict__.values():
if hasattr(item, 'func_globals'):
func = item
break
if func is None:
raise ValueError("No functions attached to object: %r" % obj)
module_name = func.func_globals['__name__']
# Get module.
module = sys.modules[module_name]
return module
def round_grid(value, grid, mode=0):
"""Round off the given value to the given grid size.
Arguments:
value -- value to be roudne
grid -- result must be a multiple of this
mode -- 0 nearest, 1 up, -1 down
Examples:
>>> round_grid(7.5, 5)
10
>>> round_grid(7.5, 5, mode=-1)
5
>>> round_grid(7.3, 5, mode=1)
10
>>> round_grid(7.3, 5.0, mode=1)
10.0
"""
off_grid = value % grid
if mode == 0:
add_one = int(off_grid >= (grid / 2.0))
elif mode == 1 and off_grid:
add_one = 1
elif mode == -1 and off_grid:
add_one = 0
result = ((int(value / grid) + add_one) * grid)
return result
def get_args(argv):
"""Store command-line args in a dictionary.
-, -- prefixes are removed
Items not prefixed with - or -- are stored as a list, indexed by 'args'
For options that take a value use --option=value
Consider using optparse or getopt (in Python standard library) instead.
"""
d = {}
args = []
for arg in argv:
if arg.startswith('-'):
parts = re.sub(r'^-+', '', arg).split('=')
if len(parts) == 2:
d[parts[0]] = parts[1]
else:
d[parts[0]] = None
else:
args.append(arg)
d['args'] = args
return d
if __name__ == '__main__':
import doctest
doctest.testmod(sys.modules['__main__'])
+392
View File
@@ -0,0 +1,392 @@
# topsort - dependency (topological) sorting and cycle finding functions
# Copyright (C) 2007 RADLogic
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# See http://www.fsf.org/licensing/licenses/lgpl.txt for full license text.
"""Provide toplogical sorting (i.e. dependency sorting) functions.
The topsort function is based on code posted on Usenet by Tim Peters.
Modifications:
- added doctests
- changed some bits to use current Python idioms
(listcomp instead of filter, +=/-=, inherit from Exception)
- added a topsort_levels version that ports items in each dependency level
into a sub-list
- added find_cycles to aid in cycle debugging
Run this module directly to run the doctests (unittests).
Make sure they all pass before checking in any modifications.
Requires Python >= 2.2
(For Python 2.2 also requires separate sets.py module)
This requires the rad_util.py module.
"""
# Provide support for Python 2.2*
from __future__ import generators
__version__ = '$Revision: 0.9 $'
__date__ = '$Date: 2007/03/27 04:15:26 $'
__credits__ = '''Tim Peters -- original topsort code
Tim Wegener -- doctesting, updating to current idioms, topsort_levels,
find_cycles
'''
# Make Python 2.3 sets look like Python 2.4 sets.
try:
set
except NameError:
from sets import Set as set
from rad_util import is_rotated
class CycleError(Exception):
"""Cycle Error"""
pass
def topsort(pairlist):
"""Topologically sort a list of (parent, child) pairs.
Return a list of the elements in dependency order (parent to child order).
>>> print topsort( [(1,2), (3,4), (5,6), (1,3), (1,5), (1,6), (2,5)] )
[1, 2, 3, 5, 4, 6]
>>> print topsort( [(1,2), (1,3), (2,4), (3,4), (5,6), (4,5)] )
[1, 2, 3, 4, 5, 6]
>>> print topsort( [(1,2), (2,3), (3,2)] )
Traceback (most recent call last):
CycleError: ([1], {2: 1, 3: 1}, {2: [3], 3: [2]})
"""
num_parents = {} # element -> # of predecessors
children = {} # element -> list of successors
for parent, child in pairlist:
# Make sure every element is a key in num_parents.
if not num_parents.has_key( parent ):
num_parents[parent] = 0
if not num_parents.has_key( child ):
num_parents[child] = 0
# Since child has a parent, increment child's num_parents count.
num_parents[child] += 1
# ... and parent gains a child.
children.setdefault(parent, []).append(child)
# Suck up everything without a parent.
answer = [x for x in num_parents.keys() if num_parents[x] == 0]
# For everything in answer, knock down the parent count on its children.
# Note that answer grows *in* the loop.
for parent in answer:
del num_parents[parent]
if children.has_key( parent ):
for child in children[parent]:
num_parents[child] -= 1
if num_parents[child] == 0:
answer.append( child )
# Following "del" isn't needed; just makes
# CycleError details easier to grasp.
del children[parent]
if num_parents:
# Everything in num_parents has at least one child ->
# there's a cycle.
raise CycleError(answer, num_parents, children)
return answer
def topsort_levels(pairlist):
"""Topologically sort a list of (parent, child) pairs into depth levels.
This returns a generator.
Turn this into a an iterator using the iter built-in function.
(if you iterate over the iterator, each element gets generated when
it is asked for, rather than generating the whole list up-front.)
Each generated element is a list of items at that dependency level.
>>> dependency_pairs = [(1,2), (3,4), (5,6), (1,3), (1,5), (1,6), (2,5)]
>>> for level in iter(topsort_levels( dependency_pairs )):
... print level
[1]
[2, 3]
[4, 5]
[6]
>>> dependency_pairs = [(1,2), (1,3), (2,4), (3,4), (5,6), (4,5)]
>>> for level in iter(topsort_levels( dependency_pairs )):
... print level
[1]
[2, 3]
[4]
[5]
[6]
>>> dependency_pairs = [(1,2), (2,3), (3,4), (4, 3)]
>>> try:
... for level in iter(topsort_levels( dependency_pairs )):
... print level
... except CycleError, exc:
... print 'CycleError:', exc
[1]
[2]
CycleError: ({3: 1, 4: 1}, {3: [4], 4: [3]})
The cycle error should look like.
CycleError: ({3: 1, 4: 1}, {3: [4], 4: [3]})
# todo: Make the doctest more robust (i.e. handle arbitrary dict order).
"""
num_parents = {} # element -> # of predecessors
children = {} # element -> list of successors
for parent, child in pairlist:
# Make sure every element is a key in num_parents.
if not num_parents.has_key( parent ):
num_parents[parent] = 0
if not num_parents.has_key( child ):
num_parents[child] = 0
# Since child has a parent, increment child's num_parents count.
num_parents[child] += 1
# ... and parent gains a child.
children.setdefault(parent, []).append(child)
return topsort_levels_core(num_parents, children)
def topsort_levels_core(num_parents, children):
"""Topologically sort a bunch of interdependent items based on dependency.
This returns a generator.
Turn this into a an iterator using the iter built-in function.
(if you iterate over the iterator, each element gets generated when
it is asked for, rather than generating the whole list up-front.)
Each generated element is a list of items at that dependency level.
>>> list(topsort_levels_core(
... {1: 0, 2: 1, 3: 1, 4: 1, 5: 2, 6: 2},
... {1: [2, 3, 5, 6], 2: [5], 3: [4], 4: [], 5: [6]}))
[[1], [2, 3], [4, 5], [6]]
>>> list(topsort_levels_core(
... {1: 0, 2: 2, 3: 1},
... {1: [2], 2: [3], 3: [2]}))
Traceback (most recent call last):
CycleError: ({2: 1, 3: 1}, {2: [3], 3: [2]})
This function has a more complicated interface than topsort_levels,
but is useful if the data is easier to generate in this form.
Arguments:
num_parents -- key: item, value: number of parents (predecessors)
children -- key: item, value: list of children (successors)
"""
while 1:
# Suck up everything without a predecessor.
level_parents = [x for x in num_parents.keys() if num_parents[x] == 0]
if not level_parents:
break
# Offer the next generated item,
# which is a list of the items at this dependency level.
yield level_parents
# For everything item in this level,
# decrement the parent count,
# since we have accounted for its parent.
for level_parent in level_parents:
del num_parents[level_parent]
if children.has_key(level_parent):
for level_parent_child in children[level_parent]:
num_parents[level_parent_child] -= 1
del children[level_parent]
if num_parents:
# Everything in num_parents has at least one child ->
# there's a cycle.
raise CycleError(num_parents, children)
else:
# This is the end of the generator.
raise StopIteration
def find_cycles(parent_children):
"""Yield cycles. Each result is a list of items comprising a cycle.
Use a 'stack' based approach to find all the cycles.
This is a generator, so yields each cycle as it finds it.
It is implicit that the last item in each cycle list is a parent of the
first item (thereby forming a cycle).
Arguments:
parent_children -- parent -> collection of children
Simplest cycle:
>>> cycles = list(find_cycles({'A': ['B'], 'B': ['A']}))
>>> len(cycles)
1
>>> cycle = cycles[0]
>>> cycle.sort()
>>> print cycle
['A', 'B']
Simplest cycle with extra baggage at the start and the end:
>>> cycles = list(find_cycles(parent_children={'A': ['B'],
... 'B': ['C'],
... 'C': ['B', 'D'],
... 'D': [],
... }))
>>> len(cycles)
1
>>> cycle = cycles[0]
>>> cycle.sort()
>>> print cycle
['B', 'C']
Double cycle:
>>> cycles = list(find_cycles(parent_children={'A': ['B'],
... 'B': ['C1', 'C2'],
... 'C1': ['D1'],
... 'D1': ['E1'],
... 'E1': ['D1'],
... 'C2': ['D2'],
... 'D2': ['E2'],
... 'E2': ['D2'],
... }))
>>> len(cycles)
2
>>> for cycle in cycles:
... cycle.sort()
>>> cycles.sort()
>>> cycle1 = cycles[0]
>>> cycle1.sort()
>>> print cycle1
['D1', 'E1']
>>> cycle2 = cycles[1]
>>> cycle2.sort()
>>> print cycle2
['D2', 'E2']
Simple cycle with children not specified for one item:
# todo: Should this barf instead?
>>> cycles = list(find_cycles(parent_children={'A': ['B'],
... 'B': ['A'],
... 'C': ['D']}))
>>> len(cycles)
1
>>> cycle = cycles[0]
>>> cycle.sort()
>>> print cycle
['A', 'B']
Diamond cycle
>>> cycles = list(find_cycles(parent_children={'A': ['B1', 'B2'],
... 'B1': ['C'],
... 'B2': ['C'],
... 'C': ['A', 'B1']}))
>>> len(cycles)
3
>>> sorted_cycles = []
>>> for cycle in cycles:
... cycle = list(cycle)
... cycle.sort()
... sorted_cycles.append(cycle)
>>> sorted_cycles.sort()
>>> for cycle in sorted_cycles:
... print cycle
['A', 'B1', 'C']
['A', 'B2', 'C']
['B1', 'C']
Hairy case (order can matter if something is wrong):
(Note order of B and C in the list.)
>>> cycles = list(find_cycles(parent_children={
... 'TD': ['DD'],
... 'TC': ['DC'],
... 'DC': ['DQ'],
... 'C': ['DQ'],
... 'DQ': ['IA', 'TO'],
... 'IA': ['A'],
... 'A': ['B', 'C'],
... }))
>>> len(cycles)
1
>>> cycle = cycles[0]
>>> cycle.sort()
>>> print cycle
['A', 'C', 'DQ', 'IA']
"""
cycles = []
visited_nodes = set()
for parent in parent_children:
if parent in visited_nodes:
# This node is part of a path that has already been traversed.
continue
paths = [[parent]]
while paths:
path = paths.pop()
parent = path[-1]
try:
children = parent_children[parent]
except KeyError:
continue
for child in children:
# Keeping a set of the path nodes, for O(1) lookups at the
# expense of more memory and complexity, actually makes speed
# worse. (Due to construction of sets.)
# This is O(N).
if child in path:
# This is a cycle.
cycle = path[path.index(child):]
# Check that this is not a dup cycle.
is_dup = False
for other_cycle in cycles:
if is_rotated(other_cycle, cycle):
is_dup = True
break
if not is_dup:
cycles.append(cycle)
yield cycle
else:
# Push this new path onto the 'stack'.
# This is probably the most expensive part of the algorithm
# (a list copy).
paths.append(path + [child])
# Mark the node as visited.
visited_nodes.add(child)
if __name__ == '__main__':
# Run the doctest tests.
import sys
import doctest
doctest.testmod(sys.modules['__main__'])
+1
View File
@@ -0,0 +1 @@
exec "`dirname "$0"`"/../../waf "$@"
+444
View File
@@ -0,0 +1,444 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import re
import Params
import Configure
import Object
import Action
import os
import Task
import pproc as subprocess
from Params import fatal, warning
import shutil
import sys
## Adjust python path to look for our local copy of pybindgen
LOCAL_PYBINDGEN_PATH = os.path.join(os.getcwd(), "bindings", "python", "pybindgen")
#PYBINDGEN_BRANCH = 'lp:pybindgen'
PYBINDGEN_BRANCH = 'https://launchpad.net/pybindgen'
if os.environ.get('PYTHONPATH', ''):
os.environ['PYTHONPATH'] = LOCAL_PYBINDGEN_PATH + os.pathsep + os.environ.get('PYTHONPATH')
else:
os.environ['PYTHONPATH'] = LOCAL_PYBINDGEN_PATH
## https://launchpad.net/pybindgen/
REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 578)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
def set_options(opt):
opt.tool_options('python')
opt.add_option('--disable-python',
help=("Don't build Python bindings."),
action="store_true", default=False,
dest='python_disable')
opt.add_option('--python-scan',
help=("Rescan Python bindings. Needs working GCCXML / pygccxml environment."),
action="store_true", default=False,
dest='python_scan')
opt.add_option('--pybindgen-checkout',
help=("During configure, force checkout of pybingen inside ns-3, "
"instead of using the system installed version."),
action="store_true", default=False,
dest='pybindgen_checkout')
def fetch_pybindgen(conf):
"""
Fetches pybindgen from launchpad as bindings/python/pybindgen.
Returns True if successful, False it not.
"""
bzr = conf.find_program("bzr")
if not bzr:
warning("the program 'bzr' is needed in order to fetch pybindgen")
return False
if len(REQUIRED_PYBINDGEN_VERSION) == 4:
rev = "-rrevno:%i" % REQUIRED_PYBINDGEN_VERSION[3]
else:
rev = "-rtag:%s" % '.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])
if os.path.exists(LOCAL_PYBINDGEN_PATH):
print "Trying to update pybindgen; this will fail if no network connection is available."
cmd = [bzr, "pull", rev, PYBINDGEN_BRANCH]
print " => ", ' '.join(cmd)
if subprocess.Popen(cmd, cwd=LOCAL_PYBINDGEN_PATH).wait():
return False
print "Update was successful."
else:
print "Trying to fetch pybindgen; this will fail if no network connection is available."
cmd = [bzr, "checkout", rev, PYBINDGEN_BRANCH, LOCAL_PYBINDGEN_PATH]
print " => ", ' '.join(cmd)
if subprocess.Popen(cmd).wait():
return False
print "Fetch was successful."
## generate a fake version.py file in pybindgen it's safer this
## way, since the normal version generation process requires
## bazaar python bindings, which may not be available.
vfile = open(os.path.join(LOCAL_PYBINDGEN_PATH, "pybindgen", "version.py"), "wt")
vfile.write("""
# (fake version generated by ns-3)
__version__ = %r
""" % list(REQUIRED_PYBINDGEN_VERSION))
vfile.close()
return True
def configure(conf):
conf.env['ENABLE_PYTHON_BINDINGS'] = False
if Params.g_options.python_disable:
conf.report_optional_feature("python", "Python Bindings", False,
"disabled by user request")
return
conf.check_tool('misc')
if sys.platform == 'cygwin':
conf.report_optional_feature("python", "Python Bindings", False,
"unsupported platform 'cygwin'")
warning("Python is not supported in CygWin environment. Try MingW instead.")
return
## Check for Python
try:
conf.check_tool('python')
conf.check_python_version((2,3))
conf.check_python_headers()
except Configure.ConfigurationError, ex:
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
return
## Check for pybindgen
if Params.g_options.pybindgen_checkout:
fetch_pybindgen(conf)
try:
conf.check_python_module('pybindgen')
except Configure.ConfigurationError:
warning("pybindgen missing")
if not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen missing and could not be retrieved")
return
else:
out = subprocess.Popen([conf.env['PYTHON'], "-c",
"import pybindgen.version; "
"print '.'.join([str(x) for x in pybindgen.version.__version__])"],
stdout=subprocess.PIPE).communicate()[0]
pybindgen_version_str = out.strip()
pybindgen_version = tuple([int(x) for x in pybindgen_version_str.split('.')])
conf.check_message('pybindgen', 'version',
(pybindgen_version >= REQUIRED_PYBINDGEN_VERSION),
pybindgen_version_str)
if not (pybindgen_version >= REQUIRED_PYBINDGEN_VERSION):
warning("pybindgen (found %s) is too old (need %s)" %
(pybindgen_version_str,
'.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])))
if not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen too old and newer version could not be retrieved")
return
## If all has gone well, we finally enable the Python bindings
conf.env['ENABLE_PYTHON_BINDINGS'] = True
conf.report_optional_feature("python", "Python Bindings", True, None)
## Check for pygccxml
try:
conf.check_python_module('pygccxml')
except Configure.ConfigurationError:
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"Missing 'pygccxml' Python module")
return
out = subprocess.Popen([conf.env['PYTHON'], "-c",
"import pygccxml; print pygccxml.__version__"],
stdout=subprocess.PIPE).communicate()[0]
pygccxml_version_str = out.strip()
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
conf.check_message('pygccxml', 'version',
(pygccxml_version >= REQUIRED_PYGCCXML_VERSION),
pygccxml_version_str)
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
warning("pygccxml (found %s) is too old (need %s) => "
"automatic scanning of API definitions will not be possible" %
(pygccxml_version_str,
'.'.join([str(x) for x in REQUIRED_PYGCCXML_VERSION])))
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"pygccxml too old")
return
## Check gccxml version
gccxml = conf.find_program('gccxml', var='GCCXML')
if not gccxml:
warning("gccxml missing; automatic scanning of API definitions will not be possible")
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"gccxml missing")
return
gccxml_version_line = os.popen(gccxml + " --version").readline().strip()
m = re.match( "^GCC-XML version (\d\.\d(\.\d)?)$", gccxml_version_line)
gccxml_version = m.group(1)
gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9])
conf.check_message('gccxml', 'version', True, gccxml_version)
if not gccxml_version_ok:
warning("gccxml too old, need version >= 0.9; automatic scanning of API definitions will not be possible")
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"gccxml too old")
return
## If we reached
conf.env['ENABLE_PYTHON_SCANNING'] = True
conf.report_optional_feature("pygccxml", "Python API Scanning Support", True, None)
prio_headers = {
-2: (
"string.h", # work around http://www.gccxml.org/Bug/view.php?id=6682
),
-1: (
"propagation-delay-model.h",
"propagation-loss-model.h",
"net-device.h",
)
}
def get_header_prio(header):
for prio, headers in prio_headers.iteritems():
if header in headers:
return prio
return 1
def calc_header_include(path):
(head, tail) = os.path.split (path)
if tail == 'ns3':
return ''
else:
return os.path.join (calc_header_include (head), tail)
def gen_ns3_metaheader(task):
assert len(task.m_outputs) == 1
header_files = [calc_header_include(node.abspath(task.m_env)) for node in task.m_inputs]
outfile = file(task.m_outputs[0].bldpath(task.m_env), "w")
def sort_func(h1, h2):
return cmp((get_header_prio(h1), h1), (get_header_prio(h1), h2))
header_files.sort(sort_func)
for header in header_files:
print >> outfile, "#include \"ns3/%s\"" % (header,)
print >> outfile, """
namespace ns3 {
static inline Ptr<Object>
__dummy_function_to_force_template_instantiation (Ptr<Object> obj, TypeId typeId)
{
return obj->GetObject<Object> (typeId);
}
}
"""
outfile.close()
return 0
class all_ns3_headers_taskgen(Object.task_gen):
"""Generates a 'everything.h' header file that includes some/all public ns3 headers.
This single header file is to be parsed only once by gccxml, for greater efficiency.
"""
def __init__(self, *features):
Object.task_gen.__init__(self, *features)
self.inst_var = 0#'INCLUDEDIR'
#self.inst_dir = 'ns3'
def apply(self):
## get all of the ns3 headers
ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
all_headers_inputs = []
for filename in self.to_list(self.source):
src_node = ns3_dir_node.find_build(filename)
if src_node is None:
Params.fatal("source ns3 header file %s not found" % (filename,))
all_headers_inputs.append(src_node)
## if self.source was empty, include all ns3 headers in enabled modules
if not all_headers_inputs:
for ns3headers in Object.g_allobjs:
if type(ns3headers).__name__ == 'ns3header_taskgen': # XXX: find less hackish way to compare
## skip headers not part of enabled modules
if self.env['NS3_ENABLED_MODULES']:
if ("ns3-%s" % ns3headers.module) not in self.env['NS3_ENABLED_MODULES']:
continue
for source in ns3headers.to_list(ns3headers.source):
#source = os.path.basename(source)
node = ns3_dir_node.find_build(source)
if node is None:
fatal("missing header file %s" % (source,))
all_headers_inputs.append(node)
assert all_headers_inputs
all_headers_outputs = [self.path.find_build("everything.h")]
task = self.create_task('gen-ns3-metaheader', self.env, 4)
task.set_inputs(all_headers_inputs)
task.set_outputs(all_headers_outputs)
def install(self):
pass
def get_modules_and_headers():
"""
Gets a dict of
module_name => ([module_dep1, module_dep2, ...], [module_header1, module_header2, ...])
tuples, one for each module.
"""
retval = {}
for module in Object.g_allobjs:
if not module.name.startswith('ns3-'):
continue
module_name = module.name[4:] # strip the ns3- prefix
## find the headers object for this module
headers = []
for ns3headers in Object.g_allobjs:
if type(ns3headers).__name__ != 'ns3header_taskgen': # XXX: find less hackish way to compare
continue
if ns3headers.module != module_name:
continue
for source in ns3headers.to_list(ns3headers.source):
headers.append(source)
retval[module_name] = (list(module.module_deps), headers)
return retval
class PythonScanTask(Task.TaskBase):
"""Uses gccxml to scan the file 'everything.h' and extract API definitions.
"""
def __init__(self, curdirnode, env):
self.m_display = 'python-scan'
self.prio = 5 # everything.h has prio 4
super(PythonScanTask, self).__init__()
self.curdirnode = curdirnode
self.env = env
def run(self):
#print "Rescanning the python bindings..."
argv = [
self.env['PYTHON'],
os.path.join(self.curdirnode.abspath(), 'ns3modulescan.py'), # scanning script
self.curdirnode.find_dir('../..').abspath(self.env), # include path (where the ns3 include dir is)
self.curdirnode.find_build('everything.h').abspath(self.env),
os.path.join(self.curdirnode.abspath(), 'ns3modulegen_generated.py'), # output file
]
scan = subprocess.Popen(argv, stdin=subprocess.PIPE)
scan.stdin.write(repr(get_modules_and_headers()))
scan.stdin.close()
if scan.wait():
raise SystemExit(1)
def build(bld):
if Params.g_options.python_disable:
return
env = bld.env_of_name('default')
curdir = bld.m_curdirnode.abspath()
#Object.register('all-ns3-headers', AllNs3Headers)
Action.Action('gen-ns3-metaheader', func=gen_ns3_metaheader, color='BLUE')
if env['ENABLE_PYTHON_BINDINGS']:
obj = bld.create_obj('all_ns3_headers')
if Params.g_options.python_scan:
if not env['ENABLE_PYTHON_SCANNING']:
Params.fatal("Cannot re-scan python bindings: (py)gccxml not available")
PythonScanTask(bld.m_curdirnode, env)
## Get a list of scanned modules; the set of scanned modules
## may be smaller than the set of all modules, in case a new
## ns3 module is being developed which wasn't scanned yet.
scanned_modules = []
for filename in os.listdir(curdir):
m = re.match(r"^ns3_module_(.+)\.py$", filename)
if m is None:
continue
name = m.group(1)
if name.endswith("__local"):
continue
scanned_modules.append(name)
if env['ENABLE_PYTHON_BINDINGS']:
bindgen = bld.create_obj('command-output')
bindgen.name = 'pybindgen'
bindgen.command = env['PYTHON']
bindgen.command_is_external = True
bindgen.stderr = 'ns3modulegen.log'
bindgen.argv = [
bindgen.input_file("ns3modulegen.py"),
bindgen.output_file("ns3module.cc"),
]
bindgen.argv.extend(get_modules_and_headers().iterkeys())
bindgen.hidden_inputs = ['ns3modulegen_generated.py',
'ns3modulegen_core_customizations.py']
for module in scanned_modules:
bindgen.hidden_inputs.append("ns3_module_%s.py" % module)
local = "ns3_module_%s__local.py" % module
if os.path.exists(os.path.join(curdir, local)):
bindgen.hidden_inputs.append(local)
bindgen.hidden_outputs = ['ns3module.h']
for module in scanned_modules:
bindgen.hidden_outputs.append("ns3_module_%s.cc" % module)
bindgen.prio = 50
bindgen.os_env = dict(os.environ)
features = []
for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']:
if was_enabled:
features.append(name)
bindgen.os_env['NS3_ENABLED_FEATURES'] = ','.join(features)
## we build python bindings if either we have the tools to
## generate them or if the pregenerated source file is already
## present in the source dir.
if env['ENABLE_PYTHON_BINDINGS'] \
or os.path.exists(os.path.join(bld.m_curdirnode.abspath(), 'ns3module.cc')):
pymod = bld.create_obj('cpp', 'shlib', 'pyext')
pymod.source = ['ns3module.cc', 'ns3module_helpers.cc']
pymod.includes = '.'
for module in scanned_modules:
pymod.source.append("ns3_module_%s.cc" % module)
pymod.target = 'ns3/_ns3'
pymod.name = 'ns3module'
pymod.uselib_local = "ns3"
pymod.env.append_value('CXXDEFINES', ['NS_DEPRECATED=""', 'NS3_DEPRECATED_H'])
# copy the __init__.py file to the build dir waf can't handle
# this, it's against waf's principles to have build dir files
# with the same name as source dir files, apparently.
dirnode = bld.m_curdirnode.find_dir('ns3')
src = os.path.join(dirnode.abspath(), '__init__.py')
dst = os.path.join(dirnode.abspath(env), '__init__.py')
try:
need_copy = os.stat(src).st_mtime > os.stat(dst).st_mtime
except OSError:
need_copy = True
if need_copy:
try:
os.mkdir(os.path.dirname(dst))
except OSError:
pass
print "%r -> %r" % (src, dst)
shutil.copy2(src, dst)
-561
View File
@@ -1,561 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Copyright (c) 2006 INRIA
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
import os
import os.path
import shutil
from SCons.Environment import Environment
from SCons.Builder import Builder
from SCons.Action import Action
import SCons
# hack stolen from wengo
# to get an ARGUMENTS defined correctly
try:
ARGUMENTS = SCons.Script.ARGUMENTS
COMMAND_LINE_TARGETS = SCons.Script.COMMAND_LINE_TARGETS
except AttributeError:
from SCons.Script.SConscript import Arguments
from SCons.Script.SConscript import CommandLineTargets
ARGUMENTS = Arguments
COMMAND_LINE_TARGETS = CommandLineTargets
class Ns3Module:
def __init__(self, name, dir):
self.sources = []
self.inst_headers = []
self.headers = []
self.extra_dist = []
self.deps = []
self.external_deps = []
self.config = []
self.name = name
self.dir = dir
self.executable = False
self.library = True
self.ldflags = []
self.header_inst_dir = ''
def set_library(self):
self.library = True
self.executable = False
def set_executable(self):
self.library = False
self.executable = True
def add_config(self, config_fn):
self.config.append(config_fn)
def add_extra_dist(self, dist):
self.extra_dist.append(dist)
def add_external_dep(self, dep):
self.external_deps.append(dep)
def add_dep(self, dep):
self.deps.append(dep)
def add_deps(self, deps):
self.deps.extend(deps)
def add_source(self, source):
self.sources.append(source)
def add_sources(self, sources):
self.sources.extend(sources)
def add_header(self, header):
self.headers.append(header)
def add_headers(self, headers):
self.headers.extend(headers)
def add_inst_header(self, header):
self.inst_headers.append(header)
def add_inst_headers(self, headers):
self.inst_headers.extend(headers)
def add_ldflags (self, ldflags):
self.ldflags.extend (ldflags)
def add_ldflag (self, ldflag):
self.add_ldflags ([ldflag])
def set_header_inst_dir (self, inst_dir):
self.header_inst_dir = inst_dir
def MyCopyAction(target, source, env):
try:
if len(target) == len(source):
for i in range(len(target)):
shutil.copy(source[i].path, target[i].path)
return 0
else:
return 'invalid target/source match'
except:
print
return 'exception'
def MyCopyActionPrint(target, source, env):
if len(target) == len(source):
output = ''
for i in range(len(target)):
output = output + 'copy \'' + source[i].path + '\' to \'' + target[i].path + '\''
if i < len(target) - 1:
output = output + '\n'
return output
else:
return 'error in copy'
def GcxxEmitter(target, source, env):
if os.path.exists(source[0].path):
return [target, source]
else:
return [[], []]
def MyRmTree(target, source, env):
shutil.rmtree(env['RM_DIR'])
return 0
def MyRmTreePrint(target, source, env):
return ''
def print_cmd_line(s, target, src, env):
print 'Building ' + (' and '.join([str(x) for x in target])) + '...'
class Ns3BuildVariant:
def __init__(self):
self.static = False
self.gcxx_deps = False
self.gcxx_root = ''
self.build_root = ''
self.env = None
class Ns3:
def __init__(self):
self.__modules = []
self.extra_dist = []
self.build_dir = 'build'
self.version = '0.0.1'
self.name = 'noname'
self.distname = 'noname'
self.doxygen_config = ''
def add(self, module):
self.__modules.append(module)
def add_extra_dist(self, dist):
self.extra_dist.append(dist)
def __get_module(self, name):
for module in self.__modules:
if module.name == name:
return module
return None
def get_mod_output(self, module, variant):
if module.executable:
suffix = variant.env.subst(variant.env['PROGSUFFIX'])
filename = os.path.join(variant.build_root, 'bin',
module.name + suffix)
else:
if variant.static:
prefix = variant.env['LIBPREFIX']
suffix = variant.env['LIBSUFFIX']
else:
prefix = variant.env['SHLIBPREFIX']
suffix = variant.env['SHLIBSUFFIX']
prefix = variant.env.subst(prefix)
suffix = variant.env.subst(suffix)
filename = os.path.join(variant.build_root, 'lib',
prefix + module.name + suffix)
return filename
def get_obj_builders(self, variant, module):
env = variant.env.Copy ()
objects = []
hash = {}
self.get_internal_deps (module, hash)
for dep in hash.values ():
if dep.header_inst_dir != '':
inc_dir = os.path.join(variant.build_root, 'include',
self.name, dep.header_inst_dir)
env.Append (CPPPATH = [inc_dir])
if len(module.config) > 0:
src_config_file = os.path.join(self.build_dir, 'config', module.name + '-config.h')
tgt_config_file = os.path.join(variant.build_root, 'include',
self.name, module.name + '-config.h')
for source in module.sources:
obj_file = os.path.splitext(source)[0] + '.o'
tgt = os.path.join(variant.build_root, module.dir, obj_file)
src = os.path.join(module.dir, source)
if variant.static:
obj_builder = env.StaticObject(target = tgt, source = src)
else:
obj_builder = env.SharedObject(target = tgt, source = src)
if len(module.config) > 0:
config_file = env.MyCopyBuilder(target = [tgt_config_file],
source = [src_config_file])
env.Depends(obj_builder, config_file)
if variant.gcxx_deps:
gcno_tgt = os.path.join(variant.build_root, module.dir,
os.path.splitext(source)[0] + '.gcno')
gcda_tgt = os.path.join(variant.build_root, module.dir,
os.path.splitext(source)[0] + '.gcda')
gcda_src = os.path.join(variant.gcxx_root, module.dir,
os.path.splitext(source)[0] + '.gcda')
gcno_src = os.path.join(variant.gcxx_root, module.dir,
os.path.splitext(source)[0] + '.gcno')
gcno_builder = env.CopyGcxxBuilder(target = gcno_tgt, source = gcno_src)
gcda_builder = env.CopyGcxxBuilder(target = gcda_tgt, source = gcda_src)
env.Depends(obj_builder, gcda_builder)
env.Depends(obj_builder, gcno_builder)
objects.append(obj_builder)
return objects
def get_internal_deps(self, module, hash):
for dep_name in module.deps:
dep = self.__get_module(dep_name)
hash[dep_name] = dep
self.get_internal_deps(dep, hash)
def get_external_deps(self, module):
hash = {}
self.get_internal_deps(module, hash)
ext_hash = {}
for mod in hash.values():
for ext_dep in mod.external_deps:
ext_hash[ext_dep] = 1
return ext_hash.keys()
def get_sorted_deps(self, module):
h = {}
self.get_internal_deps(module, h)
modules = []
for dep in h.keys():
deps_copy = []
mod = h[dep]
deps_copy.extend(mod.deps)
modules.append([mod, deps_copy])
sorted = []
while len(modules) > 0:
to_remove = []
for item in modules:
if len(item[1]) == 0:
to_remove.append(item[0].name)
for item in to_remove:
for i in modules:
if item in i[1]:
i[1].remove(item)
new_modules = []
for mod in modules:
found = False
for i in to_remove:
if i == mod[0].name:
found = True
break
if not found:
new_modules.append(mod)
modules = new_modules
sorted.extend(to_remove)
sorted.reverse()
# append external deps
ext_deps = self.get_external_deps(module)
for dep in ext_deps:
sorted.append(dep)
return sorted
def gen_mod_dep(self, variant):
build_root = variant.build_root
cpp_path = os.path.join(variant.build_root, 'include')
env = variant.env
env.Append(CPPPATH = [cpp_path])
header_dir = os.path.join(build_root, 'include', self.name)
lib_path = os.path.join(build_root, 'lib')
env.Append (LIBPATH = [lib_path])
module_builders = []
for module in self.__modules:
my_env = env.Copy ();
objects = self.get_obj_builders(variant, module)
libs = self.get_sorted_deps(module)
my_env.Append (LIBS = libs)
my_env.Append (LINKFLAGS = module.ldflags)
filename = self.get_mod_output(module, variant)
if module.executable:
module_builder = my_env.Program(target=filename, source=objects)
else:
if variant.static:
module_builder = my_env.StaticLibrary(target=filename, source=objects)
else:
module_builder = my_env.SharedLibrary(target=filename, source=objects)
for dep_name in module.deps:
dep = self.__get_module(dep_name)
my_env.Depends(module_builder, self.get_mod_output(dep, variant))
for header in module.inst_headers:
if module.header_inst_dir != '':
tgt = os.path.join(header_dir, module.header_inst_dir, header)
else:
tgt = os.path.join(header_dir, header)
src = os.path.join(module.dir, header)
#builder = env.Install(target = tgt, source = src)
header_builder = my_env.MyCopyBuilder(target=tgt, source=src)
my_env.Depends(module_builder, header_builder)
module_builders.append(module_builder)
return module_builders
def gen_mod_config(self, env):
config_dir = os.path.join(self.build_dir, 'config')
for module in self.__modules:
if len(module.config) > 0:
config_file = os.path.join(config_dir, module.name + '-config.h')
config_file_guard = module.name + '_CONFIG_H'
config_file_guard.upper()
if not os.path.isfile(config_file):
if not os.path.isdir(config_dir):
os.makedirs(config_dir)
outfile = open(config_file, 'w')
outfile.write('#ifndef ' + config_file_guard + '\n')
outfile.write('#define ' + config_file_guard + '\n')
config = env.Configure()
for fn in module.config:
output = fn(env, config)
for o in output:
outfile.write(o)
outfile.write('\n')
outfile.write('#endif /*' + config_file_guard + '*/\n')
config.Finish()
def generate_dependencies(self):
inheritenv = (ARGUMENTS.get('inheritenv', 'n') in 'yY1')
if inheritenv:
env = Environment(ENV=os.environ)
else:
env = Environment()
self.gen_mod_config(env)
cc = env['CC']
cxx = env.subst(env['CXX'])
if cc == '':
print "Missing C compiler."
env.Exit (1);
if cxx == '':
print "Missing C++ compiler."
env.Exit (1);
common_flags = ARGUMENTS.get('cflags', '').split(' ')
cxxflags = ARGUMENTS.get('cxxflags', '').split(' ')
ldflags = ARGUMENTS.get('ldflags', '').split(' ')
if cc == 'cl' and cxx == 'cl':
env = Environment(tools=['mingw'])
cc = env['CC']
cxx = env.subst(env['CXX'])
if cc == 'gcc' and cxx == 'g++':
common_flags.extend(['-g3', '-Wall', '-Werror'])
debug_flags = []
opti_flags = ['-O3']
elif cc == 'cl' and cxx == 'cl':
env = Environment(ENV=os.environ)
debug_flags = ['-W1', '-GX', '-EHsc', '-D_DEBUG', '/MDd']
opti_flags = ['-O2', '-EHsc', '-DNDEBUG', '/MD']
cc = ARGUMENTS.get ('cc', '')
cxx = ARGUMENTS.get ('cxx', '')
if cc != '':
env.Replace (CC = cc)
if cxx != '':
env.Replace (CXX = cxx)
env.Append(CCFLAGS = common_flags,
CPPDEFINES = ['RUN_SELF_TESTS'],
TARFLAGS = '-c -z',
CPPFLAGS = cxxflags,
LINKFLAGS = ldflags)
if env['PLATFORM'] == 'posix':
env.Append(LINKFLAGS = ' -z origin')
env.Append(RPATH=env.Literal(os.path.join('\\$$ORIGIN', os.pardir, 'lib')))
verbose = ARGUMENTS.get('verbose', 'n')
if verbose == 'n':
env['PRINT_CMD_LINE_FUNC'] = print_cmd_line
header_builder = Builder(action = Action(MyCopyAction, strfunction=MyCopyActionPrint))
env.Append(BUILDERS = {'MyCopyBuilder':header_builder})
gcxx_builder = Builder(action = Action(MyCopyAction, strfunction=MyCopyActionPrint),
emitter = GcxxEmitter)
env.Append(BUILDERS = {'CopyGcxxBuilder':gcxx_builder})
variant = Ns3BuildVariant()
builders = []
gcov_env = env.Copy()
gcov_env.Append(CFLAGS = ['-fprofile-arcs', '-ftest-coverage'],
CXXFLAGS = ['-fprofile-arcs', '-ftest-coverage'],
LINKFLAGS = ['-fprofile-arcs'])
# code coverage analysis
variant.static = False
variant.env = gcov_env
variant.build_root = os.path.join(self.build_dir, 'gcov')
builders = self.gen_mod_dep(variant)
for builder in builders:
gcov_env.Alias('gcov', builder)
gcov_env.Alias('lcov-report')
if 'lcov-report' in COMMAND_LINE_TARGETS:
lcov_report_dir = os.path.join(self.build_dir, 'lcov-report')
create_dir_command = "rm -rf " + lcov_report_dir
create_dir_command += " && mkdir " + lcov_report_dir + ";"
gcov_env.Execute(create_dir_command)
info_file = os.path.join(lcov_report_dir, self.name + '.info')
lcov_command = "utils/lcov/lcov -c -d . -o " + info_file
lcov_command += " --source-dirs=" + os.getcwd()
lcov_command += ":" + os.path.join(os.getcwd(),
variant.build_root,
'include')
gcov_env.Execute(lcov_command)
genhtml_command = "utils/lcov/genhtml -o " + lcov_report_dir
genhtml_command += " " + info_file
gcov_env.Execute(genhtml_command)
opt_env = env.Copy()
opt_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
# optimized static support
variant.static = True
variant.env = opt_env
variant.build_root = os.path.join(self.build_dir, 'opt-static')
builders = self.gen_mod_dep(variant)
for builder in builders:
opt_env.Alias('opt-static', builder)
opt_env = env.Copy()
opt_env.Append(CFLAGS = opti_flags,
CXXFLAGS = opti_flags,
CPPDEFINES = ['NDEBUG'])
# optimized shared support
variant.static = False
variant.env = opt_env
variant.build_root = os.path.join(self.build_dir, 'opt-shared')
builders = self.gen_mod_dep(variant)
for builder in builders:
opt_env.Alias('opt-shared', builder)
arc_env = env.Copy()
arc_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
arc_env.Append(CFLAGS=['-frandom-seed=0', '-fprofile-generate'],
CXXFLAGS=['-frandom-seed=0', '-fprofile-generate'],
LINKFLAGS=['-frandom-seed=0', '-fprofile-generate'])
# arc profiling
variant.static = False
variant.env = arc_env
variant.build_root = os.path.join(self.build_dir, 'opt-arc')
builders = self.gen_mod_dep(variant)
for builder in builders:
arc_env.Alias('opt-arc', builder)
arcrebuild_env = env.Copy()
arcrebuild_env.Append(CFLAGS=opti_flags,
CXXFLAGS=opti_flags,
CPPDEFINES=['NDEBUG'])
arcrebuild_env.Append(CFLAGS=['-frandom-seed=0', '-fprofile-use'],
CXXFLAGS=['-frandom-seed=0', '-fprofile-use'],
LINKFLAGS=['-frandom-seed=0', '-fprofile-use'])
# arc rebuild
variant.static = False
variant.env = arcrebuild_env
variant.gcxx_deps = True
variant.gcxx_root = os.path.join(self.build_dir, 'opt-arc')
variant.build_root = os.path.join(self.build_dir, 'opt-arc-rebuild')
builders = self.gen_mod_dep(variant)
for builder in builders:
arcrebuild_env.Alias('opt-arc-rebuild', builder)
variant.gcxx_deps = False
dbg_env = env.Copy()
dbg_env.Append(CFLAGS = debug_flags,
CXXFLAGS = debug_flags,
CPPDEFINES = ['NS3_DEBUG_ENABLE',
'NS3_ASSERT_ENABLE'])
# debug static support
variant.static = True
variant.env = dbg_env
variant.build_root = os.path.join(self.build_dir, 'dbg-static')
builders = self.gen_mod_dep(variant)
for builder in builders:
dbg_env.Alias('dbg-static', builder)
dbg_env = env.Copy()
dbg_env.Append(CFLAGS=debug_flags,
CXXFLAGS=debug_flags,
CPPDEFINES = ['NS3_DEBUG_ENABLE',
'NS3_ASSERT_ENABLE'])
# debug shared support
variant.static = False
variant.env = dbg_env
variant.build_root = os.path.join(self.build_dir, 'dbg-shared')
builders = self.gen_mod_dep(variant)
for builder in builders:
dbg_env.Alias('dbg-shared', builder)
env.Alias('dbg', 'dbg-shared')
env.Alias('opt', 'opt-shared')
env.Default('dbg')
env.Alias('all', ['dbg-shared', 'dbg-static', 'opt-shared', 'opt-static'])
# dist support
dist_env = env.Copy()
if dist_env['PLATFORM'] == 'posix' or dist_env['PLATFORM'] == 'darwin':
dist_list = []
for module in self.__modules:
for f in module.sources:
dist_list.append(os.path.join(module.dir, f))
for f in module.headers:
dist_list.append(os.path.join(module.dir, f))
for f in module.inst_headers:
dist_list.append(os.path.join(module.dir, f))
for f in module.extra_dist:
dist_list.append(os.path.join(module.dir, f))
for f in self.extra_dist:
dist_list.append(f)
dist_list.append (self.doxygen_config)
dist_list.append('SConstruct')
dist_list.append('build.py')
targets = []
basename = self.distname + '-' + self.version
for src in dist_list:
tgt = os.path.join(basename, src)
targets.append(dist_env.MyCopyBuilder(target=tgt, source=src))
tar = basename + '.tar.gz'
zip = basename + '.zip'
tmp_tar = os.path.join(self.build_dir, tar)
tmp_zip = os.path.join(self.build_dir, zip)
dist_tgt = [tar, zip]
dist_src = [tmp_tar, tmp_zip]
dist_env.Tar(tmp_tar, targets)
dist_env.Zip(tmp_zip, targets)
dist_builder = dist_env.MyCopyBuilder(target=dist_tgt, source=dist_src)
dist_env.Alias('dist', dist_builder)
dist_env.Append(RM_DIR=basename)
dist_env.AddPostAction(dist_builder, dist_env.Action(MyRmTree,
strfunction=MyRmTreePrint))
dist_builder = dist_env.MyCopyBuilder(target=dist_tgt, source=dist_src)
dist_env.Alias('fastdist', dist_tgt)
# distcheck
distcheck_list = []
for src in dist_list:
tgt = os.path.join(self.build_dir, basename, src)
distcheck_list.append(tgt)
untar = env.Command(distcheck_list, tar,
['cd ' + self.build_dir + ' && tar -zxf ../' + tar])
scons_dir = os.path.join(self.build_dir, basename)
distcheck_builder = env.Command('x', distcheck_list,
['cd ' + scons_dir + ' && scons'])
env.AlwaysBuild(distcheck_builder)
env.Alias('distcheck', distcheck_builder)
if self.doxygen_config != '':
doxy = env.Command('doc/html/*', self.doxygen_config,
['doxygen ' + self.doxygen_config])
env.AlwaysBuild(doxy)
env.Alias('doc', doxy)
-91
View File
@@ -1,91 +0,0 @@
The main ns-3 build system is SCons. Read the file build.txt
for SCons instructions.
Waf is an alternative build system, similar to SCons. ns-3 now is
able to build with Waf, in parallel to SCons.
(http://www.freehackers.org/~tnagy/waf.html)
Note: the Waf build scripts are experimental at this stage.
Gustavo Carneiro (gjcarneiro@gmail.com) is the maintainer.
=== Building with Waf ===
To build ns-3 with waf type the commands:
1. ./waf configure [options]
2. ./waf
[ Note: if ./waf does not exist, see the section "Note for developers" below ]
To see valid configure options, type ./waf --help. The most important
option is -d <debug level>. Valid debug levels (which are listed in
./waf --help) are: ultradebug, debug, release, and optimized.
The resulting binaries are placed in build/<debuglevel>/srcpath.
Other waf usages include:
1. ./waf check
Runs the unit tests
2. ./waf --doxygen
Run doxygen to generate documentation
3. ./waf --lcov-report
Run code coverage analysis (assuming the project was configured
with --enable-gcov)
=== Extending ns-3 ===
To add new modules:
1. Create the module directory under src (or src/devices, or whatever);
2. Add the source files to it;
3. Add a 'wscript' describing it;
4. Add the module subdirectory name to the all_modules list in src/wscript.
A module's wscript file is basically a regular Waf script. A ns-3
module is created as a cpp/shlib object, like this:
def build(bld):
obj = bld.create_obj('cpp', 'shlib')
## set module name; by convention it starts with ns3-
obj.name = 'ns3-mymodule'
obj.target = obj.name
## list dependencies to other modules
obj.uselib_local = ['ns3-core']
## list source files (private or public header files excluded)
obj.source = [
'mymodule.cc',
]
## list module public header files
headers = bld.create_obj('ns3header')
headers.source = [
'mymodule-header.h',
]
=== Note for developers ===
The ns-3 code repository does not contain the waf script. Instead,
developers should check it out from a subversion repository:
svn checkout http://waf.googlecode.com/svn/tags/ns3/ waf
[ note: 'tags/ns3' is a tag that represents the last svn version
tested to work correctly with ns3, although 'trunk' will likely work
as well ]
Then it can be installed system-wide with 'sudo ./waf-light install'.
When preparing a distribution, the resulting 'waf' script, which is
self contained (no external files needed), can be easily included in
the tarball so that users downloading ns-3 can easily build it without
having Waf installed (although Python >= 2.3 is still needed).
The command 'waf dist' can be used to create a distribution tarball.
It includes all files in the source directory, except some particular
extensions that are blacklisted, such as back files (ending in ~).
+71 -159
View File
@@ -1,186 +1,98 @@
If you want to build ns3, you need to install scons (see
http://www.scons.org). scons takes care of building
the whole source tree using your system compiler. scons
0.91.1 and 0.91.96 have been tested and are known to
work on linux FC5, Mac os X and MinGW.
The Waf build system is used to build ns-3. Waf is a Python-based
build system (http://www.freehackers.org/~tnagy/waf.html)
To start a build, you can just type 'scons' which
will generate a debug shared build by default, located
in the directory 'build-dir/dbg-shared/bin' and
'build-dir/dbg-shared/lib'.
=== Installing Waf ===
All builds are built with debugging symbols. Debugging
builds enable asserts while optimized builds disable them.
On platforms which support it, rpath is used which means that
the executable binaries generated link explicitely against
the right libraries. This saves you the pain of having to
setup environment variables to point to the right libraries.
The top-level ns-3 directory should contain a current waf script.
(Note: An alternative build system (Waf) is being
evaluated in the development branch of ns-3-dev on our server
only (i.e., not in the release tarballs)-- see doc/build-waf.txt)
=== Building with Waf ===
1) Options
----------
To build ns-3 with waf type the commands from the top-level directory:
1. ./waf configure [options]
2. ./waf
- verbose: if you have installed scons 0.91.96 or higher,
the default build output is terse. To get a more verbose
output, you need to set the 'verbose' variable to 'y'.
Example: scons verbose=y
- cflags: flags for the C compiler.
Example: scons cflags="-O3 -ffast-math"
- cxxflags: flags for the C++ compiler.
Example: scons cxxflags="-O3 -ffast-math"
- ldflags: flags for the linker:
Example: scons ldflags="-L/foo -L/bar"
- cc: the C compiler to use:
Example: scons cc=gcc-4.0
- cxx: the C++ compiler to use:
Example: scons cxx=g++-4.0
- high-precision-as-double: set to 'y' to make sure that the
high-precision arithmetics performed by the Time class on
behalf of the user will use doubles. By default, the code
uses 128 integers.
Example: scons high-precision-as-double=y
- inheritenv: set to 'y' if you want to make your compiler
execute within the same environment (env vars) as your own
shell. This is typically used to make colorgcc work.
Example: scons inheritenv=y
To see valid configure options, type ./waf --help. The most important
option is -d <debug level>. Valid debug levels (which are listed in
waf --help) are: "debug" or "optimized". It is
also possible to change the flags used for compilation with (e.g.):
CXXFLAGS="-O3" ./waf configure.
2) Targets
----------
[ Note: Unlike some other build tools, to change the build target,
the option must be supplied during the configure stage rather than
the build stage (i.e., "./waf -d optimized" will not work; instead, do
"./waf -d optimized configure; ./waf" ]
- doc: build the doxygen documentation.
Example: scons doc
The resulting binaries are placed in build/<debuglevel>/srcpath.
- dbg-shared: a debug build using shared libraries.
The files are built in 'build-dir/dbg-shared/'.
Example: scons dbg-shared
Other waf usages include:
- dbg-static: a debug build using static libraries
The files are built in 'build-dir/dbg-static/'.
Example: scons dbg-static
1. ./waf check
Runs the unit tests
- opt-shared: an optimized build using shared libraries.
The files are built in 'build-dir/opt-shared/'.
Example: scons opt-shared
2. ./waf --doxygen
Run doxygen to generate documentation
- opt-static: an optimized build using static libraries.
The files are built in 'build-dir/opt-static/'.
Example: scons opt-static
3. ./waf --lcov-report
Run code coverage analysis (assuming the project was configured
with --enable-gcov)
- dbg: an alias for dbg-shared
Example: scons dbg
4. ./waf --run "program [args]"
Run a ns3 program, given its target name, with the given
arguments. This takes care of automatically modifying the the
path for finding the ns3 dynamic libraries in the environment
before running the program. Note: the "program [args]" string is
parsed using POSIX shell rules.
- opt: an alias for opt-shared
Example: scons opt
4.1 ./waf --run programname --command-template "... %s ..."
- all: alias for dbg-shared, dbg-static, opt-shared
and opt-static
Example: scons all
Same as --run, but uses a command template with %s replaced by the
actual program (whose name is given by --run). This can be use to
run ns-3 programs with helper tools. For example, to run unit
tests with valgrind, use the command:
- gcov: code coverage analysis. Build a debugging version of
the code for code coverage analysis in 'build-dir/gcov'. Once
the code has been built, you can run various applications to
exercise the code paths. To generate an html report from
the gcov data, use the lcov-report target
./waf --run run-tests --command-template "valgrind %s"
- lcov-report: generate html report of gcov data. The output
is stored in 'build-dir/lcov-report/'.
5. ./waf --shell
Starts a nested system shell with modified environment to run ns3 programs.
- dist: generate a release tarball and zipfile from the
source tree. The tarball and zipfile name are generated
according to the version number stored in the SConstruct
file.
Example in SConstruct:
ns3 = Ns3 ()
ns3.name = 'foo'
ns3.version = '0.0.10'
Example command: scons dist
Example output files:
foo-0.0.10.tar.gz
foo-0.0.10.zip
6. ./waf distclean
Cleans out the entire build/ directory
- distcheck: generate a release tarball and zipfile and
attempt to run the 'all' target for the release tarball.
Example: scons distcheck
7. ./waf dist
The command 'waf dist' can be used to create a distribution tarball.
It includes all files in the source directory, except some particular
extensions that are blacklisted, such as back files (ending in ~).
3) How the build system works
-----------------------------
The current build system defines what are called "ns3 modules": each module
is a set of source files, normal header files and installable header
files. Each module also depends on a set of other modules. We build
modules automatically in the correct order. That is, we always start
from the module which does not depend on any other module (core) and
proceed with the other modules and make sure that when a module is
built, all the modules it depends upon have already been built.
=== Extending ns-3 ===
To build a module, we:
1) generate the .o files
2) link the .o files together
3) install the installable headers in the common directory
top_build_dir/include/ns3.
To add new modules:
1. Create the module directory under src (or src/devices, or whatever);
2. Add the source files to it;
3. Add a 'wscript' describing it;
4. Add the module subdirectory name to the all_modules list in src/wscript.
This means that if you want to use a header from your own module, you
should just include it: #include "foo.h" but if you want to include a
header from another module, you need to include it with #include
"ns3/bar.h". This allows you to make sure that our "public" ns3 headers
do not conflict with existing system-level headers. For instance,
if you were to define a header called queue.h, you would include
ns3/queue.h rather than queue.h, when including from a separate module,
since many systems provide a queue.h system include file.
A module's wscript file is basically a regular Waf script. A ns-3
module is created as a cpp/shlib object, like this:
4) How to add files to a module ?
---------------------------------
def build(bld):
obj = bld.create_obj('cpp', 'shlib')
In the main SConstruct file, you can add source code
to the add_sources method. For example, to add a foo.cc
file to the core module, we coud do this:
core.add_sources ('foo.cc')
Of course, if this file implements public API, its
header should be installable:
core.add_inst_headers ('foo.h')
## set module name; by convention it starts with ns3-
obj.name = 'ns3-mymodule'
obj.target = obj.name
5) How to create a new module ?
-------------------------------
## list dependencies to other modules
obj.uselib_local = ['ns3-core']
# create a new module. First arg is the name of
# the new module. Second arg is the directory in
# which all source files for this module reside.
my_module = build.Ns3Module ('my', 'src/my_dir')
# add it to build system
ns3.add (my_module)
# specify module dependencies. Here, depends
# on the 'ipv4' and 'core' modules
my_module.add_deps (['core', 'ipv4'])
# add source code to build located in
# src/my_dir
my_module.add_sources ([
'my_a.cc',
'my_b.cc',
'my_c.cc'
])
my_module.add_sources ([
'my_d.cc'
])
# add headers which are not public
my_module.add_headers ([
'my_a.h',
'my_c.h'
])
# add headers which are public
my_module.add_inst_headers ([
'my_b.h'
])
my_module.add_inst_headers ([
'my_d.h'
])
# if you need to link against an external library,
# you must add 'external' dependencies. Here, the
# pthread library
my_module.add_external_dep ('pthread')
# by default, a module is conceptually a library. If you
# want to generate an executable from a module you need to:
my_module.set_executable ()
## list source files (private or public header files excluded)
obj.source = [
'mymodule.cc',
]
## list module public header files
headers = bld.create_obj('ns3header')
headers.source = [
'mymodule-header.h',
]
+158 -65
View File
@@ -1,4 +1,4 @@
# Doxyfile 1.4.4
# Doxyfile 1.5.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
@@ -14,10 +14,18 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file that
# follow. The default is UTF-8 which is also the encoding used for all text before
# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into
# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of
# possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = "NS-3"
PROJECT_NAME = "NS-3 "
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -45,24 +53,14 @@ CREATE_SUBDIRS = NO
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
# Swedish, and Ukrainian.
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
OUTPUT_LANGUAGE = English
# This tag can be used to specify the encoding used in the generated output.
# The encoding is not always determined by the language that is chosen,
# but also whether or not the output is meant for Windows or non-Windows users.
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
# forces the Windows encoding (this is the default for the Windows binary),
# whereas setting the tag to NO uses a Unix-style encoding (the default for
# all platforms other than Windows).
USE_WINDOWS_ENCODING = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
@@ -135,11 +133,19 @@ SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explicit @brief command for a brief description.
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
@@ -161,13 +167,6 @@ DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
@@ -195,13 +194,40 @@ ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
# only. Doxygen will then generate output that is more tailored for Java.
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for Java.
# For instance, namespaces will be presented as packages, qualified scopes
# will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
# include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
@@ -210,6 +236,16 @@ OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is
# documented as struct with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code where the coding convention is that all structs are
# typedef'ed and only the typedef is referenced never the struct's name.
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -244,6 +280,13 @@ EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be extracted
# and appear in the documentation as a namespace called 'anonymous_namespace{file}',
# where file will be replaced with the base name of the file that contains the anonymous
# namespace. By default anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
@@ -376,7 +419,7 @@ SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is YES.
# in the documentation. The default is NO.
SHOW_DIRECTORIES = NO
@@ -385,7 +428,7 @@ SHOW_DIRECTORIES = NO
# version control system). Doxygen will invoke the program by executing (via
# popen()) the command <command> <input-file>, where <command> is the value of
# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
# provided by doxygen. Whatever the progam writes to standard output
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
@@ -397,7 +440,7 @@ FILE_VERSION_FILTER =
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
@@ -433,7 +476,7 @@ WARN_NO_PARAMDOC = NO
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
WARN_FORMAT = "$file:$line: $text "
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
@@ -450,16 +493,28 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src doc/main.txt
INPUT = doc/modules \
doc/main.h \
doc/introspected-doxygen.h \
doc/howtos/ \
src
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding.
# See http://www.gnu.org/software/libiconv for the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS = *.h *.tcc
FILE_PATTERNS = *.h \
*.tcc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -471,10 +526,12 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = \
src/simulator/high-precision.h \
src/simulator/high-precision-128.h \
src/simulator/high-precision-double.h
EXCLUDE = src/routing/olsr/olsr-state.h \
src/routing/olsr/repositories.h \
src/routing/olsr/routing-table.h \
src/simulator/high-precision.h \
src/simulator/high-precision-128.h \
src/simulator/high-precision-double.h
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@@ -490,6 +547,13 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the output.
# The symbol name can be a fully qualified name, a word, or if the wildcard * is used,
# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
@@ -514,7 +578,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
IMAGE_PATH = doc
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -548,7 +612,9 @@ FILTER_SOURCE_FILES = NO
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH
# then you must also enable this option. If you don't then doxygen will produce
# a warning and turn it on anyway
SOURCE_BROWSER = NO
@@ -575,6 +641,13 @@ REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code. Otherwise they will link to the documentstion.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
@@ -667,6 +740,14 @@ HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
@@ -965,13 +1046,13 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
@@ -999,14 +1080,18 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = RUN_SELF_TESTS NS3_DEBUG_ENABLE
PREDEFINED = RUN_SELF_TESTS \
NS3_ASSERT_ENABLE \
NS3_LOG_ENABLE
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED = ATTRIBUTE_VALUE_DEFINE \
ATTRIBUTE_VALUE_DEFINE_WITH_NAME \
ATTRIBUTE_HELPER_HEADER_2
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
@@ -1072,6 +1157,14 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to
# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to
# specify the directory where the mscgen tool resides. If left empty the tool is assumed to
# be found in the default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
@@ -1129,7 +1222,7 @@ INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
# generate a call dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
@@ -1137,6 +1230,14 @@ INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will
# generate a caller dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
@@ -1166,31 +1267,23 @@ DOT_PATH =
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the number
# of direct children of the root node in a graph is already larger than
# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that a graph may be further truncated if the graph's
# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
# the graph is not depth-constrained.
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
+203
View File
@@ -0,0 +1,203 @@
/*!
\page application How to create a traffic generator ?
\anchor howtos-application
<b>Question:</b> How do I create a new traffic generator ?
<b>Answer:</b> It is possible to instanciate \ref ns3::Packet "Packet"
objects, schedule events, and call functions from any piece of code
in ns-3 so, technically, there is no single answer to the question of
how we can write a new traffic generator. However, the
\ref ns3::Socket "Socket" API was really designed to be the single
point of entry for traffic generators or traffic analysers and the
\ref ns3::Application "Application" class was designed to hold
together any number of sockets.
Implementing a new traffic generator thus boils down to:
- implementing a new subclass of the \ref ns3::Application "Application"
base class
- instanciate one or many sockets within that application
- start scheduling events when \ref ns3::Application::StartApplication "StartApplication"
is called
- stop scheduling events when \ref ns3::Application::StopApplication "StopApplication"
is called
- create packets and send them over one or many sockets in each event
The following "random" generator generates packets separated by a random
delay and with a random size.
\code
class RandomGenerator : public Application
{
public:
RandomGenerator ();
void SetDelay (RandomVariable delay);
void SetSize (RandomVariable size);
void SetRemote (std::string socketType,
Address remote);
private:
virtual void StartApplication (void);
virtual void StopApplication (void);
void DoGenerate (void);
RandomVariable m_delay;
RandomVariable m_size;
Ptr<Socket> m_socket;
};
\endcode
The socket is created in the SetRemote method:
\code
void
RandomGenerator::SetRemote (std::string socketType,
Address remote)
{
TypeId tid = TypeId::LookupByName (socketType);
m_socket = Socket::CreateSocket (GetNode (), tid);
m_socket->Bind ();
m_socket->ShutdownRecv ();
m_socket->Connect (remote);
}
\endcode
While the the crux of the logic is located in the DoGenerate method
which is called from within StartApplication:
\code
void
RandomGenerator::DoGenerate (void)
{
m_next = Simulator::Schedule (Seconds (m_delay.GetValue ()),
&RandomGenerator::DoGenerate, this);
Ptr<Packet> p = Create<Packet> (m_size.GetIntValue ());
m_socket->Send (p);
}
\endcode
To make that application more integrated in ns-3, it needs an associated
helper class:
\code
class RandomAppHelper
{
public:
RandomAppHelper (std::string protocol, Address remote);
void SetPacketSize (RandomVariable packetSize);
void SetDelay (RandomVariable delay);
ApplicationContainer Install (NodeContainer nodes);
private:
std::string m_protocol;
Address m_remote;
RandomVariable m_packetSize;
RandomVariable m_delay;
};
\endcode
which could be trivially implemented as:
\code
ApplicationContainer
RandomAppHelper::Install (NodeContainer nodes)
{
ApplicationContainer applications;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<RandomAppHelper> app = CreateObject<RandomAppHelper> ();
app->SetSize (m_packetSize);
app->SetDelay (m_delay);
app->SetRemote (m_protocol, m_remote);
(*i)->AddApplication (app);
applications.Add (app);
}
return applications;
}
\endcode
Despite being functional, this API is not very consistant with the style of
the other helper classes, all of which allow you to control the parameters
of the underlying class through attributes and not explicit setters. The
following API thus replaces the pair SetPacketSize/SetDelay with a single
method SetAttribute:
\code
class RandomAppHelper
{
public:
RandomAppHelper (std::string protocol, Address remote);
void SetAttribute (std::string name, const AttributeValue &value);
ApplicationContainer Install (NodeContainer c);
private:
std::string m_protocol;
Address m_remote;
ObjectFactory m_factory;
};
\endcode
And which can be used as follows:
\code
RandomAppHelper app = RandomAppHelper ("ns3::TcpSocketFactory",
InetSocketAddress (Ipv4Address ("192.168.1.10"), 10));
app.SetAttribute ("Delay", StringValue ("Constant:2.5"));
app.SetAttribute ("Size", StringValue ("Constant:2100"));
app.Install (nodes);
\endcode
The implementation, in this case, is not necessarily longer but its
simplicity hides a lot of behind-the-scenes complexity:
\code
void
RandomAppHelper::SetAttribute (std::string name, const AttributeValue &value)
{
m_factory.Set (name, value);
}
ApplicationContainer
RandomAppHelper::Install (NodeContainer nodes)
{
ApplicationContainer applications;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<RandomAppHelper> app = m_factory.Create<RandomAppHelper> ();
app->SetRemote (m_socketType, m_remote);
(*i)->AddApplication (app);
applications.Add (app);
}
return applications;
}
\endcode
The key difference between this implementation and the previous one
is that this helper does not handle explicitely the attributes
delay and packet size. Instead, it stores them in an
\ref ns3::ObjectFactory "ObjectFactory" object. This, of course,
does not work magically, and requires extra support from the
underlying RandomGenerator class. Specifically, it requires
that the underlying RandomGenerator defines its attributes
in its \ref ns3::TypeId "TypeId" in a new public static method:
\code
class RandomGenerator
{
public:
static TypeId GetTypeId (void);
};
\endcode
The corresponding implementation is shown below:
\code
TypeId
RandomGenerator::GetTypeId (void)
{
static TypeId tid = TypeId ("RandomGenerator")
.SetParent<Application> ()
.AddConstructor<RandomGenerator> ()
.AddAttribute ("Delay", "The delay between two packets (s)",
RandomVariableValue (ConstantVariable (1.0)),
MakeRandomVariableAccessor (&RandomGenerator::m_delay),
MakeRandomVariableChecker ())
.AddAttribute ("PacketSize", "The size of each packet (bytes)",
RandomVariableValue (ConstantVariable (2000)),
MakeRandomVariableAccessor (&RandomGenerator::m_size),
MakeRandomVariableChecker ())
;
return tid;
}
\endcode
*/
+38
View File
@@ -0,0 +1,38 @@
/*!
\page callbacks Using ns-3 callbacks
\anchor howtos-callbacks
\section null_callbacks Null Callbacks
<b>Question:</b> The API I am using calls for using a callback (in the
function signature), but I do not
want to provide one. Is there a way to provide a null callback?
<b>Answer:</b> Use the ns3::MakeNullCallback construct:
\code
template<typename R>
Callback< R, T1, T2, T3, T4, T5, T6 > ns3::MakeNullCallback (void)
\endcode
Example usage: The ns3::Socket class uses callbacks to indicate completion
of events such as a successful TCP connect(). These callbacks are set
in the following function:
\code
void Socket::SetConnectCallback (Callback<void, Ptr<Socket> > connectionSucceeded,
Callback<void, Ptr<Socket> > connectionFailed,
Callback<void, Ptr<Socket> > halfClose);
\endcode
But suppose you do not care about registering a callback for the
halfClose event (but you want to register one for the
connectionSucceeded and connectionFailed cases). In that case, you
can pass a null callback as the third argument. You just need to
pass a callback with the matching signature, as follows:
\code
localSocket->SetConnectCallback (
MakeCallback (&ConnectionSucceededCallback),
MakeCallback (&ConnectionFailedCallback),
MakeNullCallback<void, Ptr<Socket> > () );
\endcode
*/
+162
View File
@@ -0,0 +1,162 @@
/*!
\page net-device How to create a new OSI layer 1 + 2 implementation ?
\anchor howtos-net-device
<b>Question:</b> How do I integrate a new OSI layer 1 + 2 implementation ?
<b>Answer:</b> The OSI layers 1 and 2 are represented by the ns3::NetDevice
and ns3::Channel classes. To plug transparently in ns-3, a new layer 1+2 model
thus simply needs to provide two new subclasses of these two base classes.
To make that subclassing process easy, two skeleton classes are provided in
the src/node directory: simple-net-device.h (ns3::SimpleNetDevice) and
simple-channel.h (ns3::SimpleChannel) implement a broadcast passthru medium
using 48bit MAC addresses without any kind of MAC access algorithm or PHY
layer modeling.
The ns3::SimpleChannel class is really very simple: it provides
an implementation for the ns3::Channel::GetNDevices and ns3::Channel::GetDevice
methods defined in the Channel base class and, then defines the channel-specific
send and add methods:
- The Add method is used by SimpleNetDevice::SetChannel to register a new
SimpleNetDevice with its associated channel.
- The Send method is used by SimpleNetDevice::Send to send a packet over the
broadcast medium and ensure that it gets delivered to all associated devices
(except the sender).
\code
class SimpleChannel : public Channel
{
public:
static TypeId GetTypeId (void);
SimpleChannel ();
void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
Ptr<SimpleNetDevice> sender);
void Add (Ptr<SimpleNetDevice> device);
// inherited from ns3::Channel
virtual uint32_t GetNDevices (void) const;
virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
private:
std::vector<Ptr<SimpleNetDevice> > m_devices;
};
\endcode
The SimpleNetDevice class is also trivial since it implements no special
MAC-layer processing:
\code
class SimpleNetDevice : public NetDevice
{
public:
static TypeId GetTypeId (void);
SimpleNetDevice ();
void Receive (Ptr<Packet> packet, uint16_t protocol, Mac48Address to, Mac48Address from);
void SetChannel (Ptr<SimpleChannel> channel);
void SetAddress (Mac48Address address);
// inherited from NetDevice base class.
virtual void SetName(const std::string name);
...
};
\endcode
The code below illustrates how the three model-specific methods defined above are
implemented:
\code
void
SimpleNetDevice::Receive (Ptr<Packet> packet, uint16_t protocol,
Mac48Address to, Mac48Address from)
{
if (to == m_address || to == Mac48Address::GetBroadcast ())
{
m_rxCallback (this, packet, protocol, from);
}
}
void
SimpleNetDevice::SetChannel (Ptr<SimpleChannel> channel)
{
m_channel = channel;
m_channel->Add (this);
}
void
SimpleNetDevice::SetAddress (Mac48Address address)
{
m_address = address;
}
\endcode
Building a topology with such a device is then a matter of
instanciating a set of SimpleNetDevice objects connected on a shared
SimpleChannel:
\code
NodeContainer nodes;
nodes.Create (10);
Ptr<SimpleChannel> channel = CreateObject<SimpleChannel> ();
for (uint32_t i = 0; i < nodes.GetN (); ++i)
{
CreateSimpleDevice (nodes.Get (i), channel);
}
\endcode
With the following CreateSimpleDevice function:
\code
static Ptr<SimpleNetDevice>
CreateSimpleDevice (Ptr<Node> node, Ptr<SimpleChannel> channel)
{
Ptr<SimpleNetDevice> device = CreateObject<SimpleNetDevice> ();
device->SetAddress (Mac48Address:Allocate ());
device->SetChannel (channel);
node->AddDevice (device);
return device;
}
\endcode
Of course, ultimately, you need to provide a helper class for this new device and channel
to save each user from having to re-implement their own CreateSimpleDevice helper
function:
\code
class SimpleHelper
{
public:
NetDeviceContainer Install (NodeContainer nodes, Ptr<SimpleChannel> channel);
NetDeviceContainer Install (NodeContainer nodes);
};
\endcode
with the following straightforward implementation, inspired by the CreateSimpleDevice
function defined above:
\code
NetDeviceContainer
SimpleHelper::Install (NodeContainer nodes, Ptr<SimpleChannel> channel)
{
NetDeviceContainer devices;
for (NodeContainer::Iterator i = nodes.Begin (); i != nodes.End (); ++i)
{
Ptr<SimpleNetDevice> dev = CreateObject<SimpleNetDevice> ();
dev->SetAddress (Mac48Address::Allocate ());
dev->SetChannel (channel);
(*i)->AddDevice (dev);
devices.Add (dev);
}
return devices;
}
NetDeviceContainer
SimpleHelper::Install (NodeContainer nodes)
{
return Install (nodes, CreateObject<SimpleChannel> ());
}
\endcode
Of course, at some point, this device helper class should also contain a couple of
ascii and pcap tracing helper functions but, since the default SimpleNetDevice
class we used as an example here does not report any trace event, it would
be of little use.
*/
+119
View File
@@ -0,0 +1,119 @@
/*!
\page packet-header-trailer How to create a new type of protocol header or trailer
\anchor howtos-packet-header-trailer
<b>Question:</b> I want to implement a new protocol X which uses a new
type of header Y. How do I implement and use this new header Y in ns-3 ?
<b>Answer:</b> The key is to implement a new subclass of the ns3::Header
base class to represent your protocol header:
\code
class YHeader : public Header
{
public:
// must be implemented to become a valid new header.
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
// allow protocol-specific access to the header data.
void SetData (uint32_t data);
uint32_t GetData (void) const;
private:
uint32_t m_data;
};
\endcode
Once this class is implemented, you can easily store your protocol
header into a packet:
\code
Ptr<Packet> p = ...;
YHeader yHeader;
yHeader.SetData (0xdeadbeaf);
// copy the header into the packet
p->AddHeader (yHeader);
\endcode
and get it out of a packet:
\code
Ptr<Packet> p = ...;
YHeader yHeader;
// copy the header from the packet
p->RemoveHeader (yHeader);
uint32_t data = yHeader.GetData ();
\endcode
The implementation of the new header is very simple. First, you need
to give a TypeId to your YHeader class:
\code
TypeId
YHeader::GetTypeId (void)
{
static TypeId tid = TypeId ("YHeader")
.SetParent<Header> ()
.AddConstructor<YHeader> ()
;
return tid;
}
TypeId
YHeader::GetInstanceTypeId (void)
{
return GetTypeId ();
}
\endcode
Then, you need to allow your header to serialize and deserialize itself
to a byte buffer in its network representation. Here, our new protocol
header contains first a 2-byte constant, and, then, the data field so,
the total size of the header is 2+4=6 bytes.
\code
uint32_t
YHeader::GetSerializedSize (void) const
{
return 6;
}
void
YHeader::Serialize (Buffer::Iterator start) const
{
// The 2 byte-constant
start.WriteU8 (0xfe);
start.WriteU8 (0xef);
// The data.
start.WriteHtonU32 (m_data);
}
uint32_t
YHeader::Deserialize (Buffer::Iterator start)
{
uint8_t tmp;
tmp = start.ReadU8 ();
NS_ASSERT (tmp == 0xfe);
tmp = start.ReadU8 ();
NS_ASSERT (tmp == 0xef);
m_data = start.ReadNtohU32 ();
return 6; // the number of bytes consumed.
}
\endcode
Finally, to make sure that Packet::Print also prints the content
of your header, just as it prints the content of the other
headers of the system, you need to provide a Print method:
\code
void
YHeader::Print (std::ostream &os) const
{
os << "data=" << m_data;
}
\endcode
The code will look the same if you want to implement a trailer,
that is, a protocol data structure which will be appended to the
end of the packet, not its start: you need to make sure that
you derive from the ns3::Trailer base class and that you call
Packet::AddTrailer and Packet::RemoveTrailer. Another important
detail is that you must make sure to rewind the iterator in your
Serialize and Deserialize methods writing to or reading from
the underlying buffer.
*/
+20
View File
@@ -0,0 +1,20 @@
/*!
\page howtos ns-3 HOWTOs
\anchor howtos-anchor
This is an organized set of frequently asked questions (FAQ) and HOWTOs
for ns-3. This complements the following wiki pages:
- <a href="http://www.nsnam.org/wiki/index.php/User_FAQ">User FAQ</a>
- <a href="http://www.nsnam.org/wiki/index.php/Developer_FAQ">Developer FAQ</a>
Please consider contributing tips to either the wiki (yourself) or
by submitting a patch to this maintained documentation.
- \subpage callbacks
- \subpage packet-header-trailer
- \subpage net-device
- \subpage application
*/
+61
View File
@@ -0,0 +1,61 @@
/**
* \mainpage ns-3 Documentation
*
* \section intro-sec Introduction
* <a href="http://www.nsnam.org/">ns-3</a> documentation is maintained using
* <a href="http://www.doxygen.org">Doxygen</a>.
* Doxygen is typically used for
* API documentation, and organizes such documentation across different
* modules. This project uses Doxygen both for building the manual around
* the API documentation, and a separate GNU texinfo document is used for
* the manual.
*
* The ns-3 project documentation is organized as follows:
* - <b><a href="modules.html">modules</a></b>: The "Modules" tab (above)
* organizes all of the public API and supporting manual text
* along the source code directory structure. This forms the
* "ns-3 manual", and it is available in HTML and PDF forms.
* - \ref howtos-anchor "HOWTOs": A set of HOWTOs and FAQs is
* maintained on another Doxygen "Related Page"
* - <a href="http://www.nsnam.org/docs/tutorial/tutorial.html">tutorial</a>: The ns-3 tutorial is a separate document maintained in <a href="http://www.gnu.org/software/texinfo/"> GNU Texinfo</a>.
* - The <b><a href="http://www.nsnam.org/wiki/index.php/Main_Page">ns-3 wiki</a></b>
* contains additional user-contributed material. Some wiki-contributed
* material may migrate to and overlap with the Doxygen information.
*
* \section install-sec Building the Documentation
*
* ns-3 requires Doxygen version 1.5.4 or greater to fully build all items,
* although earlier versions of Doxygen will mostly work.
*
* Type "./waf check" followed by "./waf --doxygen" to build the documentation.
* There is a program that runs during "./waf check" that builds pieces of
* the documentation through introspection. The doc/ directory contains
* configuration for Doxygen (doxygen.conf and main.txt). The Doxygen
* build process puts html files into the doc/html/ directory, and latex
* filex into the doc/latex/ directory.
*
* \section module-sec Module overview
*
* The ns-3 library is split across multiple modules:
* - core: located in src/core and contains a number of facilities which
* do not depend on any other module. Some of these facilities are
* OS-dependent.
* - simulator: located in src/simulator and contains event scheduling
* facilities.
* - common: located in src/common and contains facilities specific
* to network simulations but shared by pretty much every model
* of a network component.
* - node: located in src/node. Defines the abstract interfaces which
* must be implemented by every node and more specifically, by ipv4 nodes.
* - devices: located in src/devices. Contains a set of MAC-level models
*
* More detail can be found in the <b><a href="modules.html">Modules</a></b>
* tab.
*
*/
/**
* \namespace ns3
* \brief Every class exported by the ns3 library is enclosed in the
* ns3 namespace.
*/
-68
View File
@@ -1,68 +0,0 @@
/**
* \mainpage An Introduction to ns-3
*
* The ns-3 library is split across multiple modules:
* - core: located in src/core and contains a number of facilities which
* do not depend on any other module. Some of these facilities are
* OS-dependent.
* - simulator: located in src/simulator and contains event scheduling
* facilities.
* - common: located in src/common and contains facilities specific
* to network simulations but shared by pretty much every model
* of a network component.
* - node: located in src/node. Defines the abstract interfaces which
* must be implemented by every node and more specifically, by ipv4 nodes.
* - devices: located in src/devices. Contains a set of MAC-level models
*
* The "core" module contains:
* - a Functor class: ns3::Callback
* - an os-independent interface to get access to the elapsed wall clock time: ns3::SystemWallClockMs
* - a class to register regression tests with the test manager: ns3::Test and ns3::TestManager
* - debugging facilities: \ref debugging, \ref assert, \ref error
* - \ref randomvariable
* - \ref config
* - a base class for objects which need to support reference counting
* and QueryInterface: ns3::Interface and ns3::InterfaceId
* - a smart-pointer class ns3::Ptr designed to work together with ns3::Interface
*
* The "simulator" module contains:
* - a time management class to hold a time and convert between various time units: ns3::Time
* - a scheduler base class used to implement new simulation event schedulers:
* ns3::Scheduler and ns3::SchedulerFactory
* - a simulator class used to create, schedule and cancel events: ns3::Simulator
*
* The "common" module contains:
* - a packet class to create and manipulate simulation packets: ns3::Packet, ns3::Header,
* and ns3::Trailer. This packet class also supports per-packet ns3::Tag which are
* globs of data which can be attached to any packet.
* - a set of low-level trace facilities: \ref lowleveltracing
*
* The "node" module contains:
* - a ns3::INode base class which should be subclassed by any new type of
* network Node.
* - models which abstract the MAC-layer from the IP layer protocols:
* ns3::NetDevice and ns3::Channel.
* - models which abstract the application-layer API: ns3::Application,
* ns3::Socket, ns3::ISocketFactory, and, ns3::IUdp
*
* The "internet-node" module contains a set of classes which implement the
* APIs defined in the "node" module:
* - an Ipv4/Udp stack with socket support
* - an ARP module
* - an INode subclass.
* - and finally, a function used to instantiate nodes
* which contain this implementation: ns3::MakeInternetNode
*
* The "devices" module contains:
* - a PointToPoint MAC device: ns3::PointToPointNetDevice, ns3::PointToPointChannel,
* and ns3::PointToPointTopology.
*/
/**
* \namespace ns3
* \brief Every class exported by the ns3 library is enclosed in the
* ns3 namespace.
*/
/**
* \defgroup constants Constants
* \brief Constants you can change
*/
+48
View File
@@ -0,0 +1,48 @@
TEXI2HTML = texi2html
TEXI2PDF = texi2dvi --pdf
EPSTOPDF = epstopdf
TGIF = tgif
DIA = dia
CONVERT = convert
CSS = --css-include=manual.css
SPLIT = --split section
DIA_SOURCES = buffer.dia sockets-overview.dia
TGIF_SOURCES = packet.obj node.obj internet-node-send.obj internet-node-recv.obj
DIA_EPS = ${DIA_SOURCES:.dia=.eps}
DIA_PNG = ${DIA_SOURCES:.dia=.png}
DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
TGIF_EPS = ${TGIF_SOURCES:.obj=.eps}
TGIF_PNG = ${TGIF_SOURCES:.obj=.png}
TGIF_PDF = ${TGIF_SOURCES:.obj=.pdf}
all: images html split-html pdf
# Note: tgif requires a valid x display to convert from .obj to .png.
# If running this makefile on a remote console, the X virtual frame
# buffer may be needed (xorg-x11-server-Xvfb) to provide a "fake"
# display
images:
cd figures/; $(DIA) -t png $(DIA_SOURCES)
cd figures/; $(DIA) -t eps $(DIA_SOURCES)
cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
cd figures/; $(TGIF) -print -png $(TGIF_SOURCES)
cd figures/; $(TGIF) -print -eps $(TGIF_SOURCES)
cd figures/; $(foreach FILE,$(TGIF_EPS),$(EPSTOPDF) $(FILE);)
html: images
$(TEXI2HTML) ${CSS} manual.texi
split-html: images
$(TEXI2HTML) ${CSS} ${SPLIT} manual.texi
pdf: images
$(TEXI2PDF) manual.texi
figures-clean:
cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
cd figures/; rm -rf $(TGIF_EPS); rm -rf $(TGIF_PNG); rm -rf $(TGIF_PDF)
clean: figures-clean
rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg manual.tp manual.vr manual.toc manual.log manual.pdf manual.html manual/
+559
View File
@@ -0,0 +1,559 @@
@node Attributes
@chapter Attributes
@anchor{chap:Attributes}
In ns-3 simulations, there are two main aspects to configuration:
@itemize @bullet
@item the simulation topology and how objects are connected
@item the values used by the models instantiated in the topology
@end itemize
This chapter focuses on the second item above: how the many values
in use in ns-3 are organized, documented, and modifiable by ns-3 users.
The ns-3 attribute system is also the underpinning of how traces
and statistics are gathered in the simulator.
Before delving into details of the attribute value system,
it will help to review some basic properties of @code{class ns3::Object}.
@node Object Overview
@section Object Overview
ns-3 is fundamentally a C++ object-based system. By this we mean that
new C++ classes (types) can be declared, defined, and subclassed
as usual.
Many ns-3 objects inherit from the @code{ns3::Object} base class. These
objects have some additional properties that we exploit for
organizing the system and improving the memory management
of our objects:
@itemize @bullet
@item a "metadata" system that links the class name to a lot of
meta-information about the object, including the base class of the subclass,
the set of accessible constructors in the subclass, and the set of
"attributes" of the subclass
@item a reference counting smart pointer implementation, for memory
management.
@end itemize
ns-3 objects that use the attribute system derive from either
@code{ns3::Object} or @code{ns3::ObjectBase}. Most ns-3 objects
we will discuss derive from @code{ns3::Object}, but a few that
are outside the smart pointer memory management framework derive
from @code{ns3::ObjectBase}.
Let's review a couple of properties of these objects.
@node Smart pointers
@subsection Smart pointers
As introduced above in @ref{Smart Pointers 101}, ns-3 objects
are memory managed by a
@uref{http://en.wikipedia.org/wiki/Smart_pointer,,reference counting smart pointer implementation}, @code{class ns3::Ptr}.
Smart pointers are used extensively in the ns-3 APIs, to avoid passing
references to heap-allocated objects that may cause memory leaks.
For most basic usage (syntax), treat a smart pointer like a regular pointer:
@verbatim
Ptr<WifiNetDevice> nd = ...;
nd->CallSomeFunction ();
// etc.
@end verbatim
@node CreateObject
@subsection CreateObject
As we discussed above in @ref{Object Creation},
at the lowest-level API, objects of type @code{ns3::Object} are
not instantiated using @code{operator new} as usual but instead by
a templated function called @code{CreateObject()}.
A typical way to create such an object is as follows:
@verbatim
Ptr<WifiNetDevice> nd = CreateObject<WifiNetDevice> ();
@end verbatim
You can think of this as being functionally equivalent to:
@verbatim
WifiNetDevice* nd = new WifiNetDevice ();
@end verbatim
Objects that derive from @code{ns3::Object} must be allocated
on the heap using CreateObject(). Those deriving from
@code{ns3::ObjectBase}, such as ns-3 helper functions and packet
headers and trailers, can be allocated on the stack.
In some scripts, you may not see a lot of CreateObject() calls
in the code;
this is because there are some helper objects in effect that
are doing the CreateObject()s for you.
@node TypeId
@subsection TypeId
ns-3 classes that derive from class ns3::Object can include
a metadata class called @code{TypeId} that records meta-information
about the class, for use in the object aggregation and component
manager systems:
@itemize @bullet
@item a unique string identifying the class
@item the base class of the subclass, within the metadata system
@item the set of accessible constructors in the subclass
@end itemize
@node Object Summary
@subsection Object Summary
Putting all of these concepts together, let's look at a specific
example: @code{class ns3::Node}.
The public header file node.h has a declaration that includes
a static GetTypeId function call:
@verbatim
class Node : public Object
{
public:
static TypeId GetTypeId (void);
...
@end verbatim
This is defined in the node.cc file as follows:
@verbatim
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
;
return tid;
}
@end verbatim
Finally, when users want to create Nodes, they call:
@verbatim
Ptr<Node> n = CreateObject<Node> ();
@end verbatim
We next discuss how attributes (values associated with member variables
or functions of the class) are plumbed into the above TypeId.
@node Attribute Overview
@section Attribute Overview
The goal of the attribute system is to organize the access of
internal member objects of a simulation. This goal arises because,
typically in simulation, users will cut and paste/modify existing
simulation scripts, or will use higher-level simulation constructs,
but often will be interested in studying or tracing particular
internal variables. For instance, use cases such as:
@itemize @bullet
@item "I want to trace the packets on the wireless interface only on
the first access point"
@item "I want to trace the value of the TCP congestion window (every
time it changes) on a particular TCP socket"
@item "I want a dump of all values that were used in my simulation."
@end itemize
Similarly, users may want fine-grained access to internal
variables in the simulation, or may want to broadly change the
initial value used for a particular parameter in all subsequently
created objects. Finally, users may wish to know what variables
are settable and retrievable in a simulation configuration. This
is not just for direct simulation interaction on the command line;
consider also a (future) graphical user interface
that would like to be able to provide a feature whereby a user
might right-click on an node on the canvas and see a hierarchical,
organized list of parameters that are settable on the node and its
constituent member objects, and help text and default values for
each parameter.
@node Functional overview
@subsection Functional overview
We provide a way for users to access values deep in the system, without
having to plumb accessors (pointers) through the system and walk
pointer chains to get to them. Consider a class DropTailQueue that
has a member variable that is an unsigned integer @code{m_maxPackets};
this member variable controls the depth of the queue.
If we look at the declaration of DropTailQueue, we see the following:
@verbatim
class DropTailQueue : public Queue {
public:
static TypeId GetTypeId (void);
...
private:
std::queue<Ptr<Packet> > m_packets;
uint32_t m_maxPackets;
};
@end verbatim
Let's consider things that a user may want to do with the value of
m_maxPackets:
@itemize @bullet
@item Set a default value for the system, such that whenever a new
DropTailQueue is created, this member is initialized to that default.
@item Set or get the value on an already instantiated queue.
@end itemize
The above things typically require providing Set() and Get() functions,
and some type of global default value.
In the ns-3 attribute system, these value definitions and accessor
functions are moved into the TypeId class; e.g.:
@verbatim
TypeId DropTailQueue::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::DropTailQueue")
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddAttribute ("MaxPackets",
"The maximum number of packets accepted by this DropTailQueue.",
UintegerValue (100),
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
@end verbatim
The AddAttribute() method is performing a number of things with this
value:
@itemize @bullet
@item Binding the variable m_maxPackets to a string "MaxPackets"
@item Providing a default value (100 packets)
@item Providing some help text defining the value
@item Providing a "checker" (not used in this example) that can be used to set
bounds on the allowable range of values
@end itemize
The key point is that now the value of this variable and its default
value are accessible in the attribute namespace, which is based on
strings such as "MaxPackets" and TypeId strings. In the next
section, we will provide an example script that shows how users
may manipulate these values.
@node Basic usage
@subsection Basic usage
Let's look at how a user script might access these values.
This is based on the script found at @code{samples/main-attribute-value.cc},
with some details stripped out.
@verbatim
//
// This is a basic example of how to use the attribute system to
// set and get a value in the underlying system; namely, an unsigned
// integer of the maximum number of packets in a queue
//
int
main (int argc, char *argv[])
{
// By default, the MaxPackets attribute has a value of 100 packets
// (this default can be observed in the function DropTailQueue::GetTypeId)
//
// Here, we set it to 80 packets. We could use one of two value types:
// a string-based value or a Uinteger value
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("80"));
// The below function call is redundant
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (80));
// Allow the user to override any of the defaults and the above
// SetDefaults() at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
@end verbatim
The main thing to notice in the above are the two calls to
@code{Config::SetDefault}. This is how we set the default value
for all subsequently instantiated DropTailQueues. We illustrate
that two types of Value classes, a StringValue and a UintegerValue class,
can be used to assign the value to the attribute named by
"ns3::DropTailQueue::MaxPackets".
Now, we will create a few objects using the low-level API; here,
our newly created queues will not have a m_maxPackets initialized to
100 packets but to 80 packets, because of what we did above with
default values.
@verbatim
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<PointToPointNetDevice> net0 = CreateObject<PointToPointNetDevice> ();
n0->AddDevice (net0);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net0->AddQueue(q);
@end verbatim
At this point, we have created a single node (Node 0) and a
single PointToPointNetDevice (NetDevice 0) and added a
DropTailQueue to it.
Now, we can manipulate the MaxPackets value of the already
instantiated DropTailQueue. Here are various ways to do that.
@subsubsection Pointer-based access
We assume that a smart pointer (Ptr) to a relevant network device is
in hand; here, it is the net0 pointer.
One way to change the value is to access a pointer to the
underlying queue and modify its attribute.
First, we observe that we can get a pointer to the (base class)
queue via the PointToPointNetDevice attributes, where it is called
TxQueue
@verbatim
PointerValue tmp;
net0->GetAttribute ("TxQueue", tmp);
Ptr<Object> txQueue = tmp.GetObject ();
@end verbatim
Using the GetObject function, we can perform a safe downcast
to a DropTailQueue, where MaxPackets is a member
@verbatim
Ptr<DropTailQueue> dtq = txQueue->GetObject <DropTailQueue> ();
NS_ASSERT (dtq != 0);
@end verbatim
Next, we can get the value of an attribute on this queue.
We have introduced wrapper "Value" classes for the underlying
data types, similar to Java wrappers around these types, since
the attribute system stores values and not disparate types.
Here, the attribute value is assigned to a UintegerValue, and
the Get() method on this value produces the (unwrapped) uint32_t.
@verbatim
UintegerValue limit;
dtq->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets");
@end verbatim
Note that the above downcast is not really needed; we could have
done the same using the Ptr<Queue> even though the attribute
is a member of the subclass
@verbatim
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets");
@end verbatim
Now, let's set it to another value (60 packets)
@verbatim
txQueue->SetAttribute("MaxPackets", UintegerValue (60));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets");
@end verbatim
@subsubsection Namespace-based access
An alternative way to get at the attribute is to use the configuration
namespace. Here, this attribute resides on a known path in this
namespace; this approach is useful if one doesn't have access to
the underlying pointers and would like to configure a specific
attribute with a single statement.
@verbatim
Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", UintegerValue (25));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("4. txQueue limit changed through namespace: " <<
limit.Get () << " packets");
@end verbatim
We could have also used wildcards to set this value for all nodes
and all net devices (which in this simple example has the same
effect as the previous Set())
@verbatim
Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", UintegerValue (15));
txQueue->GetAttribute ("MaxPackets", limit);
NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " <<
limit.Get () << " packets");
@end verbatim
@node Setting through constructors and helper classes
@subsection Setting through constructors helper classes
Arbitrary combinations of attributes can be set and fetched from
the helper and low-level APIs; either from the constructors themselves:
@verbatim
Ptr<Object> p = CreateObject<MyNewObject> ("n1", v1, "n2", v2, ...);
@end verbatim
or from the higher-level helper APIs, such as:
@verbatim
mobility.SetPositionAllocator ("GridPositionAllocator",
"MinX", DoubleValue (-100.0),
"MinY", DoubleValue (-100.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (20.0),
"GridWidth", UintegerValue (20),
"LayoutType", StringValue ("RowFirst"));
@end verbatim
@node Value classes
@subsection Value classes
Readers will note the new FooValue classes which are subclasses of the
AttributeValue base class. These can be thought of as
an intermediate class that can be used to convert from raw types to the
Values that are used by the attribute system. Recall that this database is holding
objects of many types with a single generic type. Conversions to this
type can either be done using an intermediate class (IntegerValue, DoubleValue for
"floating point") or via strings. Direct implicit conversion of types
to Value is not really practical. So in the above, users have a choice
of using strings or values:
@verbatim
p->Set ("cwnd", StringValue ("100")); // string-based setter
p->Set ("cwnd", IntegerValue (100)); // integer-based setter
@end verbatim
The system provides some macros that help users declare and define
new AttributeValue subclasses for new types that they want to introduce into
the attribute system:
@itemize @bullet
@item ATTRIBUTE_HELPER_HEADER
@item ATTRIBUTE_HELPER_CPP
@end itemize
@node Extending attributes
@section Extending attributes
The ns-3 system will place a number of internal values under the
attribute system, but undoubtedly users will want to extend this
to pick up ones we have missed, or to add their own classes to this.
@subsection Adding an existing internal variable to the metadata system
Consider this variable in class TcpSocket:
@verbatim
uint32_t m_cWnd; // Congestion window
@end verbatim
Suppose that someone working with Tcp wanted to get or set the
value of that variable using the metadata system. If it were not
already provided by ns-3, the user could declare the following addition
in the metadata system (to the TypeId declaration for TcpSocket):
@verbatim
.AddParameter ("Congestion window",
"Tcp congestion window (bytes)",
Uinteger (1),
MakeUintegerAccessor (&TcpSocket::m_cWnd),
MakeUintegerChecker<uint16_t> ());
@end verbatim
Now, the user with a pointer to the TcpSocket can perform operations
such as setting and getting the value, without having to add these
functions explicitly. Furthermore, access controls can be applied, such
as allowing the parameter to be read and not written, or bounds
checking on the permissible values can be applied.
@subsection Adding a new TypeId
Here, we discuss the impact on a user who wants to add a new class to
ns-3; what additional things must be done to hook it into this system.
We've already introduced what a TypeId definition looks like:
@verbatim
TypeId
RandomWalk2dMobilityModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RandomWalk2dMobilityModel")
.SetParent<MobilityModel> ()
.SetGroupName ("Mobility")
.AddConstructor<RandomWalk2dMobilityModel> ()
.AddAttribute ("Bounds",
"Bounds of the area to cruise.",
RectangleValue (Rectangle (0.0, 0.0, 100.0, 100.0)),
MakeRectangleAccessor (&RandomWalk2dMobilityModel::m_bounds),
MakeRectangleChecker ())
.AddAttribute ("Time",
"Change current direction and speed after moving for this delay.",
TimeValue (Seconds (1.0)),
MakeTimeAccessor (&RandomWalk2dMobilityModel::m_modeTime),
MakeTimeChecker ())
// etc (more parameters).
;
return tid;
}
@end verbatim
The declaration for this in the class declaration is one-line public
member method:
@verbatim
public:
static TypeId GetTypeId (void);
@end verbatim
Typical mistakes here involve:
@itemize @bullet
@item Not calling the SetParent method or calling it with the wrong type
@item Not calling the AddConstructor method of calling it with the wrong type
@item Introducing a typographical error in the name of the TypeId in its constructor
@item Not using the fully-qualified c++ typename of the enclosing c++ class as the
name of the TypeId
@end itemize
None of these mistakes can be detected by the ns-3 codebase so, users
are advised to check carefully multiple times that they got these right.
@section Adding new class type to the attribute system
From the perspective of the user who writes a new class in the system and
wants to hook it in to the attribute system, there is mainly the matter
of writing
the conversions to/from strings and attribute values. Most of this can be
copy/pasted with macro-ized code. For instance, consider class
Rectangle in the @code{src/mobility/} directory:
One line is added to the class declaration:
@verbatim
/**
* \brief a 2d rectangle
*/
class Rectangle
{
...
};
@end verbatim
One macro call and two operators, are added below the class declaration:
@verbatim
std::ostream &operator << (std::ostream &os, const Rectangle &rectangle);
std::istream &operator >> (std::istream &is, Rectangle &rectangle);
ATTRIBUTE_HELPER_HEADER (Rectangle);
@end verbatim
In the class definition, the code looks like this:
@verbatim
ATTRIBUTE_HELPER_CPP (Rectangle);
std::ostream &
operator << (std::ostream &os, const Rectangle &rectangle)
{
os << rectangle.xMin << "|" << rectangle.xMax << "|" << rectangle.yMin << "|" << rectangle.yMax;
return os;
}
std::istream &
operator >> (std::istream &is, Rectangle &rectangle)
{
char c1, c2, c3;
is >> rectangle.xMin >> c1 >> rectangle.xMax >> c2 >> rectangle.yMin >> c3 >> rectangle.yMax;
if (c1 != '|' ||
c2 != '|' ||
c3 != '|')
{
is.setstate (std::ios_base::failbit);
}
return is;
}
@end verbatim
These stream operators simply convert from a string representation of the
Rectangle ("xMin|xMax|yMin|yMax") to the underlying Rectangle, and the
modeler must specify these operators and the string syntactical representation
of an instance of the new class.
+330
View File
@@ -0,0 +1,330 @@
@node Callbacks
@chapter Callbacks
Some new users to @command{ns-3} are unfamiliar with an extensively used
programming idiom used throughout the code: the ``ns-3 callback''. This
chapter provides some motivation on the callback, guidance on how to use
it, and details on its implementation.
@menu
* Motivation::
* Using the Callback API::
* Callback locations in ns-3::
* Implementation details::
@end menu
@node Motivation
@section Motivation
Consider that you have two simulation models A and B, and you wish
to have them pass information between them during the simulation. One
way that you can do that is that you can make A and B each explicitly
knowledgable about the other, so that they can invoke methods on each
other.
@verbatim
class A {
public:
void ReceiveInput ( // parameters );
...
}
(in another source file:)
class B {
public:
void ReceiveInput ( // parameters);
void DoSomething (void);
...
private:
A* a_instance; // pointer to an A
}
void
B::DoSomething()
{
// Tell a_instance that something happened
a_instance->ReceiveInput ( // parameters);
...
}
@end verbatim
This certainly works, but it has the drawback that it introduces a
dependency on A and B to know about the other at compile time (this
makes it harder to have independent compilation units in the simulator)
and is not generalized; if in a later usage scenario, B needs to talk
to a completely different C object, the source code for B needs to be
changed to add a ``c_instance'' and so forth. It is easy to see that
this is a brute force mechanism of communication that can lead to
programming cruft in the models.
This is not to say that objects should not know about one another
if there is a hard dependency between them, but that often the model
can be made more flexible if its interactions are less constrained at
compile time.
This is not an abstract problem for network simulation research,
but rather it has been a source of problems in previous simulators,
when researchers want to extend or modify the system to do different
things (as they are apt to do in research). Consider, for example,
a user who wants to add an IPsec security protocol sublayer
between TCP and IP:
@verbatim
------------ -----------
| TCP | | TCP |
------------ -----------
| becomes -> |
----------- -----------
| IP | | IPsec |
----------- -----------
|
-----------
| IP |
-----------
@end verbatim
If the simulator has
made assumptions, and hard coded into the code, that IP always talks
to a transport protocol above, the user may be forced to hack the
system to get the desired interconnections.
An alternative that provides this flexibility is to use a level of
indirection that is commonly known in programming as a callback.
A callback function is not invoked explicitly by the caller but is
rather delegated to another function that receives the callback
function's address and can call it.
You may be familiar with function pointers in C or C++; these can
be used to implement callbacks. For more information on introductory
callbacks, an online reference is:
@uref{http://www.inquiry.com/techtips/cpp_pro/10min/10min0300.asp,,Declaring Function Pointers and Implementing Callbacks} and
@uref{http://en.wikipedia.org/wiki/Callback_(computer_science),,Callback (computer science)-- Wikipedia}.
The callback API in @command{ns-3} is designed to minimize the overall
coupling between various pieces of of the simulator
by making each module depend on the callback API
itself rather than depend on other modules. It acts as a sort of
third-party to which work is delegated and which forwards this
work to the proper target module. This callback API, being based
on C++ templates,
is type-safe; that is, it performs static type checks to enforce
proper signature compatibility between callers and callees. It
is therefore more type-safe to use than traditional function
pointers, but the syntax may look imposing at first. This section
is designed to walk you through the callback system so that you
can be comfortable using it in @command{ns-3}.
@node Using the Callback API
@section Using the Callback API
The Callback API is fairly minimal, providing only two services:
@itemize @bullet
@item callback type declaration: a way to declare a type of callback
with a given signature, and,
@item callback instantiation: a way to instantiate a
template-generated forwarding callback which can forward any calls
to another C++ class member method or C++ function.
@end itemize
This is best observed via walking through an example, based on
@code{samples/main-callback.cc}.
@node Using the Callback API with static functions
@subsection Using the Callback API with static functions
Consider a function:
@verbatim
static double
CbOne (double a, double b)
{
std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl;
return a;
}
@end verbatim
Consider also the following main program snippett:
@verbatim
int main (int argc, char *argv[])
{
// return type: double
// first arg type: double
// second arg type: double
Callback<double, double, double> one;
}
@end verbatim
This class template Callback implements what is known as the Functor
Design Pattern. It is used to declare the type of a callback. It contains
one mandatory argument (the return type of the function to be assigned
to this callback) and up to five optional arguments, which each specify
the type of the arguments (if your function has more than five arguments,
then this can be handled by extending the callback implementation).
So in the above, we have a declared a callback named "one" that will
eventually hold a function pointer. The function that it will hold
must return double and must support two double arguments. If one
tries to pass a function whose signature does not match the declared
callback, the compilation will fail.
Now, we need to tie together this callback instance and the actual
target function (CbOne). Notice above that CbOne has the same function
signature types as the callback-- this is important. We can
pass in any such properly-typed function to this callback. Let's
look at this more closely:
@verbatim
static double CbOne (double a, double b) {}
^ ^ ^
| ---| ------|
| | |
Callback<double, double, double> one;
@end verbatim
You can only bind a function to a callback if they have the matching
signature. The first template argument is the return type, and the
additional template arguments are the types of the arguments of
the function signature.
Now, let's bind our callback "one" to the function that matches its
signature:
@verbatim
// build callback instance which points to cbOne function
one = MakeCallback (&CbOne);
@end verbatim
Then, later in the program, if the callback is to be used, it can be
used as follows:
@verbatim
// this is not a null callback
NS_ASSERT (!one.IsNull ());
// invoke cbOne function through callback instance
double retOne;
retOne = one (10.0, 20.0);
@end verbatim
The check @code{IsNull()} ensures that the callback is not null; that there
is a function to call behind this callback. Then, @code{one()} returns the
same result as if @code{CbOne()} had been called directly.
@node Using the Callback API with member functions
@subsection Using the Callback API with member functions
Generally, you will not be calling static functions but instead
public member functions of an object. In this case, an extra
argument is needed to the MakeCallback function, to tell the system
on which object the function should be invoked. Consider this example,
also from main-callback.cc:
@verbatim
class MyCb {
public:
int CbTwo (double a) {
std::cout << "invoke cbTwo a=" << a << std::endl;
return -5;
}
};
int main ()
{
...
// return type: int
// first arg type: double
Callback<int, double> two;
MyCb cb;
// build callback instance which points to MyCb::cbTwo
two = MakeCallback (&MyCb::CbTwo, &cb);
...
}
@end verbatim
Here, we pass a (raw) pointer to the @code{MakeCallback<>} function,
that says, when @code{two ()} is invoked, to call the @code{CbTwo} function
on the object pointed to by @code{&cb}.
A variation of this is used when objects are referred to by ns-3 smart
pointers. The MakeCallback API takes a raw pointer, so we need to
call @code{PeekPointer ()} to obtain this raw pointer. So the example
above would look like:
@verbatim
class MyCb : public Object {
public:
int CbTwo (double a) {
std::cout << "invoke cbTwo a=" << a << std::endl;
return -5;
}
};
int main ()
{
...
// return type: int
// first arg type: double
Callback<int, double> two;
Ptr<MyCb> cb = CreateObject<MyCb> ();
// build callback instance which points to MyCb::cbTwo
two = MakeCallback (&MyCb::CbTwo, PeekPointer (cb));
...
}
@end verbatim
@node Building Null Callbacks
@subsection Building Null Callbacks
It is possible for callbacks to be null; hence it may be wise to
check before using them. There is a special construct for a null
callback, which is preferable to simply passing "0" as an argument;
it is the @code{MakeNullCallback<>} construct:
@verbatim
two = MakeNullCallback<int, double> ();
// invoking a null callback is just like
// invoking a null function pointer:
// it will crash at runtime.
//int retTwoNull = two (20.0);
NS_ASSERT (two.IsNull ());
@end verbatim
@node Callback locations in ns-3
@section Callback locations in @command{ns-3}
Where are callbacks frequently used in @command{ns-3}? Here are some of the
more visible ones to typical users:
@subsection Socket API
@subsection Layer-2/Layer-3 API
@subsection Tracing subsystem
@subsection Routing
Route Reply
@node Implementation details
@section Implementation details
This section is advanced explanation for C++ experts interested in
the implementation, and may be skipped by most users.
This code was originally written based on the techniques described
@uref{http://www.codeproject.com/cpp/TTLFunction.asp,,here}.
It was subsequently rewritten to follow the architecture
outlined in
@uref{http://www.amazon.com/Modern-C\%2B\%2B-Design-Programming-Patterns/dp/0201704315/ref=pd_bbs_sr_1/102-0157303-1900156?ie=UTF8\&s=books\&qid=1187982662\&sr=1-1,,Modern C++ Design: Generic Programming and Design Patterns Applied-- Alexandrescu}, chapter 5, "Generalized Functors".
This code uses:
@itemize @bullet
@item default template parameters to saves users from having to
specify empty parameters when the number of parameters
is smaller than the maximum supported number
@item the pimpl idiom: the Callback class is passed around by
value and delegates the crux of the work to its pimpl pointer.
@item two pimpl implementations which derive from CallbackImpl
FunctorCallbackImpl can be used with any functor-type
while MemPtrCallbackImpl can be used with pointers to
member functions.
@item a reference list implementation to implement the Callback's
value semantics.
@end itemize
This code most notably departs from the Alexandrescu
implementation in that it does not use type lists to specify
and pass around the types of the callback arguments.
Of course, it also does not use copy-destruction semantics
and relies on a reference list rather than autoPtr to hold
the pointer.
+18
View File
@@ -0,0 +1,18 @@
Please write image files in a vector graphics format, when possible, and
generate the .png and .pdf versions on the fly (see ../Makefile).
Currently supported tools are dia and tgif. xfig could be added similarly
if someone wants to add it. The main requirement for adding another format
is that the tool to edit it is freely available and that a cron script can
autogenerate the pdf and png from the figure source.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
If the figure is not available in a vector graphics format, store both
a .png and a .pdf version in this directory.
If you add a source (.dia, .obj) file here, remember to add it to
the list of figure sources in the Makefile in the directory above
Note: tgif can convert from .obj to .pdf, but the pdf that results takes
up a whole page. Instead, we convert to an intermediate .eps step, and
then run epstopdf.
File diff suppressed because it is too large. Load diff
+380
View File
@@ -0,0 +1,380 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,154,78,0,16,0,9,1,1,0,0,3,0,1,0,'Times-Roman',0,80640,0,3,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
group([
rcbox('black','',161,586,241,634,2,1,1,0,16,125,0,0,0,0,'1',0,[
]),
text('black',161,605,1,0,1,72,18,124,13,5,0,0,0,0,2,72,18,0,0,"",0,0,0,0,618,'',[
minilines(72,18,0,0,0,0,0,[
mini_line(72,13,5,0,0,0,[
str_block(0,72,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,72,13,5,0,0,0,0,0,0,0,
"NetDevice")])
])
])])
],
141,0,0,[
]).
group([
rcbox('black','',147,77,255,125,2,1,1,0,16,354,0,0,0,0,'1',0,[
]),
text('black',163,96,1,0,1,88,18,353,13,5,0,0,0,0,2,88,18,0,0,"",0,0,0,0,109,'',[
minilines(88,18,0,0,0,0,0,[
mini_line(88,13,5,0,0,0,[
str_block(0,88,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,88,13,5,0,0,0,0,0,0,0,
"Application")])
])
])])
],
352,0,0,[
]).
text('black',202,172,1,1,1,90,17,473,14,3,2,0,0,0,2,90,17,0,0,"",0,0,0,0,186,'',[
minilines(90,17,0,0,1,0,0,[
mini_line(90,14,3,0,0,0,[
str_block(0,90,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,90,14,3,0,0,0,0,0,0,0,
"UdpSocketImpl")])
])
])]).
rcbox('black','',132,165,269,198,0,1,1,0,16,474,0,0,0,0,'1',0,[
]).
text('black',202,241,1,1,1,78,17,475,14,3,2,0,0,0,2,78,17,0,0,"",0,0,0,0,255,'',[
minilines(78,17,0,0,1,0,0,[
mini_line(78,14,3,0,0,0,[
str_block(0,78,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,78,14,3,0,0,0,0,0,0,0,
"Ipv4EndPoint")])
])
])]).
rcbox('black','',132,234,269,267,0,1,1,0,16,476,0,0,0,0,'1',0,[
]).
text('black',202,338,1,1,1,88,17,488,14,3,2,0,0,0,2,88,17,0,0,"",0,0,0,0,352,'',[
minilines(88,17,0,0,1,0,0,[
mini_line(88,14,3,0,0,0,[
str_block(0,88,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,88,14,3,0,0,0,0,0,0,0,
"UdpL4Protocol")])
])
])]).
rcbox('black','',132,331,269,364,0,1,1,0,16,489,0,0,0,0,'1',0,[
]).
text('black',202,434,1,1,1,90,17,490,14,3,2,0,0,0,2,90,17,0,0,"",0,0,0,0,448,'',[
minilines(90,17,0,0,1,0,0,[
mini_line(90,14,3,0,0,0,[
str_block(0,90,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,90,14,3,0,0,0,0,0,0,0,
"Ipv4L3Protocol")])
])
])]).
rcbox('black','',132,427,269,460,0,1,1,0,16,491,0,0,0,0,'1',0,[
]).
text('black',585,11,1,0,1,179,17,496,14,3,0,0,0,0,2,179,17,0,0,"",0,0,0,0,25,'',[
minilines(179,17,0,0,0,0,0,[
mini_line(179,14,3,0,0,0,[
str_block(0,179,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,179,14,3,0,-2,1,0,0,0,0,
"Step in packet receive process:")])
])
])]).
text('black',480,595,1,0,1,408,17,498,14,3,0,0,0,0,2,408,17,0,0,"",0,0,0,0,609,'',[
minilines(408,17,0,0,0,0,0,[
mini_line(408,14,3,0,0,0,[
str_block(0,408,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,408,14,3,0,0,0,0,0,0,0,
"1. NetDevice calls the function registered at Node::m_receiveCallback")])
])
])]).
text('black',480,572,1,0,1,346,17,520,14,3,0,0,0,0,2,346,17,0,0,"",0,0,0,0,586,'',[
minilines(346,17,0,0,0,0,0,[
mini_line(346,14,3,0,0,0,[
str_block(0,346,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,346,14,3,0,0,0,0,0,0,0,
"2. This is typically the Node::ReceiveFromDevice() function")])
])
])]).
text('black',479,509,3,0,1,460,51,524,14,3,0,0,0,0,2,460,51,0,0,"",0,0,0,0,523,'',[
minilines(460,51,0,0,0,0,0,[
mini_line(426,14,3,0,0,0,[
str_block(0,426,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,426,14,3,0,-1,0,0,0,0,0,
"3. Node::ReceiveFromDevice stores a set of callbacks (protocol handlers)")])
]),
mini_line(460,14,3,0,0,0,[
str_block(0,460,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,460,14,3,0,-1,0,0,0,0,0,
" that are looked up based on protocol number and device. In this case, the lookup")])
]),
mini_line(300,14,3,0,0,0,[
str_block(0,300,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,300,14,3,0,-1,0,0,0,0,0,
"will result in Ipv4L3Protocol::Receive() being called.")])
])
])]).
text('black',480,425,4,0,1,499,68,531,14,3,0,0,0,0,2,499,68,0,0,"",0,0,0,0,439,'',[
minilines(499,68,0,0,0,0,0,[
mini_line(475,14,3,0,0,0,[
str_block(0,475,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,475,14,3,0,-2,0,0,0,0,0,
"4. Ipv4L3Protocol removes the IP header, checks checksum (if implemented), and ")])
]),
mini_line(467,14,3,0,0,0,[
str_block(0,467,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,467,14,3,0,-2,0,0,0,0,0,
"either Forwards the packet or calls ForwardUp(). ForwardUp() then looks up the ")])
]),
mini_line(499,14,3,0,0,0,[
str_block(0,499,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,499,14,3,0,-1,0,0,0,0,0,
"IP protocol number in an IPv4L4Demux to obtain a pointer to an Ipv4L4Protocol object,")])
]),
mini_line(191,14,3,0,0,0,[
str_block(0,191,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,191,14,3,0,-1,0,0,0,0,0,
"and calls the ::Receive() method.")])
])
])]).
text('black',281,548,1,0,1,140,17,541,14,3,2,0,0,0,2,140,17,0,0,"",0,0,0,0,562,'',[
minilines(140,17,0,0,0,0,0,[
mini_line(140,14,3,0,0,0,[
str_block(0,140,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,140,14,3,0,-1,0,0,0,0,0,
"Node::ProtocolHandlers")])
])
])]).
rcbox('black','',261,541,398,574,0,1,1,2,16,542,0,0,0,0,'1',0,[
]).
poly('black','',2,[
236,596,327,576],1,1,1,548,0,0,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',272,590,1,0,1,112,17,550,14,3,0,0,0,0,2,112,17,0,0,"",0,0,0,0,604,'',[
minilines(112,17,0,0,0,0,0,[
mini_line(112,14,3,0,0,0,[
str_block(0,112,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,112,14,3,0,0,0,0,0,0,0,
"m_receiveCallback")])
])
])]).
poly('black','',2,[
306,541,202,460],1,1,1,555,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
poly('black','',2,[
280,447,367,423],3,1,1,566,0,0,3,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',185,499,1,0,1,65,17,575,14,3,0,0,0,0,2,65,17,0,0,"",0,0,0,0,513,'',[
minilines(65,17,0,0,0,0,0,[
mini_line(65,14,3,0,0,0,[
str_block(0,65,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,65,14,3,0,-1,0,0,0,0,0,
"::Receive()")])
])
])]).
text('black',315,438,1,0,1,135,17,585,14,3,0,0,0,0,2,135,17,0,0,"",0,0,0,0,452,'',[
minilines(135,17,0,0,0,0,0,[
mini_line(135,14,3,0,0,0,[
str_block(0,135,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,135,14,3,0,-1,0,0,0,0,0,
"::GetProtocol(protocol)")])
])
])]).
poly('black','',2,[
201,426,201,366],1,1,1,593,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',211,390,1,0,1,65,17,597,14,3,0,0,0,0,2,65,17,0,0,"",0,0,0,0,404,'',[
minilines(65,17,0,0,0,0,0,[
mini_line(65,14,3,0,0,0,[
str_block(0,65,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,65,14,3,0,-1,0,0,0,0,0,
"::Receive()")])
])
])]).
text('black',480,291,6,0,1,438,102,612,14,3,0,0,0,0,2,438,102,0,0,"",0,0,0,0,305,'',[
minilines(438,102,0,0,0,0,0,[
mini_line(293,14,3,0,0,0,[
str_block(0,293,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,293,14,3,0,0,0,0,0,0,0,
"5. UdpL4Protocol is where the socket-independent")])
]),
mini_line(428,14,3,0,0,0,[
str_block(0,428,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,428,14,3,0,0,0,0,0,0,0,
"protocol logic for UDP is implemented. The Receive() method removes the")])
]),
mini_line(420,14,3,0,0,0,[
str_block(0,420,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,420,14,3,0,0,0,0,0,0,0,
"UDP header and looks up the per-flow context state, which is one or more")])
]),
mini_line(438,14,3,0,0,0,[
str_block(0,438,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,438,14,3,0,-1,0,0,0,0,0,
"Ipv4EndPoint objects stored in an Ipv4EndPointDemux (indexed by src addr,")])
]),
mini_line(405,14,3,0,0,0,[
str_block(0,405,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,405,14,3,0,-1,0,0,0,0,0,
"src port, dest addr, dest port). It then calls Ipv4EndPoint::ForwardUp()")])
]),
mini_line(66,14,3,0,0,0,[
str_block(0,66,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,66,14,3,0,-1,0,0,0,0,0,
"when done.")])
])
])]).
poly('black','',2,[
201,331,201,271],1,1,1,619,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',211,295,1,0,1,85,17,620,14,3,0,0,0,0,2,85,17,0,0,"",0,0,0,0,309,'',[
minilines(85,17,0,0,0,0,0,[
mini_line(85,14,3,0,0,0,[
str_block(0,85,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,85,14,3,0,-1,0,0,0,0,0,
"::ForwardUp()")])
])
])]).
poly('black','',2,[
282,335,369,311],3,1,1,630,0,0,3,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',317,326,1,0,1,62,17,631,14,3,0,0,0,0,2,62,17,0,0,"",0,0,0,0,340,'',[
minilines(62,17,0,0,0,0,0,[
mini_line(62,14,3,0,0,0,[
str_block(0,62,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,62,14,3,0,-1,0,0,0,0,0,
"::Lookup()")])
])
])]).
text('black',211,208,1,0,1,181,17,650,14,3,0,0,0,0,2,181,17,0,0,"",0,0,0,0,222,'',[
minilines(181,17,0,0,0,0,0,[
mini_line(181,14,3,0,0,0,[
str_block(0,181,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,181,14,3,0,-1,0,0,0,0,0,
"(m_rxCallback)->ForwardUp()")])
])
])]).
poly('black','',2,[
201,233,201,196],1,1,1,652,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',211,138,1,0,1,144,17,656,14,3,0,0,0,0,2,144,17,0,0,"",0,0,0,0,152,'',[
minilines(144,17,0,0,0,0,0,[
mini_line(144,14,3,0,0,0,[
str_block(0,144,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,144,14,3,0,-1,0,0,0,0,0,
"(m_rxCallback)->Recv()")])
])
])]).
text('black',149,17,1,0,1,321,21,683,17,4,0,0,0,0,2,321,21,0,0,"",0,0,0,0,34,'',[
minilines(321,21,0,0,0,0,0,[
mini_line(321,17,4,0,0,0,[
str_block(0,321,17,4,0,0,0,0,0,[
str_seg('black','Times-Roman',0,103680,321,17,4,0,0,0,0,0,0,0,
"Function/object trace for receiving a packet")])
])
])]).
poly('black','',2,[
199,163,199,126],1,1,1,691,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
group([
text('black',311,280,1,0,1,120,17,484,14,3,0,0,0,0,2,120,17,0,0,"",0,0,0,0,294,'',[
minilines(120,17,0,0,0,0,0,[
mini_line(120,14,3,0,0,0,[
str_block(0,120,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,120,14,3,0,0,0,0,0,0,0,
"Ipv4EndPointDemux")])
])
])]),
polygon('black','',6,[
309,276,324,305,419,305,439,277,309,277,309,276],0,1,1,0,485,0,0,0,0,0,'1',0,
"00",[
])
],
704,0,0,[
]).
text('black',480,190,3,0,1,363,51,708,14,3,0,0,0,0,2,363,51,0,0,"",0,0,0,0,204,'',[
minilines(363,51,0,0,0,0,0,[
mini_line(363,14,3,0,0,0,[
str_block(0,363,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,363,14,3,0,-1,0,0,0,0,0,
"6. Ipv4EndPoint has a callback where a Socket object is able to")])
]),
mini_line(304,14,3,0,0,0,[
str_block(0,304,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,304,14,3,0,-1,0,0,0,0,0,
"register a receive method. Here, this callback calls to")])
]),
mini_line(175,14,3,0,0,0,[
str_block(0,175,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,175,14,3,0,-1,0,0,0,0,0,
"UdpSocketImpl::ForwardUp()")])
])
])]).
text('black',480,106,3,0,1,446,51,712,14,3,0,0,0,0,2,446,51,0,0,"",0,0,0,0,120,'',[
minilines(446,51,0,0,0,0,0,[
mini_line(407,14,3,0,0,0,[
str_block(0,407,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,407,14,3,0,0,0,0,0,0,0,
"7. UdpSocketImpl itself calls the Recv() callback set by the Application")])
]),
mini_line(402,14,3,0,0,0,[
str_block(0,402,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,402,14,3,0,0,0,0,0,0,0,
"when data is ready to be read. The application can then call the socket")])
]),
mini_line(446,14,3,0,0,0,[
str_block(0,446,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,446,14,3,0,-1,0,0,0,0,0,
"Recv() or RecvFrom() methods to read data (or dummy data) from the socket.")])
])
])]).
group([
text('black',308,393,1,0,1,96,17,772,14,3,0,0,0,0,2,96,17,0,0,"",0,0,0,0,407,'',[
minilines(96,17,0,0,0,0,0,[
mini_line(96,14,3,0,0,0,[
str_block(0,96,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,96,14,3,0,0,0,0,0,0,0,
" Ipv4L4Demux")])
])
])]),
polygon('black','',6,[
306,389,321,418,416,418,436,390,306,390,306,389],0,1,1,0,771,0,0,0,0,0,'1',0,
"00",[
])
],
770,0,0,[
]).
+352
View File
@@ -0,0 +1,352 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,83,0,0,16,0,9,1,1,0,0,3,2,1,0,'Times-Roman',0,80640,0,3,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
group([
rcbox('black','',158,451,238,499,2,1,1,0,16,125,0,0,0,0,'1',0,[
]),
text('black',158,470,1,0,1,72,18,124,13,5,0,0,0,0,2,72,18,0,0,"",0,0,0,0,483,'',[
minilines(72,18,0,0,0,0,0,[
mini_line(72,13,5,0,0,0,[
str_block(0,72,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,72,13,5,0,0,0,0,0,0,0,
"NetDevice")])
])
])])
],
141,0,0,[
]).
group([
rcbox('black','',147,77,255,125,2,1,1,0,16,354,0,0,0,0,'1',0,[
]),
text('black',163,96,1,0,1,88,18,353,13,5,0,0,0,0,2,88,18,0,0,"",0,0,0,0,109,'',[
minilines(88,18,0,0,0,0,0,[
mini_line(88,13,5,0,0,0,[
str_block(0,88,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,88,13,5,0,0,0,0,0,0,0,
"Application")])
])
])])
],
352,0,0,[
]).
text('black',202,172,1,1,1,90,17,473,14,3,2,0,0,0,2,90,17,0,0,"",0,0,0,0,186,'',[
minilines(90,17,0,0,1,0,0,[
mini_line(90,14,3,0,0,0,[
str_block(0,90,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,90,14,3,0,0,0,0,0,0,0,
"UdpSocketImpl")])
])
])]).
rcbox('black','',132,165,269,198,0,1,1,0,16,474,0,0,0,0,'1',0,[
]).
text('black',202,241,1,1,1,88,17,475,14,3,2,0,0,0,2,88,17,0,0,"",0,0,0,0,255,'',[
minilines(88,17,0,0,1,0,0,[
mini_line(88,14,3,0,0,0,[
str_block(0,88,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,88,14,3,0,0,0,0,0,0,0,
"UdpL4Protocol")])
])
])]).
rcbox('black','',132,234,269,267,0,1,1,0,16,476,0,0,0,0,'1',0,[
]).
text('black',201,317,1,1,1,90,17,490,14,3,2,0,0,0,2,90,17,0,0,"",0,0,0,0,331,'',[
minilines(90,17,0,0,1,0,0,[
mini_line(90,14,3,0,0,0,[
str_block(0,90,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,90,14,3,0,0,0,0,0,0,0,
"Ipv4L3Protocol")])
])
])]).
rcbox('black','',131,310,268,343,0,1,1,0,16,491,0,0,0,0,'1',0,[
]).
text('black',540,56,1,0,1,180,17,496,14,3,0,0,0,0,2,180,17,0,0,"",0,0,0,0,70,'',[
minilines(180,17,0,0,0,0,0,[
mini_line(180,14,3,0,0,0,[
str_block(0,180,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,180,14,3,0,-2,1,0,0,0,0,
"Step in packet sending process:")])
])
])]).
text('black',480,420,4,0,1,460,68,524,14,3,0,0,0,0,2,460,68,0,0,"",0,0,0,0,434,'',[
minilines(460,68,0,0,0,0,0,[
mini_line(457,14,3,0,0,0,[
str_block(0,457,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,457,14,3,0,0,0,0,0,0,0,
"5. Ipv4Interface is an abstract base class; here, we depict the ArpIpv4Interface")])
]),
mini_line(460,14,3,0,0,0,[
str_block(0,460,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,460,14,3,0,-1,0,0,0,0,0,
"concrete class. This object looks up the MAC address if Arp is supported on this")])
]),
mini_line(454,14,3,0,0,0,[
str_block(0,454,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,454,14,3,0,0,0,0,0,0,0,
"NetDevice technology, and if there is a cache hit, it sends it to the NetDevice, or")])
]),
mini_line(197,14,3,0,0,0,[
str_block(0,197,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,197,14,3,0,-1,0,0,0,0,0,
"else it first initiates an Arp request.")])
])
])]).
text('black',479,354,3,0,1,476,51,531,14,3,0,0,0,0,2,476,51,0,0,"",0,0,0,0,368,'',[
minilines(476,51,0,0,0,0,0,[
mini_line(469,14,3,0,0,0,[
str_block(0,469,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,469,14,3,0,0,0,0,0,0,0,
"4. Ipv4L3Protocol adds the IP header, looks up a route, and sends the packet to an")])
]),
mini_line(476,14,3,0,0,0,[
str_block(0,476,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,476,14,3,0,-1,0,0,0,0,0,
"appropriate Ipv4Interface instance. In this example, the device is one that supports")])
]),
mini_line(322,14,3,0,0,0,[
str_block(0,322,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,322,14,3,0,-1,0,0,0,0,0,
"Arp, so the packet is sent to an ArpIpv4Interface object.")])
])
])]).
text('black',478,261,4,0,1,437,68,612,14,3,0,0,0,0,2,437,68,0,0,"",0,0,0,0,275,'',[
minilines(437,68,0,0,0,0,0,[
mini_line(293,14,3,0,0,0,[
str_block(0,293,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,293,14,3,0,0,0,0,0,0,0,
"3. UdpL4Protocol is where the socket-independent")])
]),
mini_line(387,14,3,0,0,0,[
str_block(0,387,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,387,14,3,0,0,0,0,0,0,0,
"protocol logic for UDP is implemented. The Send() method adds the")])
]),
mini_line(437,14,3,0,0,0,[
str_block(0,437,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,437,14,3,0,-1,0,0,0,0,0,
"UDP header, initializes the checksum, and sends the packet to the Ipv4 layer.")])
]),
mini_line(431,14,3,0,0,0,[
str_block(0,431,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,431,14,3,0,-1,0,0,0,0,0,
"Here, the Ipv4L3Protocol object is queried, and the Send() method is called.")])
])
])]).
poly('black','',2,[
201,308,201,271],2,1,1,619,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',208,278,1,0,1,47,17,620,14,3,0,0,0,0,2,47,17,0,0,"",0,0,0,0,292,'',[
minilines(47,17,0,0,0,0,0,[
mini_line(47,14,3,0,0,0,[
str_block(0,47,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,47,14,3,0,-1,0,0,0,0,0,
"::Send()")])
])
])]).
text('black',211,208,1,0,1,47,17,650,14,3,0,0,0,0,2,47,17,0,0,"",0,0,0,0,222,'',[
minilines(47,17,0,0,0,0,0,[
mini_line(47,14,3,0,0,0,[
str_block(0,47,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,47,14,3,0,-1,0,0,0,0,0,
"::Send()")])
])
])]).
poly('black','',2,[
201,233,201,196],2,1,1,652,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',211,138,1,0,1,87,17,656,14,3,0,0,0,0,2,87,17,0,0,"",0,0,0,0,152,'',[
minilines(87,17,0,0,0,0,0,[
mini_line(87,14,3,0,0,0,[
str_block(0,87,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,87,14,3,0,-1,0,0,0,0,0,
"Socket::Send()")])
])
])]).
text('black',149,17,1,0,1,310,21,683,17,4,0,0,0,0,2,310,21,0,0,"",0,0,0,0,34,'',[
minilines(310,21,0,0,0,0,0,[
mini_line(310,17,4,0,0,0,[
str_block(0,310,17,4,0,0,0,0,0,[
str_seg('black','Times-Roman',0,103680,310,17,4,0,0,0,0,0,0,0,
"Function/object trace for sending a packet")])
])
])]).
poly('black','',2,[
199,163,199,126],2,1,1,691,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',480,153,6,0,1,524,102,708,14,3,0,0,0,0,2,524,102,0,0,"",0,0,0,0,167,'',[
minilines(524,102,0,0,0,0,0,[
mini_line(399,14,3,0,0,0,[
str_block(0,399,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,399,14,3,0,-2,0,0,0,0,0,
"2. Socket::Send() forwards to UdpSocketImpl::DoSend() and later to ")])
]),
mini_line(173,14,3,0,0,0,[
str_block(0,173,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,173,14,3,0,-1,0,0,0,0,0,
"UdpSocketImpl::DoSendTo().")])
]),
mini_line(479,14,3,0,0,0,[
str_block(0,479,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,479,14,3,0,-1,0,0,0,0,0,
"These functions set the proper source and destination addresses, handle socket calls")])
]),
mini_line(524,14,3,0,0,0,[
str_block(0,524,14,3,0,-2,0,0,0,[
str_seg('black','Times-Roman',0,80640,524,14,3,0,-2,0,0,0,0,0,
"such as bind() and connect() and then the UdpL4Protocol::Send() function is called. As in a ")])
]),
mini_line(505,14,3,0,0,0,[
str_block(0,505,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,505,14,3,0,-1,0,0,0,0,0,
"real implementation, the socket must query the Ipv4 layer to find the right source address")])
]),
mini_line(187,14,3,0,0,0,[
str_block(0,187,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,187,14,3,0,-1,0,0,0,0,0,
"to match the destination address.")])
])
])]).
text('black',480,106,2,0,1,434,34,712,14,3,0,0,0,0,2,434,34,0,0,"",0,0,0,0,120,'',[
minilines(434,34,0,0,0,0,0,[
mini_line(413,14,3,0,0,0,[
str_block(0,413,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,413,14,3,0,-1,0,0,0,0,0,
"1. The Application has previously created a socket (here, a UdpSocket).")])
]),
mini_line(434,14,3,0,0,0,[
str_block(0,434,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,434,14,3,0,-1,0,0,0,0,0,
"It calls Socket::Send(). Either real data or dummy data is passed at the API.")])
])
])]).
text('black',377,315,1,1,1,60,17,774,14,3,2,0,0,0,2,60,17,0,0,"",0,0,0,0,329,'',[
minilines(60,17,0,0,1,0,0,[
mini_line(60,14,3,0,0,0,[
str_block(0,60,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,60,14,3,0,0,0,0,0,0,0,
"Ipv4Route")])
])
])]).
rcbox('black','',307,308,444,341,0,1,1,0,16,775,0,0,0,0,'1',0,[
]).
poly('black','',2,[
267,325,304,325],3,1,1,787,0,0,3,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',278,299,1,0,1,62,17,796,14,3,2,0,0,0,2,62,17,0,0,"",0,0,0,0,313,'',[
minilines(62,17,0,0,0,0,0,[
mini_line(62,14,3,0,0,0,[
str_block(0,62,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,62,14,3,0,-1,0,0,0,0,0,
"::Lookup()")])
])
])]).
text('black',200,385,1,1,1,102,17,803,14,3,2,0,0,0,2,102,17,0,0,"",0,0,0,0,399,'',[
minilines(102,17,0,0,1,0,0,[
mini_line(102,14,3,0,0,0,[
str_block(0,102,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,102,14,3,0,0,0,0,0,0,0,
"ArpIpv4Interface")])
])
])]).
rcbox('black','',130,378,267,411,0,1,1,0,16,804,0,0,0,0,'1',0,[
]).
poly('black','',2,[
199,380,199,343],2,1,1,810,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',206,350,1,0,1,47,17,811,14,3,0,0,0,0,2,47,17,0,0,"",0,0,0,0,364,'',[
minilines(47,17,0,0,0,0,0,[
mini_line(47,14,3,0,0,0,[
str_block(0,47,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,47,14,3,0,-1,0,0,0,0,0,
"::Send()")])
])
])]).
text('black',378,388,1,1,1,71,17,817,14,3,2,0,0,0,2,71,17,0,0,"",0,0,0,0,402,'',[
minilines(71,17,0,0,1,0,0,[
mini_line(71,14,3,0,0,0,[
str_block(0,71,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,71,14,3,0,0,0,0,0,0,0,
"ArpProtocol")])
])
])]).
rcbox('black','',308,381,445,414,0,1,1,0,16,818,0,0,0,0,'1',0,[
]).
poly('black','',2,[
268,398,305,398],3,1,1,819,0,0,3,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',279,372,1,0,1,62,17,820,14,3,2,0,0,0,2,62,17,0,0,"",0,0,0,0,386,'',[
minilines(62,17,0,0,0,0,0,[
mini_line(62,14,3,0,0,0,[
str_block(0,62,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,62,14,3,0,-1,0,0,0,0,0,
"::Lookup()")])
])
])]).
poly('black','',2,[
199,448,199,411],2,1,1,837,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',206,418,1,0,1,47,17,838,14,3,0,0,0,0,2,47,17,0,0,"",0,0,0,0,432,'',[
minilines(47,17,0,0,0,0,0,[
mini_line(47,14,3,0,0,0,[
str_block(0,47,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,47,14,3,0,-1,0,0,0,0,0,
"::Send()")])
])
])]).
text('black',371,173,1,1,1,26,17,842,14,3,2,0,0,0,2,26,17,0,0,"",0,0,0,0,187,'',[
minilines(26,17,0,0,1,0,0,[
mini_line(26,14,3,0,0,0,[
str_block(0,26,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,26,14,3,0,-1,0,0,0,0,0,
"Ipv4")])
])
])]).
rcbox('black','',301,166,438,199,0,1,1,0,16,843,0,0,0,0,'1',0,[
]).
text('black',272,157,1,0,1,148,17,844,14,3,2,0,0,0,2,148,17,0,0,"",0,0,0,0,171,'',[
minilines(148,17,0,0,0,0,0,[
mini_line(148,14,3,0,0,0,[
str_block(0,148,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,148,14,3,0,-1,0,0,0,0,0,
"::GetAddress(outgoing if)")])
])
])]).
poly('black','',2,[
269,182,306,182],3,1,1,846,0,0,3,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
+211
View File
@@ -0,0 +1,211 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,0,0,0,16,0,9,1,1,0,0,3,2,1,0,'Times-Italic',2,80640,0,8,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
rcbox('black','',64,64,400,384,0,1,1,0,16,0,0,0,0,0,'1',0,[
]).
box('black','',280,432,555,464,0,1,1,17,0,0,0,0,0,'1',0,[
]).
text('black',384,435,1,0,1,56,18,18,13,5,0,0,0,0,2,56,18,0,0,"",0,0,0,0,448,'',[
minilines(56,18,0,0,0,0,0,[
mini_line(56,13,5,0,0,0,[
str_block(0,56,13,5,0,-1,0,0,0,[
str_seg('black','Courier-Bold',1,80640,56,13,5,0,-1,0,0,0,0,0,
"Channel")])
])
])]).
text('black',76,42,1,0,1,208,18,108,13,5,2,0,0,0,2,208,18,0,0,"",0,0,0,0,55,'',[
minilines(208,18,0,0,0,0,0,[
mini_line(208,13,5,0,0,0,[
str_block(0,208,13,5,0,0,0,0,0,[
str_seg('black','Courier-Bold',1,80640,208,13,5,0,0,0,0,0,0,0,
"class Node : public Object")])
])
])]).
group([
rcbox('black','',112,304,192,352,2,1,1,0,16,134,0,0,0,0,'1',0,[
]),
text('black',112,323,1,0,1,72,18,135,13,5,0,0,0,0,2,72,18,0,0,"",0,0,0,0,336,'',[
minilines(72,18,0,0,0,0,0,[
mini_line(72,13,5,0,0,0,[
str_block(0,72,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,72,13,5,0,0,0,0,0,0,0,
"NetDevice")])
])
])])
],
138,0,0,[
]).
group([
rcbox('black','',266,304,346,352,2,1,1,0,16,125,0,0,0,0,'1',0,[
]),
text('black',266,323,1,0,1,72,18,124,13,5,0,0,0,0,2,72,18,0,0,"",0,0,0,0,336,'',[
minilines(72,18,0,0,0,0,0,[
mini_line(72,13,5,0,0,0,[
str_block(0,72,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,72,13,5,0,0,0,0,0,0,0,
"NetDevice")])
])
])])
],
141,0,0,[
]).
poly('black','',2,[
304,351,304,430],3,1,1,167,0,2,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',219,304,1,0,1,24,37,177,30,7,2,0,0,0,2,24,37,0,0,"",0,0,0,0,334,'',[
minilines(24,37,0,0,0,0,0,[
mini_line(24,30,7,0,0,0,[
str_block(0,24,30,7,0,-2,0,0,0,[
str_seg('black','Times-Bold',1,195840,24,30,7,0,-2,0,0,0,0,0,
"...")])
])
])]).
text('black',220,98,1,0,1,24,37,182,30,7,2,0,0,0,2,24,37,0,0,"",0,0,0,0,128,'',[
minilines(24,37,0,0,0,0,0,[
mini_line(24,30,7,0,0,0,[
str_block(0,24,30,7,0,-2,0,0,0,[
str_seg('black','Times-Bold',1,195840,24,30,7,0,-2,0,0,0,0,0,
"...")])
])
])]).
text('black',420,116,2,0,1,136,36,183,13,5,2,0,0,0,2,136,36,0,0,"",0,0,0,0,129,'',[
minilines(136,36,0,0,0,0,0,[
mini_line(136,13,5,0,0,0,[
str_block(0,136,13,5,0,0,0,0,0,[
str_seg('black','Courier-Bold',1,80640,136,13,5,0,0,0,0,0,0,0,
"Unix-like C-based")])
]),
mini_line(80,13,5,0,0,0,[
str_block(0,80,13,5,0,-1,0,0,0,[
str_seg('black','Courier-Bold',1,80640,80,13,5,0,-1,0,0,0,0,0,
"socket API")])
])
])]).
text('black',414,212,3,0,1,232,54,198,13,5,2,0,0,0,2,232,54,0,0,"",0,0,0,0,225,'',[
minilines(232,54,0,0,0,0,0,[
mini_line(112,13,5,0,0,0,[
str_block(0,112,13,5,0,0,0,0,0,[
str_seg('black','Courier-Bold',1,80640,112,13,5,0,0,0,0,0,0,0,
"Callback-based")])
]),
mini_line(176,13,5,0,0,0,[
str_block(0,176,13,5,0,0,0,0,0,[
str_seg('black','Courier-Bold',1,80640,176,13,5,0,0,0,0,0,0,0,
"protocol demultiplexer")])
]),
mini_line(232,13,5,0,0,0,[
str_block(0,8,13,5,0,-1,0,0,0,[
str_seg('black','Courier-Bold',1,80640,8,13,5,0,-1,0,0,0,0,0,
"(")]),
str_block(0,216,13,3,0,-2,0,0,0,[
str_seg('black','Courier-Oblique',2,80640,216,13,3,0,-2,0,0,0,0,0,
"list of ProtocolHandlers")]),
str_block(0,8,13,5,0,-2,0,0,0,[
str_seg('black','Courier-Bold',1,80640,8,13,5,0,-2,0,0,0,0,0,
")")])
])
])]).
poly('black','',2,[
410,231,222,259],1,1,1,200,0,2,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
box('black','',56,401,229,433,0,1,1,250,0,0,0,0,0,'1',0,[
]).
text('black',119,409,1,0,1,56,18,251,13,5,0,0,0,0,2,56,18,0,0,"",0,0,0,0,422,'',[
minilines(56,18,0,0,0,0,0,[
mini_line(56,13,5,0,0,0,[
str_block(0,56,13,5,0,-1,0,0,0,[
str_seg('black','Courier-Bold',1,80640,56,13,5,0,-1,0,0,0,0,0,
"Channel")])
])
])]).
poly('black','',2,[
154,353,154,400],3,1,1,254,0,2,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
group([
rcbox('black','',98,96,206,144,2,1,1,0,16,1,0,0,0,0,'1',0,[
]),
text('black',114,115,1,0,1,88,18,2,13,5,0,0,0,0,2,88,18,0,0,"",0,0,0,0,128,'',[
minilines(88,18,0,0,0,0,0,[
mini_line(88,13,5,0,0,0,[
str_block(0,88,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,88,13,5,0,0,0,0,0,0,0,
"Application")])
])
])])
],
348,0,0,[
]).
group([
rcbox('black','',257,96,365,144,2,1,1,0,16,354,0,0,0,0,'1',0,[
]),
text('black',273,115,1,0,1,88,18,353,13,5,0,0,0,0,2,88,18,0,0,"",0,0,0,0,128,'',[
minilines(88,18,0,0,0,0,0,[
mini_line(88,13,5,0,0,0,[
str_block(0,88,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,88,13,5,0,0,0,0,0,0,0,
"Application")])
])
])])
],
352,0,0,[
]).
text('black',155,73,1,0,1,110,18,426,14,4,2,0,0,0,2,110,18,0,0,"",0,0,0,0,87,'',[
minilines(110,18,0,0,0,0,0,[
mini_line(110,14,4,0,0,0,[
str_block(0,110,14,4,0,-1,0,0,0,[
str_seg('black','Times-Italic',2,80640,110,14,4,0,-1,0,0,0,0,0,
"list of Applications")])
])
])]).
text('black',161,357,1,0,1,106,18,443,14,4,2,0,0,0,2,106,18,0,0,"",0,0,0,0,371,'',[
minilines(106,18,0,0,0,0,0,[
mini_line(106,14,4,0,0,0,[
str_block(0,106,14,4,0,-1,0,0,0,[
str_seg('black','Times-Italic',2,80640,106,14,4,0,-1,0,0,0,0,0,
"list of NetDevices")])
])
])]).
text('black',79,194,2,0,1,55,36,482,14,4,2,0,0,0,2,55,36,0,0,"",0,0,0,0,208,'',[
minilines(55,36,0,0,0,0,0,[
mini_line(53,14,4,0,0,0,[
str_block(0,53,14,4,0,0,0,0,0,[
str_seg('black','Times-Italic',2,80640,53,14,4,0,0,0,0,0,0,0,
"unique id")])
]),
mini_line(55,14,4,0,0,0,[
str_block(0,55,14,4,0,0,0,0,0,[
str_seg('black','Times-Italic',2,80640,55,14,4,0,0,0,0,0,0,0,
"system id")])
])
])]).
polygon('black','',7,[
158,271,305,271,288,291,173,291,159,273,160,273,158,271],2,1,1,0,493,8,0,0,0,0,'1',0,
"00",[
]).
+227
View File
@@ -0,0 +1,227 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,0,64,0,32,0,9,1,1,1,0,0,0,1,0,'Courier-Bold',1,103680,0,3,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
box('black','',32,48,240,256,0,3,1,0,0,0,0,0,0,'3',0,[
]).
text('black',64,10,1,0,1,121,28,3,22,6,0,0,0,0,2,121,28,0,0,"",0,0,0,0,32,'',[
minilines(121,28,0,0,0,0,0,[
mini_line(121,22,6,0,0,0,[
str_block(0,121,22,6,0,0,0,0,0,[
str_seg('black','Times-Roman',0,138240,121,22,6,0,0,0,0,0,0,0,
"class Packet")])
])
])]).
text('black',416,100,1,0,1,116,28,15,22,6,0,0,0,0,2,116,28,0,0,"",0,0,0,0,122,'',[
minilines(116,28,0,0,0,0,0,[
mini_line(116,22,6,0,0,0,[
str_block(0,116,22,6,0,0,0,0,0,[
str_seg('black','Times-Roman',0,138240,116,22,6,0,0,0,0,0,0,0,
"class Buffer")])
])
])]).
text('black',48,178,4,0,1,83,69,32,14,4,0,0,0,0,2,83,69,0,0,"",0,0,0,0,192,'',[
minilines(83,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(59,14,3,0,0,0,[
str_block(0,59,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,59,14,3,0,0,0,0,0,0,0,
"- unique id")])
]),
mini_line(83,14,3,0,0,0,[
str_block(0,83,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,83,14,3,0,0,0,0,0,0,0,
"- Buffer object")])
]),
mini_line(76,14,3,0,0,0,[
str_block(0,76,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,76,14,3,0,0,0,0,0,0,0,
"- Tags object")])
])
])]).
text('black',112,288,1,0,1,103,28,82,22,6,0,0,0,0,2,103,28,0,0,"",0,0,0,0,310,'',[
minilines(103,28,0,0,0,0,0,[
mini_line(103,22,6,0,0,0,[
str_block(0,103,22,6,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,138240,103,22,6,0,-1,0,0,0,0,0,
"class Tags")])
])
])]).
text('black',48,50,5,0,1,175,86,176,14,4,0,0,0,0,2,175,86,0,0,"",0,0,0,0,64,'',[
minilines(175,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(80,14,3,0,0,0,[
str_block(0,80,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0,
"- constructors")])
]),
mini_line(175,14,3,0,0,0,[
str_block(0,175,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,175,14,3,0,-1,0,0,0,0,0,
"- add/remove/peek at Headers")])
]),
mini_line(155,14,3,0,0,0,[
str_block(0,155,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0,
"- add/remove/peek at Tags")])
]),
mini_line(88,14,3,0,0,0,[
str_block(0,88,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,88,14,3,0,0,0,0,0,0,0,
"- fragmentation")])
])
])]).
box('black','',384,144,614,352,0,3,1,245,0,0,0,0,0,'3',0,[
]).
text('black',400,274,4,0,1,204,69,246,14,4,0,0,0,0,2,204,69,0,0,"",0,0,0,0,288,'',[
minilines(204,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(193,14,3,0,0,0,[
str_block(0,193,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,193,14,3,0,0,0,0,0,0,0,
"- struct BufferData, a dynamically")])
]),
mini_line(160,14,3,0,0,0,[
str_block(0,160,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,160,14,3,0,0,0,0,0,0,0,
"varying byte buffer to which")])
]),
mini_line(204,14,3,0,0,0,[
str_block(0,204,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,204,14,3,0,0,0,0,0,0,0,
"data can be prepended or appended")])
])
])]).
text('black',400,146,5,0,1,188,86,247,14,4,0,0,0,0,2,188,86,0,0,"",0,0,0,0,160,'',[
minilines(188,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(172,14,3,0,0,0,[
str_block(0,172,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,172,14,3,0,0,0,0,0,0,0,
"- Iterators to move byte buffer")])
]),
mini_line(171,14,3,0,0,0,[
str_block(0,171,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,171,14,3,0,0,0,0,0,0,0,
"pointers forward or backward")])
]),
mini_line(188,14,3,0,0,0,[
str_block(0,188,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,188,14,3,0,0,0,0,0,0,0,
"- functions to read and write data")])
]),
mini_line(132,14,3,0,0,0,[
str_block(0,132,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,132,14,3,0,-1,0,0,0,0,0,
"of various sized chunks")])
])
])]).
box('black','',96,324,304,532,0,3,1,264,0,0,0,0,0,'3',0,[
]).
text('black',112,454,4,0,1,167,69,265,14,4,0,0,0,0,2,167,69,0,0,"",0,0,0,0,468,'',[
minilines(167,69,0,0,0,0,0,[
mini_line(80,14,4,0,0,0,[
str_block(0,80,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,80,14,4,0,-1,0,0,0,0,0,
"private data:")])
]),
mini_line(167,14,3,0,0,0,[
str_block(0,167,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,167,14,3,0,0,0,0,0,0,0,
"- singly linked-list of TagData")])
]),
mini_line(158,14,3,0,0,0,[
str_block(0,158,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,158,14,3,0,0,0,0,0,0,0,
"structures, with a reference")])
]),
mini_line(32,14,3,0,0,0,[
str_block(0,32,14,3,0,0,0,0,0,[
str_seg('black','Times-Roman',0,80640,32,14,3,0,0,0,0,0,0,0,
"count")])
])
])]).
text('black',112,326,5,0,1,155,86,266,14,4,0,0,0,0,2,155,86,0,0,"",0,0,0,0,340,'',[
minilines(155,86,0,0,0,0,0,[
mini_line(105,14,4,0,0,0,[
str_block(0,105,14,4,0,-1,0,0,0,[
str_seg('black','Times-Bold',1,80640,105,14,4,0,-1,0,0,0,0,0,
"public functions:")])
]),
mini_line(80,14,3,0,0,0,[
str_block(0,80,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,80,14,3,0,-1,0,0,0,0,0,
"- constructors")])
]),
mini_line(155,14,3,0,0,0,[
str_block(0,155,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,155,14,3,0,-1,0,0,0,0,0,
"- templates to add, remove,")])
]),
mini_line(148,14,3,0,0,0,[
str_block(0,148,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,148,14,3,0,-1,0,0,0,0,0,
"or peek at Tags of various")])
]),
mini_line(31,14,3,0,0,0,[
str_block(0,31,14,3,0,-1,0,0,0,[
str_seg('black','Times-Roman',0,80640,31,14,3,0,-1,0,0,0,0,0,
"types")])
])
])]).
poly('black','',2,[
59,245,96,320],0,2,1,272,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
123,246,288,320],0,2,1,280,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
141,219,379,147],0,2,1,286,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
poly('black','',2,[
132,226,375,335],0,2,1,287,0,0,3,0,0,0,0,'2',0,0,
"0","",[
0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
]).
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
@node Logging
@chapter Logging
@anchor{chap:Logging}
This chapter is the first in a series of chapters discussing things that
one can do to modify the input or output of existing ns-3 scripts.
Examples:
@itemize @bullet
@item Enable or disable the generation of log messages, with fine granularity
@item Set default values for configuration values in the system
@item Generate a report of all configuration values used during a simulation
run (not yet implemented)
@item Set or get values of member variables on objects already instantiated
@item Customizing the tracing output of the script
@item Generate statistics on (not yet implemented)
@item Perform a large number of independent runs of the same simulation
@end itemize
@node Logging Basics
@section Logging Basics
@node Enabling Log Output
@section Enabling Log Output
+156
View File
@@ -0,0 +1,156 @@
body {
font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
background: white;
color: black;
font-size: 11pt;
}
h1, h2, h3, h4, h5, h6 {
# color: #990000;
color: #009999;
}
pre {
font-size: 10pt;
background: #e0e0e0;
color: black;
}
a:link, a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
img {
border: 0px;
}
#main th {
font-size: 12pt;
background: #b0b0b0;
}
.odd {
font-size: 12pt;
background: white;
}
.even {
font-size: 12pt;
background: #e0e0e0;
}
.answer {
font-size: large;
font-weight: bold;
}
.answer p {
font-size: 12pt;
font-weight: normal;
}
.answer ul {
font-size: 12pt;
font-weight: normal;
}
#container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
}
#feedback {
color: #b0b0b0;
font-size: 9pt;
font-style: italic;
}
#header {
position: absolute;
margin: 0px;
top: 10px;
height:96px;
left: 175px;
right: 10em;
bottom: auto;
background: white;
clear: both;
}
#middle {
position: absolute;
left: 0;
height: auto;
width: 100%;
}
#main {
position: absolute;
top: 50px;
left: 175px;
right: 100px;
background: white;
padding: 0em 0em 0em 0em;
}
#navbar {
position: absolute;
top: 75px;
left: 0em;
width: 146px;
padding: 0px;
margin: 0px;
font-size: 10pt;
}
#navbar a:link, #navbar a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
#navbar a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
#navbar dl {
width: 146px;
padding: 0;
margin: 0 0 10px 0px;
background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left;
}
#navbar dt {
padding: 6px 10px;
font-size: 100%;
font-weight: bold;
background: #009999;
margin: 0px;
border-bottom: 1px solid #fff;
color: white;
background: #009999 url(images/box_top2.gif) no-repeat top left;
}
#navbar dd {
font-size: 100%;
margin: 0 0 0 0px;
padding: 6px 10px;
color: #0047b9;
}
dd#selected {
background: #99ffff url(images/arrow.gif) no-repeat;
background-position: 4px 10px;
}
+104
View File
@@ -0,0 +1,104 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ns-3.info
@settitle ns-3 manual
@c @setchapternewpage odd
@c %**end of header
@ifinfo
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
@item Reference Manual (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML versions
should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
@end ifinfo
@copying
This is an @command{ns-3} reference manual.
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/tutorial/index.html,,ns-3 Tutorial}
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen}: Documentation of the public APIs of the simulator
@item Reference Manual (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML
versions should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see @uref{http://www.gnu.org/licenses/}.
@end copying
@titlepage
@title ns-3 Reference Manual
@author ns-3 project
@author feedback: ns-developers@@isi.edu
@today{}
@c @page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@c So the toc is printed at the start.
@anchor{Full Table of Contents}
@contents
@ifnottex
@node Top, Overview, Full Table of Contents
@top ns-3 Manual (html version)
For a pdf version of this manual,
see @uref{http://www.nsnam.org/docs/manual.pdf}.
@insertcopying
@end ifnottex
@menu
* Random variables::
* Callbacks::
* Attributes::
* Packets::
* Sockets APIs::
* Node and Internet Stack::
* Routing overview::
* Troubleshooting
@end menu
@include random.texi
@include callbacks.texi
@include attributes.texi
@include packets.texi
@include sockets.texi
@include node.texi
@c @include output.texi
@include routing.texi
@c @include other.texi
@include troubleshoot.texi
@printindex cp
@bye
+358
View File
@@ -0,0 +1,358 @@
@node Node and Internet Stack
@chapter Node and Internet Stack
@anchor{chap:Node}
This chapter describes how ns-3 nodes are put together, and provides
a walk-through of how packets traverse an internet-based Node.
@float Figure,fig:node
@caption{High-level node architecture.}
@image{figures/node,5in}
@end float
In ns-3, nodes are instances of @code{class Node}. This class
may be subclassed, but instead, the conceptual model is that
we @emph{aggregate} or insert objects to it rather than define
subclasses.
One might think of a bare ns-3 node as a shell of a computer,
to which one may add NetDevices (cards) and other innards including
the protocols and applications. @ref{fig:node} illustrates
that Node objects contain a list of Applications (initially,
the list is empty), a list of NetDevices (initially, the list
is empty), a unique integer ID, and a system ID (for
distributed simulation).
The design tries to avoid putting too many dependencies on the
base class Node, Application, or NetDevice for the following:
@itemize @bullet
@item IP version, or whether IP is at all even used in the Node.
@item implementation details of the IP stack
@end itemize
From a software perspective, the lower interface of applications
corresponds to the C-based sockets API. The upper interface
of NetDevice objects corresponds to the device independent
sublayer of the Linux stack. Everything in between can be
aggregated and plumbed together as needed.
Let's look more closely at the protocol demultiplexer. We want
incoming frames at layer-2 to be delivered to the right layer-3
protocol such as Ipv4. The
function of this demultiplexer is to register callbacks for
receiving packets. The callbacks are indexed based on the
@uref{http://en.wikipedia.org/wiki/EtherType,,EtherType}
in the layer-2 frame.
Many different types of higher-layer protocols may be
connected to the NetDevice, such as IPv4, IPv6, ARP,
MPLS, IEEE 802.1x, and packet sockets. Therefore, the
use of a callback-based demultiplexer avoids the need to
use a common base class for all of these protocols, which
is problematic because of the different types of objects
(including packet sockets) expected to be registered there.
Each NetDevice delivers packets to a callback with the following
signature:
@verbatim
/**
* \param device a pointer to the net device which is calling this callback
* \param packet the packet received
* \param protocol the 16 bit protocol number associated with this packet.
* This protocol number is expected to be the same protocol number
* given to the Send method by the user on the sender side.
* \param address the address of the sender
* \returns true if the callback could handle the packet successfully,
* false otherwise.
*/
typedef Callback<bool, Ptr<NetDevice>, Ptr<Packet>, uint16_t,
const Address &> ReceiveCallback;
@end verbatim
There is a function in class Node that matches that signature:
@verbatim
private:
bool ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet>,
uint16_t protocol, const Address &from);
@end verbatim
However, users do not need to access this function directly. Instead,
when users call @code{uint32_t AddDevice (Ptr<NetDevice> device)},
the implementation of this function sets the callback (and the
function returns the ifIndex of the NetDevice on that Node).
But what does the ReceiveFromDevice function do? Here, it looks
up another callback, in its list of callbacks, corresponding to the
matching EtherType. This callback is called a ProtocolHandler, and
is specified as follows:
@verbatim
typedef Callback<void, Ptr<NetDevice>, Ptr<Packet>, uint16_t,
const Address &> ProtocolHandler;
@end verbatim
Upper-layer protocols or objects are expected to provide such a function.
and register it with the list of ProtocolHandlers by calling
@code{Node::RegisterProtocolHandler ();}
For instance, if Ipv4 is aggregated to a Node, then the Ipv4 receive
function can be registered with the protocol handler by calling:
@verbatim
RegisterProtocolHandler (
MakeCallback (&Ipv4L3Protocol::Receive, ipv4),
Ipv4L3Protocol::PROT_NUMBER, 0);
@end verbatim
and likewise for Ipv6, Arp, etc.
@section NodeList
Every Node created is automatically added to the ns-3 @code{NodeList}.
The NodeList class provides an @code{Add()} method and C++ iterators
to allow one to walk the node list or fetch a Node pointer by
its integer identifier.
@section Internet stack aggregation
The above @code{class Node} is not very useful as-is; other objects
must be aggregated to it to provide useful node functionality.
The ns-3 source code directory @code{src/internet-stack} provides
implmentation of TCP/IPv4-related components. These include IPv4,
ARP, UDP, TCP, and other related protocols.
Internet Nodes are not subclasses of class Node; they are simply Nodes
that have had a bunch of IPv4-related
objects aggregated to them. They can be put together by hand, or
via a helper function @code{AddInternetStack ()} which does the
following:
@verbatim
void AddInternetStack (Ptr<Node> node)
{
// Create layer-3 protocols
Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> ();
Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> ();
ipv4->SetNode (node);
arp->SetNode (node);
// Create an L4 demux
Ptr<Ipv4L4Demux> ipv4L4Demux = CreateObject<Ipv4L4Demux> ();
// Create transport protocols and insert them into the demux
Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
Ptr<TcpL4Protocol> tcp = CreateObject<TcpL4Protocol> ();
ipv4L4Demux->SetNode (node);
udp->SetNode (node);
tcp->SetNode (node);
ipv4L4Demux->Insert (udp);
ipv4L4Demux->Insert (tcp);
// Add factories for instantiating transport protocol sockets
Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
Ptr<TcpSocketFactoryImpl> tcpFactory = CreateObject<TcpSocketFactoryImpl> ();
Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> ();
udpFactory->SetUdp (udp);
tcpFactory->SetTcp (tcp);
ipv4Impl->SetIpv4 (ipv4);
// Aggregate all of these new objects to the node
node->AggregateObject (ipv4);
node->AggregateObject (arp);
node->AggregateObject (ipv4Impl);
node->AggregateObject (udpFactory);
node->AggregateObject (tcpFactory);
node->AggregateObject (ipv4L4Demux);
}
@end verbatim
@subsection Internet Node structure
The Internet Node (an ns-3 Node augmented by aggregation to have one or more
IP stacks) has the following internal structure.
@subsubsection Layer-3 protocols
At the lowest layer, sitting above the NetDevices, are the "layer 3"
protocols, including IPv4, IPv6, and ARP. These protocols provide
the following key methods and data members:
@verbatim
class Ipv4L3Protocol : public Object
{
public:
// Add an Ipv4 interface corresponding to the provided NetDevice
uint32_t AddInterface (Ptr<NetDevice> device);
// Receive function that can be bound to a callback, for receiving
// packets up the stack
void Receive( Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol,
const Address &from);
// Higher-level layers call this method to send a packet
// down the stack to the MAC and PHY layers
//
void Send (Ptr<Packet> packet, Ipv4Address source,
Ipv4Address destination, uint8_t protocol);
private:
Ipv4InterfaceList m_interfaces;
// Protocol handlers
}
@end verbatim
There are many more functions (such as @code{Forward ()}) but we will
focus on the above four items from an architectural perspective.
First, note that the @code{Receive ()} function has a matching signature
to the ReceiveCallback in the @code{class Node}. This function pointer
is inserted into the the Node's protocol handler when
@code{AddInterface ()} is called. The actual registration is done
with a statement such as:
follows:
@verbatim
RegisterProtocolHandler ( MakeCallback (&Ipv4Protocol::Receive, ipv4),
Ipv4L3Protocol::PROT_NUMBER, 0);
@end verbatim
The Ipv4L3Protocol object is aggregated to the Node; there is only one
such Ipv4L3Protocol object. Higher-layer protocols that have a packet
to send down to the Ipv4L3Protocol object can call
@code{GetObject<Ipv4L3Protocol> ()} to obtain a pointer, as follows:
@verbatim
Ptr<Ipv4L3Protocol> ipv4 = m_node->GetObject<Ipv4L3Protocol> ();
if (ipv4 != 0)
{
ipv4->Send (packet, saddr, daddr, PROT_NUMBER);
}
@end verbatim
This class nicely demonstrates two techniques we exploit in
ns-3 to bind objects together: callbacks, and object aggregation.
Once IPv4 has determined that a packet is for the local node, it
forwards it up the stack. This is done with the following function:
@verbatim
void
Ipv4L3Protocol::ForwardUp (Ptr<Packet> p, Ipv4Header const&ip,
Ptr<Ipv4Interface> incomingInterface)
{
NS_LOG_FUNCTION (this << p << &ip);
Ptr<Ipv4L4Demux> demux = m_node->GetObject<Ipv4L4Demux> ();
Ptr<Ipv4L4Protocol> protocol = demux->GetProtocol (ip.GetProtocol ());
protocol->Receive (p, ip.GetSource (), ip.GetDestination (), incomingInterface);
}
@end verbatim
The first step is to find the aggregated Ipv4L4Demux object. Then, this
object is consulted to look up the right Ipv4L4Protocol, based on IP protocol
number. For instance, TCP is registered in the demux as protocol number 6.
Finally, the @code{Receive()} function on the Ipv4L4Protocol (such as
@code{TcpL4Protocol::Receive} is called.
We have not yet introduced the class Ipv4Interface. Basically,
each NetDevice is paired with an IPv4 representation of such device.
In Linux, this @code{class Ipv4Interface} roughly corresponds to
the @code{struct in_device}; the main purpose is to provide
address-family specific information (addresses) about an interface.
@subsubsection Layer-4 protocols and sockets
We next describe how the transport protocols, sockets, and applications
tie together. In summary, each transport protocol implementation is
a socket factory. An application that needs a new socket
For instance, to create a UDP socket, an application would use a code
snippet such as the following:
@verbatim
Ptr<Udp> udpSocketFactory = GetNode ()->GetObject<Udp> ();
Ptr<Socket> m_socket = socketFactory->CreateSocket ();
m_socket->Bind (m_local_address);
...
@end verbatim
The above will query the node to get a pointer to its UDP socket
factory, will create one such socket, and will use the socket with
an API similar to the C-based sockets API, such as @code{Connect ()}
and @code{Send ()}. See the chapter on ns-3 sockets for more information.
We have described so far a socket factory (e.g. @code{class Udp}) and
a socket, which may be specialized (e.g., @code{class UdpSocket}).
There are a few more key objects that relate to the specialized
task of demultiplexing a packet to one or more receiving sockets.
The key object in this task is @code{class Ipv4EndPointDemux}.
This demultiplexer stores objects of @code{class Ipv4EndPoint}.
This class holds the addressing/port tuple (local port, local address,
destination port, destination address) associated with the socket,
and a receive callback. This receive callback has a receive
function registered by the socket. The @code{Lookup ()} function to
Ipv4EndPointDemux returns a list of Ipv4EndPoint objects (there may
be a list since more than one socket may match the packet). The
layer-4 protocol copies the packet to each Ipv4EndPoint and calls
its @code{ForwardUp ()} method, which then calls the @code{Receive ()}
function registered by the socket.
An issue that arises when working with the sockets API on real
systems is the need to manage the reading from a socket, using
some type of I/O (e.g., blocking, non-blocking, asynchronous, ...).
ns-3 implements an asynchronous model for socket I/O; the application
sets a callback to be notified of received data ready to be read, and the
callback is invoked by the transport protocol when data is available.
This callback is specified as follows:
@verbatim
void Socket::SetRecvCallback (Callback<void, Ptr<Socket>,
Ptr<Packet>, const Address&> receivedData);
@end verbatim
The data being received is conveyed in the Packet data buffer. An example
usage is in @code{class PacketSink}:
@verbatim
m_socket->SetRecvCallback (MakeCallback(&PacketSink::HandleRead, this));
@end verbatim
To summarize, internally, the UDP implementation is organized as follows:
@itemize @bullet
@item a @code{UdpImpl} class that implements the Udp socket factory
functionality
@item a @code{UdpL4Protocol} class that implements the protocol logic
that is socket-independent
@item a @code{UdpSocketImpl} class that implements socket-specific aspects
of UDP
@item a class called @code{Ipv4EndPoint} that stores the
addressing tuple (local port, local address, destination port, destination
address) associated with the socket, and a receive callback for the socket.
@end itemize
@subsection Internet Node interfaces
Many of the implementation details, or internal objects themselves,
of Internet Node objects are not exposed at the simulator public
API. This allows for different implementations; for instance,
replacing the native ns-3 models with ported TCP/IP stack code.
The C++ public APIs of all of these objects is found in the
@code{src/node} directory, including principally:
@itemize @bullet
@item @code{socket.h}
@item @code{tcp.h}
@item @code{udp.h}
@item @code{ipv4.h}
@end itemize
These are typically base class objects that implement the default
values used in the implementation, implement access methods to get/set
state variables, host attributes, and implement publicly-available methods
exposed to clients such as @code{CreateSocket}.
@subsection Example path of a packet
These two figures show an example stack trace of how packets flow
through the Internet Node objects.
@float Figure,fig:internet-node-send
@caption{Send path of a packet.}
@image{figures/internet-node-send,5in}
@end float
@float Figure,fig:internet-node-recv
@caption{Receive path of a packet.}
@image{figures/internet-node-recv,5in}
@end float
File diff suppressed because it is too large. Load diff
+462
View File
@@ -0,0 +1,462 @@
@c ========================================================================
@c Simulation Output
@c ========================================================================
@node Simulation Output
@chapter Simulation Output
At this point, you should be able to execute any of the built-in
programs distributed with @command{ns-3}. Next, we will look at
how to generate and tailor the simulation output, before turning
to how to modify simulation scripts to do different things.
@node Tracing Basics
@section Tracing Basics
The whole point of simulation is to generate output for further
study, and the @command{ns-3} tracing system is a primary
mechanism for this.
Since @command{ns-3} is a C++ program, standard facilities for
generating output from C++ programs apply:
@verbatim
#include <iostream>
...
int main ()
{
...
std::cout << "The value of x is " << x << std::endl;
...
}
@end verbatim
The goal of the @command{ns-3} tracing system is to
provide a structured way to configure the simulator to output results
in standard or modifiable formats.
@itemize @bullet
@item For basic tasks, the tracing system should allow the user to
generate standard tracing for popular tracing sources, and to customize
which objects generate the tracing.
@item Intermediate users will be able to extend the tracing system to
modify the output format generated, or to insert new tracing sources,
without modifying the core of the simulator.
@item Advanced users can modify the simulator core to add new
tracing sources and sinks.
@end itemize
The @command{ns-3} tracing system is fundamentally built on the
concept of separating tracing sources from sinks.
@enumerate
@item Trace sources (e.g., provide access to every packet received)
@item Trace sinks (e.g., print out the packet)
@item A mechanism to tie together sources and sinks
@end enumerate
The rationale for this division is to allow users to attach new
types of sinks to existing tracing sources, without requiring
users to edit and recompile the core of the simulator.
Thus, in the example above, a user could write a new tracing sink
and attach it to an existing tracing source. What remains to
be defined is a way for users to find these hooks (tracing sources)
and attach sinks to them. A new tracing namespace is defined for
this purpose.
We will first walk through how some pre-defined sources and sinks
are provided and may be customized with little user effort. We
return later in this chapter to advanced tracing configuration including
extending the tracing namespace and creating new tracing sources.
@subsection ASCII tracing
@cindex ASCII
For Internet nodes, the ASCII trace wrapper is a wrapper around
the @command{ns-3} low-level
tracing system that lets you get access to underlying trace events easily.
The output of a trace of a simulation run is an ASCII file --- thus the name.
In the spririt of keeping things simple, you won't be able to control or
configure the output at this stage.
For those familiar with @command{ns-2} output, this type of trace is
analogous to the @command{out.tr} generated by many scripts.
@cindex tracing packets
Let's just jump right in. As usual, we need to include the definitions
related to using ASCII tracing (don't edit any files quite yet):
@verbatim
#include "ns3/ascii-trace.h"
@end verbatim
We then need to add the code to the script to actually enable the ASCII tracing
code. The following code must be inserted before the call to
@code{Simulator::Run ();}:
@verbatim
AsciiTrace asciitrace ("tutorial.tr");
asciitrace.TraceAllQueues ();
asciitrace.TraceAllNetDeviceRx ();
@end verbatim
The first line declares an object of type @code{AsciiTrace} named
@code{asciitrace} and passes a string parameter to its constructor. This
parameter is a file name to which all of the trace information will be written.
The second line, @code{asciitrace.TraceAllQueues ();} asks the trace object to
arrange that all queue operations (enqueue, dequeue, drop) on the queues
in all of the nodes of the system be traced. On the receive side,
@code{asciitrace.TraceAlllNetDeviceRx ()} traces packets received by
a NetDevice. For those familiar with @command{ns-2}, these are equivalent
to the popular trace points that log "+", "-", "d", and "r" events.
Try running the following program from the command line:
@verbatim
./waf --run tutorial-csma-echo-ascii-trace
@end verbatim
@cindex tutorial.tr
Just as you have seen previously, you will see some messages from @emph{Waf}
and then the ``Compilation finished successfully'' message. The
next message, @code{UDP Echo Simulation} is from the running program. When
it ran, the program will have created a file named @code{tutorial.tr}.
Because of the way that Waf works, the file is not created in the local
directory, it is created at the top-level directory of the repository. So,
change into the top level directory and take a look at the file
@code{tutorial.tr} in your favorite editor.
@subsubsection Parsing Ascii Traces
@cindex parsing ascii traces
This section parses in detail the structure of the ascii tracing
output. If you find this output format self explanatory (it
resembles tcpdump output), you may skip to the next
section on pcap tracing.
@cindex trace event
There's a lot of information there in a pretty dense form, but the first thing
to notice is that there are a number of distinct lines in this file. It may
be difficult to see this clearly unless you widen your windows considerably.
Each line in the file corresponds to a @emph{trace event}. A trace event
happens whenever specific conditions happen in the simulation. In this case
we are tracing events on the @emph{device queue} present in every net device
on every node in the simulation. The device queue is a queue through which
every packet destined for a channel must pass --- it is the device
@emph{transmit} queue. Note that each line in the trace file begins with a
lone character (has a space after it). This character will have the following
meaning:
@cindex enqueue
@cindex dequeue
@cindex drop
@itemize @bullet
@item @code{+}: An enqueue operation occurred on the device queue;
@item @code{-}: A dequeue operation occurred on the device queue;
@item @code{d}: A packet was dropped, typically because the queue was full.
@end itemize
Let's take a more detailed view of the first line. I'll break it down into
sections (indented for clarity) with a two digit reference number on the
left side:
@verbatim
00 +
01 2
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=9
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:00,
09 destination=ff:ff:ff:ff:ff:ff
10 ARP(request
11 source mac: 08:00:2e:00:00:00
12 source ipv4: 10.1.1.1
13 dest ipv4: 10.1.1.2)
14 ETHERNET fcs=0
@end verbatim
@cindex trace event
@cindex simulation time
The first line of this expanded trace event (reference number 00) is the
queue operation. We have a @code{+} character, so this corresponds to an
@emph{enqueue} operation. The second line (reference 01) is the simulation
time expressed in seconds. You may recall that we asked the
@code{UdpEchoClient} to start sending packets at two seconds. Here we see
confirmation that this is, indeed, happening.
@cindex node number
@cindex net device number
@cindex smart pointer
The next lines of the example listing (references 02 and 03) tell us that
this trace event originated in a given node and net device. Each time a node
is created it is given an identifying number that monotonically increases from
zero. Therefore, @code{nodeid=0} means that the node in which the given trace
event originated is the first node we created. In the case of our script,
this first node is is the node pointed to by the smart pointer @code{n0}. Not
too surpsisingly, this is also the node to which we attached the
@code{UdpEchoClient}. The device number is local to each node, and so the
device given by @code{device=0} is the first net device that we added to the
node in question. In our simulation, this corresponds to the
@code{CsmaNetDevice} we added to node zero (@code{n0}).
@cindex uid
@cindex unique ID
@cindex packet
The next line (reference 04) is a more readable form of the operation code
seen in the first line --- i.e., the character @code{+} means
@code{queue-enqueue}. Reference number 05 indicates that the @emph{unique id}
of the packet being enqueued is @code{9}. The fact that the first packet we
see has a unique ID of 9 should indicates to you that other things have
happened in the protocol stack before we got to this point. This will become
clear momentarily.
@cindex Ethernet
@cindex MAC address
Reference items 06 and 14 indicate that this is an Ethernet packet with
a zero (not computed) checksum (note the indentation to make parsing this
trace event a little easier). Reference 08 and 09 are the source and
destination addresses of this packet. The packet is from the MAC address we
assigned to the node zero net device in the script, and is destined for the
broadcast address --- this is a broadcast packet.
@cindex Address Resolution Protocol
@cindex ARP
@cindex ARP|request
Reference items 10 through 13 make clear what is happening. This is an ARP
(Address Resolution Protocol) request for the MAC address of the node on
which the @code{UdpEchoServer} resides. The protocol stack can't send a UDP
packet to be echoed until it knows (resolves) the MAC address; and this trace
event corresponds to an ARP request being queued for transmission to the local
network. The next line in the trace file (partially expanded),
@verbatim
00 -
01 2
02 nodeid=0
03 device=0
04 queue-dequeue
05 pkt-uid=9
...
@end verbatim
shows the (same) ARP request packet being dequeued from the device queue by
the net device and (implicitly) being sent down the channel to the broadcast
MAC address. We are not tracing net device reception events so we don't
actually see all of the net devices receiving the broadcast packet. We do,
however see the following in the third line of the trace file:
@verbatim
00 +
01 2.00207
02 nodeid=1
03 device=0
04 queue-enqueue
05 pkt-uid=10
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:01,
09 destination=08:00:2e:00:00:00,
10 ARP(reply
11 source mac: 08:00:2e:00:00:01
12 source ipv4: 10.1.1.2
13 dest mac: 08:00:2e:00:00:00
14 dest ipv4: 10.1.1.1)
15 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex ARP|response
Notice that this is a queue-enqueue operation (references 00 and 04) happening
on node one (reference 02) at simulation time 2.00207 seconds (reference 01).
Looking at the packet payload (references 10-14) we see that this is an ARP
reply to the request sent by node one. Note that the simulation time
(reference 01) is now 2.00207 seconds. This is direct result of the data rate
(5 mb/s) and latency (2 ms) parameters that we passed to the
@code{CsmaChannel} when we created it. Clearly the ARP request packet was
sent over the channel and received approximately 2 ms later by node one. A
corresponding ARP response packet was created and enqueued on node one's net
device. It is this enqueue trace event that has being logged.
@cindex queue
@cindex queue|transmit
@cindex echo
Given the current state of affairs, the next thing you may expect to see is
this ARP request being received by node zero, but remember we are only looking
at trace events on the device @emph{transmit} queue. The reception of the ARP
response by node zero will not directly trigger any trace event in this case,
but it will enable the protocol stack to continue what it was originally doing
(trying to send an echo packet). Thus, the next line we see in the trace file
(@code{tutorial.tr}) is the first UDP echo packet being sent to the net device.
@verbatim
00 +
01 2.00415
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=7
06 ETHERNET
07 length/type=0x800,
08 source=08:00:2e:00:00:00,
09 destination=08:00:2e:00:00:01
10 IPV4(
11 tos 0x0
12 ttl 64
13 id 0
14 offset 0
15 flags [none]
16 length: 1052) 10.1.1.1 > 10.1.1.2
17 UDP(length: 1032)
18 49153 > 7
19 DATA (length 1024)
20 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex echo
@cindex ARP
@cindex ARP|request
@cindex ARP|response
@cindex IP
@cindex Ipv4
I won't go into too much detail about this packet, but I will point out a
few key items in the trace. First, the packet was enqueued at simulation time
of 2.00415 seconds. This time reflects the fact that the echo client
application started at 2. seconds and there were two ARP packets transmitted
across the network (two milliseconds + data transmission time each way). The
packet unique identifier (reference 05) is 7. Notice that this is a lower
number than the ARP request packet, which had a unique ID of 9. This tells
us that the UDP packet was actually created before the ARP request packet ---
which makes perfect sense since it was the attempt to send packet 7 that
triggered sending the ARP request packet 9. Note that this an Ethernet
packet (reference 06) like all other packets in this simulation, however this
particular packet carries an IPV4 payload and therefore has an IP version 4
header (indicated by references 10-16). This Ipv4 in turn contains a UDP
header (references 17, 18) and finally 1024 bytes of data (reference 20).
Clearly, this is the UDP echo packet emitted by the
@code{UdpEchoClient Application}.
The next trace event is an ARP request from node one. We can infer that node
one has received the UDP echo packet and the @code{UdpEchoServer Application}
on that node has turned the packet around. Just as node zero needed to ARP
for the MAC address of node one, now node one must ARP for the MAC address of
node zero. We see the ARP request enqueued on the transmit queue of node one;
then we see the ARP request dequeued from the tranmit queue of node one (and
implicitly transmitted to node zero). Then we see an ARP response enqueued
on the transmit queue of node zero; and finally the ARP response dequeued (and
implicitly transmitted back to node one).
This exchange is summarized in the following trace event excerpts,
@verbatim
+ 2.00786 nodeid=1 ... ARP(request ...
- 2.00786 nodeid=1 ... ARP(request ...
+ 2.00994 nodeid=0 ... ARP(reply ...
- 2.00994 nodeid=0 ... ARP(reply ...
@end verbatim
The final two trace events in the @code{tutorial.tr} file correspond to the
echoed packet being enqueued for transmission on the net device for node one,
and that packet being dequeued (and implicitly transmitted back to node zero).
@cindex AsciiTrace!TraceAllNetDeviceRx
@cindex ARP!request
If you look at the trace file (@code{tutorial.tr}) you will also see some
entries with an @code{r} event, indicating a
@emph{receive} trace event. Recall that the first packet sent on the network
was a broadcast ARP request. We should then see all four nodes receive a
copy of this request. This is the case, as the first four receive trace
events are,
@verbatim
r 2.00207 nodeid=0 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=1 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=2 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=3 device=0 dev-rx pkt-uid=9 ARP(request ...
@end verbatim
@cindex unique ID
You can see that a copy of the broadcast packet with unique ID 9 was received
by the net devices on nodes 0, 1, 2 and 3. We leave it up to you to parse the
rest of the trace file and understand the remaining reception events.
@subsection PCAP Trace Wrapper
@cindex pcap
@cindex Wireshark
The @command{ns-3} @emph{pcap trace wrapper} is used to create trace files in
@code{.pcap} format. The acronym pcap (usually written in lower case) stands
for @emph{p}acket @emph{cap}ture, and is actually an API that includes the
definition of a @code{.pcap} file format. The most popular program that can
read and display this format is Wireshark (formerly called Ethereal).
However, there are many traffic trace analyzers that use this packet
format, including X, Y, and Z. We encourage users to exploit the
many tools available for analyzing pcap traces; below, we show how
tcpdump and Wireshark can be used..
@cindex tutorial-csma-echo-ascii-trace.cc
@cindex tutorial-csma-echo-pcap-trace.cc
The code used to enable pcap tracing is similar to that for ASCII tracing.
We have provided another file, @code{tutorial-csma-echo-pcap-trace.cc} that
uses the pcap trace wrapper. We have added the code to include the pcap
trace wrapper defintions:
@verbatim
#include "ns3/pcap-trace.h"
@end verbatim
And then added the following code below the AsciiTrace methods:
@cindex PcapTrace
@cindex PcapTrace!TraceAllIp
@verbatim
PcapTrace pcaptrace ("tutorial.pcap");
pcaptrace.TraceAllIp ();
@end verbatim
The first line of the code immediately above declares an object of type
@code{PcapTrace} named @code{pcaptrace} and passes a string parameter to its
constructor. This object is used to hide the details of the actual tracing
subsystem. The parameter is a base file name from which the actual trace file
names will be built. The second line of code tells the @code{PcamTrace}
object to trace all IP activity in all of the nodes present in the simulation.
@cindex interface index
Trace files are not created until trace activity is detected. Each file name
is composed of the base file name, followed by a @code{'-'}, a node id followed
by a @code{'-}', and an IP interface index. You will soon see a file named
@code{tutorial.pcap-0-1}, for example. This will be the trace file generated
as events are detected on node zero, interface index one. N.B. Interface
indices are different that net device indices --- interface index zero
corresponds to the loopback interface and interface index one corresponds to
the first net device you added to a node.
You may run the new program just like all of the others so far:
@cindex Waf
@verbatim
./waf --run tutorial-csma-echo-pcap-trace
@end verbatim
If you look at the top level directory of your distribution, you should now
see three log files: @code{tutorial.tr} is the ASCII trace file we have
previously examined. @code{tutorial.pcap-0-1} and @code{tutorial.pcap-1-1}
are the new pcap files we just generated. There will not be files
corresponding to nodes two and three since we have not sent any IP packets to
those nodes.
@subsubsection Reading output with tcpdump
@cindex tcpdump
@subsubsection Reading output with Wireshark
@cindex Wireshark
If you are unfamilar with Wireshark, there is a web site available from which
you can download programs and documentation: @uref{http://www.wireshark.org/}.
If you have Wireshark available, you can open each of the trace files and
display the contents as if you had captured the packets using a
@emph{packet sniffer}. Note that only IP packets are traced using this
wrapper, so you will not see the ARP exchanges that were logged when using
the ASCII trace wrapper. You are encouraged to take a look at the contents
of these pcap files using your favorite pcap software (or Wireshark).
@node Advanced Tracing
@section Advanced Tracing
+620
View File
@@ -0,0 +1,620 @@
@node Packets
@chapter Packets
The design of the Packet framework of @emph{ns} was heavily guided by a few
important use-cases:
@itemize @bullet
@item avoid changing the core of the simulator to introduce
new types of packet headers or trailers
@item maximize the ease of integration with real-world code
and systems
@item make it easy to support fragmentation, defragmentation,
and, concatenation which are important, especially in wireless systems.
@item make memory management of this object efficient
@item allow actual application data or dummy application bytes for
emulated applications
@end itemize
@emph{ns} Packet objects contain a buffer of bytes: protocol headers and
trailers are serialized in this buffer of bytes using user-provided
serialization and deserialization routines. The content of this byte
buffer is expected to match bit-for-bit the content of a real packet on
a real network implementing the protocol of interest.
Fragmentation and defragmentation are quite natural to implement within
this context: since we have a buffer of real bytes, we can split it in
multiple fragments and re-assemble these fragments. We expect that this
choice will make it really easy to wrap our Packet data structure within
Linux-style skb or BSD-style mbuf to integrate real-world kernel code in
the simulator. We also expect that performing a real-time plug of the
simulator to a real-world network will be easy.
Because we understand that simulation developers often wish to store in
packet objects data which is not found in the real packets (such as
timestamps or any kind of similar in-band data), the @emph{ns} Packet class
can also store extra per-packet "Tags" which are 16 bytes blobs of data.
Any Packet can store any number of unique Tags, each of which is
uniquely identified by its C++ type. These tags make it easy to attach
per-model data to a packet without having to patch the main Packet
class or Packet facilities.
Memory management of Packet objects is entirely automatic and extremely
efficient: memory for the application-level payload can be modelized by
a virtual buffer of zero-filled bytes for which memory is never allocated
unless explicitely requested by the user or unless the packet is fragmented.
Furthermore, copying, adding, and, removing headers or trailers to a packet
has been optimized to be virtually free through a technique known as
Copy On Write.
Packets (messages) are fundamental objects in the simulator and
their design is important from a performance and resource management
perspective. There
are various ways to design the simulation packet, and tradeoffs
among the different approaches. In particular, there is a
tension between ease-of-use, performance, and safe interface
design.
There are a few requirements on this object design:
@itemize @bullet
@item Creation, management, and deletion of this object
should be as simple as possible, while avoiding the
chance for memory leaks and/or heap corruption;
@item Packets should support serialization and deserialization
so that network emulation is supported;
@item Packets should support fragmentation and concatenation
(multiple packets in a data link frame), especially for wireless
support;
@item It should be natural for packets to carry actual application
data, or if there is only an emulated application and there is
no need to carry dummy bytes, smaller packets could be used with
just the headers and a record of the payload size, but not actual
application bytes, conveyed in the simulated packet.
@item Packets should facilitate BSD-like operations on mbufs, for
support of ported operating system stacks.
@item Additional side-information should be supported, such as
a tag for cross-layer information.
@end itemize
@section Packet design overview
Unlike @emph{ns-2}, in which Packet objects contain a buffer of C++
structures corresponding to protocol headers, each network packet in
@emph{ns-3} contains a byte Buffer and a list of Tags:
@itemize @bullet
@item The byte buffer stores the serialized content of the chunks
added to a packet. The serialized representation of these chunks is
expected to match that of real network packets bit for bit
(although nothing forces you to do this) which means that the content
of a packet buffer is expected to be that of a real packet.
Packets can also be created with an arbitrary zero-filled payload
for which no real memory is allocated.
@item The list of tags stores an arbitrarily large set of arbitrary
user-provided data structures in the packet. Each Tag is uniquely
identified by its type; only one instance of each
type of data structure is allowed in a list of tags. These tags typically
contain per-packet cross-layer information or flow identifiers (i.e.,
things that you wouldn't find in the bits on the wire). Each tag
stored in the tag list can be at most 16 bytes.
Trying to attach bigger data structures will trigger
crashes at runtime. The 16 byte limit is a modifiable compilation
constant.
@end itemize
@float Figure,fig:packets
@caption{Implementation overview of Packet class.}
@image{figures/packet}
@end float
Figure @ref{fig:packets} is a high-level overview of the Packet
implementation; more detail on the byte Buffer implementation
is provided later in Figure @ref{fig:buffer}.
In \nsthree, the Packet byte buffer is analogous to a Linux skbuff
or BSD mbuf; it is a serialized representation of the actual
data in the packet. The tag list is a container for extra
items useful for simulation convenience; if a Packet is converted
to an emulated packet and put over an actual network, the tags
are stripped off and the byte buffer is copied directly
into a real packet.
The Packet class has value semantics: it can be freely copied around,
allocated on the stack, and passed to functions as arguments. Whenever
an instance is copied, the full underlying data is not copied; it
has ``copy-on-write'' (COW) semantics. Packet instances can be passed
by value to function arguments without any performance hit.
The fundamental classes for adding to and removing from the byte
buffer are @code{class Header} and @code{class Trailer}.
Headers are more common but the below discussion also largely applies to
protocols using trailers. Every protocol header that needs to
be inserted and removed from a Packet instance should derive from
the abstract Header base class and implement the private pure
virtual methods listed below:
@itemize @bullet
@item @code{ns3::Header::SerializeTo()}
@item @code{ns3::Header::DeserializeFrom()}
@item @code{ns3::Header::GetSerializedSize()}
@item @code{ns3::Header::PrintTo()}
@end itemize
Basically, the first three functions are used to serialize and deserialize
protocol control information to/from a Buffer. For example,
one may define @code{class TCPHeader : public Header}. The
TCPHeader object will typically consist of some private data
(like a sequence number) and public interface access functions
(such as checking the bounds of an input). But the underlying
representation of the TCPHeader in a Packet Buffer is 20 serialized
bytes (plus TCP options). The TCPHeader::SerializeTo() function would
therefore be designed to write these 20 bytes properly into
the packet, in network byte order. The last function is used
to define how the Header object prints itself onto an output stream.
Similarly, user-defined Tags can be appended to the packet.
Unlike Headers, Tags are not serialized into a contiguous buffer
but are stored in an array. By default, Tags are limited to 16 bytes in
size. Tags can be flexibly defined to be any type, but there
can only be one instance of any particular object type in
the Tags buffer at any time. The implementation makes use
of templates to generate the proper set of Add(), Remove(),
and Peek() functions for each Tag type.
@section Packet interface
The public member functions of a Packet object are as follows:
@subsection Constructors
@verbatim
/**
* Create an empty packet with a new uid (as returned
* by getUid).
*/
Packet ();
/**
* Create a packet with a zero-filled payload.
* The memory necessary for the payload is not allocated:
* it will be allocated at any later point if you attempt
* to fragment this packet or to access the zero-filled
* bytes. The packet is allocated with a new uid (as
* returned by getUid).
*
* \param size the size of the zero-filled payload
*/
Packet (uint32_t size);
@end verbatim
@subsection Adding and removing Buffer data
The below code is reproduced for Header class only; similar functions
exist for Trailers.
@verbatim
/**
* Add header to this packet. This method invokes the
* ns3::Header::serializeTo method to request the header to serialize
* itself in the packet buffer.
*
* \param header a reference to the header to add to this packet.
*/
void Add (Header const &header);
/**
* Deserialize header from this packet. This method invokes the
* ns3::Header::deserializeFrom method to request the header to deserialize
* itself from the packet buffer. This method does not remove
* the data from the buffer. It merely reads it.
*
* \param header a reference to the header to deserialize from the buffer
*/
void Peek (Header &header);
/**
* Remove a deserialized header from the internal buffer.
* This method removes the bytes read by Packet::peek from
* the packet buffer.
*
* \param header a reference to the header to remove from the internal buffer.
*/
void Remove (Header const &header);
/**
* Add trailer to this packet. This method invokes the
* ns3::Trailer::serializeTo method to request the trailer to serialize
* itself in the packet buffer.
*
* \param trailer a reference to the trailer to add to this packet.
*/
@end verbatim
@subsection Adding and removing Tags
@verbatim
/**
* Attach a tag to this packet. The tag is fully copied
* in a packet-specific internal buffer. This operation
* is expected to be really fast.
*
* \param tag a pointer to the tag to attach to this packet.
*/
template <typename T>
void AddTag (T const &tag);
/**
* Remove a tag from this packet. The data stored internally
* for this tag is copied in the input tag if an instance
* of this tag type is present in the internal buffer. If this
* tag type is not present, the input tag is not modified.
*
* This operation can be potentially slow and might trigger
* unexpectedly large memory allocations. It is thus
* usually a better idea to create a copy of this packet,
* and invoke removeAllTags on the copy to remove all
* tags rather than remove the tags one by one from a packet.
*
* \param tag a pointer to the tag to remove from this packet
* \returns true if an instance of this tag type is stored
* in this packet, false otherwise.
*/
template <typename T>
bool RemoveTag (T &tag);
/**
* Copy a tag stored internally to the input tag. If no instance
* of this tag is present internally, the input tag is not modified.
*
* \param tag a pointer to the tag to read from this packet
* \returns true if an instance of this tag type is stored
* in this packet, false otherwise.
*/
template <typename T>
bool PeekTag (T &tag) const;
/**
* Remove all the tags stored in this packet. This operation is
* much much faster than invoking removeTag n times.
*/
void RemoveAllTags (void);
@end verbatim
@subsection Fragmentation
@verbatim
/**
* Create a new packet which contains a fragment of the original
* packet. The returned packet shares the same uid as this packet.
*
* \param start offset from start of packet to start of fragment to create
* \param length length of fragment to create
* \returns a fragment of the original packet
*/
Packet CreateFragment (uint32_t start, uint32_t length) const;
/**
* Concatenate the input packet at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet packet to concatenate
*/
void addAtEnd (Packet packet);
/oncatenate the input packet at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet packet to concatenate
*/
void AddAtEnd (Packet packet);
/**
* Concatenate the fragment of the input packet identified
* by the offset and size parameters at the end of the current
* packet. This does not alter the uid of either packet.
*
* \param packet to concatenate
* \param offset offset of fragment to copy from the start of the input packet
* \param size size of fragment of input packet to copy.
*/
void AddAtEnd (Packet packet, uint32_t offset, uint32_t size);
/**
* Remove size bytes from the end of the current packet
* It is safe to remove more bytes that what is present in
* the packet.
*
* \param size number of bytes from remove
*/
void RemoveAtEnd (uint32_t size);
/**
* Remove size bytes from the start of the current packet.
* It is safe to remove more bytes that what is present in
* the packet.
*
* \param size number of bytes from remove
*/
void RemoveAtStart (uint32_t size);
@end verbatim
@subsection Miscellaneous
@verbatim
/**
* \returns the size in bytes of the packet (including the zero-filled
* initial payload)
*/
uint32_t GetSize (void) const;
/**
* If you try to change the content of the buffer
* returned by this method, you will die.
*
* \returns a pointer to the internal buffer of the packet.
*/
uint8_t const *PeekData (void) const;
/**
* A packet is allocated a new uid when it is created
* empty or with zero-filled payload.
*
* \returns an integer identifier which uniquely
* identifies this packet.
*/
uint32_t GetUid (void) const;
@end verbatim
@section Using Headers
@emph{walk through an example of adding a UDP header}
@section Using Tags
@emph{walk through an example of adding a flow ID}
@section Using Fragmentation
@emph{walk through an example of link-layer fragmentation/reassembly}
@section Sample program
The below sample program (from @code{ns3/samples/main-packet.cc}) illustrates
some use of the Packet, Header, and Tag classes.
@verbatim
/* -*- Mode:C++; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
#include "ns3/packet.h"
#include "ns3/header.h"
#include <iostream>
using namespace ns3;
/* A sample Header implementation
*/
class MyHeader : public Header {
public:
MyHeader ();
virtual ~MyHeader ();
void SetData (uint16_t data);
uint16_t GetData (void) const;
private:
virtual void PrintTo (std::ostream &os) const;
virtual void SerializeTo (Buffer::Iterator start) const;
virtual void DeserializeFrom (Buffer::Iterator start);
virtual uint32_t GetSerializedSize (void) const;
uint16_t m_data;
};
MyHeader::MyHeader ()
{}
MyHeader::~MyHeader ()
{}
void
MyHeader::PrintTo (std::ostream &os) const
{
os << "MyHeader data=" << m_data << std::endl;
}
uint32_t
MyHeader::GetSerializedSize (void) const
{
return 2;
}
void
MyHeader::SerializeTo (Buffer::Iterator start) const
{
// serialize in head of buffer
start.WriteHtonU16 (m_data);
}
void
MyHeader::DeserializeFrom (Buffer::Iterator start)
{
// deserialize from head of buffer
m_data = start.ReadNtohU16 ();
}
void
MyHeader::SetData (uint16_t data)
{
m_data = data;
}
uint16_t
MyHeader::GetData (void) const
{
return m_data;
}
/* A sample Tag implementation
*/
struct MyTag {
uint16_t m_streamId;
};
static TagRegistration<struct MyTag> g_MyTagRegistration ("ns3::MyTag", 0);
static void
Receive (Packet p)
{
MyHeader my;
p.Peek (my);
p.Remove (my);
std::cout << "received data=" << my.GetData () << std::endl;
struct MyTag myTag;
p.PeekTag (myTag);
}
int main (int argc, char *argv[])
{
Packet p;
MyHeader my;
my.SetData (2);
std::cout << "send data=2" << std::endl;
p.Add (my);
struct MyTag myTag;
myTag.m_streamId = 5;
p.AddTag (myTag);
Receive (p);
return 0;
}
@end verbatim
@section Implementation details
@subsection Private member variables
A Packet object's interface provides access to some private
data:
@verbatim
Buffer m_buffer;
Tags m_tags;
uint32_t m_uid;
static uint32_t m_global_uid;
@end verbatim
Each Packet has a Buffer and a Tags object, and a 32-bit unique ID (m\_uid).
A static member variable keeps track of the UIDs allocated. Note
that real network packets do not have a UID; the UID is therefore an
instance of data that normally would be stored as a Tag in the packet.
However, it was felt that a UID is a special case that is so often
used in simulations that it would be more convenient to store it
in a member variable.
@subsection Buffer implementation
Class Buffer represents a buffer of bytes. Its size is
automatically adjusted to hold any data prepended
or appended by the user. Its implementation is optimized
to ensure that the number of buffer resizes is minimized,
by creating new Buffers of the maximum size ever used.
The correct maximum size is learned at runtime during use by
recording the maximum size of each packet.
Authors of new Header or Trailer classes need to know the public
API of the Buffer class. (add summary here)
The byte buffer is implemented as follows:
@verbatim
struct BufferData {
uint32_t m_count;
uint32_t m_size;
uint32_t m_initialStart;
uint32_t m_dirtyStart;
uint32_t m_dirtySize;
uint8_t m_data[1];
};
struct BufferData *m_data;
uint32_t m_zeroAreaSize;
uint32_t m_start;
uint32_t m_size;
@end verbatim
@itemize @bullet
@item @code{BufferData::m_count}: reference count for BufferData structure
@item @code{BufferData::m_size}: size of data buffer stored in BufferData structure
@item @code{BufferData::m_initialStart}: offset from start of data buffer where data was first inserted
@item @code{BufferData::m_dirtyStart}: offset from start of buffer where every Buffer which holds a reference to this BufferData instance have written data so far
@item @code{BufferData::m_dirtySize}: size of area where data has been written so far
@item @code{BufferData::m_data}: pointer to data buffer
@item @code{Buffer::m_zeroAreaSize}: size of zero area which extends before @code{m_initialStart}
@item @code{Buffer::m_start}: offset from start of buffer to area used by this buffer
@item @code{Buffer::m_size}: size of area used by this Buffer in its BufferData structure
@end itemize
@float Figure,fig:buffer
@caption{Implementation overview of a packet's byte Buffer.}
@image{figures/buffer,15cm}
@end float
This data structure is summarized in Figure @ref{fig:buffer}.
Each Buffer holds a pointer to an instance of a BufferData. Most
Buffers should be able to share the same underlying BufferData and
thus simply increase the BufferData's reference count. If they have to
change the content of a BufferData inside the Dirty Area, and if the
reference count is not one, they first create a copy of the BufferData and
then complete their state-changing operation.
@subsection Tags implementation
Tags are implemented by a single pointer which points to the start of a
linked list ofTagData data structures. Each TagData structure points
to the next TagData in the list (its next pointer contains zero to
indicate the end of the linked list). Each TagData contains an integer
unique id which identifies the type of the tag stored in the TagData.
@verbatim
struct TagData {
struct TagData *m_next;
uint32_t m_id;
uint32_t m_count;
uint8_t m_data[Tags::SIZE];
};
class Tags {
struct TagData *m_next;
};
@end verbatim
Adding a tag is a matter of inserting a new TagData at the head of
the linked list. Looking at a tag requires you to find the relevant
TagData in the linked list and copy its data into the user data
structure. Removing a tag and updating the content of a tag
requires a deep copy of the linked list before performing this operation.
On the other hand, copying a Packet and its tags is a matter of
copying the TagData head pointer and incrementing its reference count.
Tags are found by the unique mapping betweent the Tag type and
its underlying id. This is why at most one instance of any Tag
can be stored in a packet. The mapping between Tag type and
underlying id is performed by a registration as follows:
@verbatim
/* A sample Tag implementation
*/
struct MyTag {
uint16_t m_streamId;
};
@end verbatim
@emph{add description of TagRegistration for printing}
@subsection Memory management
@emph{Describe free list.}
@emph{Describe dataless vs. data-full packets.}
@subsection Copy-on-write semantics
The current implementation of the byte buffers and tag list is based
on COW (Copy On Write). An introduction to COW can be found in Scott
Meyer's "More Effective C++", items 17 and 29). This design feature
and aspects of the public interface borrows from the packet design
of the Georgia Tech Network Simulator.
This implementation of COW uses a customized reference counting
smart pointer class.
What COW means is that
copying packets without modifying them is very cheap (in terms of CPU
and memory usage) and modifying them can be also very cheap. What is
key for proper COW implementations is being
able to detect when a given modification of the state of a packet triggers
a full copy of the data prior to the modification: COW systems need
to detect when an operation is ``dirty'' and must therefore invoke
a true copy.
Dirty operations:
@itemize @bullet
@item Packet::RemoveTag()
@item Packet::Add()
@item both versions of ns3::Packet::AddAtEnd()
@end itemize
Non-dirty operations:
@itemize @bullet
@item Packet::AddTag()
@item Packet::RemoveAllTags()
@item Packet::PeekTag()
@item Packet::Peek()
@item Packet::Remove()
@item Packet::CreateFragment()
@item Packet::RemoveAtStart()
@item Packet::RemoveAtEnd()
@end itemize
Dirty operations will always be slower than non-dirty operations,
sometimes by several orders of magnitude. However, even the
dirty operations have been optimized for common use-cases which
means that most of the time, these operations will not trigger
data copies and will thus be still very fast.
+304
View File
@@ -0,0 +1,304 @@
@anchor{chap:rv}
@node Random variables
@chapter Random variables
ns-3 contains a built-in pseudo-random number generator (PRNG).
It is important for serious users of the simulator to understand
the functionality, configuration, and usage of this PRNG, and
to decide whether it is sufficient for his or her research use.
@node Quick Overview
@section Quick Overview
ns-3 random numbers are provided via instances of @code{class RandomVariable}.
@itemize @bullet
@item @strong{by default, ns-3 simulations use a random seed}; if there is any
randomness in the simulation, each run of the program will yield different results. To use a fixed seed, users must call
@code{RandomVariable::UseGlobalSeed ()} at the beginning of the program;
see section @xref{Seeding and independent replications}
@item each RandomVariable used in ns-3 has a virtual random number
generator associated with it; all random variables use either a fixed
or random seed based on the use of the global seed (previous bullet);
@item if you intend to perform multiple runs of the same scenario, with
different random numbers, please be sure to read the section on how to
perform independent replications: @xref{Seeding and independent replications}.
@end itemize
Read further for more explanation about the random number facility for
ns-3.
@node Background
@section Background
Simulations use a lot of random numbers; the study in [cite]
found that most network simulations spend as much as 50%
of the CPU generating random numbers. Simulation users need
to be concerned with the quality of the (pseudo) random numbers and
the independence between different streams of random numbers.
Users need to be concerned with a few issues, such as:
@itemize @bullet
@item the seeding of the random number generator and whether a
simulation run is deterministic or not,
@item how to acquire different streams of random numbers that are
independent from one another, and
@item how long it takes for streams to cycle
@end itemize
We will introduce a few terms here: a RNG provides a long sequence
of (pseudo) random numbers.
The length of this sequence is called the @emph{cycle length}
or @emph{period}, after which the RNG will repeat itself.
This sequence can
be partitioned into disjoint @emph{streams}. A stream of a
RNG is a contiguous subset or block of the RNG sequence.
For instance, if the
RNG period is of length N, and two streams are provided from this
RNG, then
the first stream might use the first N/2 values and the second
stream might produce the second N/2 values. An important property
here is that the two streams are uncorrelated. Likewise, each
stream can be partitioned disjointly to a number of
uncorrelated @emph{substreams}. The underlying RNG hopefully
produces a pseudo-random sequence of numbers with a very long
cycle length, and partitions this into streams and substreams in an
efficient manner.
ns-3 uses the same underlying random number generator as does
ns-2: the MRG32k3a generator from Pierre L'Ecuyer. A
detailed description can be found in
@uref{http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf,,}.
The MRG32k3a generator provides 1.8x10^19 independent
streams of random numbers, each of which consists of
2.3x10^15 substreams. Each substream has a period
(@emph{i.e.}, the number of random numbers before overlap) of
7.6x10^22. The period of the entire generator is
3.1x10^57. Figure ref-streams provides a graphical idea of
how the streams and substreams fit together.
Class @code{ns3::RandomVariable} is the public interface to this
underlying random number generator. When users create new
RandomVariables (such as UniformVariable, ExponentialVariable,
etc.), they create an object that uses one of the distinct, independent
streams of the random number generator. Therefore, each
object of type RandomVariable has, conceptually, its own "virtual" RNG.
Furthermore, each RandomVariable can be configured to use
one of the set of substreams drawn from the main stream.
An alternate implementation would be to allow each RandomVariable
to have its own (differently seeded) RNG. However, we cannot
guarantee as strongly that the different sequences would be
uncorrelated in such a case; hence, we prefer to use a single RNG
and streams and substreams from it.
@anchor{chap:rv:indeprep}
@node Seeding and independent replications
@section Seeding and independent replications
ns-3 simulations can be configured to produce deterministic or
random results. If the ns-3 simulation is configured to use
a fixed, deterministic seed with the same run number, it should give
the same output each time it is run.
By default, ns-3 simulations use random seeds where the seeding
is drawn from @code{/dev/random} (if it is available) or else from
the time of day. A user who wants to fix the initial seeding
of the PRNG must call the following static method during simulation
configuration:
@verbatim
RandomVariable::UseGlobalSeed (uint32_t s0, s1, s2, s3, s4, s5);
@end verbatim
where the six parameters are each of type uint32_t.
A typical use case is to run a simulation as a sequence of independent
trials, so as to compute statistics on a large number of independent
runs. The user can either change the global seed and rerun the
simulation, or can advance the substream state of the RNG.
This seeding and substream state setting must be called before any
random variables are created; e.g.
@verbatim
RandomVariable::UseGlobalSeed(1,2,3,4,5,6);
int N = atol(argv[1]); //read in run number from command line
RandomVariable::SetRunNumber(N);
// Now, create random variables
UniformVariable x(0,10);
ExponentialVariable y(2902);
...
@end verbatim
Which is better, setting a new seed or advancing the substream state?
There is no guarantee that the streams
produced by two random seeds will not overlap. The only way to
guarantee that two streams do not overlap is to use the substream
capability provided by the RNG implementation.
@strong{Therefore, use the substream capability to produce
multiple independent runs of the same simulation.}
In other words, the more statistically rigorous way to configure
multiple independent replications is not to simply ignore the
seeding (and use /dev/random to seed the generator each time) but
instead to use a fixed seed and to iterate the run number.
This implementation allows for a maximum of
2.3x10^15 independent replications using the substreams.
@node class RandomVariable
@section class RandomVariable
All random variables should derive from @code{class RandomVariable}.
This base class provides a few static methods for globally configuring
the behavior of the random number generator. Derived classes
provide API for drawing random variates from the particular
distribution being supported.
Each RandomVariable created in the simulation is given a generator
that is a new RNGStream from the underlying PRNG.
Used in this manner, the L'Ecuyer implementation allows for a maximum of
1.8x10^19 random variables. Each random variable in
a single replication can produce up to 7.6x10^22 random
numbers before overlapping.
@node Base class public API
@section Base class public API
Below are excerpted a few public methods of @code{class RandomVariable}
that deal with the global configuration and state of the RNG.
@verbatim
/**
* \brief Set seeding behavior
*
* Specify whether the POSIX device /dev/random is to
* be used for seeding. When this is used, the underlying
* generator is seeded with data from /dev/random instead of
* being seeded based upon the time of day. Defaults to true.
*/
static void UseDevRandom(bool udr = true);
/**
* \brief Use the global seed to force precisely reproducible results.
*/
static void UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2,
uint32_t s3, uint32_t s4, uint32_t s5);
/**
* \brief Set the run number of this simulation
*/
static void SetRunNumber(uint32_t n);
/**
* \brief Get the internal state of the RNG
*
* This function is for power users who understand the inner workings
* of the underlying RngStream method used. It returns the internal
* state of the RNG via the input parameter.
* \param seed Output parameter; gets overwritten with the internal state
* of the RNG.
*/
void GetSeed(uint32_t seed[6]) const;
@end verbatim
We have already described the seeding configuration above.
@node Types of RandomVariables
@section Types of RandomVariables
The following types of random variables are provided, and are documented
in the ns-3 Doxygen or by reading @code{src/core/random-variable.h}. Users
can also create their own custom random variables by deriving from
class RandomVariable.
@itemize @bullet
@item @code{class UniformVariable }
@item @code{class ConstantVariable }
@item @code{class SequentialVariable }
@item @code{class ExponentialVariable }
@item @code{class ParetoVariable }
@item @code{class WeibullVariable }
@item @code{class NormalVariable }
@item @code{class EmpiricalVariable }
@item @code{class IntEmpiricalVariable }
@item @code{class DeterministicVariable }
@item @code{class LogNormalVariable }
@item @code{class TriangularVariable }
@end itemize
@node Semantics of RandomVariable objects
@section Semantics of RandomVariable objects
RandomVariable objects have value semantics. This means that they
can be passed by value to functions. The can also be passed by
reference to const. RandomVariables do not derive from
@code{ns3::Object} and we do not use smart pointers to manage them;
they are either allocated on the stack or else users explicitly manage
any heap-allocated RandomVariables.
RandomVariable objects can also be used in ns-3 attributes, which means
that values can be set for them through the ns-3 attribute system.
An example is in the propagation models for WifiNetDevice:
@verbatim
TypeId
RandomPropagationDelayModel::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RandomPropagationDelayModel")
.SetParent<PropagationDelayModel> ()
.AddConstructor<RandomPropagationDelayModel> ()
.AddAttribute ("Variable",
"The random variable which generates random delays (s).",
RandomVariableValue (UniformVariable (0.0, 1.0)),
MakeRandomVariableAccessor (&RandomPropagationDelayModel::m_variable),
MakeRandomVariableChecker ())
;
return tid;
}
@end verbatim
Here, the ns-3 user can change the default random variable for this
delay model (which is a UniformVariable ranging from 0 to 1) through
the attribute system.
@node Using other PRNG
@section Using other PRNG
There is presently no support for substituting a different underlying
random number generator (e.g., the GNU Scientific Library or the Akaroa
package). Patches are welcome.
@node More advanced usage
@section More advanced usage
@emph{To be completed}
@node Publishing your results
@section Publishing your results
When you publish simulation results, a key piece of configuration
information that you should always state is how you used the
the random number generator.
@itemize @bullet
@item what seeds you used,
@item what RNG you used if not the default,
@item how were independent runs performed,
@item for large simulations, how did you check that you did not cycle.
@end itemize
It is incumbent on the researcher publishing results to include enough
information to allow others to reproduce his or her results. It is
also incumbent on the researcher to convince oneself that the random
numbers used were statistically valid, and to state in the paper why
such confidence is assumed.
@node Summary
@section Summary
Let's review what things you should do when creating a simulation.
@itemize @bullet
@item Decide whether you are running with a fixed seed or random seed;
a random seed is the default,
@item Decide how you are going to manage independent replications, if
applicable,
@item Convince yourself that you are not drawing more random values
than the cycle length, if you are running a long simulation, and
@item When you publish, follow the guidelines above about documenting your
use of the random number generator.
@end itemize
The program @emph{samples/main-random.cc} has some examples of usage.
+373
View File
@@ -0,0 +1,373 @@
@node Routing overview
@chapter Routing overview
This chapter describes the overall design of routing in the
@code{src/internet-stack}
module, and some details about the routing approachs currently
implemented.
@node Routing-Overview
@section Overview
We intend to support traditional routing approaches and protocols,
ports of open source routing implementations, and facilitate research
into unorthodox routing techniques.
For simulations that are not primarily focused on routing and that
simply want correct routing tables to occur somehow, we have an
global centralized routing capability. A singleton object
(GlobalRouteManager) be instantiated, builds a network map, and
populates a forwarding table on each node at time t=0 in the
simulation. Simulation script writers can use the same node
API to manually enter routes as well.
@node Support for multiple routing protocols
@section Support for multiple routing protocols
Typically, multiple routing protocols are supported in user space and
coordinate to write a single forwarding table in the kernel. Presently
in @command{ns-3}, the implementation instead allows for multiple routing
protocols to build/keep their own routing state, and the IPv4 implementation
will query each one of these routing protocols (in some order determined
by the simulation author) until a route is found.
We chose this approach because it may better
faciliate the integration of disparate routing approaches that may
be difficult to coordinate the writing to a single table, approaches
where more information than destination IP address (e.g., source
routing) is used to determine the next hop, and on-demand
routing approaches where packets must be cached.
There are presently two routing protocols defined:
@itemize @bullet
@item class Ipv4StaticRouting (covering both unicast and multicast)
@item Optimized Link State Routing (a MANET protocol defined in
@uref{http://www.ietf.org/rfc/rfc3626.txt,,RFC 3626})
@end itemize
but first we describe how multiple routing protocols are supported.
@subsection class Ipv4RoutingProtocol
@code{class Ipv4RoutingProtocol} derives from ns-3 Object which means
that it supports interface aggregation and reference counting. Routing
protocols should inherit from this class, defined in src/node/ipv4.cc.
The main function that must be supported by these protocols is called
@code{RequestRoute}.
@verbatim
* This method is called whenever a node's IPv4 forwarding engine
* needs to lookup a route for a given packet and IP header.
*
* The routing protocol implementation may determine immediately it
* should not be handling this particular the route request. For
* instance, a routing protocol may decline to search for routes for
* certain classes of addresses, like link-local. In this case,
* RequestRoute() should return false and the routeReply callback
* must not be invoked.
*
* If the routing protocol implementations assumes it can provide
* the requested route, then it should return true, and the
* routeReply callback must be invoked, either immediately before
* returning true (synchronously), or in the future (asynchronous).
* The routing protocol may use any information available in the IP
* header and packet as routing key, although most routing protocols
* use only the destination address (as given by
* ipHeader.GetDestination ()). The routing protocol is also
* allowed to add a new header to the packet, which will appear
* immediately after the IP header, although most routing do not
* insert any extra header.
*/
virtual bool RequestRoute (uint32_t ifIndex,
const Ipv4Header &ipHeader,
Ptr<Packet> packet,
RouteReplyCallback routeReply) = 0;
@end verbatim
This class also provides a typedef (used above) for a special Callback
that will pass to the callback function the Ipv4Route that is found (see the
Doxygen documentation):
@verbatim
typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback;
@end verbatim
@subsection Ipv4::AddRoutingProtocol
Class Ipv4 provides a pure virtual function declaration for the
method that allows one to add a routing protocol:
@verbatim
void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
int16_t priority);
@end verbatim
This method is implemented by class Ipv4L3Protocol in the internet-stack
module.
The priority variable above governs the priority in which the routing
protocols are inserted. Notice that it is a signed int.
When the class Ipv4L3Protocol is instantiated, a single routing
protocol (Ipv4StaticRouting, introduced below) is added at priority
zero. Internally, a list of Ipv4RoutingProtocols is stored, and
and the routing protocols are each consulted in decreasing order
of priority to see whether a match is found. Therefore, if you
want your Ipv4RoutingProtocol to have priority lower than the static
routing, insert it with priority less than 0; e.g.:
@verbatim
m_ipv4->AddRoutingProtocol (m_routingTable, -10);
@end verbatim
@subsection Ipv4L3Protocol::Lookup
The main function for obtaining a route is shown below:
@verbatim
Ipv4L3Protocol::Lookup (
uint32_t ifIndex,
Ipv4Header const &ipHeader,
Ptr<Packet> packet,
Ipv4RoutingProtocol::RouteReplyCallback routeReply)
@end verbatim
This function will search the list of routing protocols, in priority order,
until a route is found. It will then invoke the RouteReplyCallback
and no further routing protocols will be searched. If the caller does
not want to constrain the possible interface, it can be wildcarded
as such:
@verbatim
Lookup (Ipv4RoutingProtocol::IF_INDEX_ANY, ipHeader, packet, routeReply);
@end verbatim
@node Roadmap and Future work
@section Roadmap and Future work
Some goals for future support are:
Users should be able to trace (either debug print, or redirect to a trace
file) the routing table in a format such as used in an
Unix implementation:
@verbatim
# netstat -nr (or # route -n)
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
127.0.0.1 * 255.255.255.255 UH 0 0 0 lo
172.16.1.0 * 255.255.255.0 U 0 0 0 eth0
172.16.2.0 172.16.1.1 255.255.255.0 UG 0 0 0 eth0
# ip route show
192.168.99.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.99.254 dev eth0
@end verbatim
Global computation of multicast routing should be implemented as well.
This would ignore group membership and ensure that a copy of every
sourced multicast datagram would be delivered to each node.
This might be implemented as an RPF mechanism that functioned on-demand
by querying the forwarding table,
and perhaps optimized by a small multicast forwarding cache. It is
a bit trickier to implement over wireless links where the input
interface is the same as the output interface; other aspects of the
packet must be considered and the forwarding logic slightly changed
to allow for forwarding out the same interface.
In the future, work on bringing XORP or quagga routing to ns, but it will
take several months to port and enable.
There are presently no roadmap plans for IPv6.
@node Static routing
@section Static routing
The internet-stack module provides one routing protocol (Ipv4StaticRouting)
by default. This routing protocol allows one to add unicast or multicast
static routes to a node.
@node Unicast routing
@section Unicast routing
The unicast static routing API may be accessed via the functions
@verbatim
void Ipv4::AddHostRouteTo ()
void Ipv4::AddNetworkRouteTo ()
void Ipv4::SetDefaultRoute ()
uint32_t Ipv4::GetNRoutes ()
Ipv4Route Ipv4::GetRoute ()
@end verbatim
@uref{http://www.nsnam.org/doxygen/index.html,,Doxygen} documentation
provides full documentation of these methods. These methods are forwarding
functions to the actual implementation in Ipv4StaticRouting, when using
the internet-stack module.
@node Multicast routing
@section Multicast routing
The following function is used to add a static multicast route
to a node:
@verbatim
void
Ipv4StaticRouting::AddMulticastRoute (Ipv4Address origin,
Ipv4Address group,
uint32_t inputInterface,
std::vector<uint32_t> outputInterfaces);
@end verbatim
A multicast route must specify an origin IP address, a multicast group and
an input network interface index as conditions and provide a vector of
output network interface indices over which packets matching the conditions
are sent.
Typically there are two main types of multicast routes: routes of the
first kind are used during forwarding. All of the conditions must be
exlicitly provided. The second kind of routes are used to get packets off
of a local node. The difference is in the input interface. Routes for
forwarding will always have an explicit input interface specified. Routes
off of a node will always set the input interface to a wildcard specified
by the index Ipv4RoutingProtocol::IF\_INDEX\_ANY.
For routes off of a local node wildcards may be used in the origin and
multicast group addresses. The wildcard used for Ipv4Adresses is that
address returned by Ipv4Address::GetAny () -- typically "0.0.0.0". Usage
of a wildcard allows one to specify default behavior to varying degrees.
For example, making the origin address a wildcard, but leaving the
multicast group specific allows one (in the case of a node with multiple
interfaces) to create different routes using different output interfaces
for each multicast group.
If the origin and multicast addresses are made wildcards, you have created
essentially a default multicast address that can forward to multiple
interfaces. Compare this to the actual default multicast address that is
limited to specifying a single output interface for compatibility with
existing functionality in other systems.
Another command sets the default multicast route:
@verbatim
void
Ipv4StaticRouting::SetDefaultMulticastRoute (uint32_t outputInterface);
@end verbatim
This is the multicast equivalent of the unicast version SetDefaultRoute.
We tell the routing system what to do in the case where a specific route
to a destination multicast group is not found. The system forwards
packets out the specified interface in the hope that "something out there"
knows better how to route the packet. This method is only used in
initially sending packets off of a host. The default multicast route is
not consulted during forwarding -- exact routes must be specified using
AddMulticastRoute for that case.
Since we're basically sending packets to some entity we think may know
better what to do, we don't pay attention to "subtleties" like origin
address, nor do we worry about forwarding out multiple interfaces. If the
default multicast route is set, it is returned as the selected route from
LookupStatic irrespective of origin or multicast group if another specific
route is not found.
Finally, a number of additional functions are provided to fetch and
remove multicast routes:
@verbatim
uint32_t GetNMulticastRoutes (void) const;
Ipv4MulticastRoute *GetMulticastRoute (uint32_t i) const;
Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const;
bool RemoveMulticastRoute (Ipv4Address origin,
Ipv4Address group,
uint32_t inputInterface);
void RemoveMulticastRoute (uint32_t index);
@end verbatim
@node Global centralized routing
@section Global centralized routing
Presently, global centralized IPv4 @emph{unicast} routing over both
point-to-point and shared (CSMA) links is supported.
The global centralized routing will be modified in the future to
reduce computations once profiling finds the performance bottlenecks.
@node Global Unicast Routing API
@section Global Unicast Routing API
The public API is very minimal. User scripts include the following:
@verbatim
#include "ns3/global-route-manager.h"
@end verbatim
After IP addresses are configured, the following function call will
cause all of the nodes that have an Ipv4 interface to receive
forwarding tables entered automatically by the GlobalRouteManager:
@verbatim
GlobalRouteManager::PopulateRoutingTables ();
@end verbatim
@emph{Note:} A reminder that the wifi NetDevice is not yet supported
(only CSMA and PointToPoint).
@node Global Routing Implementation
@section Global Routing Implementation
A singleton object (GlobalRouteManager) is responsible for populating
the static routes on each node, using the public Ipv4 API of that node.
It queries each node in the topology for a "globalRouter" interface.
If found, it uses the API of that interface to obtain a "link state
advertisement (LSA)" for the router. Link State Advertisements
are used in OSPF routing, and we follow their formatting.
The GlobalRouteManager populates a link state database with LSAs
gathered from the entire topology. Then, for each router in the topology,
the GlobalRouteManager executes the OSPF shortest path first (SPF)
computation on the database, and populates the routing tables on each
node.
The quagga (http://www.quagga.net) OSPF implementation was used as the
basis for the routing computation logic.
One benefit of following an existing OSPF SPF implementation is that
OSPF already has defined link state advertisements for all common
types of network links:
@itemize @bullet
@item point-to-point (serial links)
@item point-to-multipoint (Frame Relay, ad hoc wireless)
@item non-broadcast multiple access (ATM)
@item broadcast (Ethernet)
@end itemize
Therefore, we think that enabling these other link types will be more
straightforward now that the underlying OSPF SPF framework is in place.
Presently, we can handle IPv4 point-to-point, numbered links, as well
as shared broadcast (CSMA) links, and we do not do equal-cost multipath.
The GlobalRouteManager first walks the list of nodes and aggregates
a GlobalRouter interface to each one as follows:
@verbatim
typedef std::vector < Ptr<Node> >::iterator Iterator;
for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
{
Ptr<Node> node = *i;
Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> (node);
node->AggregateObject (globalRouter);
}
@end verbatim
This interface is later queried and used to generate a Link State
Advertisement for each router, and this link state database is
fed into the OSPF shortest path computation logic. The Ipv4 API
is finally used to populate the routes themselves.
@node Optimized Link State Routing (OLSR)
@section Optimized Link State Routing (OLSR)
This is the first dynamic routing protocol for @command{ns-3}. The implementation
is found in the src/routing/olsr directory, and an example script is in
examples/simple-point-to-point-olsr.cc.
The following commands will enable OLSR in a simulation.
@verbatim
olsr::EnableAllNodes (); // Start OLSR on all nodes
olsr::EnableNodes(InputIterator begin, InputIterator end); // Start on
// a list of nodes
olsr::EnableNode (Ptr<Node> node); // Start OLSR on "node" only
@end verbatim
Once instantiated, the agent can be started with the Start() command,
and the OLSR "main interface" can be set with the SetMainInterface()
command. A number of protocol constants are defined in olsr-agent-impl.cc.
+243
View File
@@ -0,0 +1,243 @@
@node Sockets APIs
@chapter Sockets APIs
The @uref{http://en.wikipedia.org/wiki/Berkeley_sockets,,sockets API}
is a long-standing API used by user-space applications to access
network services in the kernel. A ``socket'' is an abstraction, like
a Unix file handle, that allows applications to connect to other
Internet hosts and exchange reliable byte streams and unreliable
datagrams, among other services.
ns-3 provides two types of sockets APIs, and it is important to
understand the differences between them. The first is a @emph{native}
ns-3 API, while the second uses the services of the native API to
provide a @uref{http://en.wikipedia.org/wiki/POSIX,,POSIX-like}
API as part of an overall application process. Both APIs strive
to be close to the typical sockets API that application writers
on Unix systems are accustomed to, but the POSIX variant is much
closer to a real system's sockets API.
@section ns-3 sockets API
The native sockets API for ns-3 provides an interface to various
types of transport protocols (TCP, UDP) as well as to packet sockets
and, in the future, Netlink-like sockets. However, users are cautioned
to understand that the semantics are @strong{not} the exact same as
one finds in a real system (for an API which is very much aligned
to real systems, see the next section).
@code{class ns3::Socket} is defined in @code{src/node/socket.cc,h}.
Readers will note that many public member functions are aligned
with real sockets function calls, and all other things being equal,
we have tried to align with a Posix sockets API. However, note that:
@itemize @bullet
@item ns-3 applications handle a smart pointer to a Socket object, not
a file descriptor;
@item there is no notion of synchronous API or a ``blocking'' API;
in fact, the model for interaction between application and socket is
one of asynchronous I/O, which is not typically found in real systems
(more on this below);
@item the C-style socket address structures are not used;
@item the API is not a complete sockets API, such as supporting
all socket options or all function variants;
@item many calls use @code{ns3::Packet} class to transfer data
between application and socket. This may seem a little funny to
people to pass ``Packets'' across a stream socket API, but think
of these packets as just fancy byte buffers at this level (more
on this also below).
@end itemize
@subsection Basic operation and calls
@float Figure,fig:sockets-overview
@caption{Implementation overview of native sockets API}
@image{figures/sockets-overview, 10cm}
@end float
@subsubsection Creating sockets
An application that wants to use sockets must first create one.
On real systems, this is accomplished by calling socket():
@verbatim
int
socket(int domain, int type, int protocol);
@end verbatim
which creates a socket in the system and returns an integer descriptor.
In ns-3, we have no equivalent of a system call at the lower layers,
so we adopt the following model. There are certain @emph{factory}
objects that can create sockets. Each factory is capable of creating
one type of socket, and if sockets of a particular type are able to
be created on a given node, then a factory that can create such sockets
must be aggregated to the Node.
@verbatim
static Ptr<Socket> CreateSocket (Ptr<Node> node, TypeId tid);
@end verbatim
Examples of TypeIds to pass to this method are @code{TcpSocketFactory},
@code{PacketSocketFactory}, and @code{UdpSocketFactory}.
This method returns a smart pointer to a Socket object. Here is an
example:
@verbatim
Ptr<Node> n0;
// Do some stuff to build up the Node's internet stack
Ptr<Socket> localSocket = Socket::CreateSocket (n0, TcpSocketFactory::GetTypeId ());
@end verbatim
In some ns-3 code, sockets will not be explicitly created by user's
main programs, if an ns-3 application does it. For instance, for
@code{class ns3::OnOffApplication}, the function @code{StartApplication()}
performs the socket creation, and the application holds the socket
pointer.
@subsubsection Using sockets
Below is a typical sequence of socket calls for a TCP client in a
real implementation:
@itemize @bullet
@item @code{sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);}
@item @code{bind(sock, ...);}
@item @code{connect(sock, ...);}
@item @code{send(sock, ...);}
@item @code{recv(sock, ...);}
@item @code{close(sock);}
@end itemize
There are analogs to all of these calls in ns-3, but we will focus on
two aspects here. First, most usage of sockets in real systems
requires a way to manage I/O between the application and kernel.
These models include @emph{blocking sockets}, @emph{signal-based I/O},
and @emph{non-blocking sockets} with polling. In ns-3, we make use
of the callback mechanisms to support a fourth mode, which is
analogous to POSIX @emph{asynchronous I/O}.
In this model, on the sending side, if the @code{send()} call were to
fail because of insufficient buffers, the application suspends the
sending of more data until a function registered at the
@code{SetSendCallback()} callback is invoked. An application can
also ask the socket how much space is available by calling
@code{GetTxAvailable ()}. A typical sequence of events for
sending data (ignoring connection setup) might be:
@itemize @bullet
@item @code{SetSendCallback (MakeCallback(&HandleSendCallback));}
@item @code{Send ();}
@item @code{Send ();}
@item ...
@item @code{// Send fails because buffer is full}
@item (wait until HandleSendCallback() is called)
@item (HandleSendCallback() is called by socket, since space now available)
@item @code{Send (); // Start sending again}
@end itemize
Similarly, on the receive side, the socket user does not block on
a call to @code{recv()}. Instead, the application sets a callback
with @code{SetRecvCallback ()} in which the socket will notify the
application when (and how much) there is data to be read, and
the application then calls @code{Recv()} to read the data until
no more can be read.
@subsection Packet vs. buffer variants
There are two basic variants of @code{Send()} and @code{Recv()} supported:
@verbatim
virtual int Send (Ptr<Packet> p) = 0;
int Send (const uint8_t* buf, uint32_t size);
Ptr<Packet> Recv (void);
int Recv (uint8_t* buf, uint32_t size);
@end verbatim
The non-Packet variants are left for legacy API reasons. When calling
the raw buffer variant of @code{Send()}, the buffer is immediately
written into a Packet and the @code{Send (Ptr<Packet> p)} is invoked.
Users may find it semantically odd to pass a Packet to a stream socket
such as TCP. However, do not let the name bother you; think of
@code{ns3::Packet} to be a fancy byte buffer. There are a few reasons why
the Packet variants are more likely to be preferred in ns-3:
@itemize @bullet
@item Users can use the Tags facility of packets to, for example, encode
a flow ID or other helper data.
@item Users can exploit the copy-on-write implementation to avoid
memory copies (on the receive side, the conversion back to a
@code{uint8_t* buf} may sometimes incur an additional copy).
@item Use of Packet is more aligned with the rest of the ns-3 API
@end itemize
@subsection Sending dummy data
Sometimes, users want the simulator to just pretend that there is an
actual data payload in the packet (e.g. to calculate transmission delay)
but do not want to actually produce or consume the data. This is
straightforward to support in ns-3; have applications call
@code{Create<Packet> (size);} instead of @code{Create<Packet> (buffer, size);}.
Similarly, passing in a zero to the pointer argument in the raw buffer
variants has the same effect. Note that, if some subsequent code tries
to read the Packet data buffer, the fake buffer will be converted to
a real (zero'ed) buffer on the spot, and the efficiency will be lost there.
@subsection Socket options
@emph{to be completed}
@subsection Socket errno
@emph{to be completed}
@subsection Example programs
@emph{to be completed}
@section POSIX-like sockets API
@emph{this capability is under development and is scheduled for
inclusion in August 2008 timeframe; see the repository
http://code.nsnam.org/mathieu/ns-3-simu for details}
The below is excerpted from Mathieu's post to ns-developers list
on April 4, 2008.
"To summarize, the goal is that the full posix/socket API is defined in
src/process/simu.h: each posix type and function is re-defined there
with a simu_ or SIMU_ prefix to avoid ugly name clashes and collisions
(feel free to come up with a better prefix).
Each process is created with a call to ProcessManager::Create and is
attached to that ProcessManager instance. So, if the ProcessManager
(which is aggregated to a Node in src/helper/process-helper.cc) is
killed when the simulation ends, the system will automatically reclaim
all the resources of each process associated to each manager. The same
happens when an application "exits" from its main function.
The example application defines two posix "processes": the function
ClientProgram creates a udp socket on the localhost port 2000 and the
function ServerProgram creates a udp socket on the localhost port 2000.
The code does not work right now because I did not get the details of
simu_read right yet but, I do plan to make this work at some point.
I really think that this approach is worthwhile for many reasons, a few
of which are outlined below:
@itemize @bullet
@item makes porting real world application code _much_ easier
@item makes write applications for new users much easier because they can
read the bsd socket api reference and documentation and write code
directly.
@item can be used to write applications which work in both simulation and
in the real world at the same time. To do this, all you have to do is
write your application to use the simu_ API, and, then, you can chose at
compile-time which implementation of that API you want to use: you can
pick one implementation which forwards all calls to the system BSD
socket API or another one which forwards all calls to the attached
ProcessManager. Arguably, I did not implement the version which forwards
to system BSD sockets but, that should be pretty trivial.
@end itemize
So, anyway, comments about the overall API would be welcome. Students
interested in the gsoc project for real-world code integration should
consider looking at this also."
+9
View File
@@ -0,0 +1,9 @@
@node Statistics
@chapter Statistics
@anchor{chap:Statistics}
ns-3 does not presently have support for statistics (automatically generated
statistical output). This is planned
for development later in 2008. If you are interested in contributing,
please see @uref{http://www.nsnam.org/wiki/index.php/Suggested_Projects,,our suggested projects page} or contact the ns-developers
list.
+82
View File
@@ -0,0 +1,82 @@
@node Troubleshooting
@chapter Troubleshooting
This chapter posts some information about possibly common errors in building
or running ns-3 programs.
Please note that the wiki (@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting}) may have contributed items.
@node Build errors
@section Build errors
@node Run-time errors
@section Run-time errors
Sometimes, errors can occur with a program after a successful build. These
are run-time errors, and can commonly occur when memory is corrupted or
pointer values are unexpectedly null.
Here is an example of what might occur:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
Command ['/home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point'] exited with code -11
@end verbatim
The error message says that the program terminated unsuccessfully, but it is
not clear from this information what might be wrong. To examine more
closely, try running it under the @uref{http://sources.redhat.com/gdb/,,gdb debugger}:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="gdb %s"
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xf5c000
Program received signal SIGSEGV, Segmentation fault.
0x0804aa12 in main (argc=1, argv=0xbfdfefa4)
at ../examples/tcp-point-to-point.cc:136
136 Ptr<Socket> localSocket = socketFactory->CreateSocket ();
(gdb) p localSocket
$1 = {m_ptr = 0x3c5d65}
(gdb) p socketFactory
$2 = {m_ptr = 0x0}
(gdb) quit
The program is running. Exit anyway? (y or n) y
@end verbatim
Note first the way the program was invoked-- pass the command to run as
an argument to the command template "gdb %s".
This tells us that there was an attempt to dereference a null pointer
socketFactory.
Let's look around line 136 of tcp-point-to-point, as gdb suggests:
@verbatim
Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
localSocket->Bind ();
@end verbatim
The culprit here is that the return value of GetObject is not being
checked and may be null.
Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
checker} for more subtle errors. Again, you invoke the use of valgrind
similarly:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="valgrind %s"
@end verbatim
+64
View File
@@ -0,0 +1,64 @@
/**
* @anchor modules_anchor
*
* @defgroup simulator Simulator
* The "simulator" module contains:
* - a time management class to hold a time and convert between various time units: ns3::Time
* - a scheduler base class used to implement new simulation event schedulers:
* ns3::Scheduler and ns3::SchedulerFactory
* - a simulator class used to create, schedule and cancel events: ns3::Simulator
*
* @defgroup core Core
* \brief The "core" module contains:
* - a Functor class: ns3::Callback
* - an os-independent interface to get access to the elapsed wall clock time: ns3::SystemWallClockMs
* - a class to register regression tests with the test manager: ns3::Test and ns3::TestManager
* - debugging facilities: \ref logging, \ref assert
* - \ref randomvariable
* - a base class for objects which need to support per-instance "attributes" and
* trace sources: ns3::ObjectBase
* - a base class for objects which need to support reference counting
* and dynamic object aggregation: ns3::Object
* - a smart-pointer class ns3::Ptr designed to work together with ns3::Object
* - a configuration class used to set and control all attributes and trace sources
* in a simulation: ns3::Config.
*
* @defgroup common Common
* The "common" module contains:
* - a packet class to create and manipulate simulation packets:
* ns3::Packet, ns3::Header, and ns3::Trailer. This packet class
* also supports per-packet ns3::Tag which are globs of data
* which can be attached to any packet.
*
* @defgroup node Node
* The "node" module contains:
* - a ns3::Node base class which should be subclassed by any new type of
* network Node.
* - models which abstract the MAC-layer from the IP layer protocols:
* ns3::NetDevice and ns3::Channel.
* - models which abstract the application-layer API: ns3::Application,
* ns3::Socket, ns3::SocketFactory, and, ns3::Udp
*
*
* @defgroup devices Devices
*
* @defgroup internetStack InternetStack
*
* The "internet-stack" module contains:
* - an Ipv4 stack
* - an ARP module
* - a UDP and a TCP implementation
*
* @defgroup helper Helpers
*
* @defgroup applications Applications
*
* @defgroup mobility Mobility
*
* @defgroup routing Routing
*
* @defgroup constants Constants
* @brief Constants you can change
*
* @defgroup contrib Contrib
*/
+1658
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

+78
View File
@@ -0,0 +1,78 @@
Steps in doing an ns-3 release
1. check out a clean ns-3-dev somewhere
2. prepare the source files
- revise and check in AUTHORS, if needed
- revise and check in RELEASE_NOTES
- DO NOT change VERSION at this time
- confirm that Doxygen builds cleanly and without warnings
(./waf check; ./waf --doxygen), and check in any necessary changes
- ensure no regressions (./waf --regression)
3. ./waf configure; ./waf dist
- this will create an ns-3-dev.tar.bz2 tarball
- this will also create a ns-3-dev-ref-traces.tar.bz2 tarball
4. test dev tarball on release platforms (waf check and maybe some other
scripts)
5. once you are happy with the tarball, tag ns-3-dev and ns-3-dev-ref-traces
- hg tag "ns-3.x"
- hg push
- cd into regression/ns-3-dev-ref-traces
- hg tag "ns-3.x"
- hg push
6. clone the tagged ns-3-dev and place it on the repository
- ssh code.nsnam.org; sudo tcsh; su code;
- cp -r /home/code/repos/ns-3-dev /home/code/repos/ns-3.1x
- cd /home/code/repos/ns-3.x/.hg and edit the hgrc appropriately:
"description = ns-3.x release
name = ns-3.x"
- clone the ns-3-dev-ref-traces and place it on the repository as above
but use the name ns-3.x-ref-traces and edit the hgrc appropriately
7. check out a clean version of the new release (ns-3.x) somewhere
8. Update the VERSION for this new release
- change the string 3-dev in the VERSION file to the real version
(e.g. 3.2) This must agree with the version name you chose in the clone
for the regression tests to work.
- hg commit
- hg push
9. Run the regression tests on the new release (debug and optimized)
- ./waf -d debug configure
- ./waf
- ./waf --regression
- ./waf --valgrind --regression (for valgrind version)
- ./waf -d optimized configure
- ./waf
- ./waf --regression
- ./waf --valgrind --regression (for valgrind version)
- There should be no regression errors at this time
10. Create final tarballs
- ./waf configure; ./waf dist
- this will create an ns-3.x.tar.bz2 tarball
- this will also create a ns-3.x-ref-traces.tar.bz2 tarball
11. upload "ns-3.x.tar.bz2" to the /var/www/html/releases/ directory on
the www.nsnam.org server
- give it 644 file permissions, and user/group = apache
12. upload "ns-3.x-ref-traces.tar.bz2" to the /var/www/html/releases/
directory on the www.nsnam.org server
- give it 644 file permissions, and user/group = apache
13. update web pages on www.nsnam.org (source is in the www/ module)
- clone the source repo (hg clone http://code.nsnam.org/www)
- update index.html
- add link to news.html
- update getting_started.html
- update documents.html
- update roadmap on wiki
- commit and push changes
- build and update HTML directory on the server
-- ssh www.nsnam.org; sudo tcsh; su nsnam;
-- run ~/bin/update-html
- build and update Doxygen directory on the server
-- edit ~/bin/update-doxygen-release file and change RELEASE variable
to the right version number
-- run ~/bin/update-doxygen-release
14. Final checks
- download tarball from web, build and run regression tests for as many
targets as you can
- download release from mercurial, build and run regression tests for as
many targets as you can
- test and verify until you're confident the release is solid.
15. announce to ns-developers, with summary of release notes
+49
View File
@@ -0,0 +1,49 @@
TEXI2HTML = texi2html
TEXI2PDF = texi2dvi --pdf
EPSTOPDF = epstopdf
TGIF = tgif
DIA = dia
CONVERT = convert
CSS = --css-include=tutorial.css
SPLIT = --split section
DIA_SOURCES = pp.dia dumbbell.dia star.dia
TGIF_SOURCES = helpers.obj
DIA_EPS = ${DIA_SOURCES:.dia=.eps}
DIA_PNG = ${DIA_SOURCES:.dia=.png}
DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
TGIF_EPS = ${TGIF_SOURCES:.obj=.eps}
TGIF_PNG = ${TGIF_SOURCES:.obj=.png}
TGIF_PDF = ${TGIF_SOURCES:.obj=.pdf}
all: html split-html pdf
# Note: tgif requires a valid x display to convert from .obj to .png.
# If running this makefile on a remote console, the X virtual frame
# buffer may be needed (xorg-x11-server-Xvfb) to provide a "fake"
# display
images:
cd figures/; $(DIA) -t png $(DIA_SOURCES)
cd figures/; $(DIA) -t eps $(DIA_SOURCES)
cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
cd figures/; $(TGIF) -print -png $(TGIF_SOURCES)
cd figures/; $(TGIF) -print -eps $(TGIF_SOURCES)
cd figures/; $(foreach FILE,$(TGIF_EPS),$(EPSTOPDF) $(FILE);)
html:
$(TEXI2HTML) ${CSS} tutorial.texi
split-html:
$(TEXI2HTML) ${CSS} ${SPLIT} tutorial.texi
pdf:
$(TEXI2PDF) tutorial.texi
figures-clean:
cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
cd figures/; rm -rf $(TGIF_EPS); rm -rf $(TGIF_PNG); rm -rf $(TGIF_PDF)
clean: # figures-clean
rm -rf tutorial.aux tutorial.cp tutorial.cps tutorial.fn tutorial.ky tutorial.pg tutorial.tp tutorial.vr tutorial.toc tutorial.log tutorial.pdf tutorial.html tutorial/
File diff suppressed because it is too large. Load diff
+812
View File
@@ -0,0 +1,812 @@
@c ========================================================================
@c Begin document body here
@c ========================================================================
@c ========================================================================
@c Conceptual Overview
@c ========================================================================
@node Conceptual Overview
@chapter Conceptual Overview
@menu
* Key Abstractions::
* A First ns-3 Script::
@end menu
The first thing we need to do before actually starting to look at or write
@command{ns-3} code is to explain a few core concepts and abstractions in the
system. Much of this may appear transparently obvious to some, but we
recommend taking the time to read through this section just to ensure you
are starting on a firm foundation.
@node Key Abstractions
@section Key Abstractions
In this section, we'll review some terms that are commonly used in
networking, but have a specific meaning in @command{ns-3}.
@subsection Node
@cindex Node
In Internet jargon, a computing device that connects to a network is called
a @emph{host} or sometimes an @emph{end system}. Because @command{ns-3} is a
@emph{network} simulator, not specifically an @emph{Internet} simulator, we
intentionally do not use the term host since it is closely associated with
the Internet and its protocols. Instead, we use a more generic term also
used by other simulators that originates in Graph Theory --- the @emph{node}.
@cindex class Node
In @command{ns-3} the basic computing device abstraction is called the
node. This abstraction is represented in C++ by the class @code{Node}. The
@code{Node} class provides methods for managing the representations of
computing devices in simulations.
You should think of a @code{Node} as a computer to which you will add
functionality. One adds things like applications, protocol stacks and
peripheral cards with their associated drivers to enable the computer to do
useful work. We use the same basic model in @command{ns-3}.
@subsection Application
@cindex Application
Typically, computer software is divided into two broad classes. @emph{System
Software} organizes various computer resources such as memory, processor
cycles, disk, network, etc., according to some computing model. System
software usually does not use those resources to complete tasks that directly
benefit a user. A user would typically run an @emph{application} that acquires
and uses the resources controlled by the system software to accomplish some
goal.
@cindex system call
Often, the line of separation between system and application software is made
at the privilege level change that happens in operating system traps.
In @command{ns-3} there is no real concept of operating system and especially
no concept of privilege levels or system calls. We do, however, have the
idea of an application. Just as software applications run on computers to
perform tasks in the ``real world,'' @command{ns-3} applications run on
@command{ns-3} @code{Nodes} to drive simulations in the simulated world.
@cindex class Application
In @command{ns-3} the basic abstraction for a user program that generates some
activity to be simulated is the application. This abstraction is represented
in C++ by the class @code{Application}. The @code{Application} class provides
methods for managing the representations of our version of user-level
applications in simulations. Developers are expected to specialize the
@code{Application} class in the object-oriented programming sense to create new
applications. In this tutorial, we will use specializations of class
@code{Application} called @code{UdpEchoClientApplication} and
@code{UdpEchoServerApplication}. As you might expect, these applications
compose a client/server application set used to generate and echo simulated
network packets
@subsection Channel
@cindex Channel
In the real world, one can connect a computer to a network. Often the media
over which data flows in these netowrks are called @emph{channels}. When
you connect your Ethernet cable to the plug in the wall, you are connecting
your computer to an Ethernet communication channel. In the simulated world
of @command{ns-3}, one connects a @code{Node} to an object representing a
communication channel. Here the basic communication subnetwork abstraction
is called the channel and is represented in C++ by the class @code{Channel}.
The @code{Channel} class provides methods for managing communication
subnetwork objects and connecting nodes to them. @code{Channels} may also be
specialized by developers in the object oriented programming sense. A
@code{Channel} specialization may model something as simple as a wire. The
specialized @code{Channel} can also model things as complicated as a large
Ethernet switch, or three-dimensional space full of obstructions in the case
of wireless networks.
We will use specialized versions of the @code{Channel} called
@code{CsmaChannel}, @code{PointToPointChannel} and @code{WifiChannel} in this
tutorial. The @code{CsmaChannel}, for example, models a version of a
communication subnetwork that implements a @emph{carrier sense multiple
access} communication medium. This gives us Ethernet-like functionality.
@subsection Net Device
@cindex NetDevice
@cindex Ethernet
It used to be the case that if you wanted to connect a computers to a network,
you had to buy a specific kind of network cable and a hardware device called
(in PC terminology) a @emph{peripheral card} that needed to be installed in
your computer. If the peripheral card implemented some networking function,
theys were called Network Interface Cards, or @emph{NICs}. Today most
computers come with the network interface hardware built in and users don't
see these building blocks.
A NIC will not work without a software driver to control the hardware. In
Unix (or Linux), a piece of peripheral hardware is classified as a
@emph{device}. Devices are controlled using @emph{device drivers}, and network
devices (NICs) are controlled using @emph{network device drivers}
collectively known as @emph{net devices}. In Unix and Linux you refer
to these net devices by names such as @emph{eth0}.
In @command{ns-3} the @emph{net device} abstraction covers both the software
driver and the simulated hardware. A net device is ``installed'' in a
@code{Node} in order to enable the @code{Node} to communicate with other
@code{Nodes} in the simulation via @code{Channels}. Just as in a real
computer, a @code{Node} may be connected to more than one @code{Channel} via
multiple @code{NetDevices}.
The net device abstraction is represented in C++ by the class @code{NetDevice}.
The @code{NetDevice} class provides methods for managing connections to
@code{Node} and @code{Channel} objects; and may be specialized by developers
in the object-oriented programming sense. We will use the several specialized
versions of the @code{NetDevice} called @code{CsmaNetDevice},
@code{PointToPointNetDevice}, and @code{WifiNetDevice} in this tutorial.
Just as an Ethernet NIC is designed to work with an Ethernet network, the
@code{CsmaNetDevice} is designed to work with a @code{CsmaChannel}; the
@code{PointToPointNetDevice} is designed to work with a
@code{PointToPointChannel} and a @code{WifiNetNevice} is designed to work with
a @code{WifiChannel}.
@subsection Topology Helpers
@cindex helper
@cindex topology
@cindex topology helper
In a real network, you will find host computers with added (or built-in)
NICs. In @command{ns-3} we would say that you will find @code{Nodes} with
attached @code{NetDevices}. In a large simulated network you will need to
arrange many connections between @code{Nodes}, @code{NetDevices} and
@code{Channels}.
Since connecting @code{NetDevices} to @code{Nodes}, @code{NetDevices}
to @code{Channels}, assigning IP addresses, etc., are such common tasks
in @command{ns-3}, we provide what we call @emph{topology helpers} to make
this as easy as possible. For example, it may take many distinct
@command{ns-3} core operations to create a NetDevice, add a MAC address,
install that net device on a @code{Node}, configure the node's protocol stack,
and then connect the @code{NetDevice} to a @code{Channel}. Even more
operations would be required to connect multiple devices onto multipoint
channels and then to connect individual networks together into internetworks.
We provide topology helper objects that combine those many distinct operations
into an easy to use model for your convenience.
@c ========================================================================
@c A First ns-3 script
@c ========================================================================
@node A First ns-3 Script
@section A First ns-3 Script
@cindex first script
If you downloaded the system as was suggested above, you will have a release
of @command{ns-3} in a directory called @code{repos} under your home
directory. Change into that release directory, and you should find a
directory structure something like the following:
@verbatim
AUTHORS examples/ README samples/ utils/ waf.bat*
build/ LICENSE regression/ scratch/ VERSION wscript
doc/ ns3/ RELEASE_NOTES src/ waf*
@end verbatim
@cindex first.cc
Change into the examples directory. You should see a file named
@code{first.cc} located there. This is a script that will create a simple
point-to-point link between two nodes and echo a single packet between the
nodes. Let's take a look at that script line by line, so go ahead and open
@code{first.cc} in your favorite editor.
@subsection Boilerplate
The first line in the file is an emacs mode line. This tells emacs about the
formatting conventions (coding style) we use in our source code.
@verbatim
/* -*- Mode:C++; c-file-style:''gnu''; indent-tabs-mode:nil; -*- */
@end verbatim
This is always a somewhat controversial subject, so we might as well get it
out of the way immediately. The @code{ns-3} project, like most large
projects, has adopted a coding style to which all contributed code must
adhere. If you want to contribute your code to the project, you will
eventually have to conform to the @command{ns-3} coding standard as described
in the file @code{doc/codingstd.txt} or shown on the project web page
@uref{http://www.nsnam.org/codingstyle.html,,here}.
We recommend that you, well, just get used to the look and feel of @code{ns-3}
code and adopt this standard whenever you are working with our code. All of
the development team and contributors have done so with various amounts of
grumbling. The emacs mode line above makes it easier to get the formatting
correct if you use the emacs editor.
The @command{ns-3} simulator is licensed using the GNU General Public
License. You will see the appropriate GNU legalese at the head of every file
in the @command{ns-3} distribution. Often you will see a copyright notice for
one of the institutions involved in the @code{ns-3} project above the GPL
text and an author listed below.
@verbatim
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@end verbatim
@subsection Module Includes
The code proper starts with a number of include statements.
@verbatim
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
@end verbatim
To help our high-level script users deal with the large number of include
files present in the system, we group includes according to relatively large
modules. We provide a single include file that will recursively load all of
the include files used in each module. Rather than having to look up exactly
what header you need, and possibly have to get a number of dependencies right,
we give you the ability to load a group of files at a large granularity. This
is not the most efficient approach but it certainly makes writing scripts much
easier.
Each of the @command{ns-3} include files is placed in a directory called
@code{ns3} (under the build directory) during the build process to help avoid
include file name collisions. The @code{ns3/core-module.h} file corresponds
to the ns-3 module you will find in the directory @code{src/core} in your
downloaded release distribution. If you list this directory you will find a
large number of header files. When you do a build, Waf will place public
header files in an @code{ns3} directory under the appropriate
@code{build/debug} or @code{build/optimized} directory depending on your
configuration. Waf will also automatically generate a module include file to
load all of the public header files.
Since you are, of course, following this tutorial religiously, you will
already have done a
@verbatim
./waf -d debug configure
@end verbatim
in order to configure the project to perform debug builds. You will also have
done a
@verbatim
./waf
@end verbatim
to build the project. So now if you look in the directory
@code{build/debug/ns-3} you will find the four module include files shown
above. You can take a look at the contents of these files and find that they
do include all of the public include files in their respective modules.
@subsection Ns3 Namespace
The next line in the @code{first.cc} script is a namespace declaration.
@verbatim
using namespace ns3;
@end verbatim
The @command{ns-3} project is implemented in a C++ namespace called
@code{ns3}. This groups all @command{ns-3}-related declarations in a scope
outside the global namespace, which we hope will help with integration with
other code. The C++ @code{using} statement introduces the @code{ns-3}
namespace into the current (global) declarative region. This is a fancy way
of saying that after this declaration, you will not have to type @code{ns3::}
scope resolution operator before all of the @code{ns-3} code in order to use
it. If you are unfamiliar with namespaces, please consult almost any C++
tutorial and compare the @code{ns3} namespace and usage here with instances of
the @code{std} namespace and the @code{using namespace std;} statements you
will often find in discussions of @code{cout} and streams.
@subsection Logging
The next line of the script is the following,
@verbatim
NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
@end verbatim
We will use this statement as a convenient place to talk about our Doxygen
documentation system. If you look at the project web site,
@uref{http://www.nsnam.org,,ns-3 project}, you will find a link to ``APIs
(Doxygen)'' in the navigation bar. If you select this link, you will be
taken to our documentation page.
Along the left side, you will find a graphical representation of the structure
of the documentation. A good place to start is the @code{NS-3 Modules}
``book.'' If you expand @code{Modules} you will see a list of @command{ns-3}
module documentation. The concept of module here ties directly into the
module include files discussed above. It turns out that the @command{ns-3}
logging subsystem is part of the @code{core} module, so go ahead and expand
that documentation node. Now, expand the @code{Debugging} book and then
select the @code{Logging} page.
You should now be looking at the Doxygen documentation for the Logging module.
In the list of @code{#define}s at the top of the page you will see the entry
for @code{NS_LOG_COMPONENT_DEFINE}. Before jumping in, it would probably be
good to look for the ``Detailed Description'' of the logging module to get a
feel for the overall operation. You can either scroll down or select the
``More...'' link under the collaboration diagram to do this.
Once you have a general idea of what is going on, go ahead and take a look at
the specific @code{NS_LOG_COMPONENT_DEFINE} documentation. I won't duplicate
the documentation here, but to summarize, this line declares a logging
component called @code{FirstScriptExample} that allows you to enable and
disable console message logging by reference to the name.
@subsection Main Function
The next lines of the script you will find are,
@verbatim
int
main (int argc, char *argv[])
{
@end verbatim
This is just the declaration of the main function of your program (script).
Just as in any C++ program, you need to define a main function that will be
the first function run. There is nothing at all special here. Your
@command{ns-3} script is just a C++ program.
The next two lines of the script are used to enable two logging components that
are built into the Echo Client and Echo Server applications:
@verbatim
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
@end verbatim
If you have read over the Logging component documentation you will have seen
that there are a number of levels of logging verbosity/detail that you can
enable on each component. These two lines of code enable debug logging at the
INFO level for echo clients and servers. This will result in the application
printing out messages as packets are sent and received during the simulation.
Now we will get directly to the business of creating a topology and running
a simulation. We use the topology helper objects to make this job as
easy as possible.
@subsection Topology Helpers
@subsubsection NodeContainer
The next two lines of code in our script will actually create the
@command{ns-3} @code{Node} objects that will represent the computers in the
simulation.
@verbatim
NodeContainer nodes;
nodes.Create (2);
@end verbatim
Let's find the documentation for the @code{NodeContainer} class before we
continue. Another way to get into the documentation for a given class is via
the @code{Classes} tab in the Doxygen pages. If you still have the Doxygen
handy, just scroll up to the top of the page and select the @code{Classes}
tab. You should see a new set of tabs appear, one of which is
@code{Class List}. Under that tab you will see a list of all of the
@command{ns-3} classes. Scroll down, looking for @code{ns3::NodeContainer}.
When you find the class, go ahead and select it to go to the documentation for
the class.
You may recall that one of our key abstractions is the @code{Node}. This
represents a computer to which we are going to add things like protocol stacks,
applications and peripheral cards. The @code{NodeContainer} topology helper
provides a convenient way to create, manage and access any @code{Node} objects
that we create in order to run a simulation. The first line above just
declares a NodeContainer which we call @code{nodes}. The second line calls the
@code{Create} method on the @code{nodes} object and asks the container to
create two nodes. As described in the Doxygen, the container calls down into
the @command{ns-3} system proper to create two @code{Node} objects and stores
pointers to those objects internally.
The nodes as they stand in the script do nothing. The next step in
constructing a topology is to connect our nodes together into a network.
The simplest form of network we support is a single point-to-point link
between two nodes. We'll construct one of those links here.
@subsubsection PointToPointHelper
We are constructing a point to point link, and, in a pattern which will become
quite familiar to you, we use a topology helper object to do the low-level
work required to put the link together. Recall that two of our key
abstractions are the @code{NetDevice} and the @code{Channel}. In the real
world, these terms correspond roughly to peripheral cards and network cables.
Typically these two things are intimately tied together and one cannot expect
to interchange, for example, Ethernet devices and wireless channels. Our
Topology Helpers follow this intimate coupling and therefore you will use a
single @code{PointToPointHelper} to configure and connect @command{ns-3}
@code{PointToPointNetDevice} and @code{PointToPointChannel} objects in this
script.
The next three lines in the script are,
@verbatim
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
@end verbatim
The first line
@verbatim
PointToPointHelper pointToPoint;
@end verbatim
instantiates a @code{PointToPointHelper} object on the stack. From a
high-level perspective the next line,
@verbatim
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
@end verbatim
tells the @code{PointToPointHelper} object to use the value ``5mbps''
(five megabits per second) as the ``DataRate'' when it creates a
@code{PointToPointNetDevice} object.
From a more detailed perspective, the string ``DataRate'' corresponds
to what we call an @code{Attribute} of the @code{PointToPointNetDevice}.
If you look at the Doxygen for class @code{ns3::PointToPointNetDevice} and
find the documentation for the @code{GetTypeId} method, you will find a list
of @code{Attributes} defined for the device. Among these is the ``DataRate''
attribute. Most user-visible @command{ns-3} objects have similar lists of
attributes. We use this mechanism to easily configure simulations without
recompiling as you will see in a following section.
Similar to the ``DataRate'' on the @code{PointToPointNetDevice} you will find a
``Delay'' attribute associated with the @code{PointToPointChannel}. The
final line,
@verbatim
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
@end verbatim
tells the @code{PointToPointHelper} to use the value ``2ms'' (two milliseconds)
as the value of the transmission delay of every point to point channel it
subsequently creates.
@subsubsection NetDeviceContainer
At this point in the script, we have a @code{NodeContainer} that contains
two nodes. We have a @code{PointToPointHelper} that is primed and ready to
make @code{PointToPointNetDevices} and wire @code{PointToPointChannel} objects
between them. Just as we used the @code{NodeContainer} topology helper object
to create the @code{Nodes} for our simulation, we will ask the
@code{PointToPointHelper} to do the work involved in creating, configuring and
installing our devices for us. We will need to have a list of all of the
NetDevice objects that are created, so we use a NetDeviceContainer to hold
them just as we used a NodeContainer to hold the nodes we created. The
following two lines of code,
@verbatim
NetDeviceContainer devices;
devices = pointToPoint.Install (nodes);
@end verbatim
will finish configuring the devices and channel. The first line declares the
device container mentioned above and the second does the heavy lifting. The
@code{Install} method of the @code{PointToPointHelper} takes a
@code{NodeContainer} as a parameter. Internally, a @code{NetDeviceContainer}
is created. For each node in the @code{NodeContainer} (there must be exactly
two for a point-to-point link) a @code{PointToPointNetDevice} is created and
saved in the device container. A @code{PointToPointChannel} is created and
the two @code{PointToPointNetDevices} are attached. When objects are created
by the @code{PointToPointHelper}, the attributes previously set in the helper
are used to initialize the corresponding attributes in the created objects.
After executing the the @code{pointToPoint.Install (nodes)} call we will have
two nodes, each with an installed point-to-point net device and a
point-to-point channel between them. Both devices will be configured to
transmit data at five megabits per second over the channel which has a two
millisecond transmission delay.
@subsubsection InternetStackHelper
We now have nodes and devices configured, but we don't have any protocol stacks
installed on our nodes. The next two lines of code will take care of that.
@verbatim
InternetStackHelper stack;
stack.Install (nodes);
@end verbatim
The @code{InternetStackHelper} is a topology helper that is to internet stacks
what the @code{PointToPointHelper} is to point-to-point net devices. The
@code{Install} method takes a @code{NodeContainer} as a parameter. When it is
executed, it will install an Internet Stack (TCP, UDP, IP, etc.) on each of
the nodes in the node container.
@subsubsection Ipv4AddressHelper
Next we need to associate the devices on our nodes with IP addresses. We
provide a topology helper to manage the allocation of IP addresses. The only
user-visible API is to set the base IP address and network mask to use when
performing the actual address allocation (which is done at a lower level
inside the helper).
The next two lines of code in our example script, @code{first.cc},
@verbatim
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
@end verbatim
declare an address helper object and tell it that it should begin allocating IP
addresses from the network 10.1.1.0 using the mask 255.255.255.0 to define
the allocatable bits. By default the addresses allocated will start at one
and increase monotonically, so the first address allocated from this base will
be 10.1.1.1, followed by 10.1.1.2, etc. The low level @command{ns-3} system
actually remembers all of the IP addresses allocated and will generate a
fatal error if you accidentally cause the same address to be generated twice
(which is a very hard to debug error, by the way).
The next line of code,
@verbatim
Ipv4InterfaceContainer interfaces = address.Assign (devices);
@end verbatim
performs the actual address assignment. In @command{ns-3} we make the
association between an IP address and a device using an @code{Ipv4Interface}
object. Just as we sometimes need a list of net devices created by a helper
for future reference we sometimes need a list of @code{Ipv4Interface} objects.
The @code{Ipv4InterfaceContainer} provides this functionality.
Now we have a point-to-point network built, with stacks installed and IP
addresses assigned. What we need at this point are applications to generate
traffic.
@subsection Applications
Another one of the core abstractions of the ns-3 system is the
@code{Application}. In this script we use two specializations of the core
@command{ns-3} class @code{Application} called @code{UdpEchoServerApplication}
and @code{UdpEchoClientApplication}. Just as we have in our previous
explanations, we use helper objects to help configure and manage the
underlying objects. Here, we use @code{UdpEchoServerHelper} and
@code{UdpEchoClientHelper} objects to make our lives easier.
@subsubsection UdpEchoServerHelper
The following lines of code in our example script, @code{first.cc}, are used
to set up a UDP echo server application on one of the nodes we have previously
created.
@verbatim
UdpEchoServerHelper echoServer (9);
ApplicationContainer serverApps = echoServer.Install (nodes.Get (1));
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));
@end verbatim
The first line of code in the above snippet declares the
@code{UdpEchoServerHelper}. As usual, this isn't the application itself, it
is an object used to help us create the actual applications. One of our
conventions is to place required attributes in the helper constructor. In this
case, the helper can't do anything useful unless it is provided with a port
number that the client also knows about. Rather than just picking one and
hoping it all works out, we require the port number as a parameter to the
constructor. The constructor, in turn, simply does a @code{SetAttribute}
with the passed value. You can, if desired, set the ``Port'' attribute to
another value later.
Similar to many other helper objects, the @code{UdpEchoServerHelper} object
has an @code{Install} method. It is the execution of this method that actually
causes the underlying echo server application to be instantiated and attached
to a node. Interestingly, the @code{Install} method takes a
@code{NodeContainter} as a parameter just as the other @code{Install} methods
we have seen. This is actually what is passed to the method even though it
doesn't look so in this case. There is a C++ @emph{implicit conversion} at
work here.
We now see that @code{echoServer.Install} is going to install a
@code{UdpEchoServerApplication} on the node found at index number one of the
@code{NodeContainer} we used to manage our nodes. @code{Install} will return
a container that holds pointers to all of the applications (one in this case
since we passed a @code{NodeContainer} containing one node) created by the
helper.
Applications require a time to ``start'' generating traffic and may take an
optional time to ``stop.'' We provide both. These times are set using the
@code{ApplicationContainer} methods @code{Start} and @code{Stop}. These
methods take @code{Time} parameters. In this case, we use an explicit C++
conversion sequence to take the C++ double 1.0 and convert it to an
@command{ns-3} @code{Time} object using a @code{Seconds} cast. The two lines,
@verbatim
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));
@end verbatim
will cause the echo server application to @code{Start} (enable itself) at one
second into the simulation and to @code{Stop} (disable itself) at ten seconds
into the simulation. By virtue of the fact that we have implicilty declared
a simulation event (the application stop event) to be executed at ten seconds,
the simulation will last at least ten seconds.
@subsubsection UdpEchoClientHelper
The echo client application is set up in a method substantially similar to
that for the server. There is an underlying @code{UdpEchoClientApplication}
that is managed by an @code{UdpEchoClientHelper}.
@verbatim
UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
ApplicationContainer clientApps = echoClient.Install (nodes.Get (0));
clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
@end verbatim
For the echo client, however, we need to set five different attributes. The
first two attributes are set during construction of the
@code{UdpEchoClientHelper}. We pass parameters that are used (internally to
the helper) to set the ``RemoteAddress'' and ``RemotePort'' attributes in
accordance with our convention to make required attributes parameters in the
helper constructors.
Recall that we used an @code{Ipv4InterfaceContainer} to keep track of the IP
addresses we assigned to our devices. The zeroth interface in the
@code{interfaces} container is going to coorespond to the IP address of the
zeroth node in the @code{nodes} container. The first interface in the
@code{interfaces} container cooresponds to the IP address of the first node
in the @code{nodes} container. So, in the first line of code (from above), we
are creating the helper and telling it so set the remote address of the client
to be the IP address assigned to the node on which the server resides. We
also tell it to arrange to send packets to port nine.
The ``MaxPackets'' attribute tells the client the maximum number of packets
we allow it to send during the simulation. The ``Interval'' attribute tells
the client how long to wait between packets, and the ``PacketSize'' attribute
tells the client how large its packet payloads should be. With this
particular combination of attributes, we are telling the client to send one
1024-byte packet.
Just as in the case of the echo server, we tell the echo client to @code{Start}
and @code{Stop}, but here we start the client one second after the server is
enabled (at two seconds into the simulation).
@subsection Simulator
What we need to do at this point is to actually run the simulation. This is
done using the global function @code{Simulator::Run}.
@verbatim
Simulator::Run ();
@end verbatim
When we previously called the methods,
@verbatim
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));
...
clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
@end verbatim
we actually scheduled events in the simulator at 1.0 seconds, 2.0 seconds and
10.0 seconds. When @code{Simulator::Run} is called, the ssytem will begin
looking through the list of scheduled events and executing them. First it
will run the event at 1.0 seconds, which will enable the echo server
application. Then it will run the event scheduled for t=2.0 seconds which
will start the echo client application. The start event implementation in
the echo client application will begin the data transfer phase of the
simulation by sending a packet to the server.
The act of sending the packet to the server will trigger a chain of events
that will be automatically scheduled behind the scenes and which will perform
the mechanics of the packet echo according to the various timing parameters
that we have set in the script.
Eventually, since we only send one packet, the chain of events triggered by
that single client echo request will taper off and the simulation will go
idle. Once this happens, the remaining events will be the @code{Stop} events
for the server and the client. When these events are executed, there are
no further events to process and @code{Simulator::Run} returns. The simulation
is complete.
All that remains is to clean up. This is done by calling the global function
@code{Simulator::Destroy}. As the helper functions (or low level
@command{ns-3} code) executed, they arranged it so that hooks were inserted in
the simulator to destroy all of the objects that were created. You did not
have to keep track of any of these objects yourself --- all you had to do
was to call @code{Simulator::Destroy} and exit. The @command{ns-3} system
took care of the hard part for you. The remaining lines of our first
@command{ns-3} script, @code{first.cc}, do just that:
@verbatim
Simulator::Destroy ();
return 0;
}
@end verbatim
@subsection Building Your Script
We have made it trivial to build your simple scripts. All you have to do is
to drop your script into the scratch directory and it will automatically be
built if you run Waf. Let's try it. Copy @code{examples/first.cc} into
the @code{scratch} directory.
@verbatim
~/repos/ns-3-dev > cp examples/first.cc scratch/
@end verbatim
and then build it using waf,
@verbatim
~/repos/ns-3-dev > ./waf
Entering directory `/home/craigdo/repos/ns-3-dev/build'
[432/477] cxx: scratch/first.cc -> build/debug/scratch/first_2.o
[475/477] cxx_link: build/debug/scratch/first_2.o ...
Compilation finished successfully
~/repos/ns-3-dev >
@end verbatim
You can now run the example (note that if you build your program in the scratch
directory you must run it out of the scratch direcory):
@verbatim
~/repos/ns-3-dev > ./waf --run scratch/first
Entering directory `/home/craigdo/repos/ns-3-dev/build'
Compilation finished successfully
Sent 1024 bytes to 10.1.1.2
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.1.2
~/repos/ns-3-dev >
@end verbatim
Here you see that the build system checks to make sure that the file has been
build and then runs it. You see the logging component on the echo client
indicate that it has sent one 1024 byte packet to the Echo Server on
10.1.1.2. You also see the logging component on the echo server say that
it has received the 1024 bytes from 10.1.1.1. The echo server silently
echoes the packet and you see the echo client log that it has received its
packet back from the server.
@c ========================================================================
@c Browsing ns-3
@c ========================================================================
@node Ns-3 Source Code
@section Ns-3 Source Code
Now that you have used some of the @command{ns-3} helpers you may want to
have a look at some of the source code that implements that functionality.
The most recent code can be browsed on our web server at the following link:
@uref{http://code.nsnam.org/?sort=lastchange}. If you click on the bold
repository names on the left of the page, you will see @emph{changelogs} for
these repositories, and links to the @emph{manifest}. From the manifest
links, one can browse the source tree.
The top-level directory for one of our @emph{repositories} will look
something like:
@verbatim
drwxr-xr-x [up]
drwxr-xr-x doc manifest
drwxr-xr-x examples manifest
drwxr-xr-x ns3 manifest
drwxr-xr-x regression manifest
drwxr-xr-x samples manifest
drwxr-xr-x scratch manifest
drwxr-xr-x src manifest
drwxr-xr-x tutorial manifest
drwxr-xr-x utils manifest
-rw-r--r-- 135 .hgignore file | revisions | annotate
-rw-r--r-- 891 .hgtags file | revisions | annotate
-rw-r--r-- 441 AUTHORS file | revisions | annotate
-rw-r--r-- 17987 LICENSE file | revisions | annotate
-rw-r--r-- 4948 README file | revisions | annotate
-rw-r--r-- 4917 RELEASE_NOTES file | revisions | annotate
-rw-r--r-- 7 VERSION file | revisions | annotate
-rwxr-xr-x 99143 waf file | revisions | annotate
-rwxr-xr-x 28 waf.bat file | revisions | annotate
-rw-r--r-- 30584 wscript file | revisions | annotate
@end verbatim
The source code is mainly in the @code{src} directory. You can view source
code by clicking on the @code{manifest} link to the right of the directory
name. If you click on the @code{manifest} link to the right of the src
directory you will find a subdirectory. If you click on the @code{manifest}
link next to the @code{core} subdirectory in under @code{src}, you will find
a list of files. The first file you will find is @code{assert.h}. If you
click on the @code{file} link, you will be sent to the source file for
@code{assert.h}.
Our example scripts are in the @code{examples} directory. The source code for
the helpers we have used in this chapter can be found in the
@code{src/helpers} directory.
+18
View File
@@ -0,0 +1,18 @@
Please write image files in a vector graphics format, when possible, and
generate the .png and .pdf versions on the fly (see ../Makefile).
Currently supported tools are dia and tgif. xfig could be added similarly
if someone wants to add it. The main requirement for adding another format
is that the tool to edit it is freely available and that a cron script can
autogenerate the pdf and png from the figure source.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
If the figure is not available in a vector graphics format, store both
a .png and a .pdf version in this directory.
If you add a source (.dia, .obj) file here, remember to add it to
the list of figure sources in the Makefile in the directory above
Note: tgif can convert from .obj to .pdf, but the pdf that results takes
up a whole page. Instead, we convert to an intermediate .eps step, and
then run epstopdf.
Binary file not shown.
+115
View File
@@ -0,0 +1,115 @@
%TGIF 4.1.43-QPL
state(0,37,100.000,0,0,0,32,1,9,1,1,0,0,1,2,1,0,'Courier',0,80640,0,2,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0).
%
% @(#)$Header$
% %W%
%
unit("1 pixel/pixel").
color_info(11,65535,0,[
"magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
"red", 65535, 0, 0, 65535, 0, 0, 1,
"green", 0, 65535, 0, 0, 65535, 0, 1,
"blue", 0, 0, 65535, 0, 0, 65535, 1,
"yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
"pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
"cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
"CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
"white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
"black", 0, 0, 0, 0, 0, 0, 1,
"DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
]).
script_frac("0.6").
fg_bg_colors('black','white').
dont_reencode("FFDingbests:ZapfDingbats").
page(1,"",1,'').
text('black',272,195,2,0,1,248,36,0,13,5,0,0,0,0,2,248,36,0,0,"",0,0,0,0,208,'',[
minilines(248,36,0,0,0,0,0,[
mini_line(200,13,5,0,0,0,[
str_block(0,200,13,5,0,-8,0,0,0,[
str_seg('black','Courier',0,80640,200,13,5,0,-8,0,0,0,0,0,
"low-level APIs (all src/ ")])
]),
mini_line(248,13,5,0,0,0,[
str_block(0,248,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,248,13,5,0,-2,0,0,0,0,0,
"directories except src/helper/)")])
])
])]).
rcbox('black','',96,240,384,288,5,1,1,0,16,2,0,0,0,0,'1',0,[
]).
text('black',192,259,1,0,1,112,18,3,13,5,2,0,0,0,2,112,18,0,0,"",0,0,0,0,272,'',[
minilines(112,18,0,0,0,0,0,[
mini_line(112,13,5,0,0,0,[
str_block(0,112,13,5,0,0,0,0,0,[
str_seg('black','Courier',0,80640,112,13,5,0,0,0,0,0,0,0,
"ns-3 simulator")])
])
])]).
poly('black','',2,[
272,208,240,240],0,1,1,17,0,0,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
poly('black','',2,[
240,176,240,240],1,1,1,18,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
rcbox('black','',176,128,384,176,5,1,1,0,16,25,0,0,0,0,'1',0,[
]).
text('black',192,131,2,0,1,120,36,26,13,5,2,0,0,0,2,120,36,0,0,"",0,0,0,0,144,'',[
minilines(120,36,0,0,0,0,0,[
mini_line(120,13,5,0,0,0,[
str_block(0,120,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,120,13,5,0,-1,0,0,0,0,0,
"ns-3 helper API")])
]),
mini_line(96,13,5,0,0,0,[
str_block(0,96,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,96,13,5,0,-2,0,0,0,0,0,
"(src/helper)")])
])
])]).
rcbox('black','',96,16,384,64,0,1,1,0,16,32,0,0,0,0,'1',0,[
]).
poly('black','',2,[
240,64,240,128],1,1,1,36,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',272,83,2,0,1,200,36,40,13,5,0,0,0,0,2,200,36,0,0,"",0,0,0,0,96,'',[
minilines(200,36,0,0,0,0,0,[
mini_line(200,13,5,0,0,0,[
str_block(0,200,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,200,13,5,0,-2,0,0,0,0,0,
"helper APIs (src/helper/)")])
]),
mini_line(192,13,5,0,0,0,[
str_block(0,192,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,192,13,5,0,-1,0,0,0,0,0,
"call into low-level APIs")])
])
])]).
poly('black','',2,[
272,96,240,128],0,1,1,41,0,0,2,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
text('black',128,19,2,0,1,232,36,47,13,5,0,0,0,0,2,232,36,0,0,"",0,0,0,0,32,'',[
minilines(232,36,0,0,0,0,0,[
mini_line(224,13,5,0,0,0,[
str_block(0,224,13,5,0,-2,0,0,0,[
str_seg('black','Courier',0,80640,224,13,5,0,-2,0,0,0,0,0,
"ns-3 scripts (main programs)")])
]),
mini_line(232,13,5,0,0,0,[
str_block(0,232,13,5,0,-1,0,0,0,[
str_seg('black','Courier',0,80640,232,13,5,0,-1,0,0,0,0,0,
"- may use either or both APIs")])
])
])]).
poly('black','',2,[
144,64,144,240],1,1,1,50,0,0,0,0,0,0,0,'1',0,0,
"0","",[
0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[
]).
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+299
View File
@@ -0,0 +1,299 @@
@c ========================================================================
@c Begin document body here
@c ========================================================================
@c ========================================================================
@c PART: Getting Started
@c ========================================================================
@c The below chapters are under the major heading "Getting Started"
@c This is similar to the Latex \part command
@c
@c ========================================================================
@c Getting Started
@c ========================================================================
@node Getting Started
@chapter Getting Started
@menu
* Downloading ns-3::
* Building ns-3::
* Testing ns-3::
* Running a Script::
@end menu
@c ========================================================================
@c Downloading ns-3
@c ========================================================================
@node Downloading ns-3
@section Downloading ns-3
@cindex Linux
@cindex Cygwin
@cindex GNU
@cindex toolchain
@cindex Mercurial
@cindex Waf
From this point forward, we are going to assume that the reader is working in
Linux or a Linux emulation environment (Linux, Cygwin, etc.) and has the GNU
toolchain installed and verified. We are also going to assume that you have
Mercurial and Waf installed and running on the target system as described in
the Getting Started section of the @command{ns-3} web site:
@uref{http://www.nsnam.org/getting_started.html}.
@cindex tarball
The @command{ns-3} code is available in Mercurial repositories on the server
code.nsnam.org. You can download a tarball, but we recommend working with
Mercurial --- it will make your life easier in the long run.
@cindex repository
If you go to the following link: @uref{http://code.nsnam.org/},
you will see a number of repositories. Many are the private repositories of
the @command{ns-3} development team. The repositories of interest to you will
be prefixed with ``ns-3''. The current development snapshot (unreleased)
of @command{ns-3} may be found at: @uref{http://code.nsnam.org/ns-3-dev/}.
Official releases of @command{ns-3} will be numbered as @code{ns-3.<release>}
with any requred hotfixes added as minor release numbers. For example, a
second hotfix to a hypothetical release nine of @command{ns-3} would be
numbered @code{ns-3.9.2}.
The current development snapshot (unreleased) of @command{ns-3} may be found
at: @uref{http://code.nsnam.org/ns-3-dev/}. The developers attempt to keep
this repository in a consistent, working state but it is a development area
with unreleased code present, so you may want to consider staying with an
official release.
Since the release numbers are going to be changing, I will stick with
the more constant ns-3-dev here in the tutorial, but you can replace the
string ``ns-3-dev'' with your choice of release (e.g., ns-3.1) in the text
below. You can find the latest version of the code either by inspection of
the repository list or by going to the ``Getting Started'' web page and
looking for the latest release identifier.
One practice is to create a directory called @code{repos} in one's home
directory under which one can keep local Mercurial repositories.
@emph{Hint: we will assume you do this later in the tutorial.} If you adopt
that approach, you can get a copy of the development version of
@command{ns-3} by typing the following into your Linux shell (assuming you
have installed Mercurial):
@verbatim
cd
mkdir repos
cd repos
hg clone http://code.nanam.org/ns-3-dev
@end verbatim
As the hg (Mercurial) command executes, you should see something like the
following,
@verbatim
destination directory: ns-3-dev
requesting all changes
adding changesets
adding manifests
adding file changes
added 3276 changesets with 12301 changes to 1353 files
594 files updated, 0 files merged, 0 files removed, 0 files unresolved
@end verbatim
After the clone command completes, you should have a directory called
ns-3-dev under your @code{~/repos} directory, the contents of which should
look something like the following:
@verbatim
AUTHORS examples/ README samples/ utils/ waf.bat*
build/ LICENSE regression/ scratch/ VERSION wscript
doc/ ns3/ RELEASE_NOTES src/ waf*
@end verbatim
You are now ready to build the @command{ns-3} distribution.
@c ========================================================================
@c Building ns-3
@c ========================================================================
@node Building ns-3
@section Building ns-3
@cindex building with Waf
@cindex configuring Waf
@cindex building debug version with Waf
@cindex compiling with Waf
@cindex unit tests with Waf
@cindex regression tests with Waf
We use Waf to build the @command{ns-3} project. The first thing you will need
to do is to configure the build. For reasons that will become clear later,
we are going to work with debug builds in the tutorial. To explain to Waf
that it should do debug builds you will need to execute the following command,
@verbatim
./waf -d debug configure
@end verbatim
This runs Waf out of the local directory (which is provided as a convenience
for you). As the build system checks for various dependencies you should see
output that looks similar to the following,
@verbatim
~/repos/ns-3-dev >./waf -d debug configure
Checking for program g++ : ok /usr/bin/g++
Checking for compiler version : ok Version 4.1.2
Checking for program cpp : ok /usr/bin/cpp
Checking for program ar : ok /usr/bin/ar
Checking for program ranlib : ok /usr/bin/ranlib
Checking for compiler could create programs : ok
Checking for compiler could create shared libs : ok
Checking for compiler could create static libs : ok
Checking for flags -O2 -DNDEBUG : ok
Checking for flags -g -DDEBUG : ok
Checking for flags -g3 -O0 -DDEBUG : ok
Checking for flags -Wall : ok
Checking for g++ : ok
Checking for header stdlib.h : ok
Checking for header stdlib.h : ok
Checking for header signal.h : ok
Checking for high precision time implementation : 128-bit integer
Checking for header stdint.h : ok
Checking for header inttypes.h : ok
Checking for header sys/inttypes.h : not found
Checking for package gtk+-2.0 >= 2.12 : not found
Checking for package goocanvas gthread-2.0 : not found
Checking for program diff : ok /usr/bin/diff
Configuration finished successfully; project is now ready to build.
~/repos/ns-3-dev >
@end verbatim
The build system is now configured and you can build the debug versions of
the @command{ns-3} programs by simply typing,
@verbatim
./waf
@end verbatim
You will see many Waf status messages displayed as the system compiles. The
most important is the last one,
@verbatim
Compilation finished successfully
@end verbatim
@c ========================================================================
@c Testing ns-3
@c ========================================================================
@node Testing ns-3
@section Testing ns-3
@cindex unit tests
You can run the unit tests of the @command{ns-3} distribution by running the ``check''
command,
@verbatim
./waf check
@end verbatim
You should see a report from each unit test that executes indicating that the
test has passed.
@verbatim
~/repos/ns-3-dev > ./waf check
Entering directory `/home/craigdo/repos/ns-3-dev/build'
Compilation finished successfully
PASS AddressHelper
PASS Wifi
PASS DcfManager
...
PASS Object
PASS Ptr
PASS Callback
~/repos/ns-3-dev >
@end verbatim
@cindex regression tests
This command is typically run by @code{users} to quickly verify that an
@command{ns-3} distribution has built correctly.
You can also run our regression test suite to ensure that your distribution and
tool chain have produced binaries that generate output that is identical to
reference output files stored in a central location. To run the regression
tests, you provide Waf with the regression flag.
@verbatim
./waf --regression
@end verbatim
Waf will verify that the current files in the @command{ns-3} distribution are
built and will then look for trace files in the aforementioned centralized
location. If your tool chain includes Mercurial, the regression tests will
be downloaded from a repository at @code{code.nsnam.org}. If you do not have
Mercurial installed, the reference traces will be downloaded from a tarball
located in the releases section of @code{www.nsnam.org}. The particular name
of the reference trace location is built from the @command{ns-3} version
located in the VERSION file, so don't change that string yourself unless you
know what you are doing.
Once the reference traces are downloaded to your local machine, Waf will run
a number of tests that generate what we call trace files. The content of
these trace files are compared with the reference traces just downloaded. If
they are identical, the regression tests report a PASS status. If the
regression tests pass, you should see something like,
@verbatim
~/repos/ns-3-dev > ./waf --regression
Entering directory `/home/craigdo/repos/ns-3-dev/build'
Compilation finished successfully
========== Running Regression Tests ==========
Synchronizing reference traces using Mercurial.
http://code.nsnam.org/ns-3-dev-ref-traces
Done.
PASS test-csma-broadcast
PASS test-csma-multicast
PASS test-csma-one-subnet
PASS test-csma-packet-socket
PASS test-simple-error-model
PASS test-simple-global-routing
PASS test-simple-point-to-point-olsr
PASS test-tcp-large-transfer
PASS test-udp-echo
~/repos/ns-3-dev >
@end verbatim
If a regression tests fails you will see a FAIL indication along with a
pointer to the offending trace file and its associated reference trace file
along with a suggestion on diff parameters and options in order to see what
has gone awry.
@c ========================================================================
@c Running a Script
@c ========================================================================
@node Running a Script
@section Running a Script
@cindex running a script with Waf
We typically run scripts under the control of Waf. This allows the build
system to ensure that the shared library paths are set correctly and that
the libraries are available at run time. To run a program, simply use the
@code{--run} option in Waf. Let's run the @command{ns-3} equivalent of the
ubiquitous hello world program by typing the following:
@verbatim
./waf --run hello-simulator
@end verbatim
Waf first checks to make sure that the program is built correctly and
executes a build if required. Waf then then executes the program, which
produces the following output.
@verbatim
Hello Simulator
@end verbatim
@emph{Congratulations. You are now an ns-3 user.}
If you want to run programs under another tool such as gdb or valgrind,
see this @uref{http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool,,wiki entry}.
+49
View File
@@ -0,0 +1,49 @@
TEXI2HTML = texi2html
TEXI2PDF = texi2dvi --pdf
EPSTOPDF = epstopdf
TGIF = tgif
DIA = dia
CONVERT = convert
CSS = --css-include=tutorial.css
SPLIT = --split section
DIA_SOURCES = pp.dia dumbbell.dia star.dia
TGIF_SOURCES = helpers.obj
DIA_EPS = ${DIA_SOURCES:.dia=.eps}
DIA_PNG = ${DIA_SOURCES:.dia=.png}
DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
TGIF_EPS = ${TGIF_SOURCES:.obj=.eps}
TGIF_PNG = ${TGIF_SOURCES:.obj=.png}
TGIF_PDF = ${TGIF_SOURCES:.obj=.pdf}
all: images html split-html pdf
# Note: tgif requires a valid x display to convert from .obj to .png.
# If running this makefile on a remote console, the X virtual frame
# buffer may be needed (xorg-x11-server-Xvfb) to provide a "fake"
# display
images:
cd figures/; $(DIA) -t png $(DIA_SOURCES)
cd figures/; $(DIA) -t eps $(DIA_SOURCES)
cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
cd figures/; $(TGIF) -print -png $(TGIF_SOURCES)
cd figures/; $(TGIF) -print -eps $(TGIF_SOURCES)
cd figures/; $(foreach FILE,$(TGIF_EPS),$(EPSTOPDF) $(FILE);)
html: images
$(TEXI2HTML) ${CSS} tutorial.texi
split-html: images
$(TEXI2HTML) ${CSS} ${SPLIT} tutorial.texi
pdf: images
$(TEXI2PDF) tutorial.texi
figures-clean:
cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
cd figures/; rm -rf $(TGIF_EPS); rm -rf $(TGIF_PNG); rm -rf $(TGIF_PDF)
clean: figures-clean
rm -rf tutorial.aux tutorial.cp tutorial.cps tutorial.fn tutorial.ky tutorial.pg tutorial.tp tutorial.vr tutorial.toc tutorial.log tutorial.pdf tutorial.html tutorial/
+535
View File
@@ -0,0 +1,535 @@
@node ns-3 Attributes
@chapter ns-3 Attributes
@anchor{chap:Attributes}
In ns-3 simulations, there are two main aspects to configuration:
@itemize @bullet
@item the simulation topology and how objects are connected
@item the values used by the models instantiated in the topology
@end itemize
This chapter focuses on the second item above: how the many values
in use in ns-3 are organized, documented, and modifiable by ns-3 users.
The ns-3 attribute system is also the underpinning of how traces
and statistics are gathered in the simulator.
Before delving into details of the attribute value system,
it will help to review some basic properties of @code{class ns3::Object}.
@node Object Overview
@section Object Overview
ns-3 is fundamentally a C++ object-based system. By this we mean that
new C++ classes (types) can be declared, defined, and subclassed
as usual.
Many ns-3 objects inherit from the @code{ns3::Object} base class. These
objects have some additional properties that we exploit for
organizing the system and improving the memory management
of our objects:
@itemize @bullet
@item a "metadata" system that links the class name to a lot of
meta-information about the object, including the base class of the subclass,
the set of accessible constructors in the subclass, and the set of
"attributes" of the subclass
@item a reference counting smart pointer implementation, for memory
management.
@end itemize
ns-3 objects that use the attribute system derive from either
@code{ns3::Object} or @code{ns3::ObjectBase}. Most ns-3 objects
we will discuss derive from @code{ns3::Object}, but a few that
are outside the smart pointer memory management framework derive
from @code{ns3::ObjectBase}.
Let's review a couple of properties of these objects.
@node Smart pointers
@subsection Smart pointers
As introduced above in @ref{Smart Pointers 101}, ns-3 objects
are memory managed by a
@uref{http://en.wikipedia.org/wiki/Smart_pointer,,reference counting smart pointer implementation}, @code{class ns3::Ptr}.
Smart pointers are used extensively in the ns-3 APIs, to avoid passing
references to heap-allocated objects that may cause memory leaks.
For most basic usage (syntax), treat a smart pointer like a regular pointer:
@verbatim
Ptr<WifiNetDevice> nd = ...;
nd->CallSomeFunction ();
// etc.
@end verbatim
@node CreateObject
@subsection CreateObject
As we discussed above in @ref{Object Creation},
at the lowest-level API, objects of type @code{ns3::Object} are
not instantiated using @code{operator new} as usual but instead by
a templated function called @code{CreateObject()}.
A typical way to create such an object is as follows:
@verbatim
Ptr<WifiNetDevice> nd = CreateObject<WifiNetDevice> ();
@end verbatim
You can think of this as being functionally equivalent to:
@verbatim
WifiNetDevice* nd = new WifiNetDevice ();
@end verbatim
Objects that derive from @code{ns3::Object} must be allocated
on the heap using CreateObject(). Those deriving from
@code{ns3::ObjectBase}, such as ns-3 helper functions and packet
headers and trailers, can be allocated on the stack.
In some scripts, you may not see a lot of CreateObject() calls
in the code;
this is because there are some helper objects in effect that
are doing the CreateObject()s for you.
@node TypeId
@subsection TypeId
ns-3 classes that derive from class ns3::Object can include
a metadata class called @code{TypeId} that records meta-information
about the class, for use in the object aggregation and component
manager systems:
@itemize @bullet
@item a unique string identifying the class
@item the base class of the subclass, within the metadata system
@item the set of accessible constructors in the subclass
@end itemize
@node Object Summary
@subsection Object Summary
Putting all of these concepts together, let's look at a specific
example: @code{class ns3::Node}.
The public header file node.h has a declaration that includes
a static GetTypeId function call:
@verbatim
class Node : public Object
{
public:
static TypeId GetTypeId (void);
...
@end verbatim
This is defined in the node.cc file as follows:
@verbatim
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
return tid;
}
@end verbatim
Finally, when users want to create Nodes, they call:
@verbatim
Ptr<Node> n = CreateObject<Node> n;
@end verbatim
We next discuss how attributes (values associated with member variables
or functions of the class) are plumbed into the above TypeId.
@node Attribute Overview
@section Attribute Overview
The goal of the attribute system is to organize the access of
internal member objects of a simulation. This goal arises because,
typically in simulation, users will cut and paste/modify existing
simulation scripts, or will use higher-level simulation constructs,
but often will be interested in studying or tracing particular
internal variables. For instance, use cases such as:
@itemize @bullet
@item "I want to trace the packets on the wireless interface only on
the first access point"
@item "I want to trace the value of the TCP congestion window (every
time it changes) on a particular TCP socket"
@item "I want a dump of all values that were used in my simulation."
@end itemize
Similarly, users may want fine-grained access to internal
variables in the simulation, or may want to broadly change the
initial value used for a particular parameter in all subsequently
created objects. Finally, users may wish to know what variables
are settable and retrievable in a simulation configuration. This
is not just for direct simulation interaction on the command line;
consider also a (future) graphical user interface
that would like to be able to provide a feature whereby a user
might right-click on an node on the canvas and see a hierarchical,
organized list of parameters that are settable on the node and its
constituent member objects, and help text and default values for
each parameter.
@node Functional overview
@subsection Functional overview
We provide a way for users to access values deep in the system, without
having to plumb accessors (pointers) through the system and walk
pointer chains to get to them. Consider a class DropTailQueue that
has a member variable that is an unsigned integer @code{m_maxPackets};
this member variable controls the depth of the queue.
If we look at the declaration of DropTailQueue, we see the following:
@verbatim
class DropTailQueue : public Queue {
public:
static TypeId GetTypeId (void);
...
private:
std::queue<Ptr<Packet> > m_packets;
uint32_t m_maxPackets;
};
@end verbatim
Let's consider things that a user may want to do with the value of
m_maxPackets:
@itemize @bullet
@item Set a default value for the system, such that whenever a new
DropTailQueue is created, this member is initialized to that default.
@item Set or get the value on an already instantiated queue.
@end itemize
The above things typically require providing Set() and Get() functions,
and some type of global default value.
In the ns-3 attribute system, these value definitions and accessor
functions are moved into the TypeId class; e.g.:
@verbatim
TypeId DropTailQueue::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::DropTailQueue")
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddAttribute ("MaxPackets", "The maximum number of packets accepted by this DropTailQueue.",
Uinteger (100),
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
@end verbatim
The AddAttribute() method is performing a number of things with this
value:
@itemize @bullet
@item Binding the variable m_maxPackets to a string "MaxPackets"
@item Providing a default value (100 packets)
@item Providing some help text defining the value
@item Providing a "checker" (not used in this example) that can be used to set
bounds on the allowable range of values
@end itemize
The key point is that now the value of this variable and its default
value are accessible in the attribute namespace, which is based on
strings such as "MaxPackets" and TypeId strings. In the next
section, we will provide an example script that shows how users
may manipulate these values.
@node Basic usage
@subsection Basic usage
Let's look at how a user script might access these values.
This is based on the script found at @code{samples/main-attribute-value.cc},
with some details stripped out.
@verbatim
//
// This is a basic example of how to use the attribute system to
// set and get a value in the underlying system; namely, an unsigned
// integer of the maximum number of packets in a queue
//
int
main (int argc, char *argv[])
{
// By default, the MaxPackets attribute has a value of 100 packets
// (this default can be observed in the function DropTailQueue::GetTypeId)
//
// Here, we set it to 80 packets. We could use one of two value types:
// a string-based value or a Uinteger value
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", String ("80"));
// The below function call is redundant
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", Uinteger(80));
// Allow the user to override any of the defaults and the above
// SetDefaults() at run-time, via command-line arguments
CommandLine cmd;
cmd.Parse (argc, argv);
@end verbatim
The main thing to notice in the above are the two calls to
@code{Config::SetDefault}. This is how we set the default value
for all subsequently instantiated DropTailQueues. We illustrate
that two types of Value classes, a String and a Uinteger class,
can be used to assign the value to the attribute named by
"ns3::DropTailQueue::MaxPackets".
Now, we will create a few objects using the low-level API; here,
our newly created queues will not have a m_maxPackets initialized to
100 packets but to 80 packets, because of what we did above with
default values.
@verbatim
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<PointToPointNetDevice> net0 = CreateObject<PointToPointNetDevice> ();
n0->AddDevice (net0);
Ptr<Queue> q = CreateObject<DropTailQueue> ();
net0->AddQueue(q);
@end verbatim
At this point, we have created a single node (Node 0) and a
single PointToPointNetDevice (NetDevice 0) and added a
DropTailQueue to it.
Now, we can manipulate the MaxPackets value of the already
instantiated DropTailQueue. Here are various ways to do that.
@subsubsection Pointer-based access
We assume that a smart pointer (Ptr) to a relevant network device is
in hand; here, it is the net0 pointer.
One way to change the value is to access a pointer to the
underlying queue and modify its attribute.
First, we observe that we can get a pointer to the (base class)
queue via the PointToPointNetDevice attributes, where it is called
TxQueue
@verbatim
Ptr<Queue> txQueue = net0->GetAttribute ("TxQueue");
@end verbatim
Using the GetObject function, we can perform a safe downcast
to a DropTailQueue, where MaxPackets is a member
@verbatim
Ptr<DropTailQueue> dtq = txQueue->GetObject <DropTailQueue> ();
NS_ASSERT (dtq);
@end verbatim
Next, we can get the value of an attribute on this queue
We have introduced wrapper "Value" classes for the underlying
data types, similar to Java wrappers around these types, since
the attribute system stores values and not disparate types.
Here, the attribute value is assigned to a Uinteger, and
the Get() method on this value produces the (unwrapped) uint32_t.
@verbatim
Uinteger limit = dtq->GetAttribute ("MaxPackets");
NS_LOG_INFO ("1. dtq limit: " << limit.Get () << " packets");
@end verbatim
Note that the above downcast is not really needed; we could have
done the same using the Ptr<Queue> even though the attribute
is a member of the subclass
@verbatim
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("2. txQueue limit: " << limit.Get () << " packets");
@end verbatim
Now, let's set it to another value (60 packets)
@verbatim
txQueue->SetAttribute("MaxPackets", Uinteger (60));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("3. txQueue limit changed: " << limit.Get () << " packets");
@end verbatim
@subsubsection Namespace-based access
An alternative way to get at the attribute is to use the configuration
namespace. Here, this attribute resides on a known path in this
namespace; this approach is useful if one doesn't have access to
the underlying pointers and would like to configure a specific
attribute with a single statement.
@verbatim
Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", Uinteger (25));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("4. txQueue limit changed through namespace: " <<
limit.Get () << " packets");
@end verbatim
We could have also used wildcards to set this value for all nodes
and all net devices (which in this simple example has the same
effect as the previous Set())
@verbatim
Config::Set ("/NodeList/*/DeviceList/*/TxQueue/MaxPackets", Uinteger (15));
limit = txQueue->GetAttribute ("MaxPackets");
NS_LOG_INFO ("5. txQueue limit changed through wildcarded namespace: " <<
limit.Get () << " packets");
@end verbatim
@node Setting through constructors and helper classes
@subsection Setting through constructors helper classes
Arbitrary combinations of attributes can be set and fetched from
the helper and low-level APIs; either from the constructors themselves:
@verbatim
Ptr<Object> p = CreateObject<MyNewObject> ("n1", v1, "n2", v2, ...);
@end verbatim
or from the higher-level helper APIs, such as:
@verbatim
mobility.SetPositionAllocator ("GridPositionAllocator",
"MinX", FpValue (-100.0),
"MinY", FpValue (-100.0),
"DeltaX", FpValue (5.0),
"DeltaY", FpValue (20.0),
"GridWidth", UintValue (20),
"LayoutType", "RowFirst");
@end verbatim
@node Value classes
@subsection Value classes
Readers will note the new Value classes. These can be thought of as
an intermediate class that can be used to convert from raw types to the
Values that are used by the system. Recall that this database is holding
objects of many types with a single generic type. Conversions to this
type can either be done using an intermediate class (IntValue, FpValue for
"floating point") or via strings. Direct implicit conversion of types
to Value is not really practical. So in the above, users have a choice
of using strings or values:
@verbatim
p->Set ("cwnd", "100"); // string-based setter
p->Set ("cwnd", IntValue(100)); // value-based setter
@end verbatim
The system provides some macros that help users declare and define
new Value subclasses for new types that they want to introduce into
the attribute system.
@node Extending attributes
@section Extending attributes
The ns-3 system will place a number of internal values under the
attribute system, but undoubtedly users will want to extend this
to pick up ones we have missed, or to add their own classes to this.
@subsection Adding an existing internal variable to the metadata system
// XXX revise me
Consider this variable in class TcpSocket:
@verbatim
uint32_t m_cWnd; // Congestion window
@end verbatim
Suppose that someone working with Tcp wanted to get or set the
value of that variable using the metadata system. If it were not
already provided by ns-3, the user could declare the following addition
in the metadata system (to the TypeId declaration for TcpSocket):
@verbatim
.AddParameter ("Congestion window",
"Tcp congestion window (bytes)",
MakeUIntParamSpec (&TcpSocket::m_cWnd, 1));
@end verbatim
Now, the user with a pointer to the TcpSocket can perform operations
such as setting and getting the value, without having to add these
functions explicitly. Furthermore, access controls can be applied, such
as allowing the parameter to be read and not written, or bounds
checking on the permissible values can be applied.
@subsection Adding a new TypeId
Here, we discuss the impact on a user who wants to add a new class to
ns-3; what additional things must be done to hook it into this system.
We've already introduced what a TypeId definition looks like:
@verbatim
TypeId
RandomWalk2dMobilityModel::GetTypeId (void)
{
static TypeId tid = TypeId ("RandomWalkMobilityModel")
.SetParent<MobilityModel> ()
.SetGroupName ("Mobility")
.AddConstructor<RandomWalk2dMobilityModel> ()
// followed by a number of Parameters
.AddParameter ("bounds",
"Bounds of the area to cruise.",
MakeRectangleParamSpec (&RandomWalk2dMobilityModel::m_bounds, Rectangle (0.0, 0.0, 100.0, 100.0)))
.AddParameter ("time",
"Change current direction and speed after moving for this delay.",
MakeTimeParamSpec (&RandomWalk2dMobilityModel::m_modeTime,
Seconds (1.0)))
// etc (more parameters).
@end verbatim
The declaration for this in the class declaration is one-line public
member method:
@verbatim
public:
static TypeId GetTypeId (void);
@end verbatim
@section Adding new class type to the Value system
From the perspective of the user who writes a new class in the system and
wants to hook it in to the attribute system, there is mainly the matter
of writing
the conversions to/from strings and Values. Most of this can be
copy/pasted with macro-ized code. For instance, consider class
Rectangle in the @code{src/mobility/} directory:
One line is added to the class declaration:
@verbatim
/**
* \brief a 2d rectangle
*/
class Rectangle
{
...
VALUE_HELPER_HEADER_1 (Rectangle);
};
@end verbatim
One templatized declaration, and two operators, are added below the
class declaration:
@verbatim
std::ostream &operator << (std::ostream &os, const Rectangle &rectangle);
std::istream &operator >> (std::istream &is, Rectangle &rectangle);
VALUE_HELPER_HEADER_2 (Rectangle);
@end verbatim
In the class definition, the code looks like this:
@verbatim
VALUE_HELPER_CPP (Rectangle);
std::ostream &
operator << (std::ostream &os, const Rectangle &rectangle)
{
os << rectangle.xMin << "|" << rectangle.xMax << "|" << rectangle.yMin << "|" << rectangle.yMax;
return os;
}
std::istream &
operator >> (std::istream &is, Rectangle &rectangle)
{
char c1, c2, c3;
is >> rectangle.xMin >> c1 >> rectangle.xMax >> c2 >> rectangle.yMin >> c3 >> rectangle.yMax;
if (c1 != '|' ||
c2 != '|' ||
c3 != '|')
{
is.setstate (std::ios_base::failbit);
}
return is;
}
@end verbatim
These stream operators simply convert from a string representation of the
Rectangle ("xMin|xMax|yMin|yMax") to the underlying Rectangle, and the
modeler must specify these operators and the string syntactical representation
of an instance of the new class.
+20
View File
@@ -0,0 +1,20 @@
@node Helper Functions
@chapter Helper Functions
@anchor{chap:Helpers}
This chapter describes an intermediate API for the simulator; what we
call the "helper API". The helper API is implemented in
@code{src/helper/} directory; it depends on (and wraps) the low-level
API which is implemented everywhere else in @code{src/}. The following
figure shows this relationship.
@center @image{figures/helpers,,,,png}
The use of the helper API is optional. It has two main goals:
@itemize @bullet
@item Provide "syntactic sugar" to wrap a number of related low-level
API calls together, that would normally be grouped together often, into
something that is more user-friendly.
@item Handle configuration of larger topological units (e.g., a set
of nodes or a set of nodes on a particular link) .
@end itemize
(more to follow)
File diff suppressed because it is too large. Load diff
+24
View File
@@ -0,0 +1,24 @@
@node Logging
@chapter Logging
@anchor{chap:Logging}
This chapter is the first in a series of chapters discussing things that
one can do to modify the input or output of existing ns-3 scripts.
Examples:
@itemize @bullet
@item Enable or disable the generation of log messages, with fine granularity
@item Set default values for configuration values in the system
@item Generate a report of all configuration values used during a simulation
run (not yet implemented)
@item Set or get values of member variables on objects already instantiated
@item Customizing the tracing output of the script
@item Generate statistics on (not yet implemented)
@item Perform a large number of independent runs of the same simulation
@end itemize
@node Logging Basics
@section Logging Basics
@node Enabling Log Output
@section Enabling Log Output
File diff suppressed because it is too large. Load diff
+462
View File
@@ -0,0 +1,462 @@
@c ========================================================================
@c Simulation Output
@c ========================================================================
@node Simulation Output
@chapter Simulation Output
At this point, you should be able to execute any of the built-in
programs distributed with @command{ns-3}. Next, we will look at
how to generate and tailor the simulation output, before turning
to how to modify simulation scripts to do different things.
@node Tracing Basics
@section Tracing Basics
The whole point of simulation is to generate output for further
study, and the @command{ns-3} tracing system is a primary
mechanism for this.
Since @command{ns-3} is a C++ program, standard facilities for
generating output from C++ programs apply:
@verbatim
#include <iostream>
...
int main ()
{
...
std::cout << "The value of x is " << x << std::endl;
...
}
@end verbatim
The goal of the @command{ns-3} tracing system is to
provide a structured way to configure the simulator to output results
in standard or modifiable formats.
@itemize @bullet
@item For basic tasks, the tracing system should allow the user to
generate standard tracing for popular tracing sources, and to customize
which objects generate the tracing.
@item Intermediate users will be able to extend the tracing system to
modify the output format generated, or to insert new tracing sources,
without modifying the core of the simulator.
@item Advanced users can modify the simulator core to add new
tracing sources and sinks.
@end itemize
The @command{ns-3} tracing system is fundamentally built on the
concept of separating tracing sources from sinks.
@enumerate
@item Trace sources (e.g., provide access to every packet received)
@item Trace sinks (e.g., print out the packet)
@item A mechanism to tie together sources and sinks
@end enumerate
The rationale for this division is to allow users to attach new
types of sinks to existing tracing sources, without requiring
users to edit and recompile the core of the simulator.
Thus, in the example above, a user could write a new tracing sink
and attach it to an existing tracing source. What remains to
be defined is a way for users to find these hooks (tracing sources)
and attach sinks to them. A new tracing namespace is defined for
this purpose.
We will first walk through how some pre-defined sources and sinks
are provided and may be customized with little user effort. We
return later in this chapter to advanced tracing configuration including
extending the tracing namespace and creating new tracing sources.
@subsection ASCII tracing
@cindex ASCII
For Internet nodes, the ASCII trace wrapper is a wrapper around
the @command{ns-3} low-level
tracing system that lets you get access to underlying trace events easily.
The output of a trace of a simulation run is an ASCII file --- thus the name.
In the spririt of keeping things simple, you won't be able to control or
configure the output at this stage.
For those familiar with @command{ns-2} output, this type of trace is
analogous to the @command{out.tr} generated by many scripts.
@cindex tracing packets
Let's just jump right in. As usual, we need to include the definitions
related to using ASCII tracing (don't edit any files quite yet):
@verbatim
#include "ns3/ascii-trace.h"
@end verbatim
We then need to add the code to the script to actually enable the ASCII tracing
code. The following code must be inserted before the call to
@code{Simulator::Run ();}:
@verbatim
AsciiTrace asciitrace ("tutorial.tr");
asciitrace.TraceAllQueues ();
asciitrace.TraceAllNetDeviceRx ();
@end verbatim
The first line declares an object of type @code{AsciiTrace} named
@code{asciitrace} and passes a string parameter to its constructor. This
parameter is a file name to which all of the trace information will be written.
The second line, @code{asciitrace.TraceAllQueues ();} asks the trace object to
arrange that all queue operations (enqueue, dequeue, drop) on the queues
in all of the nodes of the system be traced. On the receive side,
@code{asciitrace.TraceAlllNetDeviceRx ()} traces packets received by
a NetDevice. For those familiar with @command{ns-2}, these are equivalent
to the popular trace points that log "+", "-", "d", and "r" events.
Try running the following program from the command line:
@verbatim
./waf --run tutorial-csma-echo-ascii-trace
@end verbatim
@cindex tutorial.tr
Just as you have seen previously, you will see some messages from @emph{Waf}
and then the ``Compilation finished successfully'' message. The
next message, @code{UDP Echo Simulation} is from the running program. When
it ran, the program will have created a file named @code{tutorial.tr}.
Because of the way that Waf works, the file is not created in the local
directory, it is created at the top-level directory of the repository. So,
change into the top level directory and take a look at the file
@code{tutorial.tr} in your favorite editor.
@subsubsection Parsing Ascii Traces
@cindex parsing ascii traces
This section parses in detail the structure of the ascii tracing
output. If you find this output format self explanatory (it
resembles tcpdump output), you may skip to the next
section on pcap tracing.
@cindex trace event
There's a lot of information there in a pretty dense form, but the first thing
to notice is that there are a number of distinct lines in this file. It may
be difficult to see this clearly unless you widen your windows considerably.
Each line in the file corresponds to a @emph{trace event}. A trace event
happens whenever specific conditions happen in the simulation. In this case
we are tracing events on the @emph{device queue} present in every net device
on every node in the simulation. The device queue is a queue through which
every packet destined for a channel must pass --- it is the device
@emph{transmit} queue. Note that each line in the trace file begins with a
lone character (has a space after it). This character will have the following
meaning:
@cindex enqueue
@cindex dequeue
@cindex drop
@itemize @bullet
@item @code{+}: An enqueue operation occurred on the device queue;
@item @code{-}: A dequeue operation occurred on the device queue;
@item @code{d}: A packet was dropped, typically because the queue was full.
@end itemize
Let's take a more detailed view of the first line. I'll break it down into
sections (indented for clarity) with a two digit reference number on the
left side:
@verbatim
00 +
01 2
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=9
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:00,
09 destination=ff:ff:ff:ff:ff:ff
10 ARP(request
11 source mac: 08:00:2e:00:00:00
12 source ipv4: 10.1.1.1
13 dest ipv4: 10.1.1.2)
14 ETHERNET fcs=0
@end verbatim
@cindex trace event
@cindex simulation time
The first line of this expanded trace event (reference number 00) is the
queue operation. We have a @code{+} character, so this corresponds to an
@emph{enqueue} operation. The second line (reference 01) is the simulation
time expressed in seconds. You may recall that we asked the
@code{UdpEchoClient} to start sending packets at two seconds. Here we see
confirmation that this is, indeed, happening.
@cindex node number
@cindex net device number
@cindex smart pointer
The next lines of the example listing (references 02 and 03) tell us that
this trace event originated in a given node and net device. Each time a node
is created it is given an identifying number that monotonically increases from
zero. Therefore, @code{nodeid=0} means that the node in which the given trace
event originated is the first node we created. In the case of our script,
this first node is is the node pointed to by the smart pointer @code{n0}. Not
too surpsisingly, this is also the node to which we attached the
@code{UdpEchoClient}. The device number is local to each node, and so the
device given by @code{device=0} is the first net device that we added to the
node in question. In our simulation, this corresponds to the
@code{CsmaNetDevice} we added to node zero (@code{n0}).
@cindex uid
@cindex unique ID
@cindex packet
The next line (reference 04) is a more readable form of the operation code
seen in the first line --- i.e., the character @code{+} means
@code{queue-enqueue}. Reference number 05 indicates that the @emph{unique id}
of the packet being enqueued is @code{9}. The fact that the first packet we
see has a unique ID of 9 should indicates to you that other things have
happened in the protocol stack before we got to this point. This will become
clear momentarily.
@cindex Ethernet
@cindex MAC address
Reference items 06 and 14 indicate that this is an Ethernet packet with
a zero (not computed) checksum (note the indentation to make parsing this
trace event a little easier). Reference 08 and 09 are the source and
destination addresses of this packet. The packet is from the MAC address we
assigned to the node zero net device in the script, and is destined for the
broadcast address --- this is a broadcast packet.
@cindex Address Resolution Protocol
@cindex ARP
@cindex ARP|request
Reference items 10 through 13 make clear what is happening. This is an ARP
(Address Resolution Protocol) request for the MAC address of the node on
which the @code{UdpEchoServer} resides. The protocol stack can't send a UDP
packet to be echoed until it knows (resolves) the MAC address; and this trace
event corresponds to an ARP request being queued for transmission to the local
network. The next line in the trace file (partially expanded),
@verbatim
00 -
01 2
02 nodeid=0
03 device=0
04 queue-dequeue
05 pkt-uid=9
...
@end verbatim
shows the (same) ARP request packet being dequeued from the device queue by
the net device and (implicitly) being sent down the channel to the broadcast
MAC address. We are not tracing net device reception events so we don't
actually see all of the net devices receiving the broadcast packet. We do,
however see the following in the third line of the trace file:
@verbatim
00 +
01 2.00207
02 nodeid=1
03 device=0
04 queue-enqueue
05 pkt-uid=10
06 ETHERNET
07 length/type=0x806,
08 source=08:00:2e:00:00:01,
09 destination=08:00:2e:00:00:00,
10 ARP(reply
11 source mac: 08:00:2e:00:00:01
12 source ipv4: 10.1.1.2
13 dest mac: 08:00:2e:00:00:00
14 dest ipv4: 10.1.1.1)
15 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex ARP|response
Notice that this is a queue-enqueue operation (references 00 and 04) happening
on node one (reference 02) at simulation time 2.00207 seconds (reference 01).
Looking at the packet payload (references 10-14) we see that this is an ARP
reply to the request sent by node one. Note that the simulation time
(reference 01) is now 2.00207 seconds. This is direct result of the data rate
(5 mb/s) and latency (2 ms) parameters that we passed to the
@code{CsmaChannel} when we created it. Clearly the ARP request packet was
sent over the channel and received approximately 2 ms later by node one. A
corresponding ARP response packet was created and enqueued on node one's net
device. It is this enqueue trace event that has being logged.
@cindex queue
@cindex queue|transmit
@cindex echo
Given the current state of affairs, the next thing you may expect to see is
this ARP request being received by node zero, but remember we are only looking
at trace events on the device @emph{transmit} queue. The reception of the ARP
response by node zero will not directly trigger any trace event in this case,
but it will enable the protocol stack to continue what it was originally doing
(trying to send an echo packet). Thus, the next line we see in the trace file
(@code{tutorial.tr}) is the first UDP echo packet being sent to the net device.
@verbatim
00 +
01 2.00415
02 nodeid=0
03 device=0
04 queue-enqueue
05 pkt-uid=7
06 ETHERNET
07 length/type=0x800,
08 source=08:00:2e:00:00:00,
09 destination=08:00:2e:00:00:01
10 IPV4(
11 tos 0x0
12 ttl 64
13 id 0
14 offset 0
15 flags [none]
16 length: 1052) 10.1.1.1 > 10.1.1.2
17 UDP(length: 1032)
18 49153 > 7
19 DATA (length 1024)
20 ETHERNET fcs=0
@end verbatim
@cindex simulation time
@cindex echo
@cindex ARP
@cindex ARP|request
@cindex ARP|response
@cindex IP
@cindex Ipv4
I won't go into too much detail about this packet, but I will point out a
few key items in the trace. First, the packet was enqueued at simulation time
of 2.00415 seconds. This time reflects the fact that the echo client
application started at 2. seconds and there were two ARP packets transmitted
across the network (two milliseconds + data transmission time each way). The
packet unique identifier (reference 05) is 7. Notice that this is a lower
number than the ARP request packet, which had a unique ID of 9. This tells
us that the UDP packet was actually created before the ARP request packet ---
which makes perfect sense since it was the attempt to send packet 7 that
triggered sending the ARP request packet 9. Note that this an Ethernet
packet (reference 06) like all other packets in this simulation, however this
particular packet carries an IPV4 payload and therefore has an IP version 4
header (indicated by references 10-16). This Ipv4 in turn contains a UDP
header (references 17, 18) and finally 1024 bytes of data (reference 20).
Clearly, this is the UDP echo packet emitted by the
@code{UdpEchoClient Application}.
The next trace event is an ARP request from node one. We can infer that node
one has received the UDP echo packet and the @code{UdpEchoServer Application}
on that node has turned the packet around. Just as node zero needed to ARP
for the MAC address of node one, now node one must ARP for the MAC address of
node zero. We see the ARP request enqueued on the transmit queue of node one;
then we see the ARP request dequeued from the tranmit queue of node one (and
implicitly transmitted to node zero). Then we see an ARP response enqueued
on the transmit queue of node zero; and finally the ARP response dequeued (and
implicitly transmitted back to node one).
This exchange is summarized in the following trace event excerpts,
@verbatim
+ 2.00786 nodeid=1 ... ARP(request ...
- 2.00786 nodeid=1 ... ARP(request ...
+ 2.00994 nodeid=0 ... ARP(reply ...
- 2.00994 nodeid=0 ... ARP(reply ...
@end verbatim
The final two trace events in the @code{tutorial.tr} file correspond to the
echoed packet being enqueued for transmission on the net device for node one,
and that packet being dequeued (and implicitly transmitted back to node zero).
@cindex AsciiTrace!TraceAllNetDeviceRx
@cindex ARP!request
If you look at the trace file (@code{tutorial.tr}) you will also see some
entries with an @code{r} event, indicating a
@emph{receive} trace event. Recall that the first packet sent on the network
was a broadcast ARP request. We should then see all four nodes receive a
copy of this request. This is the case, as the first four receive trace
events are,
@verbatim
r 2.00207 nodeid=0 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=1 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=2 device=0 dev-rx pkt-uid=9 ARP(request ...
r 2.00207 nodeid=3 device=0 dev-rx pkt-uid=9 ARP(request ...
@end verbatim
@cindex unique ID
You can see that a copy of the broadcast packet with unique ID 9 was received
by the net devices on nodes 0, 1, 2 and 3. We leave it up to you to parse the
rest of the trace file and understand the remaining reception events.
@subsection PCAP Trace Wrapper
@cindex pcap
@cindex Wireshark
The @command{ns-3} @emph{pcap trace wrapper} is used to create trace files in
@code{.pcap} format. The acronym pcap (usually written in lower case) stands
for @emph{p}acket @emph{cap}ture, and is actually an API that includes the
definition of a @code{.pcap} file format. The most popular program that can
read and display this format is Wireshark (formerly called Ethereal).
However, there are many traffic trace analyzers that use this packet
format, including X, Y, and Z. We encourage users to exploit the
many tools available for analyzing pcap traces; below, we show how
tcpdump and Wireshark can be used..
@cindex tutorial-csma-echo-ascii-trace.cc
@cindex tutorial-csma-echo-pcap-trace.cc
The code used to enable pcap tracing is similar to that for ASCII tracing.
We have provided another file, @code{tutorial-csma-echo-pcap-trace.cc} that
uses the pcap trace wrapper. We have added the code to include the pcap
trace wrapper defintions:
@verbatim
#include "ns3/pcap-trace.h"
@end verbatim
And then added the following code below the AsciiTrace methods:
@cindex PcapTrace
@cindex PcapTrace!TraceAllIp
@verbatim
PcapTrace pcaptrace ("tutorial.pcap");
pcaptrace.TraceAllIp ();
@end verbatim
The first line of the code immediately above declares an object of type
@code{PcapTrace} named @code{pcaptrace} and passes a string parameter to its
constructor. This object is used to hide the details of the actual tracing
subsystem. The parameter is a base file name from which the actual trace file
names will be built. The second line of code tells the @code{PcamTrace}
object to trace all IP activity in all of the nodes present in the simulation.
@cindex interface index
Trace files are not created until trace activity is detected. Each file name
is composed of the base file name, followed by a @code{'-'}, a node id followed
by a @code{'-}', and an IP interface index. You will soon see a file named
@code{tutorial.pcap-0-1}, for example. This will be the trace file generated
as events are detected on node zero, interface index one. N.B. Interface
indices are different that net device indices --- interface index zero
corresponds to the loopback interface and interface index one corresponds to
the first net device you added to a node.
You may run the new program just like all of the others so far:
@cindex Waf
@verbatim
./waf --run tutorial-csma-echo-pcap-trace
@end verbatim
If you look at the top level directory of your distribution, you should now
see three log files: @code{tutorial.tr} is the ASCII trace file we have
previously examined. @code{tutorial.pcap-0-1} and @code{tutorial.pcap-1-1}
are the new pcap files we just generated. There will not be files
corresponding to nodes two and three since we have not sent any IP packets to
those nodes.
@subsubsection Reading output with tcpdump
@cindex tcpdump
@subsubsection Reading output with Wireshark
@cindex Wireshark
If you are unfamilar with Wireshark, there is a web site available from which
you can download programs and documentation: @uref{http://www.wireshark.org/}.
If you have Wireshark available, you can open each of the trace files and
display the contents as if you had captured the packets using a
@emph{packet sniffer}. Note that only IP packets are traced using this
wrapper, so you will not see the ARP exchanges that were logged when using
the ASCII trace wrapper. You are encouraged to take a look at the contents
of these pcap files using your favorite pcap software (or Wireshark).
@node Advanced Tracing
@section Advanced Tracing
+9
View File
@@ -0,0 +1,9 @@
@node Statistics
@chapter Statistics
@anchor{chap:Statistics}
ns-3 does not presently have support for statistics (automatically generated
statistical output). This is planned
for development later in 2008. If you are interested in contributing,
please see @uref{http://www.nsnam.org/wiki/index.php/Suggested_Projects,,our suggested projects page} or contact the ns-developers
list.
+82
View File
@@ -0,0 +1,82 @@
@node Troubleshooting
@chapter Troubleshooting
This chapter posts some information about possibly common errors in building
or running ns-3 programs.
Please note that the wiki (@uref{http://www.nsnam.org/wiki/index.php/Troubleshooting}) may have contributed items.
@node Build errors
@section Build errors
@node Run-time errors
@section Run-time errors
Sometimes, errors can occur with a program after a successful build. These
are run-time errors, and can commonly occur when memory is corrupted or
pointer values are unexpectedly null.
Here is an example of what might occur:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
Command ['/home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point'] exited with code -11
@end verbatim
The error message says that the program terminated unsuccessfully, but it is
not clear from this information what might be wrong. To examine more
closely, try running it under the @uref{http://sources.redhat.com/gdb/,,gdb debugger}:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="gdb %s"
Entering directory `/home/tomh/ns-3-nsc/build'
Compilation finished successfully
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/tomh/ns-3-nsc/build/debug/examples/tcp-point-to-point
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xf5c000
Program received signal SIGSEGV, Segmentation fault.
0x0804aa12 in main (argc=1, argv=0xbfdfefa4)
at ../examples/tcp-point-to-point.cc:136
136 Ptr<Socket> localSocket = socketFactory->CreateSocket ();
(gdb) p localSocket
$1 = {m_ptr = 0x3c5d65}
(gdb) p socketFactory
$2 = {m_ptr = 0x0}
(gdb) quit
The program is running. Exit anyway? (y or n) y
@end verbatim
Note first the way the program was invoked-- pass the command to run as
an argument to the command template "gdb %s".
This tells us that there was an attempt to dereference a null pointer
socketFactory.
Let's look around line 136 of tcp-point-to-point, as gdb suggests:
@verbatim
Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
localSocket->Bind ();
@end verbatim
The culprit here is that the return value of GetObject is not being
checked and may be null.
Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
checker} for more subtle errors. Again, you invoke the use of valgrind
similarly:
@verbatim
ns-old:~/ns-3-nsc$ ./waf --run tcp-point-to-point --command-template="valgrind %s"
@end verbatim
+156
View File
@@ -0,0 +1,156 @@
body {
font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
background: white;
color: black;
font-size: 11pt;
}
h1, h2, h3, h4, h5, h6 {
# color: #990000;
color: #009999;
}
pre {
font-size: 10pt;
background: #e0e0e0;
color: black;
}
a:link, a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
img {
border: 0px;
}
#main th {
font-size: 12pt;
background: #b0b0b0;
}
.odd {
font-size: 12pt;
background: white;
}
.even {
font-size: 12pt;
background: #e0e0e0;
}
.answer {
font-size: large;
font-weight: bold;
}
.answer p {
font-size: 12pt;
font-weight: normal;
}
.answer ul {
font-size: 12pt;
font-weight: normal;
}
#container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
}
#feedback {
color: #b0b0b0;
font-size: 9pt;
font-style: italic;
}
#header {
position: absolute;
margin: 0px;
top: 10px;
height:96px;
left: 175px;
right: 10em;
bottom: auto;
background: white;
clear: both;
}
#middle {
position: absolute;
left: 0;
height: auto;
width: 100%;
}
#main {
position: absolute;
top: 50px;
left: 175px;
right: 100px;
background: white;
padding: 0em 0em 0em 0em;
}
#navbar {
position: absolute;
top: 75px;
left: 0em;
width: 146px;
padding: 0px;
margin: 0px;
font-size: 10pt;
}
#navbar a:link, #navbar a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
#navbar a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
#navbar dl {
width: 146px;
padding: 0;
margin: 0 0 10px 0px;
background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left;
}
#navbar dt {
padding: 6px 10px;
font-size: 100%;
font-weight: bold;
background: #009999;
margin: 0px;
border-bottom: 1px solid #fff;
color: white;
background: #009999 url(images/box_top2.gif) no-repeat top left;
}
#navbar dd {
font-size: 100%;
margin: 0 0 0 0px;
padding: 6px 10px;
color: #0047b9;
}
dd#selected {
background: #99ffff url(images/arrow.gif) no-repeat;
background-position: 4px 10px;
}
+105
View File
@@ -0,0 +1,105 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ns-3.info
@settitle ns-3 tutorial
@c @setchapternewpage odd
@c %**end of header
@ifinfo
Primary documentation for the @command{ns-3} project is available in
three forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML versions
should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
@end ifinfo
@copying
This is an @command{ns-3} tutorial.
Primary documentation for the @command{ns-3} project is available in
three forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in
revision control on the @command{ns-3} code server. Both PDF and HTML
versions should be available on the server. Changes to
the document should be discussed on the ns-developers@@isi.edu mailing list.
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see @uref{http://www.gnu.org/licenses/}.
@end copying
@titlepage
@title ns-3 Tutorial
@author ns-3 project
@author feedback: ns-developers@@isi.edu
@today{}
@c @page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@c So the toc is printed at the start.
@anchor{Full Table of Contents}
@contents
@ifnottex
@node Top, Overview, Full Table of Contents
@top ns-3 Tutorial (html version)
For a pdf version of this tutorial,
see @uref{http://www.nsnam.org/docs/tutorial.pdf}.
@insertcopying
@end ifnottex
@menu
* Tutorial Goals::
Part 1: Getting Started with ns-3
* Overview::
* Browsing::
* Resources::
* Downloading and Compiling::
* Some-Prerequisites::
Part 2: Reading ns-3 Programs
* A-First-ns-3-Script::
Part 3: Reconfiguring Existing ns-3 Scripts
* Logging::
* ns-3 Attributes::
* Tracing::
* Statistics::
Part 4: Creating New or Revised Topologies
* Helper Functions::
@end menu
@include introduction.texi
@include log.texi
@include attributes.texi
@include statistics.texi
@include helpers.texi
@printindex cp
@bye
+278
View File
@@ -0,0 +1,278 @@
@c ========================================================================
@c Begin document body here
@c ========================================================================
@c ========================================================================
@c PART: Introduction
@c ========================================================================
@c The below chapters are under the major heading "Introduction"
@c This is similar to the Latex \part command
@c
@c ========================================================================
@c Introduction
@c ========================================================================
@node Introduction
@chapter Introduction
@menu
* For ns-2 Users::
* Contributing::
* Tutorial Organization::
@end menu
The @command{ns-3} simulator is a discrete-event network simulator targeted
primarily for research and educational use. The
@uref{http://www.nsnam.org,,ns-3 project},
started in 2006, is an open-source project developing ns-3.
Primary documentation for the @command{ns-3} project is available in four
forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}:
Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/docs/manual.html,,Reference Manual}: Reference Manual
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
The purpose of this tutorial is to introduce new @command{ns-3} users to the
system in a structured way. It is sometimes difficult for new users to
glean essential information from detailed manuals and to convert this
information into working simulations. In this tutorial, we will build
several example simulations, introducing and explaining key concepts and
features as we go.
As the tutorial unfolds, we will introduce the full ns-3 documentation
and provide pointers to source code for those interested in delving deeper
into the workings of the system.
A few key points are worth noting at the onset:
@itemize @bullet
@item Ns-3 is not an extension of @uref{http://www.isi.edu/nsnam/ns,,ns-2};
it is a new simulator. The two simulators are both written in C++ but
@command{ns-3} is a new simulator that does not support the ns-2 APIs. Some
models from ns-2 have already been ported from ns-2 to ns-3. The project will
continue to maintain ns-2 while ns-3 is being built, and will study transition
and integration mechanisms.
@item @command{Ns-3} is open-source, and the project strives to maintain an
open environment for researchers to contribute and share their software.
@end itemize
@node For ns-2 Users
@section For ns-2 Users
For those familiar with ns-2, the most visible outward change when moving to
@command{ns-3} is the choice of scripting language. Ns-2 is typically
scripted in Tcl and results of simulations can be visualized using the
Network Animator @command{nam}. In @command{ns-3} there is currently no
visualization module, and Python bindings have been developed (Tcl bindings
have been prototyped using @uref{http://www.swig.org,,SWIG}, but are not
currently supported). In this tutorial, we will concentrate on scripting
directly in C++ and interpreting results via trace files.
But there are similarities as well (both, for example, are based on C++
objects, and some code from ns-2 has already been ported to @command{ns-3}).
We will try to highlight differences between ns-2 and @command{ns-3}
as we proceed in this tutorial.
@node Contributing
@section Contributing
@cindex contributing
@command{Ns-3} is a research and educational simulator, by and for the
research community. It will rely on the ongoing contributions of the
community to develop new models, debug or maintain existing ones, and share
results. There are a few policies that we hope will encourage people to
contribute to @command{ns-3} like they have for ns-2:
@itemize @bullet
@item Open source licensing based on GNU GPLv2 compatibility;
@item @uref{http://www.nsnam.org/wiki/index.php,,wiki};
@item @uref{http://www.nsnam.org/wiki/index.php/Contributed_Code,,Contributed Code} page, similar to ns-2's popular
@uref{http://nsnam.isi.edu/nsnam/index.php/Contributed_Code,,Contributed Code}
page;
@item @code{src/contrib} directory (we will host your contributed code);
@item Open @uref{http://www.nsnam.org/bugzilla,,bug tracker};
@item @command{Ns-3} developers will gladly help potential contributors to get
started with the simulator (please contact @uref{http://www.nsnam.org/people.html,,one of us}).
@end itemize
If you are an ns-3 user, please consider providing your feedback, bug fixes, or
code to the project.
@node Tutorial Organization
@section Tutorial Organization
The tutorial assumes that new users might initially follow a path such as the
following:
@itemize @bullet
@item Try to download and build a copy;
@item Try to run a few sample programs;
@item Look at simulation output, and try to adjust it.
@end itemize
As a result, we have tried to organize the tutorial along the above
broad sequences of events.
@c ========================================================================
@c Resources
@c ========================================================================
@node Resources
@chapter Resources
@menu
* The Web::
* Mercurial::
* Waf::
* Development Environment::
* Socket Programming::
@end menu
@node The Web
@section The Web
@cindex www.nsnam.org
@cindex documentation
@cindex architecture
There are several important resources of which any @command{ns-3} user must be
aware. The main web site is located at @uref{http://www.nsnam.org} and
provides access to basic information about the ns-3 system. Detailed
documentation is available through the main web site at
@uref{http://www.nsnam.org/documents.html}. You can also find documents
relating to the system architecture from this page.
There is a Wiki that complements the main ns-3 web site which you will find at
@uref{http://www.nsnam.org/wiki/}. You will find user and developer FAQs
there, as well as troubleshooting guides, third-party contributed code,
papers, etc.
@cindex mercurial repository
@cindex ns-3-dev repository
@cindex release repository
The source code may be found and browsed at @uref{http://code.nsnam.org/}.
There you will find the current development tree in the repository named
@code{ns-3-dev}. Past releases and experimental repositories of the core
developers may also be found there.
@node Mercurial
@section Mercurial
Complex software systems need some way to manage the organization and
changes to the underlying code and documentation. There are many ways to
perform this feat, and you may have heard of some of the systems that are
currently used to do this. The Concurrent Version System (CVS) is probably
the most well known.
@cindex software configuration management
@cindex Mercurial
The @command{ns-3} project uses Mercurial as its source code management system.
Although you do not need to know much about Mercurial in order to complete
this tutorial, we recommend becoming familiar with Mercurial and using it
to access the source code. Mercurial has a web site at
@uref{http://www.selenic.com/mercurial/},
from which you can get binary or source releases of this Software
Configuration Management (SCM) system. Selenic (the developer of Mercurial)
also provides a tutorial at
@uref{http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial/},
and a QuickStart guide at
@uref{http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/}.
You can also find vital information about using Mercurial and @command{ns-3}
on the main @command{ns-3} web site.
@node Waf
@section Waf
@cindex Waf
@cindex make
@cindex build
Once you have source code downloaded to your local system, you will need
to compile that source to produce usable programs. Just as in the case of
source code management, there are many tools available to perform this
function. Probably the most will known of these tools is @code{make}. Along
with being the most well known, @code{make} is probably the most difficult to
use in a very large and highly configurable system. Because of this, many
alternatives have been developed. Recently these systems have been developed
using the Python language.
The build system @code{Waf} is used on the @command{ns-3} project. It is one
of the new generation of Python-based build systems. You will not need to
understand any Python to build the existing ns-3 system, and will
only have to understand a tiny and intuitively obvious subset of Python in
order to extend the system in most cases.
For those interested in the gory details of Waf, the main web site can be
found at @uref{http://freehackers.org/~tnagy/waf.html}.
@node Development Environment
@section Development Environment
@cindex C++
As mentioned above, scripting in ns-3 is done in C++. A working
knowledge of C++ and object-oriented concepts is assumed in this document.
We will take some time to review some of the more advanced concepts or
possibly unfamiliar language features, idioms and design patterns as they
appear. We don't want this tutorial to devolve into a C++ tutorial, though,
so we do expect a basic command of the language. There are an almost
unimaginable number of sources of information on C++ available on the web or
in print.
If you are new to C++, you may want to find a tutorial- or cookbook-based
book or web site and work through at least the basic features of the language
before proceeding.
@cindex toolchain
@cindex GNU
The @command{ns-3} system uses the GNU ``toolchain'' for development. A
software toolchain is the set of programming tools available in the given
environment. For a quick review of what is included in the GNU toolchain see,
@uref{http://en.wikipedia.org/wiki/GNU_toolchain}.
@cindex Linux
Typically an @command{ns-3} author will work in Linux or a Linux-like
environment. For those running under Windows, there do exist environments
which simulate the Linux environment to various degrees. The @command{ns-3}
project supports development in the Cygwin and the MinGW environments for
these users. See @uref{http://www.cygwin.com/} and
@uref{http://www.mingw.org/} for details on downloading and using these
systems. Cygwin provides many of the popular Linux system commands.
It can, however, sometimes be problematic due to the way it actually does its
emulation, and sometimes interactions with other Windows software can cause
problems.
@cindex Cygwin
@cindex MinGW
If you do use Cygwin or MinGW; and use Logitech products, we will save you
quite a bit of heartburn right off the bat and encourage you to take a look
at the @uref{http://www.mingw.org/MinGWiki/index.php/FAQ,,MinGW FAQ}.
@cindex Logitech
Search for ``Logitech'' and read the FAQ entry, ``why does make often
crash creating a sh.exe.stackdump file when I try to compile my source code.''
Believe it or not, the @code{Logitech Process Monitor} insinuates itself into
every DLL in the system when it is running. It can cause your Cygwin or
MinGW DLLs to die in mysterious ways and often prevents debuggers from
running. Beware of Logitech software.
@node Socket Programming
@section Socket Programming
@cindex sockets
We will assume a basic facility with the Berkeley Sockets API in the examples
used in this tutorial. If you are new to sockets, we recommend reviewing the
API and some common usage cases. For a good overview of programming TCP/IP
sockets we recommend @uref{http://www.elsevier.com/wps/product/cws_home/680765,,Practical TCP/IP Sockets in C, Donahoo and Calvert}.
There is an associated web site that includes source for the examples in the
book, which you can find at:
@uref{http://cs.baylor.edu/~donahoo/practical/CSockets/}.
If you understand the first four chapters of the book (or for those who do
not have access to a copy of the book, the echo clients and servers shown in
the website above) you will be in good shape to understand the tutorial.
There is a similar book on Multicast Sockets,
@uref{http://www.elsevier.com/wps/product/cws_home/700736,,Multicast Sockets, Makofske and Almeroth}.
that covers material you may need to understand if you look at the multicast
examples in the distribution.
+156
View File
@@ -0,0 +1,156 @@
body {
font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
background: white;
color: black;
font-size: 11pt;
}
h1, h2, h3, h4, h5, h6 {
# color: #990000;
color: #009999;
}
pre {
font-size: 10pt;
background: #e0e0e0;
color: black;
}
a:link, a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
img {
border: 0px;
}
#main th {
font-size: 12pt;
background: #b0b0b0;
}
.odd {
font-size: 12pt;
background: white;
}
.even {
font-size: 12pt;
background: #e0e0e0;
}
.answer {
font-size: large;
font-weight: bold;
}
.answer p {
font-size: 12pt;
font-weight: normal;
}
.answer ul {
font-size: 12pt;
font-weight: normal;
}
#container {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
}
#feedback {
color: #b0b0b0;
font-size: 9pt;
font-style: italic;
}
#header {
position: absolute;
margin: 0px;
top: 10px;
height:96px;
left: 175px;
right: 10em;
bottom: auto;
background: white;
clear: both;
}
#middle {
position: absolute;
left: 0;
height: auto;
width: 100%;
}
#main {
position: absolute;
top: 50px;
left: 175px;
right: 100px;
background: white;
padding: 0em 0em 0em 0em;
}
#navbar {
position: absolute;
top: 75px;
left: 0em;
width: 146px;
padding: 0px;
margin: 0px;
font-size: 10pt;
}
#navbar a:link, #navbar a:visited {
font-weight: normal;
text-decoration: none;
color: #0047b9;
}
#navbar a:hover {
font-weight: normal;
text-decoration: underline;
color: #0047b9;
}
#navbar dl {
width: 146px;
padding: 0;
margin: 0 0 10px 0px;
background: #99ffff url(images/box_bottom2.gif) no-repeat bottom left;
}
#navbar dt {
padding: 6px 10px;
font-size: 100%;
font-weight: bold;
background: #009999;
margin: 0px;
border-bottom: 1px solid #fff;
color: white;
background: #009999 url(images/box_top2.gif) no-repeat top left;
}
#navbar dd {
font-size: 100%;
margin: 0 0 0 0px;
padding: 6px 10px;
color: #0047b9;
}
dd#selected {
background: #99ffff url(images/arrow.gif) no-repeat;
background-position: 4px 10px;
}
+97
View File
@@ -0,0 +1,97 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ns-3.info
@settitle ns-3 tutorial
@c @setchapternewpage odd
@c %**end of header
@ifinfo
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/docs/manual.html,,Reference Manual}: Reference Manual
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in revision
control on the @command{ns-3} code server. Both PDF and HTML versions should
be available on the server. Changes to the document should be discussed on
the ns-developers@@isi.edu mailing list.
@end ifinfo
@copying
This is an @command{ns-3} tutorial.
Primary documentation for the @command{ns-3} project is available in
four forms:
@itemize @bullet
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator
@item Tutorial (this document)
@item @uref{http://www.nsnam.org/docs/manual.html,,Reference Manual}: Reference Manual
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
@end itemize
This document is written in GNU Texinfo and is to be maintained in revision
control on the @command{ns-3} code server. Both PDF and HTML versions should
be available on the server. Changes to the document should be discussed on
the ns-developers@@isi.edu mailing list.
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see @uref{http://www.gnu.org/licenses/}.
@end copying
@titlepage
@title ns-3 Tutorial
@author ns-3 project
@author feedback: ns-developers@@isi.edu
@today{}
@c @page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@c So the toc is printed at the start.
@anchor{Full Table of Contents}
@contents
@ifnottex
@node Top, Introduction, Full Table of Contents
@top ns-3 Tutorial (html version)
For a pdf version of this tutorial,
see @uref{http://www.nsnam.org/docs/tutorial.pdf}.
@insertcopying
@end ifnottex
@menu
* Introduction::
* Resources::
* Getting Started::
* Conceptual Overview::
* Tweaking ns-3::
* Building Topologies::
@end menu
@include introduction.texi
@include getting-started.texi
@include conceptual-overview.texi
@include tweaking.texi
@include building-topologies.texi
@printindex cp
@bye
Loaded 100 of 767 files, more files were not shown because too many files have changed in this diff. Show more