Compare commits

..

299 Commits

Author SHA1 Message Date
Craig Dowell f8cf3d5cf4 rescan bindings 2008-12-02 12:15:18 -08:00
Craig Dowell c18dc1e4f0 Removed tag ns-3.3-RC1 2008-12-02 11:54:27 -08:00
Gustavo J. A. M. Carneiro c806393836 Fix a couple of OLSR bugs (#415)
- Added a lot more logging messages;

- When "link sensing" tries to update a link tuple for a neighbor that has been removed, just re-add the neighbor, rather than silently failing;

- The optimization of not recomputing the routing table if we think no state has changed has been removed: it turned out to be just too buggy and the code base makes it difficult to catch all places where a state mofication is done.  Instead now we just recompute the table for any message processed, like the RFC says.
2008-12-02 18:42:24 +00:00
Tom Henderson 3380796d23 fix optimized build 2008-12-02 07:42:33 -08:00
Craig Dowell 46a52f3a67 Added tag ns-3.3-RC1 for changeset f33cbf6b051c 2008-12-02 00:00:01 -08:00
Craig Dowell 6def0ea405 update RELEASE_NOTES for ns-3.3 2008-12-01 23:43:01 -08:00
Tom Henderson 9d8fe8e81f Fix bug358; return EINVAL for inappropriate listen() call 2008-12-01 21:45:32 -08:00
Tom Henderson ebf89f2294 branch merge 2008-12-01 21:35:24 -08:00
Tom Henderson ea2f7aeed8 add missing files 2008-12-01 21:34:33 -08:00
Tom Henderson 07e526f6de branch merge 2008-12-01 21:33:52 -08:00
Tom Henderson f3dc299e82 Remove redundant m_txTrace in ipv4-l3-protocol 2008-12-01 21:29:59 -08:00
Tom Henderson 6306d3202d branch merge 2008-12-01 21:28:37 -08:00
Tom Henderson df23230e59 merge with tip 2008-12-01 21:23:51 -08:00
Tom Henderson 55051d3a0a Add processing logic for stub links in global routing code 2008-11-30 23:37:12 -08:00
Tom Henderson 655aa68d54 Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes 2008-11-30 21:21:23 -08:00
Mathieu Lacage 3f2b9429e0 merge with HEAD 2008-11-28 17:42:10 +01:00
Tom Henderson bf571e8260 Drop packets in Ipv4L3Protocol::Receive if interface is down 2008-11-28 07:21:26 -08:00
Gustavo J. A. M. Carneiro 47980e80e6 Const fix (needed for older Python versions) 2008-11-28 15:12:05 +00:00
Gustavo J. A. M. Carneiro 192ae37d11 The 'contrib' module actually depends on 'common' too (affects waf --python-scan) 2008-11-28 14:45:48 +00:00
Tom Henderson 6b0468c20b Bug 400: allow /32 addresses to be used on IPv4 interfaces 2008-11-28 06:05:27 -08:00
Sebastien Vincent 271bac3e92 Remove IcmpSocket class. 2008-11-28 14:24:09 +01:00
Mathieu Lacage 7390026044 merge with HEAD 2008-11-28 08:56:47 +01:00
Mathieu Lacage b56051a9bb bug 396: try harder to send ASSOCIATION_RESPONSE frames. 2008-11-28 08:55:24 +01:00
Craig Dowell 4913060911 CHANGES.html for global routing supporting bridges 2008-11-26 14:00:05 -08:00
Craig Dowell 8f85775a54 branch merge 2008-11-26 13:53:28 -08:00
Craig Dowell d27274e958 disallow routing on bridge devices with IP address, fix wifi-wired-bridging 2008-11-26 13:48:53 -08:00
Gustavo J. A. M. Carneiro c1b49366fe merge 2008-11-26 14:56:21 +00:00
Gustavo J. A. M. Carneiro 80b1ce258d Fix waf problem running programs with arguments. 2008-11-26 14:55:35 +00:00
Mathieu Lacage f69d0dfffd bug 421: memory leak in csma-ping 2008-11-26 04:27:10 -08:00
Mathieu Lacage 1d6cec837e merge with HEAD 2008-11-26 13:13:24 +01:00
Mathieu Lacage c0ec85b486 add missing chainup to parent DoDispose method 2008-11-26 13:12:39 +01:00
Gustavo J. A. M. Carneiro d474f1933a Bug 289: CommandLine::AddValue is not wrapped 2008-11-26 12:11:11 +00:00
Gustavo J. A. M. Carneiro 2d090e7d70 merge 2008-11-26 11:45:53 +00:00
Gustavo J. A. M. Carneiro 378f7e02be Make sure obj.name == obj.target for 'scratch' programs; fixes issue reported in ns-3-users with ./waf --run scratch/simple not working. 2008-11-26 11:44:47 +00:00
Mathieu Lacage 026673fa36 bug 420: avoid valgrind warning 2008-11-26 12:42:51 +01:00
Mathieu Lacage 6d31ca0ffb merge with HEAD 2008-11-26 10:43:24 +01:00
Mathieu Lacage 63ccaf86e4 regression test for ns2 mobility file helper 2008-11-26 10:40:23 +01:00
Mathieu Lacage c45d810a04 bug 408: ensure that we perform duplicate detection and defragmentation for both management and data frames. bug 214: make the sequence smaller check a debug log message rather than an unconditional message. 2008-11-26 10:24:41 +01:00
Craig Dowell 1885a1d55d instrument PcapWriter 2008-11-25 22:19:59 -08:00
Gustavo J. A. M. Carneiro 77fe2e1cbb [Bug 398] NqstaWifiMac does not filter received frames by BSSID 2008-11-25 14:45:46 +00:00
Mathieu Lacage fe8a6a83b9 bug 257: change the default log output of time to seconds, not the simulator's resolution. 2008-11-25 15:37:43 +01:00
Craig Dowell 8e049d9194 document wifi-wired-bridging a little and add aborts if bridged net devices with IP addresses found 2008-11-24 21:39:00 -08:00
Craig Dowell 99233fe787 branch merge 2008-11-24 11:21:15 -08:00
Gustavo J. A. M. Carneiro 35b28c656c Post-fix the last patch, to make sure invalid program names passed into --run trigger an informative error message as before. 2008-11-24 17:49:33 +00:00
Gustavo J. A. M. Carneiro ee16e0ad83 When --run'ing a program, tell WAF to only build that program, nothing more.
This greatly speeds up compilation when all you want to do is run a test program, as it skips the time consuming linking to be done for all example programs.
2008-11-24 15:28:42 +00:00
Gustavo J. A. M. Carneiro 885330d035 Work around #define ECHO in a system header file included by Python.h on Mac OS X (bug #413) 2008-11-24 12:39:50 +00:00
Gustavo J. A. M. Carneiro ef00197fe8 Disable EmuNetDevice Python bindings if the netdevice is not compiled in (bug #413) 2008-11-24 12:09:47 +00:00
Mathieu Lacage c6d1ff065d add WifiHelper::Install (Ptr<Node>) method per craig's comment. 2008-11-24 06:45:13 +01:00
Mathieu Lacage 8393b27aa2 merge with HEAD 2008-11-24 06:36:05 +01:00
Craig Dowell 46b8c8c9fc remove some hey-look-here debugging flags 2008-11-20 20:50:17 -08:00
Craig Dowell b0694a6a76 branch merge 2008-11-20 19:44:19 -08:00
Craig Dowell b66f046916 fix bug 114 and bug 66 2008-11-20 16:48:21 -08:00
Craig Dowell d26abb0c10 teach global routing about bridges 2008-11-19 23:38:01 -08:00
Craig Dowell c178314bbf deal with bridged stub/transit networks on routers 2008-11-19 22:16:43 -08:00
Craig Dowell 7d71822e3b factor DiscoverLSAs into understandable modules 2008-11-19 21:21:14 -08:00
Craig Dowell 0f468c97e7 Admit possibility that not all nodes are routers. 2008-11-19 18:44:20 -08:00
Tom Henderson d7fa009d70 Drop trace notification when outgoing interface is down 2008-11-19 16:41:17 -08:00
Craig Dowell 23b216a600 convince global routing not to crash in the presence of bridges 2008-11-19 15:54:12 -08:00
Sam Jansen ee5cf0946f Depend on nsc 0.5.0. This is required so the interface is the same for an NSC 2008-11-19 22:41:12 +01:00
Gustavo J. A. M. Carneiro dfa88263cc fix --with-pybindgen path handling bug 2008-11-19 18:23:22 +00:00
Gustavo J. A. M. Carneiro f85ef3914a merge 2008-11-19 17:33:17 +00:00
Gustavo J. A. M. Carneiro 9af50e6d5b Add a --with-pybindgen option, to allow external pybindgen to be used instead of fetching it from the network 2008-11-19 17:32:37 +00:00
Gustavo J. A. M. Carneiro 7bd84c12ac Add a --with-regression-traces configure option, to allow using externally supplied regression traces instead of fetching them from the network. 2008-11-19 17:17:07 +00:00
Mathieu Lacage 8fd3438914 5% cpu optimization 2008-11-19 14:39:52 +01:00
Mathieu Lacage 37d6b2a697 5% cpu optimization 2008-11-19 14:19:10 +01:00
Craig Dowell 179ef21209 implement IsBridged for net devices 2008-11-18 16:23:31 -08:00
Craig Dowell 1e42d9bae7 add bridged routing example 2008-11-18 15:46:46 -08:00
Florian Westphal b6939441cd nsc-tcp-socket-impl: use new nsc getsockname/getpeername interface.
closes bugzilla #320.
2008-11-18 23:14:02 +01:00
Gustavo J. A. M. Carneiro afe55f740e Fix build of Python bindings with Python 2.6 2008-11-18 15:12:12 +00:00
Andrey Hippo fec6ea6ae2 Bug 387: Build fails with junk subdirectories in "scratch" directory 2008-11-18 14:05:47 +00:00
Gustavo J. A. M. Carneiro e8e8e887d7 Refactor wscript code to move regression testing code to a separate python module (bug 325) 2008-11-18 13:48:26 +00:00
Craig Dowell 9edb6bda8b overdue changes to CHANGES.html 2008-11-17 22:25:32 -08:00
Craig Dowell 9a750001db rescan for new method in InternetStackHelper 2008-11-17 20:14:53 -08:00
Tom Henderson b45e7ce23e Add an InternetStackHelper method to do ascii tracing on drop events 2008-11-07 06:54:21 -08:00
Tom Henderson c1e02d5d3b Allow /32 addresses to be configured via Ipv4AddressHelper 2008-11-07 07:35:35 -08:00
Craig Dowell 81c8a200d9 change attribute ReceiveErrorModel in CSMA and rescan 2008-11-17 19:56:04 -08:00
Craig Dowell 0029c0056e make ppp header public 2008-11-17 19:50:23 -08:00
Unknown 523389e77e added abusive regression test csma-star 2008-11-17 19:34:03 -08:00
Unknown 222d38c1ef fix buggy example 2008-11-17 19:25:34 -08:00
Gustavo J. A. M. Carneiro 8acf39d56e Ipv6Header::GetName() is declared but not implemented; remove it. 2008-11-09 12:34:48 +00:00
Gustavo J. A. M. Carneiro 48d9cf9b40 merge 2008-11-08 15:00:56 +00:00
Gustavo J. A. M. Carneiro f804bb190a Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
This commit will change a lot the scanned API definitions, once, but should allow much more stable scanning in the future, as right now only types were being sorted, but free functions can jump up or down when different people on different machines scan the API.  Well, no more will that happen in the future, I hope.
2008-11-08 15:00:28 +00:00
Craig Dowell 586aa57b97 osx doesn't emu 2008-11-07 20:41:38 -08:00
Gustavo J. A. M. Carneiro 103389505b Make olsr::RoutingTable public, add a method GetEntries to it, and add a method GetRoutingTable to OlsrAgent. This way it is possible to read the actual routing table that OLSR has discovered, for debugging/visualization purposes. 2008-11-07 19:51:00 +00:00
Unknown a9914ca540 Initial IPv6 capability 2008-11-07 11:36:15 -08:00
Craig Dowell d1b135a2d2 g++ 4.3.2-1ubuntu7 too picky 2008-11-06 15:04:25 -08:00
Craig Dowell 8c565917e2 keep gcc 3.4 from complaining 2008-11-06 14:23:47 -08:00
Craig Dowell 2f96c1ddf5 branch merge 2008-11-06 13:10:04 -08:00
Craig Dowell 2af905d9cf address bug 393 (need to overload Install methods for python) 2008-11-06 13:08:20 -08:00
Craig Dowell 5dc26994c4 asserts cut and paste into places where fatal error was appropriate 2008-11-06 11:52:59 -08:00
raj. 478bd474e0 apply patch for bug 390 (SocketImpl::Bind returns something other than -1) 2008-11-05 19:53:52 -08:00
mathieu. 83ac2144c0 apply patch for bug 390 (regression tests can't open input files) 2008-11-05 19:45:40 -08:00
Craig Dowell eaf0526911 need bindings for v4ping 2008-11-05 17:35:15 -08:00
Craig Dowell afc09e988a remove unimplemented methods from emu class + rescan 2008-11-05 15:00:59 -08:00
Unknown dc2d67e7b8 apply patch for bug 294 (GetMulticastAddr) + emu device update + rescan 2008-11-05 14:49:21 -08:00
Craig Dowell 3aa50e6af9 Apply Patch to address bug 294 -- due to vincent 2008-11-05 14:33:20 -08:00
Craig Dowell ee5df1fda8 branch merge 2008-11-05 14:09:43 -08:00
Craig Dowell 8950779748 remove tap device and helper 2008-11-05 14:08:54 -08:00
Mathieu Lacage 4874bc3ce9 typo 2008-11-04 14:56:32 +01:00
Mathieu Lacage 6ebfe7faba new wifi API 2008-11-04 14:06:34 +01:00
Mathieu Lacage 53b1d1c6df implement missing method 2008-11-04 14:06:26 +01:00
Mathieu Lacage 87745fdacc assert on invalid uid 2008-11-04 14:05:57 +01:00
Unknown 4bf9d4efe7 Trivial change to fix time insertions after recent output format change. 2008-11-03 11:38:23 -05:00
Gustavo J. A. M. Carneiro ccd6e796cd Work around a WAF bug in failing to recognize GCC while detecting CXXFLAGS for compiling Python extensions. 2008-10-31 22:47:29 +00:00
Tom Henderson a97b740785 Fix bug 362; cancel WaitReplyTimer when ArpCache is flushed 2008-10-30 22:04:12 -07:00
Craig Dowell c48b363841 sentence made no sense in emu.h 2008-10-30 16:39:37 -07:00
Craig Dowell 46729f42fd clarify comment in emu-helper 2008-10-30 15:36:36 -07:00
Craig Dowell cb9080da39 enable multicast in emu-net-device 2008-10-30 15:34:02 -07:00
Craig Dowell 580ad68137 turn off LOG in emu-sock-creator 2008-10-30 15:27:15 -07:00
Craig Dowell c6a12a1308 reverse sense of waf sudo flag to --enable-sudo 2008-10-30 13:00:16 -07:00
Craig Dowell 2a979e7455 some dox 2008-10-30 10:30:33 -07:00
Craig Dowell 68951bddeb branch merge 2008-10-30 10:01:27 -07:00
Craig Dowell 9df77a6cdd add emu-udp-echo example 2008-10-30 10:00:41 -07:00
Craig Dowell 339b98132d double and int confusion in main-test-sync 2008-10-29 22:52:22 -07:00
Craig Dowell d8b151d4fe rework to address suid root issues 2008-10-29 22:39:36 -07:00
Craig Dowell bc35a1b17b branch merge 2008-10-29 11:49:21 -07:00
Craig Dowell 6eeec4502a Apply icmp-application patch frm lacage 2008-10-29 11:19:01 -07:00
Craig Dowell 0df5a7183a apply icmp patch 2008-10-29 11:18:39 -07:00
Mathieu Lacage b09d1008de get rid of reference model for log distance model 2008-10-28 13:40:33 +01:00
Mathieu Lacage 28f7324733 fix build. 2008-10-28 13:24:04 +01:00
Mathieu Lacage 8246114a8d add composite capability to PropagationLossModel base class. 2008-10-28 13:17:17 +01:00
Mathieu Lacage 40dc133bc7 merge with HEAD 2008-10-28 11:26:58 +01:00
Craig Dowell 8cf8f18019 add in the helpers 2008-10-27 23:05:57 -07:00
Craig Dowell eeea109010 give up on merging tap and emulated, break apart 2008-10-27 22:01:24 -07:00
Craig Dowell 622ced4462 merge in tap device 2008-10-27 13:01:28 -07:00
Raj Bhattacharjea 6b358143c0 Bug 340 2008-10-27 15:12:00 -04:00
Raj Bhattacharjea 258bd81cab Bug 311 2008-10-27 15:00:58 -04:00
Mathieu Lacage 767b622b76 bug 394: AdhocWifiMac claims to support SendFrom 2008-10-27 16:40:03 +01:00
Mathieu Lacage e2c52c7b90 remove realtime public API. 2008-10-27 12:47:33 +01:00
Mathieu Lacage f264e2efa2 merge with HEAD 2008-10-27 12:17:38 +01:00
Craig Dowell af16634027 csma version of install star and example 2008-10-24 17:29:26 -07:00
Craig Dowell 017ecaeb3d branch merge 2008-10-24 15:51:20 -07:00
Craig Dowell f18f28985f make star topologies easier to create 2008-10-24 15:50:52 -07:00
Craig Dowell a3556ebe05 branch merge 2008-10-24 07:13:35 -07:00
Mathieu Lacage 3ec1d2f640 bug 280: trace helpers too inclusive 2008-10-24 13:22:16 +02:00
Mathieu Lacage c164d111bd forgot to build ns2 mobility sample 2008-10-24 12:39:53 +02:00
Mathieu Lacage 9002d0d27c bug 284: cannot use config paths to get a handle on an object. 2008-10-24 12:35:28 +02:00
Mathieu Lacage 24d3e0317a replace \t with 8 spaces. 2008-10-24 12:31:57 +02:00
Mathieu Lacage d8dad149da add ns2 mobility sample. 2008-10-24 12:29:39 +02:00
Mathieu Lacage 7a923ef2bd rescan python 2008-10-24 12:29:15 +02:00
Mathieu Lacage b839e400a9 Read correctly fractional seconds. Reported by Ramon Bauza 2008-10-24 12:29:02 +02:00
Mathieu Lacage 4d380ed257 rework StaticSpeedHelper API 2008-10-24 12:27:47 +02:00
Mathieu Lacage 3af636f969 bug 339: unconditional assert API. 2008-10-24 10:29:06 +02:00
Mathieu Lacage 26aa64c033 bug 386: make sure errno is not set incorrectly and don't access stale packets. 2008-10-24 09:22:50 +02:00
Craig Dowell 6041ad024c rescan for bug 283 2008-10-23 16:08:13 -07:00
Craig Dowell b4947df5d0 Liu's GetSockName patch 2008-10-23 15:59:48 -07:00
Craig Dowell 49e12dc17d structured thread exit methods 2008-10-23 15:50:24 -07:00
Craig Dowell c810ef64a1 Apply thread interrupt patch 2008-10-23 15:22:38 -07:00
Kirill V. Andreev 922d5a4de9 bug 389: Beacon is sent after DIFS+Backoff instead of PIFS 2008-10-23 21:27:28 +02:00
Craig Dowell c7d0ce769c Apply patch to fix bug 364 2008-10-23 11:51:15 -07:00
Craig Dowell b8dd9ddf99 rescan after 363 fix 2008-10-23 11:50:45 -07:00
Craig Dowell 383c4d9df5 Apply patch to fix bug 363 2008-10-23 11:24:52 -07:00
Craig Dowell 012433cf91 rescan after bug 357 patch 2008-10-23 10:57:26 -07:00
Craig Dowell 0d30646695 Remove queue limit from listen 2008-10-23 10:48:42 -07:00
Tom Henderson 0458f450cb tutorial typos fixed (bug 379) 2008-10-22 22:13:22 -07:00
Gustavo J. A. M. Carneiro dd6476d804 Python: fix bug with missing wrapper registration for objects created directly via the python constructor 2008-10-20 16:56:40 +01:00
Mathieu Lacage 2aecf7055b bug 278: print protocol number from Ipv4Header::Print 2008-10-20 13:31:25 +02:00
Mathieu Lacage 8ae791d954 remove broken test 2008-10-20 12:37:43 +02:00
Mathieu Lacage 0f8139fc10 bug 382: templated DynamicCast 2008-10-20 08:40:32 +02:00
Mathieu Lacage e443a39436 merge with HEAD 2008-10-17 20:07:44 +02:00
Mathieu Lacage b4745c7708 add debugging 2008-10-17 20:05:17 +02:00
Raj Bhattacharjea e698770970 Undo change 2008-10-17 10:47:47 -04:00
Unknown 8927ae967a Touch the readme as a test 2008-10-17 10:45:44 -04:00
Mathieu Lacage 79250d10c2 add API to get bytes out of a packet without calling PeekData 2008-10-17 14:16:53 +02:00
Mathieu Lacage 36c0976a53 give attribute power to Callback. 2008-10-17 14:15:52 +02:00
Mathieu Lacage 6f484b6ead bug 349: workaround compiler bug 2008-10-17 13:11:39 +02:00
Mathieu Lacage b44dc748e0 fix optimized build 2008-10-17 10:35:14 +02:00
Gustavo J. A. M. Carneiro 2e79a78db0 merge 2008-10-16 11:54:24 +01:00
Gustavo J. A. M. Carneiro 2073f02054 merge 2008-10-16 11:53:47 +01:00
Mathieu Lacage 98b197de5a bug 202: header file conflict 2008-10-16 12:53:05 +02:00
Mathieu Lacage ff776177bf bug 352: STA receives back the broadcasts it sends. 2008-10-16 12:47:17 +02:00
Mathieu Lacage e4fb44dd96 bug 343: bench-packets does not work. 2008-10-16 12:44:25 +02:00
Gustavo J. A. M. Carneiro 6cae60a58d merge 2008-10-16 11:42:23 +01:00
Mathieu Lacage 7b55da3a04 kill dead code 2008-10-16 12:22:59 +02:00
Mathieu Lacage eb566b82d3 bug 350: operator > missing. 2008-10-16 12:17:00 +02:00
Mathieu Lacage 91d94d6076 bug 371: wifi-ap broken 2008-10-16 10:26:13 +02:00
Mathieu Lacage 47f1f1fefc improve debugging 2008-10-16 10:25:55 +02:00
Mathieu Lacage d3e9be922d bug 372: fragmentation is broken 2008-10-16 09:48:47 +02:00
Gustavo J. A. M. Carneiro e83d4da973 Python: enable wrapping of the packet metadata APIs. 2008-10-15 18:32:07 +01:00
Gustavo J. A. M. Carneiro ff4ec5cf64 Packet::Metadata::PrintStats doesn't really exist. 2008-10-15 18:19:12 +01:00
Gustavo J. A. M. Carneiro fe8cbc9a0f A more pythonic wrapper for ns3.TypeId.LookupByNameFailSafe 2008-10-15 15:55:09 +01:00
Mathieu Lacage 1a6629d9cf make sure we implement all Schedule methods within the right class 2008-10-15 15:53:06 +02:00
Mathieu Lacage 996a095d36 rescan python bindings 2008-10-15 15:12:05 +02:00
Mathieu Lacage cfea3297ac remove event locking 2008-10-15 15:01:12 +02:00
Mathieu Lacage 82bbe71419 rename RealtimeSimulator to WallclockSimulator 2008-10-15 14:51:16 +02:00
Mathieu Lacage 6557016724 remove uneeded includes. 2008-10-15 14:42:27 +02:00
Mathieu Lacage 5dc0415289 move MakeEvent out of Simulator 2008-10-15 14:35:28 +02:00
Mathieu Lacage e33fc49877 avoid using Ptr<EventImpl> 2008-10-15 13:35:49 +02:00
Mathieu Lacage b4e442df4d don't use EventId in Schedulers: use Scheduler::Event instead. 2008-10-15 13:05:33 +02:00
Mathieu Lacage 253fecb82e define Scheduler::Event and use it in Scheduler::Insert 2008-10-15 10:33:43 +02:00
Mathieu Lacage 64c11d222a reuse operator < (EventKey) 2008-10-15 10:11:32 +02:00
Mathieu Lacage 0d77861853 remove uneeded include. 2008-10-15 10:10:53 +02:00
Mathieu Lacage 50f23a7579 merge with HEAD 2008-10-15 09:50:28 +02:00
Mathieu Lacage 414c2ff3ad constify 2008-10-15 09:49:39 +02:00
Craig Dowell 2ca2b4e6bf implement a non-realtime version of RunOneEvent for realtime simulator and allow Run, Stop, Run 2008-10-14 23:13:12 -07:00
Craig Dowell 8b6dc98d14 slight reorganization and naming change for added realtime methods 2008-10-14 22:52:41 -07:00
Gustavo J. A. M. Carneiro 213f6526a8 Rescan API for Python. 2008-10-12 18:04:10 +01:00
Gustavo J. A. M. Carneiro f75fbc1512 Upgrade to pybindgen rev. 598, to fix bug #291. 2008-10-12 14:40:26 +01:00
Craig Dowell 415f3adbc5 added test for m_running in ScheduleRealNow 2008-10-10 21:01:50 -07:00
Craig Dowell 55cca9abef it helps to remember to add function implementations 2008-10-10 16:43:43 -07:00
Craig Dowell b6a9b08f75 add dangerous realtime scheduling methods in an intentionally harder to find and use way 2008-10-10 16:22:13 -07:00
Craig Dowell 8675d64f46 branch merge 2008-10-10 15:26:32 -07:00
Craig Dowell c101158f24 make simulator schedule calls explicitly relative throughout. fixes multithread problem in realtime simulator 2008-10-10 15:24:56 -07:00
Tom Henderson b03afa5f00 remove tgif figures; replace with dia 2008-10-10 15:01:20 -07:00
Tom Henderson 43f3993d36 branch merge 2008-10-10 14:22:53 -07:00
Tom Henderson 1581ac4450 remove tgif figures; replace with dia 2008-10-10 14:21:58 -07:00
Mathieu Lacage aea71064a4 bug 331: constify Packet::PeekHeader 2008-10-10 11:20:53 +02:00
Mathieu Lacage 32ce5ce0be bug 367: generate beacons by default at time 0.0 2008-10-10 11:18:46 +02:00
Mathieu Lacage e20b335199 bug 361: make GetBssid public. 2008-10-10 09:24:35 +02:00
Gustavo J. A. M. Carneiro 9239dcf55a merge 2008-10-07 12:39:27 +01:00
Gustavo J. A. M. Carneiro 81bcdc9bf8 Fix compat. with Python < 2.5 (fixes ns-old regression failure) 2008-10-07 12:23:57 +01:00
Tom Henderson 14dbd0649f typo fix (bug 373) 2008-10-06 22:39:53 -07:00
Gustavo J. A. M. Carneiro 24a1fdfc69 Improve debug logging in Node::ReceiveFromDevice 2008-10-06 18:21:04 +01:00
Gustavo J. A. M. Carneiro 8a664200e5 New pybindgen and new API scanning, brings support for comparison operators and + - * / numeric operators. 2008-10-06 17:39:35 +01:00
Tom Henderson 1c3dcd37b3 bug in script-- Stop not being called 2008-10-02 16:48:01 -07:00
Craig Dowell 4215553314 bug 337 2008-10-02 15:22:17 -07:00
Gustavo J. A. M. Carneiro c2985053a3 Pull pybindgen revno 582 for increased stability of the generated python files with multiple developers doing the scanning. 2008-10-02 17:30:38 +01:00
Gustavo J. A. M. Carneiro 3997faf477 merge 2008-10-02 17:16:04 +01:00
Gustavo J. A. M. Carneiro 03e1a6bae5 Exit WAF after processing --python-scan to avoid incorrect builds, since WAF does not handle well files being generated into the source dir instead of the build dir 2008-10-02 17:15:09 +01:00
Mathieu Lacage 2160b31237 add private operator = to disable it 2008-10-02 17:05:16 +02:00
Mathieu Lacage 35c25f995e hide window when starting simulation. 2008-10-02 15:04:28 +02:00
Mathieu Lacage 5cd9a601e1 change button label to be more explicit 2008-10-02 14:57:39 +02:00
Gustavo J. A. M. Carneiro d607ae00f3 Need to acquire the Python GIL also in ~PythonEventImpl, as it may be called at any time from the C++ code, from any thread. 2008-09-27 15:32:04 +01:00
Gustavo J. A. M. Carneiro 8e454b058b Get newer pybindgen, for stl containers support 2008-09-27 15:26:27 +01:00
Gustavo J. A. M. Carneiro 9866cc1ce3 merge 2008-09-27 15:17:37 +01:00
Gustavo J. A. M. Carneiro 79e685df92 Allow interrupting PyBindGen fetching, via Ctrl-C, for the impatient developers. 2008-09-27 15:06:38 +01:00
Mathieu Lacage e864af7983 fix build with gcc 4.3.0 2008-09-25 15:50:07 -07:00
Florian Westphal 3a6bf88a49 nsc: delay creating nsc interface using ScheduleNow ().
because we cannot rely on the node to have any assigned interface
when the nsc stack is initialised, we need to delay creating the nsc
interface. Up until now this was done by initialising the interface
when the first socket is opened, which resulted in a segfault or
an assertion failure when a packet arrived but no socket was ever created...
2008-09-25 01:43:27 +02:00
Mathieu Lacage f8bbbbc899 make sure sinks are started 2008-09-23 16:38:51 -07:00
Mathieu Lacage fbf3dd3cf7 make sure that the sinks are started 2008-09-23 16:31:54 -07:00
Mathieu Lacage a7b4e36b84 use better variable names. 2008-09-23 16:14:00 -07:00
Mathieu Lacage 97b7179161 the sink must be enabled on node 2 2008-09-23 16:02:30 -07:00
Craig Dowell 102623e2b1 mispeeling in introduction.texi 2008-09-23 09:53:52 -07:00
Florian Westphal 266bc671a5 nsc: avoid unecessary use of posix headers
this removes usage of struct iphdr and inet_ntoa.
Replaced by uint32_t[] (we only need to fetch source/destination
ip addresses) and Ipv4Header::Print(), respectively.

netinet/in.h and arpa/inet.h are retained for the time being
due to ntohs/ntohl.
2008-09-23 01:09:43 +02:00
Florian Westphal 41fffa73b9 nsc: make sure nsc has a configured interface
the receive method hands packets to the nsc core via
nsc's if_receive_packet() method.

NSC (rightfully) assumes that if it gets a packet, there must
be a network interface. However, at this time the interface
initialization in ns-3-nsc is done when the first socket is created.

The result is a segmentation fault inside nsc when ns-3 receives
a packet on an nsc-enabled node before a socked has been created
on that node.

For the time being, use NS_ASSERT to make sure the nsc interface exits.
This also gets rid of the NS_LOG use inside the Softinterrupt timer
method and replaces
NS_LOG_FUNCTION_NOARGS with NS_LOG_FUNCTION (this), as suggested by
Mathieu Lacage.
2008-09-22 22:18:53 +02:00
Craig Dowell 05d0f37dda Added tag ns-3.2 for changeset 2ecac911b3ec 2008-09-22 10:36:24 -07:00
Tom Henderson 06f2b16d78 Add chapter on realtime scheduler to manual 2008-09-21 13:10:08 -07:00
Tom Henderson 5d82b2e31f new manual chapter on TCP 2008-09-20 15:45:31 -07:00
Craig Dowell 4a3ee19a31 mispeeling in RELEASE_NOTES 2008-09-18 15:29:00 -07:00
Craig Dowell 8785a190ee Added tag ns-3.2-RC4 for changeset 68218c266a84 2008-09-18 15:28:35 -07:00
Tom Henderson 9e1a3adf6f document ConfigStore 2008-09-18 07:28:03 -07:00
Craig Dowell 4105b6e392 Apply Sam's nsc regression patch 2008-09-17 20:04:26 -07:00
Gustavo J. A. M. Carneiro a2f945ddda Add missing Python GIL locking in PythonEventImpl::Notify 2008-09-17 15:47:07 +01:00
Craig Dowell 4c13936623 Added tag ns-3.2-RC3 for changeset fa1c7b813873 2008-09-16 11:55:52 -07:00
Tom Henderson c060f84ef9 freshen tutorial 2008-09-15 21:37:40 -07:00
Tom Henderson fea009e803 merge with tip 2008-09-15 06:11:38 -07:00
Tom Henderson b005d33fb9 fix some Doxygen warnings 2008-09-15 06:10:53 -07:00
Gustavo J. A. M. Carneiro 6c7aa38c60 Add python based csma-bridge regression test. Closes #344. 2008-09-15 11:45:32 +01:00
Gustavo J. A. M. Carneiro aa6308bc1a Make the example less verbose (for use in regression) 2008-09-15 11:39:15 +01:00
Mathieu Lacage 8e3cdc2e0c don't change VERSION 2008-09-14 17:55:30 -07:00
Mathieu Lacage 77e3a780bb merge with HEAD 2008-09-14 11:40:10 -07:00
Mathieu Lacage 0c7ed36240 don't try to download traces if they are already there. 2008-09-14 11:39:58 -07:00
Tom Henderson 1994268a9b merge with tip 2008-09-12 16:13:20 -07:00
Tom Henderson 5d9c714c1e Doxygen for internet-stack 2008-09-12 16:12:58 -07:00
Tom Henderson 6f3dc648ed doxygen for src/contrib 2008-09-12 11:34:25 -07:00
Craig Dowell f51afd386b Added tag ns-3.2-RC2-bis for changeset d783a951f8f5 2008-09-12 10:36:57 -07:00
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
Tom Henderson a70b07289e updates to the tutorial introduction 2008-09-11 08:46:29 -07:00
Tom Henderson c46f02e9c8 add reference to wiki page 2008-09-11 08:45:00 -07:00
Tom Henderson e054045b37 some release notes edits 2008-09-11 08:18:04 -07:00
Tom Henderson 1e1a5caeb2 fix formatting 2008-09-11 08:17:37 -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
Mathieu Lacage cc9838870a split interference calculation from YansWifiPhy. Move them to InterferenceHelper 2008-06-14 10:52:10 -07:00
Mathieu Lacage 85c984a28c kill dead method declaration 2008-06-12 12:31:02 -07:00
Mathieu Lacage a4c0722a70 add missing license headers 2008-06-12 12:29:58 -07:00
Mathieu Lacage 194a171ed3 split the error rate model from the yans phy 2008-06-12 12:28:36 -07:00
Mathieu Lacage 034dd36649 remove header from list of public headers 2008-06-12 12:07:50 -07:00
Mathieu Lacage 70c8c5e3ba re-enable tracing of wifi phy state. 2008-06-12 11:55:22 -07:00
Mathieu Lacage 5dc4dd0ab9 constify 2008-06-12 11:14:54 -07:00
Mathieu Lacage ffe5305326 add missing license headers 2008-06-12 11:06:56 -07:00
Mathieu Lacage 2af4b83614 split state management in a helper class 2008-06-12 11:05:46 -07:00
Mathieu Lacage 50b637e66b doc cleanup 2008-06-12 09:51:29 -07:00
Mathieu Lacage 859396a8f6 remove unneeded headers 2008-06-11 16:31:22 -07:00
Mathieu Lacage 30cb33c5fe merge with HEAD 2008-06-11 16:20:04 -07:00
Mathieu Lacage 7aa4b274c0 split WifiChannel in WifiChannel + YansWifiChannel 2008-06-11 16:19:28 -07:00
Mathieu Lacage e8a52a06cc add UnsafeAttributeList 2008-06-11 16:19:01 -07:00
Mathieu Lacage 4f4bec026b add missing Setter 2008-06-11 16:18:38 -07:00
Mathieu Lacage 52169a27b8 typo 2008-06-11 13:46:04 -07:00
Mathieu Lacage 870e44c31d no need to reference WifiNetDevice 2008-06-11 12:35:02 -07:00
Mathieu Lacage 619600b607 rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class. 2008-06-11 11:52:40 -07:00
Mathieu Lacage 8aca3e058b remove dead method 2008-06-11 11:15:43 -07:00
Mathieu Lacage cec8e33447 add missing files. 2008-06-11 11:12:15 -07:00
Mathieu Lacage 0c61007aeb test PHY collisions 2008-06-11 10:57:42 -07:00
Mathieu Lacage 6db1f04b9c change name of parameter 2008-06-11 10:02:09 -07:00
Mathieu Lacage 7c73164d77 do a binary search for the range boundary. 2008-06-10 16:22:21 -07:00
Mathieu Lacage 245dfdadd8 print the tx power, not a random character 2008-06-10 16:22:12 -07:00
Mathieu Lacage 786ae233a1 PHY-layer test scripts 2008-06-10 15:43:52 -07:00
Mathieu Lacage e865a760c3 do not crash if the callback is null. 2008-06-10 13:08:34 -07:00
Mathieu Lacage 184178c225 add a string-based constructor 2008-06-10 13:08:22 -07:00
Mathieu Lacage 81844a2628 Allow a zero NetDevice in WifiChannel. 2008-06-10 12:17:34 -07:00
362 changed files with 28287 additions and 13886 deletions
+7
View File
@@ -17,3 +17,10 @@ ea16c44eb90db579c83d3434fc8a960be506a7f5 ns-3.1-RC3
42504fb1f7be7817b8be513cdcd3d9bc8f3660e8 ns-3.1
5768685f9fdba9fbf2e9561a840f085142c73575 ns-3.1
dfd634417b8d1896d981b6f44d8f71030611596a ns-3.2-RC1
319eb29611b18998abbad01548825643a8017bcb ns-3.2-RC2
d783a951f8f5e64b33bc518f0415f76cae1ca6f3 ns-3.2-RC2-bis
fa1c7b813873cfa251be7d1b7cea38373fe82fa1 ns-3.2-RC3
68218c266a844f9fbda34a0ffddb1ae2adebd4b0 ns-3.2-RC4
2ecac911b3ec40d73ab8301471bea6d9ba5b9885 ns-3.2
f33cbf6b051c51d92db41b6fa825437958fbf801 ns-3.3-RC1
0000000000000000000000000000000000000000 ns-3.3-RC1
+4
View File
@@ -9,4 +9,8 @@ Federico Maguolo (maguolof@dei.unipd.it)
George F. Riley (riley@ece.gatech.edu)
Guillaume Vu-Brugier (gvubrugier@gmail.com)
Florian Westphal (fw@strlen.de)
Sebastien Vincent (vincent@lsiit.u-strasbg.fr)
David Gross (gdavid.devel@gmail.com)
Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
+79 -18
View File
@@ -43,10 +43,82 @@ 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.2 to ns-3.3</h1>
<h2>new API:</h2>
<ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/4c1c3f6bcd03">4c1c3f6bcd03</a></li>
<ul>
<li>
The PppHeader previously defined in the point-to-point-net-device code has been
made public.
</li>
</ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/16c2970a0344">16c2970a0344</a></li>
<ul>
<li>
An emulated net device has been added as enabling technology for ns-3 emulation
scenarios. See src/devices/emu and examples/emu-udp-echo.cc for details.
</li>
</ul>
</ul>
<h2>new API in existing classes:</h2>
<ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/4222173d1e6d">4222173d1e6d</a></li>
<ul>
<li>
Added method InternetStackHelper::EnableAsciiChange to allow allow a user to
hook ascii trace to the drop trace events in Ipv4L3Protocol and ArpL3Protocol.
</li>
</ul>
</ul>
<h2>changes to existing API:</h2>
<ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/dacfd1f07538">dacfd1f07538</a></li>
<ul>
<li>
Change attribute "RxErrorModel" to "ReceiveErrorModel" in CsmaNetDevice for
consistency between devices.
</li>
</ul>
</ul>
<h2>changed behavior:</h2>
<ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/ed0dfce40459">ed0dfce40459</a></li>
<ul>
<li>
Relax reasonableness testing in Ipv4AddressHelper::SetBase to allow the
assignment of /32 addresses.
</li>
</ul>
<li>17-11-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/756887a9bbea">756887a9bbea</a></li>
<ul>
<li>
Global routing supports bridge devices.
</li>
</ul>
<hr>
<h1>changes from ns-3.1 to ns-3.2</h1>
<h2>new API:</h2>
<ul>
<li>26-08-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/5aa65b1ea001">5aa65b1ea001</a></li>
@@ -57,7 +129,6 @@ 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
@@ -68,11 +139,11 @@ Add threading and synchronization primitives. Enabling technology for
multithreaded simulator implementation.
</li>
</ul>
</li>
</ul>
<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>
@@ -81,9 +152,10 @@ and a Drop trace. It also has some new public methods but these are
mostly for internal use.
</ul>
</li>
</ul>
</ul>
<h2>changes to existing API:</h2>
<ul>
<li>05-09-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/aa1fb0f43571">aa1fb0f43571</a></li>
@@ -97,9 +169,7 @@ 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>
@@ -124,7 +194,6 @@ Users who implement a subclass of the NetDevice base class need to change the si
of their SetReceiveCallback and SetPromiscReceiveCallback methods.
</li>
</ul>
</li>
<li>04-08-2008; changeset
@@ -144,8 +213,6 @@ Doxygen of CsmaNetDevice::SetMaxPayloadLength for a detailed description of the
issues and solution.
</li>
</ul>
</li>
<li>21-07-2008; changeset
<a href="
@@ -174,8 +241,6 @@ 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>
@@ -205,8 +270,6 @@ ApplicationContainer Install (NodeContainer c);
</pre>
</li>
</ul>
</li>
<li>03-07-2008; changeset
<a href="
@@ -227,14 +290,15 @@ Rename all instances method names using "Set..Parameter" to "Set..Attribute"
</li>
</ul>
</li>
</ul>
</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.
@@ -264,13 +328,11 @@ 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>
@@ -286,7 +348,6 @@ addressed by this changeset. See
more.
</li>
</ul>
</li>
<li> 28-07-2008; changeset
<a href="http://code.nsnam.org/ns-3-dev/rev/6f68f1044df1">6f68f1044df1</a>
@@ -298,8 +359,8 @@ hold time == refresh time was never intentional, as it leads to
instability in neighbor detection.
</ul>
</li>
</ul>
</ul>
</body>
</html>
+80 -36
View File
@@ -3,27 +3,87 @@
This file contains ns-3 release notes (most recent releases first).
Release 3.2 (pending)
All of the ns-3 documentation is accessible from the ns-3 website:
http://www.nsnam.org
including tutorials:
http://www.nsnam.org/tutorials.html
Release 3.3 (pending)
=====================
Availability
------------
This release is immediately available from:
http://www.nsnam.org/releases/ns-3.3.tar.bz2
Supported platforms
-------------------
ns-3.2 has been tested on the following platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.3.2, 4.2.3, 4.2.1, 4.1.3, 3.4.6
- MacOS X ppc and x86
- cygwin gcc 3.4.4 (debug only)
Not all ns-3 options are available on all platforms; consult the
wiki for more information:
http://www.nsnam.org/wiki/index.php/Installation
New user-visible features
-------------------------
a) Emulated Net Device
A new net device has been added as enabling technology for ns-3 emulation
scenarios. See src/devices/emu and examples/emu-udp-echo.cc for details.
b) ICMP Support
Support for several ICMP messages has been added to ns-3. See
src/internet-stack/icmpv4.h for details.
c) IPv6 Address Support
New clases to support IPv6 addresses has been added to the system. This
is enabling technology for fuller IPv6 support scheduled for ns-3.4.
API changes from ns-3.2
-----------------------
API changes for this release are documented in the file CHANGES.html
Known issues
------------
ns-3 build 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.
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 including
fuller IPv6 support, and IPv4 and routing protocol refactoring, and some smaller
features such as an object naming facility and a new Global ARP package.
Release 3.2
===========
Availability
------------
This release is immediately available from:
http://www.nsnam.org/releases/ns-3.2.tar.bz2
What is ns-3 ?
--------------
Supported platforms
-------------------
ns-3.2 has been tested on the following platforms:
- linux x86 gcc 4.2, 4.1, and, 3.4.6.
- linux x86_64 gcc 4.3.2, 4.2.3, 4.2.1, 4.1.3, 3.4.6
- MacOS X ppc and x86
- cygwin gcc 3.4.4 (debug only)
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.
Not all ns-3 options are available on all platforms; consult the
wiki for more information:
http://www.nsnam.org/wiki/index.php/Installation
New user-visible features
-------------------------
@@ -40,8 +100,8 @@ New user-visible features
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
d) Network Simulation Cradle
It is now possible to use the Network Simulation Cradle
(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)
@@ -53,40 +113,24 @@ New user-visible features
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)
API changes from ns-3.1
-----------------------
API changes for this release are documented in the file CHANGES.html
Known issues
------------
ns-3 is known to fail on the following platforms:
ns-3 build 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.
+1 -2
View File
@@ -5,9 +5,8 @@ callback_classes = [
['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', 'std::string', 'ns3::empty', 'ns3::empty', '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'],
]
+71 -56
View File
@@ -3,15 +3,15 @@ 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'])
## bridge-net-device.h: ns3::BridgeNetDevice [class]
module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +20,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +32,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +40,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -49,8 +49,34 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice'])
register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel'])
register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice'])
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_Ns3BridgeNetDevice_methods(root_module, cls):
@@ -67,6 +93,16 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
cls.add_method('AddBridgePort',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')])
## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetNBridgePorts() const [member function]
cls.add_method('GetNBridgePorts',
'uint32_t',
[],
is_const=True)
## bridge-net-device.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeNetDevice::GetBridgePort(uint32_t n) const [member function]
cls.add_method('GetBridgePort',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'n')],
is_const=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
@@ -132,13 +168,8 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast() const [member function]
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) 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)
@@ -147,6 +178,11 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'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',
@@ -175,18 +211,23 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
## 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')],
[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')],
[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: ns3::Address ns3::BridgeNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, is_virtual=True)
## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
@@ -195,17 +236,17 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
## 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')],
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', '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')],
[param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', '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')],
[param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet const >', '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',
@@ -219,49 +260,23 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+124 -68
View File
@@ -3,27 +3,29 @@ 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')
## delay-jitter-estimation.h: ns3::DelayJitterEstimation [class]
module.add_class('DelayJitterEstimation')
## 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::Gnuplot [class]
module.add_class('Gnuplot')
## 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'])
## gtk-config-store.h: ns3::GtkConfigStore [class]
module.add_class('GtkConfigStore')
## 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')
## flow-id-tag.h: ns3::FlowIdTag [class]
module.add_class('FlowIdTag', parent=root_module['ns3::Tag'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -32,10 +34,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -44,7 +46,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -52,7 +54,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -61,12 +63,50 @@ def register_types_ns3_olsr(module):
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'])
register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
register_Ns3Gnuplot_methods(root_module, root_module['ns3::Gnuplot'])
register_Ns3GnuplotDataset_methods(root_module, root_module['ns3::GnuplotDataset'])
register_Ns3GtkConfigStore_methods(root_module, root_module['ns3::GtkConfigStore'])
register_Ns3ConfigStore_methods(root_module, root_module['ns3::ConfigStore'])
register_Ns3FlowIdTag_methods(root_module, root_module['ns3::FlowIdTag'])
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< ns3::Packet const >', '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< ns3::Packet const >', '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_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_Ns3Gnuplot_methods(root_module, cls):
@@ -88,28 +128,6 @@ def register_Ns3Gnuplot_methods(root_module, cls):
[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')])
@@ -135,6 +153,17 @@ def register_Ns3GnuplotDataset_methods(root_module, cls):
[param('double', 'x'), param('double', 'y'), param('double', 'errorDelta')])
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_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')])
@@ -156,49 +185,76 @@ def register_Ns3ConfigStore_methods(root_module, cls):
[])
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')],
def register_Ns3FlowIdTag_methods(root_module, cls):
## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag(ns3::FlowIdTag const & arg0) [copy constructor]
cls.add_constructor([param('ns3::FlowIdTag const &', 'arg0')])
## flow-id-tag.h: static ns3::TypeId ns3::FlowIdTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## delay-jitter-estimation.h: void ns3::DelayJitterEstimation::RecordRx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('RecordRx',
## flow-id-tag.h: ns3::TypeId ns3::FlowIdTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## flow-id-tag.h: uint32_t ns3::FlowIdTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## flow-id-tag.h: void ns3::FlowIdTag::Serialize(ns3::TagBuffer buf) const [member function]
cls.add_method('Serialize',
'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',
[param('ns3::TagBuffer', 'buf')],
is_const=True, is_virtual=True)
## flow-id-tag.h: void ns3::FlowIdTag::Deserialize(ns3::TagBuffer buf) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'buf')],
is_virtual=True)
## flow-id-tag.h: void ns3::FlowIdTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag() [constructor]
cls.add_constructor([])
## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag(uint32_t flowId) [constructor]
cls.add_constructor([param('uint32_t', 'flowId')])
## flow-id-tag.h: void ns3::FlowIdTag::SetFlowId(uint32_t flowId) [member function]
cls.add_method('SetFlowId',
'void',
[param('uint32_t', 'flowId')])
## flow-id-tag.h: uint32_t ns3::FlowIdTag::GetFlowId() const [member function]
cls.add_method('GetFlowId',
'uint32_t',
[],
is_const=True)
## delay-jitter-estimation.h: ns3::Time ns3::DelayJitterEstimation::GetLastJitter() const [member function]
cls.add_method('GetLastJitter',
'ns3::Time',
## flow-id-tag.h: static uint32_t ns3::FlowIdTag::AllocateFlowId() [member function]
cls.add_method('AllocateFlowId',
'uint32_t',
[],
is_const=True)
is_static=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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+49 -44
View File
@@ -5,10 +5,10 @@ def register_types(module):
## 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::CsmaDeviceRec [class]
module.add_class('CsmaDeviceRec')
## csma-channel.h: ns3::CsmaChannel [class]
module.add_class('CsmaChannel', parent=root_module['ns3::Channel'])
## csma-net-device.h: ns3::CsmaNetDevice [class]
@@ -16,10 +16,10 @@ def register_types(module):
## 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
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -28,10 +28,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -40,7 +40,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -48,7 +48,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -57,29 +57,12 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3CsmaDeviceRec_methods(root_module, root_module['ns3::CsmaDeviceRec'])
register_Ns3Backoff_methods(root_module, root_module['ns3::Backoff'])
register_Ns3CsmaDeviceRec_methods(root_module, root_module['ns3::CsmaDeviceRec'])
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)
@@ -115,6 +98,23 @@ def register_Ns3Backoff_methods(root_module, cls):
[])
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_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')])
@@ -338,13 +338,8 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast() const [member function]
## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) 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)
@@ -353,6 +348,11 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## csma-net-device.h: bool ns3::CsmaNetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'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',
@@ -381,12 +381,17 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
## 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')],
[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: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, 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')],
[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',
@@ -417,21 +422,21 @@ def register_Ns3CsmaNetDevice_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+234
View File
@@ -0,0 +1,234 @@
from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## emu-net-device.h: ns3::EmuNetDevice [class]
module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
## 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 TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## 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 olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3EmuNetDevice_methods(root_module, root_module['ns3::EmuNetDevice'])
return
def register_Ns3EmuNetDevice_methods(root_module, cls):
## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice(ns3::EmuNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::EmuNetDevice const &', 'arg0')])
## emu-net-device.h: static ns3::TypeId ns3::EmuNetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice() [constructor]
cls.add_constructor([])
## emu-net-device.h: void ns3::EmuNetDevice::SetDataRate(ns3::DataRate bps) [member function]
cls.add_method('SetDataRate',
'void',
[param('ns3::DataRate', 'bps')])
## emu-net-device.h: void ns3::EmuNetDevice::Start(ns3::Time tStart) [member function]
cls.add_method('Start',
'void',
[param('ns3::Time', 'tStart')])
## emu-net-device.h: void ns3::EmuNetDevice::Stop(ns3::Time tStop) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time', 'tStop')])
## emu-net-device.h: void ns3::EmuNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function]
cls.add_method('SetQueue',
'void',
[param('ns3::Ptr< ns3::Queue >', 'queue')])
## emu-net-device.h: void ns3::EmuNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Mac48Address', 'addr')])
## emu-net-device.h: void ns3::EmuNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
[param('std::string const', 'name')],
is_virtual=True)
## emu-net-device.h: std::string ns3::EmuNetDevice::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: void ns3::EmuNetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_virtual=True)
## emu-net-device.h: uint32_t ns3::EmuNetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: ns3::Ptr<ns3::Channel> ns3::EmuNetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_virtual=True)
## emu-net-device.h: uint16_t ns3::EmuNetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: void ns3::EmuNetDevice::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)
## emu-net-device.h: bool ns3::EmuNetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
## emu-net-device.h: ns3::Address ns3::EmuNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::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)
## emu-net-device.h: bool ns3::EmuNetDevice::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)
## emu-net-device.h: ns3::Ptr<ns3::Node> ns3::EmuNetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: void ns3::EmuNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_virtual=True)
## emu-net-device.h: bool ns3::EmuNetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: void ns3::EmuNetDevice::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)
## emu-net-device.h: void ns3::EmuNetDevice::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)
## emu-net-device.h: bool ns3::EmuNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
## emu-net-device.h: void ns3::EmuNetDevice::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_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+42 -17
View File
@@ -18,10 +18,10 @@ def register_types(module):
## 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
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -30,10 +30,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -42,7 +42,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -50,7 +50,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -71,6 +71,31 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls):
'void',
[],
is_static=True)
## global-route-manager.h: static void ns3::GlobalRouteManager::PopulateRoutingTables(ns3::NodeContainer c) [member function]
cls.add_method('PopulateRoutingTables',
'void',
[param('ns3::NodeContainer', 'c')],
is_static=True)
## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function]
cls.add_method('RecomputeRoutingTables',
'void',
[],
is_static=True)
## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function]
cls.add_method('DeleteGlobalRoutes',
'void',
[],
is_static=True)
## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes() [member function]
cls.add_method('SelectRouterNodes',
'void',
[],
is_static=True)
## global-route-manager.h: static void ns3::GlobalRouteManager::SelectRouterNodes(ns3::NodeContainer c) [member function]
cls.add_method('SelectRouterNodes',
'void',
[param('ns3::NodeContainer', 'c')],
is_static=True)
## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function]
cls.add_method('AllocateRouterId',
'uint32_t',
@@ -79,6 +104,7 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls):
return
def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
cls.add_output_stream_operator()
## 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]
@@ -176,7 +202,6 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls):
cls.add_method('SetStatus',
'void',
[param('ns3::GlobalRoutingLSA::SPFStatus', 'status')])
cls.add_output_stream_operator()
return
def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls):
@@ -260,21 +285,21 @@ def register_Ns3GlobalRouter_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+459 -132
View File
@@ -3,23 +3,39 @@ 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'])
## icmpv4.h: ns3::Icmpv4DestinationUnreachable [class]
module.add_class('Icmpv4DestinationUnreachable', parent=root_module['ns3::Header'])
## icmpv4.h: ns3::Icmpv4DestinationUnreachable [enumeration]
module.add_enum('', ['NET_UNREACHABLE', 'HOST_UNREACHABLE', 'PROTOCOL_UNREACHABLE', 'PORT_UNREACHABLE', 'FRAG_NEEDED', 'SOURCE_ROUTE_FAILED'], outer_class=root_module['ns3::Icmpv4DestinationUnreachable'])
## icmpv4.h: ns3::Icmpv4Echo [class]
module.add_class('Icmpv4Echo', parent=root_module['ns3::Header'])
## icmpv4.h: ns3::Icmpv4Header [class]
module.add_class('Icmpv4Header', parent=root_module['ns3::Header'])
## icmpv4.h: ns3::Icmpv4Header [enumeration]
module.add_enum('', ['ECHO_REPLY', 'DEST_UNREACH', 'ECHO', 'TIME_EXCEEDED'], outer_class=root_module['ns3::Icmpv4Header'])
## icmpv4.h: ns3::Icmpv4TimeExceeded [class]
module.add_class('Icmpv4TimeExceeded', parent=root_module['ns3::Header'])
## icmpv4.h: ns3::Icmpv4TimeExceeded [enumeration]
module.add_enum('', ['TIME_TO_LIVE', 'FRAGMENT_REASSEMBLY'], outer_class=root_module['ns3::Icmpv4TimeExceeded'])
## 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'])
## udp-header.h: ns3::UdpHeader [class]
module.add_class('UdpHeader', parent=root_module['ns3::Header'])
## ipv4-interface.h: ns3::Ipv4Interface [class]
module.add_class('Ipv4Interface', parent=root_module['ns3::Object'])
## 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'])
## ipv4-global-routing.h: ns3::Ipv4GlobalRouting [class]
module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -28,10 +44,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -40,7 +56,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -48,7 +64,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -57,165 +73,258 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
register_Ns3Icmpv4DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv4DestinationUnreachable'])
register_Ns3Icmpv4Echo_methods(root_module, root_module['ns3::Icmpv4Echo'])
register_Ns3Icmpv4Header_methods(root_module, root_module['ns3::Icmpv4Header'])
register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded'])
register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader'])
register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol'])
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
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]
def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls):
## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')])
## icmpv4.h: static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface() [constructor]
## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable() [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',
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetNextHopMtu(uint16_t mtu) [member function]
cls.add_method('SetNextHopMtu',
'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',
[param('uint16_t', 'mtu')])
## icmpv4.h: uint16_t ns3::Icmpv4DestinationUnreachable::GetNextHopMtu() const [member function]
cls.add_method('GetNextHopMtu',
'uint16_t',
[],
is_const=True)
## ipv4-interface.h: ns3::Ipv4Address ns3::Ipv4Interface::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4Address',
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::SetHeader(ns3::Ipv4Header header) [member function]
cls.add_method('SetHeader',
'void',
[param('ns3::Ipv4Header', 'header')])
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::GetData(uint8_t * payload) const [member function]
cls.add_method('GetData',
'void',
[param('uint8_t *', 'payload')],
is_const=True)
## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4DestinationUnreachable::GetHeader() const [member function]
cls.add_method('GetHeader',
'ns3::Ipv4Header',
[],
is_const=True)
## ipv4-interface.h: uint16_t ns3::Ipv4Interface::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
## icmpv4.h: ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True)
## ipv4-interface.h: bool ns3::Ipv4Interface::IsUp() const [member function]
cls.add_method('IsUp',
'bool',
is_const=True, visibility='private', is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
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',
is_const=True, visibility='private', is_virtual=True)
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[])
## ipv4-interface.h: void ns3::Ipv4Interface::SetDown() [member function]
cls.add_method('SetDown',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, visibility='private', is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
visibility='private', is_virtual=True)
## icmpv4.h: void ns3::Icmpv4DestinationUnreachable::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'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)
[param('std::ostream &', 'os')],
is_const=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',
def register_Ns3Icmpv4Echo_methods(root_module, cls):
## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')])
## icmpv4.h: void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function]
cls.add_method('SetIdentifier',
'void',
[])
## udp-header.h: void ns3::UdpHeader::SetDestinationPort(uint16_t port) [member function]
cls.add_method('SetDestinationPort',
[param('uint16_t', 'id')])
## icmpv4.h: void ns3::Icmpv4Echo::SetSequenceNumber(uint16_t seq) [member function]
cls.add_method('SetSequenceNumber',
'void',
[param('uint16_t', 'port')])
## udp-header.h: void ns3::UdpHeader::SetSourcePort(uint16_t port) [member function]
cls.add_method('SetSourcePort',
[param('uint16_t', 'seq')])
## icmpv4.h: void ns3::Icmpv4Echo::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('uint16_t', 'port')])
## udp-header.h: uint16_t ns3::UdpHeader::GetSourcePort() const [member function]
cls.add_method('GetSourcePort',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetIdentifier() const [member function]
cls.add_method('GetIdentifier',
'uint16_t',
[],
is_const=True)
## udp-header.h: uint16_t ns3::UdpHeader::GetDestinationPort() const [member function]
cls.add_method('GetDestinationPort',
## icmpv4.h: uint16_t ns3::Icmpv4Echo::GetSequenceNumber() const [member function]
cls.add_method('GetSequenceNumber',
'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]
## icmpv4.h: ns3::Ptr<const ns3::Packet> ns3::Icmpv4Echo::GetData() const [member function]
cls.add_method('GetData',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## icmpv4.h: static ns3::TypeId ns3::Icmpv4Echo::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## udp-header.h: ns3::TypeId ns3::UdpHeader::GetInstanceTypeId() const [member function]
## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo() [constructor]
cls.add_constructor([])
## icmpv4.h: ns3::TypeId ns3::Icmpv4Echo::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]
## icmpv4.h: uint32_t ns3::Icmpv4Echo::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]
## icmpv4.h: void ns3::Icmpv4Echo::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]
## icmpv4.h: uint32_t ns3::Icmpv4Echo::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',
## icmpv4.h: void ns3::Icmpv4Echo::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
return
def register_Ns3Icmpv4Header_methods(root_module, cls):
## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')])
## icmpv4.h: void ns3::Icmpv4Header::EnableChecksum() [member function]
cls.add_method('EnableChecksum',
'void',
[])
## icmpv4.h: void ns3::Icmpv4Header::SetType(uint8_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint8_t', 'type')])
## icmpv4.h: void ns3::Icmpv4Header::SetCode(uint8_t code) [member function]
cls.add_method('SetCode',
'void',
[param('uint8_t', 'code')])
## icmpv4.h: uint8_t ns3::Icmpv4Header::GetType() const [member function]
cls.add_method('GetType',
'uint8_t',
[],
is_const=True)
## icmpv4.h: uint8_t ns3::Icmpv4Header::GetCode() const [member function]
cls.add_method('GetCode',
'uint8_t',
[],
is_const=True)
## icmpv4.h: static ns3::TypeId ns3::Icmpv4Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header() [constructor]
cls.add_constructor([])
## icmpv4.h: ns3::TypeId ns3::Icmpv4Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## icmpv4.h: void ns3::Icmpv4Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## icmpv4.h: void ns3::Icmpv4Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
return
def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls):
## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')])
## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetHeader(ns3::Ipv4Header header) [member function]
cls.add_method('SetHeader',
'void',
[param('ns3::Ipv4Header', 'header')])
## icmpv4.h: void ns3::Icmpv4TimeExceeded::GetData(uint8_t * payload) const [member function]
cls.add_method('GetData',
'void',
[param('uint8_t *', 'payload')],
is_const=True)
## icmpv4.h: ns3::Ipv4Header ns3::Icmpv4TimeExceeded::GetHeader() const [member function]
cls.add_method('GetHeader',
'ns3::Ipv4Header',
[],
is_const=True)
## icmpv4.h: static ns3::TypeId ns3::Icmpv4TimeExceeded::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded() [constructor]
cls.add_constructor([])
## icmpv4.h: ns3::TypeId ns3::Icmpv4TimeExceeded::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## icmpv4.h: void ns3::Icmpv4TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## icmpv4.h: uint32_t ns3::Icmpv4TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## icmpv4.h: void ns3::Icmpv4TimeExceeded::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
return
def register_Ns3TcpHeader_methods(root_module, cls):
@@ -340,6 +449,160 @@ def register_Ns3TcpHeader_methods(root_module, cls):
is_const=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_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_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)
@@ -354,14 +617,23 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Socket> ns3::Ipv4L3Protocol::CreateRawSocket() [member function]
cls.add_method('CreateRawSocket',
'ns3::Ptr< ns3::Socket >',
[])
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function]
cls.add_method('DeleteRawSocket',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket')])
## 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]
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::Ipv4L4Protocol >',
[param('int', 'protocolNumber')])
[param('int', 'protocolNumber')],
is_const=True)
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
cls.add_method('Remove',
'void',
@@ -373,11 +645,11 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
## 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')])
[param('ns3::Ptr< ns3::NetDevice const >', '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')])
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', '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',
@@ -405,7 +677,7 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
## 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')])
[param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty >', 'routeReply')])
## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
@@ -550,7 +822,7 @@ def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
## 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')],
[param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, 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',
@@ -631,6 +903,61 @@ def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
visibility='protected', is_virtual=True)
return
def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
## ipv4-global-routing.h: static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting() [constructor]
cls.add_constructor([])
## ipv4-global-routing.h: bool ns3::Ipv4GlobalRouting::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, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty >', 'routeReply')],
is_virtual=True)
## ipv4-global-routing.h: bool ns3::Ipv4GlobalRouting::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-global-routing.h: void ns3::Ipv4GlobalRouting::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-global-routing.h: void ns3::Ipv4GlobalRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::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-global-routing.h: void ns3::Ipv4GlobalRouting::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-global-routing.h: uint32_t ns3::Ipv4GlobalRouting::GetNRoutes() [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[])
## ipv4-global-routing.h: ns3::Ipv4Route * ns3::Ipv4GlobalRouting::GetRoute(uint32_t i) [member function]
cls.add_method('GetRoute',
'ns3::Ipv4Route *',
[param('uint32_t', 'i')])
## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-global-routing.h: void ns3::Ipv4GlobalRouting::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]
@@ -641,21 +968,21 @@ def register_functions(root_module):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+344 -343
View File
@@ -3,55 +3,55 @@ 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'])
## static-speed-helper.h: ns3::StaticSpeedHelper [class]
module.add_class('StaticSpeedHelper', allow_subclassing=False)
## vector.h: ns3::Vector [class]
module.add_class('Vector')
## 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::RandomRectanglePositionAllocator [class]
module.add_class('RandomRectanglePositionAllocator', parent=root_module['ns3::PositionAllocator'])
## rectangle.h: ns3::RectangleChecker [class]
module.add_class('RectangleChecker', parent=root_module['ns3::AttributeChecker'])
## rectangle.h: ns3::RectangleValue [class]
module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue'])
## vector.h: ns3::VectorChecker [class]
module.add_class('VectorChecker', parent=root_module['ns3::AttributeChecker'])
## vector.h: ns3::VectorValue [class]
module.add_class('VectorValue', parent=root_module['ns3::AttributeValue'])
## 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'])
## position-allocator.h: ns3::ListPositionAllocator [class]
module.add_class('ListPositionAllocator', 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'])
## 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'])
## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel [class]
module.add_class('RandomWaypointMobilityModel', parent=root_module['ns3::MobilityModel'])
## static-mobility-model.h: ns3::StaticMobilityModel [class]
module.add_class('StaticMobilityModel', parent=root_module['ns3::MobilityModel'])
## 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
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -60,10 +60,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -72,7 +72,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -80,7 +80,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -89,104 +89,29 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3Rectangle_methods(root_module, root_module['ns3::Rectangle'])
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_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator'])
register_Ns3RectangleChecker_methods(root_module, root_module['ns3::RectangleChecker'])
register_Ns3RectangleValue_methods(root_module, root_module['ns3::RectangleValue'])
register_Ns3VectorChecker_methods(root_module, root_module['ns3::VectorChecker'])
register_Ns3VectorValue_methods(root_module, root_module['ns3::VectorValue'])
register_Ns3GridPositionAllocator_methods(root_module, root_module['ns3::GridPositionAllocator'])
register_Ns3ListPositionAllocator_methods(root_module, root_module['ns3::ListPositionAllocator'])
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_Ns3RandomWaypointMobilityModel_methods(root_module, root_module['ns3::RandomWaypointMobilityModel'])
register_Ns3StaticMobilityModel_methods(root_module, root_module['ns3::StaticMobilityModel'])
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):
cls.add_output_stream_operator()
## 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]
@@ -216,7 +141,69 @@ def register_Ns3Rectangle_methods(root_module, cls):
cls.add_instance_attribute('yMax', 'double', is_const=False)
## rectangle.h: ns3::Rectangle::yMin [variable]
cls.add_instance_attribute('yMin', 'double', is_const=False)
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 & vel) [constructor]
cls.add_constructor([param('ns3::Vector const &', 'position'), param('ns3::Vector const &', 'vel')])
## static-speed-helper.h: void ns3::StaticSpeedHelper::SetPosition(ns3::Vector const & position) [member function]
cls.add_method('SetPosition',
'void',
[param('ns3::Vector const &', 'position')])
## 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::SetVelocity(ns3::Vector const & vel) [member function]
cls.add_method('SetVelocity',
'void',
[param('ns3::Vector const &', 'vel')])
## 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',
[])
## static-speed-helper.h: void ns3::StaticSpeedHelper::UpdateWithBounds(ns3::Rectangle const & rectangle) const [member function]
cls.add_method('UpdateWithBounds',
'void',
[param('ns3::Rectangle const &', 'rectangle')],
is_const=True)
## static-speed-helper.h: void ns3::StaticSpeedHelper::Update() const [member function]
cls.add_method('Update',
'void',
[],
is_const=True)
return
def register_Ns3Vector_methods(root_module, cls):
cls.add_output_stream_operator()
## 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)
return
def register_Ns3PositionAllocator_methods(root_module, cls):
@@ -236,118 +223,6 @@ def register_Ns3PositionAllocator_methods(root_module, cls):
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')])
@@ -381,87 +256,109 @@ def register_Ns3RandomDiscPositionAllocator_methods(root_module, cls):
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]
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)
## mobility-model.h: ns3::MobilityModel::MobilityModel() [constructor]
## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator() [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',
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetX(ns3::RandomVariable x) [member function]
cls.add_method('SetX',
'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',
[param('ns3::RandomVariable', 'x')])
## position-allocator.h: void ns3::RandomRectanglePositionAllocator::SetY(ns3::RandomVariable y) [member function]
cls.add_method('SetY',
'void',
[],
is_const=True, visibility='protected')
## mobility-model.h: ns3::Vector ns3::MobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
[param('ns3::RandomVariable', 'y')])
## position-allocator.h: ns3::Vector ns3::RandomRectanglePositionAllocator::GetNext() const [member function]
cls.add_method('GetNext',
'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)
is_const=True, 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]
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([])
## random-direction-2d-mobility-model.h: void ns3::RandomDirection2dMobilityModel::DoDispose() [member function]
cls.add_method('DoDispose',
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',
[],
visibility='private', is_virtual=True)
## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetPosition() const [member function]
cls.add_method('DoGetPosition',
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_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_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, 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)
## vector.h: ns3::Ptr<ns3::AttributeValue> ns3::VectorValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, visibility='private', is_virtual=True)
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_Ns3GridPositionAllocator_methods(root_module, cls):
@@ -535,27 +432,104 @@ def register_Ns3GridPositionAllocator_methods(root_module, cls):
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]
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)
## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel() [constructor]
## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator() [constructor]
cls.add_constructor([])
## random-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetPosition() const [member function]
## 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_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< ns3::MobilityModel const >', '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-waypoint-mobility-model.h: void ns3::RandomWaypointMobilityModel::DoSetPosition(ns3::Vector const & position) [member function]
## 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-waypoint-mobility-model.h: ns3::Vector ns3::RandomWaypointMobilityModel::DoGetVelocity() const [member function]
## random-direction-2d-mobility-model.h: ns3::Vector ns3::RandomDirection2dMobilityModel::DoGetVelocity() const [member function]
cls.add_method('DoGetVelocity',
'ns3::Vector',
[],
@@ -594,6 +568,60 @@ def register_Ns3RandomWalk2dMobilityModel_methods(root_module, cls):
is_const=True, visibility='private', 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_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_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')])
@@ -604,8 +632,8 @@ def register_Ns3StaticSpeedMobilityModel_methods(root_module, cls):
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',
## static-speed-mobility-model.h: void ns3::StaticSpeedMobilityModel::SetVelocity(ns3::Vector const & speed) [member function]
cls.add_method('SetVelocity',
'void',
[param('ns3::Vector const &', 'speed')])
## static-speed-mobility-model.h: ns3::Vector ns3::StaticSpeedMobilityModel::DoGetPosition() const [member function]
@@ -662,35 +690,12 @@ def register_Ns3HierarchicalMobilityModel_methods(root_module, cls):
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
## 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')])
## rectangle.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeRectangleChecker() [free function]
module.add_function('MakeRectangleChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
@@ -699,25 +704,21 @@ def register_functions(root_module):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+202 -107
View File
@@ -4,31 +4,31 @@ 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 TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## 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 olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -36,47 +36,89 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
## olsr-agent.h: ns3::olsr::Agent [class]
module.add_class('Agent', parent=root_module['ns3::Object'])
## 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::MessageHeader::Mid [struct]
module.add_class('Mid', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::MessageHeader::Tc [struct]
module.add_class('Tc', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h: ns3::olsr::PacketHeader [class]
module.add_class('PacketHeader', parent=root_module['ns3::Header'])
## olsr-routing-table.h: ns3::olsr::RoutingTable [class]
module.add_class('RoutingTable', parent=root_module['ns3::Ipv4RoutingProtocol'])
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry [struct]
module.add_class('RoutingTableEntry')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', 'ns3::olsr::MessageHeader::Hello::LinkMessage', container_type='vector')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hna::Association >', 'ns3::olsr::MessageHeader::Hna::Association', container_type='vector')
module.add_container('std::vector< ns3::olsr::RoutingTableEntry >', 'ns3::olsr::RoutingTableEntry', container_type='vector')
def register_methods(root_module):
register_Ns3OlsrAgent_methods(root_module, root_module['ns3::olsr::Agent'])
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_Ns3OlsrMessageHeaderMid_methods(root_module, root_module['ns3::olsr::MessageHeader::Mid'])
register_Ns3OlsrMessageHeaderTc_methods(root_module, root_module['ns3::olsr::MessageHeader::Tc'])
register_Ns3OlsrPacketHeader_methods(root_module, root_module['ns3::olsr::PacketHeader'])
register_Ns3OlsrRoutingTable_methods(root_module, root_module['ns3::olsr::RoutingTable'])
register_Ns3OlsrRoutingTableEntry_methods(root_module, root_module['ns3::olsr::RoutingTableEntry'])
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)
## olsr-agent.h: ns3::Ptr<const ns3::olsr::RoutingTable> ns3::olsr::Agent::GetRoutingTable() const [member function]
cls.add_method('GetRoutingTable',
'ns3::Ptr< ns3::olsr::RoutingTable const >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3OlsrMessageHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## 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]
@@ -201,35 +243,6 @@ def register_Ns3OlsrMessageHeader_methods(root_module, cls):
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):
@@ -284,36 +297,6 @@ def register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, cls):
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([])
@@ -353,34 +336,66 @@ def register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, cls):
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]
def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls):
## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid() [constructor]
cls.add_constructor([])
## olsr-agent.h: static ns3::TypeId ns3::olsr::Agent::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
## 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_static=True)
## olsr-agent.h: void ns3::olsr::Agent::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
is_const=True)
## olsr-header.h: void ns3::olsr::MessageHeader::Mid::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'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',
[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_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_pure_virtual=True, is_virtual=True)
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_Ns3OlsrPacketHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## 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]
@@ -433,24 +448,104 @@ def register_Ns3OlsrPacketHeader_methods(root_module, cls):
cls.add_method('SetPacketSequenceNumber',
'void',
[param('uint16_t', 'seqnum')])
cls.add_output_stream_operator()
return
def register_Ns3OlsrRoutingTable_methods(root_module, cls):
## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable(ns3::olsr::RoutingTable const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::RoutingTable const &', 'arg0')])
## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable() [constructor]
cls.add_constructor([])
## olsr-routing-table.h: void ns3::olsr::RoutingTable::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')])
## olsr-routing-table.h: void ns3::olsr::RoutingTable::SetMainAddress(ns3::Ipv4Address mainAddress) [member function]
cls.add_method('SetMainAddress',
'void',
[param('ns3::Ipv4Address', 'mainAddress')])
## olsr-routing-table.h: void ns3::olsr::RoutingTable::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## olsr-routing-table.h: uint32_t ns3::olsr::RoutingTable::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## olsr-routing-table.h: std::vector<ns3::olsr::RoutingTableEntry,std::allocator<ns3::olsr::RoutingTableEntry> > ns3::olsr::RoutingTable::GetEntries() const [member function]
cls.add_method('GetEntries',
'std::vector< ns3::olsr::RoutingTableEntry >',
[],
is_const=True)
## olsr-routing-table.h: void ns3::olsr::RoutingTable::RemoveEntry(ns3::Ipv4Address const & dest) [member function]
cls.add_method('RemoveEntry',
'void',
[param('ns3::Ipv4Address const &', 'dest')])
## olsr-routing-table.h: void ns3::olsr::RoutingTable::AddEntry(ns3::Ipv4Address const & dest, ns3::Ipv4Address const & next, uint32_t interface, uint32_t distance) [member function]
cls.add_method('AddEntry',
'void',
[param('ns3::Ipv4Address const &', 'dest'), param('ns3::Ipv4Address const &', 'next'), param('uint32_t', 'interface'), param('uint32_t', 'distance')])
## olsr-routing-table.h: void ns3::olsr::RoutingTable::AddEntry(ns3::Ipv4Address const & dest, ns3::Ipv4Address const & next, ns3::Ipv4Address const & interfaceAddress, uint32_t distance) [member function]
cls.add_method('AddEntry',
'void',
[param('ns3::Ipv4Address const &', 'dest'), param('ns3::Ipv4Address const &', 'next'), param('ns3::Ipv4Address const &', 'interfaceAddress'), param('uint32_t', 'distance')])
## olsr-routing-table.h: bool ns3::olsr::RoutingTable::Lookup(ns3::Ipv4Address const & dest, ns3::olsr::RoutingTableEntry & outEntry) const [member function]
cls.add_method('Lookup',
'bool',
[param('ns3::Ipv4Address const &', 'dest'), param('ns3::olsr::RoutingTableEntry &', 'outEntry')],
is_const=True)
## olsr-routing-table.h: bool ns3::olsr::RoutingTable::FindSendEntry(ns3::olsr::RoutingTableEntry const & entry, ns3::olsr::RoutingTableEntry & outEntry) const [member function]
cls.add_method('FindSendEntry',
'bool',
[param('ns3::olsr::RoutingTableEntry const &', 'entry'), param('ns3::olsr::RoutingTableEntry &', 'outEntry')],
is_const=True)
## olsr-routing-table.h: bool ns3::olsr::RoutingTable::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, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty >', 'routeReply')],
is_virtual=True)
## olsr-routing-table.h: bool ns3::olsr::RoutingTable::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)
## olsr-routing-table.h: void ns3::olsr::RoutingTable::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls):
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::destAddr [variable]
cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::nextAddr [variable]
cls.add_instance_attribute('nextAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::interface [variable]
cls.add_instance_attribute('interface', 'uint32_t', is_const=False)
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::distance [variable]
cls.add_instance_attribute('distance', 'uint32_t', is_const=False)
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry(ns3::olsr::RoutingTableEntry const & arg0) [copy constructor]
cls.add_constructor([param('ns3::olsr::RoutingTableEntry const &', 'arg0')])
## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry() [constructor]
cls.add_constructor([])
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
+16 -16
View File
@@ -6,10 +6,10 @@ def register_types(module):
## onoff-application.h: ns3::OnOffApplication [class]
module.add_class('OnOffApplication', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -18,10 +18,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -30,7 +30,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -38,7 +38,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -83,21 +83,21 @@ def register_Ns3OnOffApplication_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+16 -16
View File
@@ -6,10 +6,10 @@ def register_types(module):
## packet-sink.h: ns3::PacketSink [class]
module.add_class('PacketSink', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -18,10 +18,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -30,7 +30,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -38,7 +38,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -79,21 +79,21 @@ def register_Ns3PacketSink_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+78 -24
View File
@@ -3,15 +3,17 @@ from pybindgen import Module, FileCodeSink, param, retval, cppclass
def register_types(module):
root_module = module.get_root()
## ppp-header.h: ns3::PppHeader [class]
module.add_class('PppHeader', parent=root_module['ns3::Header'])
## 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
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +22,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +34,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +42,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -49,10 +51,48 @@ def register_types_ns3_olsr(module):
def register_methods(root_module):
register_Ns3PppHeader_methods(root_module, root_module['ns3::PppHeader'])
register_Ns3PointToPointChannel_methods(root_module, root_module['ns3::PointToPointChannel'])
register_Ns3PointToPointNetDevice_methods(root_module, root_module['ns3::PointToPointNetDevice'])
return
def register_Ns3PppHeader_methods(root_module, cls):
## ppp-header.h: ns3::PppHeader::PppHeader(ns3::PppHeader const & arg0) [copy constructor]
cls.add_constructor([param('ns3::PppHeader const &', 'arg0')])
## ppp-header.h: ns3::PppHeader::PppHeader() [constructor]
cls.add_constructor([])
## ppp-header.h: static ns3::TypeId ns3::PppHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ppp-header.h: ns3::TypeId ns3::PppHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ppp-header.h: void ns3::PppHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ppp-header.h: void ns3::PppHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ppp-header.h: uint32_t ns3::PppHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## ppp-header.h: uint32_t ns3::PppHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
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')])
@@ -126,6 +166,15 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
cls.add_method('SetAddress',
'void',
[param('ns3::Mac48Address', 'addr')])
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetFrameSize(uint16_t frameSize) [member function]
cls.add_method('SetFrameSize',
'void',
[param('uint16_t', 'frameSize')])
## point-to-point-net-device.h: uint16_t ns3::PointToPointNetDevice::GetFrameSize() const [member function]
cls.add_method('GetFrameSize',
'uint16_t',
[],
is_const=True)
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetName(std::string const name) [member function]
cls.add_method('SetName',
'void',
@@ -191,13 +240,8 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast() const [member function]
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) 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)
@@ -206,6 +250,11 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
'bool',
[],
is_const=True, is_virtual=True)
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'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',
@@ -234,12 +283,17 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
## 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')],
[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: ns3::Address ns3::PointToPointNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, 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')],
[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',
@@ -255,21 +309,21 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+163 -136
View File
@@ -7,27 +7,29 @@ def register_types(module):
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 >'])
## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int> [class]
module.add_class('MinMaxAvgTotalCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
## omnet-data-output.h: ns3::OmnetDataOutput [class]
module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class]
module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
## sqlite-data-output.h: ns3::SqliteDataOutput [class]
module.add_class('SqliteDataOutput', parent=root_module['ns3::DataOutputInterface'])
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class]
module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator'])
## basic-data-calculators.h: ns3::CounterCalculator<unsigned int> [class]
module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
## packet-data-calculators.h: ns3::PacketCounterCalculator [class]
module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -36,10 +38,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -48,7 +50,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -56,7 +58,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -67,14 +69,15 @@ def register_types_ns3_olsr(module):
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_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
register_Ns3OmnetDataOutput_methods(root_module, root_module['ns3::OmnetDataOutput'])
register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator'])
register_Ns3SqliteDataOutput_methods(root_module, root_module['ns3::SqliteDataOutput'])
register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::TimeMinMaxAvgTotalCalculator'])
register_Ns3CounterCalculator__Unsigned_int_methods(root_module, root_module['ns3::CounterCalculator< unsigned int >'])
register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator'])
return
def register_Ns3DataOutputCallback_methods(root_module, cls):
@@ -158,37 +161,6 @@ def register_Ns3DataCalculator_methods(root_module, cls):
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')])
@@ -262,49 +234,6 @@ def register_Ns3DataCollector_methods(root_module, cls):
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')])
@@ -322,40 +251,21 @@ def register_Ns3DataOutputInterface_methods(root_module, cls):
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]
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 > const &', 'arg0')])
## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int>::MinMaxAvgTotalCalculator() [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',
## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator<unsigned int>::Update(unsigned int const i) [member function]
cls.add_method('Update',
'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',
[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('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]
[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',
[],
@@ -388,23 +298,140 @@ def register_Ns3OmnetDataOutput_methods(root_module, cls):
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< ns3::Packet const >', '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< ns3::Packet const >', '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_Ns3SqliteDataOutput_methods(root_module, cls):
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput(ns3::SqliteDataOutput const & arg0) [copy constructor]
cls.add_constructor([param('ns3::SqliteDataOutput const &', 'arg0')])
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput() [constructor]
cls.add_constructor([])
## sqlite-data-output.h: void ns3::SqliteDataOutput::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_virtual=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::SetDBFile(std::string const file) [member function]
cls.add_method('SetDBFile',
'void',
[param('std::string const', 'file')])
## sqlite-data-output.h: std::string ns3::SqliteDataOutput::GetDBFile() const [member function]
cls.add_method('GetDBFile',
'std::string',
[],
is_const=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::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_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 > const &', '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)
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< ns3::Packet const >', '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< ns3::Packet const >', '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_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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
+16 -16
View File
@@ -8,10 +8,10 @@ def register_types(module):
## udp-echo-server.h: ns3::UdpEchoServer [class]
module.add_class('UdpEchoServer', parent=root_module['ns3::Application'])
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -20,10 +20,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -32,7 +32,7 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
@@ -40,7 +40,7 @@ def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -113,21 +113,21 @@ def register_Ns3UdpEchoServer_methods(root_module, cls):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), 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_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(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()
## v4ping.h: ns3::V4Ping [class]
module.add_class('V4Ping', parent=root_module['ns3::Application'])
## 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 TimeStepPrecision
nested_module = module.add_cpp_namespace('TimeStepPrecision')
register_types_ns3_TimeStepPrecision(nested_module)
## 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 olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
def register_types_ns3_Config(module):
root_module = module.get_root()
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_olsr(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3V4Ping_methods(root_module, root_module['ns3::V4Ping'])
return
def register_Ns3V4Ping_methods(root_module, cls):
## v4ping.h: ns3::V4Ping::V4Ping(ns3::V4Ping const & arg0) [copy constructor]
cls.add_constructor([param('ns3::V4Ping const &', 'arg0')])
## v4ping.h: static ns3::TypeId ns3::V4Ping::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## v4ping.h: ns3::V4Ping::V4Ping() [constructor]
cls.add_constructor([])
## v4ping.h: void ns3::V4Ping::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## v4ping.h: void ns3::V4Ping::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
## v4ping.h: void ns3::V4Ping::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_Config(module.get_submodule('Config'), root_module)
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
return
File diff suppressed because it is too large Load Diff
+103
View File
@@ -1,3 +1,4 @@
#include "ns3/ref-count-base.h"
#include "ns3module.h"
@@ -28,11 +29,20 @@ public:
}
virtual ~PythonEventImpl ()
{
PyGILState_STATE __py_gil_state;
__py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
Py_DECREF(m_callback);
Py_DECREF(m_args);
if (PyEval_ThreadsInitialized())
PyGILState_Release(__py_gil_state);
}
virtual void Notify ()
{
PyGILState_STATE __py_gil_state;
__py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
PyObject *retval = PyObject_CallObject(m_callback, m_args);
if (retval) {
if (retval != Py_None) {
@@ -43,6 +53,9 @@ public:
} else {
PyErr_Print();
}
if (PyEval_ThreadsInitialized())
PyGILState_Release(__py_gil_state);
}
};
@@ -176,3 +189,93 @@ error:
return NULL;
}
PyObject *
_wrap_TypeId_LookupByNameFailSafe(PyNs3TypeId *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
bool ok;
const char *name;
Py_ssize_t name_len;
ns3::TypeId tid;
PyNs3TypeId *py_tid;
const char *keywords[] = {"name", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
PyObject *exc_type, *traceback;
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
return NULL;
}
ok = ns3::TypeId::LookupByNameFailSafe(std::string(name, name_len), &tid);
if (!ok)
{
PyErr_Format(PyExc_KeyError, "The ns3 type with name `%s' is not registered", name);
return NULL;
}
py_tid = PyObject_New(PyNs3TypeId, &PyNs3TypeId_Type);
py_tid->obj = new ns3::TypeId (tid);
PyNs3TypeId_wrapper_registry[(void *) py_tid->obj] = (PyObject *) py_tid;
return (PyObject *) py_tid;
}
class CommandLinePythonValueSetter : public ns3::RefCountBase
{
PyObject *m_namespace;
std::string m_variable;
public:
CommandLinePythonValueSetter (PyObject *ns, std::string const &variable) {
Py_INCREF(ns);
m_namespace = ns;
m_variable = variable;
}
bool Parse (std::string value) {
PyObject *pyvalue = PyString_FromStringAndSize (value.data(), value.size());
PyObject_SetAttrString (m_namespace, (char *) m_variable.c_str(), pyvalue);
if (PyErr_Occurred()) {
PyErr_Print();
return false;
}
return true;
}
virtual ~CommandLinePythonValueSetter () {
Py_DECREF (m_namespace);
m_namespace = NULL;
}
};
PyObject *
_wrap_CommandLine_AddValue(PyNs3CommandLine *self, PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
const char *name, *help, *variable = NULL;
PyObject *py_namespace = NULL;
const char *keywords[] = {"name", "help", "variable", "namespace", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ss|sO", (char **) keywords, &name, &help, &variable, &py_namespace)) {
PyObject *exc_type, *traceback;
PyErr_Fetch(&exc_type, return_exception, &traceback);
Py_XDECREF(exc_type);
Py_XDECREF(traceback);
return NULL;
}
if (variable == NULL) {
variable = name;
}
if (py_namespace == NULL) {
py_namespace = (PyObject *) self;
}
ns3::Ptr<CommandLinePythonValueSetter> setter = ns3::Create<CommandLinePythonValueSetter> (py_namespace, variable);
self->obj->AddValue (name, help, ns3::MakeCallback (&CommandLinePythonValueSetter::Parse, setter));
Py_INCREF(Py_None);
return Py_None;
}
+6
View File
@@ -85,6 +85,7 @@ def main():
ns3modulegen_core_customizations.Simulator_customizations(root_module)
ns3modulegen_core_customizations.CommandLine_customizations(root_module)
ns3modulegen_core_customizations.TypeId_customizations(root_module)
for local_module in LOCAL_MODULES:
@@ -130,6 +131,11 @@ def main():
for clsname in ['SystemThread', 'SystemMutex', 'SystemCondition', 'CriticalSection']:
root_module.classes.remove(root_module['ns3::%s' % clsname])
if 'EmuNetDevice' not in enabled_features:
for clsname in ['EmuNetDevice', 'EmuHelper']:
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])
@@ -292,6 +292,8 @@ def CommandLine_customizations(module):
CommandLine = module['ns3::CommandLine']
CommandLine.add_method('Parse', None, [ArgvParam(None, 'argv')],
is_static=False)
CommandLine.add_custom_method_wrapper("AddValue", "_wrap_CommandLine_AddValue",
flags=["METH_VARARGS", "METH_KEYWORDS"])
def Object_customizations(module):
@@ -424,6 +426,7 @@ static int %(WRAPPER_NAME)s (%(PYSTRUCT)s *self, PyObject *args, PyObject *kwarg
return -1;
}
%(CONSTRUCT_CODE)s
PyNs3ObjectBase_wrapper_registry[(void *) self->obj] = (PyObject *) self;
return 0;
}
''' % dict(WRAPPER_NAME=wrapper_name, PYSTRUCT=cls.pystruct, CLASS_NAME=cls.full_name,
@@ -517,3 +520,10 @@ def Attribute_customizations(module):
and param.default_value_type is None:
param.default_value_type = 'ns3::EmptyAttributeValue'
def TypeId_customizations(module):
TypeId = module['ns3::TypeId']
TypeId.add_custom_method_wrapper("LookupByNameFailSafe", "_wrap_TypeId_LookupByNameFailSafe",
flags=["METH_VARARGS", "METH_KEYWORDS", "METH_STATIC"])
+117 -46
View File
@@ -16,15 +16,17 @@ 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_contrib
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_emu
import ns3_module_bridge
import ns3_module_packet_sink
import ns3_module_v4ping
import ns3_module_global_routing
import ns3_module_onoff
import ns3_module_olsr
@@ -82,17 +84,6 @@ def register_types(module):
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)
@@ -104,6 +95,17 @@ def register_types(module):
ns3_module_node__local.register_types(module)
root_module.end_section('ns3_module_node')
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_point_to_point')
ns3_module_point_to_point.register_types(module)
@@ -159,6 +161,17 @@ def register_types(module):
ns3_module_csma__local.register_types(module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_emu')
ns3_module_emu.register_types(module)
try:
import ns3_module_emu__local
except ImportError:
pass
else:
ns3_module_emu__local.register_types(module)
root_module.end_section('ns3_module_emu')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_types(module)
@@ -181,6 +194,17 @@ def register_types(module):
ns3_module_packet_sink__local.register_types(module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_v4ping')
ns3_module_v4ping.register_types(module)
try:
import ns3_module_v4ping__local
except ImportError:
pass
else:
ns3_module_v4ping__local.register_types(module)
root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_types(module)
@@ -236,11 +260,13 @@ def register_types(module):
ns3_module_helper__local.register_types(module)
root_module.end_section('ns3_module_helper')
module.add_container('std::vector< unsigned int >', 'unsigned int', container_type='vector')
module.add_container('std::list< unsigned int >', 'unsigned int', container_type='list')
## Register a nested module for the namespace internal
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
## Register a nested module for the namespace TimeStepPrecision
@@ -249,10 +275,10 @@ def register_types(module):
register_types_ns3_TimeStepPrecision(nested_module)
## Register a nested module for the namespace Config
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace olsr
@@ -261,15 +287,16 @@ def register_types(module):
register_types_ns3_olsr(nested_module)
def register_types_ns3_internal(module):
def register_types_ns3_Config(module):
root_module = module.get_root()
module.add_container('std::vector< std::string >', 'std::string', container_type='vector')
def register_types_ns3_TimeStepPrecision(module):
root_module = module.get_root()
def register_types_ns3_Config(module):
def register_types_ns3_internal(module):
root_module = module.get_root()
@@ -322,17 +349,6 @@ def register_methods(root_module):
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)
@@ -344,6 +360,17 @@ def register_methods(root_module):
ns3_module_node__local.register_methods(root_module)
root_module.end_section('ns3_module_node')
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_point_to_point')
ns3_module_point_to_point.register_methods(root_module)
@@ -399,6 +426,17 @@ def register_methods(root_module):
ns3_module_csma__local.register_methods(root_module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_emu')
ns3_module_emu.register_methods(root_module)
try:
import ns3_module_emu__local
except ImportError:
pass
else:
ns3_module_emu__local.register_methods(root_module)
root_module.end_section('ns3_module_emu')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_methods(root_module)
@@ -421,6 +459,17 @@ def register_methods(root_module):
ns3_module_packet_sink__local.register_methods(root_module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_v4ping')
ns3_module_v4ping.register_methods(root_module)
try:
import ns3_module_v4ping__local
except ImportError:
pass
else:
ns3_module_v4ping__local.register_methods(root_module)
root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_methods(root_module)
@@ -524,17 +573,6 @@ def register_functions(root_module):
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)
@@ -546,6 +584,17 @@ def register_functions(root_module):
ns3_module_node__local.register_functions(root_module)
root_module.end_section('ns3_module_node')
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_point_to_point')
ns3_module_point_to_point.register_functions(root_module)
@@ -601,6 +650,17 @@ def register_functions(root_module):
ns3_module_csma__local.register_functions(root_module)
root_module.end_section('ns3_module_csma')
root_module.begin_section('ns3_module_emu')
ns3_module_emu.register_functions(root_module)
try:
import ns3_module_emu__local
except ImportError:
pass
else:
ns3_module_emu__local.register_functions(root_module)
root_module.end_section('ns3_module_emu')
root_module.begin_section('ns3_module_bridge')
ns3_module_bridge.register_functions(root_module)
@@ -623,6 +683,17 @@ def register_functions(root_module):
ns3_module_packet_sink__local.register_functions(root_module)
root_module.end_section('ns3_module_packet_sink')
root_module.begin_section('ns3_module_v4ping')
ns3_module_v4ping.register_functions(root_module)
try:
import ns3_module_v4ping__local
except ImportError:
pass
else:
ns3_module_v4ping__local.register_functions(root_module)
root_module.end_section('ns3_module_v4ping')
root_module.begin_section('ns3_module_global_routing')
ns3_module_global_routing.register_functions(root_module)
@@ -678,19 +749,19 @@ def register_functions(root_module):
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_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
return
def register_functions_ns3_internal(module, root_module):
def register_functions_ns3_Config(module, root_module):
return
def register_functions_ns3_TimeStepPrecision(module, root_module):
return
def register_functions_ns3_Config(module, root_module):
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
+6 -4
View File
@@ -48,9 +48,6 @@ type_annotations = {
'decref_method': 'Unref',
'peekref_method': 'GetReferenceCount',
},
'::ns3::PacketMetadata': {
'ignore': None,
},
'::ns3::AttributeChecker': {
'automatic_type_narrowing': 'true',
'allow_subclassing': 'false',
@@ -59,6 +56,11 @@ type_annotations = {
'automatic_type_narrowing': 'true',
'allow_subclassing': 'false',
},
'::ns3::CommandLine': {
'allow_subclassing': 'true', # needed so that AddValue is able to set attributes on the object
},
'ns3::RandomVariable::RandomVariable(ns3::RandomVariableBase const & variable) [constructor]': {
'ignore': None,
},
@@ -73,7 +75,7 @@ type_annotations = {
'params': {'info':{'transfer_ownership': 'false'}}
},
'static bool ns3::TypeId::LookupByNameFailSafe(std::string name, ns3::TypeId * tid) [member function]': {
'params': {'tid': {'transfer_ownership': 'false'}}
'ignore': None, # manually wrapped in
},
'bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]': {
'params': {'obj': {'transfer_ownership':'false'}}
+84 -12
View File
@@ -16,16 +16,25 @@ import sys
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_PYBINDGEN_VERSION = (0, 9, 0, 605)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
def add_to_python_path(path):
if os.environ.get('PYTHONPATH', ''):
os.environ['PYTHONPATH'] = path + os.pathsep + os.environ.get('PYTHONPATH')
else:
os.environ['PYTHONPATH'] = path
def set_pybindgen_pythonpath(env):
if env['WITH_PYBINDGEN']:
add_to_python_path(env['WITH_PYBINDGEN'])
else:
add_to_python_path(LOCAL_PYBINDGEN_PATH)
def set_options(opt):
opt.tool_options('python')
opt.add_option('--disable-python',
@@ -41,6 +50,10 @@ def set_options(opt):
"instead of using the system installed version."),
action="store_true", default=False,
dest='pybindgen_checkout')
opt.add_option('--with-pybindgen',
help=('Path to an existing pybindgen source tree to use.'),
default=None,
dest='with_pybindgen', type="string")
def fetch_pybindgen(conf):
"""
@@ -55,19 +68,29 @@ def fetch_pybindgen(conf):
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."
print "Trying to update pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip."
cmd = [bzr, "pull", rev, PYBINDGEN_BRANCH]
print " => ", ' '.join(cmd)
if subprocess.Popen(cmd, cwd=LOCAL_PYBINDGEN_PATH).wait():
try:
if subprocess.Popen(cmd, cwd=LOCAL_PYBINDGEN_PATH).wait():
return False
except KeyboardInterrupt:
print "Interrupted; Python bindings will be disabled."
return False
print "Update was successful."
else:
print "Trying to fetch pybindgen; this will fail if no network connection is available."
print "Trying to fetch pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip."
cmd = [bzr, "checkout", rev, PYBINDGEN_BRANCH, LOCAL_PYBINDGEN_PATH]
print " => ", ' '.join(cmd)
if subprocess.Popen(cmd).wait():
try:
if subprocess.Popen(cmd).wait():
return False
except KeyboardInterrupt:
print "Interrupted; Python bindings will be disabled."
shutil.rmtree(LOCAL_PYBINDGEN_PATH, True)
return False
print "Fetch was successful."
@@ -108,15 +131,31 @@ def configure(conf):
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
return
# Fix a bug with WAF and g++ 4.3.2 (it does not include "(GCC") in
# the output of g++ --version, so the WAF python detection fails
# to recognize it is gcc)
gcc_version = os.popen("%s --version" % conf.env['CXX']).readline()
if '(GCC)' in gcc_version or 'g++' in gcc_version:
conf.env.append_value('CXXFLAGS_PYEMBED','-fno-strict-aliasing')
conf.env.append_value('CXXFLAGS_PYEXT','-fno-strict-aliasing')
## Check for pybindgen
no_net = False
if Params.g_options.with_pybindgen:
conf.env['WITH_PYBINDGEN'] = os.path.abspath(Params.g_options.with_pybindgen)
no_net = True
if Params.g_options.pybindgen_checkout:
fetch_pybindgen(conf)
set_pybindgen_pythonpath(conf.env)
try:
conf.check_python_module('pybindgen')
except Configure.ConfigurationError:
warning("pybindgen missing")
if not fetch_pybindgen(conf):
if no_net or not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen missing and could not be retrieved")
return
@@ -134,7 +173,7 @@ def configure(conf):
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):
if no_net or not fetch_pybindgen(conf):
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen too old and newer version could not be retrieved")
return
@@ -230,6 +269,14 @@ def gen_ns3_metaheader(task):
header_files.sort(sort_func)
print >> outfile, """
/* http://www.nsnam.org/bugzilla/show_bug.cgi?id=413 */
#ifdef ECHO
# undef ECHO
#endif
"""
for header in header_files:
print >> outfile, "#include \"ns3/%s\"" % (header,)
@@ -241,6 +288,28 @@ __dummy_function_to_force_template_instantiation (Ptr<Object> obj, TypeId typeId
return obj->GetObject<Object> (typeId);
}
static inline void
__dummy_function_to_force_template_instantiation_v2 ()
{
Time t1, t2, t3;
t1 = t2 + t3;
t1 = t2 - t3;
TimeSquare tsq = t2*t3;
Time tsqdiv = tsq/Seconds(1);
Scalar scal = t2/t3;
TimeInvert inv = scal/t3;
t1 = scal*t1;
t1 = t1/scal;
t1 < t2;
t1 <= t2;
t1 == t2;
t1 != t2;
t1 >= t2;
t1 > t2;
}
}
"""
outfile.close()
@@ -343,7 +412,7 @@ class PythonScanTask(Task.TaskBase):
scan.stdin.close()
if scan.wait():
raise SystemExit(1)
raise SystemExit(0)
def build(bld):
if Params.g_options.python_disable:
@@ -352,6 +421,8 @@ def build(bld):
env = bld.env_of_name('default')
curdir = bld.m_curdirnode.abspath()
set_pybindgen_pythonpath(env)
#Object.register('all-ns3-headers', AllNs3Headers)
Action.Action('gen-ns3-metaheader', func=gen_ns3_metaheader, color='BLUE')
@@ -383,6 +454,7 @@ def build(bld):
bindgen.command_is_external = True
bindgen.stderr = 'ns3modulegen.log'
bindgen.argv = [
#'-m', 'pdb',
bindgen.input_file("ns3modulegen.py"),
bindgen.output_file("ns3module.cc"),
]
+4 -1
View File
@@ -1,6 +1,10 @@
The Waf build system is used to build ns-3. Waf is a Python-based
build system (http://www.freehackers.org/~tnagy/waf.html)
Note: We've added a wiki page with more complete build instructions
than the quick ones you find below:
http://www.nsnam.org/wiki/index.php/Installation
=== Installing Waf ===
The top-level ns-3 directory should contain a current waf script.
@@ -63,7 +67,6 @@ with --enable-gcov)
It includes all files in the source directory, except some particular
extensions that are blacklisted, such as back files (ending in ~).
=== Extending ns-3 ===
To add new modules:
+1 -15
View File
@@ -1,35 +1,22 @@
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_SOURCES = internet-node-send.dia internet-node-recv.dia packet.dia node.dia buffer.dia sockets-overview.dia
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
@@ -42,7 +29,6 @@ pdf: images
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/
+166 -2
View File
@@ -2,6 +2,15 @@
@chapter Attributes
@anchor{chap:Attributes}
@menu
* Object Overview::
* Attribute Overview::
* Extending attributes::
* Adding new class type::
* ConfigStore::
@end menu
In ns-3 simulations, there are two main aspects to configuration:
@itemize @bullet
@item the simulation topology and how objects are connected
@@ -48,8 +57,7 @@ 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
As introduced in the ns-3 tutorial, 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
@@ -496,6 +504,7 @@ 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.
@node Adding new class type
@section Adding new class type to the attribute system
From the perspective of the user who writes a new class in the system and
@@ -557,3 +566,158 @@ 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.
@node ConfigStore
@section ConfigStore
@strong{Feedback requested:} This is an experimental feature of ns-3.
It is not in the main tree. If you like this feature and would like
to provide feedback on it, please email us.
Values for ns-3 attributes can be stored in an ascii text file and
loaded into a future simulation. This feature is known as the
ns-3 ConfigStore.
The ConfigStore code is in @code{src/contrib/}. It is not yet main-tree
code, because we are seeking some user feedback.
We can explore this system by using an example. Copy the @code{csma-bridge.cc}
file to the scratch directory:
@verbatim
cp examples/csma-bridge.cc scratch/
./waf
@end verbatim
Let's edit it to add the ConfigStore feature. First, add an include statement,
and then add these lines:
@verbatim
#include "contrib-module.h"
...
int main (...)
{
// setup topology
// Invoke just before entering Simulator::Run ()
ConfigStore config;
config.Configure ();
Simulator::Run ();
}
@end verbatim
There is an attribute that governs whether the Configure() call either
stores a simulation configuration in a file and exits, or whether
it loads a simulation configuration file annd proceeds. First,
the @code{LoadFilename} attribute is checked, and if non-empty,
the program loads the configuration from the filename provided.
If LoadFilename is empty, and if the @code{StoreFilename} attribute is
populated, the configuration will be written to the output filename
specified.
While it is possible to generate a sample config file and lightly
edit it to change a couple of values, there are cases where this
process will not work because the same value on the same object
can appear multiple times in the same automatically-generated
configuration file under different configuration paths.
As such, the best way to use this class is to use it to generate
an initial configuration file, extract from that configuration
file only the strictly necessary elements, and move these minimal
elements to a new configuration file which can then safely
be edited and loaded in a subsequent simulation run.
So, let's do that as an example. We'lll run the program once
to create a configure file, and look at it.
If you are running bash shell, the below command should work (which illustrates
how to set an attribute from the command line):
@verbatim
./build/debug/scratch/csma-bridge --ns3::ConfigStore::StoreFilename=test.config
@end verbatim
or, if the above does not work (the above requires rpath support), try this:
@verbatim
./waf --command-template="%s --ns3::ConfigStore::StoreFilename=test.config" --run scratch/csma-bridge
@end verbatim
Running the program should yield a "test.config" output configuration file
that looks like this:
@verbatim
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Addre
ss 00:00:00:00:00:01
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Frame
Size 1518
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/SendE
nable true
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Recei
veEnable true
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/TxQue
ue/$ns3::DropTailQueue/MaxPackets 100
/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Mtu 1
500
...
@end verbatim
The above lists, for each object in the script topology, the value of each
registered attribute. The syntax of this file is that the unique name
of the attribute (in the attribute namespace) is specified on each line,
followed by a value.
This file is intended to be a convenient record of the parameters that were
used in a given simulation run, and can be stored with simulation
output files. Additionally,
this file can also be used to parameterize a simulation, instead of
editing the script or passing in command line arguments. For instance,
a person wanting to run the simulation can examine and tweak the values
in a pre-existing configuration file, and pass the file to the
program. In this case, the relevant commands are:
@verbatim
./build/debug/scratch/csma-bridge --ns3::ConfigStore::LoadFilename=test.config
@end verbatim
or, if the above does not work (the above requires rpath support), try this:
@verbatim
./waf --command-template="%s --ns3::ConfigStore::LoadFilename=test.config" --run scratch/csma-bridge
@end verbatim
@subsection GTK-based ConfigStore
There is a GTK-based front end for the ConfigStore. This allows users
to use a GUI to access and change variables. Screenshots of this
feature are available in the
@uref{http://www.nsnam.org/docs/ns-3-overview.pdf,,ns-3 Overview} presentation.
To use this feature, one must install libgtk and libgtk-dev; an example
Ubuntu installation command is:
@verbatim
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
@end verbatim
To check whether it is configured or not, check the output of the
./waf configure step:
@verbatim
---- Summary of optional NS-3 features:
Threading Primitives : enabled
Real Time Simulator : enabled
GtkConfigStore : not enabled (library 'gtk+-2.0 >= 2.12' not found)
@end verbatim
In the above example, it was not enabled, so it cannot be used until a
suitable version is installed and ./waf configure; ./waf is rerun.
Usage is almost the same as the non-GTK-based version:
@verbatim
// Invoke just before entering Simulator::Run ()
GtkConfigStore config;
config.Configure ();
@end verbatim
Now, when you run the script, a GUI should pop up, allowing you to open
menus of attributes on different nodes/objects, and then launch the
simulation execution when you are done.
@subsection Future work
There are a couple of possible improvements:
@itemize bullet
@item save a unique version number with date and time at start of file
@item save rng initial seed somewhere.
@item make each RandomVariable serialize its own initial seed and re-read
it later
@item add the default values
@end itemize
+7 -7
View File
@@ -1,18 +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
The currently supported tool is dia. 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.
autogenerate the pdf and png from the figure source. Tgif (.obj) files
were once used but the file conversions require a valid X display to
be running, and are therefore to be avoided since our code server
does not run such a server. Tgif pdf conversions were also cumbersome.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
Store the .dia 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
If you add a source (.dia) 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.
-380
View File
@@ -1,380 +0,0 @@
%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,[
]).
Binary file not shown.
-352
View File
@@ -1,352 +0,0 @@
%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'],[
]).
Binary file not shown.
-211
View File
@@ -1,211 +0,0 @@
%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",[
]).
Binary file not shown.
-227
View File
@@ -1,227 +0,0 @@
%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'],[
]).
+4
View File
@@ -81,9 +81,11 @@ see @uref{http://www.nsnam.org/docs/manual.pdf}.
* Random variables::
* Callbacks::
* Attributes::
* RealTime::
* Packets::
* Sockets APIs::
* Node and Internet Stack::
* TCP::
* Routing overview::
* Troubleshooting
@end menu
@@ -91,10 +93,12 @@ see @uref{http://www.nsnam.org/docs/manual.pdf}.
@include random.texi
@include callbacks.texi
@include attributes.texi
@include realtime.texi
@include packets.texi
@include sockets.texi
@include node.texi
@c @include output.texi
@include tcp.texi
@include routing.texi
@c @include other.texi
@include troubleshoot.texi
+100
View File
@@ -0,0 +1,100 @@
@node RealTime
@chapter Real-Time Scheduler
@anchor{chap:RealTime}
ns-3 has been designed for integration into testbed and virtual machine
environments. To integrate with real network stacks and emit/consume
packets, a real-time scheduler is needed to try to lock the simulation
clock with the hardware clock. We describe here a component of this:
the RealTime scheduler.
The purpose of the realtime scheduler is to cause the progression of
the simulation clock to occur synchronously with respect to some
external time base. Without the presence of an external time base
(wall clock), simulation time jumps instantly from one simulated time to
the next.
@section Behavior
When using a non-realtime scheduler (the default in ns-3), the simulator
advances the simulation time to the next scheduled event. During event
execution, simulation time is frozen. With the realtime scheduler, the
behavior is similar from the perspective of simulation models (i.e.,
simulation time is frozen during event execution), but between events,
the simulator will attempt to keep the simulation clock aligned with
the machine clock.
When an event is finished executing, and the scheduler moves to the next
event, the scheduler compares the next event execution time with the
machine clock. If the next event is scheduled for a future time,
the simulator sleeps until that realtime is reached and then executes
the next event.
It may happen that, due to the processing inherent in the execution
of simulation events, that the simulator cannot keep up with realtime.
In such a case, it is up to the user configuration what to do. There
are two ns-3 attributes that govern the behavior. The first is
@code{ns3::RealTimeSimulatorImpl::SynchronizationMode}. The two
entries possible for this attribute are @code{BestEffort} (the default)
or @code{HardLimit}. In "BestEffort" mode, the simulator will just
try to catch up to realtime by executing events until it reaches
a point where the next event is in the (realtime) future, or else
the simulation ends. In BestEffort mode, then, it is possible for
the simulation to consume more time than the wall clock time. The
other option "HardLimit" will cause the simulation to abort if the tolerance
threshold is exceeded. This attribute is
@code{ns3::RealTimeSimulatorImpl::HardLimit} and the default is 0.1 seconds.
A different mode of operation is one in which simulated time is @strong{not}
frozen during an event execution. This mode of realtime simulation was
implemented but removed from the ns-3 tree because of questions of whether
it would be useful. If users are interested in a realtime simulator
for which simulation time does not freeze during event execution (i.e.,
every call to @code{Simulator::Now()} returns the current wall clock time,
not the time at which the event started executing), please contact the
ns-developers mailing list.
@section Usage
The usage of the realtime simulator is straightforward, from a scripting
perspective. Users just need to set the attribute
@code{SimulatorImplementationType} to the Realtime simulator, such as follows:
@verbatim
GlobalValue::Bind ("SimulatorImplementationType",
StringValue ("ns3::RealtimeSimulatorImpl"));
@end verbatim
There is a script in @code{examples/realtime-udp-echo.cc} that has an
example of how to configure the realtime behavior. Try:
@verbatim
./waf --run realtime-udp-echo
@end verbatim
Whether the simulator will work in a best effort or hard limit policy
fashion is governed by the attributes explained in the previous section.
@section Implementation
The implementation is contained in the following files:
@itemize @bullet
@item @code{src/simulator/realtime-simulator-impl.{cc,h}}
@item @code{src/simulator/wall-clock-synchronizer.{cc,h}}
@end itemize
In order to create a realtime scheduler, to a first approximation you
just want to cause simulation time jumps to consume real time. We propose
doing this using a combination of sleep- and busy- waits. Sleep-waits cause
the calling process (thread) to yield the processor for some amount of time.
Even though this specified amount of time can be passed to nanosecond
resolution, it is actually converted to an OS-specific granularity.
In Linux, the granularity is called a Jiffy. Typically this resolution is
insufficient for our needs (on the order of a ten milliseconds), so we
round down and sleep for some smaller number of Jiffies. The process is
then awakened after the specified number of Jiffies has passed. At this
time, we have some residual time to wait. This time is generally smaller
than the minimum sleep time, so we busy-wait for the remainder of the time.
This means that the thread just sits in a for loop consuming cycles until
the desired time arrives. After the combination of sleep- and busy-waits,
the elapsed realtime (wall) clock should agree with the simulation time
of the next event and the simulation proceeds.
+342
View File
@@ -0,0 +1,342 @@
@node TCP
@chapter TCP models in ns-3
@anchor{chap:TCP}
This chapter describes the TCP models available in ns-3.
@section Generic support for TCP
ns-3 was written to support multiple TCP implementations. The
implementations inherit from a few common header classes in the
@code{src/node} directory, so that user code can swap out implementations
with minimal changes to the scripts.
There are two important abstract base classes:
@itemize @bullet
@item @code{class TcpSocket}: This is defined in @code{src/node/tcp-socket.{cc,h}}. This class exists for hosting TcpSocket attributes that can be
reused across different implementations. For instance,
@code{TcpSocket::SetInitialCwnd()} can be used for any of the implementations
that derive from @code{class TcpSocket}.
@item @code{class TcpSocketFactory}: This is used by applications to
create TCP sockets. A typical usage can be seen in this snippet:
@verbatim
// Create the socket if not already created
if (!m_socket)
{
m_socket = Socket::CreateSocket (GetNode(), m_tid);
m_socket->Bind (m_local);
...
}
@end verbatim
The parameter @code{m_tid} controls the TypeId of the actual Tcp Socket
implementation that is instantiated. This way, the application can be
written generically and different socket implementations can be swapped out
by specifying the TypeId.
@end itemize
@section ns-3 TCP
ns-3 contains a port of the TCP model from
@uref{http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/index.html,,GTNetS}. This model is a full TCP, in that it is
bidirectional and attempts to model the connection setup and
close logic. In fact, it is a more complete implementation of the TCP
state machine than ns-2's "FullTcp" model. This TCP model was originally
written by George Riley
as part of GTNetS and ported to ns-3 by Raj Bhattacharjea.
The implementation of TCP is contained in the following files:
@verbatim
src/internet-stack/tcp-header.{cc,h}
src/internet-stack/tcp-l4-protocol.{cc,h}
src/internet-stack/tcp-socket-factory-impl.{cc,h}
src/internet-stack/tcp-socket-impl.{cc,h}
src/internet-stack/tcp-typedefs.h
src/internet-stack/rtt-estimator.{cc,h}
src/internet-stack/sequence-number.{cc,h}
@end verbatim
@subsection Usage
The file @code{examples/tcp-star-server.cc} contains an example that
makes use of @code{ns3::OnOffApplication} and @code{ns3::PacketSink}
applications.
Using the helper functions defined in @code{src/helper}, here is how
one would create a TCP receiver:
@verbatim
// Create a packet sink on the star "hub" to receive these packets
uint16_t port = 50000;
Address sinkLocalAddress(InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
ApplicationContainer sinkApp = sinkHelper.Install (serverNode);
sinkApp.Start (Seconds (1.0));
sinkApp.Stop (Seconds (10.0));
@end verbatim
Similarly, the below snippet configures OnOffApplication traffic
source to use
TCP:
@verbatim
// Create the OnOff applications to send TCP to the server
OnOffHelper clientHelper ("ns3::TcpSocketFactory", Address ());
@end verbatim
The careful reader will note above that we have specified the TypeId
of an abstract base class @code{TcpSocketFactory}. How does the
script tell ns-3 that it wants the native ns-3 TCP vs. some other one?
Well, when internet stacks are added to the node, the default
TCP implementation that is aggregated to the node is the ns-3 TCP.
This can be overridden as we show below when using Network
Simulation Cradle. So, by default, when using the ns-3 helper API,
the TCP that is aggregated to nodes with an Internet stack is the
native ns-3 TCP.
Once a TCP socket is created, you will want to follow conventional
socket logic and either connect() and send() (for a TCP client)
or bind(), listen(), and accept() (for a TCP server).
@xref{Sockets APIs,,Sockets API} for a review of how sockets are used
in ns-3.
To configure behavior of TCP, a number of parameters are exported through
the @ref{Attributes,,ns-3 attribute system}. These are documented in the
@uref{http://www.nsnam.org/doxygen/classns3_1_1_tcp_socket.html,,Doxygen}
for @code{class TcpSocket}.
@subsection Current limitations
@itemize @bullet
@item Only Tahoe congestion control is presently supported.
@item Only IPv4 is supported (IPv6 support will start to be added in ns-3.3).
@item @uref{http://www.nsnam.org/bugzilla/show_bug.cgi?id=198,,Bug 198}: TcpSocketImpl doesn't send acks with data packets in two-way transfers
@item @uref{http://www.nsnam.org/bugzilla/show_bug.cgi?id=250,,Bug 250}: Tcp breaks if you set the DelAckCount parameter to be greater than 2
@item @uref{http://www.nsnam.org/bugzilla/show_bug.cgi?id=311,,Bug 311}: Tcp socket close returns -1 but does not set errno.
@end itemize
@section Network Simulation Cradle
The @uref{http://www.wand.net.nz/~stj2/nsc/,,Network Simulation Cradle (NSC)}
is a framework for wrapping real-world network
code into simulators, allowing simulation of real-world behavior at little
extra cost. This work has been validated by comparing situations using
a test network with the same situations in the simulator. To date, it has
been shown that the NSC is able to produce extremely accurate results.
NSC supports four real world stacks: FreeBSD, OpenBSD, lwIP and Linux.
Emphasis has been placed on not changing any of the network stacks by hand.
Not a single line of code has been changed in the network protocol
implementations of any of the above four stacks. However, a custom C
parser was built to programmatically change source code.
NSC has previously been ported to ns-2 and OMNeT++, and recently
was added to ns-3. This section describes the ns-3 port of NSC and
how to use it.
@subsection Prerequisites
Presently, NSC has been tested and shown to work on these platforms:
Linux i386 and Linux x86-64. NSC does not support powerpc at the moment.
NSC requires the packages mercurial, flex, and bison.
@subsection Configuring and Downloading
NSC is disbled by default and must be explicitly configured in. To try
this, type
@verbatim
./waf configure --enable-nsc
@end verbatim
the output of the configuration will show something like:
@verbatim
Checking for NSC supported architecture x86_64 : ok
Pulling nsc updates from https://secure.wand.net.nz/mercurial/nsc
pulling from https://secure.wand.net.nz/mercurial/nsc
searching for changes
no changes found
---- Summary of optional NS-3 features:
...
Network Simulation Cradle : enabled
...
@end verbatim
if successful. Note that the configure script pulls a recent copy of
NSC from a mercurial repository. This download will not work if you are not
online.
If everything went OK, you will see a directory called "nsc" in the top-level
directory, with contents like this:
@verbatim
audit.sh linux-2.6/ openbsd3/ scons-time.py*
ChangeLog linux-2.6.18/ README SConstruct
config.log linux-2.6.26/ sconsign.py* sim/
freebsd5/ lwip-1.3.0/ scons-LICENSE test/
globaliser/ lwip-HEAD/ scons-local-1.0.1/
INSTALL ns/ scons.py*
LICENSE omnetpp/ scons-README
@end verbatim
@subsection Building and validating
Building ns-3 with nsc support is the same as building it without; no
additional arguments are needed for waf. Building nsc may take some time
compared to ns-3; it is interleaved in the ns-3 building process.
Try running the regression tests: @code{./waf --regression}. If NSC has
been successfully built, the following test should show up in the results:
@verbatim
PASS test-tcp-nsc-lfn
@end verbatim
This confirms that NSC is ready to use.
@subsection Usage
There are a few example files. Try
@verbatim
./waf --run tcp-nsc-zoo
./waf --run tcp-nsc-lfn
@end verbatim
These examples will deposit some @code{.pcap} files in your directory,
which can be examined by tcpdump or wireshark.
Let's look at the @code{examples/tcp-nsc-zoo.cc} file for some typical
usage. How does it differ from using native ns-3 TCP? There is one
main configuration line, when using NSC and the ns-3 helper API, that needs
to be set:
@verbatim
InternetStackHelper internetStack;
internetStack.SetNscStack ("liblinux2.6.26.so");
// this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
internetStack.Install (n.Get(0));
internetStack.Install (n.Get(1));
@end verbatim
The key line is the @code{SetNscStack}. This tells the InternetStack
helper to aggregate instances of NSC TCP instead of native ns-3 TCP
to the remaining nodes. It is important that this function be called
@strong{before} callling the @code{Install()} function, as shown above.
Which stacks are available to use? Presently, the focus has been on
Linux 2.6.18 and Linux 2.6.26 stacks for ns-3. To see which stacks
were built, one can execute the following find command at the ns-3 top level
directory:
@verbatim
~/ns-3.2> find nsc -name "*.so" -type f
nsc/linux-2.6.18/liblinux2.6.18.so
nsc/linux-2.6.26/liblinux2.6.26.so
@end verbatim
This tells us that we may either pass the library name liblinux2.6.18.so or
liblinux2.6.26.so to the above configuration step.
@subsection Stack configuration
NSC TCP shares the same configuration attributes that are common
across TCP sockets, as described above and documented in
@uref{http://www.nsnam.org/doxygen/classns3_1_1_tcp_socket.html,,Doxygen}
Additionally, NSC TCP exports a lot of configuration variables into the
ns-3 @ref{Attributes} system, via a @uref{http://en.wikipedia.org/wiki/Sysctl,,
sysctl}-like interface. In the @code{examples/tcp-nsc-zoo} example, you
can see the following configuration:
@verbatim
// this disables TCP SACK, wscale and timestamps on node 1 (the attributes represent sysctl-values).
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
@end verbatim
These additional configuration variables are not available to native ns-3
TCP.
@subsection NSC API
This subsection describes the API that NSC presents to ns-3 or any other
simulator. NSC provides its API in the form of a number of classes that
are defined in @code{sim/sim_interface.h} in the nsc directory.
@itemize @bullet
@item @strong{INetStack}
INetStack contains the 'low level' operations for the operating system
network stack, e.g. in and output functions from and to the network stack
(think of this as the 'network driver interface'. There are also functions
to create new TCP or UDP sockets.
@item @strong{ISendCallback}
This is called by NSC when a packet should be sent out to the network.
This simulator should use this callback to re-inject the packet into the
simulator so the actual data can be delivered/routed to its destination,
where it will eventually be handed into Receive() (and eventually back to the
receivers NSC instance via INetStack->if_receive() ).
@item @strong{INetStreamSocket}
This is the structure defining a particular connection endpoint (file
descriptor). It contains methods to operate on this endpoint, e.g. connect,
disconnect, accept, listen, send_data/read_data, ...
@item @strong{IInterruptCallback}
This contains the wakeup callback, which is called by NSC whenever
something of interest happens. Think of wakeup() as a replacement of the
operating systems wakeup function: Whenever the operating system would
wake up a process that has been waiting for an operation to complete (for
example the TCP handshake during connect()), NSC invokes the wakeup() callback
to allow the simulator to check for state changes in its connection endpoints.
@end itemize
@subsection ns-3 implementation
The ns-3 implementation makes use of the above NSC API, and is implemented
as follows.
The three main parts are:
@itemize @bullet
@item @code{ns3::NscTcpL4Protocol}: a subclass of Ipv4L4Protocol (and two nsc classes: ISendCallback and IInterruptCallback)
@item @code{ns3::NscTcpSocketImpl}: a subclass of TcpSocket
@item @code{ns3::NscTcpSocketFactoryImpl}: a factory to create new NSC
sockets
@end itemize
@code{src/internet-stack/nsc-tcp-l4-protocol} is the main class. Upon
Initialization, it loads an nsc network stack to use (via dlopen()). Each
instance of this class may use a different stack. The stack
(=shared library) to use is set using the SetNscLibrary() method (at
this time its called indirectly via the internet stack helper). The nsc
stack is then set up accordingly (timers etc). The
NscTcpL4Protocol::Receive() function hands the packet it receives (must be
a complete tcp/ip packet) to the nsc stack for further processing.
To be able to send packets, this class implements the nsc send_callback
method. This method is called by nsc whenever the nsc stack wishes to
send a packet out to the network. Its arguments are a raw buffer,
containing a complete TCP/IP packet, and a length value. This method
therefore has to convert the raw data to a Ptr<Packet> usable by ns-3.
In order to avoid various ipv4 header issues, the nsc ip header is not
included. Instead, the tcp header and the actual payload are put into the
Ptr<Packet>, after this the Packet is passed down to layer 3 for sending
the packet out (no further special treatment is needed in the send code
path).
This class calls @code{ns3::NscTcpSocketImpl} both from the nsc wakeup()
callback and from the Receive path (to ensure that possibly queued data
is scheduled for sending).
@code{src/internet-stack/nsc-tcp-socket-impl} implements the nsc socket
interface. Each instance has its own nscTcpSocket. Data that is Send()
will be handed to the nsc stack via m_nscTcpSocket->send_data(). (and not
to nsc-tcp-l4, this is the major difference compared to ns-3 TCP). The
class also queues up data that is Send() before the underlying
descriptor has entered an ESTABLISHED state. This class is called from
the nsc-tcp-l4 class, when the nsc-tcp-l4 wakeup() callback is invoked by
nsc. nsc-tcp-socket-impl then checks the current connection state
(SYN_SENT, ESTABLISHED, LISTEN...) and schedules appropriate callbacks as
needed, e.g. a LISTEN socket will schedule Accept to see if a new
connection must be accepted, an ESTABLISHED socket schedules any pending
data for writing, schedule a read callback, etc.
Note that @code{ns3::NscTcpSocketImpl} does not interact with nsc-tcp
directly: instead, data is redirected to nsc. nsc-tcp calls the
nsc-tcp-sockets of a node when its wakeup callback is invoked by nsc.
@subsection Limitations
@itemize @bullet
@item NSC only works on single-interface nodes; attempting to run it on
a multi-interface node will cause a program error. This limitation should
be fixed by ns-3.3.
@item Cygwin and OS X PPC are not presently supported
@item The non-Linux stacks of NSC are not supported
@item NSC's integration into the build system presently requires on-line
access and mercurial, and is a slow download.
@end itemize
For more information, see
@uref{http://www.nsnam.org/wiki/index.php/Network_Simulation_Cradle_Integration,, this wiki page}.
+13 -12
View File
@@ -14,23 +14,23 @@ Steps in doing an ns-3 release
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.1x"
- hg tag "ns-3.x"
- hg push
- cd into regression/ns-3-dev-ref-traces
- hg tag "ns-3.1x"
- 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.1x/.hg and edit the hgrc appropriately:
"description = ns-3.1x release
name = 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.1x-ref-traces and edit the hgrc appropriately
7. check out a clean version of the new release (ns-3.1x) somewhere
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.1) This must agree with the version name you chose in the clone
(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
@@ -46,16 +46,17 @@ Steps in doing an ns-3 release
- There should be no regression errors at this time
10. Create final tarballs
- ./waf configure; ./waf dist
- this will create an ns-3.1x.tar.bz2 tarball
- this will also create a ns-3.1x-ref-traces.tar.bz2 tarball
11. upload "ns-3.1x.tar.bz2" to the /var/www/html/releases/ directory on
- 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.1x-ref-traces.tar.bz2" to the /var/www/html/releases/
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
-10
View File
@@ -1,23 +1,17 @@
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.
@@ -28,9 +22,6 @@ 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
@@ -43,7 +34,6 @@ pdf:
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/
+7 -6
View File
@@ -63,7 +63,7 @@ off of the right side. Notice that this is the default network topology
since you can actually vary the number of nodes created on the LAN. If you
set nCsma to one, there will be a total of two nodes on the LAN (CSMA
channel) --- one required node and one ``extra'' node. By default there are
thee ``extra'' nodes as seen below:
three ``extra'' nodes as seen below:
@verbatim
// Default Network Topology
@@ -589,7 +589,7 @@ number of nodes created on the wired and wireless networks. Just as in the
number of ``extra'' CSMA nodes. Similarly, you can set @code{nWifi} to
control how many @code{STA} (station) nodes are created in the simulation.
There will always be one @code{AP} (access point) node on the wireless
network. By default there are thee ``extra'' CSMA nodes and three wireless
network. By default there are three ``extra'' CSMA nodes and three wireless
@code{STA} nodes.
The code begins by loading module include files just as was done in the
@@ -812,7 +812,7 @@ usual, you will find the documentation in the ``Classes'' tab of the Doxygen
documentation.
Now we will return to more familiar ground. We next create a @code{WifiHelper}
object and set two default atributes that it will use when creating the actual
object and set two default attributes that it will use when creating the actual
devices.
@verbatim
@@ -1240,12 +1240,13 @@ they happen.
@end verbatim
If you are feeling brave, there is a list of all trace sources in the
@command{ns-3} Doxygen which you can find in the ``NS-3 Modules'' section.
@uref{http://www.nsnam.org/doxygen-release/index.html,,ns-3 Doxygen}
which you can find in the ``Modules'' tab.
Under the ``core'' section, you will find a link to ``The list of all trace
sources.'' You may find it interesting to try and hook some of these
traces yourself. Additionally in the ``NS-3 Modules'' documentation, there is
traces yourself. Additionally in the ``Modules'' documentation, there is
a link to ``The list of all attributes.'' You can set the default value of
any of these atributes via the command line as we have previously discussed.
any of these attributes via the command line as we have previously discussed.
We have just scratched the surface of @command{ns-3} in this tutorial, but we
hope we have covered enough to get you started doing useful work.
+8 -5
View File
@@ -681,7 +681,7 @@ When we previously called the methods,
@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
10.0 seconds. When @code{Simulator::Run} is called, the system 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
@@ -731,10 +731,13 @@ 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 >
[467/511] cxx: scratch/first.cc -> build/debug/scratch/first_1.o
[468/511] cxx: scratch/multiple-sources/simple-main.cc -> build/debug/scratch/multiple-sources/simple-main_2.o
[469/511] cxx: scratch/multiple-sources/simple-simulation.cc -> build/debug/scratch/multiple-sources/simple-simulation_2.o
[470/511] cxx: scratch/simple.cc -> build/debug/scratch/simple_3.o
[508/511] cxx_link: build/debug/scratch/first_1.o -> build/debug/scratch/first
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
+7 -7
View File
@@ -1,18 +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
The currently supported tool is dia. 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.
autogenerate the pdf and png from the figure source. Tgif (.obj) files
were once used but the file conversions require a valid X display to
be running, and are therefore to be avoided since our code server
does not run such a server. Tgif pdf conversions were also cumbersome.
Store the .dia, or .obj versions in mercurial, but not the .png or .pdfs.
Store the .dia 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
If you add a source (.dia) 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
@@ -1,115 +0,0 @@
%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'],[
]).
+83 -40
View File
@@ -44,8 +44,9 @@ the Getting Started section of the @command{ns-3} web site:
@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.
code.nsnam.org. You can download a tarball release at
@uref{http://www.nsnam.org/releases/}, or you can work with repositories
using Mercurial.
@cindex repository
If you go to the following link: @uref{http://code.nsnam.org/},
@@ -54,7 +55,7 @@ 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
with any required 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}.
@@ -62,11 +63,11 @@ 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.
official release if you do not need newly-introduced features.
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
string ``ns-3-dev'' with your choice of release (e.g., ns-3.2) 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.
@@ -108,6 +109,15 @@ look something like the following:
doc/ ns3/ RELEASE_NOTES src/ waf*
@end verbatim
Similarly, if working from a released version instead, you can simply
@verbatim
cd
mkdir repos
wget http://www.nsnam.org/releases/ns-3.2.tar.bz2
bunzip2 ns-3.2.tar.bz2
tar xvf ns-3.2.tar
@end verbatim
You are now ready to build the @command{ns-3} distribution.
@c ========================================================================
@@ -137,34 +147,58 @@ 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 >
Checking for program g++ : ok /usr/bin/g++
Checking for compiler version : ok Version 4.0.1
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 -Wno-error=deprecated-declarations compilation flag support : no
Checking for header stdlib.h : ok
Checking for header stdlib.h : ok
Checking for header signal.h : ok
Checking for library rt : not found
Checking for header pthread.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 library sqlite3 : ok
Checking for package goocanvas gthread-2.0 : not found
Checking for program python : ok /usr/local/bin/python
Checking for Python version >= 2.3 : ok 2.4.3
Checking for library python2.4 : not found
Checking for library python2.4 : not found
Checking for library python24 : not found
Checking for program python2.4-config : not found
Checking for header Python.h : not found
Checking for program diff : ok /usr/bin/diff
Checking for program hg : ok /opt/local/bin/hg
---- Summary of optional NS-3 features:
Threading Primitives : enabled
Real Time Simulator : enabled
GtkConfigStore : not enabled (library 'gtk+-2.0 >= 2.12' not found)
SQlite stats data output : enabled
Network Simulation Cradle : not enabled (--enable-nsc configure option not given)
Python Bindings : not enabled (Python development headers not found.)
Configuration finished successfully; project is now ready to build.
@end verbatim
Note the trailing portion of the above output. Some ns-3 options are
not enabled by default or require support from the underlying system.
For instance, to enable Python bindings, Python development headers must
be installed on the host machine, and they were not found in the above
example, so Python scripting will not be supported in the resulting build.
For this tutorial, we will focus on the non-optional pieces of ns-3.
The build system is now configured and you can build the debug versions of
the @command{ns-3} programs by simply typing,
@@ -172,8 +206,10 @@ the @command{ns-3} programs by simply typing,
./waf
@end verbatim
(Hint: if you have a multicore machine, use the "-j JOBS" option to speed
up your build, where JOBS is the number of cores)
You will see many Waf status messages displayed as the system compiles. The
most important is the last one,
most important is the last one:
@verbatim
Compilation finished successfully
@@ -187,8 +223,8 @@ most important is the last one,
@section Testing ns-3
@cindex unit tests
You can run the unit tests of the @command{ns-3} distribution by running the ``check''
command,
You can run the unit tests of the @command{ns-3} distribution by running the
``check'' command,
@verbatim
./waf check
@@ -213,10 +249,10 @@ test has passed.
~/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.
@cindex regression tests
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
@@ -234,7 +270,9 @@ 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.
know what you are doing. (Warning: The ns-3.2 release requires you
to be online when you run regression tests because it synchronizes the
trace directory with an online repository).
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
@@ -245,27 +283,32 @@ 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
Compilation finished successfully
========== Running Regression Tests ==========
Synchronizing reference traces using Mercurial.
http://code.nsnam.org/ns-3-dev-ref-traces
Done.
Pulling http://code.nsnam.org/ns-3-dev-ref-traces from repo.
Skipping csma-bridge: Python bindings not available.
SKIP test-csma-bridge
PASS test-csma-broadcast
PASS test-csma-multicast
PASS test-csma-one-subnet
PASS test-csma-packet-socket
PASS test-realtime-udp-echo
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
PASS test-wifi-wired-bridging
~/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.
has gone awry. Python regression tests will be SKIPped if Python bindings
are not built.
@c ========================================================================
@c Running a Script
+53 -21
View File
@@ -63,19 +63,37 @@ open environment for researchers to contribute and share their software.
@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.
ns-3 is the choice of scripting language. Ns-2 is
scripted in OTcl and results of simulations can be visualized using the
Network Animator @command{nam}. It is not possible to run a simulation
in ns-2 purely from C++ (i.e., as a main() program without any OTcl).
Moreover, some components of ns-2 are written in C++ and others in OTcl.
In ns-3, the simulator is written entirely in C++, with optional
Python bindings. Simulation scripts can therefore be written in C++
or in Python. The results of some simulations can be visualized by
@command{nam}, but new animators are under development. Since ns-3
generates pcap packet trace files, other utilities can be used to
analyze traces as well.
In this tutorial, we will first concentrate on scripting
directly in C++ and interpreting results via ascii 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}
objects, and some code from ns-2 has already been ported to ns-3).
We will try to highlight differences between ns-2 and ns-3
as we proceed in this tutorial.
A question that we often hear is "Should I still use ns-2 or move to
ns-3?" The answer is that it depends. ns-3 does not have all of the
models that ns-2 currently has, but on the other hand, ns-3 does have
new capabilities (such as handling multiple interfaces on nodes
correctly, use of IP addressing and more alignment with Internet
protocols and designs, more detailed 802.11 models, etc.). ns-2
models can usually be ported to ns-3 (a porting guide is under
development). There is active development on multiple fronts for ns-3.
The ns-3 developers believe (and certain early users have proven) that
ns-3 is ready for active use, and should be an attractive alternative
for users looking to start new simulation projects.
@node Contributing
@section Contributing
@@ -97,8 +115,12 @@ page;
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.
We realize that if you are reading this document, contributing back to
the project is probably not your foremost concern at this point, but
we want you to be aware that contributing is in the spirit of the project and
that even the act of dropping us a note about your early experience
with ns-3 (e.g. "this tutorial section was not clear..."),
reports of stale documentation, etc. are much appreciated.
@node Tutorial Organization
@section Tutorial Organization
@@ -191,7 +213,7 @@ on the main @command{ns-3} web site.
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
function. Probably the most well 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
@@ -210,7 +232,10 @@ found at @uref{http://freehackers.org/~tnagy/waf.html}.
@section Development Environment
@cindex C++
As mentioned above, scripting in ns-3 is done in C++. A working
@cindex Python
As mentioned above, scripting in ns-3 is done in C++ or Python.
As of ns-3.2, most of the ns-3 API is available in Python, but the models
are written in C++ in either case. 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
@@ -221,23 +246,27 @@ 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.
before proceeding. For instance,
@uref{http://www.cplusplus.com/doc/tutorial/,,this tutorial}.
@cindex toolchain
@cindex GNU
The @command{ns-3} system uses the GNU ``toolchain'' for development. A
The @command{ns-3} system uses several components of 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}.
@uref{http://en.wikipedia.org/wiki/GNU_toolchain}. ns-3 uses gcc,
GNU binutils, and gdb. However, we do not use the GNU build system,
either make or autotools, using Waf instead.
@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.
project supports development in the Cygwin environment for
these users. See @uref{http://www.cygwin.com/}
for details on downloading (MinGW is presently not supported).
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.
@@ -254,7 +283,10 @@ 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.
running. Beware of Logitech software when using Cygwin.
Another alternative to Cygwin is to install a virtual machine environment
such as VMware server and install a Linux virtual machine.
@node Socket Programming
@section Socket Programming
+2 -2
View File
@@ -180,7 +180,7 @@ actually a class name, and there is a single colon there instead of a double
colon to remind you in a relatively subtle way to conceptually separate the
logging component name from the class name.
It turns out that in come cases, it can be hard to determine which method
It turns out that in some cases, it can be hard to determine which method
actually generates a log message. If you look in the text above, you may
wonder where the string ``@code{Received 1024 bytes from 10.1.1.2}'' comes
from. You can resolve this by ORing the @code{prefix_func} level into the
@@ -625,7 +625,7 @@ need to hook the value into the parser. We do this by adding a call to
start with the following code,
@verbatim
int
int
main (int argc, char *argv[])
{
uint32_t nPackets = 1;
+246
View File
@@ -0,0 +1,246 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*/
// Network topology
//
// bridge1 The node named bridge1 (node 5 in the nodelist)
// ------------------ has three CMSA net devices that are bridged
// CSMA CSMA CSMA together using a BridgeNetDevice.
// | | |
// | | | The bridge node talks over three CSMA channels
// | | |
// CSMA CSMA CSMA to three other CSMA net devices
// ---- ---- ----
// n0 n1 n2 Node two acts as a router and talks to another
// ---- bridge that connects the remaining nodes.
// CSMA
// |
// n3 n4 |
// ---- ---- |
// CSMA CSMA |
// | | |
// | | |
// | | |
// CSMA CSMA CSMA The node named bridge2 (node 6 in the nodelist)
// ------------------ has three CMSA net devices that are bridged
// bridge2 together using a BridgeNetDevice.
//
// Or, more abstractly, recognizing that bridge 1 and bridge 2 are nodes
// with three net devices:
//
// n0 n1 (n0 = 10.1.1.2)
// | | (n1 = 10.1.1.3) Note odd addressing
// ----------- (n2 = 10.1.1.1)
// | bridge1 | <- n5
// -----------
// |
// router <- n2
// |
// -----------
// | bridge2 | <- n6
// ----------- (n2 = 10.1.2.1)
// | | (n3 = 10.1.2.2)
// n3 n4 (n4 = 10.1.2.3)
//
// So, this example shows two broadcast domains, each interconnected by a bridge
// with a router node (n2) interconnecting the layer-2 broadcast domains
//
// It is meant to mirror somewhat the csma-bridge example but adds another
// bridged link separated by a router.
//
// - CBR/UDP flows from n0 (10.1.1.2) to n1 (10.1.1.3) and from n3 (10.1.2.2) to n0 (10.1.1.3)
// - DropTail queues
// - Global static routing
// - Tracing of queues and packet receptions to file "csma-bridge-one-hop.tr"
#include <iostream>
#include <fstream>
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/core-module.h"
#include "ns3/helper-module.h"
#include "ns3/bridge-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaBridgeOneHopExample");
int
main (int argc, char *argv[])
{
//
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
//
#if 0
LogComponentEnable ("CsmaBridgeOneHopExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
//
// Allow the user to override any of the defaults and the above Bind() at
// run-time, via command-line arguments
//
CommandLine cmd;
cmd.Parse (argc, argv);
//
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");
Ptr<Node> n0 = CreateObject<Node> ();
Ptr<Node> n1 = CreateObject<Node> ();
Ptr<Node> n2 = CreateObject<Node> ();
Ptr<Node> n3 = CreateObject<Node> ();
Ptr<Node> n4 = CreateObject<Node> ();
Ptr<Node> bridge1 = CreateObject<Node> ();
Ptr<Node> bridge2 = CreateObject<Node> ();
NS_LOG_INFO ("Build Topology");
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", DataRateValue (5000000));
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
// Create the csma links, from each terminal to the bridge
// This will create six network devices; we'll keep track separately
// of the devices on and off the bridge respectively, for later configuration
NetDeviceContainer topLanDevices;
NetDeviceContainer topBridgeDevices;
// It is easier to iterate the nodes in C++ if we put them into a container
NodeContainer topLan (n2, n0, n1);
for (int i = 0; i < 3; i++)
{
// install a csma channel between the ith toplan node and the bridge node
NetDeviceContainer link = csma.Install (NodeContainer (topLan.Get (i), bridge1));
topLanDevices.Add (link.Get (0));
topBridgeDevices.Add (link.Get (1));
}
//
// Now, Create the bridge netdevice, which will do the packet switching. The
// bridge lives on the node bridge1 and bridges together the topBridgeDevices
// which are the three CSMA net devices on the node in the diagram above.
//
BridgeHelper bridge;
bridge.Install (bridge1, topBridgeDevices);
// Add internet stack to the topLan nodes
InternetStackHelper internet;
internet.Install (topLan);
// Repeat for bottom bridged LAN
NetDeviceContainer bottomLanDevices;
NetDeviceContainer bottomBridgeDevices;
NodeContainer bottomLan (n2, n3, n4);
for (int i = 0; i < 3; i++)
{
NetDeviceContainer link = csma.Install (NodeContainer (bottomLan.Get (i), bridge2));
bottomLanDevices.Add (link.Get (0));
bottomBridgeDevices.Add (link.Get (1));
}
bridge.Install (bridge2, bottomBridgeDevices);
// Add internet stack to the bottomLan nodes
internet.Install (NodeContainer (n3, n4));
// We've got the "hardware" in place. Now we need to add IP addresses.
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (topLanDevices);
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
ipv4.Assign (bottomLanDevices);
//
// Create router nodes, initialize routing database and set up the routing
// tables in the nodes. We excuse the bridge nodes from having to serve as
// routers, since they don't even have internet stacks on them.
//
NodeContainer routerNodes (n0, n1, n2, n3, n4);
GlobalRouteManager::PopulateRoutingTables (routerNodes);
//
// Create an OnOff application to send UDP datagrams from node zero to node 1.
//
NS_LOG_INFO ("Create Applications.");
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address ("10.1.1.3"), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer app = onoff.Install (n0);
// Start the application
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0));
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
ApplicationContainer sink1 = sink.Install (n1);
sink1.Start (Seconds (1.0));
sink1.Stop (Seconds (10.0));
//
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
ApplicationContainer app2 = onoff.Install (n3);
app2.Start (Seconds (1.1));
app2.Stop (Seconds (10.0));
ApplicationContainer sink2 = sink.Install (n0);
sink2.Start (Seconds (1.1));
sink2.Stop (Seconds (10.0));
//
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.
// Trace output will be sent to the file "csma-bridge-one-hop.tr"
//
NS_LOG_INFO ("Configure Tracing.");
std::ofstream ascii;
ascii.open ("csma-bridge-one-hop.tr");
CsmaHelper::EnableAsciiAll (ascii);
//
// Also configure some tcpdump traces; each interface will be traced.
// The output files will be named:
// csma-bridge.pcap-<nodeId>-<interfaceId>
// and can be read by the "tcpdump -r" command (use "-tt" option to
// display timestamps correctly)
//
CsmaHelper::EnablePcapAll ("csma-bridge-one-hop");
//
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+7 -5
View File
@@ -127,19 +127,21 @@ main (int argc, char *argv[])
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
sink.Install (terminals.Get (1));
app = sink.Install (terminals.Get (1));
app.Start (Seconds (0.0));
//
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.1"), port)));
ApplicationContainer app2 = onoff.Install (terminals.Get (3));
app = onoff.Install (terminals.Get (3));
app.Start (Seconds (1.1));
app.Stop (Seconds (10.0));
sink.Install (terminals.Get (0));
app = sink.Install (terminals.Get (0));
app.Start (Seconds (0.0));
app2.Start (Seconds (1.1));
app2.Stop (Seconds (10.0));
//
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.
+13 -12
View File
@@ -47,14 +47,14 @@ def main(argv):
#
# Explicitly create the nodes required by the topology(shown above).
#
print "Create nodes."
#print "Create nodes."
terminals = ns3.NodeContainer()
terminals.Create(4)
csmaSwitch = ns3.NodeContainer()
csmaSwitch.Create(1)
print "Build Topology"
#print "Build Topology"
csma = ns3.CsmaHelper()
csma.SetChannelAttribute("DataRate", ns3.DataRateValue(ns3.DataRate(5000000)))
csma.SetChannelAttribute("Delay", ns3.TimeValue(ns3.MilliSeconds(2)))
@@ -83,7 +83,7 @@ def main(argv):
# We've got the "hardware" in place. Now we need to add IP addresses.
#
print "Assign IP Addresses."
#print "Assign IP Addresses."
ipv4 = ns3.Ipv4AddressHelper()
ipv4.SetBase(ns3.Ipv4Address("10.1.1.0"), ns3.Ipv4Mask("255.255.255.0"))
ipv4.Assign(terminalDevices)
@@ -91,7 +91,7 @@ def main(argv):
#
# Create an OnOff application to send UDP datagrams from node zero to node 1.
#
print "Create Applications."
#print "Create Applications."
port = 9 # Discard port(RFC 863)
onoff = ns3.OnOffHelper("ns3::UdpSocketFactory",
@@ -107,19 +107,20 @@ def main(argv):
# Create an optional packet sink to receive these packets
sink = ns3.PacketSinkHelper("ns3::UdpSocketFactory",
ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address.GetAny(), port)))
sink.Install(ns3.NodeContainer(terminals.Get(1)))
app = sink.Install(ns3.NodeContainer(terminals.Get(1)))
app.Start (ns3.Seconds (0.0))
#
# Create a similar flow from n3 to n0, starting at time 1.1 seconds
#
onoff.SetAttribute("Remote",
ns3.AddressValue(ns3.InetSocketAddress(ns3.Ipv4Address("10.1.1.1"), port)))
app2 = onoff.Install(ns3.NodeContainer(terminals.Get(3)))
app = onoff.Install(ns3.NodeContainer(terminals.Get(3)))
app.Start(ns3.Seconds(1.1))
app.Stop(ns3.Seconds(10.0))
sink.Install(ns3.NodeContainer(terminals.Get(0)))
app2.Start(ns3.Seconds(1.1))
app2.Stop(ns3.Seconds(10.0))
app = sink.Install(ns3.NodeContainer(terminals.Get(0)))
app.Start (ns3.Seconds (0.0))
#
# Configure tracing of all enqueue, dequeue, and NetDevice receive events.
@@ -142,10 +143,10 @@ def main(argv):
#
# Now, do the actual simulation.
#
print "Run Simulation."
#print "Run Simulation."
ns3.Simulator.Run()
ns3.Simulator.Destroy()
print "Done."
#print "Done."
+16 -19
View File
@@ -61,8 +61,8 @@ main (int argc, char *argv[])
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
NodeContainer nodes;
nodes.Create (4);
NS_LOG_INFO ("Build Topology");
CsmaHelper csma;
@@ -70,24 +70,19 @@ main (int argc, char *argv[])
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
//
// Now fill out the topology by creating the net devices required to connect
// the nodes to the channels and hooking them up. AddIpv4CsmaNetDevice will
// create a net device, add a MAC address (in memory of the pink flamingo) and
// connect the net device to a nodes and also to a channel. the
// AddIpv4CsmaNetDevice method returns a net device index for the net device
// created on the node. Interpret nd0 as the net device we created for node
// zero.
// the nodes to the channels and hooking them up.
//
NetDeviceContainer nd0 = csma.Install (c);
NetDeviceContainer devices = csma.Install (nodes);
InternetStackHelper internet;
internet.Install (c);
internet.Install (nodes);
// We've got the "hardware" in place. Now we need to add IP addresses.
//
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (nd0);
Ipv4InterfaceContainer interfaces = ipv4.Assign (devices);
//
// Create an OnOff application to send UDP datagrams from node zero to node 1.
@@ -96,11 +91,11 @@ main (int argc, char *argv[])
uint16_t port = 9; // Discard port (RFC 863)
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));
Address (InetSocketAddress (interfaces.GetAddress (1), port)));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer app = onoff.Install (c.Get (0));
ApplicationContainer app = onoff.Install (nodes.Get (0));
// Start the application
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0));
@@ -108,19 +103,21 @@ main (int argc, char *argv[])
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
sink.Install (c.Get (1));
app = sink.Install (nodes.Get (1));
app.Start (Seconds (0.0));
//
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.1"), port)));
ApplicationContainer app2 = onoff.Install (c.Get (3));
AddressValue (InetSocketAddress (interfaces.GetAddress (0), port)));
app = onoff.Install (nodes.Get (3));
app.Start(Seconds (1.1));
app.Stop (Seconds (10.0));
sink.Install (c.Get (0));
app = sink.Install (nodes.Get (0));
app.Start (Seconds (0.0));
app2.Start(Seconds (1.1));
app2.Stop (Seconds (10.0));
//
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.
// Trace output will be sent to the file "csma-one-subnet.tr"
+140
View File
@@ -0,0 +1,140 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0 n1 n2 n3
// | | | |
// =====================
//
// - CBR/UDP flows from n0 to n1, and from n3 to n0
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaPingExample");
static void SinkRx (Ptr<const Packet> p, const Address &ad)
{
//std::cout << *p << std::endl;
}
static void PingRtt (std::string context, Time rtt)
{
//std::cout << context << " " << rtt << std::endl;
}
int
main (int argc, char *argv[])
{
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
// connect all our nodes to a shared channel.
NS_LOG_INFO ("Build Topology.");
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (5000000)));
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
csma.SetDeviceAttribute ("EncapsulationMode", StringValue ("Llc"));
NetDeviceContainer devs = csma.Install (c);
// add an ip stack to all nodes.
NS_LOG_INFO ("Add ip stack.");
InternetStackHelper ipStack;
ipStack.Install (c);
// assign ip addresses
NS_LOG_INFO ("Assign ip addresses.");
Ipv4AddressHelper ip;
ip.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer addresses = ip.Assign (devs);
// setup global router
GlobalRouteManager::PopulateRoutingTables ();
NS_LOG_INFO ("Create Source");
Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
OnOffHelper onoff = OnOffHelper ("ns3::Ipv4RawSocketFactory", dst);
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1.0)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (15000)));
onoff.SetAttribute ("PacketSize", UintegerValue (1200));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
NS_LOG_INFO ("Create Sink.");
PacketSinkHelper sink = PacketSinkHelper ("ns3::Ipv4RawSocketFactory", dst);
apps = sink.Install (c.Get (3));
apps.Start (Seconds (0.0));
apps.Stop (Seconds (11.0));
NS_LOG_INFO ("Create pinger");
V4PingHelper ping = V4PingHelper (addresses.GetAddress (2));
NodeContainer pingers;
pingers.Add (c.Get (0));
pingers.Add (c.Get (1));
pingers.Add (c.Get (3));
apps = ping.Install (pingers);
apps.Start (Seconds (2.0));
apps.Stop (Seconds (5.0));
NS_LOG_INFO ("Configure Tracing.");
// first, pcap tracing.
csma.EnablePcapAll ("csma-ping");
// then, print what the packet sink receives.
Config::ConnectWithoutContext ("/NodeList/3/ApplicationList/0/$ns3::PacketSink/Rx",
MakeCallback (&SinkRx));
// finally, print the ping rtts.
Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::V4Ping/Rtt",
MakeCallback (&PingRtt));
Packet::EnablePrinting ();
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+122
View File
@@ -0,0 +1,122 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*/
// Port of ns-2/tcl/ex/simple.tcl to ns-3
//
// Network topology
//
// n0 n1 n2 n3
// | | | |
// =====================
//
// - CBR/UDP flows from n0 to n1, and from n3 to n0
// - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
// (i.e., DataRate of 448,000 bps)
// - DropTail queues
// - Tracing of queues and packet receptions to file "csma-one-subnet.tr"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaPacketSocketExample");
static void SinkRx (Ptr<const Packet> p, const Address &ad)
{
//std::cout << *p << std::endl;
}
int
main (int argc, char *argv[])
{
#if 0
LogComponentEnable ("CsmaPacketSocketExample", LOG_LEVEL_INFO);
#endif
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
CommandLine cmd;
cmd.Parse (argc, argv);
// Here, we will explicitly create four nodes.
NS_LOG_INFO ("Create nodes.");
NodeContainer c;
c.Create (4);
// connect all our nodes to a shared channel.
NS_LOG_INFO ("Build Topology.");
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate (5000000)));
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
csma.SetDeviceAttribute ("EncapsulationMode", StringValue ("Llc"));
NetDeviceContainer devs = csma.Install (c);
// add an ip stack to all nodes.
NS_LOG_INFO ("Add ip stack.");
InternetStackHelper ipStack;
ipStack.Install (c);
// assign ip addresses
NS_LOG_INFO ("Assign ip addresses.");
Ipv4AddressHelper ip;
ip.SetBase ("192.168.1.0", "255.255.255.0");
Ipv4InterfaceContainer addresses = ip.Assign (devs);
NS_LOG_INFO ("Create Source");
Config::SetDefault ("ns3::Ipv4RawSocketImpl::Protocol", StringValue ("2"));
InetSocketAddress dst = InetSocketAddress (addresses.GetAddress (3));
OnOffHelper onoff = OnOffHelper ("ns3::Ipv4RawSocketFactory", dst);
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1.0)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0.0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000)));
onoff.SetAttribute ("PacketSize", UintegerValue (1200));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
NS_LOG_INFO ("Create Sink.");
PacketSinkHelper sink = PacketSinkHelper ("ns3::Ipv4RawSocketFactory", dst);
apps = sink.Install (c.Get (3));
apps.Start (Seconds (0.0));
apps.Stop (Seconds (11.0));
NS_LOG_INFO ("Configure Tracing.");
// first, pcap tracing.
csma.EnablePcapAll ("csma-raw-ip-socket");
// then, print what the packet sink receives.
Config::ConnectWithoutContext ("/NodeList/3/ApplicationList/0/$ns3::PacketSink/Rx",
MakeCallback (&SinkRx));
Packet::EnablePrinting ();
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+216
View File
@@ -0,0 +1,216 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*
*/
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
// Network topology (default)
//
// n2 + + n3 .
// | ... |\ /| ... | .
// ======= \ / ======= .
// CSMA \ / CSMA .
// \ / .
// n1 +--- n0 ---+ n4 .
// | ... | / \ | ... | .
// ======= / \ ======= .
// CSMA / \ CSMA .
// / \ .
// n6 + + n5 .
// | ... | | ... | .
// ======= ======= .
// CSMA CSMA .
//
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("CsmaStar");
int
main (int argc, char *argv[])
{
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
//
// Set up some default values for the simulation.
//
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (137));
// ??? try and stick 15kb/s into the data rate
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("14kb/s"));
//
// Default number of nodes in the star. Overridable by command line argument.
//
uint32_t nNodes = 7;
CommandLine cmd;
cmd.AddValue("nNodes", "Number of nodes to place in the star", nNodes);
cmd.Parse (argc, argv);
NS_LOG_INFO ("Create nodes.");
NodeContainer hubNode;
NodeContainer spokeNodes;
hubNode.Create (1);
Ptr<Node> hub = hubNode.Get (0);
spokeNodes.Create (nNodes - 1);
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
csma.SetChannelAttribute ("Delay", StringValue ("1ms"));
NS_LOG_INFO ("Build star topology.");
NetDeviceContainer hubDevices, spokeDevices;
csma.InstallStar (hubNode.Get (0), spokeNodes, hubDevices, spokeDevices);
NodeContainer fillNodes;
//
// Just to be nasy, hang some more nodes off of the CSMA channel for each
// spoke, so that there are a total of 16 nodes on each channel. Stash
// all of these new devices into a container.
//
NetDeviceContainer fillDevices;
uint32_t nFill = 14;
for (uint32_t i = 0; i < spokeDevices.GetN (); ++i)
{
Ptr<Channel> channel = spokeDevices.Get (i)->GetChannel ();
Ptr<CsmaChannel> csmaChannel = channel->GetObject<CsmaChannel> ();
NodeContainer newNodes;
NetDeviceContainer newDevices;
newNodes.Create (nFill);
fillNodes.Add (newNodes);
fillDevices.Add (csma.Install (newNodes, csmaChannel));
}
NS_LOG_INFO ("Install internet stack on all nodes.");
InternetStackHelper internet;
internet.Install (NodeContainer (hubNode, spokeNodes, fillNodes));
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper address;
//
// Assign IPv4 interfaces and IP addresses to the devices we previously
// created. Keep track of the resulting addresses, one for the addresses
// of the hub node, and one for addresses on the spoke nodes. Despite the
// name of the class (Ipv4InterfaceContainer), what is visible to clients
// is really the address not the interface.
//
Ipv4InterfaceContainer hubAddresses;
Ipv4InterfaceContainer spokeAddresses;
for(uint32_t i = 0; i < spokeNodes.GetN (); ++i)
{
std::ostringstream subnet;
subnet << "10.1." << i << ".0";
NS_LOG_INFO ("Assign IP Addresses for CSMA subnet " << subnet.str ());
address.SetBase (subnet.str ().c_str (), "255.255.255.0");
hubAddresses.Add (address.Assign (hubDevices.Get (i)));
spokeAddresses.Add (address.Assign (spokeDevices.Get (i)));
//
// We assigned addresses to the logical hub and the first "drop" of the
// CSMA network that acts as the spoke, but we also have a number of fill
// devices (nFill) also hanging off the CSMA network. We have got to
// assign addresses to them as well. We put all of the fill devices into
// a single device container, so the first nFill devices are associated
// with the channel connected to spokeDevices.Get (0), the second nFill
// devices afe associated with the channel connected to spokeDevices.Get (1)
// etc.
//
for (uint32_t j = 0; j < nFill; ++j)
{
address.Assign (fillDevices.Get (i * nFill + j));
}
}
NS_LOG_INFO ("Create applications.");
//
// Create a packet sink on the star "hub" to receive packets.
//
uint16_t port = 50000;
Address hubLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", hubLocalAddress);
ApplicationContainer hubApp = packetSinkHelper.Install (hubNode);
hubApp.Start (Seconds (1.0));
hubApp.Stop (Seconds (10.0));
//
// Create OnOff applications to send TCP to the hub, one on each spoke node.
//
OnOffHelper onOffHelper ("ns3::TcpSocketFactory", Address ());
onOffHelper.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onOffHelper.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer spokeApps;
for (uint32_t i = 0; i < spokeNodes.GetN (); ++i)
{
AddressValue remoteAddress (InetSocketAddress (hubAddresses.GetAddress (i), port));
onOffHelper.SetAttribute ("Remote", remoteAddress);
spokeApps.Add (onOffHelper.Install (spokeNodes.Get (i)));
}
spokeApps.Start (Seconds (1.0));
spokeApps.Stop (Seconds (10.0));
//
// Because we are evil, we also add OnOff applications to send TCP to the hub
// from the fill devices on each CSMA link. The first nFill nodes in the
// fillNodes container are on the CSMA network talking to the zeroth device
// on the hub node. The next nFill nodes are on the CSMA network talking to
// the first device on the hub node, etc. So the ith fillNode is associated
// with the hub address found on the (i / nFill)th device on the hub node.
//
ApplicationContainer fillApps;
for (uint32_t i = 0; i < fillNodes.GetN (); ++i)
{
AddressValue remoteAddress (InetSocketAddress (hubAddresses.GetAddress (i / nFill), port));
onOffHelper.SetAttribute ("Remote", remoteAddress);
fillApps.Add (onOffHelper.Install (fillNodes.Get (i)));
}
fillApps.Start (Seconds (1.0));
fillApps.Stop (Seconds (10.0));
NS_LOG_INFO ("Enable static global routing.");
//
// Turn on global static routing so we can actually be routed across the star.
//
GlobalRouteManager::PopulateRoutingTables ();
NS_LOG_INFO ("Enable pcap tracing.");
//
// Do pcap tracing on all devices on all nodes.
//
CsmaHelper::EnablePcapAll ("csma-star");
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
+156
View File
@@ -0,0 +1,156 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*/
// Network topology
//
// Normally, the use case for emulated net devices is in collections of
// small simulations that connect to the outside world through specific
// interfaces. For example, one could construct a number of virtual
// machines and connect them via a host-only network. To use the emulated
// net device, you would need to set all of the host-only interfaces in
// promiscuous mode and provide an appropriate device name (search for "eth1"
// below). One could also use the emulated net device in a testbed situation
// where the host on which the simulation is running has a specific interface
// of interested. You would also need to set this specific interface into
// promiscuous mode and provide an appropriate device name.
//
// This philosophy carries over to this simple example.
//
// We don't assume any special configuration and all of the ns-3 emulated net
// devices will actually talk to the same underlying OS device. We rely on
// the fact that the OS will deliver copies of our packets to the other ns-3
// net devices since we operate in promiscuous mode.
//
// Packets will be sent out over the device, but we use MAC spoofing. The
// MAC addresses will be generated using the Organizationally Unique Identifier
// (OUI) 00:00:00 as a base. This vendor code is not assigned to any
// organization and so should not conflict with any real hardware. We'll use
// the first n of these addresses, where n is the number of nodes, in this
// simualtion. It is up to you to determine that using these MAC addresses is
// okay on your network and won't conflict with anything else (including another
// simulation using emu devices) on your network. Once you have made this
// determination, you need to put the interface you chose into promiscuous mode.
// We don't do it for you since you need to think about it first.
//
// This simulation uses the real-time simulator and so will consume ten seconds
// of real time.
//
// By default, we create the following topology
//
// n0 n1 n2 n3
// | | | |
// -----------------
// "eth1"
//
// - UDP flows from n0 to n1 and back
// - DropTail queues
// - Tracing of queues and packet receptions to file "udp-echo.tr"
// - pcap tracing on all devices
//
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/helper-module.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("EmulatedUdpEchoExample");
int
main (int argc, char *argv[])
{
std::string deviceName ("eth1");
uint32_t nNodes = 4;
//
// Allow the user to override any of the defaults at run-time, via command-line
// arguments
//
CommandLine cmd;
cmd.AddValue("deviceName", "device name", deviceName);
cmd.AddValue("nNodes", "number of nodes to create (>= 2)", nNodes);
cmd.Parse (argc, argv);
GlobalValue::Bind ("SimulatorImplementationType",
StringValue ("ns3::RealtimeSimulatorImpl"));
//
// need at least two nodes
//
nNodes = nNodes < 2 ? 2 : nNodes;
//
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");
NodeContainer n;
n.Create (nNodes);
InternetStackHelper internet;
internet.Install (n);
//
// Explicitly create the channels required by the topology (shown above).
//
NS_LOG_INFO ("Create channels.");
EmuHelper emu;
emu.SetAttribute ("DeviceName", StringValue (deviceName));
NetDeviceContainer d = emu.Install (n);
//
// We've got the "hardware" in place. Now we need to add IP addresses.
//
Ipv4AddressHelper ipv4;
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (d);
//
// Create a UdpEchoServer application on node one.
//
NS_LOG_INFO ("Create Applications.");
UdpEchoServerHelper server (9);
ApplicationContainer apps = server.Install (n.Get(1));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
//
// Create a UdpEchoClient application to send UDP datagrams from node zero to node one.
//
uint32_t packetSize = 1024;
uint32_t maxPacketCount = 1;
Time interPacketInterval = Seconds (1.);
UdpEchoClientHelper client (i.GetAddress (1), 9);
client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
client.SetAttribute ("Interval", TimeValue (interPacketInterval));
client.SetAttribute ("PacketSize", UintegerValue (packetSize));
apps = client.Install (n.Get (0));
apps.Start (Seconds (2.0));
apps.Stop (Seconds (10.0));
std::ofstream ascii;
ascii.open ("emu-udp-echo.tr");
EmuHelper::EnablePcapAll ("emu-udp-echo");
//
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}
+8 -6
View File
@@ -132,10 +132,12 @@ main (int argc, char *argv[])
// Create the backbone wifi net devices and install them into the nodes in
// our container
//
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
WifiHelper wifi;
wifi.SetMac ("ns3::AdhocWifiMac");
wifi.SetPhy ("ns3::WifiPhy");
NetDeviceContainer backboneDevices = wifi.Install (backbone);
NetDeviceContainer backboneDevices = wifi.Install (wifiPhy, backbone);
//
// Add the IPv4 protocol stack to the nodes in our container
//
@@ -244,8 +246,8 @@ main (int argc, char *argv[])
//
WifiHelper wifiInfra;
wifiInfra.SetMac ("ns3::AdhocWifiMac");
wifiInfra.SetPhy ("ns3::WifiPhy");
NetDeviceContainer infraDevices = wifiInfra.Install (infra);
wifiPhy.SetChannel (wifiChannel.Create ());
NetDeviceContainer infraDevices = wifiInfra.Install (wifiPhy, infra);
// Add the IPv4 protocol stack to the nodes in our container
//
@@ -332,14 +334,14 @@ main (int argc, char *argv[])
//
std::ofstream ascii;
ascii.open ("mixed-wireless.tr");
WifiHelper::EnableAsciiAll (ascii);
YansWifiPhyHelper::EnableAsciiAll (ascii);
CsmaHelper::EnableAsciiAll (ascii);
// Look at nodes 11, 13 only
//WifiHelper::EnableAscii (ascii, 11, 0);
//WifiHelper::EnableAscii (ascii, 13, 0);
// Let's do a pcap trace on the backbone devices
WifiHelper::EnablePcap ("mixed-wireless", backboneDevices);
YansWifiPhyHelper::EnablePcap ("mixed-wireless", backboneDevices);
// Let's additionally trace the application Sink, ifIndex 0
CsmaHelper::EnablePcap ("mixed-wireless", appSink->GetId (), 0);
+1 -1
View File
@@ -148,7 +148,7 @@ main (int argc, char *argv[])
ApplicationContainer apps = onoff.Install (c.Get (3));
apps.Start (Seconds (1.1));
apps.Start (Seconds (10.0));
apps.Stop (Seconds (10.0));
// Create a packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
+1 -1
View File
@@ -134,7 +134,7 @@ main (int argc, char *argv[])
// Create an optional packet sink to receive these packets
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
apps = sink.Install (c.Get (3));
apps = sink.Install (c.Get (2));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));
+153
View File
@@ -0,0 +1,153 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*
*/
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-route-manager.h"
// Network topology (default)
//
// n2 n3 n4 .
// \ | / .
// \|/ .
// n1--- n0---n5 .
// /|\ .
// / | \ .
// n8 n7 n6 .
//
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("Star");
int
main (int argc, char *argv[])
{
//
// Make the random number generators generate reproducible results.
//
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
//
// Set up some default values for the simulation.
//
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (137));
// ??? try and stick 15kb/s into the data rate
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("14kb/s"));
//
// Default number of nodes in the star. Overridable by command line argument.
//
uint32_t nNodes = 9;
CommandLine cmd;
cmd.AddValue("nNodes", "Number of nodes to place in the star", nNodes);
cmd.Parse (argc, argv);
NS_LOG_INFO ("Create nodes.");
NodeContainer hubNode;
NodeContainer spokeNodes;
hubNode.Create (1);
Ptr<Node> hub = hubNode.Get (0);
spokeNodes.Create (nNodes - 1);
NS_LOG_INFO ("Install internet stack on all nodes.");
InternetStackHelper internet;
internet.Install (NodeContainer (hubNode, spokeNodes));
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
NS_LOG_INFO ("Build star topology.");
NetDeviceContainer hubDevices, spokeDevices;
pointToPoint.InstallStar (hubNode.Get (0), spokeNodes, hubDevices, spokeDevices);
NS_LOG_INFO ("Assign IP Addresses.");
Ipv4AddressHelper address;
//
// Assign IPv4 interfaces and IP addresses to the devices we previously
// created. Keep track of the resulting addresses, one for the addresses
// of the hub node, and one for addresses on the spoke nodes. Despite the
// name of the class, what is visible to clients is really the address.
//
Ipv4InterfaceContainer hubAddresses;
Ipv4InterfaceContainer spokeAddresses;
for(uint32_t i = 0; i < spokeNodes.GetN (); ++i)
{
std::ostringstream subnet;
subnet << "10.1.1." << (i << 2);
NS_LOG_INFO ("Assign IP Addresses for point-to-point subnet " << subnet.str ());
address.SetBase (subnet.str ().c_str (), "255.255.255.252");
hubAddresses.Add (address.Assign (hubDevices.Get (i)));
spokeAddresses.Add (address.Assign (spokeDevices.Get (i)));
}
NS_LOG_INFO ("Create applications.");
//
// Create a packet sink on the star "hub" to receive packets.
//
uint16_t port = 50000;
Address hubLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port));
PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", hubLocalAddress);
ApplicationContainer hubApp = packetSinkHelper.Install (hubNode);
hubApp.Start (Seconds (1.0));
hubApp.Stop (Seconds (10.0));
//
// Create OnOff applications to send TCP to the hub, one on each spoke node.
//
OnOffHelper onOffHelper ("ns3::TcpSocketFactory", Address ());
onOffHelper.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
onOffHelper.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer spokeApps;
for (uint32_t i = 0; i < spokeNodes.GetN (); ++i)
{
AddressValue remoteAddress (InetSocketAddress (hubAddresses.GetAddress (i), port));
onOffHelper.SetAttribute ("Remote", remoteAddress);
spokeApps.Add (onOffHelper.Install (spokeNodes.Get (i)));
}
spokeApps.Start (Seconds (1.0));
spokeApps.Stop (Seconds (10.0));
NS_LOG_INFO ("Enable static global routing.");
//
// Turn on global static routing so we can actually be routed across the star.
//
GlobalRouteManager::PopulateRoutingTables ();
NS_LOG_INFO ("Enable pcap tracing.");
//
// Do pcap tracing on all devices on all nodes.
//
PointToPointHelper::EnablePcapAll ("star");
NS_LOG_INFO ("Run Simulation.");
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
+4 -2
View File
@@ -129,8 +129,10 @@ int main(int argc, char *argv[]) {
NS_LOG_INFO("Installing WiFi and Internet stack.");
WifiHelper wifi;
wifi.SetMac("ns3::AdhocWifiMac");
wifi.SetPhy("ns3::WifiPhy");
NetDeviceContainer nodeDevices = wifi.Install(nodes);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
NetDeviceContainer nodeDevices = wifi.Install(wifiPhy, nodes);
InternetStackHelper internet;
internet.Install(nodes);
+36 -19
View File
@@ -25,7 +25,7 @@
//
// - Pcap traces are saved as tcp-nsc-zoo-$n-0.pcap, where $n represents the node number
// - TCP flows from n0 to n1, n2, n3, from n1 to n0, n2, n3, etc.
// Usage (e.g.): ./waf --run 'tcp-nsc-zoo --Nodes=5'
// Usage (e.g.): ./waf --run 'tcp-nsc-zoo --nodes=5'
#include <iostream>
#include <string>
@@ -45,14 +45,23 @@ int main(int argc, char *argv[])
{
CsmaHelper csma;
unsigned int MaxNodes = 4;
unsigned int runtime = 3;
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (4096));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("1Mb/s"));
RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (2048));
Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("8kbps"));
CommandLine cmd;
// this allows the user to raise the number of nodes using --Nodes=X command-line argument.
cmd.AddValue("Nodes", "Number of nodes in the network", MaxNodes);
// this allows the user to raise the number of nodes using --nodes=X command-line argument.
cmd.AddValue("nodes", "Number of nodes in the network (must be > 1)", MaxNodes);
cmd.AddValue("runtime", "How long the applications should send data (default 3 seconds)", runtime);
cmd.Parse (argc, argv);
if (MaxNodes < 2)
{
std::cerr << "--nodes: must be >= 2" << std::endl;
return 1;
}
csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(100 * 1000 * 1000)));
csma.SetChannelAttribute ("Delay", TimeValue (MicroSeconds (200)));
@@ -70,16 +79,24 @@ int main(int argc, char *argv[])
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", StringValue ("0"));
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", StringValue ("0"));
Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", StringValue ("0"));
internetStack.Install (n.Get(2));
// the next statement doesn't change anything for the nodes 0, 1, and 2; since they
// already have a stack assigned.
internetStack.SetNscStack ("liblinux2.6.18.so");
// this switches node 3 to NSCs Linux 2.6.18 stack.
internetStack.Install (n.Get(3));
// and then agains disables sack/timestamps/wscale on node 3.
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_sack", StringValue ("0"));
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_timestamps", StringValue ("0"));
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_window_scaling", StringValue ("0"));
if (MaxNodes > 2)
{
internetStack.Install (n.Get(2));
}
if (MaxNodes > 3)
{
// the next statement doesn't change anything for the nodes 0, 1, and 2; since they
// already have a stack assigned.
internetStack.SetNscStack ("liblinux2.6.18.so");
// this switches node 3 to NSCs Linux 2.6.18 stack.
internetStack.Install (n.Get(3));
// and then agains disables sack/timestamps/wscale on node 3.
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_sack", StringValue ("0"));
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_timestamps", StringValue ("0"));
Config::Set ("/NodeList/3/$ns3::Ns3NscStack<linux2.6.18>/net.ipv4.tcp_window_scaling", StringValue ("0"));
}
// the freebsd stack is not yet built by default, so its commented out for now.
// internetStack.SetNscStack ("libfreebsd5.so");
for (unsigned int i =4; i < MaxNodes; i++)
@@ -97,7 +114,7 @@ int main(int argc, char *argv[])
PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), servPort));
// start a sink client on all nodes
ApplicationContainer sinkApp = sinkHelper.Install (n);
sinkApp.Start (Seconds (1.0));
sinkApp.Start (Seconds (0));
sinkApp.Stop (Seconds (30.0));
// This tells every node on the network to start a flow to all other nodes on the network ...
@@ -116,14 +133,14 @@ int main(int argc, char *argv[])
clientHelper.SetAttribute
("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer clientApp = clientHelper.Install(n.Get(i));
clientApp.Start (Seconds (j + 1.0)); /* delay startup depending on node number */
clientApp.Stop (Seconds (j + 10.0));
clientApp.Start (Seconds (j)); /* delay startup depending on node number */
clientApp.Stop (Seconds (j + runtime));
}
}
CsmaHelper::EnablePcapAll ("tcp-nsc-zoo");
Simulator::Stop (Seconds(1000));
Simulator::Stop (Seconds(100));
Simulator::Run ();
Simulator::Destroy ();
+70
View File
@@ -0,0 +1,70 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2008 Louis Pasteur University / Telecom Bretagne
*
* 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: Angelos Chatzipapas <Angelos.CHATZIPAPAS@enst-bretagne.fr> /
* <chatzipa@ceid.upatras.gr>
*/
#include "ns3/log.h"
//#include "ns3/ipv6.h"
#include "ns3/ipv6-address.h"
#include "ns3/node.h"
#include "ns3/mac48-address.h"
NS_LOG_COMPONENT_DEFINE ("TestIpv6");
using namespace ns3;
int
main (int argc, char *argv[])
{
LogComponentEnable ("TestIpv6", LOG_LEVEL_ALL);
NS_LOG_INFO ("Test Ipv6");
Mac48Address m_addresses[10];
m_addresses[0]=("00:00:00:00:00:01");
m_addresses[1]=("00:00:00:00:00:02");
m_addresses[2]=("00:00:00:00:00:03");
m_addresses[3]=("00:00:00:00:00:04");
m_addresses[4]=("00:00:00:00:00:05");
m_addresses[5]=("00:00:00:00:00:06");
m_addresses[6]=("00:00:00:00:00:07");
m_addresses[7]=("00:00:00:00:00:08");
m_addresses[8]=("00:00:00:00:00:09");
m_addresses[9]=("00:00:00:00:00:10");
Ipv6Address prefix1 ("2001:1::");
NS_LOG_INFO ("prefix = " << prefix1);
for (uint32_t i = 0; i < 10 ; ++i)
{
NS_LOG_INFO ("address = " <<m_addresses[i]);
Ipv6Address ipv6address=Ipv6Address::MakeAutoconfiguredAddress(m_addresses[i], prefix1);
NS_LOG_INFO ("address = " <<ipv6address);
}
Ipv6Address prefix2 ("2002:1:1::");
NS_LOG_INFO ("prefix = " << prefix2);
for (uint32_t i = 0; i < 10 ; ++i)
{
Ipv6Address ipv6address=Ipv6Address::MakeAutoconfiguredAddress(m_addresses[i], prefix2);
NS_LOG_INFO ("address = " <<ipv6address);
}
}
+20 -17
View File
@@ -36,7 +36,7 @@ class Experiment
public:
Experiment ();
Experiment (std::string name);
GnuplotDataset Run (const WifiHelper &wifi);
GnuplotDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const YansWifiChannelHelper &wifiChannel);
private:
void ReceivePacket (Ptr<Socket> socket);
void SetPosition (Ptr<Node> node, Vector position);
@@ -110,7 +110,7 @@ Experiment::SetupPacketReceive (Ptr<Node> node)
}
GnuplotDataset
Experiment::Run (const WifiHelper &wifi)
Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const YansWifiChannelHelper &wifiChannel)
{
m_bytesTotal = 0;
@@ -120,7 +120,9 @@ Experiment::Run (const WifiHelper &wifi)
PacketSocketHelper packetSocket;
packetSocket.Install (c);
NetDeviceContainer devices = wifi.Install (c);
YansWifiPhyHelper phy = wifiPhy;
phy.SetChannel (wifiChannel.Create ());
NetDeviceContainer devices = wifi.Install (phy, c);
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
@@ -168,91 +170,92 @@ int main (int argc, char *argv[])
Gnuplot gnuplot = Gnuplot ("reference-rates.png");
Experiment experiment;
WifiHelper wifi;
WifiHelper wifi = WifiHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
GnuplotDataset dataset;
wifi.SetMac ("ns3::AdhocWifiMac");
wifi.SetPhy ("ns3::WifiPhy");
NS_LOG_DEBUG ("54");
experiment = Experiment ("54mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-54mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("48");
experiment = Experiment ("48mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-48mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("36");
experiment = Experiment ("36mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-36mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("24");
experiment = Experiment ("24mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-24mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("18");
experiment = Experiment ("18mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-18mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("12");
experiment = Experiment ("12mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-12mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("9");
experiment = Experiment ("9mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-9mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("6");
experiment = Experiment ("6mb");
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("wifia-6mbs"));
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
gnuplot.GenerateOutput (std::cout);
gnuplot = Gnuplot ("rate-control.png");
Config::SetDefault ("ns3::WifiPhy::Standard", StringValue ("holland"));
Config::SetDefault ("ns3::YansWifiPhy::Standard", StringValue ("holland"));
NS_LOG_DEBUG ("arf");
experiment = Experiment ("arf");
wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("aarf");
experiment = Experiment ("aarf");
wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
NS_LOG_DEBUG ("ideal");
experiment = Experiment ("ideal");
wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
dataset = experiment.Run (wifi);
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
gnuplot.AddDataset (dataset);
gnuplot.GenerateOutput (std::cout);
+10 -14
View File
@@ -117,7 +117,7 @@ int main (int argc, char *argv[])
// disable fragmentation
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
WifiHelper wifi;
WifiHelper wifi = WifiHelper::Default ();
MobilityHelper mobility;
NodeContainer stas;
NodeContainer ap;
@@ -131,25 +131,21 @@ int main (int argc, char *argv[])
packetSocket.Install (stas);
packetSocket.Install (ap);
Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
channel->SetPropagationLossModel (log);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
Ssid ssid = Ssid ("wifi-default");
wifi.SetPhy ("ns3::WifiPhy");
wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
// setup stas.
wifi.SetMac ("ns3::NqstaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
staDevs = wifi.Install (stas, channel);
staDevs = wifi.Install (wifiPhy, stas);
// setup ap.
wifi.SetMac ("ns3::NqapWifiMac", "Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue (Seconds (2.5)));
wifi.Install (ap, channel);
wifi.Install (wifiPhy, ap);
// mobility.
mobility.Install (stas);
@@ -174,10 +170,10 @@ int main (int argc, char *argv[])
Config::Connect ("/NodeList/*/DeviceList/*/Tx", MakeCallback (&DevTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Rx", MakeCallback (&DevRxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxOk", MakeCallback (&PhyRxOkTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxError", MakeCallback (&PhyRxErrorTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/Tx", MakeCallback (&PhyTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State", MakeCallback (&PhyStateTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxOk", MakeCallback (&PhyRxOkTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxError", MakeCallback (&PhyRxErrorTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/Tx", MakeCallback (&PhyTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace));
Simulator::Run ();
+57 -23
View File
@@ -1,4 +1,46 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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
*/
// Default network topology includes some number of AP nodes specified by
// the variable nWifis (defaults to two). Off of each AP node, there are some
// number of STA nodes specified by the variable nStas (defaults to two).
// Each AP talks to its associated STA nodes. There are bridge net devices
// on each AP node that bridge the whole thing into one network.
//
// +-----+ +-----+ +-----+ +-----+
// | STA | | STA | | STA | | STA |
// +-----+ +-----+ +-----+ +-----+
// 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6
// -------- -------- -------- --------
// WIFI STA WIFI STA WIFI STA WIFI STA
// -------- -------- -------- --------
// ((*)) ((*)) | ((*)) ((*))
// |
// ((*)) | ((*))
// ------- -------
// WIFI AP CSMA ========= CSMA WIFI AP
// ------- ---- ---- -------
// ############## ##############
// BRIDGE BRIDGE
// ############## ##############
// 192.168.0.1 192.168.0.2
// +---------+ +---------+
// | AP Node | | AP Node |
// +---------+ +---------+
//
#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
@@ -10,20 +52,10 @@
#include <vector>
#include <stdint.h>
#include <sstream>
#include <fstream>
using namespace ns3;
Ptr<WifiChannel>
CreateChannel (void)
{
Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
channel->SetPropagationLossModel (log);
return channel;
}
int main (int argc, char *argv[])
{
uint32_t nWifis = 2;
@@ -56,7 +88,6 @@ int main (int argc, char *argv[])
stack.Install (backboneNodes);
backboneDevices = csma.Install (backboneNodes);
backboneInterfaces = ip.Assign (backboneDevices);
double wifiX = 0.0;
for (uint32_t i = 0; i < nWifis; ++i)
@@ -73,13 +104,12 @@ int main (int argc, char *argv[])
Ipv4InterfaceContainer apInterface;
MobilityHelper mobility;
BridgeHelper bridge;
WifiHelper wifi;
Ptr<WifiChannel> channel;
WifiHelper wifi = WifiHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
sta.Create (nStas);
wifi.SetPhy ("ns3::WifiPhy");
channel = CreateChannel ();
ip.NewNetwork ();
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (wifiX),
"MinY", DoubleValue (0.0),
@@ -96,9 +126,13 @@ int main (int argc, char *argv[])
"Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue (Seconds (2.5)));
apDev = wifi.Install (backboneNodes.Get (i), channel);
apInterface = ip.Assign (apDev);
bridge.Install (backboneNodes.Get (i), NetDeviceContainer (apDev, backboneDevices.Get (i)));
apDev = wifi.Install (wifiPhy, backboneNodes.Get (i));
NetDeviceContainer bridgeDev;
bridgeDev = bridge.Install (backboneNodes.Get (i), NetDeviceContainer (apDev, backboneDevices.Get (i)));
// assign AP IP address to bridge, not wifi
apInterface = ip.Assign (bridgeDev);
// setup the STAs
stack.Install (sta);
@@ -111,7 +145,7 @@ int main (int argc, char *argv[])
wifi.SetMac ("ns3::NqstaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));
staDev = wifi.Install (sta, channel);
staDev = wifi.Install (wifiPhy, sta);
staInterface = ip.Assign (staDev);
// save everything in containers.
@@ -150,8 +184,8 @@ int main (int argc, char *argv[])
apps.Stop (Seconds (3.0));
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[1].Get (1));
WifiHelper::EnablePcap ("wifi-wire-bridging", staNodes[0].Get (0));
YansWifiPhyHelper::EnablePcap ("wifi-wire-bridging", staNodes[1].Get (1));
YansWifiPhyHelper::EnablePcap ("wifi-wire-bridging", staNodes[0].Get (0));
std::ofstream os;
os.open ("wifi-wire-bridging.mob");
MobilityHelper::EnableAsciiAll (os);
+48 -17
View File
@@ -5,73 +5,85 @@ def build(bld):
obj.source = 'hello-simulator.cc'
obj = bld.create_ns3_program('mixed-wireless',
['core', 'simulator', 'mobility', 'wifi', 'point-to-point', 'internet-stack'])
['core', 'simulator', 'mobility', 'wifi', 'point-to-point', 'internet-stack'])
obj.source = 'mixed-wireless.cc'
obj = bld.create_ns3_program('simple-global-routing',
['point-to-point', 'internet-stack', 'global-routing'])
['point-to-point', 'internet-stack', 'global-routing'])
obj.source = 'simple-global-routing.cc'
obj = bld.create_ns3_program('simple-alternate-routing',
['point-to-point', 'internet-stack', 'global-routing'])
['point-to-point', 'internet-stack', 'global-routing'])
obj.source = 'simple-alternate-routing.cc'
obj = bld.create_ns3_program('simple-error-model',
['point-to-point', 'internet-stack'])
['point-to-point', 'internet-stack'])
obj.source = 'simple-error-model.cc'
obj = bld.create_ns3_program('csma-one-subnet',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'csma-one-subnet.cc'
obj = bld.create_ns3_program('csma-bridge',
['bridge', 'csma', 'internet-stack'])
['bridge', 'csma', 'internet-stack'])
obj.source = 'csma-bridge.cc'
obj = bld.create_ns3_program('csma-bridge-one-hop',
['bridge', 'csma', 'internet-stack'])
obj.source = 'csma-bridge-one-hop.cc'
obj = bld.create_ns3_program('udp-echo',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'udp-echo.cc'
obj = bld.create_ns3_program('realtime-udp-echo',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'realtime-udp-echo.cc'
obj = bld.create_ns3_program('csma-broadcast',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'csma-broadcast.cc'
obj = bld.create_ns3_program('csma-packet-socket',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'csma-packet-socket.cc'
obj = bld.create_ns3_program('csma-multicast',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'csma-multicast.cc'
obj = bld.create_ns3_program( 'mixed-global-routing',
['point-to-point', 'internet-stack', 'global-routing' , 'csma-cd'])
['point-to-point', 'internet-stack', 'global-routing' , 'csma-cd'])
obj.source = 'mixed-global-routing.cc'
obj = bld.create_ns3_program('simple-point-to-point-olsr',
['point-to-point', 'internet-stack', 'olsr'])
['point-to-point', 'internet-stack', 'olsr'])
obj.source = 'simple-point-to-point-olsr.cc'
obj = bld.create_ns3_program('tcp-large-transfer',
['point-to-point', 'internet-stack'])
['point-to-point', 'internet-stack'])
obj.source = 'tcp-large-transfer.cc'
obj = bld.create_ns3_program('tcp-nsc-lfn',
['point-to-point', 'internet-stack'])
['point-to-point', 'internet-stack'])
obj.source = 'tcp-nsc-lfn.cc'
obj = bld.create_ns3_program('tcp-nsc-zoo',
['csma', 'internet-stack'])
['csma', 'internet-stack'])
obj.source = 'tcp-nsc-zoo.cc'
obj = bld.create_ns3_program('tcp-star-server',
['point-to-point', 'internet-stack'])
['point-to-point', 'internet-stack'])
obj.source = 'tcp-star-server.cc'
obj = bld.create_ns3_program('star',
['point-to-point', 'internet-stack'])
obj.source = 'star.cc'
obj = bld.create_ns3_program('csma-star',
['csma', 'internet-stack'])
obj.source = 'csma-star.cc'
obj = bld.create_ns3_program('wifi-adhoc',
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'wifi-adhoc.cc'
@@ -86,3 +98,22 @@ def build(bld):
['core', 'simulator', 'mobility', 'wifi',
'csma', 'helper', 'bridge'])
obj.source = 'wifi-wired-bridging.cc'
obj = bld.create_ns3_program('csma-raw-ip-socket',
['csma', 'internet-stack'])
obj.source = 'csma-raw-ip-socket.cc'
obj = bld.create_ns3_program('csma-ping',
['csma', 'internet-stack', 'v4ping'])
obj.source = 'csma-ping.cc'
obj = bld.create_ns3_program('test-ipv6',
['point-to-point', 'internet-stack'])
obj.source = 'test-ipv6.cc'
env = bld.env_of_name('default')
if env['ENABLE_EMU']:
obj = bld.create_ns3_program('emu-udp-echo',
['emu', 'internet-stack'])
obj.source = 'emu-udp-echo.cc'
+270
View File
@@ -0,0 +1,270 @@
import os
import sys
import Params
import shutil
import pproc as subprocess
import urllib
import wutils
#
# The directory in which the tarball of the reference traces lives. This is
# used if Mercurial is not on the system.
#
REGRESSION_TRACES_URL = "http://www.nsnam.org/releases/"
#
# The path to the Mercurial repository used to find the reference traces if
# we find "hg" on the system. We expect that the repository will be named
# identically to refDirName below
#
REGRESSION_TRACES_REPO = "http://code.nsnam.org/"
#
# Name of the local directory where the regression code lives.
#
REGRESSION_DIR = "regression"
#
# The last part of the path name to use to find the regression traces. The
# path will be APPNAME + '-' + VERSION + REGRESSION_SUFFIX, e.g.,
# ns-3-dev-ref-traces
#
REGRESSION_SUFFIX = "-ref-traces"
def dev_null():
if sys.platform == 'win32':
return open("NUL:", "w")
else:
return open("/dev/null", "w")
### Regression testing
class Regression(object):
def __init__(self, testdir, reference_traces):
self.testdir = testdir
self.reference_traces = reference_traces
self.env = Params.g_build.env_of_name('default')
def run_test(self, verbose, generate, testName, arguments=[], pyscript=None, refTestName=None):
"""
@param verbose: enable verbose execution
@param generate: generate new traces instead of comparing with the reference
@param testName: name of the test
@arguments: list of extra parameters to pass to the program to be tested
@pyscript: if not None, the test is written in Python and this
parameter contains the path to the python script, relative to
the project root dir
@param refTestName: if not None, this is the name of the directory under refDirName
that contains the reference traces. Otherwise "refDirname/testName + .ref" is used.
"""
if not isinstance(arguments, list):
raise TypeError
if refTestName is None:
refTestDirName = os.path.join(self.reference_traces, (testName + ".ref"))
else:
refTestDirName = os.path.join(self.reference_traces, refTestName)
if not os.path.exists(self.reference_traces):
print"No reference trace repository"
return 1
if generate:
if not os.path.exists(refTestDirName):
print "creating new " + refTestDirName
os.mkdir(refTestDirName)
if pyscript is None:
Params.g_options.cwd_launch = refTestDirName
tmpl = "%s"
for arg in arguments:
tmpl = tmpl + " " + arg
wutils.run_program(testName, tmpl)
else:
argv = [self.env['PYTHON'], os.path.join(Params.g_cwd_launch, *os.path.split(pyscript))] + arguments
before = os.getcwd()
os.chdir(refTestDirName)
try:
wutils.run_argv(argv)
finally:
os.chdir(before)
print "Remember to commit " + refTestDirName
return 0
else:
if not os.path.exists(refTestDirName):
print "Cannot locate reference traces in " + refTestDirName
return 1
if refTestName is None:
traceDirName = testName + ".ref"
else:
traceDirName = refTestName
traceDirName = os.path.join ('traces', traceDirName)
try:
shutil.rmtree(traceDirName)
except OSError:
pass
os.mkdir(traceDirName)
#os.system("./waf --cwd regression/traces --run " +
# testName + " > /dev/null 2>&1")
if pyscript is None:
Params.g_options.cwd_launch = traceDirName
wutils.run_program(testName, command_template=wutils.get_command_template(*arguments))
else:
argv = [self.env['PYTHON'], os.path.join('..', '..', '..', *os.path.split(pyscript))] + arguments
before = os.getcwd()
os.chdir(traceDirName)
try:
wutils.run_argv(argv)
finally:
os.chdir(before)
if verbose:
#diffCmd = "diff traces " + refTestDirName + " | head"
diffCmd = subprocess.Popen([self.env['DIFF'], traceDirName, refTestDirName],
stdout=subprocess.PIPE)
headCmd = subprocess.Popen("head", stdin=diffCmd.stdout)
rc2 = headCmd.wait()
diffCmd.stdout.close()
rc1 = diffCmd.wait()
rc = rc1 or rc2
else:
rc = subprocess.Popen([self.env['DIFF'], traceDirName, refTestDirName], stdout=dev_null()).wait()
if rc:
print "----------"
print "Traces differ in test: test-" + testName
print "Reference traces in directory: regression/" + refTestDirName
print "Traces in directory: traces"
print "Rerun regression test as: " + \
"\"./waf --regression --regression-tests=test-" + testName + "\""
print "Then do \"diff -u regression/" + refTestDirName + " regression/" + traceDirName +\
"\" for details"
print "----------"
return rc
def _find_tests(testdir):
"""Return a list of test modules in the test directory
Arguments:
testdir -- the directory to look in for tests
"""
names = os.listdir(testdir)
tests = []
for name in names:
if name[:5] == "test-" and name[-3:] == ".py":
testname = name[:-3]
tests.append(testname)
tests.sort()
return tests
def run_regression(reference_traces):
"""Execute regression tests. Called with cwd set to the 'regression' subdir of ns-3.
@param reference_traces: reference traces directory, or None for default.
"""
testdir = "tests"
if not os.path.exists(testdir):
print "Tests directory does not exist"
sys.exit(3)
dir_name = (wutils.APPNAME + '-' + wutils.VERSION + REGRESSION_SUFFIX)
if reference_traces is None:
reference_traces = dir_name
no_net = False
else:
no_net = True
sys.path.append(testdir)
sys.modules['tracediff'] = Regression(testdir, reference_traces)
if Params.g_options.regression_tests:
tests = Params.g_options.regression_tests.split(',')
else:
tests = _find_tests(testdir)
print "========== Running Regression Tests =========="
env = Params.g_build.env_of_name('default')
if not no_net:
if env['MERCURIAL']:
print "Synchronizing reference traces using Mercurial."
if not os.path.exists(reference_traces):
print "Cloning " + REGRESSION_TRACES_REPO + dir_name + " from repo."
argv = ["hg", "clone", REGRESSION_TRACES_REPO + dir_name, reference_traces]
rv = subprocess.Popen(argv).wait()
else:
_dir = os.getcwd()
os.chdir(reference_traces)
try:
print "Pulling " + REGRESSION_TRACES_REPO + dir_name + " from repo."
result = subprocess.Popen(["hg", "-q", "pull", REGRESSION_TRACES_REPO + dir_name]).wait()
if not result:
result = subprocess.Popen(["hg", "-q", "update"]).wait()
finally:
os.chdir("..")
if result:
Params.fatal("Synchronizing reference traces using Mercurial failed.")
else:
if not os.path.exists(reference_traces):
traceball = dir_name + wutils.TRACEBALL_SUFFIX
print "Retrieving " + traceball + " from web."
urllib.urlretrieve(REGRESSION_TRACES_URL + traceball, traceball)
os.system("tar -xjf %s -C .." % (traceball))
print "Done."
if not os.path.exists(reference_traces):
print "Reference traces directory (%s) does not exist" % reference_traces
return 3
bad = []
for test in tests:
try:
result = _run_regression_test(test)
if result == 0:
if Params.g_options.regression_generate:
print "GENERATE " + test
else:
print "PASS " + test
else:
bad.append(test)
print "FAIL " + test
except NotImplementedError:
print "SKIP " + test
return len(bad) > 0
def _run_regression_test(test):
"""Run a single test.
Arguments:
test -- the name of the test
"""
if os.path.exists("traces"):
files = os.listdir("traces")
for file in files:
if file == '.' or file == '..':
continue
shutil.rmtree(os.path.join("traces", file), ignore_errors=True)
else:
os.mkdir("traces")
mod = __import__(test, globals(), locals(), [])
return mod.run(verbose=(Params.g_options.verbose > 0),
generate=Params.g_options.regression_generate)
+16
View File
@@ -0,0 +1,16 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import sys
import tracediff
def run(verbose, generate):
"""Execute a test."""
if tracediff.env['ENABLE_PYTHON_BINDINGS']:
return tracediff.run_test(verbose, generate,
"csma-bridge", pyscript=os.path.join('examples', 'csma-bridge.py'))
else:
print >> sys.stderr, "Skipping csma-bridge: Python bindings not available."
raise NotImplementedError
+2 -2
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-broadcast")
return tracediff.run_test(verbose, generate, "csma-broadcast")
+2 -2
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-multicast")
return tracediff.run_test(verbose, generate, "csma-multicast")
+2 -2
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "csma-one-subnet")
return tracediff.run_test(verbose, generate, "csma-one-subnet")
+2 -2
View File
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
return tracediff.run_test(verbose, generate,
"csma-packet-socket")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, "csma-ping")
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, "csma-raw-ip-socket")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, "csma-star")
+12
View File
@@ -0,0 +1,12 @@
#! /usr/bin/env python
"""Generic trace-comparison-type regression test."""
import os
import shutil
import tracediff
def run(verbose, generate):
"""Execute a test."""
arguments = ["../../../samples/ns2-mob.tr", "out.tr"]
return tracediff.run_test(verbose, generate, "main-ns2-mob", arguments=arguments)
+2 -2
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "realtime-udp-echo")
return tracediff.run_test(verbose, generate, "realtime-udp-echo")
+2 -2
View File
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
return tracediff.run_test(verbose, generate,
"simple-error-model")
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
return tracediff.run_test(verbose, generate,
"simple-global-routing")
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
return tracediff.run_test(verbose, generate,
"simple-point-to-point-olsr")
+2 -2
View File
@@ -6,8 +6,8 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName,
return tracediff.run_test(verbose, generate,
"tcp-large-transfer")
+33
View File
@@ -0,0 +1,33 @@
#! /usr/bin/env python
"""Trace-comparison-type regression test for the Network Simulation Cradle."""
import os
import shutil
import sys
import tracediff
import platform
def run(verbose, generate):
"""Run a Network Simulation Cradle test involving two TCP streams."""
if not tracediff.env['ENABLE_NSC']:
print >>sys.stderr, "Skipping tcp-nsc-lfn: NSC not available."
raise NotImplementedError
testName = "tcp-nsc-lfn"
arguments = ["--ns3::OnOffApplication::DataRate=40000", "--runtime=20"]
platform_bits = platform.architecture()[0]
if platform_bits == "64bit":
traceDirName = testName + "_64bit.ref"
elif platform_bits == "32bit":
traceDirName = testName + "_32bit.ref"
else:
# Something unexpected. How should we signal an error here? Rasing a
# string might not be the best idea?
raise "Unknown architecture, not 64 or 32 bit?"
return tracediff.run_test(verbose, generate,
testName, arguments=arguments, refTestName=traceDirName)
+3 -3
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "udp-echo")
#print tracediff.env
return tracediff.run_test(verbose, generate, "udp-echo")
+2 -2
View File
@@ -6,7 +6,7 @@ import os
import shutil
import tracediff
def run(verbose, generate, refDirName):
def run(verbose, generate):
"""Execute a test."""
return tracediff.run_test(verbose, generate, refDirName, "wifi-wired-bridging", "--SendIp=0")
return tracediff.run_test(verbose, generate, "wifi-wired-bridging", ["--SendIp=0"])
+38
View File
@@ -0,0 +1,38 @@
#include "ns3/core-module.h"
#include "ns3/mobility-module.h"
#include "ns3/simulator-module.h"
#include "ns3/helper-module.h"
#include "ns3/mobility-module.h"
#include <iostream>
#include <fstream>
using namespace ns3;
static void
CourseChange (std::ostream *os, std::string foo, Ptr<const MobilityModel> mobility)
{
Vector pos = mobility->GetPosition ();
Vector vel = mobility->GetVelocity ();
*os << Simulator::Now () << " POS: x=" << pos.x << ", y=" << pos.y
<< ", z=" << pos.z << "; VEL:" << vel.x << ", y=" << vel.y
<< ", z=" << vel.z << std::endl;
}
int main (int argc, char *argv[])
{
Ns2MobilityHelper mobility(argv[1]);
std::ofstream os;
os.open (argv[2]);
NodeContainer stas;
stas.Create (1);
mobility.Install ();
Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange",
MakeBoundCallback (&CourseChange, &os));
Simulator::Stop (Seconds (10.0));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
+2 -3
View File
@@ -30,7 +30,6 @@ PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min,
Ptr<StaticMobilityModel> a = CreateObject<StaticMobilityModel> ();
Ptr<StaticMobilityModel> b = CreateObject<StaticMobilityModel> ();
Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
Ptr<PropagationLossModel> model = log;
@@ -51,8 +50,8 @@ PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min,
int main (int argc, char *argv[])
{
Config::SetGlobal ("LogDistancePropagationLossModel::ReferenceDistance", StringValue ("1.0"));
Config::SetGlobal ("LogDistancePropagationLossModel::Exponent", StringValue ("4"));
Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceDistance", StringValue ("1.0"));
Config::SetDefault ("ns3::LogDistancePropagationLossModel::Exponent", StringValue ("4"));
PrintOne (-10, 20, 5, 0, 10000, 2);
+133
View File
@@ -0,0 +1,133 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/simulator.h"
#include "ns3/realtime-simulator-impl.h"
#include "ns3/nstime.h"
#include "ns3/log.h"
#include "ns3/system-thread.h"
#include "ns3/string.h"
#include "ns3/config.h"
#include "ns3/global-value.h"
#include "ns3/ptr.h"
#include <unistd.h>
#include <sys/time.h>
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("TestSync");
bool gFirstRun = false;
void
inserted_function (void)
{
NS_ASSERT (gFirstRun);
NS_LOG_UNCOND ("inserted_function() called at " <<
Simulator::Now ().GetSeconds () << " s");
}
void
background_function (void)
{
NS_ASSERT (gFirstRun);
NS_LOG_UNCOND ("background_function() called at " <<
Simulator::Now ().GetSeconds () << " s");
}
void
first_function (void)
{
NS_LOG_UNCOND ("first_function() called at " <<
Simulator::Now ().GetSeconds () << " s");
gFirstRun = true;
}
class FakeNetDevice
{
public:
FakeNetDevice ();
void Doit3 (void);
void Doit4 (void);
};
FakeNetDevice::FakeNetDevice ()
{
NS_LOG_FUNCTION_NOARGS ();
}
void
FakeNetDevice::Doit3 (void)
{
NS_LOG_FUNCTION_NOARGS ();
sleep (1);
for (uint32_t i = 0; i < 10000; ++i)
{
//
// Exercise the realtime relative now path
//
DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtimeNow (MakeEvent (&inserted_function));
usleep (1000);
}
}
void
FakeNetDevice::Doit4 (void)
{
NS_LOG_FUNCTION_NOARGS ();
sleep (1);
for (uint32_t i = 0; i < 10000; ++i)
{
//
// Exercise the realtime relative schedule path
//
DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtime (Seconds (0), MakeEvent (&inserted_function));
usleep (1000);
}
}
void
test (void)
{
GlobalValue::Bind ("SimulatorImplementationType",
StringValue ("ns3::RealtimeSimulatorImpl"));
FakeNetDevice fnd;
//
// Make sure ScheduleNow works when the system isn't running
//
DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtimeNow(MakeEvent (&first_function));
//
// drive the progression of m_currentTs at a ten millisecond rate from the main thread
//
for (double d = 0.; d < 14.999; d += 0.01)
{
Simulator::Schedule (Seconds (d), &background_function);
}
Ptr<SystemThread> st3 = Create<SystemThread> (
MakeCallback (&FakeNetDevice::Doit3, &fnd));
st3->Start ();
Ptr<SystemThread> st4 = Create<SystemThread> (
MakeCallback (&FakeNetDevice::Doit4, &fnd));
st4->Start ();
Simulator::Stop (Seconds (15.0));
Simulator::Run ();
st3->Join ();
st4->Join ();
Simulator::Destroy ();
}
int
main (int argc, char *argv[])
{
while (true)
{
test ();
}
}
+7
View File
@@ -0,0 +1,7 @@
$node_(0) set X_ 0.0
$node_(0) set Y_ 25.0
$node_(0) set Z_ 0.0
$ns_ at 3.0 "$node_(0) setdest 25 0 0"
$ns_ at 4.8 "$node_(0) setdest 0 0 0"
$ns_ at 5.0 "$node_(0) setdest 25 0 0"
+7
View File
@@ -19,6 +19,9 @@ def build(bld):
obj = bld.create_ns3_program('main-test')
obj.source = 'main-test.cc'
obj = bld.create_ns3_program('main-test-sync')
obj.source = 'main-test-sync.cc'
obj = bld.create_ns3_program('main-simple',
['node', 'internet-stack', 'onoff'])
obj.source = 'main-simple.cc'
@@ -39,4 +42,8 @@ def build(bld):
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'main-propagation-loss.cc'
obj = bld.create_ns3_program('main-ns2-mob',
['core', 'simulator', 'mobility', 'wifi'])
obj.source = 'main-ns2-mob.cc'
+8 -1
View File
@@ -147,7 +147,14 @@ void OnOffApplication::StopApplication() // Called at time specified by Stop
NS_LOG_FUNCTION_NOARGS ();
CancelEvents ();
m_socket->Close ();
if(m_socket != 0)
{
m_socket->Close ();
}
else
{
NS_LOG_WARN("OnOffApplication found null socket to close in StopApplication");
}
}
void OnOffApplication::CancelEvents ()
+1 -1
View File
@@ -87,7 +87,7 @@ void PacketSink::StartApplication() // Called at time specified by Start
{
m_socket = Socket::CreateSocket (GetNode(), m_tid);
m_socket->Bind (m_local);
m_socket->Listen (0);
m_socket->Listen ();
}
m_socket->SetRecvCallback (MakeCallback(&PacketSink::HandleRead, this));

Some files were not shown because too many files have changed in this diff Show More