# HG changeset patch # User Mitch Watrous # Date 1305315448 25200 # Node ID b55a5876af9a29ba8f03a7644dfd22526393107c # Parent 316d93dd93756a03df9c57b1fd66d4440727bbb1 More edits for manual chapter about adding new modules diff -r 316d93dd9375 -r b55a5876af9a doc/manual/source/new-modules.rst --- a/doc/manual/source/new-modules.rst Fri May 13 15:02:36 2011 -0400 +++ b/doc/manual/source/new-modules.rst Fri May 13 12:37:28 2011 -0700 @@ -36,8 +36,8 @@ Not all directories will be present in each module. -Step 2 - Copy the template module -********************************* +Step 2 - Create your new module based on the template module +************************************************************ The template module :: @@ -55,6 +55,24 @@ and replace all of the occurrences of "template" in this wscript file with the name of your new module, i.e. "new-module" for our assumed module name. +You will also need to specify the |ns3| modules your new module will +depend on. Let's assume that "new-module" depends on the internet, +mobility, and aodv modules. Then the call to the function that will +create this module should look like this when you are done with this +step: :: + + module = bld.create_ns3_module('new-module', ['internet', 'mobility', 'aodv']) + +As an example, the dependencies for the spectrum module are specified +in :: + + src/spectrum/wscript + +with the following function call: :: + + module = bld.create_ns3_module('spectrum', ['internet', 'propagation', + 'applications']) + If your module will have model source files, then create the following directory where they will go: :: mkdir src/new-module/model @@ -67,6 +85,11 @@ Copy all of your module's helper source files to the above directory. +If your module will have tests, then copy all of your module's test files to the following directory: :: + + mkdir src/new-module/test + + Step 3 - Specify your module's source files ******************************************* @@ -82,13 +105,7 @@ src/spectrum/wscript -with the following function call and list -of source files. Note that the second argument for the function -create_ns3_module() is the list of modules that the module being created -depends on: :: - - module = bld.create_ns3_module('spectrum', ['internet', 'propagation', - 'applications']) +with the following list of source files: :: module.source = [ 'model/spectrum-model.cc', @@ -264,7 +281,7 @@ Step 8 - Add your module to the list on |ns3| modules -**************************************************** +***************************************************** Your new module must be added to the current list of |ns3| modules by modifying the following wscript file with your text editor: ::