On 5/11/21 12:19 PM, Brian O'Neill wrote:
> Hi,
>
> I'm still very new to ns3 myself, but for getting started a new
> protocol I ran ./utils/create-module.py contrib/new-module to create
> the structure you hinted at with the helper example etc. and then I
> turned that new-module folder into a git repository for versioning.
> Here's the man page on that
> method:
https://www.nsnam.org/docs/manual/html/new-modules.html
>
> However, you also have the option to only create a .cc file in the
> scratch folder which will be compiled without any additional work.
>
> So, my understanding is that both are options for getting started.
Yes, with the caveat that one can create more than a single .cc in the
scratch folder. This is not well documented, but if you create a
subfolder in scratch and put multiple .cc and .h files there, with one
of the .cc files containing a main(), Waf will build and link all of
them together and you can run by specifying the name of the subdirectory.
However, for a new model or protocol, I never use scratch for this, I
create a new module, as described here:
https://www.nsnam.org/docs/manual/html/new-modules.html
- Tom