diff --git a/.codespellrc b/.codespellrc index d63e5cad7..b3a6c0d58 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,5 +1,5 @@ [codespell] -skip = .git,.gitlab-ci-local,*.eps,*.pdf,*.css_t,AUTHORS,*build*,*.mob +skip = .git,.gitlab-ci-local,*.eps,*.pdf,*.css_t,AUTHORS,*build*,*.mob,./cmake-*,./venv ignore-words = ./utils/codespell-ignored-words exclude-file = ./utils/codespell-ignored-lines regex = (?> $GITHUB_ENV - name: Restore ccache id: ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .ccache key: ubuntu-ci-${{env.time}} @@ -47,59 +47,12 @@ jobs: if: env.cache_misses != '0' run: python3 test.py --no-build - CodeQL: - runs-on: ubuntu-latest - needs: Ubuntu - if: ${{ (needs.Ubuntu.outputs.cache_misses != '0') && (github.repository == 'nsnam/ns-3-dev-git') }} - strategy: - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: 'cpp' - - name: Install required packages - run: | - sudo apt-get update - sudo apt-get -y install apt-utils - sudo apt-get -y install git gcc g++ cmake python3 make ninja-build - sudo apt-get -y install tcpdump libgsl-dev libxml2-dev - sudo apt-get -y install curl unzip tar - sudo apt-get -y install ccache - - name: Get timestamp - id: time - run: python3 -c "from datetime import datetime; print('time='+datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))" >> $GITHUB_ENV - - name: Restore ccache - id: ccache - uses: actions/cache@v3 - with: - path: .ccache - key: ubuntu-codeql-${{env.time}} - restore-keys: ubuntu-codeql- - - name: Setup ccache - run: | - ccache --set-config=cache_dir="$GITHUB_WORKSPACE/.ccache" - ccache --set-config=max_size=400M - ccache --set-config=compression=true - ccache -z - - name: Configure CMake - run: | - ./ns3 configure -d release --enable-asserts --enable-examples --enable-tests --disable-werror -G"Ninja" - - name: Build ns-3 - run: | - ./ns3 build - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - Codecov: runs-on: ubuntu-latest needs: Ubuntu if: needs.Ubuntu.outputs.cache_misses != '0' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install required packages run: | sudo apt-get update @@ -114,7 +67,7 @@ jobs: run: python3 -c "from datetime import datetime; print('time='+datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))" >> $GITHUB_ENV - name: Restore ccache id: ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .ccache key: ubuntu-coverage-${{env.time}} @@ -150,7 +103,7 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: msys2/setup-msys2@v2 - name: Install required msys2/mingw64 packages run: | @@ -174,7 +127,7 @@ jobs: run: python3 -c "from datetime import datetime; print('time='+datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))" >> $GITHUB_ENV - name: Restore ccache id: ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .ccache key: msys2-${{env.time}} @@ -201,9 +154,12 @@ jobs: run: python3 test.py --no-build Mac_OS_X: - runs-on: macos-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-latest, macos-12 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install required packages run: | brew install ninja cmake ccache libxml2 gsl open-mpi #qt5 @@ -212,7 +168,7 @@ jobs: run: python3 -c "from datetime import datetime; print('time='+datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))" >> $GITHUB_ENV - name: Restore ccache id: ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .ccache key: osx_brew-ci-${{env.time}} diff --git a/AUTHORS b/AUTHORS index 573414e17..cafc1a638 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,12 +30,14 @@ Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu) Apoorva Bhargava (apoorvabhargava13@gmail.com) Avakash Bhat (avakash261@gmail.com) Kavya Bhat (kavyabhat@gmail.com) +Sanjay Bhat (sanjubhat2004@gmail.com) Raj Bhattacharjea (raj.b@gatech.edu) Mathew Bielejeski (bielejeski1@llnl.gov) Timo Bingmann (timo.bingmann@student.kit.edu) Doug Blough (doug.blough@gatech.edu) Julien Boite (juboite@gmail.com) Biljana Bojovic (bbojovic@cttc.es) +Andreas Boltres (andreas.boltres@partner.kit.edu) Elena Borovkova (borokovaes@iitp.ru) Rahul Bothra (rrbothra@gmail.com) Caleb Bowers (caleb.bowers@nel.navy.mil, cbowers1020@gmail.com) @@ -44,7 +46,6 @@ Matthew Bradbury (matt-bradbury@live.co.uk) Dan Broyles (muxman@sbcglobal.net) Jonathan Brugge (j.d.brugge@student.utwente.nl) Junling Bu (linlinjavaer@gmail.com) -Alessio Bugetti (alessiobugetti98@gmail.com) Elena Buchatskaia (borovkovaes@iitp.ru) Alessio Bugetti (alessiobugetti98@gmail.com) Nuno Cardoso (nunopcardoso@gmail.com) @@ -76,6 +77,7 @@ Christophe Delahaye (christophe.delahaye@orange.com) Sébastien Deronne (sebastien.deronne@gmail.com) Ameya Deshpande (ameyanrd@outlook.com) Zhiheng Dong (dzh2077@gmail.com) +@donghuiyong at GitLab.com Christoph Döpmann (doepmanc@informatik.hu-berlin.de) Jordan Dorham (dorham1@llnl.gov) Craig Dowell (craigdo@ee.washington.edu) @@ -96,8 +98,10 @@ Piotr Gawlowicz (gawlowicz.p@gmail.com) Eric Gamess (egamess@gmail.com) Shiva Gantha (ganthashiva@gmail.com) Yida Gao (yidapb@gmail.com) +Vikas Gaur (vikasgaurdws@gmail.com) Thomas Geithner (thomas.geithner@dai-labor.de) Ashim Ghosh (ashim.atiit@gmail.com) +@Ghostyhands at GitLab.com Martin Giachino (martin.giachino@gmail.com,giachino@fing.edu.uy) Nichit Bodhak Goel (nichit93@gmail.com) Tom Goff (tgoff@tgoff.net) @@ -144,6 +148,7 @@ Chandrakant Jena (chandrakant.barcelona@gmail.com) Liu Jian (liujatp@gmail.com) Sascha Alexander Jopen (jopen@informatik.uni-bonn.de) Piotr Jurkiewicz (piotr.jerzy.jurkiewicz@gmail.com) +Kakadus1 (j.dittrich2303@gmail.com) Evgeny Kalishenko (ydginster@gmail.com) Raghuram Kannan (raghuramkannan40@gmail.com) Vignesh Kannan (vignesh2496@gmail.com) @@ -152,6 +157,7 @@ Tanmay Kathpalia (tanmay.kathpalia@landisgyr.com) Konstantinos Katsaros (dinos.katsaros@gmail.com) Bhaskar Kataria (www.bhaskar.com7@gmail.com) Nils Kattenbeck (nils.kattenbeck@rwth-aachen.de) +Nakayama Kenjiro (nakayamakenjiro@gmail.com) Morteza Kheirkhah (m.kheirkhah@sussex.ac.uk) Jörg Christian Kirchhof (christian.kirchhof@rwth-aachen.de) Ohad Klausner @@ -261,6 +267,7 @@ Manoj Kumar Rana (manoj24.rana@gmail.com) Andrea Ranieri (andreran@uno.it) Bruno Ranieri (Yrrsinn@googlemail.com) Deepti Rajagopal (deeptir96@gmail.com) +Satyarth Ratnani (satyarthratnani@gmail.com) Varun Reddy (varunamarreddy@gmail.com) Ken Renard (kenneth.renard@arl.army.mil) Getachew Redieteab (getachew.redieteab@orange.com) @@ -270,7 +277,7 @@ Jakub Rewienski (jrewienski@gmail.com) Matias Richart (mrichart@fing.edu.uy) George F. Riley (riley@ece.gatech.edu) Juergen Rinas (jrinas@gmx.de) -Robert-ML +@Robert-ML at GitLab.com Sebastian Rohde (sebastian.rohde@tu-dortmund.de) Karsten Roscher (sfx@rocktale.de) Ali Rostami (a.rostami@rutgers.edu) @@ -300,6 +307,7 @@ Muyuan Shen (shmy315@gmail.com) Guowang Shi (shiguowang2007@gmail.com) Phillip Sitbon (phillip.sitbon@gmail.com) Pedro Silva (pmms@inesctec.pt) +Aniket Singh (aniketsingh84646@gmail.com) Siddharth Singh (siddharth12375@gmail.com) Anirudh Sivaraman (sk.anirudh@gmail.com) Steven Smith (smith84@llnl.gov) @@ -313,6 +321,7 @@ Ewgenij Starostin (estar@cs.tu-berlin.de) Greg Steinbrecher (grs@fb.com) YunQiang Su (wzssyqa@gmail.com) Brian Swenson (bswenson3@gatech.edu) +Jay C. Surani (jaysurani333@gmail.com) Lalith Suresh (suresh.lalith@gmail.com) Szymon Szott (szott@kt.agh.edu.pl) Mohit P. Tahiliani (tahiliani.nitk@gmail.com) @@ -331,6 +340,7 @@ Quincy Tse (quincy.tse@gmail.com) Frederic Urbani (frederic.urbani@inria.fr) Andras Varga (andras@omnetpp.org) Shrinidhi Anil Varna (shrinidhi99.varna@gmail.com) +Silviu-Leonard Vatamanelu (silviu48vatamanelu@gmail.com) Sebastien Vincent (vincent@clarinet.u-strasbg.fr) Guillaume Vu-Brugier (gvubrugier@gmail.com) Tom Wambold (tom5760@gmail.com) @@ -343,6 +353,7 @@ Florian Westphal (fw@strlen.de) He Wu (mdzz@u.washington.edu) Xiuchao Wu (xiuchao@amazon.com) Aron Wussler (aron@wussler.it) +wzfelix Heran Yang (heran55@126.com) Yoshihiko Yazawa (yoshiyaz@gmail.com) Menglei Zhang (menglei@nyu.edu) diff --git a/CHANGES.md b/CHANGES.md index eced4b4b2..ba16b292b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,49 @@ Note that users who upgrade the simulator across versions, or who work directly This file is a best-effort approach to solving this issue; we will do our best but can guarantee that there will be things that fall through the cracks, unfortunately. If you, as a user, can suggest improvements to this file based on your experience, please contribute a patch or drop us a note on ns-developers mailing list. +Changes from ns-3.42 to ns-3.43 +------------------------------- + +### New API + +* (applications) A new trace source `BulkSendApplication::TcpRetransmission` has been added for tracing TCP retranmissions. +* (core) Added `LaplacianRandomVariable` class implementing the Laplacian random variable, and `LargestExtremeValueRandomVariable` class implementing the Largest Extreme Value random variable. +* (lr-wpan) Added a new test to `lr-wpan-cca-test.cc` suite. The added test demonstrates a known CCA vulnerability window. +* (tcp) A new trace source `TcpSocketBase::LastRtt` has been added for tracing the last RTT sample observed. The existing trace source `TcpSocketBase::Rtt` is still providing the smoothed RTT, although it had been incorrectly documented as providing the last RTT. +* (wifi) Added a new trace source to `WifiPhy`: **PhyRxMacHeaderEnd**, which is fired when the reception of the MAC header of an MPDU is completed and provides the MAC header and the remaining PSDU duration. The trace source is actually fired when the new **NotifyMacHdrRxEnd** attribute of `WifiPhy` is set to true (it is set to false by default). +* (wifi) WifiHelper::SetStandard() method now accepts selected string values in addition to enum argument. +* (wifi) Added a new method **SetPcapCaptureType** to `WifiPhyHelper` to control how PCAPs are generated for MLD devices. + +### Changes to existing API + +* (core) Deprecated struct `TypeTraits`. Functionality provided by the standard library header `` should be used instead. +* (core) Add `AddDeprecatedName` to TypeId. This allows for TypeIds to transition to name TypeIds that use namespaces while still supporting the old name. +* (energy) Energy module TypeId now uses the name that includes the namespace `ns3::energy`, the old name is now deprecated. +* (energy) Documentation was extended and reformatted. +* (lr-wpan) Lr-wpan module TypeId now uses the name that includes the namespace `ns3::lrwpan`, the old name is now deprecated. +* (lr-wpan) Attribute `macBeaconPayload` in `MacPibAttributes` is now a std::vector instead of a packet pointer. +* (lr-wpan) Removes the word `address` from the MAC address prefix when `LOG_PREFIX_FUNC` is used. +* (lr-wpan) Removes the word `address` from the CSMA-CA logs prefix when `LOG_PREFIX_FUNC` is used. +* (lr-wpan) Added `AssignStreams` function to the MAC. +* (lr-wpan) Attribute `macRxOnWhenIdle` added to the supported attributes in `MacPibAttributes`. +* (lr-wpan) Attribute `macPromiscuousMode` added to the supported attributes in `MacPibAttributes`. +* (lr-wpan) Attribute `macAssociatePermit` added to the supported attributes in `MacPibAttributes`. +* (lr-wpan) Attribute `pCurrentChannel` added to the supported attributes in `MacPibAttributes`. +* (lr-wpan) Attribute `pCurrentPage` added to the supported attributes in `MacPibAttributes`. +* (lr-wpan) Documentation was extended and reformatted. +* (wifi) The `WifiHelper::AssignStreams()` method has been made static. +* (wifi) Attribute `ChannelSettings` has been changed to allow configuration of non-contiguous operating channels by specifying each 80 MHz segment. It has changed from TupleValue to AttributeContainerValue, but the configuration of contiguous channels using a StringValue still works as before. + +### Changes to build system + +* Module libraries targets names have their "lib" prefixes removed. This affects target selection within IDEs and ns-3 importing via CMake. + +### Changed behavior + +* (lr-wpan) Beacons are now transmitted using CSMA-CA when requested from a beacon request command. +* (lr-wpan) Upon a beacon request command, beacons are transmitted after a jitter to reduce the probability of collisions. +* (tcp) TCP Proportional Rate Reduction (PRR) recovery has been aligned to the updates in draft-ietf-tcpm-prr-rfc6937bis + Changes from ns-3.41 to ns-3.42 ------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fd9b0114..b704ec107 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,9 @@ project(NS3 CXX C) file(STRINGS VERSION NS3_VER) # minimum compiler versions -set(AppleClang_MinVersion 11.0.0) -set(Clang_MinVersion 10.0.0) -set(GNU_MinVersion 9.1.0) +set(AppleClang_MinVersion 13.1.6) +set(Clang_MinVersion 11.0.0) +set(GNU_MinVersion 10.1.0) # common options option(NS3_ASSERT "Enable assert on failure" OFF) @@ -60,6 +60,11 @@ option(NS3_FAST_LINKERS "Use Mold or LLD to speed up linking if available" ON) option(NS3_FETCH_OPTIONAL_COMPONENTS "Fetch Brite, Click and Openflow dependencies" OFF ) +option( + NS3_FORCE_LOCAL_DEPENDENCIES + "Only search applications, headers, libraries on explicitly set directories" + OFF +) option(NS3_GSL "Build with GSL support" ON) option(NS3_GTK3 "Build with GTK3 support" ON) option(NS3_LINK_TIME_OPTIMIZATION "Build with link-time optimization" OFF) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e869dfd2..8470c4b22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,12 @@ *This file is heavily inspired by Atom's [CONTRIBUTING.md file](https://raw.githubusercontent.com/atom/atom/master/CONTRIBUTING.md).* +ns-3 is a free, open source software project that welcomes contributions from users worldwide. + The following is a set of guidelines for contributing to ns-3, which are hosted in the [nsnam organization](https://gitlab.com/nsnam) on GitLab.com. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a merge request. +The full documentation about how to contribute to ns-3 is available in the [ns-3 Contributing Code](http://www.nsnam.org/developers/contributing-code) website. + ## Table Of Contents * [I do not want to read this whole thing, I just have a question](#i-do-not-want-to-read-this-whole-thing-i-just-have-a-question) @@ -156,10 +160,11 @@ While the prerequisites above must be satisfied prior to having your merge reque ### Git Commit Messages -* Use the present tense ("Add feature" not "Added feature") -* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +* Use the present tense (e.g., "Add feature" not "Added feature") +* Use the imperative mood (e.g., "Move cursor to..." not "Moves cursor to...") * Limit the first line to 72 characters or less -* Reference issues in the first line, by prepending `[#issue]` +* Reference the modules edited in the commit, except if the change applies to many modules (e.g., "core, network: ...") +* If a commit fixes an issue, add "(fixes #issue)" to the commit message (e.g., "core: (fixes #issue) ...") ### C++ Styleguide diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt new file mode 100644 index 000000000..086d3992c --- /dev/null +++ b/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,11 @@ +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/GPL-2.0-only.txt b/LICENSES/GPL-2.0-only.txt new file mode 100644 index 000000000..17cb28643 --- /dev/null +++ b/LICENSES/GPL-2.0-only.txt @@ -0,0 +1,117 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice diff --git a/LICENSES/GPL-2.0-or-later.txt b/LICENSES/GPL-2.0-or-later.txt new file mode 100644 index 000000000..17cb28643 --- /dev/null +++ b/LICENSES/GPL-2.0-or-later.txt @@ -0,0 +1,117 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + This 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a28d6d482..719e70102 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -13,6 +13,87 @@ a [GitLab.com issue tracker](https://gitlab.com/nsnam/ns-3-dev/-/issues) number, and references prefixed by '!' refer to a [GitLab.com merge request](https://gitlab.com/nsnam/ns-3-dev/-/merge_requests) number. +Release 3.43 +------------ + +This release is mainly a maintenance release and the API is generally +consistent with the previous ns-3.42 release. See the file CHANGES.md +for changed model behavior and build system aspects. The GPLv2 license +identifiers in the headers of each file have been changed to use SPDX +identifiers. The minimum GCC version supported is now version 10.1. + +### Availability + +This release is available from: + + +### Supported platforms + +This release is intended to work on systems with the following minimal +requirements (Note: not all ns-3 features are available on all systems): + +- g++-10.1 or later, or LLVM/clang++-11 or later +- Python 3.8 or later +- CMake 3.13 or later +- (macOS only) Xcode 13.1.6 or later +- (Windows only) Msys2/MinGW64 and Msys2/UCRT64 toolchains or WSL2 + +Python API requires [Cppyy](https://cppyy.readthedocs.io/en/latest/installation.html) and has only +been tested on Linux. As of this release, the latest known version to work with ns-3 is cppyy==3.1.2. + +The required Doxygen version for documentation generation is version 1.11. + +### New user-visible features + +- (applications) !2027 - BulkSendApplication: Added TCP retransmission trace consuming TcpSocketBase's TCP retransmission trace +- (core) !1904 - Added support for Laplacian and Largest Extreme Value random variables (`LaplacianRandomVariable`, `LargestExtremeValueRandomVariable`) +- (core) !2018 - `AddDeprecatedName` is now supported in TypeId. +- (energy) !2018 - Energy module now uses the `ns3::energy` namespace in its TypeId. +- (lr-wpan) !2082 - MAC SET GET attributes added +- (lr-wpan) !2123 - CCA vulnerability window test and doc +- (lr-wpan) !2163 - Lr-wpan module now uses the `ns3::lrwpan` namespace in its TypeId. +- (tcp) !2027 - TcpSocketBase: Added TCP retransmission trace +- (tcp) !2059 - Aligns PRR implementation with RFC 6937 bis-08. Added a new param `isDupAck` to `DoRecovery` method, removed `ReductionBound` attribute from `TcpPrrRecovery`. +- (wifi) !2068 - Introduce use of weak type aliases for quantities representing SI units, +in preparation for future conversion to strongly typed units and quantities +- (wifi) - Added support for 80+80 MHz channel configuration +- (wifi) - It is now possible to control how PCAPs are generated for MLD: either a single PCAP +per device, or a PCAP file per PHY, or a PCAP file per link. By default, a single PCAP is generated per PHY for MLD. The configuration of this parameter has no impact for SLD. + +### Bugs fixed + +- (core) #1118 - Demangle EnumValue typenames for Doxygen +- (core) #1122 - Handle deserializing empty strings in ATTRIBUTE_VALUE_IMPLEMENT +- (config-store, core) #1091 - Fix handling of deprecated and obsolete attributes +- (flow-monitor) #1097 - Add logging of max. and min. packet delay in FlowMonitor +- (lr-wpan) !2001 - Beacon improvements and fixes +- (lr-wpan) !2042 - Beacon improvements and jitter addition +- (mobility) #1101 - Use std::abs() instead of abs() +- (tcp) #1126 - Fix bytesAcked calculation in ProcessAck +- (tcp) #805 - Update NextSeg() conditions for SACK as per RFC +- (tcp) #1011 - Forbid ECN-marking of retransmissions, window probes and pure ACKs +- (tcp) #1043 - Fix BBR incorrect minRtt updates +- (tcp) #1113 - Fix integer overflow on first Hystart event +- (tcp) !2083 - Consider segmentSize send limit while checking cwnd for cwnd rate-limit +- (uan) !2087 - Fix Thorp attenuation formula +- (uan) !2088 - Fix PER calculation of M-QAM +- (uan) !2121 - Wrong Eb/N0 calculation in UanPhyPerCommonModes::CalcPer() +- (uan) !2127 - Fix bug in energy update in UanPhyGen::RxEndEvent() +- (wifi) #1095 - Fix reception of WIFI_MOD_CLASS_HR_DSSS +- (wifi) Avoid firing WifiMac::DroppedMpdu trace twice in some cases +- (wifi) Fix assignment of AIDs to non-AP STAs/MLDs to ensure they are unique +- (wifi) Fix starting Sequence Number when ADDBA Response arrives after timeout +- (wifi) Fix default association manager not properly handling non-AP MLDs not supporting 160 MHz operations +- (wifi) Fix round robin multi-user scheduler sending Basic/BSRP TFs to EMLSR clients using another link +- (wifi) Fix round robin multi-user scheduler sending Basic/BSRP TFs when no TID is mapped in the UL direction +- (wifi) MU scheduler maintains a separate access request timer for each link +- (wifi) Prevent cases where the TX window is stalled in case the ``BaThreshold`` attribute of the default ack manager is non-zero +- (wifi) Fix retrieval of buffer status info from QoS Null frames sent in TB PPDUs in the multi-link case +- (wifi) Avoid repeatedly sending BSRP TF in a TXOP when access is requested by MU scheduler +- (wifi) Fix Txop Link entity swapping in some specific cases +- (wifi) Fix incorrect configuration of wifi-spectrum-saturation-example.cc +- (wifi) Fix output formatting for wifi-spectrum-per-example.cc + Release 3.42 ------------ diff --git a/VERSION b/VERSION index 761e16c13..1c8686e67 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.42 +3.43 diff --git a/build-support/3rd-party/colored-messages.cmake b/build-support/3rd-party/colored-messages.cmake index 0032715a7..14bdc166a 100644 --- a/build-support/3rd-party/colored-messages.cmake +++ b/build-support/3rd-party/colored-messages.cmake @@ -1,3 +1,4 @@ +# cmake-format: off # Copyright (c) 2013 Fraser Hutchison # # This program is free software; you can redistribute it and/or modify it under @@ -12,7 +13,6 @@ # 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 -# cmake-format: off # # Author: Fraser Hutchison # Modified by: Gabriel Ferreira diff --git a/build-support/3rd-party/find-program-hints.cmake b/build-support/3rd-party/find-program-hints.cmake index 61106b9e6..b81957231 100644 --- a/build-support/3rd-party/find-program-hints.cmake +++ b/build-support/3rd-party/find-program-hints.cmake @@ -1,4 +1,5 @@ disable_cmake_warnings() +string(REPLACE ";" "/bin;" syspaths "${CMAKE_SYSTEM_PREFIX_PATH};") set(3RD_PARTY_FIND_PROGRAM_HINTS # find_program HINTS for Doxygen # https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindDoxygen.cmake @@ -18,5 +19,6 @@ set(3RD_PARTY_FIND_PROGRAM_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin" /Applications/Graphviz.app/Contents/MacOS /Applications/Utilities/Graphviz.app/Contents/MacOS + ${syspaths} ) enable_cmake_warnings() diff --git a/build-support/3rd-party/netanim-cmakelists.cmake b/build-support/3rd-party/netanim-cmakelists.cmake index ce72c733a..62f47d557 100644 --- a/build-support/3rd-party/netanim-cmakelists.cmake +++ b/build-support/3rd-party/netanim-cmakelists.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/cmake-format.yaml b/build-support/cmake-format.yaml index 1d2ce71e4..afc2664d2 100644 --- a/build-support/cmake-format.yaml +++ b/build-support/cmake-format.yaml @@ -56,6 +56,14 @@ additional_commands: CMAKE_PACKAGES : '*' EXECUTABLES : '*' PYTHON_PACKAGES : '*' + copy_headers: + kwargs: + PUBLIC_HEADER_OUTPUT_DIR: '1' + DEPRECATED_HEADER_OUTPUT_DIR: '1' + PRIVATE_HEADER_OUTPUT_DIR: '1' + PUBLIC_HEADER_FILES: '*' + DEPRECATED_HEADER_FILES: '*' + PRIVATE_HEADER_FILES: '*' format: tab_size: 2 diff --git a/build-support/custom-modules/ns3-check-dependencies.cmake b/build-support/custom-modules/ns3-check-dependencies.cmake index 37f6a085d..d7dbd631f 100644 --- a/build-support/custom-modules/ns3-check-dependencies.cmake +++ b/build-support/custom-modules/ns3-check-dependencies.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-cmake-package.cmake b/build-support/custom-modules/ns3-cmake-package.cmake index 8b1a7ba09..7d2b118b0 100644 --- a/build-support/custom-modules/ns3-cmake-package.cmake +++ b/build-support/custom-modules/ns3-cmake-package.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-compiler-and-linker-support.cmake b/build-support/custom-modules/ns3-compiler-and-linker-support.cmake index 44426b2d3..c535e65ed 100644 --- a/build-support/custom-modules/ns3-compiler-and-linker-support.cmake +++ b/build-support/custom-modules/ns3-compiler-and-linker-support.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-compiler-workarounds.cmake b/build-support/custom-modules/ns3-compiler-workarounds.cmake index 4386dafd5..73cb77a2f 100644 --- a/build-support/custom-modules/ns3-compiler-workarounds.cmake +++ b/build-support/custom-modules/ns3-compiler-workarounds.cmake @@ -1,16 +1,5 @@ # Copyright (c) 2022 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-configtable.cmake b/build-support/custom-modules/ns3-configtable.cmake index fc4ef9a32..f74a95123 100644 --- a/build-support/custom-modules/ns3-configtable.cmake +++ b/build-support/custom-modules/ns3-configtable.cmake @@ -205,8 +205,8 @@ macro(write_configtable) set(really-enabled-modules ${ns3-libs};${ns3-contrib-libs}) if(${ENABLE_TESTS}) - list(APPEND really-enabled-modules libtest) # test is an object library and - # is treated differently + list(APPEND really-enabled-modules test) # test is an object library and + # is treated differently endif() if(really-enabled-modules) print_formatted_table_with_modules( diff --git a/build-support/custom-modules/ns3-contributions.cmake b/build-support/custom-modules/ns3-contributions.cmake index 77e7dbe63..f5916a11a 100644 --- a/build-support/custom-modules/ns3-contributions.cmake +++ b/build-support/custom-modules/ns3-contributions.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-coverage.cmake b/build-support/custom-modules/ns3-coverage.cmake index 4372bc393..b5c4598d9 100644 --- a/build-support/custom-modules/ns3-coverage.cmake +++ b/build-support/custom-modules/ns3-coverage.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -29,6 +18,7 @@ if(${NS3_COVERAGE}) message(FATAL_ERROR "LCOV is required but it is not installed.") endif() + set(zero_counters) if(${NS3_COVERAGE_ZERO_COUNTERS}) set(zero_counters "--lcov-zerocounters") endif() @@ -43,8 +33,32 @@ if(${NS3_COVERAGE}) add_custom_target( coverage_gcc COMMAND lcov -o ns3.info -c --directory ${CMAKE_BINARY_DIR} ${zero_counters} - COMMAND genhtml ns3.info WORKING_DIRECTORY ${CMAKE_OUTPUT_DIRECTORY}/coverage DEPENDS run_test_py ) + + add_custom_target( + coverage_html + COMMAND genhtml ns3.info + WORKING_DIRECTORY ${CMAKE_OUTPUT_DIRECTORY}/coverage + DEPENDS coverage_gcc + ) + + # Convert lcov results to cobertura (compatible with gitlab) + check_deps(cobertura_deps EXECUTABLES c++filt PYTHON_PACKAGES lcov_cobertura) + if(cobertura_deps) + message( + WARNING + "Code coverage conversion from LCOV to Cobertura requires missing dependencies: ${cobertura_deps}" + ) + else() + add_custom_target( + coverage_cobertura + COMMAND + lcov_cobertura ${CMAKE_OUTPUT_DIRECTORY}/coverage/ns3.info --output + ${CMAKE_OUTPUT_DIRECTORY}/coverage/cobertura.xml --demangle + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + DEPENDS coverage_gcc + ) + endif() endif() diff --git a/build-support/custom-modules/ns3-executables.cmake b/build-support/custom-modules/ns3-executables.cmake index ab4f3ac0e..47d001f89 100644 --- a/build-support/custom-modules/ns3-executables.cmake +++ b/build-support/custom-modules/ns3-executables.cmake @@ -168,8 +168,20 @@ function(scan_python_examples path) return() endif() - # Search for python examples - file(GLOB_RECURSE python_examples ${path}/*.py) + # Search for example scripts in the directory and its immediate children + # directories + set(python_examples) + file(GLOB examples_subdirs LIST_DIRECTORIES TRUE ${path}/*) + foreach(subdir ${path} ${examples_subdirs}) + if(NOT (IS_DIRECTORY ${subdir})) + continue() + endif() + file(GLOB python_examples_subdir ${subdir}/*.py) + list(APPEND python_examples ${python_examples_subdir}) + endforeach() + + # Add example scripts to the list + list(REMOVE_DUPLICATES python_examples) foreach(python_example ${python_examples}) if(NOT (${python_example} MATCHES "examples-to-run")) set(ns3-execs-py "${python_example};${ns3-execs-py}" diff --git a/build-support/custom-modules/ns3-fetch-optional-modules-dependencies.cmake b/build-support/custom-modules/ns3-fetch-optional-modules-dependencies.cmake index 583430995..07d628334 100644 --- a/build-support/custom-modules/ns3-fetch-optional-modules-dependencies.cmake +++ b/build-support/custom-modules/ns3-fetch-optional-modules-dependencies.cmake @@ -85,9 +85,4 @@ macro(add_dependency_to_optional_modules_dependencies) add_dependencies(${libbrite} brite_dep) add_dependencies(${libclick} click_dep) add_dependencies(${libopenflow} openflow_dep) - if(NOT ${XCODE}) - add_dependencies(${libbrite}-obj brite_dep) - add_dependencies(${libclick}-obj click_dep) - add_dependencies(${libopenflow}-obj openflow_dep) - endif() endmacro() diff --git a/build-support/custom-modules/ns3-filter-modules.cmake b/build-support/custom-modules/ns3-filter-modules.cmake index 9c79ace9d..0909d3537 100644 --- a/build-support/custom-modules/ns3-filter-modules.cmake +++ b/build-support/custom-modules/ns3-filter-modules.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-find-external-library.cmake b/build-support/custom-modules/ns3-find-external-library.cmake index 1d7506310..018279014 100644 --- a/build-support/custom-modules/ns3-find-external-library.cmake +++ b/build-support/custom-modules/ns3-find-external-library.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -111,6 +100,9 @@ function(find_external_library) # directories $ENV{PATH} # Search for libraries in PATH directories ) + if(library_search_paths) + list(REMOVE_DUPLICATES library_search_paths) + endif() enable_cmake_warnings() # cmake-format: off # @@ -223,6 +215,9 @@ function(find_external_library) # ns-3-dev/build ${CMAKE_INSTALL_PREFIX} # Search for headers in the install ) + if(header_search_paths) + list(REMOVE_DUPLICATES header_search_paths) + endif() set(not_found_headers) set(include_dirs) diff --git a/build-support/custom-modules/ns3-hidden-settings.cmake b/build-support/custom-modules/ns3-hidden-settings.cmake index e10976f51..d683a8b38 100644 --- a/build-support/custom-modules/ns3-hidden-settings.cmake +++ b/build-support/custom-modules/ns3-hidden-settings.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-lock.cmake b/build-support/custom-modules/ns3-lock.cmake index e28a493e3..84f4c6eac 100644 --- a/build-support/custom-modules/ns3-lock.cmake +++ b/build-support/custom-modules/ns3-lock.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -126,6 +115,8 @@ function(write_lock) set(lock_filename .lock-ns3_darwin_build) elseif(WIN32) set(lock_filename .lock-ns3_win32_build) + elseif(BSD) + set(lock_filename .lock-ns3_bsd_build) else() message(FATAL_ERROR "Platform not supported") endif() diff --git a/build-support/custom-modules/ns3-module-macros.cmake b/build-support/custom-modules/ns3-module-macros.cmake index a64790840..c413faf99 100644 --- a/build-support/custom-modules/ns3-module-macros.cmake +++ b/build-support/custom-modules/ns3-module-macros.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -47,6 +36,40 @@ function(copy_headers_before_building_lib libname outputdir headers visibility) endforeach() endfunction(copy_headers_before_building_lib) +function(copy_headers) + # Argument parsing + set(options) + set(oneValueArgs PUBLIC_HEADER_OUTPUT_DIR DEPRECATED_HEADER_OUTPUT_DIR + PRIVATE_HEADER_OUTPUT_DIR + ) + set(multiValueArgs PUBLIC_HEADER_FILES DEPRECATED_HEADER_FILES + PRIVATE_HEADER_FILES + ) + cmake_parse_arguments( + "CP" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} + ) + if((DEFINED CP_PUBLIC_HEADER_OUTPUT_DIR) AND (DEFINED CP_PUBLIC_HEADER_FILES)) + copy_headers_before_building_lib( + "" "${CP_PUBLIC_HEADER_OUTPUT_DIR}" "${CP_PUBLIC_HEADER_FILES}" public + ) + endif() + if((DEFINED CP_DEPRECATED_HEADER_OUTPUT_DIR) AND (DEFINED + CP_DEPRECATED_HEADER_FILES) + ) + copy_headers_before_building_lib( + "" "${CP_DEPRECATED_HEADER_OUTPUT_DIR}" "${CP_DEPRECATED_HEADER_FILES}" + deprecated + ) + endif() + if((DEFINED CP_PRIVATE_HEADER_OUTPUT_DIR) AND (DEFINED CP_PRIVATE_HEADER_FILES + ) + ) + copy_headers_before_building_lib( + "" "${CP_PRIVATE_HEADER_OUTPUT_DIR}" "${CP_PRIVATE_HEADER_FILES}" private + ) + endif() +endfunction() + function(remove_lib_prefix prefixed_library library) # Check if there is a lib prefix string(FIND "${prefixed_library}" "lib" lib_pos) @@ -129,74 +152,32 @@ function(build_lib) # Add library to a global list of libraries if("${FOLDER}" MATCHES "src") - set(ns3-libs "${lib${BLIB_LIBNAME}};${ns3-libs}" + set(ns3-libs "${BLIB_LIBNAME};${ns3-libs}" CACHE INTERNAL "list of processed upstream modules" ) else() - set(ns3-contrib-libs "${lib${BLIB_LIBNAME}};${ns3-contrib-libs}" + set(ns3-contrib-libs "${BLIB_LIBNAME};${ns3-contrib-libs}" CACHE INTERNAL "list of processed contrib modules" ) endif() - if(NOT ${XCODE}) - # Create object library with sources and headers, that will be used in - # lib-ns3-static and the shared library - add_library( - ${lib${BLIB_LIBNAME}-obj} OBJECT "${BLIB_SOURCE_FILES}" - "${BLIB_HEADER_FILES}" - ) + # Create the module shared library + add_library(${BLIB_LIBNAME} SHARED "${BLIB_SOURCE_FILES}") - if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${BLIB_IGNORE_PCH})) - target_precompile_headers(${lib${BLIB_LIBNAME}-obj} REUSE_FROM stdlib_pch) - endif() + # Set alias + add_library(ns3::${BLIB_LIBNAME} ALIAS ${BLIB_LIBNAME}) - # Create shared library with previously created object library (saving - # compilation time for static libraries) - add_library( - ${lib${BLIB_LIBNAME}} SHARED $ - ) - else() - # Xcode and CMake don't play well when using object libraries, so we have a - # specific path for that - add_library(${lib${BLIB_LIBNAME}} SHARED "${BLIB_SOURCE_FILES}") - - if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${BLIB_IGNORE_PCH})) - target_precompile_headers(${lib${BLIB_LIBNAME}} REUSE_FROM stdlib_pch) - endif() + # Reuse PCH + if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${BLIB_IGNORE_PCH})) + target_precompile_headers(${BLIB_LIBNAME} REUSE_FROM stdlib_pch) endif() - add_library(ns3::${lib${BLIB_LIBNAME}} ALIAS ${lib${BLIB_LIBNAME}}) - # Associate public headers with library for installation purposes - set(config_headers) - if("${BLIB_LIBNAME}" STREQUAL "core") - set(config_headers ${CMAKE_HEADER_OUTPUT_DIRECTORY}/config-store-config.h - ${CMAKE_HEADER_OUTPUT_DIRECTORY}/core-config.h - ) - if(${ENABLE_BUILD_VERSION}) - list(APPEND config_headers - ${CMAKE_HEADER_OUTPUT_DIRECTORY}/version-defines.h - ) - endif() - - # Enable examples as tests suites - if(${ENABLE_EXAMPLES} AND ${ENABLE_TESTS}) - if(NOT ${XCODE}) - target_compile_definitions( - ${lib${BLIB_LIBNAME}}-obj PRIVATE NS3_ENABLE_EXAMPLES - ) - else() - target_compile_definitions( - ${lib${BLIB_LIBNAME}} PRIVATE NS3_ENABLE_EXAMPLES - ) - endif() - endif() - endif() set_target_properties( - ${lib${BLIB_LIBNAME}} + ${BLIB_LIBNAME} PROPERTIES PUBLIC_HEADER - "${BLIB_HEADER_FILES};${BLIB_DEPRECATED_HEADER_FILES};${config_headers};${CMAKE_HEADER_OUTPUT_DIRECTORY}/${BLIB_LIBNAME}-module.h" + "${BLIB_HEADER_FILES};${BLIB_DEPRECATED_HEADER_FILES};${CMAKE_HEADER_OUTPUT_DIRECTORY}/${BLIB_LIBNAME}-module.h" PRIVATE_HEADER "${BLIB_PRIVATE_HEADER_FILES}" RUNTIME_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # set output # directory for @@ -204,35 +185,75 @@ function(build_lib) ) if(${NS3_CLANG_TIMETRACE}) - add_dependencies(timeTraceReport ${lib${BLIB_LIBNAME}}) + add_dependencies(timeTraceReport ${BLIB_LIBNAME}) endif() - # Split ns and non-ns libraries to manage their propagation properly - set(non_ns_libraries_to_link ${CMAKE_THREAD_LIBS_INIT}) + build_lib_reexport_third_party_libraries( + "${BLIB_LIBNAME}" "${BLIB_LIBRARIES_TO_LINK}" + ) - set(ns_libraries_to_link) + # set output name of library + set_target_properties( + ${BLIB_LIBNAME} + PROPERTIES OUTPUT_NAME ns${NS3_VER}-${BLIB_LIBNAME}${build_profile_suffix} + ) - foreach(library ${BLIB_LIBRARIES_TO_LINK}) - remove_lib_prefix("${library}" module_name) + # Export compile definitions as interface definitions, propagating local + # definitions to other modules and scratches + build_lib_export_definitions_as_interface_definitions(${BLIB_LIBNAME}) - # Ignore the case where the library dependency name match the ns-3 module - # since it is most likely is due to brite, click and openflow collisions. - # All the ns-3 module targets should be prefixed with 'lib' to be - # differentiable. - if("${library}" STREQUAL "${BLIB_LIBNAME}") - list(APPEND non_ns_libraries_to_link ${library}) - continue() - endif() + # Write a module header that includes all headers from that module + write_module_header("${BLIB_LIBNAME}" "${BLIB_HEADER_FILES}") - # Check if the module exists in the ns-3 modules list or if it is a - # 3rd-party library - if(${module_name} IN_LIST ns3-all-enabled-modules) - list(APPEND ns_libraries_to_link ${library}) - else() - list(APPEND non_ns_libraries_to_link ${library}) - endif() - unset(module_name) - endforeach() + # Check if headers actually exist to prevent copying errors during + # installation (includes the module header created above) + build_lib_check_headers(${BLIB_LIBNAME}) + + # Copy all header files to outputfolder/include before each build + copy_headers( + PUBLIC_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + PUBLIC_HEADER_FILES ${BLIB_HEADER_FILES} + DEPRECATED_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + DEPRECATED_HEADER_FILES ${BLIB_DEPRECATED_HEADER_FILES} + PRIVATE_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + PRIVATE_HEADER_FILES ${BLIB_PRIVATE_HEADER_FILES} + ) + + # Scan for C++ and Python examples and return a list of C++ examples (which + # can be set as dependencies of examples-as-test test suites) + build_lib_scan_examples(module_examples) + + # Build tests if requested + build_lib_tests( + "${BLIB_LIBNAME}" "${BLIB_IGNORE_PCH}" "${FOLDER}" "${BLIB_TEST_SOURCES}" + ) + + # Handle package export + install( + TARGETS ${BLIB_LIBNAME} + EXPORT ns3ExportTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/ + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ns3" + PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ns3" + ) + if(${NS3_VERBOSE}) + message(STATUS "Processed ${FOLDER}") + endif() +endfunction() + +function(build_lib_reexport_third_party_libraries libname libraries_to_link) + # Separate ns-3 and non-ns-3 libraries to manage their propagation properly + separate_ns3_from_non_ns3_libs( + "${libname}" "${libraries_to_link}" ns_libraries_to_link + non_ns_libraries_to_link + ) + + set(ns3-external-libs "${non_ns_libraries_to_link};${ns3-external-libs}" + CACHE INTERNAL + "list of non-ns libraries to link to NS3_STATIC and NS3_MONOLIB" + ) if(NOT ${NS3_REEXPORT_THIRD_PARTY_LIBRARIES}) # ns-3 libraries are linked publicly, to make sure other modules can find @@ -259,7 +280,7 @@ function(build_lib) # with NS3_REEXPORT_THIRD_PARTY_LIBRARIES, we export all 3rd-party library # include directories, allowing consumers of this module to include and link # the 3rd-party code with no additional setup - get_target_includes(${lib${BLIB_LIBNAME}} exported_include_directories) + get_target_includes(${libname} exported_include_directories) string(REPLACE "-I" "" exported_include_directories "${exported_include_directories}" @@ -288,39 +309,22 @@ function(build_lib) "${exported_include_directories}" ) endif() - - target_link_libraries( - ${lib${BLIB_LIBNAME}} ${exported_libraries} ${private_libraries} - ) - - if(NOT ${XCODE}) - target_link_libraries( - ${lib${BLIB_LIBNAME}}-obj PRIVATE ${ns_libraries_to_link} - ) - endif() - - # set output name of library - set_target_properties( - ${lib${BLIB_LIBNAME}} - PROPERTIES OUTPUT_NAME ns${NS3_VER}-${BLIB_LIBNAME}${build_profile_suffix} - ) + # Set public and private headers linked to the module library + target_link_libraries(${libname} ${exported_libraries} ${private_libraries}) # export include directories used by this library so that it can be used by # 3rd-party consumers of ns-3 using find_package(ns3) this will automatically # add the build/include path to them, so that they can ns-3 headers with # target_include_directories( - ${lib${BLIB_LIBNAME}} - PUBLIC $ - $ + ${libname} PUBLIC $ + $ INTERFACE ${exported_include_directories} ) +endfunction() - # Export definitions as interface definitions, propagating local definitions - # to other modules and scratches - get_target_property( - target_definitions ${lib${BLIB_LIBNAME}} COMPILE_DEFINITIONS - ) +function(build_lib_export_definitions_as_interface_definitions libname) + get_target_property(target_definitions ${libname} COMPILE_DEFINITIONS) if(${target_definitions} STREQUAL "target_definitions-NOTFOUND") set(target_definitions) endif() @@ -329,167 +333,9 @@ function(build_lib) list(REMOVE_DUPLICATES exported_definitions) list(REMOVE_ITEM exported_definitions "") set_target_properties( - ${lib${BLIB_LIBNAME}} PROPERTIES INTERFACE_COMPILE_DEFINITIONS - "${exported_definitions}" + ${libname} PROPERTIES INTERFACE_COMPILE_DEFINITIONS + "${exported_definitions}" ) - - set(ns3-external-libs "${non_ns_libraries_to_link};${ns3-external-libs}" - CACHE INTERNAL - "list of non-ns libraries to link to NS3_STATIC and NS3_MONOLIB" - ) - if(${NS3_STATIC} OR ${NS3_MONOLIB}) - set(lib-ns3-static-objs - "$;${lib-ns3-static-objs}" - CACHE - INTERNAL - "list of object files from module used by NS3_STATIC and NS3_MONOLIB" - ) - endif() - - # Write a module header that includes all headers from that module - write_module_header("${BLIB_LIBNAME}" "${BLIB_HEADER_FILES}") - - # Check if headers actually exist to prevent copying errors during - # installation - get_target_property(headers_to_check ${lib${BLIB_LIBNAME}} PUBLIC_HEADER) - set(missing_headers) - foreach(header ${headers_to_check}) - if(NOT ((EXISTS ${header}) OR (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) - ) - ) - list(APPEND missing_headers ${header}) - endif() - endforeach() - if(missing_headers) - message( - FATAL_ERROR "Missing header files for ${BLIB_LIBNAME}: ${missing_headers}" - ) - endif() - - # Copy all header files to outputfolder/include before each build - copy_headers_before_building_lib( - ${BLIB_LIBNAME} ${CMAKE_HEADER_OUTPUT_DIRECTORY} "${BLIB_HEADER_FILES}" - public - ) - if(BLIB_PRIVATE_HEADER_FILES) - copy_headers_before_building_lib( - ${BLIB_LIBNAME} ${CMAKE_HEADER_OUTPUT_DIRECTORY} - "${BLIB_PRIVATE_HEADER_FILES}" private - ) - endif() - - if(BLIB_DEPRECATED_HEADER_FILES) - copy_headers_before_building_lib( - ${BLIB_LIBNAME} ${CMAKE_HEADER_OUTPUT_DIRECTORY} - "${BLIB_DEPRECATED_HEADER_FILES}" deprecated - ) - endif() - - # Build lib examples if requested - set(examples_before ${ns3-execs-clean}) - foreach(example_folder example;examples) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) - if(${ENABLE_EXAMPLES}) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}/CMakeLists.txt) - add_subdirectory(${example_folder}) - endif() - endif() - scan_python_examples(${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) - endif() - endforeach() - set(module_examples ${ns3-execs-clean}) - - # Filter only module examples - foreach(example ${examples_before}) - list(REMOVE_ITEM module_examples ${example}) - endforeach() - unset(examples_before) - - # Check if the module tests should be built - set(filtered_in ON) - if(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in OFF) - if(${BLIB_LIBNAME} IN_LIST NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in ON) - endif() - endif() - - # Build tests if requested - if(${ENABLE_TESTS} AND ${filtered_in}) - list(LENGTH BLIB_TEST_SOURCES test_source_len) - if(${test_source_len} GREATER 0) - # Create BLIB_LIBNAME of output library test of module - set(test${BLIB_LIBNAME} lib${BLIB_LIBNAME}-test CACHE INTERNAL "") - - # Create shared library containing tests of the module on UNIX and just - # the object file that will be part of test-runner on Windows - if(WIN32) - set(ns3-libs-tests - "$;${ns3-libs-tests}" - CACHE INTERNAL "list of test libraries" - ) - add_library(${test${BLIB_LIBNAME}} OBJECT "${BLIB_TEST_SOURCES}") - else() - set(ns3-libs-tests "${test${BLIB_LIBNAME}};${ns3-libs-tests}" - CACHE INTERNAL "list of test libraries" - ) - add_library(${test${BLIB_LIBNAME}} SHARED "${BLIB_TEST_SOURCES}") - - # Link test library to the module library - if(${NS3_MONOLIB}) - target_link_libraries( - ${test${BLIB_LIBNAME}} ${LIB_AS_NEEDED_PRE} ${lib-ns3-monolib} - ${LIB_AS_NEEDED_POST} - ) - else() - target_link_libraries( - ${test${BLIB_LIBNAME}} ${LIB_AS_NEEDED_PRE} ${lib${BLIB_LIBNAME}} - "${BLIB_LIBRARIES_TO_LINK}" ${LIB_AS_NEEDED_POST} - ) - endif() - set_target_properties( - ${test${BLIB_LIBNAME}} - PROPERTIES OUTPUT_NAME - ns${NS3_VER}-${BLIB_LIBNAME}-test${build_profile_suffix} - ) - endif() - target_compile_definitions( - ${test${BLIB_LIBNAME}} PRIVATE NS_TEST_SOURCEDIR="${FOLDER}/test" - ) - if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${BLIB_IGNORE_PCH})) - target_precompile_headers(${test${BLIB_LIBNAME}} REUSE_FROM stdlib_pch) - endif() - - # Add dependency between tests and examples used as tests - if(${ENABLE_EXAMPLES}) - foreach(source_file ${BLIB_TEST_SOURCES}) - file(READ ${source_file} source_file_contents) - foreach(example_as_test ${module_examples}) - string(FIND "${source_file_contents}" "${example_as_test}" - is_sub_string - ) - if(NOT (${is_sub_string} EQUAL -1)) - add_dependencies(test-runner-examples-as-tests ${example_as_test}) - endif() - endforeach() - endforeach() - endif() - endif() - endif() - - # Handle package export - install( - TARGETS ${lib${BLIB_LIBNAME}} - EXPORT ns3ExportTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/ - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ - RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ns3" - PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ns3" - ) - if(${NS3_VERBOSE}) - message(STATUS "Processed ${FOLDER}") - endif() endfunction() # cmake-format: off @@ -519,13 +365,7 @@ function(build_lib_example) ) # Check if a module example should be built - set(filtered_in ON) - if(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in OFF) - if(${BLIB_LIBNAME} IN_LIST NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in ON) - endif() - endif() + build_lib_check_examples_and_tests_filtered_in(${BLIB_LIBNAME} filtered_in) if((NOT missing_dependencies) AND ${filtered_in}) # Convert boolean into text to forward argument @@ -540,7 +380,7 @@ function(build_lib_example) SOURCE_FILES ${BLIB_EXAMPLE_SOURCE_FILES} HEADER_FILES ${BLIB_EXAMPLE_HEADER_FILES} LIBRARIES_TO_LINK - ${lib${BLIB_LIBNAME}} ${BLIB_EXAMPLE_LIBRARIES_TO_LINK} + ${BLIB_LIBNAME} ${BLIB_EXAMPLE_LIBRARIES_TO_LINK} ${ns3-optional-visualizer-lib} EXECUTABLE_DIRECTORY_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${FOLDER}/ ${IGNORE_PCH} @@ -549,6 +389,184 @@ function(build_lib_example) endif() endfunction() +# Check if module examples and tests should be built or not +# +# Arguments: libname (e.g. core, wifi), filtered_in (return boolean) +function(build_lib_check_examples_and_tests_filtered_in libname filtered_in) + set(in ON) + if(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) + set(in OFF) + if(${libname} IN_LIST NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) + set(in ON) + endif() + endif() + set(${filtered_in} ${in} PARENT_SCOPE) +endfunction() + +# Separate the LIBRARIES_TO_LINK list into ns-3 modules and external libraries +# +# Arguments: libname (e.g. core, wifi), libraries_to_link (input list), +# ns_libraries_to_link and non_ns_libraries_to_link (output lists) +function(separate_ns3_from_non_ns3_libs libname libraries_to_link + ns_libraries_to_link non_ns_libraries_to_link +) + set(non_ns_libs ${CMAKE_THREAD_LIBS_INIT}) + set(ns_libs) + foreach(library ${libraries_to_link}) + remove_lib_prefix("${library}" module_name) + + # In case the dependency library matches the ns-3 module, we are most likely + # dealing with brite, click and openflow collisions. All the ns-3 module + # targets used to be prefixed with 'lib' to be differentiable, but now we + # are dropping it. To disambiguate them two, we assume these external + # libraries are shared libraries by adding suffixes. + if("${library}" STREQUAL "${libname}") + list(APPEND non_ns_libs ${library}${CMAKE_SHARED_LIBRARY_SUFFIX}) + continue() + endif() + + # Check if the module exists in the ns-3 modules list or if it is a + # 3rd-party library + if(${module_name} IN_LIST ns3-all-enabled-modules) + list(APPEND ns_libs ${library}) + else() + list(APPEND non_ns_libs ${library}) + endif() + unset(module_name) + endforeach() + set(${ns_libraries_to_link} ${ns_libs} PARENT_SCOPE) + set(${non_ns_libraries_to_link} ${non_ns_libs} PARENT_SCOPE) +endfunction() + +# This macro scans for C++ and Python examples for a given module and return a +# list of C++ examples +# +# Arguments: module_cpp_examples = return list of C++ examples +function(build_lib_scan_examples module_cpp_examples) + # Build lib examples if requested + set(examples_before ${ns3-execs-clean}) + foreach(example_folder example;examples) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) + if(${ENABLE_EXAMPLES}) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}/CMakeLists.txt) + add_subdirectory(${example_folder}) + endif() + endif() + scan_python_examples(${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) + endif() + endforeach() + set(module_examples ${ns3-execs-clean}) + + # Return a list of module c++ examples (current examples - previous examples) + list(REMOVE_ITEM module_examples "${examples_before}") + set(${module_cpp_examples} ${module_examples} PARENT_SCOPE) +endfunction() + +# This macro builds the test library for the module library +# +# Arguments: libname (e.g. core), ignore_pch (TRUE/FALSE), folder (src/contrib), +# sources (list of .cc's) +function(build_lib_tests libname ignore_pch folder test_sources) + if(${ENABLE_TESTS}) + # Check if the module tests should be built + build_lib_check_examples_and_tests_filtered_in(${libname} filtered_in) + if(NOT ${filtered_in}) + return() + endif() + list(LENGTH test_sources test_source_len) + if(${test_source_len} GREATER 0) + # Create libname of output library test of module + set(test${libname} ${libname}-test CACHE INTERNAL "") + + # Create shared library containing tests of the module on UNIX and just + # the object file that will be part of test-runner on Windows + if(WIN32) + set(ns3-libs-tests + "$;${ns3-libs-tests}" + CACHE INTERNAL "list of test libraries" + ) + add_library(${test${libname}} OBJECT "${test_sources}") + else() + set(ns3-libs-tests "${test${libname}};${ns3-libs-tests}" + CACHE INTERNAL "list of test libraries" + ) + add_library(${test${libname}} SHARED "${test_sources}") + + # Link test library to the module library + if(${NS3_MONOLIB}) + target_link_libraries( + ${test${libname}} ${LIB_AS_NEEDED_PRE} ${lib-ns3-monolib} + ${LIB_AS_NEEDED_POST} + ) + else() + target_link_libraries( + ${test${libname}} ${LIB_AS_NEEDED_PRE} ${libname} + "${BLIB_LIBRARIES_TO_LINK}" ${LIB_AS_NEEDED_POST} + ) + endif() + set_target_properties( + ${test${libname}} + PROPERTIES OUTPUT_NAME + ns${NS3_VER}-${libname}-test${build_profile_suffix} + ) + endif() + target_compile_definitions( + ${test${libname}} PRIVATE NS_TEST_SOURCEDIR="${folder}/test" + ) + if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${ignore_pch})) + target_precompile_headers(${test${libname}} REUSE_FROM stdlib_pch) + endif() + + # Add dependency between tests and examples used as tests + examples_as_tests_dependencies("${module_examples}" "${test_sources}") + endif() + endif() +endfunction() + +# This macro scans for C++ examples used by examples-as-tests suites +# +# Arguments: module_cpp_examples = list of C++ example executable names, +# module_test_sources = list of C++ sources with tests +function(examples_as_tests_dependencies module_cpp_examples module_test_sources) + if(${ENABLE_EXAMPLES}) + foreach(source_file ${module_test_sources}) + file(READ ${source_file} source_file_contents) + foreach(example_as_test ${module_cpp_examples}) + string(FIND "${source_file_contents}" "${example_as_test}" + is_sub_string + ) + if(NOT (${is_sub_string} EQUAL -1)) + add_dependencies(test-runner-examples-as-tests ${example_as_test}) + endif() + endforeach() + endforeach() + endif() +endfunction() + +# This macro checks if all headers from a module actually exist or are missing +# +# Arguments: target_name = module name (e.g. core, wifi) +function(build_lib_check_headers target_name) + # Retrieve target properties containing the public (which include deprecated) + # and private headers + get_target_property(headers_to_check ${target_name} PUBLIC_HEADER) + get_target_property(headers_to_check2 ${target_name} PRIVATE_HEADER) + list(APPEND headers_to_check ${headers_to_check2}) + set(missing_headers) + foreach(header ${headers_to_check}) + if(NOT ((EXISTS ${header}) OR (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${header}) + ) + ) + list(APPEND missing_headers ${header}) + endif() + endforeach() + if(missing_headers) + message( + FATAL_ERROR "Missing header files for ${target_name}: ${missing_headers}" + ) + endif() +endfunction() + # This macro processes a ns-3 module header file (module_name-module.h) # # Arguments: name = module name (e.g. core, wifi) HEADER_FILES = diff --git a/build-support/custom-modules/ns3-ns3rc-parser.cmake b/build-support/custom-modules/ns3-ns3rc-parser.cmake index c79d5016f..32a3e7a39 100644 --- a/build-support/custom-modules/ns3-ns3rc-parser.cmake +++ b/build-support/custom-modules/ns3-ns3rc-parser.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-output-directory.cmake b/build-support/custom-modules/ns3-output-directory.cmake index 1514b227a..b0965dd18 100644 --- a/build-support/custom-modules/ns3-output-directory.cmake +++ b/build-support/custom-modules/ns3-output-directory.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/custom-modules/ns3-platform-support.cmake b/build-support/custom-modules/ns3-platform-support.cmake index bc83344e5..d640ce228 100644 --- a/build-support/custom-modules/ns3-platform-support.cmake +++ b/build-support/custom-modules/ns3-platform-support.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -28,9 +17,26 @@ if(EXISTS "/proc/version") endif() endif() +# cmake-format: off +# Windows injects **BY DEFAULT** its %PATH% into WSL $PATH +# Detect and warn users how to disable path injection +# cmake-format: on +if("$ENV{PATH}" MATCHES "/mnt/c/") + message( + WARNING + "To prevent Windows path injection on WSL, append the following to /etc/wsl.conf, then use `wsl --shutdown` to restart the WSL VM: +[interop] +appendWindowsPath = false" + ) +endif() + # Set Linux flag if on Linux if(UNIX AND NOT APPLE) - set(LINUX TRUE) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(LINUX TRUE) + else() + set(BSD TRUE) + endif() add_definitions(-D__LINUX__) endif() @@ -64,8 +70,8 @@ else() endif() if(${XCODE}) - # Is that so hard not to break people's CI, AAPL? Why would you output the - # targets to a Debug/Release subfolder? Why? + # Prevent multi-config generators from placing output files into per + # configuration directory foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} diff --git a/build-support/custom-modules/ns3-vcpkg-hunter.cmake b/build-support/custom-modules/ns3-vcpkg-hunter.cmake index 093d5eb94..997ab3904 100644 --- a/build-support/custom-modules/ns3-vcpkg-hunter.cmake +++ b/build-support/custom-modules/ns3-vcpkg-hunter.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2023 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 3808c799c..69fe4164b 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -1,17 +1,6 @@ # Copyright (c) 2017-2021 Universidade de Brasília # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Gabriel Ferreira @@ -92,19 +81,13 @@ macro(SUBDIRLIST result curdir) endmacro() macro(library_target_name libname targetname) - set(${targetname} lib${libname}) + set(${targetname} ${libname}) endmacro() macro(clear_global_cached_variables) # clear cache variables unset(build_profile CACHE) unset(build_profile_suffix CACHE) - set(lib-ns3-static-objs - "" - CACHE - INTERNAL - "list of object files from module used by NS3_STATIC and NS3_MONOLIB" - ) set(ns3-contrib-libs "" CACHE INTERNAL "list of processed contrib modules") set(ns3-example-folders "" CACHE INTERNAL "list of example folders") set(ns3-execs "" CACHE INTERNAL "list of c++ executables") @@ -121,7 +104,6 @@ macro(clear_global_cached_variables) mark_as_advanced( build_profile build_profile_suffix - lib-ns3-static-objs ns3-contrib-libs ns3-example-folders ns3-execs @@ -199,7 +181,8 @@ macro(process_options) set(ENABLE_TESTS OFF) if(${NS3_TESTS} OR ${ns3rc_tests_enabled}) set(ENABLE_TESTS ON) - enable_testing() + # CTest creates a TEST target that conflicts with ns-3 test library + # enable_testing() else() list(REMOVE_ITEM libs_to_build test) endif() @@ -220,6 +203,13 @@ macro(process_options) unset(CMAKE_VERBOSE_MAKEFILE CACHE) endif() + if(${NS3_FORCE_LOCAL_DEPENDENCIES}) + set(CMAKE_FIND_FRAMEWORK NEVER) + set(CMAKE_FIND_APPBUNDLE NEVER) + set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE) + set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH FALSE) + endif() + # Set warning level and warning as errors if(${NS3_WARNINGS}) if(DEFINED MSVC) @@ -319,10 +309,17 @@ macro(process_options) if("${CMAKE_FORMAT_PROGRAM}" STREQUAL "CMAKE_FORMAT_PROGRAM-NOTFOUND") message(${HIGHLIGHTED_STATUS} "Proceeding without cmake-format") else() - file(GLOB_RECURSE MODULES_CMAKE_FILES src/**/CMakeLists.txt - contrib/**/CMakeLists.txt examples/**/CMakeLists.txt - scratch/**/CMakeLists.txt + file( + GLOB + MODULES_CMAKE_FILES + src/**/CMakeLists.txt + contrib/**/CMakeLists.txt + src/**/examples/CMakeLists.txt + contrib/**/examples/CMakeLists.txt + examples/**/CMakeLists.txt + scratch/**/CMakeLists.txt ) + file(GLOB_RECURSE SCRATCH_CMAKE_FILES scratch/**/CMakeLists.txt) file( GLOB INTERNAL_CMAKE_FILES @@ -341,7 +338,7 @@ macro(process_options) COMMAND ${CMAKE_FORMAT_PROGRAM} -c ${PROJECT_SOURCE_DIR}/build-support/cmake-format-modules.yaml -i - ${MODULES_CMAKE_FILES} + ${MODULES_CMAKE_FILES} ${SCRATCH_CMAKE_FILES} ) add_custom_target( cmake-format-check @@ -684,14 +681,6 @@ macro(process_options) "Bindings: python bindings require Python, but it could not be found" ) set(ENABLE_PYTHON_BINDINGS_REASON "missing dependency: python") - elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") - # Warn users that Cppyy on ARM Macs isn't supported yet - message(${HIGHLIGHTED_STATUS} - "Bindings: macOS silicon detected -- see issue 930" - ) - set(ENABLE_PYTHON_BINDINGS_REASON - "macOS silicon detected -- see issue 930" - ) else() check_deps(missing_packages PYTHON_PACKAGES cppyy) if(missing_packages) @@ -1165,7 +1154,11 @@ macro(process_options) set(PLATFORM_UNSUPPORTED_POST "features. Continuing without them.") # Remove from libs_to_build all incompatible libraries or the ones that # dependencies couldn't be installed - if(APPLE OR WSLv1 OR WIN32) + if(APPLE + OR WSLv1 + OR WIN32 + OR BSD + ) set(ENABLE_TAP OFF) set(ENABLE_EMU OFF) set(ENABLE_FDNETDEV FALSE) @@ -1198,7 +1191,6 @@ macro(process_options) set(ns3-all-enabled-modules) set(ns3-libs-tests) set(ns3-contrib-libs) - set(lib-ns3-static-objs) set(ns3-external-libs) foreach(libname ${scanned_modules}) @@ -1398,8 +1390,8 @@ macro(build_example) set(filtered_in ON) if(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) set(filtered_in OFF) - foreach(filtered_module NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - if(${filtered_module} IN_LIST EXAMPLE_LIBRARIES_TO_LINK) + foreach(required_module ${EXAMPLE_LIBRARIES_TO_LINK}) + if(${required_module} IN_LIST NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) set(filtered_in ON) endif() endforeach() diff --git a/build-support/version-defines-template.h b/build-support/version-defines-template.h index 5018cc68f..9a82353ed 100644 --- a/build-support/version-defines-template.h +++ b/build-support/version-defines-template.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathew Bielejeski */ diff --git a/doc/contributing.txt b/doc/contributing.txt deleted file mode 100644 index b8e4b1f68..000000000 --- a/doc/contributing.txt +++ /dev/null @@ -1,7 +0,0 @@ -Contributing to the ns-3 project --------------------------------- - -ns-3 is a free, open source software project that welcomes contributions -from users worldwide. Please see the following web page for how to -contribute: -http://www.nsnam.org/developers/contributing-code/ diff --git a/doc/contributing/source/coding-style.rst b/doc/contributing/source/coding-style.rst index 6bed1d3d4..9d9e80e12 100644 --- a/doc/contributing/source/coding-style.rst +++ b/doc/contributing/source/coding-style.rst @@ -21,6 +21,11 @@ The |ns3| project uses `clang-format `_ +To fix the formatting of files with Git, run the following commands in the |ns3| main directory. +These commands do not change past commits. Instead, the reformatted files are left in the +workspace. These changes should be squashed to the corresponding commits, in order to fix them. + +.. sourcecode:: console + + # Fix all commits of the current branch, relative to the master branch + git clang-format master + + # Fix all staged changes (i.e., changes that have been `git add`ed): + git clang-format + + # Fix all changes staged and unstaged: + git clang-format -f + + # Fix specific files: + git clang-format path_to_file + + # Check what formatting changes are needed (if no files provided, check all staged files): + git clang-format --diff + +Note that this only fixes formatting issues related to clang-format. +For other |ns3| coding style guidelines, read the ``check-style-clang-format.py`` section below. + In addition to Git patches, `clang-format-diff `_ can also be used to reformat existing patches produced with the ``diff`` tool. @@ -121,15 +150,25 @@ source code files. Additionally, it performs other manual checks and fixes in te We recommend running this script over your newly introduced C++ files prior to submission as a Merge Request. -The script has multiple modes of operation. By default, the script checks if -source code files are well formatted, if there are no #include headers from the same -module with the "ns3/" prefix, and text files do not have trailing whitespace -nor tabs. The process returns a zero exit code if all files adhere to these rules. +The script performs multiple style checks. By default, the script runs the following checks: + +* Check code formatting using clang-format. Respects clang-format guards. +* Check if local ``#include`` headers do not use the "ns3/" prefix. Respects clang-format guards. +* Check if there are no trailing whitespace. Always checked. +* Check if there are no tabs. Respects clang-format guards. +* Check if source code files use SPDX licenses rather than GPL license text. Respects clang-format guards. + +The process returns a zero exit code if all files adhere to these rules. If there are files that do not comply with the rules, the process returns a non-zero exit code and lists the respective files. This mode is useful for developers editing their code and for the GitLab CI/CD pipeline to check if the codebase is well formatted. All checks are enabled by default. Users can disable specific checks using the corresponding -flags: ``--no-include-prefixes``, ``--no-formatting``, ``--no-whitespace`` and ``--no-tabs``. +flags: + +* ``--no-formatting`` +* ``--no-include-prefixes`` +* ``--no-whitespace`` +* ``--no-tabs`` Additional information about the formatting issues detected by the script can be enabled by adding the ``-v, --verbose`` flag. @@ -161,8 +200,8 @@ For quick-reference, the most used commands are listed below: # Specific directory or file /path/to/utils/check-style-clang-format.py --fix absolute_or_relative/path/to/directory_or_file - # Modified files - git diff --name-only | xargs ./utils/check-style-clang-format.py --fix + # Files modified by the current branch, relative to the master branch + git diff --name-only master | xargs ./utils/check-style-clang-format.py --fix Clang-tidy ********** @@ -620,18 +659,7 @@ statement. /* * Copyright (c) YEAR COPYRIGHTHOLDER * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: MyName */ @@ -666,7 +694,7 @@ is described in the `Doxygen website `_. * A detailed description of the purpose of the method. * * \param firstParam a short description of the purpose of this parameter - * \returns a short description of what is returned from this function. + * \return a short description of what is returned from this function. */ int DoSomething(int firstParam); @@ -690,7 +718,7 @@ The ``my-class.cc`` file is structured similarly: /* * Copyright (c) YEAR COPYRIGHTHOLDER * - * 3-paragraph GPL blurb + * SPDX-License-Identifier: GPL-2.0-only * * Author: MyName */ @@ -803,7 +831,6 @@ file (``*.cc``). When declaring variables that are easily deducible from context, prefer to declare them with ``auto`` instead of repeating the type name. Not only does this improve code readability, by making lines shorter, but it also facilitates future code refactoring. -When declaring variables, prefer to use direct-initialization, to avoid repeating the type name. .. sourcecode:: cpp @@ -817,12 +844,74 @@ When declaring variables, prefer to use direct-initialization, to avoid repeatin auto* ptr = new int[10]; auto m = static_cast(97 + (i % 26)); + +Initialization +============== + +When declaring variables, prefer to use direct-initialization, to avoid repeating the type name. + +.. sourcecode:: cpp + // Avoid splitting the declaration and initialization of variables Ipv4Address ipv4Address = Ipv4Address("192.168.0.1") // Prefer to use direct-initialization Ipv4Address ipv4Address("192.168.0.1") +Variables with no default constructor or of primitive types should be initialized when declared. + +Variables with default constructors do not need to be explicitly initialized, since the compiler +already does that. An example of this is the ``ns3::Time`` class, which will initialize to zero. + +Member variables of structs and classes should be initialized unless the member has a default +constructor that guarantees initialization. Preferably, variables should be initialized together +with the declaration (in the header file). Alternatively, they can be initialized in the default +constructor (in the implementation file), and you may see instances of this in the codebase, but +direct initialization upon declaration is preferred going forward. + +If all member variables of a class / struct are directly initialized (see above), they do not +require explicit default initialization. But if not all variables are initialized, those +non-initialized variables will contain garbage. Therefore, initializing the class object with +``{}`` allows all member variables to always be initialized -- either with the provided default +initialization or with the primitive type's default value (typically 0). + +C++ supports two syntax choices for direct initialization, either ``()`` or ``{}``. There are +various tradeoffs in the choices for more complicated types (consult the C++ literature on +brace vs. parentheses initialization), but for the fundamental types like ``double``, either is +acceptable (please use consistently within files). + +Regarding ``ns3::Time``, do not initialize to non-zero integer values as follows, assuming +that it will be converted to nanoseconds: + +.. sourcecode:: cpp + + Time t{1000000}; // This is disallowed + +The value will be interpreted according to the current resolution, which is ambiguous. A +user's program may have already changed the resolution from the default of nanoseconds to +something else by the time of this initialization, and it will be instead interpreted according +to 10^6 * the new resolution unit. + +Time initialization to raw floating-point values is additionally fraught, because of rounding. Doing +so with small values has led to bugs in practice such as timer timeout values of zero time. + +When declaring or manipulating ``Time`` objects with known values, prefer to use integer-based representations and +arguments over floating-point fractions, where possible, because integer-based is faster. +This means preferring the use of ``NanoSeconds``, ``MicroSeconds``, and ``MilliSeconds`` over +``Seconds``. For example, to represent a tenth of a second, prefer ``MilliSeconds(100)`` +to ``Seconds(0.1)``. + +To summarize Time declaration and initialization, consider the following examples and comments: + +.. sourcecode:: cpp + + Time t; // OK, will be value-initialized to integer zero + Time t{MilliSeconds(100)}; // OK, fastest, no floating point involved + Time t{"100ms"}; // OK, will perform a string conversion; integer would be faster + Time t{Seconds(0.1)}; // OK, will invoke Seconds(double); integer would be faster + Time t{100000000}; // NOT OK, is interpreted differently when ``Time::SetResolution()`` called + Time t{0.1}; // NOT OK, will round to zero; see above and also merge request !2007 + Comments ======== @@ -1477,6 +1566,18 @@ Miscellaneous items ... }; +- When checking whether a Time value is zero, use ``Time::IsZero()`` rather than comparing it to a zero-valued time object with ``operator==``, to avoid construction of a temporary. Similar guidance applies to the related functions ``Time::IsPositive()``, ``Time::IsNegative()``, ``Time::IsStrictlyPositive``, and ``Time::IsStrictlyNegative()``. + + .. sourcecode:: cpp + + Time t = ...; + // prefer the below: + if (t.IsStrictlyPositive()) + {...} + // to this alternative: + if (t > Seconds(0)) + {...} + Clang-tidy rules ================ diff --git a/doc/contributing/source/conf.py b/doc/contributing/source/conf.py index aa5090d31..041d3798f 100644 --- a/doc/contributing/source/conf.py +++ b/doc/contributing/source/conf.py @@ -49,9 +49,9 @@ copyright = "2015, ns-3 project" # built documents. # # The short X.Y version. -version = "ns-3.42" +version = "ns-3.43" # The full version, including alpha/beta/rc tags. -release = "ns-3.42" +release = "ns-3.43" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/contributing/source/enhancements.rst b/doc/contributing/source/enhancements.rst index 7f96c788b..afb6345f1 100644 --- a/doc/contributing/source/enhancements.rst +++ b/doc/contributing/source/enhancements.rst @@ -113,8 +113,8 @@ To submit code proposed for |ns3| as one or more commits, use a merge request. The following steps are recommended to smooth the process. If you are new to public Git repositories, you may want to read -`this overview of merge requests `_. If you are familiar with GitHub -pull requests, the GitLab.com merge requests are very similar. +`this overview of merge requests `_. +If you are familiar with GitHub pull requests, the GitLab.com merge requests are very similar. In brief, you will want to fork ns-3-dev into your own namespace (i.e., fork the repository into your personal GitLab.com account, via the user diff --git a/doc/contributing/source/general.rst b/doc/contributing/source/general.rst index 3fb1bba09..71389086b 100644 --- a/doc/contributing/source/general.rst +++ b/doc/contributing/source/general.rst @@ -98,9 +98,7 @@ An example placement of a copyright statement can be found in the file /* * Copyright (c) 2005,2006 INRIA * - * 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; + * SPDX-License-Identifier: GPL-2.0-only Copyright on existing files =========================== @@ -115,9 +113,7 @@ of code that is covered by the new copyright. An example is the program * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari * Copyright (c) 2018 Fraunhofer ESK : RLF extensions * - * 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; + * SPDX-License-Identifier: GPL-2.0-only Here, Fraunhofer ESK added extensions to support radio link failure (RLF), and the copyright statement clarifies the extension (separated from the diff --git a/doc/doxygen.conf b/doc/doxygen.conf index 4d604f4e9..8659554a4 100644 --- a/doc/doxygen.conf +++ b/doc/doxygen.conf @@ -1881,7 +1881,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = amsmath,amssymb +EXTRA_PACKAGES = amsmath,amssymb,physics # The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for # the generated LaTeX document. The header should contain everything until the @@ -2299,6 +2299,7 @@ EXPAND_AS_DEFINED = ATTRIBUTE_ACCESSOR_DEFINE \ ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME \ NS_UNUSED_GLOBAL \ NS_DEPRECATED \ + NS_DEPRECATED_3_43 \ NS_DEPRECATED_3_42 \ NS_DEPRECATED_3_41 \ NS_DEPRECATED_3_40 diff --git a/doc/doxygen.warnings.report.sh b/doc/doxygen.warnings.report.sh index c24b837be..62d212055 100755 --- a/doc/doxygen.warnings.report.sh +++ b/doc/doxygen.warnings.report.sh @@ -22,7 +22,7 @@ VERBLOG="$DIR/doxygen.verbose.log" # Options ------------------------------ # -# One line sysnopsis, continue +# One line synopsis, continue function synopsis_short { echo "Usage: $me [-beithv] [-s | -l | -w] [-m ] [-f ] [-F ]" @@ -305,6 +305,12 @@ if [ $skip_doxy -eq 1 ]; then else + # We're going to modify doxygen.conf + # In case the user ^C's out of this we need to restore + # doxygen.conf, otherwise weird things happen. + # function restore_doxygen_conf defined below + trap restore_doxygen_conf INT + # Modify doxygen.conf to generate all the warnings # We keep dot active to generate graphs in the documentation # (see for example PacketTagList) and warn about ill-formed @@ -333,6 +339,14 @@ else DIRECTORY_GRAPH = no EOF + # Swap back to original config + function restore_doxygen_conf() + { + if [ -e $conf.bak ]; then + rm -f $conf + mv -f $conf.bak $conf + fi + } intro_h="introspected-doxygen.h" if [ $skip_intro -eq 1 ]; then @@ -350,17 +364,11 @@ EOF status_report $? "./ns3 run print-introspected-doxygen" fi - # Waf insists on writing cruft to stdout - sed -i.bak -E '/^Waf:/d' doc/$intro_h - rm doc/$intro_h.bak - verbose -n "Rebuilding doxygen docs with full errors" (cd "$ROOT" && ./ns3 docs doxygen-no-build >&6 2>&6 ) status_report $? "./ns3 docs doxygen-no-build" - # Swap back to original config - rm -f $conf - mv -f $conf.bak $conf + restore_doxygen_conf fi # Filter log file @@ -442,9 +450,21 @@ misplacedWarns=$( \ sed 's/^[ \t]*//;s/[ \t]*$//' \ ) +# This is to catch LaTeX formula errors. +# In this case the output is of the form: +# "error: Problems running latex." followed by +# "Check your installation or look for typos in _formulas.tex and check _formulas.log!" +# and +# "Check your installation or look for typos in _formulas_dark.tex and check _formulas_dark.log!" +# Hence, the count can be two. +latexWarns=$( \ + grep "Problems running latex" "$LOG" | \ + wc -l | \ + sed 's/^[ \t]*//;s/[ \t]*$//' \ + ) # Total number of warnings -warncount=$((modwarncount + addlparam + misplacedWarns)) +warncount=$((modwarncount + addlparam + misplacedWarns + latexWarns)) # List of files appearing in the log if [ ! -z "$filter_log_results" ] @@ -497,7 +517,7 @@ echo echo "Report of Doxygen warnings" echo "----------------------------------------" echo -echo "(All counts are lower bounds.)" +echo "(All counts are approximate.)" echo echo "Warnings by module/directory:" echo @@ -529,6 +549,27 @@ echo "----------------------------------------" printf "%6d files with warnings\n" $filecount echo echo +if [ $latexWarns -ne 0 ] ; then + html_output=`dirname $LOG` + if [ $skip_doxy -eq 1 ]; then + html_output+="/html" + else + html_output+="/html-warn" + fi + echo "----------------------------------------" + echo "There are LaTeX warnings, probably math" + echo " Inspect the generated LaTeX input files" + echo " '$html_output/_formulas.tex'" + echo " (and '$html_output/_formulas_dark.tex')." + echo " as well as the LaTeX run log" + echo " '$html_output/_formulas.log'" + echo + echo "The LaTeX log is:" + echo "$(<$html_output/_formulas.log )" + echo "----------------------------------------" + echo + echo +fi echo "Doxygen Warnings Summary" echo "----------------------------------------" printf "%6d directories\n" $modcount diff --git a/doc/installation/source/conf.py b/doc/installation/source/conf.py index 57986336a..9d427c4cd 100644 --- a/doc/installation/source/conf.py +++ b/doc/installation/source/conf.py @@ -49,9 +49,9 @@ copyright = "2018, ns-3 project" # built documents. # # The short X.Y version. -version = "ns-3.42" +version = "ns-3.43" # The full version, including alpha/beta/rc tags. -release = "ns-3.42" +release = "ns-3.43" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/installation/source/macos.rst b/doc/installation/source/macos.rst index 77732307e..9453f5443 100644 --- a/doc/installation/source/macos.rst +++ b/doc/installation/source/macos.rst @@ -108,9 +108,12 @@ For MacPorts packages we show the most recent package version available as of ea | Building Doxygen | ``doxygen graphviz imagemagick`` | ``doxygen graphviz`` | | | | ``ImageMagick`` | +-----------------------------+----------------------------------+--------------------------+ - | Sphinx documentation | ``sphinx-doc texlive`` | ``texlive`` | - | | | ``pyXX-sphinx``, with | - | | | `XX`` the Python version | + | Sphinx documentation | ``sphinx-doc texlive`` | ``dia texlive`` | + | | | ``texlive-fonts-extra`` | + | | | ``texlive-latex-extra`` | + | | | ``py3XX-sphinx``, with | + | | | `XX`` the Python minor | + | | | version such as `12` | +-----------------------------+----------------------------------+--------------------------+ | Eigen3 | ``eigen`` | ``eigen3`` | +-----------------------------+----------------------------------+--------------------------+ diff --git a/doc/installation/source/quick-start.rst b/doc/installation/source/quick-start.rst index 9445b752f..19f00cd28 100644 --- a/doc/installation/source/quick-start.rst +++ b/doc/installation/source/quick-start.rst @@ -42,13 +42,13 @@ source archive download (via a web browser, ``wget``, or ``curl``). | | or ``tar`` and ``bunzip2`` | No minimum version | | | (for Web download) | | +--------------------+--------------------------------------+------------------------------+ - | **Compiler** | ``g++`` | >= 9 | + | **Compiler** | ``g++`` | >= 10 | + + + + - | | or ``clang++`` | >= 10 | + | | or ``clang++`` | >= 11 | +--------------------+--------------------------------------+------------------------------+ - | **Configuration** | ``python3`` | >= 3.5 | + | **Configuration** | ``python3`` | >= 3.8 | +--------------------+--------------------------------------+------------------------------+ - | **Build system** | ``cmake``, | >= 3.10 | + | **Build system** | ``cmake``, | >= 3.13 | + + + + | | and at least one of: | No minimum version | | | ``make``, ``ninja``, or ``Xcode`` | | @@ -80,13 +80,13 @@ Download There are two main options: -1. Download a release tarball. This will unpack to a directory such as ``ns-allinone-3.42`` +1. Download a release tarball. This will unpack to a directory such as ``ns-allinone-3.43`` containing |ns3| and some other programs. Below is a command-line download using ``wget``, but a browser download will also work:: - $ wget https://www.nsnam.org/releases/ns-allinone-3.42.tar.bz2 - $ tar xfj ns-allinone-3.42.tar.bz2 - $ cd ns-allinone-3.42/ns-3.42 + $ wget https://www.nsnam.org/releases/ns-allinone-3.43.tar.bz2 + $ tar xfj ns-allinone-3.43.tar.bz2 + $ cd ns-allinone-3.43/ns-3.43 2. Clone |ns3| from the Git repository. The ``ns-3-allinone`` can be cloned, as well as ``ns-3-dev`` by itself. Below, we illustrate the latter:: @@ -99,7 +99,7 @@ you clone |ns3|, your directory will be named ``ns-3-dev``. By default, Git wil the |ns3| ``master`` branch, which is a development branch. All |ns3| releases are tagged in Git, so if you would then like to check out a past release, you can do so as follows:: - $ git checkout -b ns-3.42-release ns-3.42 + $ git checkout -b ns-3.43-release ns-3.43 In this quick-start, we are omitting download and build instructions for optional |ns3| modules, the ``NetAnim`` animator, Python bindings, and ``NetSimulyzer``. The @@ -125,6 +125,30 @@ and support for |ns3| logging) is what is usually done at first:: Depending on how fast your CPU is, the configuration command can take anywhere from a few seconds to a minute. +You should see some output such as below, if successful:: + + Modules configured to be built: + antenna aodv applications + bridge buildings config-store + core csma csma-layout + dsdv dsr energy + fd-net-device flow-monitor internet + internet-apps lr-wpan lte + mesh mobility netanim + network nix-vector-routing olsr + point-to-point point-to-point-layout propagation + sixlowpan spectrum stats + tap-bridge test topology-read + traffic-control uan virtual-net-device + wifi wimax + + Modules that cannot be built: + brite click mpi + openflow visualizer + +Do not be concerned about the list of modules that cannot be built; these modules are all optional +and require some extra dependencies, but are not needed for initial exploration of |ns3|. + Then, use the ``ns3`` program to build the |ns3| module libraries and executables:: $ ./ns3 build @@ -135,31 +159,9 @@ slower). Additional configuration (not covered here) can be used to limit the s build, and the ``ccache``, if installed, can speed things up. In general, plan on the build taking a few minutes on faster workstations. -You should see some output such as below, if successful:: - - 'build' finished successfully (44.159s) - - Modules built: - antenna aodv applications - bridge buildings config-store - core csma csma-layout - dsdv dsr energy - fd-net-device flow-monitor internet - internet-apps lr-wpan lte - mesh mobility mpi - netanim (no Python) network nix-vector-routing - olsr point-to-point point-to-point-layout - propagation sixlowpan spectrum - stats tap-bridge test (no Python) - topology-read traffic-control uan - virtual-net-device visualizer wifi - wimax - - Modules not built (see ns-3 tutorial for explanation): - brite click openflow - - -Once complete, you can run the unit tests to check your build:: +At the end of the build, if successful, the output will report on the underlying ``cmake`` +build command that was invoked by the ``ns3`` program. Once the build is complete, you can +run the unit tests to check your build:: $ ./test.py diff --git a/doc/installation/source/windows.rst b/doc/installation/source/windows.rst index 03500f159..883bf34f9 100644 --- a/doc/installation/source/windows.rst +++ b/doc/installation/source/windows.rst @@ -161,119 +161,22 @@ Getting Doxygen from Msys2 is straightforward. .. sourcecode:: console - /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-doxygen mingw-w64-x86_64-graphviz - -For unknown reasons, the texlive packages in Msys2 are broken, -so we recommend manually installing the official Texlive. - -.. _Texlive for Windows: https://tug.org/texlive/windows.html - -Start by installing `Texlive for Windows`_. It can be installed either via the network installer or -directly from the ISO with all optional packages. - -To install it with the network installer, start by creating a texlive folder and downloading the -texlive configuration profile below. You can change the installation directory (starting with -``C:/texlive/2022``). - -.. sourcecode:: text - - selected_scheme scheme-custom - TEXDIR C:/texlive/2022 - TEXMFCONFIG ~/.texlive2022/texmf-config - TEXMFHOME ~/texmf - TEXMFLOCAL C:/texlive/texmf-local - TEXMFSYSCONFIG C:/texlive/2022/texmf-config - TEXMFSYSVAR C:/texlive/2022/texmf-var - TEXMFVAR ~/.texlive2022/texmf-var - binary_win32 1 - collection-basic 1 - collection-bibtexextra 1 - collection-binextra 1 - collection-context 1 - collection-fontsrecommended 1 - collection-fontutils 1 - collection-games 1 - collection-humanities 1 - collection-langenglish 1 - collection-latex 1 - collection-latexextra 1 - collection-latexrecommended 1 - collection-luatex 1 - collection-mathscience 1 - collection-metapost 1 - collection-music 1 - collection-pictures 1 - collection-plaingeneric 1 - collection-pstricks 1 - collection-publishers 1 - collection-texworks 1 - collection-wintools 1 - collection-xetex 1 - instopt_adjustpath 1 - instopt_adjustrepo 1 - instopt_letter 0 - instopt_portable 0 - instopt_write18_restricted 1 - tlpdbopt_autobackup 1 - tlpdbopt_backupdir tlpkg/backups - tlpdbopt_create_formats 1 - tlpdbopt_desktop_integration 1 - tlpdbopt_file_assocs 1 - tlpdbopt_generate_updmap 0 - tlpdbopt_install_docfiles 0 - tlpdbopt_install_srcfiles 0 - tlpdbopt_post_code 1 - tlpdbopt_sys_bin /usr/local/bin - tlpdbopt_sys_info /usr/local/share/info - tlpdbopt_sys_man /usr/local/share/man - tlpdbopt_w32_multi_user 0 - - -Then, download Texlive's web installer and unpack it to the texlive directory, -and run the installer. - -.. sourcecode:: console - - ~$ wget https://linorg.usp.br/CTAN/systems/texlive/tlnet/install-tl.zip - ~$ python3 -c "import shutil; shutil.unpack_archive('install-tl.zip', './')" - ~$ cd install-tl-* - ~/install-tl-20220923$ .\install-tl-windows.bat --no-gui --lang en -profile ..\texlive.profile - -After the installation finishes, add the installation directory to the PATH environment variable. - -.. sourcecode:: console - - setx PATH "%PATH%;C:\texlive\2022\bin\win32" /m - C:\ns-3-dev\> set MSYSTEM MINGW64 - C:\ns-3-dev\> bash - /c/ns-3-dev/ MINGW64$ echo "export PATH=$PATH:/c/texlive/2022/bin/win32" >> ~/.bashrc + /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-doxygen mingw-w64-x86_64-graphviz mingw-w64-x86_64-texlive-full The ns-3 manual, models and tutorial ++++++++++++++++++++++++++++++++++++ These documents are written in reStructuredText for Sphinx (doc/tutorial, doc/manual, doc/models). -The figures are typically written in dia. +The figures are typically written in Dia. The documents can be generated into multiple formats, one of them being pdf, which requires the same Latex setup for doxygen. -Sphinx can be installed via Msys2's package manager: +Sphinx and Dia can be installed via Msys2's package manager: .. sourcecode:: console - /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-python-sphinx - -.. _Dia: https://sourceforge.net/projects/dia-installer/ - -`Dia`_ on the other hand needs to be downloaded and installed manually. -After installing it, or unzipping the package (example below), add Dia/bin to the PATH. - -.. sourcecode:: console - - C:\ns-3-dev\> setx PATH "%PATH%;C:\dia_0.97.2_win32\bin" /m - C:\ns-3-dev\> set MSYSTEM MINGW64 - C:\ns-3-dev\> bash - /c/ns-3-dev/ MINGW64$ echo "export PATH=$PATH:/c/dia_0.97.2_win32/bin" >> ~/.bashrc + /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-python-sphinx mingw-w64-x86_64-dia mingw-w64-x86_64-texlive-full GNU Scientific Library (GSL) ++++++++++++++++++++++++++++ @@ -308,6 +211,15 @@ Requires some boost libraries that can be installed with the following. /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-boost +Support for click module ++++++++++++++++++++++++++++ + +Requires autotools, which can be installed with the following. + +.. sourcecode:: console + + /c/ns-3-dev/ MINGW64$ pacman -S mingw-w64-x86_64-autotools + Windows 10 Docker container *************************** @@ -396,9 +308,9 @@ Windows 10 Vagrant ****************** .. _VirtualBox: https://www.virtualbox.org/ -.. _Vagrant: https://www.vagrantup.com/ +.. _Vagrant: https://developer.hashicorp.com/vagrant/docs .. _virtual machine: https://www.redhat.com/en/topics/virtualization/what-is-a-virtual-machine -.. _boxes available: https://app.vagrantup.com/boxes/search +.. _boxes available: https://vagrantcloud.com/boxes/search As an alternative to manually setting up all dependencies required by ns-3, one can use a pre-packaged `virtual machine`_. There are many ways to do that, diff --git a/doc/manual/source/conf.py b/doc/manual/source/conf.py index 6249c0dcd..8a172ba7d 100644 --- a/doc/manual/source/conf.py +++ b/doc/manual/source/conf.py @@ -74,9 +74,9 @@ copyright = "2006-2019, ns-3 project" # built documents. # # The short X.Y version. -version = "ns-3.42" +version = "ns-3.43" # The full version, including alpha/beta/rc tags. -release = "ns-3.42" +release = "ns-3.43" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/manual/source/documentation.rst b/doc/manual/source/documentation.rst index 2395d0fb5..d16108a22 100644 --- a/doc/manual/source/documentation.rst +++ b/doc/manual/source/documentation.rst @@ -555,7 +555,7 @@ usage for |ns3|. * \ingroup foo * * FooBar packet type. - */ + */ class FooBar * Did you know ``typedefs`` can have formal arguments? This enables diff --git a/doc/manual/source/random-variables.rst b/doc/manual/source/random-variables.rst index ed6e9afc3..317323c92 100644 --- a/doc/manual/source/random-variables.rst +++ b/doc/manual/source/random-variables.rst @@ -263,6 +263,8 @@ can also create their own custom random variables by deriving from class * class :cpp:class:`EmpiricalRandomVariable` * class :cpp:class:`BinomialRandomVariable` * class :cpp:class:`BernoulliRandomVariable` +* class :cpp:class:`LaplacianRandomVariable` +* class :cpp:class:`LargestExtremeValueRandomVariable` Semantics of RandomVariableStream objects ***************************************** diff --git a/doc/manual/source/working-with-cmake.rst b/doc/manual/source/working-with-cmake.rst index 2d7dc3172..7acdfab27 100644 --- a/doc/manual/source/working-with-cmake.rst +++ b/doc/manual/source/working-with-cmake.rst @@ -399,10 +399,12 @@ To build specific targets, run: ~/ns-3-dev/cmake-cache$ cmake --build . --target target_name -Where target_name is a valid target name. Module libraries are prefixed with ``lib`` (e.g. libcore), -executables from the scratch folder are prefixed with ``scratch_`` (e.g. scratch_scratch-simulator). -Executables targets have their source file name without the ".cc" prefix -(e.g. sample-simulator.cc => sample-simulator). +Where target_name is a valid target name. +Since ns-3.43, module libraries CMake targets are named the same as the module name (e.g. core, wifi, lte). +From ns-3.36 to 3.42, module library targets were prefixed with ``lib`` (e.g. libcore, libwifi, liblte). +Executables from the scratch folder are prefixed with ``scratch_`` (e.g. scratch_scratch-simulator). +Executables targets are named the same as their source file containing the `main` function, +without the ".cc" prefix (e.g. sample-simulator.cc => sample-simulator). Adding a new module @@ -615,7 +617,6 @@ produces the following: In the CMake build command line, notice the scratch-simulator has a ``scratch_`` prefix. That is true for all the CMake scratch targets. This is done to guarantee globally unique names. -Similarly, library-related targets have ``lib`` as a prefix (e.g. ``libcore``, ``libnetwork``). .. _RPATH: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_RPATH.html @@ -2361,26 +2362,16 @@ and modules in the contrib folder to a different list. # Add library to a global list of libraries if("${FOLDER}" MATCHES "src") - set(ns3-libs "${lib${BLIB_LIBNAME}};${ns3-libs}" + set(ns3-libs "${BLIB_LIBNAME};${ns3-libs}" CACHE INTERNAL "list of processed upstream modules" ) else() - set(ns3-contrib-libs "${lib${BLIB_LIBNAME}};${ns3-contrib-libs}" + set(ns3-contrib-libs "${BLIB_LIBNAME};${ns3-contrib-libs}" CACHE INTERNAL "list of processed contrib modules" ) endif() -In the following block, we check if we are working with Xcode, which does -not handle correctly CMake object libraries (.o files). - -In other platforms, -we build an object file ``add_library(${lib${BLIB_LIBNAME}-obj} OBJECT "${BLIB_SOURCE_FILES}...)`` -and a shared library ``add_library(${lib${BLIB_LIBNAME}} SHARED ...)``. - -The object library contains the actual source files (``${BLIB_SOURCE_FILES}``), -but is not linked, which mean we can reuse the object to build the static version of the libraries. -Notice the shared library uses the object file as its source files -``$ - ) - else() - # Xcode and CMake don't play well when using object libraries, so we have a - # specific path for that - add_library(${lib${BLIB_LIBNAME}} SHARED "${BLIB_SOURCE_FILES}") - - if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${IGNORE_PCH})) - target_precompile_headers(${lib${BLIB_LIBNAME}} REUSE_FROM stdlib_pch) - endif() + if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${IGNORE_PCH})) + target_precompile_headers(${BLIB_LIBNAME} REUSE_FROM stdlib_pch) endif() # ... endfunction() -In the next code block, we create an alias to ``libmodule``, ``ns3::libmodule``, +In the next code block, we create an alias to ``module``, ``ns3::module``, which can later be used when importing |ns3| with CMake's ``find_package(ns3)``. -Then, we associate configured headers (``config-store-config``, ``core-config.h`` and -``version-defines.h``) to the core module. - And finally associate all of the public headers of the module to that library, to make sure CMake will be refreshed in case one of them changes. @@ -2432,24 +2399,14 @@ to make sure CMake will be refreshed in case one of them changes. function(build_lib) # ... - add_library(ns3::${lib${BLIB_LIBNAME}} ALIAS ${lib${BLIB_LIBNAME}}) + add_library(ns3::${BLIB_LIBNAME} ALIAS ${BLIB_LIBNAME}) # Associate public headers with library for installation purposes - if("${BLIB_LIBNAME}" STREQUAL "core") - set(config_headers ${CMAKE_HEADER_OUTPUT_DIRECTORY}/config-store-config.h - ${CMAKE_HEADER_OUTPUT_DIRECTORY}/core-config.h - ) - if(${NS3_ENABLE_BUILD_VERSION}) - list(APPEND config_headers - ${CMAKE_HEADER_OUTPUT_DIRECTORY}/version-defines.h - ) - endif() - endif() set_target_properties( - ${lib${BLIB_LIBNAME}} + ${BLIB_LIBNAME} PROPERTIES PUBLIC_HEADER - "${BLIB_HEADER_FILES};${BLIB_DEPRECATED_HEADER_FILES};${config_headers};${CMAKE_HEADER_OUTPUT_DIRECTORY}/${BLIB_LIBNAME}-module.h" + "${BLIB_HEADER_FILES};${BLIB_DEPRECATED_HEADER_FILES};${CMAKE_HEADER_OUTPUT_DIRECTORY}/${BLIB_LIBNAME}-module.h" ) # ... endfunction() @@ -2457,42 +2414,50 @@ to make sure CMake will be refreshed in case one of them changes. In the next code block, we make the library a dependency to the ClangAnalyzer's time trace report, which measures which step of compilation took most time and which files were responsible for that. -Then, the |ns3| libraries are separated from non-|ns3| libraries, that can be propagated or not -for libraries/executables linked to the current |ns3| module being processed. +.. sourcecode:: cmake + + function(build_lib) + # ... + + build_lib_reexport_third_party_libraries( + "${BLIB_LIBNAME}" "${BLIB_LIBRARIES_TO_LINK}" + ) + + # ... + endfunction(build_lib) + +The ``build_lib_reexport_third_party_libraries`` macro then separates |ns3| libraries from non-|ns3| libraries. +The non-|ns3| can be automatically propagated, or not, to libraries/executables linked to the current |ns3| module being processed. + +.. sourcecode:: cmake + + function(build_lib_reexport_third_party_libraries libname libraries_to_link) + # Separate ns-3 and non-ns-3 libraries to manage their propagation properly + separate_ns3_from_non_ns3_libs( + "${libname}" "${libraries_to_link}" ns_libraries_to_link + non_ns_libraries_to_link + ) + + set(ns3-external-libs "${non_ns_libraries_to_link};${ns3-external-libs}" + CACHE INTERNAL + "list of non-ns libraries to link to NS3_STATIC and NS3_MONOLIB" + ) + # ... + endfunction() The default is propagating these third-party libraries and their include directories, but this can be turned off by setting ``NS3_REEXPORT_THIRD_PARTY_LIBRARIES=OFF`` .. sourcecode:: cmake - function(build_lib) + function(build_lib_reexport_third_party_libraries libname libraries_to_link) # ... - if(${NS3_CLANG_TIMETRACE}) - add_dependencies(timeTraceReport ${lib${BLIB_LIBNAME}}) - endif() - - # Split ns and non-ns libraries to manage their propagation properly - set(non_ns_libraries_to_link) - set(ns_libraries_to_link) - - foreach(library ${BLIB_LIBRARIES_TO_LINK}) - remove_lib_prefix("${library}" module_name) - - # Check if the module exists in the ns-3 modules list - # or if it is a 3rd-party library - if(${module_name} IN_LIST ns3-all-enabled-modules) - list(APPEND ns_libraries_to_link ${library}) - else() - list(APPEND non_ns_libraries_to_link ${library}) - endif() - unset(module_name) - endforeach() if(NOT ${NS3_REEXPORT_THIRD_PARTY_LIBRARIES}) # ns-3 libraries are linked publicly, to make sure other modules can find # each other without being directly linked set(exported_libraries PUBLIC ${LIB_AS_NEEDED_PRE} ${ns_libraries_to_link} - ${LIB_AS_NEEDED_POST} + ${LIB_AS_NEEDED_POST} ) # non-ns-3 libraries are linked privately, not propagating unnecessary @@ -2506,20 +2471,40 @@ can be turned off by setting ``NS3_REEXPORT_THIRD_PARTY_LIBRARIES=OFF`` else() # we export everything by default when NS3_REEXPORT_THIRD_PARTY_LIBRARIES=ON set(exported_libraries PUBLIC ${LIB_AS_NEEDED_PRE} ${ns_libraries_to_link} - ${non_ns_libraries_to_link} ${LIB_AS_NEEDED_POST} + ${non_ns_libraries_to_link} ${LIB_AS_NEEDED_POST} ) set(private_libraries) # with NS3_REEXPORT_THIRD_PARTY_LIBRARIES, we export all 3rd-party library # include directories, allowing consumers of this module to include and link # the 3rd-party code with no additional setup - get_target_includes(${lib${BLIB_LIBNAME}} exported_include_directories) + get_target_includes(${libname} exported_include_directories) + string(REPLACE "-I" "" exported_include_directories - "${exported_include_directories}" + "${exported_include_directories}" ) - string(REPLACE "${CMAKE_OUTPUT_DIRECTORY}/include" "" - exported_include_directories - "${exported_include_directories}" + + # include directories prefixed in the source or binary directory need to be + # treated differently + set(new_exported_include_directories) + foreach(directory ${exported_include_directories}) + string(FIND "${directory}" "${PROJECT_SOURCE_DIR}" is_prefixed_in_subdir) + if(${is_prefixed_in_subdir} GREATER_EQUAL 0) + string(SUBSTRING "${directory}" ${is_prefixed_in_subdir} -1 + directory_path + ) + list(APPEND new_exported_include_directories + $ + ) + else() + list(APPEND new_exported_include_directories ${directory}) + endif() + endforeach() + set(exported_include_directories ${new_exported_include_directories}) + + string(REPLACE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include" "" + exported_include_directories + "${exported_include_directories}" ) endif() # ... @@ -2528,21 +2513,14 @@ can be turned off by setting ``NS3_REEXPORT_THIRD_PARTY_LIBRARIES=OFF`` After the lists of libraries to link that should be exported (``PUBLIC``) and not exported (``PRIVATE``) are built, we can link them with ``target_link_libraries``. -Next, we set the output name of the module library to ``n3version-modulename`` (+ optional build suffix). - .. sourcecode:: cmake - function(build_lib) + function(build_lib_reexport_third_party_libraries libname libraries_to_link) # ... - target_link_libraries( - ${lib${BLIB_LIBNAME}} ${exported_libraries} ${private_libraries} - ) - # set output name of library - set_target_properties( - ${lib${BLIB_LIBNAME}} - PROPERTIES OUTPUT_NAME ns${NS3_VER}-${BLIB_LIBNAME}${build_profile_suffix} - ) + # Set public and private headers linked to the module library + target_link_libraries(${libname} ${exported_libraries} ${private_libraries}) + # ... endfunction() @@ -2551,43 +2529,20 @@ use them just by linking to one of the |ns3| modules. .. sourcecode:: cmake - function(build_lib) + function(build_lib_reexport_third_party_libraries libname libraries_to_link) # ... # export include directories used by this library so that it can be used by # 3rd-party consumers of ns-3 using find_package(ns3) this will automatically # add the build/include path to them, so that they can ns-3 headers with # target_include_directories( - ${lib${BLIB_LIBNAME}} - PUBLIC $ - $ + ${libname} PUBLIC $ + $ INTERFACE ${exported_include_directories} ) # ... endfunction() -We append the list of third-party/external libraries for each processed module, -and append a list of object libraries that can be later used for the static |ns3| build. - -.. sourcecode:: cmake - - function(build_lib) - # ... - set(ns3-external-libs "${non_ns_libraries_to_link};${ns3-external-libs}" - CACHE INTERNAL - "list of non-ns libraries to link to NS3_STATIC and NS3_MONOLIB" - ) - if(${NS3_STATIC} OR ${NS3_MONOLIB}) - set(lib-ns3-static-objs - "$;${lib-ns3-static-objs}" - CACHE - INTERNAL - "list of object files from module used by NS3_STATIC and NS3_MONOLIB" - ) - endif() - # ... - endfunction() - The following block creates the ``${BLIB_LIBNAME}-module.h`` header for user scripts, and copies header files from ``src/module`` and ``contrib/module`` to the ``include/ns3`` directory. @@ -2598,77 +2553,99 @@ and copies header files from ``src/module`` and ``contrib/module`` to the ``incl # Write a module header that includes all headers from that module write_module_header("${BLIB_LIBNAME}" "${BLIB_HEADER_FILES}") + # ... + # Copy all header files to outputfolder/include before each build - copy_headers_before_building_lib( - ${BLIB_LIBNAME} ${CMAKE_HEADER_OUTPUT_DIRECTORY} "${BLIB_HEADER_FILES}" - public + copy_headers( + PUBLIC_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + PUBLIC_HEADER_FILES ${BLIB_HEADER_FILES} + DEPRECATED_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + DEPRECATED_HEADER_FILES ${BLIB_DEPRECATED_HEADER_FILES} + PRIVATE_HEADER_OUTPUT_DIR ${CMAKE_HEADER_OUTPUT_DIRECTORY} + PRIVATE_HEADER_FILES ${BLIB_PRIVATE_HEADER_FILES} ) - if(BLIB_DEPRECATED_HEADER_FILES) - copy_headers_before_building_lib( - ${BLIB_LIBNAME} ${CMAKE_HEADER_OUTPUT_DIRECTORY} - "${BLIB_DEPRECATED_HEADER_FILES}" deprecated - ) - endif() # ... endfunction() The following block creates the test library for the module currently being processed. +Note that it handles Windows vs non-Windows differently, since Windows requires all +used linked symbols to be used, which results in our test-runner being unable to +be dynamically linked to ns-3 modules. To solve that, we create the test libraries +for the different modules as object libraries instead, and statically link to the +test-runner executable. .. sourcecode:: cmake function(build_lib) # ... - # Check if the module tests should be built - set(filtered_in ON) - if(NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in OFF) - if(${BLIB_LIBNAME} IN_LIST NS3_FILTER_MODULE_EXAMPLES_AND_TESTS) - set(filtered_in ON) - endif() - endif() - - # Build tests if requested - if(${ENABLE_TESTS} AND ${filtered_in}) - list(LENGTH BLIB_TEST_SOURCES test_source_len) - if(${test_source_len} GREATER 0) - # Create BLIB_LIBNAME of output library test of module - set(test${BLIB_LIBNAME} lib${BLIB_LIBNAME}-test CACHE INTERNAL "") - set(ns3-libs-tests "${test${BLIB_LIBNAME}};${ns3-libs-tests}" - CACHE INTERNAL "list of test libraries" - ) - - # Create shared library containing tests of the module - add_library(${test${BLIB_LIBNAME}} SHARED "${BLIB_TEST_SOURCES}") - - # Link test library to the module library - if(${NS3_MONOLIB}) - target_link_libraries( - ${test${BLIB_LIBNAME}} ${LIB_AS_NEEDED_PRE} ${lib-ns3-monolib} - ${LIB_AS_NEEDED_POST} - ) - else() - target_link_libraries( - ${test${BLIB_LIBNAME}} ${LIB_AS_NEEDED_PRE} ${lib${BLIB_LIBNAME}} - "${BLIB_LIBRARIES_TO_LINK}" ${LIB_AS_NEEDED_POST} - ) - endif() - set_target_properties( - ${test${BLIB_LIBNAME}} - PROPERTIES OUTPUT_NAME - ns${NS3_VER}-${BLIB_LIBNAME}-test${build_profile_suffix} - ) - - target_compile_definitions( - ${test${BLIB_LIBNAME}} PRIVATE NS_TEST_SOURCEDIR="${FOLDER}/test" - ) - if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${IGNORE_PCH})) - target_precompile_headers(${test${BLIB_LIBNAME}} REUSE_FROM stdlib_pch) - endif() - endif() - endif() + build_lib_tests( + "${BLIB_LIBNAME}" "${BLIB_IGNORE_PCH}" "${FOLDER}" "${BLIB_TEST_SOURCES}" + ) # ... endfunction() + # This macro builds the test library for the module library + # + # Arguments: libname (e.g. core), ignore_pch (TRUE/FALSE), folder (src/contrib), + # sources (list of .cc's) + function(build_lib_tests libname ignore_pch folder test_sources) + if(${ENABLE_TESTS}) + # Check if the module tests should be built + build_lib_check_examples_and_tests_filtered_in(${libname} filtered_in) + if(NOT ${filtered_in}) + return() + endif() + list(LENGTH test_sources test_source_len) + if(${test_source_len} GREATER 0) + # Create libname of output library test of module + set(test${libname} ${libname}-test CACHE INTERNAL "") + + # Create shared library containing tests of the module on UNIX and just + # the object file that will be part of test-runner on Windows + if(WIN32) + set(ns3-libs-tests + "$;${ns3-libs-tests}" + CACHE INTERNAL "list of test libraries" + ) + add_library(${test${libname}} OBJECT "${test_sources}") + else() + set(ns3-libs-tests "${test${libname}};${ns3-libs-tests}" + CACHE INTERNAL "list of test libraries" + ) + add_library(${test${libname}} SHARED "${test_sources}") + + # Link test library to the module library + if(${NS3_MONOLIB}) + target_link_libraries( + ${test${libname}} ${LIB_AS_NEEDED_PRE} ${lib-ns3-monolib} + ${LIB_AS_NEEDED_POST} + ) + else() + target_link_libraries( + ${test${libname}} ${LIB_AS_NEEDED_PRE} ${libname} + "${BLIB_LIBRARIES_TO_LINK}" ${LIB_AS_NEEDED_POST} + ) + endif() + set_target_properties( + ${test${libname}} + PROPERTIES OUTPUT_NAME + ns${NS3_VER}-${libname}-test${build_profile_suffix} + ) + endif() + target_compile_definitions( + ${test${libname}} PRIVATE NS_TEST_SOURCEDIR="${folder}/test" + ) + if(${PRECOMPILE_HEADERS_ENABLED} AND (NOT ${ignore_pch})) + target_precompile_headers(${test${libname}} REUSE_FROM stdlib_pch) + endif() + + # Add dependency between tests and examples used as tests + examples_as_tests_dependencies("${module_examples}" "${test_sources}") + endif() + endif() + endfunction() + + The following block checks for examples subdirectories and add them to parse their CMakeLists.txt file, creating the examples. It also scans for python examples. @@ -2676,18 +2653,36 @@ CMakeLists.txt file, creating the examples. It also scans for python examples. function(build_lib) # ... + + # Scan for C++ and Python examples and return a list of C++ examples (which + # can be set as dependencies of examples-as-test test suites) + build_lib_scan_examples(module_examples) + + # ... + endfunction() + + # This macro scans for C++ and Python examples for a given module and return a + # list of C++ examples + # + # Arguments: module_cpp_examples = return list of C++ examples + function(build_lib_scan_examples module_cpp_examples) # Build lib examples if requested - if(${ENABLE_EXAMPLES}) - foreach(example_folder example;examples) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) + set(examples_before ${ns3-execs-clean}) + foreach(example_folder example;examples) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) + if(${ENABLE_EXAMPLES}) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}/CMakeLists.txt) add_subdirectory(${example_folder}) endif() - scan_python_examples(${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) endif() - endforeach() - endif() - # ... + scan_python_examples(${CMAKE_CURRENT_SOURCE_DIR}/${example_folder}) + endif() + endforeach() + set(module_examples ${ns3-execs-clean}) + + # Return a list of module c++ examples (current examples - previous examples) + list(REMOVE_ITEM module_examples ${examples_before}) + set(${module_cpp_examples} ${module_examples} PARENT_SCOPE) endfunction() In the next code block we add the library to the ``ns3ExportTargets``, later used for installation. @@ -2699,7 +2694,7 @@ We also print an additional message the folder just finished being processed if # ... # Handle package export install( - TARGETS ${lib${BLIB_LIBNAME}} + TARGETS ${BLIB_LIBNAME} EXPORT ns3ExportTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ diff --git a/doc/models/source/conf.py b/doc/models/source/conf.py index 2fbed33d8..7b24da99d 100644 --- a/doc/models/source/conf.py +++ b/doc/models/source/conf.py @@ -74,9 +74,9 @@ copyright = "2006-2019, ns-3 project" # built documents. # # The short X.Y version. -version = "ns-3.42" +version = "ns-3.43" # The full version, including alpha/beta/rc tags. -release = "ns-3.42" +release = "ns-3.43" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/ns3_html_theme/get_version.sh b/doc/ns3_html_theme/get_version.sh index 70c11161b..4bb6f1314 100755 --- a/doc/ns3_html_theme/get_version.sh +++ b/doc/ns3_html_theme/get_version.sh @@ -137,13 +137,13 @@ fi outf="doc/ns3_html_theme/static/ns3_version.js" # Distance from last tag -# 'git describe HEAD --tags' will return a string such as either +# 'git describe HEAD --tags --long' will return a string such as either # 'ns-3.29-159-xxx' (if we are at a distance from the last release tag) or # 'ns-3.29' if we are at the tag. -distance=`git describe HEAD --tags | cut -d '-' -f 3- | cut -d '-' -f 1` +distance=`git describe HEAD --tags --long | cut -d '-' -f 3` -if [ $distance -eq 1 ]; then - version=`git describe HEAD --tags | cut -d '-' -f 2` +if [ $distance -eq 1 ] | [ $distance -eq 0 ]; then + version=`git describe HEAD --tags --long | cut -d '-' -f 2` say "at version $version" elif [ $tag -eq 1 ]; then @@ -152,7 +152,7 @@ elif [ $tag -eq 1 ]; then vers_href= else - version=`git describe HEAD --tags | cut -d '-' -f 3- | cut -d '-' -f 2 | cut -c 2-` + version=`git describe HEAD --tags --long | cut -d '-' -f 3- | cut -d '-' -f 2 | cut -c 2-` # Check for uncommitted changes changes=0 if [ "$(git status --porcelain)" ]; then diff --git a/doc/tutorial/source/conceptual-overview.rst b/doc/tutorial/source/conceptual-overview.rst index fb24257ab..dd5dbcc68 100644 --- a/doc/tutorial/source/conceptual-overview.rst +++ b/doc/tutorial/source/conceptual-overview.rst @@ -179,18 +179,7 @@ text and an author listed below. :: /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ Module Includes diff --git a/doc/tutorial/source/conf.py b/doc/tutorial/source/conf.py index 6f1dee1bc..379cf595c 100644 --- a/doc/tutorial/source/conf.py +++ b/doc/tutorial/source/conf.py @@ -71,9 +71,9 @@ copyright = "2006-2019, ns-3 project" # built documents. # # The short X.Y version. -version = "ns-3.42" +version = "ns-3.43" # The full version, including alpha/beta/rc tags. -release = "ns-3.42" +release = "ns-3.43" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/tutorial/source/getting-started.rst b/doc/tutorial/source/getting-started.rst index de32de195..525e5d7b6 100644 --- a/doc/tutorial/source/getting-started.rst +++ b/doc/tutorial/source/getting-started.rst @@ -61,14 +61,14 @@ the project provides an installation guide for various systems, available at https://www.nsnam.org/docs/installation/html/index.html. -As of the most recent |ns3| release (ns-3.42), the following tools +As of the most recent |ns3| release (ns-3.43), the following tools are needed to get started with |ns3|: ============ =========================================================== Prerequisite Package/version ============ =========================================================== C++ compiler ``clang++`` or ``g++`` (g++ version 9 or greater) -Python ``python3`` version >=3.6 +Python ``python3`` version >=3.8 CMake ``cmake`` version >=3.13 Build system ``make``, ``ninja``, ``xcodebuild`` (XCode) Git any recent version (to access |ns3| from `GitLab.com `_) @@ -116,21 +116,21 @@ get a copy of a release by typing the following into your Linux shell $ cd $ mkdir workspace $ cd workspace - $ wget https://www.nsnam.org/release/ns-allinone-3.42.tar.bz2 - $ tar xjf ns-allinone-3.42.tar.bz2 + $ wget https://www.nsnam.org/release/ns-allinone-3.43.tar.bz2 + $ tar xjf ns-allinone-3.43.tar.bz2 Notice the use above of the ``wget`` utility, which is a command-line tool to fetch objects from the web; if you do not have this installed, you can use a browser for this step. Following these steps, if you change into the directory -``ns-allinone-3.42``, you should see a number of files and directories +``ns-allinone-3.43``, you should see a number of files and directories .. sourcecode:: text - $ cd ns-allinone-3.42 + $ cd ns-allinone-3.43 $ ls - bake build.py constants.py netanim-3.109 ns-3.42 README.md util.py + bake build.py constants.py netanim-3.109 ns-3.43 README.md util.py You are now ready to build the base |ns3| distribution and may skip ahead to the section on building |ns3|. @@ -180,7 +180,7 @@ release number: .. sourcecode:: console - $ python3 download.py -n ns-3.42 + $ python3 download.py -n ns-3.43 After this step, the additional repositories of |ns3|, bake, pybindgen, and netanim will be downloaded to the ``ns-3-allinone`` directory. @@ -249,9 +249,9 @@ distribution of your choice. There are a few configuration targets available: -1. ``ns-3.42``: the code corresponding to the release +1. ``ns-3.43``: the code corresponding to the release 2. ``ns-3-dev``: a similar module but using the development code tree -3. ``ns-allinone-3.42``: the module that includes other optional features +3. ``ns-allinone-3.43``: the module that includes other optional features such as bake build system, netanim animator, and pybindgen 4. ``ns-3-allinone``: similar to the released version of the allinone module, but for development code. @@ -268,7 +268,7 @@ code either by inspection of the repository list or by going to the `"ns-3 Releases" `_ web page and clicking on the latest release link. We'll proceed in -this tutorial example with ``ns-3.42``. +this tutorial example with ``ns-3.43``. We are now going to use the bake tool to pull down the various pieces of |ns3| you will be using. First, we'll say a word about running bake. @@ -297,7 +297,7 @@ Step into the workspace directory and type the following into your shell: .. sourcecode:: console - $ ./bake.py configure -e ns-allinone-3.42 + $ ./bake.py configure -e ns-allinone-3.43 Next, we'll ask bake to check whether we have enough tools to download various components. Type: @@ -347,7 +347,7 @@ should yield something like: >> Downloading click-ns-3.37 - OK >> Downloading BRITE - OK >> Downloading openflow-dev - OK - >> Downloading ns-3.42 (target directory:ns-3.42) - OK + >> Downloading ns-3.43 (target directory:ns-3.43) - OK The above suggests that three sources have been downloaded. Check the ``source`` directory now and type ``ls``; one should see: @@ -356,7 +356,7 @@ The above suggests that three sources have been downloaded. Check the $ cd source $ ls - BRITE click-ns-3.37 netanim-3.109 ns-3.42 openflow-dev + BRITE click-ns-3.37 netanim-3.109 ns-3.43 openflow-dev You are now ready to build the |ns3| distribution. @@ -386,7 +386,7 @@ native |ns3| build system, CMake, to be introduced later in this tutorial. If you downloaded using a tarball you should have a directory called something like -``ns-allinone-3.42`` under your ``~/workspace`` directory. +``ns-allinone-3.43`` under your ``~/workspace`` directory. Type the following: .. sourcecode:: console @@ -419,7 +419,7 @@ and you should see something like: .. sourcecode:: text >> Building netanim-3.109 - OK - >> Building ns-3.42 - OK + >> Building ns-3.43 - OK There may be failures to build all components, but the build will proceed anyway if the component is optional. diff --git a/doc/tutorial/source/quick-start.rst b/doc/tutorial/source/quick-start.rst index b2a76e5c6..fc7d4e9da 100644 --- a/doc/tutorial/source/quick-start.rst +++ b/doc/tutorial/source/quick-start.rst @@ -33,7 +33,7 @@ does not cover those aspects. Prerequisites ************* |ns3| has various optional extensions, but the main features just require -a C++ compiler (g++ or clang++), Python (version 3.6 or above), CMake and +a C++ compiler (g++ or clang++), Python (version 3.8 or above), CMake and a build-system (e.g. make, ninja, Xcode). We focus in this chapter only on getting |ns3| up and running on a system supported by a recent C++ compiler and Python runtime support. @@ -64,13 +64,13 @@ Downloading the Latest Release :: - $ tar xjf ns-allinone-3.42.tar.bz2 + $ tar xjf ns-allinone-3.43.tar.bz2 3) Change into the |ns3| directory directly; e.g. :: - $ cd ns-allinone-3.42/ns-3.42 + $ cd ns-allinone-3.43/ns-3.43 The ns-allinone directory has some additional components but we are skipping over them here; one can work directly from the |ns3| source code directory. @@ -92,12 +92,12 @@ only to `cd` into ns-3-dev; the `master` branch is checked out by default. $ cd ns-3-dev -If instead you want to try the most recent release (version 3.42 as of this +If instead you want to try the most recent release (version 3.43 as of this writing), you can checkout a branch corresponding to that git tag: :: - $ git checkout -b ns-3.42-branch ns-3.42 + $ git checkout -b ns-3.43-branch ns-3.43 Building and testing ns-3 ************************* diff --git a/doc/tutorial/source/resources.rst b/doc/tutorial/source/resources.rst index fc4301444..f42c8673b 100644 --- a/doc/tutorial/source/resources.rst +++ b/doc/tutorial/source/resources.rst @@ -36,7 +36,7 @@ as its source code management system, but in December 2018, switch to using Git. Although you do not need to know much about Git in order to complete this tutorial, we recommend becoming familiar with Git and using it to access the source code. GitLab.com provides resources to get started -at: https://docs.gitlab.com/ee/gitlab-basics/. +at: https://docs.gitlab.com/ee/tutorials/. CMake ***** diff --git a/doc/tutorial/source/tracing.rst b/doc/tutorial/source/tracing.rst index 8ba188d48..bda23e2fa 100644 --- a/doc/tutorial/source/tracing.rst +++ b/doc/tutorial/source/tracing.rst @@ -314,18 +314,7 @@ example of tracing that can be assembled. You can find this code in the tutorial directory as ``fourth.cc``. Let's walk through it:: /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/object.h" @@ -625,7 +614,7 @@ for "CourseChange" in your favorite editor. You should find .AddTraceSource("CourseChange", "The value of the position and/or velocity vector changed", MakeTraceSourceAccessor(&MobilityModel::m_courseChangeTrace), - "ns3::MobilityModel::CourseChangeCallback") + "ns3::MobilityModel::TracedCallback"); which should look very familiar at this point. @@ -634,14 +623,14 @@ variable in ``mobility-model.h`` you will find :: - TracedCallback> m_courseChangeTrace; + ns3::TracedCallback> m_courseChangeTrace; The type declaration ``TracedCallback`` identifies ``m_courseChangeTrace`` as a special list of Callbacks that can be hooked using the Config functions described above. The ``typedef`` for the callback function signature is also defined in the header file:: - typedef void (* CourseChangeCallback)(Ptr * model); + typedef void (*TracedCallback)(Ptr model); The ``MobilityModel`` class is designed to be a base class providing a common interface for all of the specific subclasses. If you search @@ -651,7 +640,7 @@ down to the end of the file, you will see a method defined called void MobilityModel::NotifyCourseChange() const { - m_courseChangeTrace(this); + m_courseChangeTrace(this); } Derived classes will call into this method whenever they do a course @@ -1390,18 +1379,7 @@ dissecting the congestion window test. Open see some familiar looking code:: /* - * 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, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0-only */ #include "tutorial-app.h" diff --git a/examples/channel-models/three-gpp-v2v-channel-example.cc b/examples/channel-models/three-gpp-v2v-channel-example.cc index 783077656..2a2dee10a 100644 --- a/examples/channel-models/three-gpp-v2v-channel-example.cc +++ b/examples/channel-models/three-gpp-v2v-channel-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020, University of Padova, Dep. of Information Engineering, SIGNET lab * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/channel-models/three-gpp-v2v-channel-example.sh b/examples/channel-models/three-gpp-v2v-channel-example.sh index e8eee69ae..0e460fef6 100644 --- a/examples/channel-models/three-gpp-v2v-channel-example.sh +++ b/examples/channel-models/three-gpp-v2v-channel-example.sh @@ -2,18 +2,7 @@ # Copyright (c) 2020, University of Padova, Dep. of Information Engineering, SIGNET lab # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Plot the traces generated by three-gpp-vehicular-channel-condition-model-example diff --git a/examples/energy/energy-model-example.cc b/examples/energy/energy-model-example.cc index 89e352b50..90ca58e9b 100644 --- a/examples/energy/energy-model-example.cc +++ b/examples/energy/energy-model-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sidharth Nabar , He Wu */ diff --git a/examples/energy/energy-model-with-harvesting-example.cc b/examples/energy/energy-model-with-harvesting-example.cc index 6c1ae96c9..9153b3b65 100644 --- a/examples/energy/energy-model-with-harvesting-example.cc +++ b/examples/energy/energy-model-with-harvesting-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/examples/error-model/simple-error-model.cc b/examples/error-model/simple-error-model.cc index 38c0c9402..c60e358bd 100644 --- a/examples/error-model/simple-error-model.cc +++ b/examples/error-model/simple-error-model.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/ipv6/fragmentation-ipv6-PMTU.cc b/examples/ipv6/fragmentation-ipv6-PMTU.cc index b25c2b0ab..342deb27f 100644 --- a/examples/ipv6/fragmentation-ipv6-PMTU.cc +++ b/examples/ipv6/fragmentation-ipv6-PMTU.cc @@ -3,18 +3,7 @@ * Copyright (c) 2013 Universita' di Firenze * Copyright (c) 2022 Jadavpur University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/ipv6/fragmentation-ipv6-two-MTU.cc b/examples/ipv6/fragmentation-ipv6-two-MTU.cc index 8a58cb80c..1bf149f04 100644 --- a/examples/ipv6/fragmentation-ipv6-two-MTU.cc +++ b/examples/ipv6/fragmentation-ipv6-two-MTU.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008-2009 Strasbourg University * Copyright (c) 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/ipv6/fragmentation-ipv6.cc b/examples/ipv6/fragmentation-ipv6.cc index 5708739a1..ab622c86e 100644 --- a/examples/ipv6/fragmentation-ipv6.cc +++ b/examples/ipv6/fragmentation-ipv6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/ipv6/icmpv6-redirect.cc b/examples/ipv6/icmpv6-redirect.cc index 4497f5e63..f74826731 100644 --- a/examples/ipv6/icmpv6-redirect.cc +++ b/examples/ipv6/icmpv6-redirect.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/examples/ipv6/loose-routing-ipv6.cc b/examples/ipv6/loose-routing-ipv6.cc index f18876fd2..4fbe1ffc2 100644 --- a/examples/ipv6/loose-routing-ipv6.cc +++ b/examples/ipv6/loose-routing-ipv6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/examples/ipv6/ping6-example.cc b/examples/ipv6/ping6-example.cc index 2a516bca3..0a7d86141 100644 --- a/examples/ipv6/ping6-example.cc +++ b/examples/ipv6/ping6-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/examples/ipv6/radvd-one-prefix.cc b/examples/ipv6/radvd-one-prefix.cc index 344536067..035cdfd65 100644 --- a/examples/ipv6/radvd-one-prefix.cc +++ b/examples/ipv6/radvd-one-prefix.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/ipv6/radvd-two-prefix.cc b/examples/ipv6/radvd-two-prefix.cc index a9633ec1a..af3fd86d4 100644 --- a/examples/ipv6/radvd-two-prefix.cc +++ b/examples/ipv6/radvd-two-prefix.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/ipv6/test-ipv6.cc b/examples/ipv6/test-ipv6.cc index a168bcf07..7f41d1f03 100644 --- a/examples/ipv6/test-ipv6.cc +++ b/examples/ipv6/test-ipv6.cc @@ -1,18 +1,7 @@ /* * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Angelos Chatzipapas / * diff --git a/examples/ipv6/wsn-ping6.cc b/examples/ipv6/wsn-ping6.cc index 54d81a575..d879f4f93 100644 --- a/examples/ipv6/wsn-ping6.cc +++ b/examples/ipv6/wsn-ping6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ @@ -85,6 +74,8 @@ main(int argc, char** argv) NS_LOG_INFO("Create channels."); LrWpanHelper lrWpanHelper; + lrWpanHelper.SetPropagationDelayModel("ns3::ConstantSpeedPropagationDelayModel"); + lrWpanHelper.AddPropagationLossModel("ns3::LogDistancePropagationLossModel"); // Add and install the LrWpanNetDevice for each node // lrWpanHelper.EnableLogComponents(); NetDeviceContainer devContainer = lrWpanHelper.Install(nodes); diff --git a/examples/matrix-topology/matrix-topology.cc b/examples/matrix-topology/matrix-topology.cc index 6203ec9b4..eb02f34e1 100644 --- a/examples/matrix-topology/matrix-topology.cc +++ b/examples/matrix-topology/matrix-topology.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Egemen K. Cetinkaya, Justin P. Rohrer, and Amit Dandekar * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Egemen K. Cetinkaya * Author: Justin P. Rohrer diff --git a/examples/naming/object-names.cc b/examples/naming/object-names.cc index f52678eca..3f392681b 100644 --- a/examples/naming/object-names.cc +++ b/examples/naming/object-names.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/realtime/realtime-udp-echo.cc b/examples/realtime/realtime-udp-echo.cc index 5b3da0783..6eeab1673 100644 --- a/examples/realtime/realtime-udp-echo.cc +++ b/examples/realtime/realtime-udp-echo.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/realtime/realtime-udp-echo.py b/examples/realtime/realtime-udp-echo.py index 17fd2088a..9292980f2 100644 --- a/examples/realtime/realtime-udp-echo.py +++ b/examples/realtime/realtime-udp-echo.py @@ -1,16 +1,5 @@ # -# * 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 +# * SPDX-License-Identifier: GPL-2.0-only # Network topology # diff --git a/examples/routing/dynamic-global-routing.cc b/examples/routing/dynamic-global-routing.cc index a4484df3a..1b5c1b4b4 100644 --- a/examples/routing/dynamic-global-routing.cc +++ b/examples/routing/dynamic-global-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Contributed by: Luis Cortes (cortes@gatech.edu) */ diff --git a/examples/routing/global-injection-slash32.cc b/examples/routing/global-injection-slash32.cc index ff48313f3..8ce5dbae6 100644 --- a/examples/routing/global-injection-slash32.cc +++ b/examples/routing/global-injection-slash32.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/routing/global-routing-multi-switch-plus-router.cc b/examples/routing/global-routing-multi-switch-plus-router.cc index 1b0fdbdc6..50b7649aa 100644 --- a/examples/routing/global-routing-multi-switch-plus-router.cc +++ b/examples/routing/global-routing-multi-switch-plus-router.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 - Chip Webb * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Chip Webb * diff --git a/examples/routing/global-routing-slash32.cc b/examples/routing/global-routing-slash32.cc index 55ee91d06..f8afe7452 100644 --- a/examples/routing/global-routing-slash32.cc +++ b/examples/routing/global-routing-slash32.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/routing/manet-routing-compare.cc b/examples/routing/manet-routing-compare.cc index a105ab0d2..50ae5487e 100644 --- a/examples/routing/manet-routing-compare.cc +++ b/examples/routing/manet-routing-compare.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 University of Kansas * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Justin Rohrer * diff --git a/examples/routing/mixed-global-routing.cc b/examples/routing/mixed-global-routing.cc index 9a14011b7..bac2ae237 100644 --- a/examples/routing/mixed-global-routing.cc +++ b/examples/routing/mixed-global-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/routing/rip-simple-network.cc b/examples/routing/rip-simple-network.cc index aa2efa011..0bca62c6b 100644 --- a/examples/routing/rip-simple-network.cc +++ b/examples/routing/rip-simple-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/examples/routing/ripng-simple-network.cc b/examples/routing/ripng-simple-network.cc index 744b80f58..59f1c3e09 100644 --- a/examples/routing/ripng-simple-network.cc +++ b/examples/routing/ripng-simple-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/examples/routing/simple-alternate-routing.cc b/examples/routing/simple-alternate-routing.cc index 4273d4fc6..04cac0c4e 100644 --- a/examples/routing/simple-alternate-routing.cc +++ b/examples/routing/simple-alternate-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/routing/simple-global-routing.cc b/examples/routing/simple-global-routing.cc index 9efd8cca8..f36e34dab 100644 --- a/examples/routing/simple-global-routing.cc +++ b/examples/routing/simple-global-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/routing/simple-multicast-flooding.cc b/examples/routing/simple-multicast-flooding.cc index 9f6c81428..73f165fc1 100644 --- a/examples/routing/simple-multicast-flooding.cc +++ b/examples/routing/simple-multicast-flooding.cc @@ -2,18 +2,7 @@ * Copyright (c) 2013 Universita' di Firenze * Copyright (c) 2019 Caliola Engineering, LLC : RFC 6621 multicast packet de-duplication * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella * Modified (2019): Jared Dulmage diff --git a/examples/routing/simple-routing-ping6.cc b/examples/routing/simple-routing-ping6.cc index 0309ed3b5..512615d58 100644 --- a/examples/routing/simple-routing-ping6.cc +++ b/examples/routing/simple-routing-ping6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross * Sebastien Vincent diff --git a/examples/routing/simple-routing-ping6.py b/examples/routing/simple-routing-ping6.py index b8a0f0b4e..c380b033b 100644 --- a/examples/routing/simple-routing-ping6.py +++ b/examples/routing/simple-routing-ping6.py @@ -1,18 +1,7 @@ # # Copyright (c) 2008-2009 Strasbourg University # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: David Gross # Sebastien Vincent diff --git a/examples/routing/static-routing-slash32.cc b/examples/routing/static-routing-slash32.cc index bd4188d3d..d677c60fc 100644 --- a/examples/routing/static-routing-slash32.cc +++ b/examples/routing/static-routing-slash32.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/socket/socket-bound-static-routing.cc b/examples/socket/socket-bound-static-routing.cc index c34e596cd..b77a9eaf7 100644 --- a/examples/socket/socket-bound-static-routing.cc +++ b/examples/socket/socket-bound-static-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/socket/socket-bound-tcp-static-routing.cc b/examples/socket/socket-bound-tcp-static-routing.cc index dc88e4366..19c744017 100644 --- a/examples/socket/socket-bound-tcp-static-routing.cc +++ b/examples/socket/socket-bound-tcp-static-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/socket/socket-options-ipv4.cc b/examples/socket/socket-options-ipv4.cc index 774a5876d..a2ac266be 100644 --- a/examples/socket/socket-options-ipv4.cc +++ b/examples/socket/socket-options-ipv4.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/socket/socket-options-ipv6.cc b/examples/socket/socket-options-ipv6.cc index 067e5d1fc..5344b567d 100644 --- a/examples/socket/socket-options-ipv6.cc +++ b/examples/socket/socket-options-ipv6.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/stats/wifi-example-apps.cc b/examples/stats/wifi-example-apps.cc index ff5e1e2e7..9967612f2 100644 --- a/examples/stats/wifi-example-apps.cc +++ b/examples/stats/wifi-example-apps.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Joe Kopena * diff --git a/examples/stats/wifi-example-apps.h b/examples/stats/wifi-example-apps.h index e65a2c2c0..b68e18f9d 100644 --- a/examples/stats/wifi-example-apps.h +++ b/examples/stats/wifi-example-apps.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Joe Kopena * diff --git a/examples/stats/wifi-example-sim.cc b/examples/stats/wifi-example-sim.cc index d2238254b..103fde19c 100644 --- a/examples/stats/wifi-example-sim.cc +++ b/examples/stats/wifi-example-sim.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Joe Kopena * diff --git a/examples/tcp/dctcp-example.cc b/examples/tcp/dctcp-example.cc index 9d8e080ee..e8843ba46 100644 --- a/examples/tcp/dctcp-example.cc +++ b/examples/tcp/dctcp-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2017-20 NITK Surathkal * Copyright (c) 2020 Tom Henderson (better alignment with experiment) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Shravya K.S. * Apoorva Bhargava diff --git a/examples/tcp/star.cc b/examples/tcp/star.cc index d680e5a76..30f51b5ac 100644 --- a/examples/tcp/star.cc +++ b/examples/tcp/star.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/tcp/tcp-bbr-example.cc b/examples/tcp/tcp-bbr-example.cc index 729c4b3fa..52d655691 100644 --- a/examples/tcp/tcp-bbr-example.cc +++ b/examples/tcp/tcp-bbr-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018-20 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Aarti Nandagiri * Vivek Jain @@ -41,7 +30,7 @@ // * bbr-3-0.pcap for the first interface on R2 // * bbr-3-1.pcap for the second interface on R2 // (2) cwnd.dat file contains congestion window trace for the sender node -// (3) throughput.dat file contains sender side throughput trace +// (3) throughput.dat file contains sender side throughput trace (throughput is in Mbit/s) // (4) queueSize.dat file contains queue length trace from the bottleneck link // // BBR algorithm enters PROBE_RTT phase in every 10 seconds. The congestion @@ -81,9 +70,12 @@ TraceThroughput(Ptr monitor) { auto itr = stats.begin(); Time curTime = Now(); - throughput << curTime << " " + + // Convert (curTime - prevTime) to microseconds so that throughput is in bits per + // microsecond (which is equivalent to Mbps) + throughput << curTime.GetSeconds() << "s " << 8 * (itr->second.txBytes - prev) / ((curTime - prevTime).ToDouble(Time::US)) - << std::endl; + << " Mbps" << std::endl; prevTime = curTime; prev = itr->second.txBytes; } diff --git a/examples/tcp/tcp-bulk-send.cc b/examples/tcp/tcp-bulk-send.cc index 427ff9901..5bc21e578 100644 --- a/examples/tcp/tcp-bulk-send.cc +++ b/examples/tcp/tcp-bulk-send.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/tcp/tcp-large-transfer.cc b/examples/tcp/tcp-large-transfer.cc index 98ecbb8b7..b59b65b20 100644 --- a/examples/tcp/tcp-large-transfer.cc +++ b/examples/tcp/tcp-large-transfer.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/tcp/tcp-linux-reno.cc b/examples/tcp/tcp-linux-reno.cc index 85bbcde9c..5a8c90d7a 100644 --- a/examples/tcp/tcp-linux-reno.cc +++ b/examples/tcp/tcp-linux-reno.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Apoorva Bhargava */ diff --git a/examples/tcp/tcp-pacing.cc b/examples/tcp/tcp-pacing.cc index 2b061654b..4d8f964a5 100644 --- a/examples/tcp/tcp-pacing.cc +++ b/examples/tcp/tcp-pacing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Vivek Jain * Deepak Kumaraswamy diff --git a/examples/tcp/tcp-pcap-nanosec-example.cc b/examples/tcp/tcp-pcap-nanosec-example.cc index eed95060a..265896a11 100644 --- a/examples/tcp/tcp-pcap-nanosec-example.cc +++ b/examples/tcp/tcp-pcap-nanosec-example.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // ============================================================ // diff --git a/examples/tcp/tcp-star-server.cc b/examples/tcp/tcp-star-server.cc index 8bd51e038..a725a57f2 100644 --- a/examples/tcp/tcp-star-server.cc +++ b/examples/tcp/tcp-star-server.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/tcp/tcp-validation.cc b/examples/tcp/tcp-validation.cc index 18ee32031..cc383dd8d 100644 --- a/examples/tcp/tcp-validation.cc +++ b/examples/tcp/tcp-validation.cc @@ -2,34 +2,7 @@ * Copyright (c) 2019 Cable Television Laboratories, Inc. * Copyright (c) 2020 Tom Henderson (adapted for DCTCP testing) * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, provided that this notice is retained in full, this - * software may be distributed under the terms of the GNU General - * Public License ("GPL") version 2, in which case the provisions of the - * GPL apply INSTEAD OF those given above. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: BSD-3-Clause */ // This program is designed to observe long-running TCP congestion control @@ -258,10 +231,10 @@ TraceFirstDctcp(std::ofstream* ofStream, uint32_t bytesMarked, uint32_t bytesAck NS_LOG_WARN("now " << Now().As(Time::S) << " alpha " << alpha << " (expected <= 0.1)"); g_validationFailed = true; } - if ((now > 7) && ((alpha > 0.09) || (alpha < 0.055))) + if ((now > 7) && ((alpha > 0.09) || (alpha < 0.049))) { NS_LOG_WARN("now " << Now().As(Time::S) << " alpha " << alpha - << " (expected 0.09 <= alpha <= 0.055)"); + << " (expected 0.09 <= alpha <= 0.049)"); g_validationFailed = true; } } diff --git a/examples/tcp/tcp-variants-comparison.cc b/examples/tcp/tcp-variants-comparison.cc index 4859e865f..caa8309e2 100644 --- a/examples/tcp/tcp-variants-comparison.cc +++ b/examples/tcp/tcp-variants-comparison.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Justin P. Rohrer, Truc Anh N. Nguyen , Siddharth Gangadhar * diff --git a/examples/traffic-control/CMakeLists.txt b/examples/traffic-control/CMakeLists.txt index 8d79c4bb9..cd5fe5607 100644 --- a/examples/traffic-control/CMakeLists.txt +++ b/examples/traffic-control/CMakeLists.txt @@ -1,6 +1,6 @@ build_example( - NAME traffic-control - SOURCE_FILES traffic-control.cc + NAME traffic-control-example + SOURCE_FILES traffic-control-example.cc LIBRARIES_TO_LINK ${libinternet} ${libpoint-to-point} diff --git a/examples/traffic-control/cobalt-vs-codel.cc b/examples/traffic-control/cobalt-vs-codel.cc index ac098d8af..6609b4d58 100644 --- a/examples/traffic-control/cobalt-vs-codel.cc +++ b/examples/traffic-control/cobalt-vs-codel.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Shefali Gupta * Jendaipou Palmei diff --git a/examples/traffic-control/queue-discs-benchmark.cc b/examples/traffic-control/queue-discs-benchmark.cc index 87eee9f3e..1298c96a2 100644 --- a/examples/traffic-control/queue-discs-benchmark.cc +++ b/examples/traffic-control/queue-discs-benchmark.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pasquale Imputato * Stefano Avallone diff --git a/examples/traffic-control/red-vs-fengadaptive.cc b/examples/traffic-control/red-vs-fengadaptive.cc index 22011da7c..f4764fdaa 100644 --- a/examples/traffic-control/red-vs-fengadaptive.cc +++ b/examples/traffic-control/red-vs-fengadaptive.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sourabh Jain * Mohit P. Tahiliani diff --git a/examples/traffic-control/red-vs-nlred.cc b/examples/traffic-control/red-vs-nlred.cc index 05a3403a1..1eff4bfb9 100644 --- a/examples/traffic-control/red-vs-nlred.cc +++ b/examples/traffic-control/red-vs-nlred.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Phani Kiran S V S * Nichit Bodhak Goel diff --git a/examples/traffic-control/tbf-example.cc b/examples/traffic-control/tbf-example.cc index 096e543a1..bd9ade7e9 100644 --- a/examples/traffic-control/tbf-example.cc +++ b/examples/traffic-control/tbf-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2015 Universita' degli Studi di Napoli "Federico II" * 2017 Kungliga Tekniska Högskolan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato * Author: Stefano Avallone diff --git a/examples/traffic-control/traffic-control.cc b/examples/traffic-control/traffic-control-example.cc similarity index 93% rename from examples/traffic-control/traffic-control.cc rename to examples/traffic-control/traffic-control-example.cc index ee1a1cf84..4ef439ac0 100644 --- a/examples/traffic-control/traffic-control.cc +++ b/examples/traffic-control/traffic-control-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Universita' degli Studi di Napoli "Federico II" * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato * Author: Stefano Avallone diff --git a/examples/tutorial/fifth.cc b/examples/tutorial/fifth.cc index c1b6153ad..f840c9b0b 100644 --- a/examples/tutorial/fifth.cc +++ b/examples/tutorial/fifth.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "tutorial-app.h" diff --git a/examples/tutorial/first.cc b/examples/tutorial/first.cc index 89c88891d..262741bf7 100644 --- a/examples/tutorial/first.cc +++ b/examples/tutorial/first.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/applications-module.h" diff --git a/examples/tutorial/first.py b/examples/tutorial/first.py index 8a10ae7e3..ef753b330 100644 --- a/examples/tutorial/first.py +++ b/examples/tutorial/first.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # try: diff --git a/examples/tutorial/fourth.cc b/examples/tutorial/fourth.cc index 460e373a4..93f2527df 100644 --- a/examples/tutorial/fourth.cc +++ b/examples/tutorial/fourth.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/object.h" diff --git a/examples/tutorial/hello-simulator.cc b/examples/tutorial/hello-simulator.cc index 86ae3aa3a..3e5ed60c5 100644 --- a/examples/tutorial/hello-simulator.cc +++ b/examples/tutorial/hello-simulator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/core-module.h" diff --git a/examples/tutorial/second.cc b/examples/tutorial/second.cc index a732ea4bd..16983acab 100644 --- a/examples/tutorial/second.cc +++ b/examples/tutorial/second.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/applications-module.h" diff --git a/examples/tutorial/second.py b/examples/tutorial/second.py index e5621fe28..73c2a9905 100644 --- a/examples/tutorial/second.py +++ b/examples/tutorial/second.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Ported to Python by Mohit P. Tahiliani # diff --git a/examples/tutorial/seventh.cc b/examples/tutorial/seventh.cc index b17824474..c338b0b0a 100644 --- a/examples/tutorial/seventh.cc +++ b/examples/tutorial/seventh.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "tutorial-app.h" diff --git a/examples/tutorial/sixth.cc b/examples/tutorial/sixth.cc index 85f49ee12..98ec32721 100644 --- a/examples/tutorial/sixth.cc +++ b/examples/tutorial/sixth.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "tutorial-app.h" diff --git a/examples/tutorial/third.cc b/examples/tutorial/third.cc index 8356fdd39..88c418831 100644 --- a/examples/tutorial/third.cc +++ b/examples/tutorial/third.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/applications-module.h" diff --git a/examples/tutorial/third.py b/examples/tutorial/third.py index 0bd70e068..e28b7dece 100644 --- a/examples/tutorial/third.py +++ b/examples/tutorial/third.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Ported to Python by Mohit P. Tahiliani # diff --git a/examples/tutorial/tutorial-app.cc b/examples/tutorial/tutorial-app.cc index 70568dec7..99124b19e 100644 --- a/examples/tutorial/tutorial-app.cc +++ b/examples/tutorial/tutorial-app.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "tutorial-app.h" diff --git a/examples/tutorial/tutorial-app.h b/examples/tutorial/tutorial-app.h index 7ef0af004..86a6a6204 100644 --- a/examples/tutorial/tutorial-app.h +++ b/examples/tutorial/tutorial-app.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef TUTORIAL_APP_H diff --git a/examples/udp-client-server/udp-client-server.cc b/examples/udp-client-server/udp-client-server.cc index 515561656..fcb4b4cb0 100644 --- a/examples/udp-client-server/udp-client-server.cc +++ b/examples/udp-client-server/udp-client-server.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail */ diff --git a/examples/udp-client-server/udp-trace-client-server.cc b/examples/udp-client-server/udp-trace-client-server.cc index dccc61702..3b3c7a395 100644 --- a/examples/udp-client-server/udp-trace-client-server.cc +++ b/examples/udp-client-server/udp-trace-client-server.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail */ diff --git a/examples/udp/udp-echo.cc b/examples/udp/udp-echo.cc index 177ff1f51..60eca393c 100644 --- a/examples/udp/udp-echo.cc +++ b/examples/udp/udp-echo.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/examples/wireless/examples-to-run.py b/examples/wireless/examples-to-run.py index 1926ac480..1a4cf9a9d 100755 --- a/examples/wireless/examples-to-run.py +++ b/examples/wireless/examples-to-run.py @@ -85,12 +85,17 @@ cpp_examples = [ "True", ), ( - "wifi-vht-network --simulationTime=0.2s --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=620", + "wifi-vht-network --simulationTime=0.2s --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=620", "True", "True", ), ( - "wifi-vht-network --simulationTime=0.2s --useRts=1 --minExpectedThroughput=5 --maxExpectedThroughput=557", + "wifi-vht-network --simulationTime=0.2s --useRts=1 --minExpectedThroughput=5 --maxExpectedThroughput=557", + "True", + "True", + ), + ( + "wifi-vht-network --simulationTime=0.2s --useRts=0 --use80Plus80=1 --minExpectedThroughput=5 --maxExpectedThroughput=620", "True", "True", ), @@ -99,6 +104,11 @@ cpp_examples = [ "True", "True", ), + ( + "wifi-he-network --simulationTime=0.25s --frequency=5 --useRts=0 --use80Plus80=1 --minExpectedThroughput=6 --maxExpectedThroughput=844", + "True", + "True", + ), ( "wifi-he-network --simulationTime=0.3s --frequency=5 --useRts=0 --useExtendedBlockAck=1 --minExpectedThroughput=6 --maxExpectedThroughput=1033", "True", @@ -144,6 +154,11 @@ cpp_examples = [ "True", "True", ), + ( + "wifi-eht-network --simulationTime=0.1s --frequency=5 --useRts=0 --use80Plus80=1 --minExpectedThroughput=6 --maxExpectedThroughput=760", + "True", + "True", + ), ( "wifi-eht-network --simulationTime=0.1s --frequency=5 --useRts=0 --mpduBufferSize=1024 --frequency2=6 --minExpectedThroughput=7 --maxExpectedThroughput=1444", "True", @@ -165,7 +180,7 @@ cpp_examples = [ "True", ), ( - "wifi-eht-network --simulationTime=0.23s --udp=0 --downlink=1 --useRts=0 --nStations=4 --dlAckType=ACK-SU-FORMAT --enableUlOfdma=1 --enableBsrp=0 --mcs=5 --frequency2=6 --minExpectedThroughput=35 --maxExpectedThroughput=404", + "wifi-eht-network --simulationTime=0.23s --udp=0 --downlink=1 --useRts=0 --nStations=4 --dlAckType=ACK-SU-FORMAT --enableUlOfdma=1 --enableBsrp=0 --mcs=6 --frequency2=6 --minExpectedThroughput=60 --maxExpectedThroughput=430", "True", "True", ), @@ -180,7 +195,7 @@ cpp_examples = [ "True", ), ( - "wifi-eht-network --simulationTime=0.25s --udp=0 --downlink=0 --useRts=0 --nStations=4 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mpduBufferSize=1024 --mcs=7 --muSchedAccessReqInterval=45ms --frequency2=6 --minExpectedThroughput=70 --maxExpectedThroughput=550", + "wifi-eht-network --simulationTime=0.25s --udp=0 --downlink=0 --useRts=0 --nStations=4 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mpduBufferSize=1024 --mcs=8 --muSchedAccessReqInterval=45ms --frequency2=6 --minExpectedThroughput=50 --maxExpectedThroughput=550", "True", "True", ), diff --git a/examples/wireless/mixed-wired-wireless.cc b/examples/wireless/mixed-wired-wireless.cc index e800b1d01..4709a9585 100644 --- a/examples/wireless/mixed-wired-wireless.cc +++ b/examples/wireless/mixed-wired-wireless.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/examples/wireless/mixed-wired-wireless.py b/examples/wireless/mixed-wired-wireless.py index 2132135b7..8ea17de55 100644 --- a/examples/wireless/mixed-wired-wireless.py +++ b/examples/wireless/mixed-wired-wireless.py @@ -1,17 +1,5 @@ # /* -# * 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 -# * +# * SPDX-License-Identifier: GPL-2.0-only # */ # diff --git a/examples/wireless/wifi-80211e-txop.cc b/examples/wireless/wifi-80211e-txop.cc index 67d8dee65..4dd09877f 100644 --- a/examples/wireless/wifi-80211e-txop.cc +++ b/examples/wireless/wifi-80211e-txop.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Sébastien Deronne * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -96,7 +85,7 @@ main(int argc, char* argv[]) { uint32_t payloadSize{1472}; // bytes Time simulationTime{"10s"}; - double distance{5}; // meters + meter_u distance{5}; bool enablePcap{false}; bool verifyResults{false}; // used for regression Time txopLimit{"4096us"}; diff --git a/examples/wireless/wifi-80211n-mimo.cc b/examples/wireless/wifi-80211n-mimo.cc index 549f696e7..f1ca276d6 100644 --- a/examples/wireless/wifi-80211n-mimo.cc +++ b/examples/wireless/wifi-80211n-mimo.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -216,7 +205,7 @@ main(int argc, char* argv[]) /* Setting applications */ const auto maxLoad = HtPhy::GetDataRate(i, channelBonding ? 40 : 20, - shortGuardInterval ? 400 : 800, + NanoSeconds(shortGuardInterval ? 400 : 800), nStreams); ApplicationContainer serverApp; if (udp) diff --git a/examples/wireless/wifi-adhoc.cc b/examples/wireless/wifi-adhoc.cc index 37fc872c5..4e465d328 100644 --- a/examples/wireless/wifi-adhoc.cc +++ b/examples/wireless/wifi-adhoc.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/examples/wireless/wifi-aggregation.cc b/examples/wireless/wifi-aggregation.cc index 69ad3b452..24652e04c 100644 --- a/examples/wireless/wifi-aggregation.cc +++ b/examples/wireless/wifi-aggregation.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Sébastien Deronne * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -84,7 +73,7 @@ main(int argc, char* argv[]) { uint32_t payloadSize{1472}; // bytes Time simulationTime{"10s"}; - double distance{5}; // meters + meter_u distance{5}; bool enableRts{false}; bool enablePcap{false}; bool verifyResults{false}; // used for regression diff --git a/examples/wireless/wifi-ap.cc b/examples/wireless/wifi-ap.cc index 888f336ca..8e1b411fc 100644 --- a/examples/wireless/wifi-ap.cc +++ b/examples/wireless/wifi-ap.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/examples/wireless/wifi-ap.py b/examples/wireless/wifi-ap.py index e97f0ff9a..c6a48a3cf 100644 --- a/examples/wireless/wifi-ap.py +++ b/examples/wireless/wifi-ap.py @@ -3,18 +3,7 @@ # * Copyright (c) 2005,2006,2007 INRIA # * Copyright (c) 2009 INESC Porto # * -# * 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 +# * SPDX-License-Identifier: GPL-2.0-only # * # * Authors: Mathieu Lacage # * Gustavo Carneiro diff --git a/examples/wireless/wifi-backward-compatibility.cc b/examples/wireless/wifi-backward-compatibility.cc index e90e55cea..f0d19cad8 100644 --- a/examples/wireless/wifi-backward-compatibility.cc +++ b/examples/wireless/wifi-backward-compatibility.cc @@ -1,22 +1,12 @@ /* * Copyright (c) 2017 * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ +#include "ns3/attribute-container.h" #include "ns3/boolean.h" #include "ns3/command-line.h" #include "ns3/config.h" @@ -150,7 +140,10 @@ main(int argc, char* argv[]) WifiMacHelper mac; WifiHelper wifi; Ssid ssid = Ssid("ns3"); - TupleValue, UintegerValue> channelValue; + AttributeContainerValue< + TupleValue, UintegerValue>, + ';'> + channelValue; const auto& [staStandard, staBand] = ConvertStringToStandardAndBand(staVersion); wifi.SetStandard(staStandard); @@ -160,7 +153,7 @@ main(int argc, char* argv[]) // Workaround needed as long as we do not fully support channel bonding uint16_t width = (staVersion == "80211ac" ? 20 : 0); - channelValue.Set(WifiPhy::ChannelTuple{0, width, staBand, 0}); + channelValue.Set(WifiPhy::ChannelSegments{{0, width, staBand, 0}}); phy.Set("ChannelSettings", channelValue); NetDeviceContainer staDevice; @@ -174,7 +167,7 @@ main(int argc, char* argv[]) // Workaround needed as long as we do not fully support channel bonding width = (apVersion == "80211ac" ? 20 : 0); - channelValue.Set(WifiPhy::ChannelTuple{0, width, apBand, 0}); + channelValue.Set(WifiPhy::ChannelSegments{{0, width, apBand, 0}}); phy.Set("ChannelSettings", channelValue); NetDeviceContainer apDevice; diff --git a/examples/wireless/wifi-blockack.cc b/examples/wireless/wifi-blockack.cc index 3ac509d31..ed49dd3eb 100644 --- a/examples/wireless/wifi-blockack.cc +++ b/examples/wireless/wifi-blockack.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 MIRKO BANCHI * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mirko Banchi */ diff --git a/examples/wireless/wifi-clear-channel-cmu.cc b/examples/wireless/wifi-clear-channel-cmu.cc index 4b4f308a2..87503c299 100644 --- a/examples/wireless/wifi-clear-channel-cmu.cc +++ b/examples/wireless/wifi-clear-channel-cmu.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Guangyu Pei */ diff --git a/examples/wireless/wifi-dsss-validation.cc b/examples/wireless/wifi-dsss-validation.cc index 5c6c0ac0a..0e6aa18b7 100644 --- a/examples/wireless/wifi-dsss-validation.cc +++ b/examples/wireless/wifi-dsss-validation.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-eht-network.cc b/examples/wireless/wifi-eht-network.cc index d14fa202a..a5ee804fd 100644 --- a/examples/wireless/wifi-eht-network.cc +++ b/examples/wireless/wifi-eht-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ @@ -145,6 +134,7 @@ main(int argc, char* argv[]) bool udp{true}; bool downlink{true}; bool useRts{false}; + bool use80Plus80{false}; uint16_t mpduBufferSize{512}; std::string emlsrLinks; uint16_t paddingDelayUsec{32}; @@ -154,7 +144,7 @@ main(int argc, char* argv[]) uint16_t auxPhyChWidth{20}; bool auxPhyTxCapable{true}; Time simulationTime{"10s"}; - double distance{1.0}; // meters + meter_u distance{1.0}; double frequency{5}; // whether the first link operates in the 2.4, 5 or 6 GHz double frequency2{0}; // whether the second link operates in the 2.4, 5 or 6 GHz (0 means no // second link exists) @@ -218,6 +208,7 @@ main(int argc, char* argv[]) "Generate downlink flows if set to 1, uplink flows otherwise", downlink); cmd.AddValue("useRts", "Enable/disable RTS/CTS", useRts); + cmd.AddValue("use80Plus80", "Enable/disable use of 80+80 MHz", use80Plus80); cmd.AddValue("mpduBufferSize", "Size (in number of MPDUs) of the BlockAck buffer", mpduBufferSize); @@ -298,6 +289,9 @@ main(int argc, char* argv[]) int minGi = enableUlOfdma ? 1600 : 800; for (int channelWidth = 20; channelWidth <= maxChannelWidth;) // MHz { + const auto is80Plus80 = (use80Plus80 && (channelWidth == 160)); + const std::string widthStr = is80Plus80 ? "80+80" : std::to_string(channelWidth); + const auto segmentWidthStr = is80Plus80 ? "80" : widthStr; for (int gi = 3200; gi >= minGi;) // Nanoseconds { if (!udp) @@ -335,7 +329,7 @@ main(int argc, char* argv[]) { break; } - channelStr[nLinks] = "{0, " + std::to_string(channelWidth) + ", "; + channelStr[nLinks] = "{0, " + segmentWidthStr + ", "; if (freq == 6) { channelStr[nLinks] += "BAND_6GHZ, 0}"; @@ -379,6 +373,12 @@ main(int argc, char* argv[]) { NS_FATAL_ERROR("Wrong frequency value!"); } + + if (is80Plus80) + { + channelStr[nLinks] += std::string(";") + channelStr[nLinks]; + } + nLinks++; } @@ -389,12 +389,6 @@ main(int argc, char* argv[]) Ssid ssid = Ssid("ns3-80211be"); - /* - * SingleModelSpectrumChannel cannot be used with 802.11be because two - * spectrum models are required: one with 78.125 kHz bands for HE PPDUs - * and one with 312.5 kHz bands for, e.g., non-HT PPDUs (for more details, - * see issue #408 (CLOSED)) - */ SpectrumWifiPhyHelper phy(nLinks); phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); phy.Set("ChannelSwitchDelay", TimeValue(MicroSeconds(channelSwitchDelayUsec))); @@ -442,8 +436,8 @@ main(int argc, char* argv[]) apDevice = wifi.Install(phy, mac, wifiApNode); int64_t streamNumber = 100; - streamNumber += wifi.AssignStreams(apDevice, streamNumber); - streamNumber += wifi.AssignStreams(staDevices, streamNumber); + streamNumber += WifiHelper::AssignStreams(apDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(staDevices, streamNumber); // Set guard interval and MPDU buffer size Config::Set( @@ -493,7 +487,7 @@ main(int argc, char* argv[]) } const auto maxLoad = - nLinks * EhtPhy::GetDataRate(mcs, channelWidth, gi, 1) / nStations; + nLinks * EhtPhy::GetDataRate(mcs, channelWidth, NanoSeconds(gi), 1) / nStations; if (udp) { // UDP flow @@ -580,8 +574,9 @@ main(int argc, char* argv[]) Simulator::Destroy(); - std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << gi << " ns\t\t\t" - << throughput << " Mbit/s" << std::endl; + std::cout << +mcs << "\t\t\t" << widthStr << " MHz\t\t" + << (widthStr.size() > 3 ? "" : "\t") << gi << " ns\t\t\t" << throughput + << " Mbit/s" << std::endl; // test first element if (mcs == minMcs && channelWidth == 20 && gi == 3200) diff --git a/examples/wireless/wifi-error-models-comparison.cc b/examples/wireless/wifi-error-models-comparison.cc index 03bd46988..f1db0a362 100644 --- a/examples/wireless/wifi-error-models-comparison.cc +++ b/examples/wireless/wifi-error-models-comparison.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sébastien Deronne * Rohan Patidar diff --git a/examples/wireless/wifi-he-network.cc b/examples/wireless/wifi-he-network.cc index 17b88cc5c..602e20328 100644 --- a/examples/wireless/wifi-he-network.cc +++ b/examples/wireless/wifi-he-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 SEBASTIEN DERONNE * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ @@ -72,10 +61,11 @@ main(int argc, char* argv[]) bool udp{true}; bool downlink{true}; bool useRts{false}; + bool use80Plus80{false}; bool useExtendedBlockAck{false}; Time simulationTime{"10s"}; - double distance{1.0}; // meters - double frequency{5}; // whether 2.4, 5 or 6 GHz + meter_u distance{1.0}; + double frequency{5}; // whether 2.4, 5 or 6 GHz std::size_t nStations{1}; std::string dlAckSeqType{"NO-OFDMA"}; bool enableUlOfdma{false}; @@ -101,6 +91,7 @@ main(int argc, char* argv[]) "Generate downlink flows if set to 1, uplink flows otherwise", downlink); cmd.AddValue("useRts", "Enable/disable RTS/CTS", useRts); + cmd.AddValue("use80Plus80", "Enable/disable use of 80+80 MHz", use80Plus80); cmd.AddValue("useExtendedBlockAck", "Enable/disable use of extended BACK", useExtendedBlockAck); cmd.AddValue("nStations", "Number of non-AP HE stations", nStations); cmd.AddValue("dlAckType", @@ -119,7 +110,8 @@ main(int argc, char* argv[]) cmd.AddValue("mcs", "if set, limit testing to a specific MCS (0-11)", mcs); cmd.AddValue("payloadSize", "The application payload size in bytes", payloadSize); cmd.AddValue("phyModel", - "PHY model to use when OFDMA is disabled (Yans or Spectrum). If OFDMA is enabled " + "PHY model to use when OFDMA is disabled (Yans or Spectrum). If 80+80 MHz or " + "OFDMA is enabled " "then Spectrum is automatically selected", phyModel); cmd.AddValue("minExpectedThroughput", @@ -161,9 +153,9 @@ main(int argc, char* argv[]) { NS_ABORT_MSG("Invalid PHY model (must be Yans or Spectrum)"); } - if (dlAckSeqType != "NO-OFDMA") + if (use80Plus80 || (dlAckSeqType != "NO-OFDMA")) { - // SpectrumWifiPhy is required for OFDMA + // SpectrumWifiPhy is required for 80+80 MHz and OFDMA phyModel = "Spectrum"; } @@ -191,6 +183,9 @@ main(int argc, char* argv[]) int minGi = enableUlOfdma ? 1600 : 800; for (int channelWidth = 20; channelWidth <= maxChannelWidth;) // MHz { + const auto is80Plus80 = (use80Plus80 && (channelWidth == 160)); + const std::string widthStr = is80Plus80 ? "80+80" : std::to_string(channelWidth); + const auto segmentWidthStr = is80Plus80 ? "80" : widthStr; for (int gi = 3200; gi >= minGi;) // Nanoseconds { if (!udp) @@ -207,7 +202,7 @@ main(int argc, char* argv[]) NetDeviceContainer staDevices; WifiMacHelper mac; WifiHelper wifi; - std::string channelStr("{0, " + std::to_string(channelWidth) + ", "); + std::string channelStr("{0, " + segmentWidthStr + ", "); StringValue ctrlRate; auto nonHtRefRateMbps = HePhy::GetNonHtReferenceRate(mcs) / 1e6; @@ -216,7 +211,6 @@ main(int argc, char* argv[]) if (frequency == 6) { - wifi.SetStandard(WIFI_STANDARD_80211ax); ctrlRate = StringValue(ossDataMode.str()); channelStr += "BAND_6GHZ, 0}"; Config::SetDefault("ns3::LogDistancePropagationLossModel::ReferenceLoss", @@ -224,7 +218,6 @@ main(int argc, char* argv[]) } else if (frequency == 5) { - wifi.SetStandard(WIFI_STANDARD_80211ax); std::ostringstream ossControlMode; ossControlMode << "OfdmRate" << nonHtRefRateMbps << "Mbps"; ctrlRate = StringValue(ossControlMode.str()); @@ -232,7 +225,6 @@ main(int argc, char* argv[]) } else if (frequency == 2.4) { - wifi.SetStandard(WIFI_STANDARD_80211ax); std::ostringstream ossControlMode; ossControlMode << "ErpOfdmRate" << nonHtRefRateMbps << "Mbps"; ctrlRate = StringValue(ossControlMode.str()); @@ -245,6 +237,12 @@ main(int argc, char* argv[]) NS_FATAL_ERROR("Wrong frequency value!"); } + if (is80Plus80) + { + channelStr += std::string(";") + channelStr; + } + + wifi.SetStandard(WIFI_STANDARD_80211ax); wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode", StringValue(ossDataMode.str()), @@ -257,17 +255,9 @@ main(int argc, char* argv[]) if (phyModel == "Spectrum") { - /* - * SingleModelSpectrumChannel cannot be used with 802.11ax because two - * spectrum models are required: one with 78.125 kHz bands for HE PPDUs - * and one with 312.5 kHz bands for, e.g., non-HT PPDUs (for more details, - * see issue #408 (CLOSED)) - */ - Ptr spectrumChannel = - CreateObject(); + auto spectrumChannel = CreateObject(); - Ptr lossModel = - CreateObject(); + auto lossModel = CreateObject(); spectrumChannel->AddPropagationLossModel(lossModel); SpectrumWifiPhyHelper phy; @@ -301,7 +291,7 @@ main(int argc, char* argv[]) } else { - YansWifiChannelHelper channel = YansWifiChannelHelper::Default(); + auto channel = YansWifiChannelHelper::Default(); YansWifiPhyHelper phy; phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); phy.SetChannel(channel.Create()); @@ -323,8 +313,8 @@ main(int argc, char* argv[]) } int64_t streamNumber = 150; - streamNumber += wifi.AssignStreams(apDevice, streamNumber); - streamNumber += wifi.AssignStreams(staDevices, streamNumber); + streamNumber += WifiHelper::AssignStreams(apDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(staDevices, streamNumber); // mobility. MobilityHelper mobility; @@ -366,7 +356,8 @@ main(int argc, char* argv[]) clientNodes.Add(downlink ? wifiApNode.Get(0) : wifiStaNodes.Get(i)); } - const auto maxLoad = HePhy::GetDataRate(mcs, channelWidth, gi, 1) / nStations; + const auto maxLoad = + HePhy::GetDataRate(mcs, channelWidth, NanoSeconds(gi), 1) / nStations; if (udp) { // UDP flow @@ -454,8 +445,9 @@ main(int argc, char* argv[]) Simulator::Destroy(); - std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << gi << " ns\t\t\t" - << throughput << " Mbit/s" << std::endl; + std::cout << +mcs << "\t\t\t" << widthStr << " MHz\t\t" + << (widthStr.size() > 3 ? "" : "\t") << gi << " ns\t\t\t" << throughput + << " Mbit/s" << std::endl; // test first element if (mcs == minMcs && channelWidth == 20 && gi == 3200) diff --git a/examples/wireless/wifi-hidden-terminal.cc b/examples/wireless/wifi-hidden-terminal.cc index 9c7d94180..b26a4d8a8 100644 --- a/examples/wireless/wifi-hidden-terminal.cc +++ b/examples/wireless/wifi-hidden-terminal.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pavel Boyko * @@ -125,7 +114,8 @@ experiment(bool enableCtsRts, std::string wifiManager) cbrApps.Add(onOffHelper.Install(nodes.Get(0))); // flow 2: node 2 -> node 1 - /** \internal + /** + * \internal * The slightly different start times and data rates are a workaround * for \bugid{388} and \bugid{912} */ @@ -133,7 +123,8 @@ experiment(bool enableCtsRts, std::string wifiManager) onOffHelper.SetAttribute("StartTime", TimeValue(Seconds(1.001))); cbrApps.Add(onOffHelper.Install(nodes.Get(2))); - /** \internal + /** + * \internal * We also use separate UDP applications that will send a single * packet before the CBR flows start. * This is a workaround for the lack of perfect ARP, see \bugid{187} diff --git a/examples/wireless/wifi-ht-network.cc b/examples/wireless/wifi-ht-network.cc index 5b2f545e2..4d94b2acd 100644 --- a/examples/wireless/wifi-ht-network.cc +++ b/examples/wireless/wifi-ht-network.cc @@ -1,23 +1,13 @@ /* * Copyright (c) 2009 MIRKO BANCHI * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mirko Banchi * Sebastien Deronne */ +#include "ns3/attribute-container.h" #include "ns3/boolean.h" #include "ns3/command-line.h" #include "ns3/config.h" @@ -67,9 +57,9 @@ main(int argc, char* argv[]) bool udp{true}; bool useRts{false}; Time simulationTime{"10s"}; - double distance{1.0}; // meters - double frequency{5}; // whether 2.4 or 5 GHz - int mcs{-1}; // -1 indicates an unset value + meter_u distance{1.0}; + double frequency{5}; // whether 2.4 or 5 GHz + int mcs{-1}; // -1 indicates an unset value double minExpectedThroughput{0.0}; double maxExpectedThroughput{0.0}; @@ -176,10 +166,12 @@ main(int argc, char* argv[]) wifi.ConfigHtOptions("ShortGuardIntervalSupported", BooleanValue(sgi)); Ssid ssid = Ssid("ns3-80211n"); - TupleValue, UintegerValue> + AttributeContainerValue< + TupleValue, UintegerValue>, + ';'> channelValue; WifiPhyBand band = (frequency == 5.0 ? WIFI_PHY_BAND_5GHZ : WIFI_PHY_BAND_2_4GHZ); - channelValue.Set(WifiPhy::ChannelTuple{0, channelWidth, band, 0}); + channelValue.Set(WifiPhy::ChannelSegments{{0, channelWidth, band, 0}}); mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); phy.Set("ChannelSettings", channelValue); @@ -197,8 +189,8 @@ main(int argc, char* argv[]) apDevice = wifi.Install(phy, mac, wifiApNode); int64_t streamNumber = 150; - streamNumber += wifi.AssignStreams(apDevice, streamNumber); - streamNumber += wifi.AssignStreams(staDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(apDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(staDevice, streamNumber); // mobility. MobilityHelper mobility; @@ -229,7 +221,8 @@ main(int argc, char* argv[]) apNodeInterface = address.Assign(apDevice); /* Setting applications */ - const auto maxLoad = HtPhy::GetDataRate(mcs, channelWidth, sgi ? 400 : 800, 1); + const auto maxLoad = + HtPhy::GetDataRate(mcs, channelWidth, NanoSeconds(sgi ? 400 : 800), 1); ApplicationContainer serverApp; if (udp) { diff --git a/examples/wireless/wifi-mixed-network.cc b/examples/wireless/wifi-mixed-network.cc index 0613b95f5..f48f49246 100644 --- a/examples/wireless/wifi-mixed-network.cc +++ b/examples/wireless/wifi-mixed-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Sébastien Deronne * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-multi-tos.cc b/examples/wireless/wifi-multi-tos.cc index 3a1068238..66d2aa3cb 100644 --- a/examples/wireless/wifi-multi-tos.cc +++ b/examples/wireless/wifi-multi-tos.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ @@ -49,7 +38,7 @@ main(int argc, char* argv[]) { uint32_t nWifi{4}; Time simulationTime{"10s"}; - double distance{1.0}; // meters + meter_u distance{1.0}; uint16_t mcs{7}; uint8_t channelWidth{20}; // MHz bool useShortGuardInterval{false}; diff --git a/examples/wireless/wifi-multirate.cc b/examples/wireless/wifi-multirate.cc index 0a0671229..b9963c80a 100644 --- a/examples/wireless/wifi-multirate.cc +++ b/examples/wireless/wifi-multirate.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Duy Nguyen */ diff --git a/examples/wireless/wifi-ofdm-eht-validation.cc b/examples/wireless/wifi-ofdm-eht-validation.cc index 38098b929..61cdd8259 100644 --- a/examples/wireless/wifi-ofdm-eht-validation.cc +++ b/examples/wireless/wifi-ofdm-eht-validation.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-ofdm-he-validation.cc b/examples/wireless/wifi-ofdm-he-validation.cc index 67d6fc8da..65e33f34d 100644 --- a/examples/wireless/wifi-ofdm-he-validation.cc +++ b/examples/wireless/wifi-ofdm-he-validation.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-ofdm-ht-validation.cc b/examples/wireless/wifi-ofdm-ht-validation.cc index 5cc01a874..6ed3ccfdc 100644 --- a/examples/wireless/wifi-ofdm-ht-validation.cc +++ b/examples/wireless/wifi-ofdm-ht-validation.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-ofdm-validation.cc b/examples/wireless/wifi-ofdm-validation.cc index 907db3a54..047d56bd6 100644 --- a/examples/wireless/wifi-ofdm-validation.cc +++ b/examples/wireless/wifi-ofdm-validation.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gary Pei */ diff --git a/examples/wireless/wifi-ofdm-vht-validation.cc b/examples/wireless/wifi-ofdm-vht-validation.cc index a42e96b99..f655a49f9 100644 --- a/examples/wireless/wifi-ofdm-vht-validation.cc +++ b/examples/wireless/wifi-ofdm-vht-validation.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ diff --git a/examples/wireless/wifi-power-adaptation-distance.cc b/examples/wireless/wifi-power-adaptation-distance.cc index 1557a127c..f0da9a720 100644 --- a/examples/wireless/wifi-power-adaptation-distance.cc +++ b/examples/wireless/wifi-power-adaptation-distance.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universidad de la República - Uruguay * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Matias Richart */ @@ -210,7 +199,7 @@ class NodeStatistics */ Time GetCalcTxTime(DataRate rate); - std::map m_currentPower; //!< Current Tx power for each sender. + std::map m_currentPower; //!< Current Tx power for each sender. std::map m_currentRate; //!< Current Tx rate for each sender. uint32_t m_bytesTotal; //!< Number of received bytes on a given state. double m_totalEnergy; //!< Energy used on a given state. @@ -227,7 +216,7 @@ NodeStatistics::NodeStatistics(NetDeviceContainer aps, NetDeviceContainer stas) Ptr phy = wifiDevice->GetPhy(); SetupPhy(phy); DataRate dataRate = DataRate(phy->GetDefaultMode().GetDataRate(phy->GetChannelWidth())); - double power = phy->GetTxPowerEnd(); + const auto power = phy->GetTxPowerEnd(); for (uint32_t j = 0; j < stas.GetN(); j++) { Ptr staDevice = stas.Get(j); @@ -392,8 +381,8 @@ RateCallback(std::string path, DataRate oldRate, DataRate newRate, Mac48Address int main(int argc, char* argv[]) { - double maxPower{17}; - double minPower{0}; + dBm_u maxPower{17}; + dBm_u minPower{0}; uint32_t powerLevels{18}; uint32_t rtsThreshold{2346}; @@ -404,7 +393,7 @@ main(int argc, char* argv[]) int sta1_x{5}; int sta1_y{0}; uint32_t steps{200}; - uint32_t stepsSize{1}; + meter_u stepsSize{1}; Time stepsTime{"1s"}; CommandLine cmd(__FILE__); diff --git a/examples/wireless/wifi-power-adaptation-interference.cc b/examples/wireless/wifi-power-adaptation-interference.cc index a0b2b4d50..b18cb6081 100644 --- a/examples/wireless/wifi-power-adaptation-interference.cc +++ b/examples/wireless/wifi-power-adaptation-interference.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universidad de la República - Uruguay * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Matias Richart */ @@ -208,7 +197,7 @@ class NodeStatistics */ Time GetCalcTxTime(DataRate rate); - std::map m_currentPower; //!< Current Tx power for each sender. + std::map m_currentPower; //!< Current Tx power for each sender. std::map m_currentRate; //!< Current Tx rate for each sender. uint32_t m_bytesTotal; //!< Number of received bytes. double m_totalEnergy; //!< Energy used. @@ -237,7 +226,7 @@ NodeStatistics::NodeStatistics(NetDeviceContainer aps, NetDeviceContainer stas) Ptr phy = wifiDevice->GetPhy(); SetupPhy(phy); DataRate dataRate = DataRate(phy->GetDefaultMode().GetDataRate(phy->GetChannelWidth())); - double power = phy->GetTxPowerEnd(); + const auto power = phy->GetTxPowerEnd(); for (uint32_t j = 0; j < stas.GetN(); j++) { Ptr staDevice = stas.Get(j); @@ -456,8 +445,8 @@ main(int argc, char* argv[]) { // LogComponentEnable("ConstantRateWifiManager", LOG_LEVEL_FUNCTION); - double maxPower{17}; - double minPower{0}; + dBm_u maxPower{17}; + dBm_u minPower{0}; uint32_t powerLevels{18}; uint32_t rtsThreshold{2346}; diff --git a/examples/wireless/wifi-rate-adaptation-distance.cc b/examples/wireless/wifi-rate-adaptation-distance.cc index dd59fb9f6..34f0d4f41 100644 --- a/examples/wireless/wifi-rate-adaptation-distance.cc +++ b/examples/wireless/wifi-rate-adaptation-distance.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universidad de la República - Uruguay * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Matías Richart */ diff --git a/examples/wireless/wifi-simple-adhoc-grid.cc b/examples/wireless/wifi-simple-adhoc-grid.cc index b46ccf892..630e2ef96 100644 --- a/examples/wireless/wifi-simple-adhoc-grid.cc +++ b/examples/wireless/wifi-simple-adhoc-grid.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -150,7 +139,7 @@ int main(int argc, char* argv[]) { std::string phyMode{"DsssRate1Mbps"}; - double distance{100}; // m + meter_u distance{100}; uint32_t packetSize{1000}; // bytes uint32_t numPackets{1}; uint32_t numNodes{25}; // by default, 5x5 diff --git a/examples/wireless/wifi-simple-adhoc.cc b/examples/wireless/wifi-simple-adhoc.cc index 3f85ac58f..8dc13ee4e 100644 --- a/examples/wireless/wifi-simple-adhoc.cc +++ b/examples/wireless/wifi-simple-adhoc.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -110,7 +99,7 @@ int main(int argc, char* argv[]) { std::string phyMode("DsssRate1Mbps"); - double rss{-80}; // -dBm + dBm_u rss{-80}; uint32_t packetSize{1000}; // bytes uint32_t numPackets{1}; Time interPacketInterval{"1s"}; diff --git a/examples/wireless/wifi-simple-ht-hidden-stations.cc b/examples/wireless/wifi-simple-ht-hidden-stations.cc index fd779b3be..bc2f6f080 100644 --- a/examples/wireless/wifi-simple-ht-hidden-stations.cc +++ b/examples/wireless/wifi-simple-ht-hidden-stations.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Sébastien Deronne * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -139,8 +128,8 @@ main(int argc, char* argv[]) UintegerValue(maxAmpduSize)); int64_t streamNumber = 20; - streamNumber += wifi.AssignStreams(apDevice, streamNumber); - streamNumber += wifi.AssignStreams(staDevices, streamNumber); + streamNumber += WifiHelper::AssignStreams(apDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(staDevices, streamNumber); // Setting mobility model MobilityHelper mobility; diff --git a/examples/wireless/wifi-simple-infra.cc b/examples/wireless/wifi-simple-infra.cc index 8e9936738..1ccbad06c 100644 --- a/examples/wireless/wifi-simple-infra.cc +++ b/examples/wireless/wifi-simple-infra.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -143,7 +132,7 @@ int main(int argc, char* argv[]) { std::string phyMode{"DsssRate1Mbps"}; - double rss{-80}; // -dBm + dBm_u rss{-80}; uint32_t packetSize{1000}; // bytes uint32_t numPackets{1}; Time interval{"1s"}; diff --git a/examples/wireless/wifi-simple-interference.cc b/examples/wireless/wifi-simple-interference.cc index 5c6f69faa..5d8a8882c 100644 --- a/examples/wireless/wifi-simple-interference.cc +++ b/examples/wireless/wifi-simple-interference.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -50,14 +39,14 @@ // The configurable parameters are: // - Prss (primary rss) (-80 dBm default) // - Irss (interfering rss) (-95 dBm default) -// - delta (microseconds, (t1-t0), may be negative, default 0) +// - delta (t1-t0, may be negative, default 0ns) // - PpacketSize (primary packet size) (bytes, default 1000) // - IpacketSize (interferer packet size) (bytes, default 1000) // // For instance, for this configuration, the interfering frame arrives // at -90 dBm with a time offset of 3.2 microseconds: // -// ./ns3 run "wifi-simple-interference --Irss=-90 --delta=3.2" +// ./ns3 run "wifi-simple-interference --Irss=-90 --delta=3.2ns" // // Note that all ns-3 attributes (not just the ones exposed in the below // script) can be changed at command line; see the documentation. @@ -77,7 +66,7 @@ // // Next, try this command and look at the tcpdump-- you should see two packets // that are no longer interfering: -// ./ns3 run "wifi-simple-interference --delta=30000" +// ./ns3 run "wifi-simple-interference --delta=30000ns" #include "ns3/command-line.h" #include "ns3/config.h" @@ -161,9 +150,9 @@ int main(int argc, char* argv[]) { std::string phyMode{"DsssRate1Mbps"}; - double Prss{-80}; // -dBm - double Irss{-95}; // -dBm - double delta{0}; // microseconds + dBm_u Prss{-80}; + dBm_u Irss{-95}; + Time delta{"0ns"}; uint32_t PpacketSize{1000}; // bytes uint32_t IpacketSize{1000}; // bytes bool verbose{false}; @@ -172,7 +161,7 @@ main(int argc, char* argv[]) uint32_t numPackets{1}; Time interPacketInterval{"1s"}; Time startTime{"10s"}; - double distanceToRx{100.0}; // meters + meter_u distanceToRx{100.0}; double offset{91}; // This is a magic number used to set the // transmit power, based on other configuration @@ -180,7 +169,7 @@ main(int argc, char* argv[]) cmd.AddValue("phyMode", "Wifi Phy mode", phyMode); cmd.AddValue("Prss", "Intended primary received signal strength (dBm)", Prss); cmd.AddValue("Irss", "Intended interfering received signal strength (dBm)", Irss); - cmd.AddValue("delta", "time offset (microseconds) for interfering signal", delta); + cmd.AddValue("delta", "time offset for interfering signal", delta); cmd.AddValue("PpacketSize", "size of application packet sent", PpacketSize); cmd.AddValue("IpacketSize", "size of interfering packet sent", IpacketSize); cmd.AddValue("verbose", "turn on all WifiNetDevice log components", verbose); @@ -264,7 +253,7 @@ main(int argc, char* argv[]) // Output what we are doing NS_LOG_UNCOND("Primary packet RSS=" << Prss << " dBm and interferer RSS=" << Irss - << " dBm at time offset=" << delta << " ms"); + << " dBm at time offset=" << delta.As(Time::US)); Simulator::ScheduleWithContext(source->GetNode()->GetId(), startTime, @@ -275,7 +264,7 @@ main(int argc, char* argv[]) interPacketInterval); Simulator::ScheduleWithContext(interferer->GetNode()->GetId(), - startTime + Seconds(delta / 1000000.0), + startTime + delta, &GenerateTraffic, interferer, IpacketSize, diff --git a/examples/wireless/wifi-sleep.cc b/examples/wireless/wifi-sleep.cc index 68e2c37a6..80317b1db 100644 --- a/examples/wireless/wifi-sleep.cc +++ b/examples/wireless/wifi-sleep.cc @@ -2,18 +2,7 @@ * Copyright (c) 2009 The Boeing Company * 2014 Universita' degli Studi di Napoli "Federico II" * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -113,14 +102,14 @@ main(int argc, char* argv[]) DataRate dataRate{"1Mb/s"}; uint32_t packetSize{1000}; // bytes Time duration{"10s"}; - double initialEnergy{7.5}; // joule - double voltage{3.0}; // volts - double txPowerStart{0.0}; // dbm - double txPowerEnd{15.0}; // dbm + joule_u initialEnergy{7.5}; + volt_u voltage{3.0}; + dBm_u txPowerStart{0.0}; + dBm_u txPowerEnd{15.0}; uint32_t nTxPowerLevels{16}; uint32_t txPowerLevel{0}; - double idleCurrent{0.273}; // Ampere - double txCurrent{0.380}; // Ampere + ampere_u idleCurrent{0.273}; + ampere_u txCurrent{0.380}; bool verbose{false}; CommandLine cmd(__FILE__); diff --git a/examples/wireless/wifi-spatial-reuse.cc b/examples/wireless/wifi-spatial-reuse.cc index a1905a700..356a5f6a4 100644 --- a/examples/wireless/wifi-spatial-reuse.cc +++ b/examples/wireless/wifi-spatial-reuse.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -157,24 +146,24 @@ int main(int argc, char* argv[]) { Time duration{"10s"}; - double d1{30.0}; // meters - double d2{30.0}; // meters - double d3{150.0}; // meters - double powSta1{10.0}; // dBm - double powSta2{10.0}; // dBm - double powAp1{21.0}; // dBm - double powAp2{21.0}; // dBm - double ccaEdTrSta1{-62}; // dBm - double ccaEdTrSta2{-62}; // dBm - double ccaEdTrAp1{-62}; // dBm - double ccaEdTrAp2{-62}; // dBm - double minimumRssi{-82}; // dBm + meter_u d1{30.0}; + meter_u d2{30.0}; + meter_u d3{150.0}; + dBm_u powSta1{10.0}; + dBm_u powSta2{10.0}; + dBm_u powAp1{21.0}; + dBm_u powAp2{21.0}; + dBm_u ccaEdTrSta1{-62}; + dBm_u ccaEdTrSta2{-62}; + dBm_u ccaEdTrAp1{-62}; + dBm_u ccaEdTrAp2{-62}; + dBm_u minimumRssi{-82}; int channelWidth{20}; // MHz uint32_t payloadSize{1500}; // bytes uint32_t mcs{0}; // MCS value Time interval{"1ms"}; bool enableObssPd{true}; - double obssPdThreshold{-72.0}; // dBm + dBm_u obssPdThreshold{-72.0}; CommandLine cmd(__FILE__); cmd.AddValue("duration", "Duration of simulation", duration); diff --git a/examples/wireless/wifi-spectrum-per-example.cc b/examples/wireless/wifi-spectrum-per-example.cc index fd30b6262..1736e06be 100644 --- a/examples/wireless/wifi-spectrum-per-example.cc +++ b/examples/wireless/wifi-spectrum-per-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2009 MIRKO BANCHI * Copyright (c) 2015 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mirko Banchi * Sebastien Deronne @@ -129,7 +118,7 @@ int main(int argc, char* argv[]) { bool udp{true}; - double distance{50}; + meter_u distance{50}; Time simulationTime{"10s"}; uint16_t index{256}; std::string wifiType{"ns3::SpectrumWifiPhy"}; @@ -181,7 +170,7 @@ main(int argc, char* argv[]) NodeContainer wifiApNode; wifiApNode.Create(1); - YansWifiPhyHelper phy; + YansWifiPhyHelper yansPhy; SpectrumWifiPhyHelper spectrumPhy; if (wifiType == "ns3::YansWifiPhy") { @@ -190,9 +179,9 @@ main(int argc, char* argv[]) "Frequency", DoubleValue(5.180e9)); channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel"); - phy.SetChannel(channel.Create()); - phy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW) - phy.Set("TxPowerEnd", DoubleValue(1)); + yansPhy.SetChannel(channel.Create()); + yansPhy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW) + yansPhy.Set("TxPowerEnd", DoubleValue(1)); } else if (wifiType == "ns3::SpectrumWifiPhy") { @@ -397,17 +386,19 @@ main(int argc, char* argv[]) if (wifiType == "ns3::YansWifiPhy") { mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", - StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}")); - staDevice = wifi.Install(phy, mac, wifiStaNode); + yansPhy.Set( + "ChannelSettings", + StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}")); + staDevice = wifi.Install(yansPhy, mac, wifiStaNode); mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); - apDevice = wifi.Install(phy, mac, wifiApNode); + apDevice = wifi.Install(yansPhy, mac, wifiApNode); } else if (wifiType == "ns3::SpectrumWifiPhy") { mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", - StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}")); + spectrumPhy.Set( + "ChannelSettings", + StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}")); staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode); mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); apDevice = wifi.Install(spectrumPhy, mac, wifiApNode); @@ -491,11 +482,15 @@ main(int argc, char* argv[]) if (enablePcap) { + auto& phy = wifiType == "ns3::YansWifiPhy" ? dynamic_cast(yansPhy) + : dynamic_cast(spectrumPhy); + phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); std::stringstream ss; ss << "wifi-spectrum-per-example-" << i; phy.EnablePcap(ss.str(), apDevice); } + g_signalDbmAvg = 0; g_noiseDbmAvg = 0; g_samples = 0; @@ -504,7 +499,7 @@ main(int argc, char* argv[]) Simulator::Run(); auto throughput = 0.0; - auto totalPacketsThrough = 0.0; + uint64_t totalPacketsThrough = 0; if (udp) { // UDP @@ -516,7 +511,7 @@ main(int argc, char* argv[]) { // TCP auto totalBytesRx = DynamicCast(serverApp.Get(0))->GetTotalRx(); - totalPacketsThrough = totalBytesRx / tcpPacketSize; + totalPacketsThrough = static_cast(totalBytesRx / tcpPacketSize); throughput = totalBytesRx * 8 / simulationTime.GetMicroSeconds(); // Mbit/s } std::cout << std::setw(5) << i << std::setw(6) << (i % 8) << std::setprecision(2) diff --git a/examples/wireless/wifi-spectrum-per-interference.cc b/examples/wireless/wifi-spectrum-per-interference.cc index 6e2ae44d7..ebd34563c 100644 --- a/examples/wireless/wifi-spectrum-per-interference.cc +++ b/examples/wireless/wifi-spectrum-per-interference.cc @@ -2,18 +2,7 @@ * Copyright (c) 2009 MIRKO BANCHI * Copyright (c) 2015 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mirko Banchi * Sebastien Deronne @@ -180,14 +169,14 @@ int main(int argc, char* argv[]) { bool udp{true}; - double distance{50}; + meter_u distance{50}; Time simulationTime{"10s"}; uint16_t index{256}; std::string wifiType{"ns3::SpectrumWifiPhy"}; std::string errorModelType{"ns3::NistErrorRateModel"}; bool enablePcap{false}; const uint32_t tcpPacketSize{1448}; - double waveformPower{0}; + Watt_u waveformPower{0}; CommandLine cmd(__FILE__); cmd.AddValue("simulationTime", "Simulation time", simulationTime); diff --git a/examples/wireless/wifi-spectrum-saturation-example.cc b/examples/wireless/wifi-spectrum-saturation-example.cc index 11dd67263..f2fd34cff 100644 --- a/examples/wireless/wifi-spectrum-saturation-example.cc +++ b/examples/wireless/wifi-spectrum-saturation-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2009 MIRKO BANCHI * Copyright (c) 2015 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mirko Banchi * Sebastien Deronne @@ -100,7 +89,7 @@ NS_LOG_COMPONENT_DEFINE("WifiSpectrumSaturationExample"); int main(int argc, char* argv[]) { - double distance{1}; + meter_u distance{1}; Time simulationTime{"10s"}; uint16_t index{256}; uint32_t channelWidth{0}; @@ -141,22 +130,22 @@ main(int argc, char* argv[]) NodeContainer wifiApNode; wifiApNode.Create(1); - YansWifiPhyHelper phy; + YansWifiPhyHelper yansPhy; SpectrumWifiPhyHelper spectrumPhy; if (wifiType == "ns3::YansWifiPhy") { YansWifiChannelHelper channel; channel.AddPropagationLoss("ns3::FriisPropagationLossModel"); channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel"); - phy.SetChannel(channel.Create()); - phy.Set("TxPowerStart", DoubleValue(1)); - phy.Set("TxPowerEnd", DoubleValue(1)); + yansPhy.SetChannel(channel.Create()); + yansPhy.Set("TxPowerStart", DoubleValue(1)); + yansPhy.Set("TxPowerEnd", DoubleValue(1)); if (i > 31 && i <= 63) { - phy.Set("Antennas", UintegerValue(2)); - phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2)); - phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2)); + yansPhy.Set("Antennas", UintegerValue(2)); + yansPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2)); + yansPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2)); } } else if (wifiType == "ns3::SpectrumWifiPhy") @@ -535,20 +524,20 @@ main(int argc, char* argv[]) if (wifiType == "ns3::YansWifiPhy") { mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", StringValue(channelStr)); + yansPhy.Set("ChannelSettings", StringValue(channelStr)); - staDevice = wifi.Install(phy, mac, wifiStaNode); + staDevice = wifi.Install(yansPhy, mac, wifiStaNode); mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", StringValue(channelStr)); - apDevice = wifi.Install(phy, mac, wifiApNode); + yansPhy.Set("ChannelSettings", StringValue(channelStr)); + apDevice = wifi.Install(yansPhy, mac, wifiApNode); } else if (wifiType == "ns3::SpectrumWifiPhy") { mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", StringValue(channelStr)); + spectrumPhy.Set("ChannelSettings", StringValue(channelStr)); staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode); mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); - phy.Set("ChannelSettings", StringValue(channelStr)); + spectrumPhy.Set("ChannelSettings", StringValue(channelStr)); apDevice = wifi.Install(spectrumPhy, mac, wifiApNode); } @@ -602,6 +591,9 @@ main(int argc, char* argv[]) if (enablePcap) { + auto& phy = + (wifiType == "ns3::YansWifiPhy" ? dynamic_cast(yansPhy) + : dynamic_cast(spectrumPhy)); phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); std::stringstream ss; ss << "wifi-spectrum-saturation-example-" << i; diff --git a/examples/wireless/wifi-tcp.cc b/examples/wireless/wifi-tcp.cc index ca2c6b64b..a7040beee 100644 --- a/examples/wireless/wifi-tcp.cc +++ b/examples/wireless/wifi-tcp.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015, IMDEA Networks Institute * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hany Assasa .* diff --git a/examples/wireless/wifi-timing-attributes.cc b/examples/wireless/wifi-timing-attributes.cc index bfc894846..63e169b28 100644 --- a/examples/wireless/wifi-timing-attributes.cc +++ b/examples/wireless/wifi-timing-attributes.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ @@ -39,7 +28,7 @@ // Example: set slot time to 20 microseconds, while keeping other values as defined in the // simulation script: // -// ./ns3 run "wifi-timing-attributes --slot=20" +// ./ns3 run "wifi-timing-attributes --slot=20us" // // Network topology: // @@ -57,15 +46,15 @@ NS_LOG_COMPONENT_DEFINE("wifi-timing-attributes"); int main(int argc, char* argv[]) { - uint32_t slot{9}; // slot time in microseconds - uint32_t sifs{10}; // SIFS duration in microseconds - uint32_t pifs{19}; // PIFS duration in microseconds + Time slot{"9us"}; // slot time + Time sifs{"10us"}; // SIFS duration + Time pifs{"19us"}; // PIFS duration Time simulationTime{"10s"}; // Simulation time CommandLine cmd(__FILE__); - cmd.AddValue("slot", "Slot time in microseconds", slot); - cmd.AddValue("sifs", "SIFS duration in microseconds", sifs); - cmd.AddValue("pifs", "PIFS duration in microseconds", pifs); + cmd.AddValue("slot", "Slot time", slot); + cmd.AddValue("sifs", "SIFS duration", sifs); + cmd.AddValue("pifs", "PIFS duration", pifs); cmd.AddValue("simulationTime", "Simulation time", simulationTime); cmd.Parse(argc, argv); @@ -107,12 +96,9 @@ main(int argc, char* argv[]) apDevice = wifi.Install(phy, mac, wifiApNode); // Once install is done, we overwrite the standard timing values - Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Slot", - TimeValue(MicroSeconds(slot))); - Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Sifs", - TimeValue(MicroSeconds(sifs))); - Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Pifs", - TimeValue(MicroSeconds(pifs))); + Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Slot", TimeValue(slot)); + Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Sifs", TimeValue(sifs)); + Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/Pifs", TimeValue(pifs)); // Mobility MobilityHelper mobility; diff --git a/examples/wireless/wifi-txop-aggregation.cc b/examples/wireless/wifi-txop-aggregation.cc index 0b63ac4e4..e0807cfa5 100644 --- a/examples/wireless/wifi-txop-aggregation.cc +++ b/examples/wireless/wifi-txop-aggregation.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Sébastien Deronne * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sébastien Deronne */ @@ -111,7 +100,7 @@ main(int argc, char* argv[]) uint32_t payloadSize{1472}; // bytes Time simulationTime{"10s"}; double txopLimit{3520}; // microseconds - double distance{5}; // meters + meter_u distance{5}; bool enableRts{false}; bool enablePcap{false}; bool verifyResults{false}; // used for regression diff --git a/examples/wireless/wifi-vht-network.cc b/examples/wireless/wifi-vht-network.cc index df9b85473..5aa3bc387 100644 --- a/examples/wireless/wifi-vht-network.cc +++ b/examples/wireless/wifi-vht-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 SEBASTIEN DERONNE * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Deronne */ @@ -26,9 +15,11 @@ #include "ns3/ipv4-global-routing-helper.h" #include "ns3/log.h" #include "ns3/mobility-helper.h" +#include "ns3/multi-model-spectrum-channel.h" #include "ns3/on-off-helper.h" #include "ns3/packet-sink-helper.h" #include "ns3/packet-sink.h" +#include "ns3/spectrum-wifi-helper.h" #include "ns3/ssid.h" #include "ns3/string.h" #include "ns3/udp-client-server-helper.h" @@ -64,9 +55,11 @@ main(int argc, char* argv[]) { bool udp{true}; bool useRts{false}; + bool use80Plus80{false}; Time simulationTime{"10s"}; - double distance{1.0}; // meters - int mcs{-1}; // -1 indicates an unset value + meter_u distance{1.0}; + int mcs{-1}; // -1 indicates an unset value + std::string phyModel{"Yans"}; double minExpectedThroughput{0.0}; double maxExpectedThroughput{0.0}; @@ -77,7 +70,12 @@ main(int argc, char* argv[]) cmd.AddValue("simulationTime", "Simulation time", simulationTime); cmd.AddValue("udp", "UDP if set to 1, TCP otherwise", udp); cmd.AddValue("useRts", "Enable/disable RTS/CTS", useRts); + cmd.AddValue("use80Plus80", "Enable/disable use of 80+80 MHz", use80Plus80); cmd.AddValue("mcs", "if set, limit testing to a specific MCS (0-9)", mcs); + cmd.AddValue("phyModel", + "PHY model to use (Yans or Spectrum). If 80+80 MHz is enabled, then Spectrum is " + "automatically selected", + phyModel); cmd.AddValue("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput); @@ -86,6 +84,16 @@ main(int argc, char* argv[]) maxExpectedThroughput); cmd.Parse(argc, argv); + if (phyModel != "Yans" && phyModel != "Spectrum") + { + NS_ABORT_MSG("Invalid PHY model (must be Yans or Spectrum)"); + } + if (use80Plus80) + { + // SpectrumWifiPhy is required for 80+80 MHz + phyModel = "Spectrum"; + } + if (useRts) { Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue("0")); @@ -118,6 +126,9 @@ main(int argc, char* argv[]) channelWidth *= 2; continue; } + const auto is80Plus80 = (use80Plus80 && (channelWidth == 160)); + const std::string widthStr = is80Plus80 ? "80+80" : std::to_string(channelWidth); + const auto segmentWidthStr = is80Plus80 ? "80" : widthStr; for (auto sgi : {false, true}) { uint32_t payloadSize; // 1500 byte IP packet @@ -136,16 +147,11 @@ main(int argc, char* argv[]) NodeContainer wifiApNode; wifiApNode.Create(1); - YansWifiChannelHelper channel = YansWifiChannelHelper::Default(); - YansWifiPhyHelper phy; - phy.SetChannel(channel.Create()); - - phy.Set("ChannelSettings", - StringValue("{0, " + std::to_string(channelWidth) + ", BAND_5GHZ, 0}")); - - WifiHelper wifi; - wifi.SetStandard(WIFI_STANDARD_80211ac); + NetDeviceContainer apDevice; + NetDeviceContainer staDevice; WifiMacHelper mac; + WifiHelper wifi; + std::string channelStr{"{0, " + segmentWidthStr + ", BAND_5GHZ, 0}"}; std::ostringstream ossControlMode; auto nonHtRefRateMbps = VhtPhy::GetNonHtReferenceRate(mcs) / 1e6; @@ -153,6 +159,13 @@ main(int argc, char* argv[]) std::ostringstream ossDataMode; ossDataMode << "VhtMcs" << mcs; + + if (is80Plus80) + { + channelStr += std::string(";") + channelStr; + } + + wifi.SetStandard(WIFI_STANDARD_80211ac); wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode", StringValue(ossDataMode.str()), @@ -164,23 +177,53 @@ main(int argc, char* argv[]) Ssid ssid = Ssid("ns3-80211ac"); - mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); + if (phyModel == "Spectrum") + { + auto spectrumChannel = CreateObject(); + auto lossModel = CreateObject(); + spectrumChannel->AddPropagationLossModel(lossModel); - NetDeviceContainer staDevice; - staDevice = wifi.Install(phy, mac, wifiStaNode); + SpectrumWifiPhyHelper phy; + phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); + phy.SetChannel(spectrumChannel); - mac.SetType("ns3::ApWifiMac", - "EnableBeaconJitter", - BooleanValue(false), - "Ssid", - SsidValue(ssid)); + phy.Set("ChannelSettings", + StringValue("{0, " + std::to_string(channelWidth) + ", BAND_5GHZ, 0}")); - NetDeviceContainer apDevice; - apDevice = wifi.Install(phy, mac, wifiApNode); + mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); + staDevice = wifi.Install(phy, mac, wifiStaNode); + + mac.SetType("ns3::ApWifiMac", + "EnableBeaconJitter", + BooleanValue(false), + "Ssid", + SsidValue(ssid)); + apDevice = wifi.Install(phy, mac, wifiApNode); + } + else + { + auto channel = YansWifiChannelHelper::Default(); + YansWifiPhyHelper phy; + phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); + phy.SetChannel(channel.Create()); + + phy.Set("ChannelSettings", + StringValue("{0, " + std::to_string(channelWidth) + ", BAND_5GHZ, 0}")); + + mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid)); + staDevice = wifi.Install(phy, mac, wifiStaNode); + + mac.SetType("ns3::ApWifiMac", + "EnableBeaconJitter", + BooleanValue(false), + "Ssid", + SsidValue(ssid)); + apDevice = wifi.Install(phy, mac, wifiApNode); + } int64_t streamNumber = 150; - streamNumber += wifi.AssignStreams(apDevice, streamNumber); - streamNumber += wifi.AssignStreams(staDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(apDevice, streamNumber); + streamNumber += WifiHelper::AssignStreams(staDevice, streamNumber); // mobility. MobilityHelper mobility; @@ -211,7 +254,8 @@ main(int argc, char* argv[]) apNodeInterface = address.Assign(apDevice); /* Setting applications */ - const auto maxLoad = VhtPhy::GetDataRate(mcs, channelWidth, sgi ? 400 : 800, 1); + const auto maxLoad = + VhtPhy::GetDataRate(mcs, channelWidth, NanoSeconds(sgi ? 400 : 800), 1); ApplicationContainer serverApp; if (udp) { @@ -283,8 +327,9 @@ main(int argc, char* argv[]) Simulator::Destroy(); - std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << std::boolalpha - << sgi << "\t\t\t" << throughput << " Mbit/s" << std::endl; + std::cout << +mcs << "\t\t\t" << widthStr << " MHz\t\t" + << (widthStr.size() > 3 ? "" : "\t") << (sgi ? "400 ns" : "800 ns") + << "\t\t\t" << throughput << " Mbit/s" << std::endl; // test first element if (mcs == minMcs && channelWidth == 20 && !sgi) diff --git a/examples/wireless/wifi-wired-bridging.cc b/examples/wireless/wifi-wired-bridging.cc index 5408f5573..6dd7a9547 100644 --- a/examples/wireless/wifi-wired-bridging.cc +++ b/examples/wireless/wifi-wired-bridging.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Default network topology includes some number of AP nodes specified by @@ -92,7 +81,7 @@ main(int argc, char* argv[]) backboneDevices = csma.Install(backboneNodes); - double wifiX = 0.0; + meter_u wifiX = 0.0; YansWifiPhyHelper wifiPhy; wifiPhy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO); diff --git a/ns3 b/ns3 index fcdca5f46..cf1e305c9 100755 --- a/ns3 +++ b/ns3 @@ -13,7 +13,9 @@ import sys ns3_path = os.path.dirname(os.path.realpath(os.path.abspath(__file__))) append_to_ns3_path = functools.partial(os.path.join, ns3_path) out_dir = os.sep.join([ns3_path, "build"]) -lock_file = os.sep.join([ns3_path, ".lock-ns3_%s_build" % sys.platform]) +platform = sys.platform +platform = "bsd" if "bsd" in platform else platform +lock_file = os.sep.join([ns3_path, ".lock-ns3_%s_build" % platform]) max_cpu_threads = max(1, os.cpu_count() - 1) print_buffer = "" @@ -656,7 +658,7 @@ def remove_file(file_to_remove, dry_run): def clean_cmake_artifacts(dry_run=False): remove_dir(out_dir, dry_run, "output") - cmake_cache_files = glob.glob("%s/**/CMakeCache.txt" % ns3_path, recursive=True) + cmake_cache_files = glob.glob("%s/**/CMakeCache.txt" % ns3_path) for cmake_cache_file in cmake_cache_files: dirname = os.path.dirname(cmake_cache_file) remove_dir(dirname, dry_run, "CMake cache") @@ -706,7 +708,7 @@ def clean_vcpkg_artifacts(dry_run=False): def search_cmake_cache(build_profile): # Search for the CMake cache - cmake_cache_files = glob.glob("%s/**/CMakeCache.txt" % ns3_path, recursive=True) + cmake_cache_files = glob.glob("%s/**/CMakeCache.txt" % ns3_path) current_cmake_cache_folder = None current_cmake_generator = None @@ -1285,7 +1287,9 @@ def build_step( "check-version", "cmake-format", "cmake-format-check", + "coverage_cobertura", "coverage_gcc", + "coverage_html", "docs", "doxygen", "doxygen-no-build", @@ -1303,7 +1307,7 @@ def build_step( # Build targets in the list for target in args.build: if target in ns3_modules: - target = "lib" + target + pass elif target not in non_executable_targets: target = get_target_to_build(target, ns3_version, build_profile) else: @@ -1694,14 +1698,6 @@ def main(): if os.getenv("CLICOLOR") is None: os.environ["CLICOLOR"] = "1" - # If pybindgen exists in the parent directory - # (e.g. ns3-all-in-one), add it to the PYTHONPATH - pybindgen_dir = glob.glob(os.path.abspath(append_to_ns3_path("..", "pybindgen*"))) - if pybindgen_dir: - if "PYTHONPATH" not in os.environ: - os.environ["PYTHONPATH"] = "" - os.environ["PYTHONPATH"] += path_sep + pybindgen_dir[0] - # Parse arguments args = parse_args(sys.argv[1:]) atexit.register(exit_handler, dry_run=args.dry_run) diff --git a/scratch/nested-subdir/lib/scratch-nested-subdir-library-header.h b/scratch/nested-subdir/lib/scratch-nested-subdir-library-header.h index 55a765910..f5efdf6d2 100644 --- a/scratch/nested-subdir/lib/scratch-nested-subdir-library-header.h +++ b/scratch/nested-subdir/lib/scratch-nested-subdir-library-header.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This header does not provide much functionality but is meant to demonstrate how, diff --git a/scratch/nested-subdir/lib/scratch-nested-subdir-library-source.cc b/scratch/nested-subdir/lib/scratch-nested-subdir-library-source.cc index 186fb2cd2..91831499d 100644 --- a/scratch/nested-subdir/lib/scratch-nested-subdir-library-source.cc +++ b/scratch/nested-subdir/lib/scratch-nested-subdir-library-source.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This file contains the implementation of the functions declared in the diff --git a/scratch/nested-subdir/scratch-nested-subdir-executable.cc b/scratch/nested-subdir/scratch-nested-subdir-executable.cc index 1e258edb3..b0808d0bf 100644 --- a/scratch/nested-subdir/scratch-nested-subdir-executable.cc +++ b/scratch/nested-subdir/scratch-nested-subdir-executable.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This example shows how to create new simulations that are implemented in diff --git a/scratch/scratch-simulator.cc b/scratch/scratch-simulator.cc index 838d378ca..3694ec28b 100644 --- a/scratch/scratch-simulator.cc +++ b/scratch/scratch-simulator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/core-module.h" diff --git a/scratch/subdir/scratch-subdir-additional-header.cc b/scratch/subdir/scratch-subdir-additional-header.cc index 69efcd490..6b42c2b45 100644 --- a/scratch/subdir/scratch-subdir-additional-header.cc +++ b/scratch/subdir/scratch-subdir-additional-header.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This file contains the implementation of the functions declared in the diff --git a/scratch/subdir/scratch-subdir-additional-header.h b/scratch/subdir/scratch-subdir-additional-header.h index c6a7c8948..e8d0e98c3 100644 --- a/scratch/subdir/scratch-subdir-additional-header.h +++ b/scratch/subdir/scratch-subdir-additional-header.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This header does not provide much functionality but is meant to demonstrate how, diff --git a/scratch/subdir/scratch-subdir.cc b/scratch/subdir/scratch-subdir.cc index 23373d010..0bd5a26f2 100644 --- a/scratch/subdir/scratch-subdir.cc +++ b/scratch/subdir/scratch-subdir.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // This example shows how to create new simulations that are implemented in diff --git a/setup.cfg b/setup.cfg index 342e29711..9f9be6f84 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,8 +26,6 @@ classifiers = Intended Audience :: Developers Intended Audience :: Science/Research Programming Language :: C++ - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -38,7 +36,7 @@ classifiers = [options] zip_safe = False -python_requires = >=3.6 +python_requires = >=3.8 install_requires = cppyy==3.1.2 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 52f65e9f8..2be102398 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,71 +53,124 @@ foreach(libname ${modules}) endif() endforeach() -# Prevents link errors due to symbol collisions if the same library is linked -# multiple times -list(REMOVE_DUPLICATES ns3-external-libs) +if(NOT ${XCODE}) -# Build the lib-ns3-static (ns3.x-static-buildtype.a/.lib) with all sublibraries -if(${NS3_STATIC}) - add_library( - ${lib-ns3-static} STATIC ${PROJECT_SOURCE_DIR}/build-support/empty.cc - "${lib-ns3-static-objs}" - ) + # Create object libraries from shared libraries to be reused by static and + # monolib builds + set(lib-ns3-static-objs) + if(${NS3_STATIC} OR ${NS3_MONOLIB}) + foreach(module ${ns3-libs} ${ns3-contrib-libs}) + # Retrieve source files from shared library target + get_target_property(target_sources ${module} SOURCES) - # Replace shared library suffix and check if static version exists before - # linking - set(ns3-external-static-libs) - foreach(sharedlib ${ns3-external-libs}) - if(NOT (${sharedlib} MATCHES ".so")) - list(APPEND ns3-external-static-libs ${sharedlib}) - continue() - endif() - - string(REPLACE ".so" ".a" output ${sharedlib}) - if(EXISTS ${output}) - list(APPEND ns3-external-static-libs ${output}) - else() - message( - FATAL_ERROR "Static library version of ${sharedlib} was not found" + # Prepend module path to source files + set(FOLDER "src") + if(${module} IN_LIST ns3-contrib-libs) + set(FOLDER "contrib") + endif() + list(TRANSFORM target_sources + PREPEND ${PROJECT_SOURCE_DIR}/${FOLDER}/${module}/ ) + + # Create object library from shared library + add_library(${module}-obj OBJECT ${target_sources}) + + # Reuse PCH + if(${PRECOMPILE_HEADERS_ENABLED}) + target_precompile_headers(${module}-obj REUSE_FROM stdlib_pch) + endif() + + # Retrieve properties from shared library target and apply to object + foreach(property INCLUDE_DIRECTORIES LINK_DIRECTORIES + INTERFACE_COMPILE_DEFINITIONS + ) + get_target_property(target_definitions ${module} ${property}) + if("${target_definitions}" MATCHES "target_definitions-NOTFOUND") + continue() + endif() + if(${property} STREQUAL "INTERFACE_COMPILE_DEFINITIONS") + set(property COMPILE_DEFINITIONS) + endif() + + set_target_properties( + ${module}-obj PROPERTIES ${property} "${target_definitions}" + ) + endforeach() + + # Append to the list of object files + list(APPEND lib-ns3-static-objs $) + endforeach() + endif() + + # Prevents link errors due to symbol collisions if the same library is linked + # multiple times + list(REMOVE_DUPLICATES ns3-external-libs) + + # Build the lib-ns3-static (ns3.x-static-buildtype.a/.lib) with all + # sublibraries + if(${NS3_STATIC}) + add_library( + ${lib-ns3-static} STATIC ${PROJECT_SOURCE_DIR}/build-support/empty.cc + "${lib-ns3-static-objs}" + ) + + # Replace shared library suffix and check if static version exists before + # linking + set(ns3-external-static-libs) + foreach(sharedlib ${ns3-external-libs}) + if(NOT (${sharedlib} MATCHES ".so")) + list(APPEND ns3-external-static-libs ${sharedlib}) + continue() + endif() + + string(REPLACE ".so" ".a" output ${sharedlib}) + if(EXISTS ${output}) + list(APPEND ns3-external-static-libs ${output}) + else() + message( + FATAL_ERROR "Static library version of ${sharedlib} was not found" + ) + endif() + endforeach() + + # Required by some static libraries, such as sqlite, for some odd reason + if(LINUX) + list(APPEND ns3-external-static-libs -ldl) endif() - endforeach() - # Required by some static libraries, such as sqlite, for some odd reason - if(LINUX) - list(APPEND ns3-external-static-libs -ldl) - endif() + target_link_libraries( + ${lib-ns3-static} ${STATIC_LINK_FLAGS} ${LIB_AS_NEEDED_PRE_STATIC} + ${ns3-external-static-libs} ${LIB_AS_NEEDED_POST_STATIC} + ) + if(${NS3_CLANG_TIMETRACE}) + add_dependencies(timeTraceReport ${lib-ns3-static}) + endif() + endif() # NS3_STATIC - target_link_libraries( - ${lib-ns3-static} ${STATIC_LINK_FLAGS} ${LIB_AS_NEEDED_PRE_STATIC} - ${ns3-external-static-libs} ${LIB_AS_NEEDED_POST_STATIC} - ) - if(${NS3_CLANG_TIMETRACE}) - add_dependencies(timeTraceReport ${lib-ns3-static}) - endif() -endif() + # Build the lib-ns3 (ns3.x-monolib-buildtype.dll/.dylib/.so) with all + # sublibraries + if(${NS3_MONOLIB}) + add_library( + ${lib-ns3-monolib} SHARED ${PROJECT_SOURCE_DIR}/build-support/empty.cc + "${lib-ns3-static-objs}" + ) + set_target_properties( + ${lib-ns3-monolib} + PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE + RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # set output directory for + # DLLs + ) + target_link_libraries( + ${lib-ns3-monolib} ${LIB_AS_NEEDED_PRE} ${ns3-external-libs} + ${LIB_AS_NEEDED_POST} + ) + if(${NS3_CLANG_TIMETRACE}) + add_dependencies(timeTraceReport ${lib-ns3-monolib}) + endif() + endif() # NS3_MONOLIB -# Build the lib-ns3 (ns3.x-monolib-buildtype.dll/.dylib/.so) with all -# sublibraries -if(${NS3_MONOLIB}) - add_library( - ${lib-ns3-monolib} SHARED ${PROJECT_SOURCE_DIR}/build-support/empty.cc - "${lib-ns3-static-objs}" - ) - set_target_properties( - ${lib-ns3-monolib} - PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE - RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # set output directory for DLLs - ) - target_link_libraries( - ${lib-ns3-monolib} ${LIB_AS_NEEDED_PRE} ${ns3-external-libs} - ${LIB_AS_NEEDED_POST} - ) - if(${NS3_CLANG_TIMETRACE}) - add_dependencies(timeTraceReport ${lib-ns3-monolib}) - endif() -endif() +endif() # NOT XCODE if(${NS3_FETCH_OPTIONAL_COMPONENTS}) add_dependency_to_optional_modules_dependencies() diff --git a/src/antenna/model/angles.cc b/src/antenna/model/angles.cc index 83c94f525..e9a1caafe 100644 --- a/src/antenna/model/angles.cc +++ b/src/antenna/model/angles.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/angles.h b/src/antenna/model/angles.h index e93e5a9d0..4c1c84910 100644 --- a/src/antenna/model/angles.h +++ b/src/antenna/model/angles.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/antenna-model.cc b/src/antenna/model/antenna-model.cc index a34da756b..be5bd4f97 100644 --- a/src/antenna/model/antenna-model.cc +++ b/src/antenna/model/antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/antenna-model.h b/src/antenna/model/antenna-model.h index 5dd0871dd..9410c8e8b 100644 --- a/src/antenna/model/antenna-model.h +++ b/src/antenna/model/antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/circular-aperture-antenna-model.cc b/src/antenna/model/circular-aperture-antenna-model.cc index e409a613a..901e4086f 100644 --- a/src/antenna/model/circular-aperture-antenna-model.cc +++ b/src/antenna/model/circular-aperture-antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mattia Sandri */ @@ -33,9 +22,9 @@ #include /** - * \file - * \ingroup antenna - * Class CircularApertureAntennaModel implementation. + * \file + * \ingroup antenna + * Class CircularApertureAntennaModel implementation. */ namespace diff --git a/src/antenna/model/circular-aperture-antenna-model.h b/src/antenna/model/circular-aperture-antenna-model.h index 84b8feb1a..2d805196b 100644 --- a/src/antenna/model/circular-aperture-antenna-model.h +++ b/src/antenna/model/circular-aperture-antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mattia Sandri */ diff --git a/src/antenna/model/cosine-antenna-model.cc b/src/antenna/model/cosine-antenna-model.cc index 4a4515dd2..3974be1cd 100644 --- a/src/antenna/model/cosine-antenna-model.cc +++ b/src/antenna/model/cosine-antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/cosine-antenna-model.h b/src/antenna/model/cosine-antenna-model.h index a2b653059..5676c4d15 100644 --- a/src/antenna/model/cosine-antenna-model.h +++ b/src/antenna/model/cosine-antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/isotropic-antenna-model.cc b/src/antenna/model/isotropic-antenna-model.cc index 20914194e..11fe9d8a8 100644 --- a/src/antenna/model/isotropic-antenna-model.cc +++ b/src/antenna/model/isotropic-antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/isotropic-antenna-model.h b/src/antenna/model/isotropic-antenna-model.h index 7d15bacf8..984cc5b57 100644 --- a/src/antenna/model/isotropic-antenna-model.h +++ b/src/antenna/model/isotropic-antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/parabolic-antenna-model.cc b/src/antenna/model/parabolic-antenna-model.cc index 54316b9b5..cdb2e2f9c 100644 --- a/src/antenna/model/parabolic-antenna-model.cc +++ b/src/antenna/model/parabolic-antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/parabolic-antenna-model.h b/src/antenna/model/parabolic-antenna-model.h index 05afd9fdb..9007ebcc1 100644 --- a/src/antenna/model/parabolic-antenna-model.h +++ b/src/antenna/model/parabolic-antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/model/phased-array-model.cc b/src/antenna/model/phased-array-model.cc index 46d950cbf..d27007f10 100644 --- a/src/antenna/model/phased-array-model.cc +++ b/src/antenna/model/phased-array-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "phased-array-model.h" diff --git a/src/antenna/model/phased-array-model.h b/src/antenna/model/phased-array-model.h index 193200e05..b76b778d0 100644 --- a/src/antenna/model/phased-array-model.h +++ b/src/antenna/model/phased-array-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef PHASED_ARRAY_MODEL_H diff --git a/src/antenna/model/three-gpp-antenna-model.cc b/src/antenna/model/three-gpp-antenna-model.cc index a218b7fe8..d1a02f8ef 100644 --- a/src/antenna/model/three-gpp-antenna-model.cc +++ b/src/antenna/model/three-gpp-antenna-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "three-gpp-antenna-model.h" diff --git a/src/antenna/model/three-gpp-antenna-model.h b/src/antenna/model/three-gpp-antenna-model.h index 453e719e2..22e4d5c2f 100644 --- a/src/antenna/model/three-gpp-antenna-model.h +++ b/src/antenna/model/three-gpp-antenna-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef THREE_GPP_ANTENNA_MODEL_H diff --git a/src/antenna/model/uniform-planar-array.cc b/src/antenna/model/uniform-planar-array.cc index a92af41ab..3b04e2bd6 100644 --- a/src/antenna/model/uniform-planar-array.cc +++ b/src/antenna/model/uniform-planar-array.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "uniform-planar-array.h" diff --git a/src/antenna/model/uniform-planar-array.h b/src/antenna/model/uniform-planar-array.h index 8ba5d4547..c58aa325e 100644 --- a/src/antenna/model/uniform-planar-array.h +++ b/src/antenna/model/uniform-planar-array.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef UNIFORM_PLANAR_ARRAY_H diff --git a/src/antenna/test/test-angles.cc b/src/antenna/test/test-angles.cc index f1af5d5dc..6d4ab23be 100644 --- a/src/antenna/test/test-angles.cc +++ b/src/antenna/test/test-angles.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/test/test-circular-aperture-antenna.cc b/src/antenna/test/test-circular-aperture-antenna.cc index e6cfa9377..97eba564e 100644 --- a/src/antenna/test/test-circular-aperture-antenna.cc +++ b/src/antenna/test/test-circular-aperture-antenna.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/circular-aperture-antenna-model.h" diff --git a/src/antenna/test/test-cosine-antenna.cc b/src/antenna/test/test-cosine-antenna.cc index efd0a51dd..2c8d4c6e4 100644 --- a/src/antenna/test/test-cosine-antenna.cc +++ b/src/antenna/test/test-cosine-antenna.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/test/test-degrees-radians.cc b/src/antenna/test/test-degrees-radians.cc index 035199bbc..5b1331ae6 100644 --- a/src/antenna/test/test-degrees-radians.cc +++ b/src/antenna/test/test-degrees-radians.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/test/test-isotropic-antenna.cc b/src/antenna/test/test-isotropic-antenna.cc index 7d756930c..424abe42c 100644 --- a/src/antenna/test/test-isotropic-antenna.cc +++ b/src/antenna/test/test-isotropic-antenna.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/test/test-parabolic-antenna.cc b/src/antenna/test/test-parabolic-antenna.cc index 795dd9baf..a63bed441 100644 --- a/src/antenna/test/test-parabolic-antenna.cc +++ b/src/antenna/test/test-parabolic-antenna.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011,12 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/antenna/test/test-uniform-planar-array.cc b/src/antenna/test/test-uniform-planar-array.cc index 5c95c6c1e..3dc88fabe 100644 --- a/src/antenna/test/test-uniform-planar-array.cc +++ b/src/antenna/test/test-uniform-planar-array.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "cmath" diff --git a/src/aodv/doc/aodv.h b/src/aodv/doc/aodv.h index b73eb5764..a235dd21c 100644 --- a/src/aodv/doc/aodv.h +++ b/src/aodv/doc/aodv.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/examples/CMakeLists.txt b/src/aodv/examples/CMakeLists.txt index cee2aaf73..f64c03dba 100644 --- a/src/aodv/examples/CMakeLists.txt +++ b/src/aodv/examples/CMakeLists.txt @@ -1,6 +1,6 @@ build_lib_example( - NAME aodv - SOURCE_FILES aodv.cc + NAME aodv-example + SOURCE_FILES aodv-example.cc LIBRARIES_TO_LINK ${libwifi} ${libinternet} diff --git a/src/aodv/examples/aodv.cc b/src/aodv/examples/aodv-example.cc similarity index 91% rename from src/aodv/examples/aodv.cc rename to src/aodv/examples/aodv-example.cc index 79e2e378b..150ea2c41 100644 --- a/src/aodv/examples/aodv.cc +++ b/src/aodv/examples/aodv-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * This is an example script for AODV manet routing protocol. * diff --git a/src/aodv/helper/aodv-helper.cc b/src/aodv/helper/aodv-helper.cc index 5fd6c2cc8..bdc2d8942 100644 --- a/src/aodv/helper/aodv-helper.cc +++ b/src/aodv/helper/aodv-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko , written after OlsrHelper by Mathieu Lacage * diff --git a/src/aodv/helper/aodv-helper.h b/src/aodv/helper/aodv-helper.h index a8675f950..5c9faf609 100644 --- a/src/aodv/helper/aodv-helper.h +++ b/src/aodv/helper/aodv-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko , written after OlsrHelper by Mathieu Lacage * diff --git a/src/aodv/model/aodv-dpd.cc b/src/aodv/model/aodv-dpd.cc index 5ad4e298a..2a10dd228 100644 --- a/src/aodv/model/aodv-dpd.cc +++ b/src/aodv/model/aodv-dpd.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * * Authors: Elena Buchatskaia diff --git a/src/aodv/model/aodv-dpd.h b/src/aodv/model/aodv-dpd.h index 0821455f8..fd280fe3b 100644 --- a/src/aodv/model/aodv-dpd.h +++ b/src/aodv/model/aodv-dpd.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * * Authors: Elena Buchatskaia diff --git a/src/aodv/model/aodv-id-cache.cc b/src/aodv/model/aodv-id-cache.cc index b00cacb22..a89c6603d 100644 --- a/src/aodv/model/aodv-id-cache.cc +++ b/src/aodv/model/aodv-id-cache.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-id-cache.h b/src/aodv/model/aodv-id-cache.h index 1d059d4a0..1d550fc74 100644 --- a/src/aodv/model/aodv-id-cache.h +++ b/src/aodv/model/aodv-id-cache.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-neighbor.cc b/src/aodv/model/aodv-neighbor.cc index 3d7e6b4d7..4941f379c 100644 --- a/src/aodv/model/aodv-neighbor.cc +++ b/src/aodv/model/aodv-neighbor.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-neighbor.h b/src/aodv/model/aodv-neighbor.h index d009dec72..9b8b78249 100644 --- a/src/aodv/model/aodv-neighbor.h +++ b/src/aodv/model/aodv-neighbor.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-packet.cc b/src/aodv/model/aodv-packet.cc index bdf7684df..632a95323 100644 --- a/src/aodv/model/aodv-packet.cc +++ b/src/aodv/model/aodv-packet.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-packet.h b/src/aodv/model/aodv-packet.h index 029012207..6c36c07ad 100644 --- a/src/aodv/model/aodv-packet.h +++ b/src/aodv/model/aodv-packet.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-routing-protocol.cc b/src/aodv/model/aodv-routing-protocol.cc index 4d46b8027..2ddbd6836 100644 --- a/src/aodv/model/aodv-routing-protocol.cc +++ b/src/aodv/model/aodv-routing-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-routing-protocol.h b/src/aodv/model/aodv-routing-protocol.h index 363268804..948bfafff 100644 --- a/src/aodv/model/aodv-routing-protocol.h +++ b/src/aodv/model/aodv-routing-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-rqueue.cc b/src/aodv/model/aodv-rqueue.cc index aab6ab911..44e776c72 100644 --- a/src/aodv/model/aodv-rqueue.cc +++ b/src/aodv/model/aodv-rqueue.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-rqueue.h b/src/aodv/model/aodv-rqueue.h index 41fb66793..9e69eafba 100644 --- a/src/aodv/model/aodv-rqueue.h +++ b/src/aodv/model/aodv-rqueue.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-rtable.cc b/src/aodv/model/aodv-rtable.cc index 7b0c1b209..9e57d92b5 100644 --- a/src/aodv/model/aodv-rtable.cc +++ b/src/aodv/model/aodv-rtable.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/model/aodv-rtable.h b/src/aodv/model/aodv-rtable.h index dfe52fe58..a4d9b2d74 100644 --- a/src/aodv/model/aodv-rtable.h +++ b/src/aodv/model/aodv-rtable.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and @@ -84,7 +73,7 @@ class RoutingTableEntry ~RoutingTableEntry(); - ///\name Precursors management + /// \name Precursors management //\{ /** * Insert precursor in precursor list if it doesn't yet exist in the list @@ -429,7 +418,7 @@ class RoutingTable */ RoutingTable(Time t); - ///\name Handle lifetime of invalid route + /// \name Handle lifetime of invalid route //\{ /** * Get the lifetime of a bad link diff --git a/src/aodv/test/aodv-id-cache-test-suite.cc b/src/aodv/test/aodv-id-cache-test-suite.cc index b3325d6c7..20333b536 100644 --- a/src/aodv/test/aodv-id-cache-test-suite.cc +++ b/src/aodv/test/aodv-id-cache-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and diff --git a/src/aodv/test/aodv-regression.cc b/src/aodv/test/aodv-regression.cc index d79384a80..f32c64804 100644 --- a/src/aodv/test/aodv-regression.cc +++ b/src/aodv/test/aodv-regression.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ @@ -193,7 +182,7 @@ ChainRegressionTest::CreateDevices() NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, *m_nodes); // Assign fixed stream numbers to wifi and channel random variables - streamsUsed += wifi.AssignStreams(devices, streamsUsed); + streamsUsed += WifiHelper::AssignStreams(devices, streamsUsed); // Assign 6 streams per device NS_TEST_ASSERT_MSG_EQ(streamsUsed, (devices.GetN() * 2), "Stream assignment mismatch"); streamsUsed += wifiChannel.AssignStreams(chan, streamsUsed); diff --git a/src/aodv/test/aodv-regression.h b/src/aodv/test/aodv-regression.h index f94582fc1..88b599b04 100644 --- a/src/aodv/test/aodv-regression.h +++ b/src/aodv/test/aodv-regression.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ @@ -33,132 +22,131 @@ using namespace ns3; * \brief AODV chain regression test * * This script creates 1-dimensional grid topology and then ping last node from the first one: - * - * [10.1.1.1] <-- step --> [10.1.1.2] <-- step --> [10.1.1.3] <-- step --> [10.1.1.4] <-- step --> -[10.1.1.5] - * - * Each node can hear only his right and his left neighbor, if they exist. When one third of total -time expired, - * central node moves away. After this, node 3 doesn't hear any packets from other nodes and nobody -hears his packets. + */ +// clang-format off +/** + * [10.1.1.1] <-- step --> [10.1.1.2] <-- step --> [10.1.1.3] <-- step --> [10.1.1.4] <-- step --> [10.1.1.5] + */ +// clang-format on +/** + * Each node can hear only his right and his left neighbor, if they exist. + * When one third of total time expired, central node moves away. + * After this, node 3 doesn't hear any packets from other nodes and nobody hears his packets. * We want to demonstrate in this script * 1) route establishing * 2) broken link detection both from layer 2 information and hello messages. * + */ +// clang-format off +/** * \verbatim - Expected packets time diagram. + Expected packets time diagram. + 1 2 3 4 5 - <------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, -hop=0, ID=1, org_seqno=1) src = 10.1.1.1 - |<------|------>| | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, -hop=1, ID=1, org_seqno=1) src = 10.1.1.2 | |<------|------>| | RREQ -(orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=2, ID=1, org_seqno=1) src = 10.1.1.3 | | -|<------|------>| RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=3, ID=1, org_seqno=1) src -= 10.1.1.4 | | | |<------|------> ARP request. Who has 10.1.1.4? Tell 10.1.1.5 | -| | |======>| ARP reply | | | |<======| RREP -(orig 10.1.1.1, dst 10.1.1.5, hop=0, dst_seqno=0) src=10.1.1.5 | | |<------|------>| ARP -request. Who has 10.1.1.3? Tell 10.1.1.4 | | |======>| | ARP reply | | -|<======| | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=1, dst_seqno=0) src=10.1.1.4 | -|<------|------>| | ARP request. Who has 10.1.1.2? Tell 10.1.1.3 | |======>| | | -ARP reply | |<======| | | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=2, -dst_seqno=0) src=10.1.1.3 + <-------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=0, ID=1, org_seqno=1) src = 10.1.1.1 + |<------|------>| | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=1, ID=1, org_seqno=1) src = 10.1.1.2 + | |<------|------>| | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=2, ID=1, org_seqno=1) src = 10.1.1.3 + | | |<------|------>| RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, U=1, hop=3, ID=1, org_seqno=1) src = 10.1.1.4 + | | | |<------|------> ARP request. Who has 10.1.1.4? Tell 10.1.1.5 + | | | |======>| ARP reply + | | | |<======| RREP (orig 10.1.1.1, dst 10.1.1.5, hop=0, dst_seqno=0) src=10.1.1.5 + | | |<------|------>| ARP request. Who has 10.1.1.3? Tell 10.1.1.4 + | | |======>| | ARP reply + | | |<======| | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=1, dst_seqno=0) src=10.1.1.4 + | |<------|------>| | ARP request. Who has 10.1.1.2? Tell 10.1.1.3 + | |======>| | | ARP reply + | |<======| | | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=2, dst_seqno=0) src=10.1.1.3 |<------|------>| | | ARP request. Who has 10.1.1.1? Tell 10.1.1.2 |======>| | | | ARP reply - |<======| | | | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=3, -dst_seqno=0) src=10.1.1.2 + |<======| | | | RREP (orig 10.1.1.1, dst 10.1.1.5, hop=3, dst_seqno=0) src=10.1.1.2 <-------|------>| | | | ARP request. Who has 10.1.1.2? Tell 10.1.1.1 |<======| | | | - |======>| | | | ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; -src=10.1.1.1 next_hop=10.1.1.2 + |======>| | | | ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; src=10.1.1.1 next_hop=10.1.1.2 |<------|------>| | | ARP request. Who has 10.1.1.3? Tell 10.1.1.2 | |<======| | | ARP reply - | |======>| | | ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; -src=10.1.1.2 next_hop=10.1.1.3 | |<------|------>| | ARP request. Who -has 10.1.1.4? Tell 10.1.1.3 | | |<======| | ARP reply | | |======>| -| ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; src=10.1.1.3 next_hop=10.1.1.4 | | -|<------|------>| ARP request. Who has 10.1.1.5? Tell 10.1.1.4 | | | |<======| -ARP reply | | | |======>| ICMP (ping) request 0; src=10.1.1.4 -next_hop=10.1.1.5 | | | |<======| ICMP (ping) reply 0; src=10.1.1.5 -next_hop=10.1.1.4 | | |<======| | ICMP (ping) reply 0; src=10.1.1.4 -next_hop=10.1.1.3 | |<======| | | ICMP (ping) reply 0; src=10.1.1.3 -next_hop=10.1.1.2 - |<======| | | | ICMP (ping) reply 0; src=10.1.1.2 -next_hop=10.1.1.1 | | | |<------|------> Hello + | |======>| | | ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; src=10.1.1.2 next_hop=10.1.1.3 + | |<------|------>| | ARP request. Who has 10.1.1.4? Tell 10.1.1.3 + | | |<======| | ARP reply + | | |======>| | ICMP (ping) request 0 from 10.1.1.1 to 10.1.1.5; src=10.1.1.3 next_hop=10.1.1.4 + | | |<------|------>| ARP request. Who has 10.1.1.5? Tell 10.1.1.4 + | | | |<======| ARP reply + | | | |======>| ICMP (ping) request 0; src=10.1.1.4 next_hop=10.1.1.5 + | | | |<======| ICMP (ping) reply 0; src=10.1.1.5 next_hop=10.1.1.4 + | | |<======| | ICMP (ping) reply 0; src=10.1.1.4 next_hop=10.1.1.3 + | |<======| | | ICMP (ping) reply 0; src=10.1.1.3 next_hop=10.1.1.2 + |<======| | | | ICMP (ping) reply 0; src=10.1.1.2 next_hop=10.1.1.1 + | | | |<------|------> Hello |<------|------>| | | Hello - <------|------>| | | | Hello + <-------|------>| | | | Hello | |<------|------>| | Hello - |======>| | | | ICMP (ping) request 1; src=10.1.1.1 -next_hop=10.1.1.2 | | |<------|------>| Hello | |======>| | | -ICMP (ping) request 1; src=10.1.1.2 next_hop=10.1.1.3 | | |======>| | ICMP -(ping) request 1; src=10.1.1.3 next_hop=10.1.1.4 | | | |======>| ICMP -(ping) request 1; src=10.1.1.4 next_hop=10.1.1.5 | | | |<======| ICMP -(ping) reply 1; src=10.1.1.5 next_hop=10.1.1.4 | | |<======| | ICMP (ping) -reply 1; src=10.1.1.4 next_hop=10.1.1.3 | |<======| | | ICMP (ping) reply -11; src=10.1.1.3 next_hop=10.1.1.2 - |<======| | | | ICMP (ping) reply 1; src=10.1.1.2 -next_hop=10.1.1.1 | | | |<------|------> Hello + |======>| | | | ICMP (ping) request 1; src=10.1.1.1 next_hop=10.1.1.2 + | | |<------|------>| Hello + | |======>| | | ICMP (ping) request 1; src=10.1.1.2 next_hop=10.1.1.3 + | | |======>| | ICMP (ping) request 1; src=10.1.1.3 next_hop=10.1.1.4 + | | | |======>| ICMP (ping) request 1; src=10.1.1.4 next_hop=10.1.1.5 + | | | |<======| ICMP (ping) reply 1; src=10.1.1.5 next_hop=10.1.1.4 + | | |<======| | ICMP (ping) reply 1; src=10.1.1.4 next_hop=10.1.1.3 + | |<======| | | ICMP (ping) reply 11; src=10.1.1.3 next_hop=10.1.1.2 + |<======| | | | ICMP (ping) reply 1; src=10.1.1.2 next_hop=10.1.1.1 + | | | |<------|------> Hello |<------|------>| | | Hello - <------|------>| | | | Hello + <-------|------>| | | | Hello | | |<------|------>| Hello | |<------|------>| | Hello - |======>| | | | ICMP (ping) request 2; src=10.1.1.1 -next_hop=10.1.1.2 | |======>| | | ICMP (ping) request 2; src=10.1.1.2 -next_hop=10.1.1.3 | | |======>| | ICMP (ping) request 2; src=10.1.1.3 -next_hop=10.1.1.4 | | | |======>| ICMP (ping) request 2; src=10.1.1.4 -next_hop=10.1.1.5 | | | |<======| ICMP (ping) reply 2; src=10.1.1.5 -next_hop=10.1.1.4 | | |<======| | ICMP (ping) reply 2; src=10.1.1.4 -next_hop=10.1.1.3 | |<======| | | ICMP (ping) reply 2; src=10.1.1.3 -next_hop=10.1.1.2 - |<======| | | | ICMP (ping) reply 2; src=10.1.1.2 -next_hop=10.1.1.1 | | | |<------|------> Hello - <------|------>| | | | Hello + |======>| | | | ICMP (ping) request 2; src=10.1.1.1 next_hop=10.1.1.2 + | |======>| | | ICMP (ping) request 2; src=10.1.1.2 next_hop=10.1.1.3 + | | |======>| | ICMP (ping) request 2; src=10.1.1.3 next_hop=10.1.1.4 + | | | |======>| ICMP (ping) request 2; src=10.1.1.4 next_hop=10.1.1.5 + | | | |<======| ICMP (ping) reply 2; src=10.1.1.5 next_hop=10.1.1.4 + | | |<======| | ICMP (ping) reply 2; src=10.1.1.4 next_hop=10.1.1.3 + | |<======| | | ICMP (ping) reply 2; src=10.1.1.3 next_hop=10.1.1.2 + |<======| | | | ICMP (ping) reply 2; src=10.1.1.2 next_hop=10.1.1.1 + | | | |<------|------> Hello + <-------|------>| | | | Hello | |<------|------>| | Hello |<------|------>| | | Hello | | |<------|------>| Hello - |======>| | | | ICMP (ping) request 3; src=10.1.1.1 -next_hop=10.1.1.2 | |======>| | | ICMP (ping) request 3; src=10.1.1.2 -next_hop=10.1.1.3 | | |======>| | ICMP (ping) request 3; src=10.1.1.3 -next_hop=10.1.1.4 | | | |======>| ICMP (ping) request 3; src=10.1.1.4 -next_hop=10.1.1.5 | | | |<======| ICMP (ping) reply 3; src=10.1.1.5 -next_hop=10.1.1.4 | | |<======| | ICMP (ping) reply 3; src=10.1.1.4 -next_hop=10.1.1.3 | |<======| | | ICMP (ping) reply 3; src=10.1.1.3 -next_hop=10.1.1.2 - |<======| | | | ICMP (ping) reply 3; src=10.1.1.2 -next_hop=10.1.1.1 | | | |<------|------> Hello - <------|------>| | | | Hello + |======>| | | | ICMP (ping) request 3; src=10.1.1.1 next_hop=10.1.1.2 + | |======>| | | ICMP (ping) request 3; src=10.1.1.2 next_hop=10.1.1.3 + | | |======>| | ICMP (ping) request 3; src=10.1.1.3 next_hop=10.1.1.4 + | | | |======>| ICMP (ping) request 3; src=10.1.1.4 next_hop=10.1.1.5 + | | | |<======| ICMP (ping) reply 3; src=10.1.1.5 next_hop=10.1.1.4 + | | |<======| | ICMP (ping) reply 3; src=10.1.1.4 next_hop=10.1.1.3 + | |<======| | | ICMP (ping) reply 3; src=10.1.1.3 next_hop=10.1.1.2 + |<======| | | | ICMP (ping) reply 3; src=10.1.1.2 next_hop=10.1.1.1 + | | | |<------|------> Hello + <-------|------>| | | | Hello |<------|--> | | | Hello | - | | <--|--> | | Hello |Node 3 move away => nobody hear his -packets and node 3 doesn't hear anything ! | | | <--|------>| Hello | - |======>| | | | ICMP (ping) request 4; src=10.1.1.1 -next_hop=10.1.1.2 | |==> | | | ICMP (ping) request 4; src=10.1.1.2 -next_hop=10.1.1.3. 7 retries. - |<======| | | | RERR (unreachable dst 10.1.1.3 & 10.1.1.5) -src=10.1.1.2 | | | |<------|------> Hello - <------|------>| | | | Hello + | | <--|--> | | Hello |Node 3 move away => nobody hear his packets and node 3 doesn't hear anything ! + | | | <--|------>| Hello | + |======>| | | | ICMP (ping) request 4; src=10.1.1.1 next_hop=10.1.1.2 + | |==> | | | ICMP (ping) request 4; src=10.1.1.2 next_hop=10.1.1.3. 7 retries. + |<======| | | | RERR (unreachable dst 10.1.1.3 & 10.1.1.5) src=10.1.1.2 + | | | |<------|------> Hello + <-------|------>| | | | Hello |<------|--> | | | Hello | | <--|--> | | Hello | | | <--|------>| Hello - <------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=0, -ID=2, org_seqno=2) src = 10.1.1.1 - |<------|--> | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=1, -ID=2, org_seqno=2) src = 10.1.1.2 | | | |<------|------> Hello | | | -<--|------>| Hello | | <--|--> | | Hello - |<------|--> | | | Hello - <------|------>| | | | Hello - | | | |======>| RERR (unreachable dst 10.1.1.1 & 10.1.1.3) -src=10.1.1.4 | | | |<------|------> Hello | | | <--|------>| Hello + <-------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=0, ID=2, org_seqno=2) src = 10.1.1.1 + |<------|--> | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=1, ID=2, org_seqno=2) src = 10.1.1.2 + | | | |<------|------> Hello + | | | <--|------>| Hello | | <--|--> | | Hello |<------|--> | | | Hello - <------|------>| | | | Hello + <-------|------>| | | | Hello + | | | |======>| RERR (unreachable dst 10.1.1.1 & 10.1.1.3) src=10.1.1.4 | | | |<------|------> Hello - <------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=0, -ID=4, org_seqno=3) src = 10.1.1.1 - |<------|--> | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=1, -ID=4, org_seqno=3) src = 10.1.1.2 - -.................................................................. - * \endverbatim + | | | <--|------>| Hello + | | <--|--> | | Hello + |<------|--> | | | Hello + <-------|------>| | | | Hello + | | | |<------|------> Hello + <-------|------>| | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=0, ID=4, org_seqno=3) src = 10.1.1.1 + |<------|--> | | | RREQ (orig 10.1.1.1, dst 10.1.1.5, G=1, hop=1, ID=4, org_seqno=3) src = 10.1.1.2 + ................................................. + \endverbatim */ +//clang-format on class ChainRegressionTest : public TestCase { public: diff --git a/src/aodv/test/aodv-test-suite.cc b/src/aodv/test/aodv-test-suite.cc index deb6fffb3..4e7f8c69c 100644 --- a/src/aodv/test/aodv-test-suite.cc +++ b/src/aodv/test/aodv-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ diff --git a/src/aodv/test/bug-772.cc b/src/aodv/test/bug-772.cc index cd41059d9..ef1241ed9 100644 --- a/src/aodv/test/bug-772.cc +++ b/src/aodv/test/bug-772.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ @@ -163,7 +152,7 @@ Bug772ChainTest::CreateDevices() NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, *m_nodes); // Assign fixed stream numbers to wifi and channel random variables - streamsUsed += wifi.AssignStreams(devices, streamsUsed); + streamsUsed += WifiHelper::AssignStreams(devices, streamsUsed); // Assign 6 streams per device NS_TEST_ASSERT_MSG_EQ(streamsUsed, (devices.GetN() * 2), "Stream assignment mismatch"); streamsUsed += wifiChannel.AssignStreams(chan, streamsUsed); diff --git a/src/aodv/test/bug-772.h b/src/aodv/test/bug-772.h index cfba00f14..9a67da158 100644 --- a/src/aodv/test/bug-772.h +++ b/src/aodv/test/bug-772.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ diff --git a/src/aodv/test/loopback.cc b/src/aodv/test/loopback.cc index 3550c1fab..8e509748e 100644 --- a/src/aodv/test/loopback.cc +++ b/src/aodv/test/loopback.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 IITP RAS * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Pavel Boyko */ diff --git a/src/applications/doc/applications.h b/src/applications/doc/applications.h index 47129ad11..0a13f8f29 100644 --- a/src/applications/doc/applications.h +++ b/src/applications/doc/applications.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/applications/examples/three-gpp-http-example.cc b/src/applications/examples/three-gpp-http-example.cc index 991d0f37d..7eb05981c 100644 --- a/src/applications/examples/three-gpp-http-example.cc +++ b/src/applications/examples/three-gpp-http-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Lauri Sormunen */ diff --git a/src/applications/helper/bulk-send-helper.cc b/src/applications/helper/bulk-send-helper.cc index 594ba90ef..174f27703 100644 --- a/src/applications/helper/bulk-send-helper.cc +++ b/src/applications/helper/bulk-send-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Geoge Riley * Adapted from OnOffHelper by: diff --git a/src/applications/helper/bulk-send-helper.h b/src/applications/helper/bulk-send-helper.h index 5cb6a7137..732f111f3 100644 --- a/src/applications/helper/bulk-send-helper.h +++ b/src/applications/helper/bulk-send-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Geoge Riley * Adapted from OnOffHelper by: diff --git a/src/applications/helper/on-off-helper.cc b/src/applications/helper/on-off-helper.cc index 31b327267..e2b513951 100644 --- a/src/applications/helper/on-off-helper.cc +++ b/src/applications/helper/on-off-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/helper/on-off-helper.h b/src/applications/helper/on-off-helper.h index b0f1ebb79..8c0fd7f00 100644 --- a/src/applications/helper/on-off-helper.h +++ b/src/applications/helper/on-off-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/helper/packet-sink-helper.cc b/src/applications/helper/packet-sink-helper.cc index 3c61cfb37..888fe21a7 100644 --- a/src/applications/helper/packet-sink-helper.cc +++ b/src/applications/helper/packet-sink-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/helper/packet-sink-helper.h b/src/applications/helper/packet-sink-helper.h index b1d43e8d9..273817359 100644 --- a/src/applications/helper/packet-sink-helper.h +++ b/src/applications/helper/packet-sink-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/helper/three-gpp-http-helper.cc b/src/applications/helper/three-gpp-http-helper.cc index c00c19702..f0a701d24 100644 --- a/src/applications/helper/three-gpp-http-helper.cc +++ b/src/applications/helper/three-gpp-http-helper.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Original work author (from packet-sink-helper.cc): * - Mathieu Lacage diff --git a/src/applications/helper/three-gpp-http-helper.h b/src/applications/helper/three-gpp-http-helper.h index 5d2363a17..a07115dae 100644 --- a/src/applications/helper/three-gpp-http-helper.h +++ b/src/applications/helper/three-gpp-http-helper.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Original work author (from packet-sink-helper.cc): * - Mathieu Lacage diff --git a/src/applications/helper/udp-client-server-helper.cc b/src/applications/helper/udp-client-server-helper.cc index 8d7bbe4f7..e7184b67a 100644 --- a/src/applications/helper/udp-client-server-helper.cc +++ b/src/applications/helper/udp-client-server-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail */ diff --git a/src/applications/helper/udp-client-server-helper.h b/src/applications/helper/udp-client-server-helper.h index 2f09aae3f..65796f358 100644 --- a/src/applications/helper/udp-client-server-helper.h +++ b/src/applications/helper/udp-client-server-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail */ diff --git a/src/applications/helper/udp-echo-helper.cc b/src/applications/helper/udp-echo-helper.cc index e85e4d93a..6ab59e781 100644 --- a/src/applications/helper/udp-echo-helper.cc +++ b/src/applications/helper/udp-echo-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/helper/udp-echo-helper.h b/src/applications/helper/udp-echo-helper.h index dfa6587d1..abd8d9567 100644 --- a/src/applications/helper/udp-echo-helper.h +++ b/src/applications/helper/udp-echo-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/model/application-packet-probe.cc b/src/applications/model/application-packet-probe.cc index 909caf7f0..a7943cb31 100644 --- a/src/applications/model/application-packet-probe.cc +++ b/src/applications/model/application-packet-probe.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/applications/model/application-packet-probe.h b/src/applications/model/application-packet-probe.h index aa41e5f4b..d290f8a21 100644 --- a/src/applications/model/application-packet-probe.h +++ b/src/applications/model/application-packet-probe.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/applications/model/bulk-send-application.cc b/src/applications/model/bulk-send-application.cc index 5e4ffe403..ead5da68e 100644 --- a/src/applications/model/bulk-send-application.cc +++ b/src/applications/model/bulk-send-application.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Georgia Institute of Technology * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: George F. Riley */ @@ -28,6 +17,7 @@ #include "ns3/simulator.h" #include "ns3/socket-factory.h" #include "ns3/socket.h" +#include "ns3/tcp-socket-base.h" #include "ns3/tcp-socket-factory.h" #include "ns3/trace-source-accessor.h" #include "ns3/uinteger.h" @@ -94,7 +84,12 @@ BulkSendApplication::GetTypeId() .AddTraceSource("TxWithSeqTsSize", "A new packet is created with SeqTsSizeHeader", MakeTraceSourceAccessor(&BulkSendApplication::m_txTraceWithSeqTsSize), - "ns3::PacketSink::SeqTsSizeCallback"); + "ns3::PacketSink::SeqTsSizeCallback") + .AddTraceSource("TcpRetransmission", + "The TCP socket retransmitted a packet", + MakeTraceSourceAccessor(&BulkSendApplication::m_retransmissionTrace), + "ns3::TcpSocketBase::RetransmissionCallback"); + return tid; } @@ -196,6 +191,13 @@ BulkSendApplication::StartApplication() // Called at time specified by Start m_socket->SetConnectCallback(MakeCallback(&BulkSendApplication::ConnectionSucceeded, this), MakeCallback(&BulkSendApplication::ConnectionFailed, this)); m_socket->SetSendCallback(MakeCallback(&BulkSendApplication::DataSend, this)); + Ptr tcpSocket = DynamicCast(m_socket); + if (tcpSocket) + { + tcpSocket->TraceConnectWithoutContext( + "Retransmission", + MakeCallback(&BulkSendApplication::PacketRetransmitted, this)); + } } if (m_connected) { @@ -342,4 +344,15 @@ BulkSendApplication::DataSend(Ptr socket, uint32_t) } } +void +BulkSendApplication::PacketRetransmitted(Ptr p, + const TcpHeader& header, + const Address& localAddr, + const Address& peerAddr, + Ptr socket) +{ + NS_LOG_FUNCTION(this << p << header << localAddr << peerAddr << socket); + m_retransmissionTrace(p, header, localAddr, peerAddr, socket); +} + } // Namespace ns3 diff --git a/src/applications/model/bulk-send-application.h b/src/applications/model/bulk-send-application.h index 6f4865908..d60587740 100644 --- a/src/applications/model/bulk-send-application.h +++ b/src/applications/model/bulk-send-application.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Georgia Institute of Technology * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: George F. Riley */ @@ -33,6 +22,8 @@ namespace ns3 class Address; class Socket; +class TcpHeader; +class TcpSocketBase; /** * \ingroup applications @@ -137,6 +128,14 @@ class BulkSendApplication : public Application /// Traced Callback: sent packets TracedCallback> m_txTrace; + /// Traced Callback: retransmitted packets + TracedCallback, + const TcpHeader&, + const Address&, + const Address&, + Ptr> + m_retransmissionTrace; + /// Callback for tracing the packet Tx events, includes source, destination, the packet sent, /// and header TracedCallback, const Address&, const Address&, const SeqTsSizeHeader&> @@ -162,6 +161,20 @@ class BulkSendApplication : public Application * \param unused actually unused */ void DataSend(Ptr socket, uint32_t unused); + + /** + * \brief Packet retransmitted (called by TcpSocketBase sockets via callback) + * \param p the retransmitted packet + * \param header the TCP header + * \param localAddr the local address + * \param peerAddr the peer address + * \param socket the socket that retransmitted the packet + */ + void PacketRetransmitted(Ptr p, + const TcpHeader& header, + const Address& localAddr, + const Address& peerAddr, + Ptr socket); }; } // namespace ns3 diff --git a/src/applications/model/onoff-application.cc b/src/applications/model/onoff-application.cc index a5f32c37f..e47744a3a 100644 --- a/src/applications/model/onoff-application.cc +++ b/src/applications/model/onoff-application.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // diff --git a/src/applications/model/onoff-application.h b/src/applications/model/onoff-application.h index a994abcec..be41f7440 100644 --- a/src/applications/model/onoff-application.h +++ b/src/applications/model/onoff-application.h @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // diff --git a/src/applications/model/packet-loss-counter.cc b/src/applications/model/packet-loss-counter.cc index 0f0574e2e..3ba775942 100644 --- a/src/applications/model/packet-loss-counter.cc +++ b/src/applications/model/packet-loss-counter.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/packet-loss-counter.h b/src/applications/model/packet-loss-counter.h index 3d8d65f62..fc00dd501 100644 --- a/src/applications/model/packet-loss-counter.h +++ b/src/applications/model/packet-loss-counter.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008,2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/packet-sink.cc b/src/applications/model/packet-sink.cc index f1525fb92..c70a27d53 100644 --- a/src/applications/model/packet-sink.cc +++ b/src/applications/model/packet-sink.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Henderson (tomhend@u.washington.edu) */ diff --git a/src/applications/model/packet-sink.h b/src/applications/model/packet-sink.h index 6159997d6..da7f63d4e 100644 --- a/src/applications/model/packet-sink.h +++ b/src/applications/model/packet-sink.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Henderson (tomhend@u.washington.edu) */ diff --git a/src/applications/model/seq-ts-echo-header.cc b/src/applications/model/seq-ts-echo-header.cc index 6a9161032..657f35007 100644 --- a/src/applications/model/seq-ts-echo-header.cc +++ b/src/applications/model/seq-ts-echo-header.cc @@ -2,18 +2,7 @@ * Copyright (c) 2009 INRIA * Copyright (c) 2016 Universita' di Firenze (added echo fields) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/applications/model/seq-ts-echo-header.h b/src/applications/model/seq-ts-echo-header.h index 822520a24..781092172 100644 --- a/src/applications/model/seq-ts-echo-header.h +++ b/src/applications/model/seq-ts-echo-header.h @@ -2,18 +2,7 @@ * Copyright (c) 2009 INRIA * Copyright (c) 2016 Universita' di Firenze (added echo fields) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/applications/model/seq-ts-header.cc b/src/applications/model/seq-ts-header.cc index 1de6d2ada..636d5d691 100644 --- a/src/applications/model/seq-ts-header.cc +++ b/src/applications/model/seq-ts-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/model/seq-ts-header.h b/src/applications/model/seq-ts-header.h index cb1a8a90e..68c0aeb4d 100644 --- a/src/applications/model/seq-ts-header.h +++ b/src/applications/model/seq-ts-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/applications/model/seq-ts-size-header.cc b/src/applications/model/seq-ts-size-header.cc index 3c315d8eb..9b52da78e 100644 --- a/src/applications/model/seq-ts-size-header.cc +++ b/src/applications/model/seq-ts-size-header.cc @@ -3,18 +3,7 @@ * Copyright (c) 2018 Natale Patriciello * (added timestamp and size fields) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/applications/model/seq-ts-size-header.h b/src/applications/model/seq-ts-size-header.h index c2c71a7b0..5c45a01b7 100644 --- a/src/applications/model/seq-ts-size-header.h +++ b/src/applications/model/seq-ts-size-header.h @@ -3,18 +3,7 @@ * Copyright (c) 2018 Natale Patriciello * (added timestamp and size fields) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef SEQ_TS_SIZE_HEADER_H diff --git a/src/applications/model/three-gpp-http-client.cc b/src/applications/model/three-gpp-http-client.cc index dae0b9965..7526306eb 100644 --- a/src/applications/model/three-gpp-http-client.cc +++ b/src/applications/model/three-gpp-http-client.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-client.h b/src/applications/model/three-gpp-http-client.h index 3e09bbe84..b2c3406b7 100644 --- a/src/applications/model/three-gpp-http-client.h +++ b/src/applications/model/three-gpp-http-client.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-header.cc b/src/applications/model/three-gpp-http-header.cc index bf366277e..8fb24cc17 100644 --- a/src/applications/model/three-gpp-http-header.cc +++ b/src/applications/model/three-gpp-http-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-header.h b/src/applications/model/three-gpp-http-header.h index 9f8f028b7..d1929866d 100644 --- a/src/applications/model/three-gpp-http-header.h +++ b/src/applications/model/three-gpp-http-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-server.cc b/src/applications/model/three-gpp-http-server.cc index 0acd43d6b..d104ec622 100644 --- a/src/applications/model/three-gpp-http-server.cc +++ b/src/applications/model/three-gpp-http-server.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-server.h b/src/applications/model/three-gpp-http-server.h index 700936ff0..fd7321bcf 100644 --- a/src/applications/model/three-gpp-http-server.h +++ b/src/applications/model/three-gpp-http-server.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-variables.cc b/src/applications/model/three-gpp-http-variables.cc index f5f2bb328..cd615db54 100644 --- a/src/applications/model/three-gpp-http-variables.cc +++ b/src/applications/model/three-gpp-http-variables.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/three-gpp-http-variables.h b/src/applications/model/three-gpp-http-variables.h index b2f2d6e2c..7fdbb68a3 100644 --- a/src/applications/model/three-gpp-http-variables.h +++ b/src/applications/model/three-gpp-http-variables.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/model/udp-client.cc b/src/applications/model/udp-client.cc index 470e360ef..cf6125d92 100644 --- a/src/applications/model/udp-client.cc +++ b/src/applications/model/udp-client.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008,2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/udp-client.h b/src/applications/model/udp-client.h index 89e4c1d66..3879c81c7 100644 --- a/src/applications/model/udp-client.h +++ b/src/applications/model/udp-client.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008,2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/udp-echo-client.cc b/src/applications/model/udp-echo-client.cc index 00739372c..85428d62e 100644 --- a/src/applications/model/udp-echo-client.cc +++ b/src/applications/model/udp-echo-client.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "udp-echo-client.h" diff --git a/src/applications/model/udp-echo-client.h b/src/applications/model/udp-echo-client.h index 6a8804deb..2ac58a078 100644 --- a/src/applications/model/udp-echo-client.h +++ b/src/applications/model/udp-echo-client.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef UDP_ECHO_CLIENT_H diff --git a/src/applications/model/udp-echo-server.cc b/src/applications/model/udp-echo-server.cc index ab77bddb9..67be5d9de 100644 --- a/src/applications/model/udp-echo-server.cc +++ b/src/applications/model/udp-echo-server.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "udp-echo-server.h" diff --git a/src/applications/model/udp-echo-server.h b/src/applications/model/udp-echo-server.h index bc71f0650..a549d4c4e 100644 --- a/src/applications/model/udp-echo-server.h +++ b/src/applications/model/udp-echo-server.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef UDP_ECHO_SERVER_H diff --git a/src/applications/model/udp-server.cc b/src/applications/model/udp-server.cc index f1a74e094..66dea3d3a 100644 --- a/src/applications/model/udp-server.cc +++ b/src/applications/model/udp-server.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008,2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/udp-server.h b/src/applications/model/udp-server.h index e730cc4b1..949342f9c 100644 --- a/src/applications/model/udp-server.h +++ b/src/applications/model/udp-server.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008,2009 INRIA, UDCAST * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Amine Ismail * diff --git a/src/applications/model/udp-trace-client.cc b/src/applications/model/udp-trace-client.cc index b48c74750..4b183447c 100644 --- a/src/applications/model/udp-trace-client.cc +++ b/src/applications/model/udp-trace-client.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008, 2009 INRIA, UDcast * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail * diff --git a/src/applications/model/udp-trace-client.h b/src/applications/model/udp-trace-client.h index be93d1b80..cf71797fc 100644 --- a/src/applications/model/udp-trace-client.h +++ b/src/applications/model/udp-trace-client.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008, 2009 INRIA, UDcast * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail * diff --git a/src/applications/test/bulk-send-application-test-suite.cc b/src/applications/test/bulk-send-application-test-suite.cc index 131d8fc03..28155d468 100644 --- a/src/applications/test/bulk-send-application-test-suite.cc +++ b/src/applications/test/bulk-send-application-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Tom Henderson (tomh@tomh.org) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/applications/test/three-gpp-http-client-server-test.cc b/src/applications/test/three-gpp-http-client-server-test.cc index 77bbb5c67..8cab4987e 100644 --- a/src/applications/test/three-gpp-http-client-server-test.cc +++ b/src/applications/test/three-gpp-http-client-server-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 Magister Solutions * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Budiarto Herman * diff --git a/src/applications/test/udp-client-server-test.cc b/src/applications/test/udp-client-server-test.cc index 55a09ee40..9bec96ced 100644 --- a/src/applications/test/udp-client-server-test.cc +++ b/src/applications/test/udp-client-server-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007,2008, 2009 INRIA, UDcast * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mohamed Amine Ismail * diff --git a/src/bridge/examples/csma-bridge-one-hop.cc b/src/bridge/examples/csma-bridge-one-hop.cc index 50ffa8eb5..2cbd3b91e 100644 --- a/src/bridge/examples/csma-bridge-one-hop.cc +++ b/src/bridge/examples/csma-bridge-one-hop.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/bridge/examples/csma-bridge.cc b/src/bridge/examples/csma-bridge.cc index eea36b14e..722a12aae 100644 --- a/src/bridge/examples/csma-bridge.cc +++ b/src/bridge/examples/csma-bridge.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/bridge/examples/csma-bridge.py b/src/bridge/examples/csma-bridge.py index 1d152429a..d762fe709 100644 --- a/src/bridge/examples/csma-bridge.py +++ b/src/bridge/examples/csma-bridge.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Network topology diff --git a/src/bridge/helper/bridge-helper.cc b/src/bridge/helper/bridge-helper.cc index d56d504c7..a7ea84f0f 100644 --- a/src/bridge/helper/bridge-helper.cc +++ b/src/bridge/helper/bridge-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "bridge-helper.h" diff --git a/src/bridge/helper/bridge-helper.h b/src/bridge/helper/bridge-helper.h index 9d8a7fc69..e9e3bef7c 100644 --- a/src/bridge/helper/bridge-helper.h +++ b/src/bridge/helper/bridge-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Gustavo Carneiro diff --git a/src/bridge/model/bridge-channel.cc b/src/bridge/model/bridge-channel.cc index 6d7585357..d3b684e71 100644 --- a/src/bridge/model/bridge-channel.cc +++ b/src/bridge/model/bridge-channel.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro */ diff --git a/src/bridge/model/bridge-channel.h b/src/bridge/model/bridge-channel.h index 553912380..6ca50e4d9 100644 --- a/src/bridge/model/bridge-channel.h +++ b/src/bridge/model/bridge-channel.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro */ diff --git a/src/bridge/model/bridge-net-device.cc b/src/bridge/model/bridge-net-device.cc index adab855aa..da7a10d87 100644 --- a/src/bridge/model/bridge-net-device.cc +++ b/src/bridge/model/bridge-net-device.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro */ diff --git a/src/bridge/model/bridge-net-device.h b/src/bridge/model/bridge-net-device.h index d5d6f0958..581795561 100644 --- a/src/bridge/model/bridge-net-device.h +++ b/src/bridge/model/bridge-net-device.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro */ diff --git a/src/brite/examples/brite-MPI-example.cc b/src/brite/examples/brite-MPI-example.cc index 21b6e8679..383dc256c 100644 --- a/src/brite/examples/brite-MPI-example.cc +++ b/src/brite/examples/brite-MPI-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 The Georgia Institute of Technology * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Brian Swenson */ diff --git a/src/brite/examples/brite-generic-example.cc b/src/brite/examples/brite-generic-example.cc index 0ea758d1d..4498afa79 100644 --- a/src/brite/examples/brite-generic-example.cc +++ b/src/brite/examples/brite-generic-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 The Georgia Institute of Technology * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Brian Swenson */ diff --git a/src/brite/examples/brite-generic-example.py b/src/brite/examples/brite-generic-example.py index d5647e30d..d5d177449 100644 --- a/src/brite/examples/brite-generic-example.py +++ b/src/brite/examples/brite-generic-example.py @@ -1,18 +1,7 @@ # # Copyright (c) 2012 The Georgia Institute of Technology # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Brian Swenson # Modified by: Gabriel Ferreira diff --git a/src/brite/helper/brite-topology-helper.cc b/src/brite/helper/brite-topology-helper.cc index d37f60963..7031ef410 100644 --- a/src/brite/helper/brite-topology-helper.cc +++ b/src/brite/helper/brite-topology-helper.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/brite/helper/brite-topology-helper.h b/src/brite/helper/brite-topology-helper.h index 08a60e0f4..84bf54ddc 100644 --- a/src/brite/helper/brite-topology-helper.h +++ b/src/brite/helper/brite-topology-helper.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/brite/test/brite-test-topology.cc b/src/brite/test/brite-test-topology.cc index 81f6b2f78..fdc848004 100644 --- a/src/brite/test/brite-test-topology.cc +++ b/src/brite/test/brite-test-topology.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/buildings/examples/buildings-pathloss-profiler.cc b/src/buildings/examples/buildings-pathloss-profiler.cc index f7b1b3e2a..a09247a16 100644 --- a/src/buildings/examples/buildings-pathloss-profiler.cc +++ b/src/buildings/examples/buildings-pathloss-profiler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo */ diff --git a/src/buildings/examples/outdoor-group-mobility-animate.sh b/src/buildings/examples/outdoor-group-mobility-animate.sh index 39b1afdaf..b1f537ed9 100755 --- a/src/buildings/examples/outdoor-group-mobility-animate.sh +++ b/src/buildings/examples/outdoor-group-mobility-animate.sh @@ -3,18 +3,7 @@ # Copyright (c) 2019, University of Padova, Dep. of Information Engineering, SIGNET lab # Copyright (c) 2021, University of Washington: animation extensions # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Authors: Michele Polese # Tom Henderson diff --git a/src/buildings/examples/outdoor-group-mobility-example.cc b/src/buildings/examples/outdoor-group-mobility-example.cc index 59515ebf8..0c9992b6e 100644 --- a/src/buildings/examples/outdoor-group-mobility-example.cc +++ b/src/buildings/examples/outdoor-group-mobility-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2020 Institute for the Wireless Internet of Things, Northeastern University, * Boston, MA Copyright (c) 2021, University of Washington: refactor for hierarchical model * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Michele Polese * Heavily edited by Tom Henderson to use HierarchicalMobilityModel diff --git a/src/buildings/examples/outdoor-random-walk-example-animate.sh b/src/buildings/examples/outdoor-random-walk-example-animate.sh index ccecc40c1..6abbb8772 100755 --- a/src/buildings/examples/outdoor-random-walk-example-animate.sh +++ b/src/buildings/examples/outdoor-random-walk-example-animate.sh @@ -3,18 +3,7 @@ # Copyright (c) 2019, University of Padova, Dep. of Information Engineering, SIGNET lab # Copyright (c) 2021, University of Washington: animation extensions # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Authors: Michele Polese # Tom Henderson (animation extensions) diff --git a/src/buildings/examples/outdoor-random-walk-example.cc b/src/buildings/examples/outdoor-random-walk-example.cc index 36da591a1..915fa8a5c 100644 --- a/src/buildings/examples/outdoor-random-walk-example.cc +++ b/src/buildings/examples/outdoor-random-walk-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * Copyright (c) 2019, University of Padova, Dep. of Information Engineering, SIGNET lab * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo for the code adapted from the lena-dual-stripe.cc example * Author: Michele Polese for this version diff --git a/src/buildings/examples/outdoor-random-walk-example.sh b/src/buildings/examples/outdoor-random-walk-example.sh index f0b885f82..fd134bd69 100755 --- a/src/buildings/examples/outdoor-random-walk-example.sh +++ b/src/buildings/examples/outdoor-random-walk-example.sh @@ -2,18 +2,7 @@ # Copyright (c) 2019, University of Padova, Dep. of Information Engineering, SIGNET lab # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Michele Polese diff --git a/src/buildings/helper/building-allocator.cc b/src/buildings/helper/building-allocator.cc index 774004357..3fbfe818c 100644 --- a/src/buildings/helper/building-allocator.cc +++ b/src/buildings/helper/building-allocator.cc @@ -2,18 +2,7 @@ * Copyright (c) 2007 INRIA * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Nicola Baldo (took position-allocator and turned it into diff --git a/src/buildings/helper/building-allocator.h b/src/buildings/helper/building-allocator.h index 33957708e..3c767c30a 100644 --- a/src/buildings/helper/building-allocator.h +++ b/src/buildings/helper/building-allocator.h @@ -2,18 +2,7 @@ * Copyright (c) 2007 INRIA * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Nicola Baldo (took position-allocator and turned it into diff --git a/src/buildings/helper/building-container.cc b/src/buildings/helper/building-container.cc index 55816a4c9..6951d354f 100644 --- a/src/buildings/helper/building-container.cc +++ b/src/buildings/helper/building-container.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage (original node-container.cc) * Nicola Baldo (wrote building-container.cc based on node-container.cc) diff --git a/src/buildings/helper/building-container.h b/src/buildings/helper/building-container.h index 51faceecd..433d9c8b2 100644 --- a/src/buildings/helper/building-container.h +++ b/src/buildings/helper/building-container.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage (original node-container.h) * Nicola Baldo (wrote building-container.h based on node-container.h) diff --git a/src/buildings/helper/building-position-allocator.cc b/src/buildings/helper/building-position-allocator.cc index 31fb58250..e0a823528 100644 --- a/src/buildings/helper/building-position-allocator.cc +++ b/src/buildings/helper/building-position-allocator.cc @@ -1,18 +1,7 @@ /* * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo * Michele Polese for the OutdoorPositionAllocator class diff --git a/src/buildings/helper/building-position-allocator.h b/src/buildings/helper/building-position-allocator.h index 9a64703c1..cdc7b6c0b 100644 --- a/src/buildings/helper/building-position-allocator.h +++ b/src/buildings/helper/building-position-allocator.h @@ -1,18 +1,7 @@ /* * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo * Michele Polese for the OutdoorPositionAllocator class diff --git a/src/buildings/helper/buildings-helper.cc b/src/buildings/helper/buildings-helper.cc index 1f15a778e..91dcd33e1 100644 --- a/src/buildings/helper/buildings-helper.cc +++ b/src/buildings/helper/buildings-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/buildings/helper/buildings-helper.h b/src/buildings/helper/buildings-helper.h index 25e00766e..17046d287 100644 --- a/src/buildings/helper/buildings-helper.h +++ b/src/buildings/helper/buildings-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 CTTC * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/buildings/model/building-list.cc b/src/buildings/model/building-list.cc index e6c634255..dea56f267 100644 --- a/src/buildings/model/building-list.cc +++ b/src/buildings/model/building-list.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jaume Nin * Based on BuildingList implementation by Mathieu Lacage diff --git a/src/buildings/model/building-list.h b/src/buildings/model/building-list.h index 55591abc8..fa6d7b07a 100644 --- a/src/buildings/model/building-list.h +++ b/src/buildings/model/building-list.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jaume Nin * Based on NodeList implementation by Mathieu Lacage diff --git a/src/buildings/model/building.cc b/src/buildings/model/building.cc index 192b262da..07964ae10 100644 --- a/src/buildings/model/building.cc +++ b/src/buildings/model/building.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/model/building.h b/src/buildings/model/building.h index eef5b635c..7e1cf34af 100644 --- a/src/buildings/model/building.h +++ b/src/buildings/model/building.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * diff --git a/src/buildings/model/buildings-channel-condition-model.cc b/src/buildings/model/buildings-channel-condition-model.cc index 74c2ca0b3..f59814c77 100644 --- a/src/buildings/model/buildings-channel-condition-model.cc +++ b/src/buildings/model/buildings-channel-condition-model.cc @@ -4,18 +4,7 @@ * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering, * University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "buildings-channel-condition-model.h" diff --git a/src/buildings/model/buildings-channel-condition-model.h b/src/buildings/model/buildings-channel-condition-model.h index 5b532325a..a406540aa 100644 --- a/src/buildings/model/buildings-channel-condition-model.h +++ b/src/buildings/model/buildings-channel-condition-model.h @@ -4,18 +4,7 @@ * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering, * University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef BUILDINGS_CHANNEL_CONDITION_MODEL_H diff --git a/src/buildings/model/buildings-propagation-loss-model.cc b/src/buildings/model/buildings-propagation-loss-model.cc index 37d15bdb6..422530e22 100644 --- a/src/buildings/model/buildings-propagation-loss-model.cc +++ b/src/buildings/model/buildings-propagation-loss-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo , * Nicola Baldo diff --git a/src/buildings/model/buildings-propagation-loss-model.h b/src/buildings/model/buildings-propagation-loss-model.h index 6c2f4eafc..13a9f2a08 100644 --- a/src/buildings/model/buildings-propagation-loss-model.h +++ b/src/buildings/model/buildings-propagation-loss-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/model/hybrid-buildings-propagation-loss-model.cc b/src/buildings/model/hybrid-buildings-propagation-loss-model.cc index 9cf60b515..396bb528b 100644 --- a/src/buildings/model/hybrid-buildings-propagation-loss-model.cc +++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/model/hybrid-buildings-propagation-loss-model.h b/src/buildings/model/hybrid-buildings-propagation-loss-model.h index 99b202544..5100d095a 100644 --- a/src/buildings/model/hybrid-buildings-propagation-loss-model.h +++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo @@ -39,7 +28,7 @@ class Kun2600MhzPropagationLossModel; * \ingroup buildings * \ingroup propagation * - * \brief The HybridBuildingsPropagationModel is a compound of different models able to evaluate + * \brief The HybridBuildingsPropagationModel is a compound of different models able to evaluate * the pathloss from 200 to 2600 MHz, in different environments and with buildings (i.e., indoor and * outdoor communications). * diff --git a/src/buildings/model/itu-r-1238-propagation-loss-model.cc b/src/buildings/model/itu-r-1238-propagation-loss-model.cc index 0c4dc1c95..0b844781c 100644 --- a/src/buildings/model/itu-r-1238-propagation-loss-model.cc +++ b/src/buildings/model/itu-r-1238-propagation-loss-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo , * Nicola Baldo diff --git a/src/buildings/model/itu-r-1238-propagation-loss-model.h b/src/buildings/model/itu-r-1238-propagation-loss-model.h index 017a362e7..9b7ca866e 100644 --- a/src/buildings/model/itu-r-1238-propagation-loss-model.h +++ b/src/buildings/model/itu-r-1238-propagation-loss-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/model/mobility-building-info.cc b/src/buildings/model/mobility-building-info.cc index f51c68af9..7eb386d76 100644 --- a/src/buildings/model/mobility-building-info.cc +++ b/src/buildings/model/mobility-building-info.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * diff --git a/src/buildings/model/mobility-building-info.h b/src/buildings/model/mobility-building-info.h index 49a9a93a6..0e7736244 100644 --- a/src/buildings/model/mobility-building-info.h +++ b/src/buildings/model/mobility-building-info.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * diff --git a/src/buildings/model/oh-buildings-propagation-loss-model.cc b/src/buildings/model/oh-buildings-propagation-loss-model.cc index 0ed56b0c3..7c735596e 100644 --- a/src/buildings/model/oh-buildings-propagation-loss-model.cc +++ b/src/buildings/model/oh-buildings-propagation-loss-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * diff --git a/src/buildings/model/oh-buildings-propagation-loss-model.h b/src/buildings/model/oh-buildings-propagation-loss-model.h index 8b2a30116..c8d8f1f7e 100644 --- a/src/buildings/model/oh-buildings-propagation-loss-model.h +++ b/src/buildings/model/oh-buildings-propagation-loss-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * diff --git a/src/buildings/model/random-walk-2d-outdoor-mobility-model.cc b/src/buildings/model/random-walk-2d-outdoor-mobility-model.cc index 995023178..ffe9fefee 100644 --- a/src/buildings/model/random-walk-2d-outdoor-mobility-model.cc +++ b/src/buildings/model/random-walk-2d-outdoor-mobility-model.cc @@ -2,18 +2,7 @@ * Copyright (c) 2006,2007 INRIA * Copyright (c) 2019 University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Michele Polese diff --git a/src/buildings/model/random-walk-2d-outdoor-mobility-model.h b/src/buildings/model/random-walk-2d-outdoor-mobility-model.h index d570b592f..c4684cabf 100644 --- a/src/buildings/model/random-walk-2d-outdoor-mobility-model.h +++ b/src/buildings/model/random-walk-2d-outdoor-mobility-model.h @@ -2,18 +2,7 @@ * Copyright (c) 2006,2007 INRIA * Copyright (c) 2019 University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Michele Polese diff --git a/src/buildings/model/three-gpp-v2v-channel-condition-model.cc b/src/buildings/model/three-gpp-v2v-channel-condition-model.cc index 94256e60a..4280aeadb 100644 --- a/src/buildings/model/three-gpp-v2v-channel-condition-model.cc +++ b/src/buildings/model/three-gpp-v2v-channel-condition-model.cc @@ -3,18 +3,7 @@ * University of Padova * Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "three-gpp-v2v-channel-condition-model.h" diff --git a/src/buildings/model/three-gpp-v2v-channel-condition-model.h b/src/buildings/model/three-gpp-v2v-channel-condition-model.h index d5023da69..a6ee41e2b 100644 --- a/src/buildings/model/three-gpp-v2v-channel-condition-model.h +++ b/src/buildings/model/three-gpp-v2v-channel-condition-model.h @@ -3,18 +3,7 @@ * University of Padova * Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef THREE_GPP_V2V_CHANNEL_CONDITION_MODEL diff --git a/src/buildings/test/building-position-allocator-test.cc b/src/buildings/test/building-position-allocator-test.cc index 7fc96c72a..10527bf2e 100644 --- a/src/buildings/test/building-position-allocator-test.cc +++ b/src/buildings/test/building-position-allocator-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/buildings/test/buildings-channel-condition-model-test.cc b/src/buildings/test/buildings-channel-condition-model-test.cc index ea75acc84..e5b64c6cb 100644 --- a/src/buildings/test/buildings-channel-condition-model-test.cc +++ b/src/buildings/test/buildings-channel-condition-model-test.cc @@ -2,18 +2,7 @@ * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering, * University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/abort.h" diff --git a/src/buildings/test/buildings-helper-test.cc b/src/buildings/test/buildings-helper-test.cc index 9dde3fc7d..590fef7fc 100644 --- a/src/buildings/test/buildings-helper-test.cc +++ b/src/buildings/test/buildings-helper-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Nicola Baldo */ diff --git a/src/buildings/test/buildings-pathloss-test.cc b/src/buildings/test/buildings-pathloss-test.cc index 2b2e61719..d9387cde3 100644 --- a/src/buildings/test/buildings-pathloss-test.cc +++ b/src/buildings/test/buildings-pathloss-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/test/buildings-pathloss-test.h b/src/buildings/test/buildings-pathloss-test.h index 39c75ca61..6f141e2ef 100644 --- a/src/buildings/test/buildings-pathloss-test.h +++ b/src/buildings/test/buildings-pathloss-test.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo */ diff --git a/src/buildings/test/buildings-penetration-loss-pathloss-test.cc b/src/buildings/test/buildings-penetration-loss-pathloss-test.cc index 653fb1378..a3942b850 100644 --- a/src/buildings/test/buildings-penetration-loss-pathloss-test.cc +++ b/src/buildings/test/buildings-penetration-loss-pathloss-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/abort.h" diff --git a/src/buildings/test/buildings-shadowing-test.cc b/src/buildings/test/buildings-shadowing-test.cc index c553cc509..f8cf9a426 100644 --- a/src/buildings/test/buildings-shadowing-test.cc +++ b/src/buildings/test/buildings-shadowing-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo * Nicola Baldo diff --git a/src/buildings/test/buildings-shadowing-test.h b/src/buildings/test/buildings-shadowing-test.h index bd8091b8a..4544ed8e6 100644 --- a/src/buildings/test/buildings-shadowing-test.h +++ b/src/buildings/test/buildings-shadowing-test.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Marco Miozzo */ diff --git a/src/buildings/test/outdoor-random-walk-test.cc b/src/buildings/test/outdoor-random-walk-test.cc index 3329ef016..5366ea8f3 100644 --- a/src/buildings/test/outdoor-random-walk-test.cc +++ b/src/buildings/test/outdoor-random-walk-test.cc @@ -2,18 +2,7 @@ * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering, * University of Padova * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/abort.h" diff --git a/src/buildings/test/three-gpp-v2v-channel-condition-model-test.cc b/src/buildings/test/three-gpp-v2v-channel-condition-model-test.cc index 428e6d035..f17ef0e75 100644 --- a/src/buildings/test/three-gpp-v2v-channel-condition-model-test.cc +++ b/src/buildings/test/three-gpp-v2v-channel-condition-model-test.cc @@ -2,18 +2,7 @@ * Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/abort.h" diff --git a/src/click/examples/nsclick-defines.cc b/src/click/examples/nsclick-defines.cc index db3d11976..e98aca6be 100644 --- a/src/click/examples/nsclick-defines.cc +++ b/src/click/examples/nsclick-defines.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sascha Jopen */ diff --git a/src/click/examples/nsclick-lan-single-interface.click b/src/click/examples/nsclick-lan-single-interface.click index 24403570e..5c2fcb315 100644 --- a/src/click/examples/nsclick-lan-single-interface.click +++ b/src/click/examples/nsclick-lan-single-interface.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/click/examples/nsclick-raw-wlan.cc b/src/click/examples/nsclick-raw-wlan.cc index ab3a3b628..48e90a435 100644 --- a/src/click/examples/nsclick-raw-wlan.cc +++ b/src/click/examples/nsclick-raw-wlan.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/examples/nsclick-routing-node0.click b/src/click/examples/nsclick-routing-node0.click index 7a6ebdc43..ebc021daa 100644 --- a/src/click/examples/nsclick-routing-node0.click +++ b/src/click/examples/nsclick-routing-node0.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/click/examples/nsclick-routing-node2.click b/src/click/examples/nsclick-routing-node2.click index e42b03a45..c1bb2b978 100644 --- a/src/click/examples/nsclick-routing-node2.click +++ b/src/click/examples/nsclick-routing-node2.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/click/examples/nsclick-routing.cc b/src/click/examples/nsclick-routing.cc index 5acdd50c5..1c915cff4 100644 --- a/src/click/examples/nsclick-routing.cc +++ b/src/click/examples/nsclick-routing.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/examples/nsclick-simple-lan.cc b/src/click/examples/nsclick-simple-lan.cc index ed3ee4579..55936d31b 100644 --- a/src/click/examples/nsclick-simple-lan.cc +++ b/src/click/examples/nsclick-simple-lan.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/examples/nsclick-simple-lan.py b/src/click/examples/nsclick-simple-lan.py index 58760374c..fff3335c7 100644 --- a/src/click/examples/nsclick-simple-lan.py +++ b/src/click/examples/nsclick-simple-lan.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Authors: Lalith Suresh # Modified by: Gabriel Ferreira diff --git a/src/click/examples/nsclick-udp-client-server-csma.cc b/src/click/examples/nsclick-udp-client-server-csma.cc index 796a2bf1e..ec13e2401 100644 --- a/src/click/examples/nsclick-udp-client-server-csma.cc +++ b/src/click/examples/nsclick-udp-client-server-csma.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Adaptation of examples/udp/udp-client-server.cc for diff --git a/src/click/examples/nsclick-udp-client-server-wifi.cc b/src/click/examples/nsclick-udp-client-server-wifi.cc index ec3580370..07008331f 100644 --- a/src/click/examples/nsclick-udp-client-server-wifi.cc +++ b/src/click/examples/nsclick-udp-client-server-wifi.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Adaptation of examples/udp/udp-client-server.cc for diff --git a/src/click/examples/nsclick-wifi-single-interface-promisc.click b/src/click/examples/nsclick-wifi-single-interface-promisc.click index e27d11a56..0c452d29b 100644 --- a/src/click/examples/nsclick-wifi-single-interface-promisc.click +++ b/src/click/examples/nsclick-wifi-single-interface-promisc.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/click/examples/nsclick-wifi-single-interface.click b/src/click/examples/nsclick-wifi-single-interface.click index 7638f7828..b6c8f91db 100644 --- a/src/click/examples/nsclick-wifi-single-interface.click +++ b/src/click/examples/nsclick-wifi-single-interface.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/click/helper/click-internet-stack-helper.cc b/src/click/helper/click-internet-stack-helper.cc index e9b12e260..c4651a439 100644 --- a/src/click/helper/click-internet-stack-helper.cc +++ b/src/click/helper/click-internet-stack-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Faker Moatamri diff --git a/src/click/helper/click-internet-stack-helper.h b/src/click/helper/click-internet-stack-helper.h index a4f0e919e..4b2f66d2c 100644 --- a/src/click/helper/click-internet-stack-helper.h +++ b/src/click/helper/click-internet-stack-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Lalith Suresh diff --git a/src/click/model/ipv4-click-routing.cc b/src/click/model/ipv4-click-routing.cc index b38b89ea9..c3c77f4c7 100644 --- a/src/click/model/ipv4-click-routing.cc +++ b/src/click/model/ipv4-click-routing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Lalith Suresh * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/model/ipv4-click-routing.h b/src/click/model/ipv4-click-routing.h index cded799e7..64dec0644 100644 --- a/src/click/model/ipv4-click-routing.h +++ b/src/click/model/ipv4-click-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Lalith Suresh * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/model/ipv4-l3-click-protocol.cc b/src/click/model/ipv4-l3-click-protocol.cc index 15c1e7848..3397338ab 100644 --- a/src/click/model/ipv4-l3-click-protocol.cc +++ b/src/click/model/ipv4-l3-click-protocol.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // Author: Lalith Suresh diff --git a/src/click/model/ipv4-l3-click-protocol.h b/src/click/model/ipv4-l3-click-protocol.h index 2fb06e9cf..37f97aa5a 100644 --- a/src/click/model/ipv4-l3-click-protocol.h +++ b/src/click/model/ipv4-l3-click-protocol.h @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // Author: Lalith Suresh @@ -268,8 +257,10 @@ class Ipv4L3ClickProtocol : public Ipv4 void SetIpForward(bool forward) override; bool GetIpForward() const override; + /** \copydoc Ipv4::SetWeakEsModel */ NS_DEPRECATED_3_41("Use SetStrongEndSystemModel instead") void SetWeakEsModel(bool model) override; + /** \copydoc Ipv4::GetWeakEsModel */ NS_DEPRECATED_3_41("Use GetStrongEndSystemModel instead") bool GetWeakEsModel() const override; diff --git a/src/click/test/ipv4-click-routing-test.cc b/src/click/test/ipv4-click-routing-test.cc index 086ba9dc0..2d609e121 100644 --- a/src/click/test/ipv4-click-routing-test.cc +++ b/src/click/test/ipv4-click-routing-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Lalith Suresh * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Lalith Suresh */ diff --git a/src/click/test/nsclick-test-lan-single-interface.click b/src/click/test/nsclick-test-lan-single-interface.click index f34badd05..ed5a3d8e6 100644 --- a/src/click/test/nsclick-test-lan-single-interface.click +++ b/src/click/test/nsclick-test-lan-single-interface.click @@ -2,18 +2,7 @@ // // Copyright (c) 2011, Deutsche Telekom Laboratories // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Ruben Merz // diff --git a/src/config-store/model/attribute-default-iterator.cc b/src/config-store/model/attribute-default-iterator.cc index d2b37c60c..c1f928353 100644 --- a/src/config-store/model/attribute-default-iterator.cc +++ b/src/config-store/model/attribute-default-iterator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/attribute-default-iterator.h b/src/config-store/model/attribute-default-iterator.h index 14cbf6d1b..4cf9003d9 100644 --- a/src/config-store/model/attribute-default-iterator.h +++ b/src/config-store/model/attribute-default-iterator.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/attribute-iterator.cc b/src/config-store/model/attribute-iterator.cc index 8cb7dff03..80d7d899c 100644 --- a/src/config-store/model/attribute-iterator.cc +++ b/src/config-store/model/attribute-iterator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -231,8 +220,13 @@ AttributeIterator::DoIterate(Ptr object) if (ptrChecker != nullptr) { NS_LOG_DEBUG("pointer attribute " << info.name); + if (info.supportLevel == TypeId::DEPRECATED || + info.supportLevel == TypeId::OBSOLETE) + { + continue; + } PointerValue ptr; - object->GetAttribute(info.name, ptr); + object->GetAttribute(info.name, ptr, true); Ptr tmp = ptr.Get(); if (tmp) { @@ -251,7 +245,7 @@ AttributeIterator::DoIterate(Ptr object) { NS_LOG_DEBUG("ObjectPtrContainer attribute " << info.name); ObjectPtrContainerValue vector; - object->GetAttribute(info.name, vector); + object->GetAttribute(info.name, vector, true); StartVisitArrayAttribute(object, info.name, vector); ObjectPtrContainerValue::Iterator it; for (it = vector.Begin(); it != vector.End(); ++it) diff --git a/src/config-store/model/attribute-iterator.h b/src/config-store/model/attribute-iterator.h index 4fe203c9a..fb9c9d14c 100644 --- a/src/config-store/model/attribute-iterator.h +++ b/src/config-store/model/attribute-iterator.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/config-store/model/config-store.cc b/src/config-store/model/config-store.cc index 05a2dec35..3b49bfb6f 100644 --- a/src/config-store/model/config-store.cc +++ b/src/config-store/model/config-store.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -74,11 +63,15 @@ ConfigStore::GetTypeId() EnumValue(ConfigStore::RAW_TEXT), MakeEnumAccessor(&ConfigStore::SetFileFormat), MakeEnumChecker(ConfigStore::RAW_TEXT, "RawText", ConfigStore::XML, "Xml")) - .AddAttribute("SaveDeprecated", - "Save DEPRECATED attributes", - BooleanValue(true), - MakeBooleanAccessor(&ConfigStore::SetSaveDeprecated), - MakeBooleanChecker()); + .AddAttribute( + "SaveDeprecated", + "Save DEPRECATED attributes", + BooleanValue(true), + MakeBooleanAccessor(&ConfigStore::SetSaveDeprecated), + MakeBooleanChecker(), + TypeId::OBSOLETE, + "OBSOLETE since ns-3.43 as it is no longer needed; deprecated attributes are saved " + "only if their value differs from their respective original initial value"); return tid; } @@ -140,8 +133,6 @@ ConfigStore::ConfigStore() } } m_file->SetFilename(m_filename); - m_file->SetSaveDeprecated(m_saveDeprecated); - NS_LOG_FUNCTION(this << ": format: " << m_fileFormat << ", mode: " << m_mode << ", file name: " << m_filename); } diff --git a/src/config-store/model/config-store.h b/src/config-store/model/config-store.h index fd85fe59c..695db0161 100644 --- a/src/config-store/model/config-store.h +++ b/src/config-store/model/config-store.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/config-store/model/display-functions.cc b/src/config-store/model/display-functions.cc index a8b0abb07..f08eb870c 100644 --- a/src/config-store/model/display-functions.cc +++ b/src/config-store/model/display-functions.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/display-functions.h b/src/config-store/model/display-functions.h index 1164cd8c9..67de1b363 100644 --- a/src/config-store/model/display-functions.h +++ b/src/config-store/model/display-functions.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/file-config.cc b/src/config-store/model/file-config.cc index ec70bd54f..79a24a3f6 100644 --- a/src/config-store/model/file-config.cc +++ b/src/config-store/model/file-config.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -26,12 +15,6 @@ FileConfig::~FileConfig() { } -void -FileConfig::SetSaveDeprecated(bool saveDeprecated) -{ - m_saveDeprecated = saveDeprecated; -} - NoneFileConfig::NoneFileConfig() { } diff --git a/src/config-store/model/file-config.h b/src/config-store/model/file-config.h index b0e064dd8..61dd86b1e 100644 --- a/src/config-store/model/file-config.h +++ b/src/config-store/model/file-config.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -39,11 +28,6 @@ class FileConfig * \param filename the filename */ virtual void SetFilename(std::string filename) = 0; - /** - * Set if to save deprecated attributes - * \param saveDeprecated the deprecated attributes save policy - */ - void SetSaveDeprecated(bool saveDeprecated); /** * Load or save the default values */ @@ -56,9 +40,6 @@ class FileConfig * Load or save the attributes values */ virtual void Attributes() = 0; - - protected: - bool m_saveDeprecated; ///< save deprecated attributes }; /** diff --git a/src/config-store/model/gtk-config-store.cc b/src/config-store/model/gtk-config-store.cc index eb4cc37d3..7d1495451 100644 --- a/src/config-store/model/gtk-config-store.cc +++ b/src/config-store/model/gtk-config-store.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/gtk-config-store.h b/src/config-store/model/gtk-config-store.h index 45d8bb049..a28ebd950 100644 --- a/src/config-store/model/gtk-config-store.h +++ b/src/config-store/model/gtk-config-store.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/model-node-creator.cc b/src/config-store/model/model-node-creator.cc index a3bbfa7a5..72a86bf6a 100644 --- a/src/config-store/model/model-node-creator.cc +++ b/src/config-store/model/model-node-creator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/model-node-creator.h b/src/config-store/model/model-node-creator.h index 3d7a46fb9..4b4925896 100644 --- a/src/config-store/model/model-node-creator.h +++ b/src/config-store/model/model-node-creator.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Faker Moatamri * Mathieu Lacage diff --git a/src/config-store/model/model-typeid-creator.cc b/src/config-store/model/model-typeid-creator.cc index a76b06c81..bf83e6d04 100644 --- a/src/config-store/model/model-typeid-creator.cc +++ b/src/config-store/model/model-typeid-creator.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Faker Moatamri */ diff --git a/src/config-store/model/model-typeid-creator.h b/src/config-store/model/model-typeid-creator.h index 2763d2440..410f0a356 100644 --- a/src/config-store/model/model-typeid-creator.h +++ b/src/config-store/model/model-typeid-creator.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Moatamri Faker */ diff --git a/src/config-store/model/raw-text-config.cc b/src/config-store/model/raw-text-config.cc index 7db161f4c..c508ac8f5 100644 --- a/src/config-store/model/raw-text-config.cc +++ b/src/config-store/model/raw-text-config.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -75,11 +64,6 @@ RawTextConfigSave::Default() m_os = os; } - void SetSaveDeprecated(bool saveDeprecated) - { - m_saveDeprecated = saveDeprecated; - } - private: void StartVisitTypeId(std::string name) override { @@ -91,39 +75,49 @@ RawTextConfigSave::Default() NS_LOG_DEBUG("Saving " << m_typeId << "::" << name); TypeId tid = TypeId::LookupByName(m_typeId); ns3::TypeId::SupportLevel supportLevel = TypeId::SupportLevel::SUPPORTED; + std::string originalInitialValue; + std::string valueTypeName; for (std::size_t i = 0; i < tid.GetAttributeN(); i++) { TypeId::AttributeInformation tmp = tid.GetAttribute(i); if (tmp.name == name) { supportLevel = tmp.supportLevel; + originalInitialValue = tmp.originalInitialValue->SerializeToString(tmp.checker); + valueTypeName = tmp.checker->GetValueTypeName(); break; } } + if (valueTypeName == "ns3::CallbackValue") + { + NS_LOG_WARN("Global attribute " << m_typeId << "::" << name + << " was not saved because it is a CallbackValue"); + return; + } if (supportLevel == TypeId::SupportLevel::OBSOLETE) { NS_LOG_WARN("Global attribute " << m_typeId << "::" << name << " was not saved because it is OBSOLETE"); + return; } - else if (supportLevel == TypeId::SupportLevel::DEPRECATED && !m_saveDeprecated) + if (supportLevel == TypeId::SupportLevel::DEPRECATED && + defaultValue == originalInitialValue) { - NS_LOG_WARN("Global attribute " << m_typeId << "::" << name - << " was not saved because it is DEPRECATED"); - } - else - { - *m_os << "default " << m_typeId << "::" << name << " \"" << defaultValue << "\"" - << std::endl; + NS_LOG_WARN("Global attribute " + << m_typeId << "::" << name + << " was not saved because it is DEPRECATED and its value has not " + "changed from the original initial value"); + return; } + *m_os << "default " << m_typeId << "::" << name << " \"" << defaultValue << "\"" + << std::endl; } std::string m_typeId; std::ostream* m_os; - bool m_saveDeprecated; }; RawTextDefaultIterator iterator = RawTextDefaultIterator(m_os); - iterator.SetSaveDeprecated(m_saveDeprecated); iterator.Iterate(); } @@ -153,52 +147,52 @@ RawTextConfigSave::Attributes() { } - void SetSaveDeprecated(bool saveDeprecated) - { - m_saveDeprecated = saveDeprecated; - } - private: void DoVisitAttribute(Ptr object, std::string name) override { StringValue str; - - ns3::TypeId::SupportLevel supportLevel = TypeId::SupportLevel::SUPPORTED; TypeId tid = object->GetInstanceTypeId(); - for (std::size_t i = 0; i < tid.GetAttributeN(); i++) + auto [found, inTid, attr] = TypeId::FindAttribute(tid, name); + + if (found) { - TypeId::AttributeInformation tmp = tid.GetAttribute(i); - if (tmp.name == name) + if (attr.checker && attr.checker->GetValueTypeName() == "ns3::CallbackValue") { - supportLevel = tmp.supportLevel; - break; + NS_LOG_WARN("Attribute " << GetCurrentPath() + << " was not saved because it is a CallbackValue"); + return; + } + auto supportLevel = attr.supportLevel; + if (supportLevel == TypeId::SupportLevel::OBSOLETE) + { + NS_LOG_WARN("Attribute " << GetCurrentPath() + << " was not saved because it is OBSOLETE"); + return; + } + + std::string originalInitialValue = + attr.originalInitialValue->SerializeToString(attr.checker); + object->GetAttribute(name, str, true); + + if (supportLevel == TypeId::SupportLevel::DEPRECATED && + str.Get() == originalInitialValue) + { + NS_LOG_WARN("Attribute " + << GetCurrentPath() + << " was not saved because it is DEPRECATED and its value has not " + "changed from the original initial value"); + return; } - } - if (supportLevel == TypeId::SupportLevel::OBSOLETE) - { - NS_LOG_WARN("Attribute " << GetCurrentPath() - << " was not saved because it is OBSOLETE"); - } - else if (supportLevel == TypeId::SupportLevel::DEPRECATED && !m_saveDeprecated) - { - NS_LOG_WARN("Attribute " << GetCurrentPath() - << " was not saved because it is DEPRECATED"); - } - else - { - object->GetAttribute(name, str); NS_LOG_DEBUG("Saving " << GetCurrentPath()); *m_os << "value " << GetCurrentPath() << " \"" << str.Get() << "\"" << std::endl; } } std::ostream* m_os; - bool m_saveDeprecated; }; RawTextAttributeIterator iter = RawTextAttributeIterator(m_os); - iter.SetSaveDeprecated(m_saveDeprecated); iter.Iterate(); } diff --git a/src/config-store/model/raw-text-config.h b/src/config-store/model/raw-text-config.h index 7dc2a4218..1224f87fb 100644 --- a/src/config-store/model/raw-text-config.h +++ b/src/config-store/model/raw-text-config.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/config-store/model/xml-config.cc b/src/config-store/model/xml-config.cc index c8f377d43..564f20e15 100644 --- a/src/config-store/model/xml-config.cc +++ b/src/config-store/model/xml-config.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -115,11 +104,6 @@ XmlConfigSave::Default() m_writer = writer; } - void SetSaveDeprecated(bool saveDeprecated) - { - m_saveDeprecated = saveDeprecated; - } - private: void StartVisitTypeId(std::string name) override { @@ -130,25 +114,38 @@ XmlConfigSave::Default() { TypeId tid = TypeId::LookupByName(m_typeid); ns3::TypeId::SupportLevel supportLevel = TypeId::SupportLevel::SUPPORTED; + std::string originalInitialValue; + std::string valueTypeName; for (std::size_t i = 0; i < tid.GetAttributeN(); i++) { TypeId::AttributeInformation tmp = tid.GetAttribute(i); if (tmp.name == name) { supportLevel = tmp.supportLevel; + originalInitialValue = tmp.originalInitialValue->SerializeToString(tmp.checker); + valueTypeName = tmp.checker->GetValueTypeName(); break; } } + if (valueTypeName == "ns3::CallbackValue") + { + NS_LOG_WARN("Global attribute " << m_typeid << "::" << name + << " was not saved because it is a CallbackValue"); + return; + } if (supportLevel == TypeId::SupportLevel::OBSOLETE) { NS_LOG_WARN("Global attribute " << m_typeid << "::" << name << " was not saved because it is OBSOLETE"); return; } - else if (supportLevel == TypeId::SupportLevel::DEPRECATED && !m_saveDeprecated) + if (supportLevel == TypeId::SupportLevel::DEPRECATED && + defaultValue == originalInitialValue) { - NS_LOG_WARN("Global attribute " << m_typeid << "::" << name - << " was not saved because it is DEPRECATED"); + NS_LOG_WARN("Global attribute " + << m_typeid << "::" << name + << " was not saved because it is DEPRECATED and its value has not " + "changed from the original initial value"); return; } @@ -180,11 +177,9 @@ XmlConfigSave::Default() xmlTextWriterPtr m_writer; std::string m_typeid; - bool m_saveDeprecated; }; XmlDefaultIterator iterator = XmlDefaultIterator(m_writer); - iterator.SetSaveDeprecated(m_saveDeprecated); iterator.Iterate(); } @@ -199,39 +194,45 @@ XmlConfigSave::Attributes() { } - void SetSaveDeprecated(bool saveDeprecated) - { - m_saveDeprecated = saveDeprecated; - } - private: void DoVisitAttribute(Ptr object, std::string name) override { + StringValue str; TypeId tid = object->GetInstanceTypeId(); - ns3::TypeId::SupportLevel supportLevel = TypeId::SupportLevel::SUPPORTED; - for (std::size_t i = 0; i < tid.GetAttributeN(); i++) + + auto [found, inTid, attr] = TypeId::FindAttribute(tid, name); + + if (found) { - TypeId::AttributeInformation tmp = tid.GetAttribute(i); - if (tmp.name == name) + if (attr.checker && attr.checker->GetValueTypeName() == "ns3::CallbackValue") { - supportLevel = tmp.supportLevel; - break; + NS_LOG_WARN("Attribute " << GetCurrentPath() + << " was not saved because it is a CallbackValue"); + return; + } + auto supportLevel = attr.supportLevel; + if (supportLevel == TypeId::SupportLevel::OBSOLETE) + { + NS_LOG_WARN("Attribute " << GetCurrentPath() + << " was not saved because it is OBSOLETE"); + return; + } + + std::string originalInitialValue = + attr.originalInitialValue->SerializeToString(attr.checker); + object->GetAttribute(name, str, true); + + if (supportLevel == TypeId::SupportLevel::DEPRECATED && + str.Get() == originalInitialValue) + { + NS_LOG_WARN("Attribute " + << GetCurrentPath() + << " was not saved because it is DEPRECATED and its value has not " + "changed from the original initial value"); + return; } } - if (supportLevel == TypeId::SupportLevel::OBSOLETE) - { - NS_LOG_WARN("Attribute " << GetCurrentPath() - << " was not saved because it is OBSOLETE"); - return; - } - else if (supportLevel == TypeId::SupportLevel::DEPRECATED && !m_saveDeprecated) - { - NS_LOG_WARN("Attribute " << GetCurrentPath() - << " was not saved because it is DEPRECATED"); - return; - } - StringValue str; - object->GetAttribute(name, str); + int rc; rc = xmlTextWriterStartElement(m_writer, BAD_CAST "value"); if (rc < 0) @@ -259,11 +260,9 @@ XmlConfigSave::Attributes() } xmlTextWriterPtr m_writer; - bool m_saveDeprecated; }; XmlTextAttributeIterator iter = XmlTextAttributeIterator(m_writer); - iter.SetSaveDeprecated(m_saveDeprecated); iter.Iterate(); } diff --git a/src/config-store/model/xml-config.h b/src/config-store/model/xml-config.h index 7d499cc02..23b3577e1 100644 --- a/src/config-store/model/xml-config.h +++ b/src/config-store/model/xml-config.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 41ed6b21e..48de20154 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,6 +1,18 @@ # Set lib core link dependencies set(libraries_to_link) +set(config_headers + ${CMAKE_HEADER_OUTPUT_DIRECTORY}/config-store-config.h + ${CMAKE_HEADER_OUTPUT_DIRECTORY}/core-config.h +) +if(${ENABLE_BUILD_VERSION}) + list( + APPEND + config_headers + ${CMAKE_HEADER_OUTPUT_DIRECTORY}/version-defines.h + ) +endif() + set(gsl_test_sources) if(${GSL_FOUND}) set(libraries_to_link @@ -183,10 +195,12 @@ set(source_files model/realtime-simulator-impl.cc model/wall-clock-synchronizer.cc model/matrix-array.cc + model/demangle.cc ) # Define core lib headers set(header_files + ${config_headers} ${int64x64_headers} ${example_as_test_headers} ${embedded_version_headers} @@ -212,6 +226,7 @@ set(header_files model/config.h model/default-deleter.h model/default-simulator-impl.h + model/demangle.h model/deprecated.h model/des-metrics.h model/double.h diff --git a/src/core/doc/core.h b/src/core/doc/core.h index bd95bebf9..7920f89c5 100644 --- a/src/core/doc/core.h +++ b/src/core/doc/core.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Peter D. Barnes, Jr. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: * Tom Henderson diff --git a/src/core/doc/environment-variables.h b/src/core/doc/environment-variables.h index b23fc53dd..d9ba6c08c 100644 --- a/src/core/doc/environment-variables.h +++ b/src/core/doc/environment-variables.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/assert-example.cc b/src/core/examples/assert-example.cc index 2248deec0..f4040251d 100644 --- a/src/core/examples/assert-example.cc +++ b/src/core/examples/assert-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/build-version-example.cc b/src/core/examples/build-version-example.cc index 6426eb839..3579b8520 100644 --- a/src/core/examples/build-version-example.cc +++ b/src/core/examples/build-version-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/command-line-example.cc b/src/core/examples/command-line-example.cc index 7fb5b22b2..3f1071c62 100644 --- a/src/core/examples/command-line-example.cc +++ b/src/core/examples/command-line-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/empirical-random-variable-example.cc b/src/core/examples/empirical-random-variable-example.cc index a44ee9551..ad414819c 100644 --- a/src/core/examples/empirical-random-variable-example.cc +++ b/src/core/examples/empirical-random-variable-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/fatal-example.cc b/src/core/examples/fatal-example.cc index 9cf5bfe49..9ac62a04d 100644 --- a/src/core/examples/fatal-example.cc +++ b/src/core/examples/fatal-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/hash-example.cc b/src/core/examples/hash-example.cc index f7d0e3624..26b4faa06 100644 --- a/src/core/examples/hash-example.cc +++ b/src/core/examples/hash-example.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/core-module.h" diff --git a/src/core/examples/length-example.cc b/src/core/examples/length-example.cc index e23e5a34d..536dc485c 100644 --- a/src/core/examples/length-example.cc +++ b/src/core/examples/length-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathew Bielejeski */ diff --git a/src/core/examples/log-example.cc b/src/core/examples/log-example.cc index 62d4fdd14..f78f3fef9 100644 --- a/src/core/examples/log-example.cc +++ b/src/core/examples/log-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/main-callback.cc b/src/core/examples/main-callback.cc index ad4d6969e..40910e6f4 100644 --- a/src/core/examples/main-callback.cc +++ b/src/core/examples/main-callback.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/examples/main-ptr.cc b/src/core/examples/main-ptr.cc index f1e8fd630..53af974c9 100644 --- a/src/core/examples/main-ptr.cc +++ b/src/core/examples/main-ptr.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/examples/main-random-variable-stream.cc b/src/core/examples/main-random-variable-stream.cc index ea435936b..52aee4456 100644 --- a/src/core/examples/main-random-variable-stream.cc +++ b/src/core/examples/main-random-variable-stream.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 Timo Bingmann * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Timo Bingmann */ diff --git a/src/core/examples/main-test-sync.cc b/src/core/examples/main-test-sync.cc index b8f1031f3..8712eb8d2 100644 --- a/src/core/examples/main-test-sync.cc +++ b/src/core/examples/main-test-sync.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/command-line.h" diff --git a/src/core/examples/sample-log-time-format.cc b/src/core/examples/sample-log-time-format.cc index f25ee58d7..f6e32b5af 100644 --- a/src/core/examples/sample-log-time-format.cc +++ b/src/core/examples/sample-log-time-format.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ /** diff --git a/src/core/examples/sample-random-variable-stream.cc b/src/core/examples/sample-random-variable-stream.cc index 66b694267..695c45ee1 100644 --- a/src/core/examples/sample-random-variable-stream.cc +++ b/src/core/examples/sample-random-variable-stream.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/command-line.h" #include "ns3/nstime.h" diff --git a/src/core/examples/sample-random-variable.cc b/src/core/examples/sample-random-variable.cc index 4433d73e6..34dcff60b 100644 --- a/src/core/examples/sample-random-variable.cc +++ b/src/core/examples/sample-random-variable.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/command-line.h" #include "ns3/nstime.h" diff --git a/src/core/examples/sample-rng-plot.py b/src/core/examples/sample-rng-plot.py index 6b3e0907d..c742e9c0c 100644 --- a/src/core/examples/sample-rng-plot.py +++ b/src/core/examples/sample-rng-plot.py @@ -1,16 +1,5 @@ # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # ## @file diff --git a/src/core/examples/sample-show-progress.cc b/src/core/examples/sample-show-progress.cc index 811481307..e57fad3e9 100644 --- a/src/core/examples/sample-show-progress.cc +++ b/src/core/examples/sample-show-progress.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro * Author: Peter D. Barnes, Jr. diff --git a/src/core/examples/sample-simulator.cc b/src/core/examples/sample-simulator.cc index 66224bd29..0df364e91 100644 --- a/src/core/examples/sample-simulator.cc +++ b/src/core/examples/sample-simulator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/examples/sample-simulator.py b/src/core/examples/sample-simulator.py index 7f8084a4b..d6838b0af 100755 --- a/src/core/examples/sample-simulator.py +++ b/src/core/examples/sample-simulator.py @@ -1,18 +1,7 @@ # # Copyright (c) 2010 INRIA # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Authors: Mathieu Lacage # diff --git a/src/core/examples/system-path-examples.cc b/src/core/examples/system-path-examples.cc index 7e52f10da..db034b42a 100644 --- a/src/core/examples/system-path-examples.cc +++ b/src/core/examples/system-path-examples.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/examples/test-string-value-formatting.cc b/src/core/examples/test-string-value-formatting.cc index 526af8a13..4ad1c04d7 100644 --- a/src/core/examples/test-string-value-formatting.cc +++ b/src/core/examples/test-string-value-formatting.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Tom Henderson * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/core-module.h" diff --git a/src/core/helper/csv-reader.cc b/src/core/helper/csv-reader.cc index a44e42e5e..487f512cc 100644 --- a/src/core/helper/csv-reader.cc +++ b/src/core/helper/csv-reader.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathew Bielejeski */ diff --git a/src/core/helper/csv-reader.h b/src/core/helper/csv-reader.h index 49c9e9f8b..978c6310c 100644 --- a/src/core/helper/csv-reader.h +++ b/src/core/helper/csv-reader.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathew Bielejeski */ diff --git a/src/core/helper/event-garbage-collector.cc b/src/core/helper/event-garbage-collector.cc index 6beed43eb..aad1b191f 100644 --- a/src/core/helper/event-garbage-collector.cc +++ b/src/core/helper/event-garbage-collector.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INESC Porto * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo J. A. M. Carneiro */ diff --git a/src/core/helper/event-garbage-collector.h b/src/core/helper/event-garbage-collector.h index c336d66d1..21399b82c 100644 --- a/src/core/helper/event-garbage-collector.h +++ b/src/core/helper/event-garbage-collector.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INESC Porto * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo J. A. M. Carneiro */ diff --git a/src/core/helper/random-variable-stream-helper.cc b/src/core/helper/random-variable-stream-helper.cc index e174ba6a4..93a2fa8f4 100644 --- a/src/core/helper/random-variable-stream-helper.cc +++ b/src/core/helper/random-variable-stream-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ #include "random-variable-stream-helper.h" diff --git a/src/core/helper/random-variable-stream-helper.h b/src/core/helper/random-variable-stream-helper.h index 6b63dcf89..34702903b 100644 --- a/src/core/helper/random-variable-stream-helper.h +++ b/src/core/helper/random-variable-stream-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ #ifndef RANDOM_VARIABLE_STREAM_HELPER_H diff --git a/src/core/model/abort.h b/src/core/model/abort.h index cd22e48f7..99563d80e 100644 --- a/src/core/model/abort.h +++ b/src/core/model/abort.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA, 2010 NICTA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Original author unknown * Quincy Tse diff --git a/src/core/model/ascii-file.cc b/src/core/model/ascii-file.cc index 98d4e813b..2a210f6df 100644 --- a/src/core/model/ascii-file.cc +++ b/src/core/model/ascii-file.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mitch Watrous (watrous@u.washington.edu) * diff --git a/src/core/model/ascii-file.h b/src/core/model/ascii-file.h index a0f74656b..240275ce7 100644 --- a/src/core/model/ascii-file.h +++ b/src/core/model/ascii-file.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mitch Watrous (watrous@u.washington.edu) * diff --git a/src/core/model/ascii-test.h b/src/core/model/ascii-test.h index 0b1947a31..834ace79c 100644 --- a/src/core/model/ascii-test.h +++ b/src/core/model/ascii-test.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mitch Watrous (watrous@u.washington.edu) * diff --git a/src/core/model/assert.h b/src/core/model/assert.h index 7a819c27f..60aa763cf 100644 --- a/src/core/model/assert.h +++ b/src/core/model/assert.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA, 2010 NICTA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Quincy Tse diff --git a/src/core/model/attribute-accessor-helper.h b/src/core/model/attribute-accessor-helper.h index e9f1e9f1c..1f04789c9 100644 --- a/src/core/model/attribute-accessor-helper.h +++ b/src/core/model/attribute-accessor-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -117,7 +106,7 @@ inline Ptr MakeAccessorHelper(T1 a1, T2 a2); * Implementation of the templates declared above. ***************************************************************/ -#include "type-traits.h" +#include namespace ns3 { @@ -133,7 +122,7 @@ template struct AccessorTrait { /** The non-const, non reference type. */ - typedef typename TypeTraits::ReferencedType>::NonConstType Result; + using Result = std::remove_cvref_t; }; /** diff --git a/src/core/model/attribute-construction-list.cc b/src/core/model/attribute-construction-list.cc index 42253c176..6cee86363 100644 --- a/src/core/model/attribute-construction-list.cc +++ b/src/core/model/attribute-construction-list.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/attribute-construction-list.h b/src/core/model/attribute-construction-list.h index d76efafed..2edfc8cc0 100644 --- a/src/core/model/attribute-construction-list.h +++ b/src/core/model/attribute-construction-list.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/attribute-container.h b/src/core/model/attribute-container.h index 70f5eb386..d4f1b94f6 100644 --- a/src/core/model/attribute-container.h +++ b/src/core/model/attribute-container.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Caliola Engineering, LLC. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jared Dulmage */ diff --git a/src/core/model/attribute-helper.h b/src/core/model/attribute-helper.h index 6f98305eb..7d92d7b3c 100644 --- a/src/core/model/attribute-helper.h +++ b/src/core/model/attribute-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -204,7 +193,7 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) class name##Value : public AttributeValue \ { \ public: \ - name##Value(); \ + name##Value() = default; \ name##Value(const type& value); \ void Set(const type& value); \ type Get() const; \ @@ -292,10 +281,6 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) * Typically invoked in the source file */ #define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type, name) \ - name##Value::name##Value() \ - : m_value() \ - { \ - } \ name##Value::name##Value(const type& value) \ : m_value(value) \ { \ @@ -321,6 +306,11 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) bool name##Value::DeserializeFromString(std::string value, \ Ptr checker) \ { \ + if (value.empty()) \ + { \ + m_value = type(); \ + return true; \ + } \ std::istringstream iss; \ iss.str(value); \ iss >> m_value; \ diff --git a/src/core/model/attribute.cc b/src/core/model/attribute.cc index 6553a2353..38fcb4e31 100644 --- a/src/core/model/attribute.cc +++ b/src/core/model/attribute.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/attribute.h b/src/core/model/attribute.h index 944fe8306..4e6c4db91 100644 --- a/src/core/model/attribute.h +++ b/src/core/model/attribute.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/boolean.cc b/src/core/model/boolean.cc index e7706a5fa..0a1c9ad3d 100644 --- a/src/core/model/boolean.cc +++ b/src/core/model/boolean.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/boolean.h b/src/core/model/boolean.h index 4b19f31f8..8c0c930b6 100644 --- a/src/core/model/boolean.h +++ b/src/core/model/boolean.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/breakpoint.cc b/src/core/model/breakpoint.cc index 4ae8637fb..e17362c32 100644 --- a/src/core/model/breakpoint.cc +++ b/src/core/model/breakpoint.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006,2007 INRIA, INESC Porto * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Gustavo Carneiro diff --git a/src/core/model/breakpoint.h b/src/core/model/breakpoint.h index 8593038cd..e5590b4c7 100644 --- a/src/core/model/breakpoint.h +++ b/src/core/model/breakpoint.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006,2007 INESC Porto, INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro * Author: Mathieu Lacage diff --git a/src/core/model/build-profile.h b/src/core/model/build-profile.h index 5a3994726..1a38e6cc1 100644 --- a/src/core/model/build-profile.h +++ b/src/core/model/build-profile.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 LLNL * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/cairo-wideint-private.h b/src/core/model/cairo-wideint-private.h index 9dbc1e3b2..402b68d24 100644 --- a/src/core/model/cairo-wideint-private.h +++ b/src/core/model/cairo-wideint-private.h @@ -1,3 +1,6 @@ +// NOLINTBEGIN +// clang-format off + /* cairo - a vector graphics library with display and print output * * Copyright © 2004 Keith Packard @@ -29,9 +32,6 @@ * */ -// NOLINTBEGIN -// clang-format off - #ifndef CAIRO_WIDEINT_H #define CAIRO_WIDEINT_H diff --git a/src/core/model/cairo-wideint.c b/src/core/model/cairo-wideint.c index 893112f32..d8abe2da6 100644 --- a/src/core/model/cairo-wideint.c +++ b/src/core/model/cairo-wideint.c @@ -1,3 +1,6 @@ +// NOLINTBEGIN +// clang-format off + /* cairo - a vector graphics library with display and print output * * Copyright © 2004 Keith Packard @@ -30,9 +33,6 @@ * Code changes for ns-3 from upstream are marked with `//PDB' */ -// NOLINTBEGIN -// clang-format off - #include "cairo-wideint-private.h" #include diff --git a/src/core/model/calendar-scheduler.cc b/src/core/model/calendar-scheduler.cc index 2cb9e37e9..35cf8a4ea 100644 --- a/src/core/model/calendar-scheduler.cc +++ b/src/core/model/calendar-scheduler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Alexander Krotov diff --git a/src/core/model/calendar-scheduler.h b/src/core/model/calendar-scheduler.h index 73c0822fd..87febd01c 100644 --- a/src/core/model/calendar-scheduler.h +++ b/src/core/model/calendar-scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Alexander Krotov diff --git a/src/core/model/callback.cc b/src/core/model/callback.cc index 3971a5358..189e958ec 100644 --- a/src/core/model/callback.cc +++ b/src/core/model/callback.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -88,67 +77,3 @@ CallbackValue::DeserializeFromString(std::string value, Ptr= 3) - -#include -#include - -namespace ns3 -{ - -std::string -CallbackImplBase::Demangle(const std::string& mangled) -{ - NS_LOG_FUNCTION(mangled); - - int status; - char* demangled = abi::__cxa_demangle(mangled.c_str(), nullptr, nullptr, &status); - - std::string ret; - if (status == 0) - { - NS_ASSERT(demangled); - ret = demangled; - } - else if (status == -1) - { - NS_LOG_UNCOND("Callback demangling failed: Memory allocation failure occurred."); - ret = mangled; - } - else if (status == -2) - { - NS_LOG_UNCOND("Callback demangling failed: Mangled name is not a valid under the C++ ABI " - "mangling rules."); - ret = mangled; - } - else if (status == -3) - { - NS_LOG_UNCOND("Callback demangling failed: One of the arguments is invalid."); - ret = mangled; - } - else - { - NS_LOG_UNCOND("Callback demangling failed: status " << status); - ret = mangled; - } - - if (demangled) - { - std::free(demangled); - } - return ret; -} - -} // namespace ns3 - -#else - -std::string -ns3::CallbackImplBase::Demangle(const std::string& mangled) -{ - NS_LOG_FUNCTION(this << mangled); - return mangled; -} - -#endif diff --git a/src/core/model/callback.h b/src/core/model/callback.h index df4a2dfb8..e4bc77214 100644 --- a/src/core/model/callback.h +++ b/src/core/model/callback.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage * Stefano Avallone @@ -23,6 +12,7 @@ #include "attribute-helper.h" #include "attribute.h" +#include "demangle.h" #include "fatal-error.h" #include "ptr.h" #include "simple-ref-count.h" @@ -99,12 +89,6 @@ class CallbackImplBase : public SimpleRefCount virtual std::string GetTypeid() const = 0; protected: - /** - * \param [in] mangled The mangled string - * \return The demangled form of mangled - */ - static std::string Demangle(const std::string& mangled); - /** * Helper to get the C++ typeid as a string. * diff --git a/src/core/model/command-line.cc b/src/core/model/command-line.cc index cd8d6807f..818b860bb 100644 --- a/src/core/model/command-line.cc +++ b/src/core/model/command-line.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/command-line.h b/src/core/model/command-line.h index 60d42f1cf..fea314aad 100644 --- a/src/core/model/command-line.h +++ b/src/core/model/command-line.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -466,7 +455,7 @@ class CommandLine /** * \ingroup commandline - *\brief An argument Item assigning to POD + * \brief An argument Item assigning to POD */ template class UserItem : public Item @@ -672,8 +661,9 @@ class CommandLine }; // class CommandLine -/** \ingroup commandline - * \defgroup commandlinehelper Helpers to specialize UserItem +/** + * \ingroup commandline + * \defgroup commandlinehelper Helpers to specialize UserItem */ /** * \ingroup commandlinehelper diff --git a/src/core/model/config.cc b/src/core/model/config.cc index 578d4c7be..512394da2 100644 --- a/src/core/model/config.cc +++ b/src/core/model/config.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/config.h b/src/core/model/config.h index acd3e37b9..f3f1009b9 100644 --- a/src/core/model/config.h +++ b/src/core/model/config.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/default-deleter.h b/src/core/model/default-deleter.h index f1d6dd1e0..9b5439f8b 100644 --- a/src/core/model/default-deleter.h +++ b/src/core/model/default-deleter.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/model/default-simulator-impl.cc b/src/core/model/default-simulator-impl.cc index f22bc6dca..54849af59 100644 --- a/src/core/model/default-simulator-impl.cc +++ b/src/core/model/default-simulator-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/default-simulator-impl.h b/src/core/model/default-simulator-impl.h index 4a87e7dab..e57cd5188 100644 --- a/src/core/model/default-simulator-impl.h +++ b/src/core/model/default-simulator-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/demangle.cc b/src/core/model/demangle.cc new file mode 100644 index 000000000..0ad9e00cf --- /dev/null +++ b/src/core/model/demangle.cc @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2005,2006 INRIA + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Author: Mathieu Lacage + * Modified by: Gabriel Ferreira + * Moved the Demangle function out of CallbackImplBase + */ + +#include "demangle.h" + +#include "assert.h" +#include "log.h" + +NS_LOG_COMPONENT_DEFINE("Demangle"); + +#if (__GNUC__ >= 3) + +#include +#include + +std::string +ns3::Demangle(const std::string& mangled) +{ + NS_LOG_FUNCTION(mangled); + + int status; + char* demangled = abi::__cxa_demangle(mangled.c_str(), nullptr, nullptr, &status); + + std::string ret; + if (status == 0) + { + NS_ASSERT(demangled); + ret = demangled; + } + else if (status == -1) + { + NS_LOG_DEBUG("Demangling failed: Memory allocation failure occurred."); + ret = mangled; + } + else if (status == -2) + { + NS_LOG_DEBUG("Demangling failed: Mangled name is not a valid under the C++ ABI " + "mangling rules."); + ret = mangled; + } + else if (status == -3) + { + NS_LOG_DEBUG("Demangling failed: One of the arguments is invalid."); + ret = mangled; + } + else + { + NS_LOG_DEBUG("Demangling failed: status " << status); + ret = mangled; + } + + if (demangled) + { + std::free(demangled); + } + return ret; +} + +#else + +std::string +ns3::Demangle(const std::string& mangled) +{ + NS_LOG_FUNCTION(mangled); + return mangled; +} + +#endif diff --git a/src/core/model/demangle.h b/src/core/model/demangle.h new file mode 100644 index 000000000..c97ffd535 --- /dev/null +++ b/src/core/model/demangle.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2005,2006 INRIA + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Author: Mathieu Lacage + * Modified by: Gabriel Ferreira + * Moved the Demangle function out of CallbackImplBase + */ + +#ifndef NS3_DEMANGLE_H +#define NS3_DEMANGLE_H + +#include + +namespace ns3 +{ +/** + * \param [in] mangled The mangled string + * \return The demangled form of mangled + */ +std::string Demangle(const std::string& mangled); +}; // namespace ns3 + +#endif // NS3_DEMANGLE_H diff --git a/src/core/model/deprecated.h b/src/core/model/deprecated.h index 4166d84e7..fc57b888a 100644 --- a/src/core/model/deprecated.h +++ b/src/core/model/deprecated.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -92,7 +81,14 @@ * \param msg Optional message to add to the compiler warning. * */ -#define NS_DEPRECATED(msg) [[deprecated(msg)]] +#define NS_DEPRECATED(msg) /** \deprecated msg */ [[deprecated(msg)]] + +/** + * \ingroup deprecation + * \def NS_DEPRECATED_3_43 + * Tag for things deprecated in version ns-3.43. + */ +#define NS_DEPRECATED_3_43(msg) NS_DEPRECATED("Deprecated in ns-3.43: " msg) /** * \ingroup deprecation diff --git a/src/core/model/des-metrics.cc b/src/core/model/des-metrics.cc index b79729b38..3f6ad07bb 100644 --- a/src/core/model/des-metrics.cc +++ b/src/core/model/des-metrics.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 LLNL * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/des-metrics.h b/src/core/model/des-metrics.h index 65d224e90..28fa128f5 100644 --- a/src/core/model/des-metrics.h +++ b/src/core/model/des-metrics.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 LLNL * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/double.cc b/src/core/model/double.cc index e3ce84c00..b31efb3c9 100644 --- a/src/core/model/double.cc +++ b/src/core/model/double.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/double.h b/src/core/model/double.h index 7876c290c..7cf651546 100644 --- a/src/core/model/double.h +++ b/src/core/model/double.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/enum.h b/src/core/model/enum.h index 464a7c039..274c8119a 100644 --- a/src/core/model/enum.h +++ b/src/core/model/enum.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -21,6 +10,7 @@ #include "attribute-accessor-helper.h" #include "attribute.h" +#include "demangle.h" #include // find_if #include @@ -341,7 +331,7 @@ template std::string EnumChecker::GetValueTypeName() const { - return "ns3::EnumValue<" + std::string(typeid(T).name()) + ">"; + return "ns3::EnumValue<" + Demangle(typeid(T).name()) + ">"; } template diff --git a/src/core/model/environment-variable.cc b/src/core/model/environment-variable.cc index d6ddd02b2..a753b2577 100644 --- a/src/core/model/environment-variable.cc +++ b/src/core/model/environment-variable.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/environment-variable.h b/src/core/model/environment-variable.h index 607ee15c6..97beac979 100644 --- a/src/core/model/environment-variable.h +++ b/src/core/model/environment-variable.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/event-id.cc b/src/core/model/event-id.cc index 174e01429..bf34b93c8 100644 --- a/src/core/model/event-id.cc +++ b/src/core/model/event-id.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/event-id.h b/src/core/model/event-id.h index 5f042d4d8..ab3ed842a 100644 --- a/src/core/model/event-id.h +++ b/src/core/model/event-id.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/event-impl.cc b/src/core/model/event-impl.cc index 29cf7d237..60259d9b4 100644 --- a/src/core/model/event-impl.cc +++ b/src/core/model/event-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/event-impl.h b/src/core/model/event-impl.h index aba8e65e1..f899ddb74 100644 --- a/src/core/model/event-impl.h +++ b/src/core/model/event-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/example-as-test.cc b/src/core/model/example-as-test.cc index a53353a94..645951af9 100644 --- a/src/core/model/example-as-test.cc +++ b/src/core/model/example-as-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ @@ -42,7 +31,6 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE("ExampleAsTestCase"); // Running tests as examples currently requires Python. -#if defined(NS3_ENABLE_EXAMPLES) ExampleAsTestCase::ExampleAsTestCase(const std::string name, const std::string program, @@ -161,6 +149,4 @@ ExampleAsTestSuite::ExampleAsTestSuite(const std::string name, AddTestCase(new ExampleAsTestCase(name, program, dataDir, args, shouldNotErr), duration); } -#endif // NS3_ENABLE_EXAMPLES - } // namespace ns3 diff --git a/src/core/model/example-as-test.h b/src/core/model/example-as-test.h index c730ec39e..c0e4db0ec 100644 --- a/src/core/model/example-as-test.h +++ b/src/core/model/example-as-test.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/fatal-error.h b/src/core/model/fatal-error.h index 67c199505..4f19337b9 100644 --- a/src/core/model/fatal-error.h +++ b/src/core/model/fatal-error.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA, 2010 NICTA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Quincy Tse diff --git a/src/core/model/fatal-impl.cc b/src/core/model/fatal-impl.cc index 7c709b51b..5b6a3b429 100644 --- a/src/core/model/fatal-impl.cc +++ b/src/core/model/fatal-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 NICTA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Quincy Tse */ diff --git a/src/core/model/fatal-impl.h b/src/core/model/fatal-impl.h index 4bf93a73a..1503703e1 100644 --- a/src/core/model/fatal-impl.h +++ b/src/core/model/fatal-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 NICTA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Quincy Tse */ diff --git a/src/core/model/fd-reader.h b/src/core/model/fd-reader.h index ccf51d30b..4614c5d8a 100644 --- a/src/core/model/fd-reader.h +++ b/src/core/model/fd-reader.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Goff */ diff --git a/src/core/model/global-value.cc b/src/core/model/global-value.cc index 679a808dd..404ffe0d9 100644 --- a/src/core/model/global-value.cc +++ b/src/core/model/global-value.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/global-value.h b/src/core/model/global-value.h index 179191c01..30fdad8da 100644 --- a/src/core/model/global-value.h +++ b/src/core/model/global-value.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/hash-fnv.cc b/src/core/model/hash-fnv.cc index 9e1a9a54b..4c94b785d 100644 --- a/src/core/model/hash-fnv.cc +++ b/src/core/model/hash-fnv.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. * diff --git a/src/core/model/hash-fnv.h b/src/core/model/hash-fnv.h index 71f4966a9..c02df3e13 100644 --- a/src/core/model/hash-fnv.h +++ b/src/core/model/hash-fnv.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/hash-function.cc b/src/core/model/hash-function.cc index c0b6e9a73..a2379159e 100644 --- a/src/core/model/hash-function.cc +++ b/src/core/model/hash-function.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/hash-function.h b/src/core/model/hash-function.h index 0e6f353ff..e2971fc4d 100644 --- a/src/core/model/hash-function.h +++ b/src/core/model/hash-function.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ @@ -42,9 +31,9 @@ namespace Hash { /** - * \ingroup hash + * \ingroup hash * - * \brief Hash function implementation base class. + * \brief Hash function implementation base class. */ class Implementation : public SimpleRefCount { diff --git a/src/core/model/hash-murmur3.cc b/src/core/model/hash-murmur3.cc index d45d78d83..73acfb461 100644 --- a/src/core/model/hash-murmur3.cc +++ b/src/core/model/hash-murmur3.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. * diff --git a/src/core/model/hash-murmur3.h b/src/core/model/hash-murmur3.h index 700bae866..e48b2f2e5 100644 --- a/src/core/model/hash-murmur3.h +++ b/src/core/model/hash-murmur3.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/hash.cc b/src/core/model/hash.cc index 4f0926cea..584478438 100644 --- a/src/core/model/hash.cc +++ b/src/core/model/hash.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/hash.h b/src/core/model/hash.h index e1468acf1..8aab5a59d 100644 --- a/src/core/model/hash.h +++ b/src/core/model/hash.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ @@ -41,7 +30,7 @@ namespace ns3 * \ingroup core * \defgroup hash Hash Functions * - * \brief Generic Hash function interface. + * \brief Generic Hash function interface. * * See \ref Hasher for main entry point. * See \ref hash-example.cc for example usage. diff --git a/src/core/model/heap-scheduler.cc b/src/core/model/heap-scheduler.cc index cc29614e5..9224d1094 100644 --- a/src/core/model/heap-scheduler.cc +++ b/src/core/model/heap-scheduler.cc @@ -2,18 +2,7 @@ * Copyright (c) 2006 INRIA * Copyright (c) 2005 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * diff --git a/src/core/model/heap-scheduler.h b/src/core/model/heap-scheduler.h index dfa1764cf..69343db55 100644 --- a/src/core/model/heap-scheduler.h +++ b/src/core/model/heap-scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/int64x64-128.cc b/src/core/model/int64x64-128.cc index c5fc43255..2bfaa3c98 100644 --- a/src/core/model/int64x64-128.cc +++ b/src/core/model/int64x64-128.cc @@ -1,19 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ #include "int64x64-128.h" @@ -22,6 +10,8 @@ #include "assert.h" #include "log.h" +#if defined(INT64X64_USE_128) && !defined(PYTHON_SCAN) + /** * \file * \ingroup highprec @@ -253,3 +243,5 @@ int64x64_t::Invert(const uint64_t v) } } // namespace ns3 + +#endif /* INT64X64_128_H */ diff --git a/src/core/model/int64x64-128.h b/src/core/model/int64x64-128.h index 0c2a068b3..28d00e453 100644 --- a/src/core/model/int64x64-128.h +++ b/src/core/model/int64x64-128.h @@ -1,29 +1,19 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ +#ifndef INT64X64_128_H +#define INT64X64_128_H + #include "ns3/core-config.h" -#if !defined(INT64X64_128_H) && defined(INT64X64_USE_128) && !defined(PYTHON_SCAN) /** * \ingroup highprec * Use uint128_t for int64x64_t implementation */ -#define INT64X64_128_H +#if defined(INT64X64_USE_128) && !defined(PYTHON_SCAN) #include // pow #include @@ -58,22 +48,11 @@ class int64x64_t static const uint128_t HP128_MASK_HI_BIT = (((int128_t)1) << 127); /// Mask for fraction part. static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; - /** - * Floating point value of HP_MASK_LO + 1. - * We really want: - * \code - * static const long double HP_MAX_64 = std:pow (2.0L, 64); - * \endcode - * but we can't call functions in const definitions. - * - * We could make this a static and initialize in int64x64-128.cc or - * int64x64.cc, but this requires handling static initialization order - * when most of the implementation is inline. Instead, we resort to - * this define. - */ -#define HP_MAX_64 (std::pow(2.0L, 64)) public: + /// Floating point value of HP_MASK_LO + 1. + static constexpr long double HP_MAX_64 = (static_cast(1) << 63) * 2.0L; + /** * Type tag for the underlying implementation. * @@ -238,7 +217,8 @@ class int64x64_t inline double GetDouble() const { const bool negative = _v < 0; - const uint128_t value = negative ? -_v : _v; + const int128_t vTemp = _v + (_v == std::numeric_limits::min()); + const uint128_t value = negative ? -vTemp : vTemp; const long double fhi = value >> 64; const long double flo = (value & HP_MASK_LO) / HP_MAX_64; long double retval = fhi; @@ -471,4 +451,5 @@ class int64x64_t } // namespace ns3 +#endif /* defined(INT64X64_USE_128) && !defined(PYTHON_SCAN) */ #endif /* INT64X64_128_H */ diff --git a/src/core/model/int64x64-cairo.cc b/src/core/model/int64x64-cairo.cc index c686cf632..f1100ba28 100644 --- a/src/core/model/int64x64-cairo.cc +++ b/src/core/model/int64x64-cairo.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -26,6 +15,8 @@ #include #include +#if defined(INT64X64_USE_CAIRO) && !defined(PYTHON_SCAN) + // Include directly to allow optimizations within this compilation unit. extern "C" { @@ -235,3 +226,5 @@ int64x64_t::Invert(const uint64_t v) } } // namespace ns3 + +#endif /* INT64X64_CAIRO_H */ diff --git a/src/core/model/int64x64-cairo.h b/src/core/model/int64x64-cairo.h index e90d4d120..7e9c6b61a 100644 --- a/src/core/model/int64x64-cairo.h +++ b/src/core/model/int64x64-cairo.h @@ -1,26 +1,17 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ -#include "ns3/core-config.h" -#if !defined(INT64X64_CAIRO_H) && defined(INT64X64_USE_CAIRO) && !defined(PYTHON_SCAN) -/** Using the ns3::int64x64_t based on Cairo 128-bit integers. */ +#ifndef INT64X64_CAIRO_H #define INT64X64_CAIRO_H +#include "ns3/core-config.h" + +#if defined(INT64X64_USE_CAIRO) && !defined(PYTHON_SCAN) +/** Using the ns3::int64x64_t based on Cairo 128-bit integers. */ + #include "cairo-wideint-private.h" #include // pow @@ -44,21 +35,11 @@ class int64x64_t static const uint64_t HPCAIRO_MASK_HI_BIT = (((uint64_t)1) << 63); /// Mask for fraction part static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; - /** - * Floating point value of HP_MASK_LO + 1 - * We really want: - * \code - * static const long double HP_MAX_64 = std:pow (2.0L, 64); - * \endcode - * but we can't call functions in const definitions, - * We could make this a static and initialize in int64x64-cairo.cc or - * int64x64.cc, but this requires handling static initialization order - * when most of the implementation is inline. Instead, we resort to - * this define. - */ -#define HP_MAX_64 (std::pow(2.0L, 64)) public: + /// Floating point value of HP_MASK_LO + 1 + static constexpr long double HP_MAX_64 = (static_cast(1) << 63) * 2.0L; + /** * Type tag for the underlying implementation. * @@ -453,4 +434,5 @@ class int64x64_t } // namespace ns3 +#endif /* defined(INT64X64_USE_CAIRO) && !defined(PYTHON_SCAN) */ #endif /* INT64X64_CAIRO_H */ diff --git a/src/core/model/int64x64-double.h b/src/core/model/int64x64-double.h index b965003c1..650fa45bf 100644 --- a/src/core/model/int64x64-double.h +++ b/src/core/model/int64x64-double.h @@ -1,26 +1,17 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ -#include "ns3/core-config.h" -#if !defined(INT64X64_DOUBLE_H) && (defined(INT64X64_USE_DOUBLE) || defined(PYTHON_SCAN)) -/** Using the ns3::int64x64_t based on double values. */ +#ifndef INT64X64_DOUBLE_H #define INT64X64_DOUBLE_H +#include "ns3/core-config.h" + +#if defined(INT64X64_USE_DOUBLE) || defined(PYTHON_SCAN) +/** Using the ns3::int64x64_t based on double values. */ + #include // pow #include #include // pair @@ -43,21 +34,11 @@ class int64x64_t { /// Mask for fraction part static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL; - /** - * Floating point value of HP_MASK_LO + 1 - * We really want: - * \code - * static const long double HP_MAX_64 = std:pow (2.0L, 64); - * \endcode - * but we can't call functions in const definitions, - * We could make this a static and initialize in int64x64-double.cc or - * int64x64.cc, but this requires handling static initialization order - * when most of the implementation is inline. Instead, we resort to - * this define. - */ -#define HP_MAX_64 (std::pow(2.0L, 64)) public: + /// Floating point value of HP_MASK_LO + 1 + static constexpr long double HP_MAX_64 = (static_cast(1) << 63) * 2.0L; + /** * Type tag for the underlying implementation. * @@ -396,4 +377,5 @@ class int64x64_t } // namespace ns3 +#endif /* defined(INT64X64_USE_DOUBLE) || defined(PYTHON_SCAN) */ #endif /* INT64X64_DOUBLE_H */ diff --git a/src/core/model/int64x64.cc b/src/core/model/int64x64.cc index 2c390b050..b93a3afd8 100644 --- a/src/core/model/int64x64.cc +++ b/src/core/model/int64x64.cc @@ -1,19 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ #include "int64x64.h" diff --git a/src/core/model/int64x64.h b/src/core/model/int64x64.h index e368d073e..d396b17d7 100644 --- a/src/core/model/int64x64.h +++ b/src/core/model/int64x64.h @@ -1,19 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef INT64X64_H diff --git a/src/core/model/integer.cc b/src/core/model/integer.cc index 8dd248ad8..0f794b4f3 100644 --- a/src/core/model/integer.cc +++ b/src/core/model/integer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/integer.h b/src/core/model/integer.h index 572700082..7724275ef 100644 --- a/src/core/model/integer.h +++ b/src/core/model/integer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/length.cc b/src/core/model/length.cc index 718c01e27..d4f4455c5 100644 --- a/src/core/model/length.cc +++ b/src/core/model/length.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathew Bielejeski */ diff --git a/src/core/model/length.h b/src/core/model/length.h index 9f33774ec..561c8ea54 100644 --- a/src/core/model/length.h +++ b/src/core/model/length.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathew Bielejeski */ diff --git a/src/core/model/list-scheduler.cc b/src/core/model/list-scheduler.cc index ea1685d13..edef53fba 100644 --- a/src/core/model/list-scheduler.cc +++ b/src/core/model/list-scheduler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/list-scheduler.h b/src/core/model/list-scheduler.h index 86c35cb42..426586d3f 100644 --- a/src/core/model/list-scheduler.h +++ b/src/core/model/list-scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/log-macros-disabled.h b/src/core/model/log-macros-disabled.h index 1695cfa41..ca9700d88 100644 --- a/src/core/model/log-macros-disabled.h +++ b/src/core/model/log-macros-disabled.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Andrey Mazo * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrey Mazo */ diff --git a/src/core/model/log-macros-enabled.h b/src/core/model/log-macros-enabled.h index 2251178dd..2c6ff63cf 100644 --- a/src/core/model/log-macros-enabled.h +++ b/src/core/model/log-macros-enabled.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/log.cc b/src/core/model/log.cc index 8f36fd907..41b427065 100644 --- a/src/core/model/log.cc +++ b/src/core/model/log.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -492,8 +481,9 @@ void LogSetTimePrinter(TimePrinter printer) { g_logTimePrinter = printer; - /** \internal - * This is the only place where we are more or less sure that all log variables + /** + * \internal + * This is the only place where we are more or less sure that all log variables * are registered. See \bugid{1082} for details. */ CheckEnvironmentVariables(); diff --git a/src/core/model/log.h b/src/core/model/log.h index cfc2f90e0..64d3f2c25 100644 --- a/src/core/model/log.h +++ b/src/core/model/log.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -195,7 +184,7 @@ void LogComponentDisableAll(LogLevel level); * using ns3::g_log; * * // Further definitions outside of the ns3 namespace - *\endcode + * \endcode * * \param [in] name The log component name. */ diff --git a/src/core/model/make-event.h b/src/core/model/make-event.h index 8cb09164c..4cfb6651b 100644 --- a/src/core/model/make-event.h +++ b/src/core/model/make-event.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/model/map-scheduler.cc b/src/core/model/map-scheduler.cc index aaa50fd09..d14f6d25a 100644 --- a/src/core/model/map-scheduler.cc +++ b/src/core/model/map-scheduler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * The idea to use a std c++ map came from GTNetS diff --git a/src/core/model/map-scheduler.h b/src/core/model/map-scheduler.h index df9283dcb..f630fc970 100644 --- a/src/core/model/map-scheduler.h +++ b/src/core/model/map-scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/math.h b/src/core/model/math.h index e92354082..a3519c2cd 100644 --- a/src/core/model/math.h +++ b/src/core/model/math.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * * FreeBSD log2 patch from graphviz port to FreeBSD 9, courtesy of diff --git a/src/core/model/matrix-array.cc b/src/core/model/matrix-array.cc index 854266dee..ef48e772f 100644 --- a/src/core/model/matrix-array.cc +++ b/src/core/model/matrix-array.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Biljana Bojovic */ diff --git a/src/core/model/matrix-array.h b/src/core/model/matrix-array.h index 3e3bf6ca0..cae21af03 100644 --- a/src/core/model/matrix-array.h +++ b/src/core/model/matrix-array.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Biljana Bojovic */ @@ -200,7 +189,7 @@ class MatrixArray : public ValArray */ MatrixArray FrobeniusNorm() const; /** - *\brief Multiply each matrix in the array by the left and the right matrix. + * \brief Multiply each matrix in the array by the left and the right matrix. * For each page of this MatrixArray the operation performed is * lMatrix * matrix(pageIndex) * rMatrix, and the resulting MatrixArray * contains the array of the results per page. If "this" has dimensions diff --git a/src/core/model/names.cc b/src/core/model/names.cc index c3b40a184..eaa7a99f9 100644 --- a/src/core/model/names.cc +++ b/src/core/model/names.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "names.h" diff --git a/src/core/model/names.h b/src/core/model/names.h index 90a5dab59..f34298fe7 100644 --- a/src/core/model/names.h +++ b/src/core/model/names.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef OBJECT_NAMES_H diff --git a/src/core/model/node-printer.cc b/src/core/model/node-printer.cc index 3f26ef38a..8e6fdc024 100644 --- a/src/core/model/node-printer.cc +++ b/src/core/model/node-printer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/node-printer.h b/src/core/model/node-printer.h index e1c485168..9af7edb73 100644 --- a/src/core/model/node-printer.h +++ b/src/core/model/node-printer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/nstime.h b/src/core/model/nstime.h index f73c47190..d135b0cfd 100644 --- a/src/core/model/nstime.h +++ b/src/core/model/nstime.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/object-base.cc b/src/core/model/object-base.cc index 4c2e9a0eb..577311b0b 100644 --- a/src/core/model/object-base.cc +++ b/src/core/model/object-base.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -248,12 +237,12 @@ ObjectBase::SetAttributeFailSafe(std::string name, const AttributeValue& value) } void -ObjectBase::GetAttribute(std::string name, AttributeValue& value) const +ObjectBase::GetAttribute(std::string name, AttributeValue& value, bool permissive) const { NS_LOG_FUNCTION(this << name << &value); TypeId::AttributeInformation info; TypeId tid = GetInstanceTypeId(); - if (!tid.LookupAttributeByName(name, &info)) + if (!tid.LookupAttributeByName(name, &info, permissive)) { NS_FATAL_ERROR( "Attribute name=" << name << " does not exist for this object: tid=" << tid.GetName()); diff --git a/src/core/model/object-base.h b/src/core/model/object-base.h index c496531cb..c54f87fb6 100644 --- a/src/core/model/object-base.h +++ b/src/core/model/object-base.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ @@ -235,8 +224,11 @@ class ObjectBase * * \param [in] name The name of the attribute to read. * \param [out] value Where the result should be stored. + * \param [in] permissive If false (by default), will generate warnings and errors for + * deprecated and obsolete attributes, respectively. If set to true, warnings for deprecated + * attributes will be suppressed. */ - void GetAttribute(std::string name, AttributeValue& value) const; + void GetAttribute(std::string name, AttributeValue& value, bool permissive = false) const; /** * Get the value of an attribute without raising errors. * diff --git a/src/core/model/object-factory.cc b/src/core/model/object-factory.cc index 1646fb4a9..48cd54bae 100644 --- a/src/core/model/object-factory.cc +++ b/src/core/model/object-factory.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object-factory.h b/src/core/model/object-factory.h index 109e1af8b..7c53123a0 100644 --- a/src/core/model/object-factory.h +++ b/src/core/model/object-factory.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object-map.h b/src/core/model/object-map.h index 0a4c17b8a..f1688f109 100644 --- a/src/core/model/object-map.h +++ b/src/core/model/object-map.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object-ptr-container.cc b/src/core/model/object-ptr-container.cc index 974f7ef9b..2e19e4c9c 100644 --- a/src/core/model/object-ptr-container.cc +++ b/src/core/model/object-ptr-container.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object-ptr-container.h b/src/core/model/object-ptr-container.h index b77cfc339..f5eb3aeab 100644 --- a/src/core/model/object-ptr-container.h +++ b/src/core/model/object-ptr-container.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object-vector.h b/src/core/model/object-vector.h index 36194507c..c47aab075 100644 --- a/src/core/model/object-vector.h +++ b/src/core/model/object-vector.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/object.cc b/src/core/model/object.cc index f97b2a1ab..96f603270 100644 --- a/src/core/model/object.cc +++ b/src/core/model/object.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Gustavo Carneiro * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Gustavo Carneiro , * Mathieu Lacage diff --git a/src/core/model/object.h b/src/core/model/object.h index b5f46a01c..7b5dd75a6 100644 --- a/src/core/model/object.h +++ b/src/core/model/object.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Gustavo Carneiro * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Gustavo Carneiro , * Mathieu Lacage diff --git a/src/core/model/pair.h b/src/core/model/pair.h index 44c5952f2..15a9864ac 100644 --- a/src/core/model/pair.h +++ b/src/core/model/pair.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Caliola Engineering, LLC. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jared Dulmage */ diff --git a/src/core/model/pointer.cc b/src/core/model/pointer.cc index 3ed2227b0..383c9fbbf 100644 --- a/src/core/model/pointer.cc +++ b/src/core/model/pointer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/pointer.h b/src/core/model/pointer.h index 437198b79..f309f7561 100644 --- a/src/core/model/pointer.h +++ b/src/core/model/pointer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/priority-queue-scheduler.cc b/src/core/model/priority-queue-scheduler.cc index a687b201c..2250ab3e7 100644 --- a/src/core/model/priority-queue-scheduler.cc +++ b/src/core/model/priority-queue-scheduler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 IITP * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alexander Krotov */ diff --git a/src/core/model/priority-queue-scheduler.h b/src/core/model/priority-queue-scheduler.h index af7e1daf1..b6c587824 100644 --- a/src/core/model/priority-queue-scheduler.h +++ b/src/core/model/priority-queue-scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/ptr.h b/src/core/model/ptr.h index 7f0cf3039..eef612464 100644 --- a/src/core/model/ptr.h +++ b/src/core/model/ptr.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/random-variable-stream.cc b/src/core/model/random-variable-stream.cc index 4364419ea..440841385 100644 --- a/src/core/model/random-variable-stream.cc +++ b/src/core/model/random-variable-stream.cc @@ -2,18 +2,7 @@ * Copyright (c) 2006 Georgia Tech Research Corporation * Copyright (c) 2011 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Rajib Bhattacharjea * Hadi Arbabi @@ -33,10 +22,12 @@ #include "rng-seed-manager.h" #include "rng-stream.h" #include "string.h" +#include "uinteger.h" #include // upper_bound #include #include +#include /** * \file @@ -84,7 +75,6 @@ RandomVariableStream::RandomVariableStream() RandomVariableStream::~RandomVariableStream() { - NS_LOG_FUNCTION(this); delete m_rng; } @@ -98,15 +88,16 @@ RandomVariableStream::SetAntithetic(bool isAntithetic) bool RandomVariableStream::IsAntithetic() const { - NS_LOG_FUNCTION(this); return m_isAntithetic; } uint32_t RandomVariableStream::GetInteger() { - NS_LOG_FUNCTION(this); - return static_cast(GetValue()); + auto value = static_cast(GetValue()); + NS_LOG_DEBUG(GetInstanceTypeId().GetName() + << " integer value: " << value << " stream: " << GetStream()); + return value; } void @@ -122,6 +113,7 @@ RandomVariableStream::SetStream(int64_t stream) // number assignment. uint64_t nextStream = RngSeedManager::GetNextStreamIndex(); NS_ASSERT(nextStream <= ((1ULL) << 63)); + NS_LOG_INFO(GetInstanceTypeId().GetName() << " automatic stream: " << nextStream); m_rng = new RngStream(RngSeedManager::GetSeed(), nextStream, RngSeedManager::GetRun()); } else @@ -130,6 +122,7 @@ RandomVariableStream::SetStream(int64_t stream) // number assignment. uint64_t base = ((1ULL) << 63); uint64_t target = base + stream; + NS_LOG_INFO(GetInstanceTypeId().GetName() << " configured stream: " << stream); m_rng = new RngStream(RngSeedManager::GetSeed(), target, RngSeedManager::GetRun()); } m_stream = stream; @@ -138,14 +131,12 @@ RandomVariableStream::SetStream(int64_t stream) int64_t RandomVariableStream::GetStream() const { - NS_LOG_FUNCTION(this); return m_stream; } RngStream* RandomVariableStream::Peek() const { - NS_LOG_FUNCTION(this); return m_rng; } @@ -181,49 +172,50 @@ UniformRandomVariable::UniformRandomVariable() double UniformRandomVariable::GetMin() const { - NS_LOG_FUNCTION(this); return m_min; } double UniformRandomVariable::GetMax() const { - NS_LOG_FUNCTION(this); return m_max; } double UniformRandomVariable::GetValue(double min, double max) { - NS_LOG_FUNCTION(this << min << max); double v = min + Peek()->RandU01() * (max - min); if (IsAntithetic()) { v = min + (max - v); } + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream() << " min: " << min + << " max: " << max); return v; } uint32_t UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) { - NS_LOG_FUNCTION(this << min << max); NS_ASSERT(min <= max); - return static_cast(GetValue((double)(min), (double)(max) + 1.0)); + auto v = static_cast(GetValue((double)(min), (double)(max) + 1.0)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " min: " << min << " max " + << max); + return v; } double UniformRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_min, m_max); } uint32_t UniformRandomVariable::GetInteger() { - NS_LOG_FUNCTION(this); - return static_cast(GetValue(m_min, m_max + 1)); + auto v = static_cast(GetValue(m_min, m_max + 1)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream()); + return v; } NS_OBJECT_ENSURE_REGISTERED(ConstantRandomVariable); @@ -259,21 +251,20 @@ ConstantRandomVariable::GetConstant() const double ConstantRandomVariable::GetValue(double constant) { - NS_LOG_FUNCTION(this << constant); + NS_LOG_DEBUG("value: " << constant << " stream: " << GetStream()); return constant; } uint32_t ConstantRandomVariable::GetInteger(uint32_t constant) { - NS_LOG_FUNCTION(this << constant); + NS_LOG_DEBUG("integer value: " << constant << " stream: " << GetStream()); return constant; } double ConstantRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_constant); } @@ -323,28 +314,24 @@ SequentialRandomVariable::SequentialRandomVariable() double SequentialRandomVariable::GetMin() const { - NS_LOG_FUNCTION(this); return m_min; } double SequentialRandomVariable::GetMax() const { - NS_LOG_FUNCTION(this); return m_max; } Ptr SequentialRandomVariable::GetIncrement() const { - NS_LOG_FUNCTION(this); return m_increment; } uint32_t SequentialRandomVariable::GetConsecutive() const { - NS_LOG_FUNCTION(this); return m_consecutive; } @@ -352,7 +339,6 @@ double SequentialRandomVariable::GetValue() { // Set the current sequence value if it hasn't been set. - NS_LOG_FUNCTION(this); if (!m_isCurrentSet) { // Start the sequence at its minimum value. @@ -371,6 +357,7 @@ SequentialRandomVariable::GetValue() m_current = m_min + (m_current - m_max); } } + NS_LOG_DEBUG("value: " << r << " stream: " << GetStream()); return r; } @@ -406,21 +393,18 @@ ExponentialRandomVariable::ExponentialRandomVariable() double ExponentialRandomVariable::GetMean() const { - NS_LOG_FUNCTION(this); return m_mean; } double ExponentialRandomVariable::GetBound() const { - NS_LOG_FUNCTION(this); return m_bound; } double ExponentialRandomVariable::GetValue(double mean, double bound) { - NS_LOG_FUNCTION(this << mean << bound); while (true) { // Get a uniform random variable in [0,1]. @@ -436,6 +420,8 @@ ExponentialRandomVariable::GetValue(double mean, double bound) // Use this value if it's acceptable. if (bound == 0 || r <= bound) { + NS_LOG_DEBUG("value: " << r << " stream: " << GetStream() << " mean: " << mean + << " bound: " << bound); return r; } } @@ -445,13 +431,15 @@ uint32_t ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) { NS_LOG_FUNCTION(this << mean << bound); - return static_cast(GetValue(mean, bound)); + auto v = static_cast(GetValue(mean, bound)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " mean: " << mean + << " bound: " << bound); + return v; } double ExponentialRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_mean, m_bound); } @@ -496,30 +484,24 @@ ParetoRandomVariable::ParetoRandomVariable() double ParetoRandomVariable::GetScale() const { - NS_LOG_FUNCTION(this); return m_scale; } double ParetoRandomVariable::GetShape() const { - NS_LOG_FUNCTION(this); return m_shape; } double ParetoRandomVariable::GetBound() const { - NS_LOG_FUNCTION(this); return m_bound; } double ParetoRandomVariable::GetValue(double scale, double shape, double bound) { - // Calculate the scale parameter. - NS_LOG_FUNCTION(this << scale << shape << bound); - while (true) { // Get a uniform random variable in [0,1]. @@ -535,6 +517,8 @@ ParetoRandomVariable::GetValue(double scale, double shape, double bound) // Use this value if it's acceptable. if (bound == 0 || r <= bound) { + NS_LOG_DEBUG("value: " << r << " stream: " << GetStream() << " scale: " << scale + << " shape: " << shape << " bound: " << bound); return r; } } @@ -543,14 +527,15 @@ ParetoRandomVariable::GetValue(double scale, double shape, double bound) uint32_t ParetoRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) { - NS_LOG_FUNCTION(this << scale << shape << bound); - return static_cast(GetValue(scale, shape, bound)); + auto v = static_cast(GetValue(scale, shape, bound)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " scale: " << scale + << " shape: " << shape << " bound: " << bound); + return v; } double ParetoRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_scale, m_shape, m_bound); } @@ -594,28 +579,38 @@ WeibullRandomVariable::WeibullRandomVariable() double WeibullRandomVariable::GetScale() const { - NS_LOG_FUNCTION(this); return m_scale; } double WeibullRandomVariable::GetShape() const { - NS_LOG_FUNCTION(this); return m_shape; } double WeibullRandomVariable::GetBound() const { - NS_LOG_FUNCTION(this); return m_bound; } +double +WeibullRandomVariable::GetMean(double scale, double shape) +{ + NS_LOG_FUNCTION(scale << shape); + return scale * std::tgamma(1 + (1 / shape)); +} + +double +WeibullRandomVariable::GetMean() const +{ + NS_LOG_FUNCTION(this); + return GetMean(m_scale, m_shape); +} + double WeibullRandomVariable::GetValue(double scale, double shape, double bound) { - NS_LOG_FUNCTION(this << scale << shape << bound); double exponent = 1.0 / shape; while (true) { @@ -632,6 +627,8 @@ WeibullRandomVariable::GetValue(double scale, double shape, double bound) // Use this value if it's acceptable. if (bound == 0 || r <= bound) { + NS_LOG_DEBUG("value: " << r << " stream: " << GetStream() << " scale: " << scale + << " shape: " << shape << " bound: " << bound); return r; } } @@ -640,8 +637,10 @@ WeibullRandomVariable::GetValue(double scale, double shape, double bound) uint32_t WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) { - NS_LOG_FUNCTION(this << scale << shape << bound); - return static_cast(GetValue(scale, shape, bound)); + auto v = static_cast(GetValue(scale, shape, bound)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " scale: " << scale + << " shape: " << shape << " bound: " << bound); + return v; } double @@ -693,34 +692,32 @@ NormalRandomVariable::NormalRandomVariable() double NormalRandomVariable::GetMean() const { - NS_LOG_FUNCTION(this); return m_mean; } double NormalRandomVariable::GetVariance() const { - NS_LOG_FUNCTION(this); return m_variance; } double NormalRandomVariable::GetBound() const { - NS_LOG_FUNCTION(this); return m_bound; } double NormalRandomVariable::GetValue(double mean, double variance, double bound) { - NS_LOG_FUNCTION(this << mean << variance << bound); if (m_nextValid) { // use previously generated m_nextValid = false; double x2 = mean + m_v2 * m_y * std::sqrt(variance); if (std::fabs(x2 - mean) <= bound) { + NS_LOG_DEBUG("value: " << x2 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x2; } } @@ -748,6 +745,8 @@ NormalRandomVariable::GetValue(double mean, double variance, double bound) m_nextValid = true; m_y = y; m_v2 = v2; + NS_LOG_DEBUG("value: " << x1 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x1; } // otherwise try and return the other if it is valid @@ -755,6 +754,8 @@ NormalRandomVariable::GetValue(double mean, double variance, double bound) if (std::fabs(x2 - mean) <= bound) { m_nextValid = false; + NS_LOG_DEBUG("value: " << x2 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x2; } // otherwise, just run this loop again @@ -765,14 +766,15 @@ NormalRandomVariable::GetValue(double mean, double variance, double bound) uint32_t NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) { - NS_LOG_FUNCTION(this << mean << variance << bound); - return static_cast(GetValue(mean, variance, bound)); + auto v = static_cast(GetValue(mean, variance, bound)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); + return v; } double NormalRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_mean, m_variance, m_bound); } @@ -812,14 +814,12 @@ LogNormalRandomVariable::LogNormalRandomVariable() double LogNormalRandomVariable::GetMu() const { - NS_LOG_FUNCTION(this); return m_mu; } double LogNormalRandomVariable::GetSigma() const { - NS_LOG_FUNCTION(this); return m_sigma; } @@ -829,19 +829,7 @@ LogNormalRandomVariable::GetSigma() const * * Copyright (C) 1996, 1997, 1998, 1999, 2000 James Theiler, Brian Gough * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* The lognormal distribution has the form @@ -855,9 +843,10 @@ LogNormalRandomVariable::GetValue(double mu, double sigma) if (m_nextValid) { // use previously generated m_nextValid = false; - double normal = m_v2 * m_normal; - - return std::exp(sigma * normal + mu); + double v = std::exp(sigma * m_v2 * m_normal + mu); + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream() << " mu: " << mu + << " sigma: " << sigma); + return v; } double v1; @@ -866,8 +855,6 @@ LogNormalRandomVariable::GetValue(double mu, double sigma) double normal; double x; - NS_LOG_FUNCTION(this << mu << sigma); - do { /* choose x,y in uniform square (-1,-1) to (+1,+1) */ @@ -893,6 +880,8 @@ LogNormalRandomVariable::GetValue(double mu, double sigma) m_v2 = v2; x = std::exp(sigma * normal + mu); + NS_LOG_DEBUG("value: " << x << " stream: " << GetStream() << " mu: " << mu + << " sigma: " << sigma); return x; } @@ -900,14 +889,15 @@ LogNormalRandomVariable::GetValue(double mu, double sigma) uint32_t LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) { - NS_LOG_FUNCTION(this << mu << sigma); - return static_cast(GetValue(mu, sigma)); + auto v = static_cast(GetValue(mu, sigma)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " mu: " << mu + << " sigma: " << sigma); + return v; } double LogNormalRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_mu, m_sigma); } @@ -945,14 +935,12 @@ GammaRandomVariable::GammaRandomVariable() double GammaRandomVariable::GetAlpha() const { - NS_LOG_FUNCTION(this); return m_alpha; } double GammaRandomVariable::GetBeta() const { - NS_LOG_FUNCTION(this); return m_beta; } @@ -975,7 +963,6 @@ GammaRandomVariable::GetBeta() const double GammaRandomVariable::GetValue(double alpha, double beta) { - NS_LOG_FUNCTION(this << alpha << beta); if (alpha < 1) { double u = Peek()->RandU01(); @@ -983,6 +970,9 @@ GammaRandomVariable::GetValue(double alpha, double beta) { u = (1 - u); } + double v = GetValue(1.0 + alpha, beta) * std::pow(u, 1.0 / alpha); + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream() << " alpha: " << alpha + << " beta: " << beta); return GetValue(1.0 + alpha, beta) * std::pow(u, 1.0 / alpha); } @@ -1022,26 +1012,29 @@ GammaRandomVariable::GetValue(double alpha, double beta) } } - return beta * d * v; + double value = beta * d * v; + NS_LOG_DEBUG("value: " << value << " stream: " << GetStream() << " alpha: " << alpha + << " beta: " << beta); + return value; } double GammaRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_alpha, m_beta); } double GammaRandomVariable::GetNormalValue(double mean, double variance, double bound) { - NS_LOG_FUNCTION(this << mean << variance << bound); if (m_nextValid) { // use previously generated m_nextValid = false; double x2 = mean + m_v2 * m_y * std::sqrt(variance); if (std::fabs(x2 - mean) <= bound) { + NS_LOG_DEBUG("value: " << x2 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x2; } } @@ -1069,6 +1062,8 @@ GammaRandomVariable::GetNormalValue(double mean, double variance, double bound) m_nextValid = true; m_y = y; m_v2 = v2; + NS_LOG_DEBUG("value: " << x1 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x1; } // otherwise try and return the other if it is valid @@ -1076,6 +1071,8 @@ GammaRandomVariable::GetNormalValue(double mean, double variance, double bound) if (std::fabs(x2 - mean) <= bound) { m_nextValid = false; + NS_LOG_DEBUG("value: " << x2 << " stream: " << GetStream() << " mean: " << mean + << " variance: " << variance << " bound: " << bound); return x2; } // otherwise, just run this loop again @@ -1116,14 +1113,12 @@ ErlangRandomVariable::ErlangRandomVariable() uint32_t ErlangRandomVariable::GetK() const { - NS_LOG_FUNCTION(this); return m_k; } double ErlangRandomVariable::GetLambda() const { - NS_LOG_FUNCTION(this); return m_lambda; } @@ -1142,7 +1137,6 @@ ErlangRandomVariable::GetLambda() const double ErlangRandomVariable::GetValue(uint32_t k, double lambda) { - NS_LOG_FUNCTION(this << k << lambda); double mean = lambda; double bound = 0.0; @@ -1151,28 +1145,29 @@ ErlangRandomVariable::GetValue(uint32_t k, double lambda) { result += GetExponentialValue(mean, bound); } - + NS_LOG_DEBUG("value: " << result << " stream: " << GetStream() << " k: " << k + << " lambda: " << lambda); return result; } uint32_t ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) { - NS_LOG_FUNCTION(this << k << lambda); - return static_cast(GetValue(k, lambda)); + auto v = static_cast(GetValue(k, lambda)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " k: " << k + << " lambda: " << lambda); + return v; } double ErlangRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_k, m_lambda); } double ErlangRandomVariable::GetExponentialValue(double mean, double bound) { - NS_LOG_FUNCTION(this << mean << bound); while (true) { // Get a uniform random variable in [0,1]. @@ -1188,6 +1183,8 @@ ErlangRandomVariable::GetExponentialValue(double mean, double bound) // Use this value if it's acceptable. if (bound == 0 || r <= bound) { + NS_LOG_DEBUG("value: " << r << " stream: " << GetStream() << " mean:: " << mean + << " bound: " << bound); return r; } } @@ -1232,21 +1229,18 @@ TriangularRandomVariable::TriangularRandomVariable() double TriangularRandomVariable::GetMean() const { - NS_LOG_FUNCTION(this); return m_mean; } double TriangularRandomVariable::GetMin() const { - NS_LOG_FUNCTION(this); return m_min; } double TriangularRandomVariable::GetMax() const { - NS_LOG_FUNCTION(this); return m_max; } @@ -1254,7 +1248,6 @@ double TriangularRandomVariable::GetValue(double mean, double min, double max) { // Calculate the mode. - NS_LOG_FUNCTION(this << mean << min << max); double mode = 3.0 * mean - min - max; // Get a uniform random variable in [0,1]. @@ -1267,25 +1260,32 @@ TriangularRandomVariable::GetValue(double mean, double min, double max) // Calculate the triangular random variable. if (u <= (mode - min) / (max - min)) { - return min + std::sqrt(u * (max - min) * (mode - min)); + double v = min + std::sqrt(u * (max - min) * (mode - min)); + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream() << " mean: " << mean + << " min: " << min << " max: " << max); + return v; } else { - return max - std::sqrt((1 - u) * (max - min) * (max - mode)); + double v = max - std::sqrt((1 - u) * (max - min) * (max - mode)); + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream() << " mean: " << mean + << " min: " << min << " max: " << max); + return v; } } uint32_t TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) { - NS_LOG_FUNCTION(this << mean << min << max); - return static_cast(GetValue(mean, min, max)); + auto v = static_cast(GetValue(mean, min, max)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " mean: " << mean + << " min: " << min << " max: " << max); + return v; } double TriangularRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_mean, m_min, m_max); } @@ -1321,21 +1321,18 @@ ZipfRandomVariable::ZipfRandomVariable() uint32_t ZipfRandomVariable::GetN() const { - NS_LOG_FUNCTION(this); return m_n; } double ZipfRandomVariable::GetAlpha() const { - NS_LOG_FUNCTION(this); return m_alpha; } double ZipfRandomVariable::GetValue(uint32_t n, double alpha) { - NS_LOG_FUNCTION(this << n << alpha); // Calculate the normalization constant c. m_c = 0.0; for (uint32_t i = 1; i <= n; i++) @@ -1353,15 +1350,17 @@ ZipfRandomVariable::GetValue(uint32_t n, double alpha) double sum_prob = 0; double zipf_value = 0; - for (uint32_t i = 1; i <= m_n; i++) + for (uint32_t i = 1; i <= n; i++) { - sum_prob += m_c / std::pow((double)i, m_alpha); + sum_prob += m_c / std::pow((double)i, alpha); if (sum_prob > u) { zipf_value = i; break; } } + NS_LOG_DEBUG("value: " << zipf_value << " stream: " << GetStream() << " n: " << n + << " alpha: " << alpha); return zipf_value; } @@ -1369,13 +1368,15 @@ uint32_t ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) { NS_LOG_FUNCTION(this << n << alpha); - return static_cast(GetValue(n, alpha)); + auto v = static_cast(GetValue(n, alpha)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " n: " << n + << " alpha: " << alpha); + return v; } double ZipfRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_n, m_alpha); } @@ -1406,14 +1407,12 @@ ZetaRandomVariable::ZetaRandomVariable() double ZetaRandomVariable::GetAlpha() const { - NS_LOG_FUNCTION(this); return m_alpha; } double ZetaRandomVariable::GetValue(double alpha) { - NS_LOG_FUNCTION(this << alpha); m_b = std::pow(2.0, alpha - 1.0); double u; @@ -1438,25 +1437,25 @@ ZetaRandomVariable::GetValue(double alpha) v = (1 - v); } - X = std::floor(std::pow(u, -1.0 / (m_alpha - 1.0))); - T = std::pow(1.0 + 1.0 / X, m_alpha - 1.0); + X = std::floor(std::pow(u, -1.0 / (alpha - 1.0))); + T = std::pow(1.0 + 1.0 / X, alpha - 1.0); test = v * X * (T - 1.0) / (m_b - 1.0); } while (test > (T / m_b)); - + NS_LOG_DEBUG("value: " << X << " stream: " << GetStream() << " alpha: " << alpha); return X; } uint32_t ZetaRandomVariable::GetInteger(uint32_t alpha) { - NS_LOG_FUNCTION(this << alpha); - return static_cast(GetValue(alpha)); + auto v = static_cast(GetValue(alpha)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " alpha: " << alpha); + return v; } double ZetaRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_alpha); } @@ -1521,7 +1520,6 @@ DeterministicRandomVariable::SetValueArray(const double* values, std::size_t len double DeterministicRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); // Make sure the array has been set. NS_ASSERT(m_count > 0); @@ -1529,7 +1527,9 @@ DeterministicRandomVariable::GetValue() { m_next = 0; } - return m_data[m_next++]; + double v = m_data[m_next++]; + NS_LOG_DEBUG("value: " << v << " stream: " << GetStream()); + return v; } NS_OBJECT_ENSURE_REGISTERED(EmpiricalRandomVariable); @@ -1569,8 +1569,7 @@ EmpiricalRandomVariable::SetInterpolate(bool interpolate) bool EmpiricalRandomVariable::PreSample(double& value) { - NS_LOG_FUNCTION(this); - + NS_LOG_FUNCTION(this << value); if (!m_validated) { Validate(); @@ -1602,8 +1601,6 @@ EmpiricalRandomVariable::PreSample(double& value) double EmpiricalRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); - double value; if (PreSample(value)) { @@ -1619,6 +1616,7 @@ EmpiricalRandomVariable::GetValue() { value = DoSampleCDF(value); } + NS_LOG_DEBUG("value: " << value << " stream: " << GetStream()); return value; } @@ -1770,8 +1768,6 @@ BinomialRandomVariable::BinomialRandomVariable() double BinomialRandomVariable::GetValue(uint32_t trials, double probability) { - NS_LOG_FUNCTION(this << trials << probability); - double successes = 0; for (uint32_t i = 0; i < trials; ++i) @@ -1787,21 +1783,23 @@ BinomialRandomVariable::GetValue(uint32_t trials, double probability) successes += 1; } } - + NS_LOG_DEBUG("value: " << successes << " stream: " << GetStream() << " trials: " << trials + << " probability: " << probability); return successes; } uint32_t BinomialRandomVariable::GetInteger(uint32_t trials, uint32_t probability) { - NS_LOG_FUNCTION(this << trials << probability); - return static_cast(GetValue(trials, probability)); + auto v = static_cast(GetValue(trials, probability)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() << " trials: " << trials + << " probability: " << probability); + return v; } double BinomialRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_trials, m_probability); } @@ -1832,29 +1830,240 @@ BernoulliRandomVariable::BernoulliRandomVariable() double BernoulliRandomVariable::GetValue(double probability) { - NS_LOG_FUNCTION(this << probability); - double v = Peek()->RandU01(); if (IsAntithetic()) { v = (1 - v); } - return (v <= probability) ? 1.0 : 0.0; + double value = (v <= probability) ? 1.0 : 0.0; + NS_LOG_DEBUG("value: " << value << " stream: " << GetStream() + << " probability: " << probability); + return value; } uint32_t BernoulliRandomVariable::GetInteger(uint32_t probability) { - NS_LOG_FUNCTION(this << probability); - return static_cast(GetValue(probability)); + auto v = static_cast(GetValue(probability)); + NS_LOG_DEBUG("integer value: " << v << " stream: " << GetStream() + << " probability: " << probability); + return v; } double BernoulliRandomVariable::GetValue() { - NS_LOG_FUNCTION(this); return GetValue(m_probability); } +NS_OBJECT_ENSURE_REGISTERED(LaplacianRandomVariable); + +TypeId +LaplacianRandomVariable::GetTypeId() +{ + static TypeId tid = + TypeId("ns3::LaplacianRandomVariable") + .SetParent() + .SetGroupName("Core") + .AddConstructor() + .AddAttribute("Location", + "The location parameter for the Laplacian distribution returned by this " + "RNG stream.", + DoubleValue(0.0), + MakeDoubleAccessor(&LaplacianRandomVariable::m_location), + MakeDoubleChecker()) + .AddAttribute( + "Scale", + "The scale parameter for the Laplacian distribution returned by this RNG stream.", + DoubleValue(1.0), + MakeDoubleAccessor(&LaplacianRandomVariable::m_scale), + MakeDoubleChecker()) + .AddAttribute("Bound", + "The bound on the values returned by this RNG stream.", + DoubleValue(0.0), + MakeDoubleAccessor(&LaplacianRandomVariable::m_bound), + MakeDoubleChecker()); + return tid; +} + +LaplacianRandomVariable::LaplacianRandomVariable() +{ + NS_LOG_FUNCTION(this); +} + +double +LaplacianRandomVariable::GetLocation() const +{ + return m_location; +} + +double +LaplacianRandomVariable::GetScale() const +{ + return m_scale; +} + +double +LaplacianRandomVariable::GetBound() const +{ + return m_bound; +} + +double +LaplacianRandomVariable::GetValue(double location, double scale, double bound) +{ + NS_LOG_FUNCTION(this << location << scale << bound); + NS_ABORT_MSG_IF(scale <= 0, "Scale parameter should be larger than 0"); + + while (true) + { + // Get a uniform random variable in [-0.5,0.5]. + auto v = (Peek()->RandU01() - 0.5); + if (IsAntithetic()) + { + v = (1 - v); + } + + // Calculate the laplacian random variable. + const auto sgn = (v > 0) ? 1 : ((v < 0) ? -1 : 0); + const auto r = location - (scale * sgn * std::log(1.0 - (2.0 * std::abs(v)))); + + // Use this value if it's acceptable. + if (bound == 0.0 || std::fabs(r - location) <= bound) + { + return r; + } + } +} + +uint32_t +LaplacianRandomVariable::GetInteger(uint32_t location, uint32_t scale, uint32_t bound) +{ + NS_LOG_FUNCTION(this << location << scale << bound); + return static_cast(GetValue(location, scale, bound)); +} + +double +LaplacianRandomVariable::GetValue() +{ + NS_LOG_FUNCTION(this); + return GetValue(m_location, m_scale, m_bound); +} + +double +LaplacianRandomVariable::GetVariance(double scale) +{ + NS_LOG_FUNCTION(scale); + return 2.0 * std::pow(scale, 2.0); +} + +double +LaplacianRandomVariable::GetVariance() const +{ + return GetVariance(m_scale); +} + +NS_OBJECT_ENSURE_REGISTERED(LargestExtremeValueRandomVariable); + +TypeId +LargestExtremeValueRandomVariable::GetTypeId() +{ + static TypeId tid = + TypeId("ns3::LargestExtremeValueRandomVariable") + .SetParent() + .SetGroupName("Core") + .AddConstructor() + .AddAttribute("Location", + "The location parameter for the Largest Extreme Value distribution " + "returned by this RNG stream.", + DoubleValue(0.0), + MakeDoubleAccessor(&LargestExtremeValueRandomVariable::m_location), + MakeDoubleChecker()) + .AddAttribute("Scale", + "The scale parameter for the Largest Extreme Value distribution " + "returned by this RNG stream.", + DoubleValue(1.0), + MakeDoubleAccessor(&LargestExtremeValueRandomVariable::m_scale), + MakeDoubleChecker()); + return tid; +} + +LargestExtremeValueRandomVariable::LargestExtremeValueRandomVariable() +{ + NS_LOG_FUNCTION(this); +} + +double +LargestExtremeValueRandomVariable::GetLocation() const +{ + return m_location; +} + +double +LargestExtremeValueRandomVariable::GetScale() const +{ + return m_scale; +} + +double +LargestExtremeValueRandomVariable::GetValue(double location, double scale) +{ + NS_LOG_FUNCTION(this << location << scale); + NS_ABORT_MSG_IF(scale <= 0, "Scale parameter should be larger than 0"); + + // Get a uniform random variable in [0,1]. + auto v = Peek()->RandU01(); + if (IsAntithetic()) + { + v = (1 - v); + } + + // Calculate the largest extreme value random variable. + const auto t = std::log(v) * (-1.0); + const auto r = location - (scale * std::log(t)); + + return r; +} + +uint32_t +LargestExtremeValueRandomVariable::GetInteger(uint32_t location, uint32_t scale) +{ + NS_LOG_FUNCTION(this << location << scale); + return static_cast(GetValue(location, scale)); +} + +double +LargestExtremeValueRandomVariable::GetValue() +{ + NS_LOG_FUNCTION(this); + return GetValue(m_location, m_scale); +} + +double +LargestExtremeValueRandomVariable::GetMean(double location, double scale) +{ + NS_LOG_FUNCTION(location << scale); + return (location + (scale * std::numbers::egamma)); +} + +double +LargestExtremeValueRandomVariable::GetMean() const +{ + return GetMean(m_location, m_scale); +} + +double +LargestExtremeValueRandomVariable::GetVariance(double scale) +{ + NS_LOG_FUNCTION(scale); + return std::pow((scale * std::numbers::pi), 2) / 6.0; +} + +double +LargestExtremeValueRandomVariable::GetVariance() const +{ + return GetVariance(m_scale); +} + } // namespace ns3 diff --git a/src/core/model/random-variable-stream.h b/src/core/model/random-variable-stream.h index 7ddb6f9e7..ed462851a 100644 --- a/src/core/model/random-variable-stream.h +++ b/src/core/model/random-variable-stream.h @@ -2,18 +2,7 @@ * Copyright (c) 2006 Georgia Tech Research Corporation * Copyright (c) 2011 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Rajib Bhattacharjea * Hadi Arbabi @@ -862,6 +851,19 @@ class WeibullRandomVariable : public RandomVariableStream */ double GetBound() const; + /** + * \brief Returns the mean value for the Weibull distribution returned by this RNG stream. + * \return The mean value for the Weibull distribution returned by this RNG stream. + */ + double GetMean() const; + + /** + * \copydoc GetMean() + * \param [in] scale Scale parameter for the Weibull distribution. + * \param [in] shape Shape parameter for the Weibull distribution. + */ + static double GetMean(double scale, double shape); + /** * \copydoc GetValue() * \param [in] scale Scale parameter for the Weibull distribution. @@ -2271,6 +2273,234 @@ class BernoulliRandomVariable : public RandomVariableStream }; // class BernoulliRandomVariable +/** + * \ingroup randomvariable + * \brief The laplacian distribution Random Number Generator (RNG). + * + * This class supports the creation of objects that return random numbers + * from a fixed laplacian distribution. + * + * The probability density function of a laplacian variable + * is defined as: + * + * \f[ + * P(x; \mu, \beta) dx = \frac{1}{2 \beta} e^{\frac{- \abs{x - \mu}}{\beta}} dx + * \f] + * + * where \f$\mu\f$ is the \c Location configurable attribute and \f$\beta\f$ + * is the \c Scale configurable attribute. This distribution has mean \f$\mu\f$ + * and variance \f$ \sigma^2 = 2 \beta^2 \f$. + * + * The laplacian RNG value \f$x\f$ is generated by + * + * \f[ + * x = \mu - \beta sgn(u) \log(1 - 2 \abs{u}) + * \f] + * + * where \f$u\f$ is a uniform random variable on [-0.5,0.5). + * + * \par Bounded Distribution + * + * The Laplacian distribution can be bounded symmetrically about the mean by + * the \c Bound parameter, \f$b\f$, _i.e._ its values are confined to the interval + * \f$[\mu - b, \mu + b]\f$. This preserves the mean but decreases the variance. + */ +class LaplacianRandomVariable : public RandomVariableStream +{ + public: + /** + * \brief Register this type. + * \return The object TypeId. + */ + static TypeId GetTypeId(); + + /** + * \brief Creates an unbounded laplacian distribution RNG with the default + * values for the location and the scale. + */ + LaplacianRandomVariable(); + + /** + * \brief Get the configured location value of this RNG. + * + * \return The configured location value. + */ + double GetLocation() const; + + /** + * \brief Get the configured scale value of this RNG. + * + * \return The configured scale value. + */ + double GetScale() const; + + /** + * \brief Get the configured bound of this RNG. + * \return The bound. + */ + double GetBound() const; + + /** + * \copydoc GetValue() + * \param [in] location location value of the laplacian distribution. + * \param [in] scale scale value of the laplacian distribution. + * \param [in] bound bound on values returned. + */ + double GetValue(double location, double scale, double bound); + + /** \copydoc GetValue(double,double,double) */ + uint32_t GetInteger(uint32_t location, uint32_t scale, uint32_t bound); + + // Inherited + double GetValue() override; + using RandomVariableStream::GetInteger; + + /** + * \brief Returns the variance value for the laplacian distribution returned by this RNG stream. + * \return The variance value for the laplacian distribution returned by this RNG stream. + */ + double GetVariance() const; + + /** + * \copydoc GetVariance() + * \param [in] scale scale value of the laplacian distribution. + */ + static double GetVariance(double scale); + + private: + /** The location value of the laplacian distribution. */ + double m_location; + + /** The scale value of the laplacian distribution. */ + double m_scale; + + /** The bound on values that can be returned by this RNG stream. */ + double m_bound; + +}; // class LaplacianRandomVariable + +/** + * \ingroup randomvariable + * \brief The Largest Extreme Value distribution Random Number Generator (RNG). + * + * This class supports the creation of objects that return random numbers from a fixed Largest + * Extreme Value distribution. This corresponds to the type-I Generalized Extreme Value + * distribution, also known as Gumbel distribution + * (https://en.wikipedia.org/wiki/Gumbel_distribution). + * + * The probability density function of a Largest Extreme Value variable + * is defined as: + * + * \f[ + * P(x; \mu, \beta) dx = \frac{1}{\beta} e^{-(z+ e^{-z})} dx, \quad z = \frac{x - \mu}{\beta} + * \f] + * + * where \f$\mu\f$ is the \c Location configurable attribute and \f$\beta\f$ + * is the \c Scale configurable attribute. + * + * The Largest Extreme Value RNG value \f$x\f$ is generated by + * + * \f[ + * x = \mu - \beta \log(-\log(u)) + * \f] + * + * where \f$u\f$ is a uniform random variable on [0,1). + * + * The mean of the distribution is: + * + * \f[ + * E = \mu + y \beta + * \f] + * + * where \f$y\f$ is the Euler-Mascheroni constant. + * + * The variance of the distribution is + * + * \f[ + * \sigma^2 = 6 \pi^2 \beta^2 + * \f] + */ +class LargestExtremeValueRandomVariable : public RandomVariableStream +{ + public: + /** + * \brief Register this type. + * \return The object TypeId. + */ + static TypeId GetTypeId(); + + /** + * \brief Creates a Largest Extreme Value distribution RNG with the default + * values for the location and the scale. + */ + LargestExtremeValueRandomVariable(); + + /** + * \brief Get the configured location value of this RNG. + * + * \return The configured location value. + */ + double GetLocation() const; + + /** + * \brief Get the configured scale value of this RNG. + * + * \return The configured scale value. + */ + double GetScale() const; + + /** + * \copydoc GetValue() + * \param [in] location location value of the Largest Extreme Value distribution. + * \param [in] scale scale value of the Largest Extreme Value distribution. + */ + double GetValue(double location, double scale); + + /** \copydoc GetValue(double,double) */ + uint32_t GetInteger(uint32_t location, uint32_t scale); + + // Inherited + double GetValue() override; + using RandomVariableStream::GetInteger; + + /** + * \brief Returns the mean value for the Largest Extreme Value distribution returned by this RNG + * stream. + * \return The mean value for the Largest Extreme Value distribution returned by this + * RNG stream. + */ + double GetMean() const; + + /** + * \copydoc GetMean() + * \param [in] location location value of the Largest Extreme Value distribution. + * \param [in] scale scale value of the Largest Extreme Value distribution. + */ + static double GetMean(double location, double scale); + + /** + * \brief Returns the variance value for the Largest Extreme Value distribution returned by this + * RNG stream. + * \return The variance value for the Largest Extreme Value distribution returned by + * this RNG stream. + */ + double GetVariance() const; + + /** + * \copydoc GetVariance() + * \param [in] scale scale value of the Largest Extreme Value distribution. + */ + static double GetVariance(double scale); + + private: + /** The location value of the Largest Extreme Value distribution. */ + double m_location; + + /** The scale value of the Largest Extreme Value distribution. */ + double m_scale; + +}; // class LargestExtremeValueRandomVariable + } // namespace ns3 #endif /* RANDOM_VARIABLE_STREAM_H */ diff --git a/src/core/model/realtime-simulator-impl.cc b/src/core/model/realtime-simulator-impl.cc index 526bfa86e..c979ba333 100644 --- a/src/core/model/realtime-simulator-impl.cc +++ b/src/core/model/realtime-simulator-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "realtime-simulator-impl.h" diff --git a/src/core/model/realtime-simulator-impl.h b/src/core/model/realtime-simulator-impl.h index 307693306..1f89fb602 100644 --- a/src/core/model/realtime-simulator-impl.h +++ b/src/core/model/realtime-simulator-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef REALTIME_SIMULATOR_IMPL_H diff --git a/src/core/model/rng-seed-manager.cc b/src/core/model/rng-seed-manager.cc index 4598d1e43..c06fe1676 100644 --- a/src/core/model/rng-seed-manager.cc +++ b/src/core/model/rng-seed-manager.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -112,4 +101,10 @@ RngSeedManager::GetNextStreamIndex() return next; } +void +RngSeedManager::ResetNextStreamIndex() +{ + g_nextStreamIndex = 0; +} + } // namespace ns3 diff --git a/src/core/model/rng-seed-manager.h b/src/core/model/rng-seed-manager.h index a44f1b4c2..32a232239 100644 --- a/src/core/model/rng-seed-manager.h +++ b/src/core/model/rng-seed-manager.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Mathieu Lacage * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -104,6 +93,11 @@ class RngSeedManager * \returns The next stream index. */ static uint64_t GetNextStreamIndex(); + + /** + * Resets the global stream index counter. + */ + static void ResetNextStreamIndex(); }; /** Alias for compatibility. */ diff --git a/src/core/model/rng-stream.cc b/src/core/model/rng-stream.cc index 06b049f20..362c258bd 100644 --- a/src/core/model/rng-stream.cc +++ b/src/core/model/rng-stream.cc @@ -1,18 +1,7 @@ // // Copyright (C) 2001 Pierre L'Ecuyer (lecuyer@iro.umontreal.ca) // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Modified for ns-3 by: // - Rajib Bhattacharjea diff --git a/src/core/model/rng-stream.h b/src/core/model/rng-stream.h index a3f8503e1..a37a4fcfb 100644 --- a/src/core/model/rng-stream.h +++ b/src/core/model/rng-stream.h @@ -1,18 +1,7 @@ // // Copyright (C) 2001 Pierre L'Ecuyer (lecuyer@iro.umontreal.ca) // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Modified for ns-3 by: Rajib Bhattacharjea diff --git a/src/core/model/scheduler.cc b/src/core/model/scheduler.cc index cc3feedbb..fec97b360 100644 --- a/src/core/model/scheduler.cc +++ b/src/core/model/scheduler.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/scheduler.h b/src/core/model/scheduler.h index 7635953ef..9bb6a8d5d 100644 --- a/src/core/model/scheduler.h +++ b/src/core/model/scheduler.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/show-progress.cc b/src/core/model/show-progress.cc index 3f47aeb71..36b0a792f 100644 --- a/src/core/model/show-progress.cc +++ b/src/core/model/show-progress.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro * Author: Peter D. Barnes, Jr. diff --git a/src/core/model/show-progress.h b/src/core/model/show-progress.h index 30a75acdd..0e893fd7e 100644 --- a/src/core/model/show-progress.h +++ b/src/core/model/show-progress.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo Carneiro * Author: Peter D. Barnes, Jr. diff --git a/src/core/model/shuffle.h b/src/core/model/shuffle.h index 5b63f98d9..4299c3a3e 100644 --- a/src/core/model/shuffle.h +++ b/src/core/model/shuffle.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2024 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Stefano Avallone */ diff --git a/src/core/model/simple-ref-count.h b/src/core/model/simple-ref-count.h index 144c348c6..b548101dd 100644 --- a/src/core/model/simple-ref-count.h +++ b/src/core/model/simple-ref-count.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Georgia Tech Research Corporation, INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: George Riley * Gustavo Carneiro , diff --git a/src/core/model/simulation-singleton.h b/src/core/model/simulation-singleton.h index b4ea33c17..bd7ebcef6 100644 --- a/src/core/model/simulation-singleton.h +++ b/src/core/model/simulation-singleton.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/simulator-impl.cc b/src/core/model/simulator-impl.cc index 34c260680..248a36628 100644 --- a/src/core/model/simulator-impl.cc +++ b/src/core/model/simulator-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/model/simulator-impl.h b/src/core/model/simulator-impl.h index 9775e324d..930016155 100644 --- a/src/core/model/simulator-impl.h +++ b/src/core/model/simulator-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -54,7 +43,7 @@ class SimulatorImpl : public Object */ static TypeId GetTypeId(); - /** \copydoc Simulator::Destroy */ + /** \copydoc Simulator::Destroy */ virtual void Destroy() = 0; /** \copydoc Simulator::IsFinished */ virtual bool IsFinished() const = 0; diff --git a/src/core/model/simulator.cc b/src/core/model/simulator.cc index 806cfa04a..8cbca7c3c 100644 --- a/src/core/model/simulator.cc +++ b/src/core/model/simulator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/simulator.h b/src/core/model/simulator.h index 326678304..5ec3b5d7d 100644 --- a/src/core/model/simulator.h +++ b/src/core/model/simulator.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/singleton.h b/src/core/model/singleton.h index 9ee0361f0..c91930269 100644 --- a/src/core/model/singleton.h +++ b/src/core/model/singleton.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/string.cc b/src/core/model/string.cc index 8c3856fb9..f2e4a9cda 100644 --- a/src/core/model/string.cc +++ b/src/core/model/string.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/model/string.h b/src/core/model/string.h index b67150c8e..4dda6dea9 100644 --- a/src/core/model/string.h +++ b/src/core/model/string.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/model/synchronizer.cc b/src/core/model/synchronizer.cc index ec840b3e9..8457bc67d 100644 --- a/src/core/model/synchronizer.cc +++ b/src/core/model/synchronizer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "synchronizer.h" diff --git a/src/core/model/synchronizer.h b/src/core/model/synchronizer.h index 274860040..41f40d108 100644 --- a/src/core/model/synchronizer.h +++ b/src/core/model/synchronizer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef SYNCHRONIZER_H diff --git a/src/core/model/system-path.cc b/src/core/model/system-path.cc index 0a16f5bd6..94d4c245f 100644 --- a/src/core/model/system-path.cc +++ b/src/core/model/system-path.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/system-path.h b/src/core/model/system-path.h index f498f1260..7dd5d2f4c 100644 --- a/src/core/model/system-path.h +++ b/src/core/model/system-path.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/system-wall-clock-ms.cc b/src/core/model/system-wall-clock-ms.cc index fe09b8b38..a6d590df0 100644 --- a/src/core/model/system-wall-clock-ms.cc +++ b/src/core/model/system-wall-clock-ms.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/system-wall-clock-ms.h b/src/core/model/system-wall-clock-ms.h index c407aac9a..35caee933 100644 --- a/src/core/model/system-wall-clock-ms.h +++ b/src/core/model/system-wall-clock-ms.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/system-wall-clock-timestamp.cc b/src/core/model/system-wall-clock-timestamp.cc index 4c2db8eed..d9565d9ac 100644 --- a/src/core/model/system-wall-clock-timestamp.cc +++ b/src/core/model/system-wall-clock-timestamp.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/system-wall-clock-timestamp.h b/src/core/model/system-wall-clock-timestamp.h index eeef7c6d8..225569f0f 100644 --- a/src/core/model/system-wall-clock-timestamp.h +++ b/src/core/model/system-wall-clock-timestamp.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/test.cc b/src/core/model/test.cc index af8063118..d7a65f86e 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "test.h" @@ -22,6 +11,7 @@ #include "config.h" #include "des-metrics.h" #include "log.h" +#include "rng-seed-manager.h" #include "singleton.h" #include "system-path.h" @@ -357,6 +347,7 @@ TestCase::Run(TestRunnerImpl* runner) m_result->clock.Start(); for (auto i = m_children.begin(); i != m_children.end(); ++i) { + RngSeedManager::ResetNextStreamIndex(); TestCase* test = *i; test->Run(runner); if (IsFailed()) diff --git a/src/core/model/test.h b/src/core/model/test.h index 243102b98..bd20f9fdd 100644 --- a/src/core/model/test.h +++ b/src/core/model/test.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef NS3_TEST_H @@ -1068,16 +1057,21 @@ class TestCase TAKES_FOREVER = 3 //!< Very long running test. }; + /** + * Deprecated test duration simple enums. + * + * Use the `TestCase::Duration` enum class symbols instead. + * @{ + */ NS_DEPRECATED_3_42("Use Duration::QUICK instead") - static constexpr auto QUICK = Duration::QUICK; //!< @deprecated See Duration::QUICK. + static constexpr auto QUICK = Duration::QUICK; NS_DEPRECATED_3_42("Use Duration::EXTENSIVE instead") - static constexpr auto EXTENSIVE = Duration::EXTENSIVE; //!< @deprecated See Duration::EXTENSIVE. + static constexpr auto EXTENSIVE = Duration::EXTENSIVE; NS_DEPRECATED_3_42("Use Duration::TAKES_FOREVER instead") - static constexpr auto TAKES_FOREVER = - Duration::TAKES_FOREVER; //!< @deprecated See Duration::TAKES_FOREVER. + static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER; - using TestDuration NS_DEPRECATED_3_42("Use Duration instead") = - Duration; //!< @deprecated See Duration. + using TestDuration NS_DEPRECATED_3_42("Use Duration instead") = Duration; + /**@}*/ /** * Destructor @@ -1278,23 +1272,30 @@ class TestSuite : public TestCase */ enum class Type { - ALL = 0, //!< + ALL = 0, //!< Token to represent all tests. UNIT, //!< This test suite implements a Unit Test SYSTEM, //!< This test suite implements a System Test EXAMPLE, //!< This test suite implements an Example Test PERFORMANCE //!< This test suite implements a Performance Test }; + /** + * Deprecated test type simple enums. + * + * Use the `TestSuite::Type` enum class symbols instead. + * @{ + */ NS_DEPRECATED_3_42("Use Type::ALL instead") - static constexpr auto ALL = Type::ALL; //!< @deprecated See Type::ALL. + static constexpr auto ALL = Type::ALL; NS_DEPRECATED_3_42("Use Type::UNIT instead") - static constexpr auto UNIT = Type::UNIT; //!< @deprecated See Type::UNIT. + static constexpr auto UNIT = Type::UNIT; NS_DEPRECATED_3_42("Use Type::SYSTEM instead") - static constexpr auto SYSTEM = Type::SYSTEM; //!< @deprecated See Type::SYSTEM. + static constexpr auto SYSTEM = Type::SYSTEM; NS_DEPRECATED_3_42("Use Type::EXAMPLE instead") - static constexpr auto EXAMPLE = Type::EXAMPLE; //!< @deprecated See Type::EXAMPLE. + static constexpr auto EXAMPLE = Type::EXAMPLE; NS_DEPRECATED_3_42("Use Type::PERFORMANCE instead") - static constexpr auto PERFORMANCE = Type::PERFORMANCE; //!< @deprecated See Type::PERFORMANCE. + static constexpr auto PERFORMANCE = Type::PERFORMANCE; + /**@}*/ /** * \brief Construct a new test suite. diff --git a/src/core/model/time-printer.cc b/src/core/model/time-printer.cc index 2793fa3ce..6373123f3 100644 --- a/src/core/model/time-printer.cc +++ b/src/core/model/time-printer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/time-printer.h b/src/core/model/time-printer.h index 5ac4db935..357618218 100644 --- a/src/core/model/time-printer.h +++ b/src/core/model/time-printer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/model/time.cc b/src/core/model/time.cc index 69c1078f6..4c89aaab5 100644 --- a/src/core/model/time.cc +++ b/src/core/model/time.cc @@ -2,18 +2,7 @@ * Copyright (c) 2005,2006 INRIA * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * TimeStep support by Emmanuelle Laprise diff --git a/src/core/model/timer-impl.h b/src/core/model/timer-impl.h index 746ef3b74..f3ea47fe3 100644 --- a/src/core/model/timer-impl.h +++ b/src/core/model/timer-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/timer.cc b/src/core/model/timer.cc index 214125469..7186ccfdf 100644 --- a/src/core/model/timer.cc +++ b/src/core/model/timer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/timer.h b/src/core/model/timer.h index eae0b0e58..e7c1ec65e 100644 --- a/src/core/model/timer.h +++ b/src/core/model/timer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/trace-source-accessor.cc b/src/core/model/trace-source-accessor.cc index 80bc501c2..394b9428e 100644 --- a/src/core/model/trace-source-accessor.cc +++ b/src/core/model/trace-source-accessor.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/trace-source-accessor.h b/src/core/model/trace-source-accessor.h index ea9d1b048..111a432ff 100644 --- a/src/core/model/trace-source-accessor.h +++ b/src/core/model/trace-source-accessor.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/traced-callback.h b/src/core/model/traced-callback.h index 1cbc2874f..868489f8f 100644 --- a/src/core/model/traced-callback.h +++ b/src/core/model/traced-callback.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/traced-value.h b/src/core/model/traced-value.h index f215b3092..064f7435b 100644 --- a/src/core/model/traced-value.h +++ b/src/core/model/traced-value.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/trickle-timer.cc b/src/core/model/trickle-timer.cc index 524d1ac3c..2aadaf30e 100644 --- a/src/core/model/trickle-timer.cc +++ b/src/core/model/trickle-timer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/core/model/trickle-timer.h b/src/core/model/trickle-timer.h index d50d86786..1a7be39d2 100644 --- a/src/core/model/trickle-timer.h +++ b/src/core/model/trickle-timer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/core/model/tuple.h b/src/core/model/tuple.h index 422bbab04..6efadf07b 100644 --- a/src/core/model/tuple.h +++ b/src/core/model/tuple.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Stefano Avallone */ diff --git a/src/core/model/type-id.cc b/src/core/model/type-id.cc index 91241b4c7..e0aa28640 100644 --- a/src/core/model/type-id.cc +++ b/src/core/model/type-id.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -84,6 +73,13 @@ class IidManager : public Singleton * \returns The id. */ uint16_t AllocateUid(std::string name); + /** + * Add a deprecated name for the type id. Use of this name raises + * a runtime warning, and only one deprecated name is supported. + * \param [in] uid The id. + * \param [in] name The deprecated name. + */ + void AddDeprecatedName(uint16_t uid, const std::string& name); /** * Set the parent of a type id. * \param [in] uid The id. @@ -131,6 +127,12 @@ class IidManager : public Singleton * \returns The name of the type id. */ std::string GetName(uint16_t uid) const; + /** + * Get the deprecated name of a type id. + * \param [in] uid The id. + * \returns The name of the type id. + */ + std::string GetDeprecatedName(uint16_t uid) const; /** * Get the hash of a type id. * \param [in] uid The id. @@ -297,6 +299,8 @@ class IidManager : public Singleton { /** The type id name. */ std::string name; + /** A deprecated type id name. */ + std::string deprecatedName; /** The type id hash value. */ TypeId::hash_t hash; /** The parent type id. */ @@ -427,7 +431,7 @@ IidManager::AllocateUid(std::string name) uint16_t oldUid = GetUid(hinfo->hash); m_hashmap.erase(m_hashmap.find(hinfo->hash)); hinfo->hash = hash | HashChainFlag; - m_hashmap.insert(std::make_pair(hinfo->hash, oldUid)); + m_hashmap.insert({hinfo->hash, oldUid}); // leave new hash unchained } } @@ -447,8 +451,8 @@ IidManager::AllocateUid(std::string name) auto uid = static_cast(tuid); // Add to both maps: - m_namemap.insert(std::make_pair(name, uid)); - m_hashmap.insert(std::make_pair(hash, uid)); + m_namemap.insert({name, uid}); + m_hashmap.insert({hash, uid}); NS_LOG_LOGIC(IIDL << uid); return uid; } @@ -463,6 +467,19 @@ IidManager::LookupInformation(uint16_t uid) const return const_cast(&m_information[uid - 1]); } +void +IidManager::AddDeprecatedName(uint16_t uid, const std::string& name) +{ + NS_LOG_FUNCTION(IID << uid << name); + IidInformation* info = LookupInformation(uid); + NS_ASSERT_MSG(info->deprecatedName.empty(), + "Deprecated name already added: " << info->deprecatedName); + const auto [it, success] = m_namemap.insert({name, uid}); + NS_ASSERT_MSG(success, + "Deprecated name " << name << " insertion failed (possibly a duplicate?)"); + info->deprecatedName = name; +} + void IidManager::SetParent(uint16_t uid, uint16_t parent) { @@ -546,6 +563,15 @@ IidManager::GetName(uint16_t uid) const return information->name; } +std::string +IidManager::GetDeprecatedName(uint16_t uid) const +{ + NS_LOG_FUNCTION(IID << uid); + IidInformation* information = LookupInformation(uid); + NS_LOG_LOGIC(IIDL << information->deprecatedName); + return information->deprecatedName; +} + TypeId::hash_t IidManager::GetHash(uint16_t uid) const { @@ -832,12 +858,27 @@ TypeId::TypeId(uint16_t tid) NS_LOG_FUNCTION(this << tid); } +TypeId +TypeId::AddDeprecatedName(const std::string& name) +{ + NS_LOG_FUNCTION(this << name); + IidManager::Get()->AddDeprecatedName(m_tid, name); + NS_LOG_INFO("Set deprecated name " << name << " for TypeId " + << IidManager::Get()->GetName(m_tid)); + return *this; +} + TypeId TypeId::LookupByName(std::string name) { NS_LOG_FUNCTION(name); uint16_t uid = IidManager::Get()->GetUid(name); - NS_ASSERT_MSG(uid != 0, "Assert in TypeId::LookupByName: " << name << " not found"); + NS_ASSERT_MSG(uid, "Assert in TypeId::LookupByName: " << name << " not found"); + if (IidManager::Get()->GetDeprecatedName(uid) == name) + { + std::cerr << "Deprecation warning for name " << name << "; use " + << IidManager::Get()->GetName(uid) << " instead" << std::endl; + } return TypeId(uid); } @@ -851,6 +892,11 @@ TypeId::LookupByNameFailSafe(std::string name, TypeId* tid) return false; } *tid = TypeId(uid); + if (IidManager::Get()->GetDeprecatedName(uid) == name) + { + std::cerr << "Deprecation warning for name " << name << "; use " + << IidManager::Get()->GetName(uid) << " instead" << std::endl; + } return true; } @@ -890,41 +936,64 @@ TypeId::GetRegistered(uint16_t i) return TypeId(IidManager::Get()->GetRegistered(i)); } -bool -TypeId::LookupAttributeByName(std::string name, TypeId::AttributeInformation* info) const +std::tuple +TypeId::FindAttribute(const TypeId& tid, const std::string& name) { - NS_LOG_FUNCTION(this << name << info); - TypeId tid; - TypeId nextTid = *this; - do + TypeId currentTid = tid; + TypeId parentTid; + while (true) { - tid = nextTid; - for (std::size_t i = 0; i < tid.GetAttributeN(); i++) + for (std::size_t i = 0; i < currentTid.GetAttributeN(); ++i) { - TypeId::AttributeInformation tmp = tid.GetAttribute(i); - if (tmp.name == name) + const AttributeInformation& attributeInfo = currentTid.GetAttribute(i); + if (attributeInfo.name == name) { - if (tmp.supportLevel == TypeId::SUPPORTED) - { - *info = tmp; - return true; - } - else if (tmp.supportLevel == TypeId::DEPRECATED) - { - std::cerr << "Attribute '" << name << "' is deprecated: " << tmp.supportMsg - << std::endl; - *info = tmp; - return true; - } - else if (tmp.supportLevel == TypeId::OBSOLETE) - { - NS_FATAL_ERROR("Attribute '" << name << "' is obsolete, with no fallback: " - << tmp.supportMsg); - } + return {true, currentTid, attributeInfo}; } } - nextTid = tid.GetParent(); - } while (nextTid != tid); + + parentTid = currentTid.GetParent(); + + if (parentTid == currentTid) + { + break; + } + + currentTid = parentTid; + } + return {false, TypeId(), AttributeInformation()}; +} + +bool +TypeId::LookupAttributeByName(std::string name, + TypeId::AttributeInformation* info, + bool permissive) const +{ + NS_LOG_FUNCTION(this << name << info); + auto [found, tid, attribute] = FindAttribute(*this, name); + if (found) + { + if (attribute.supportLevel == TypeId::SUPPORTED) + { + *info = attribute; + return true; + } + else if (attribute.supportLevel == TypeId::DEPRECATED) + { + if (!permissive) + { + std::cerr << "Attribute '" << name << "' is deprecated: " << attribute.supportMsg + << std::endl; + } + *info = attribute; + return true; + } + else if (attribute.supportLevel == TypeId::OBSOLETE) + { + NS_FATAL_ERROR("Attribute '" + << name << "' is obsolete, with no fallback: " << attribute.supportMsg); + } + } return false; } diff --git a/src/core/model/type-id.h b/src/core/model/type-id.h index 2c2a58f3f..52f5bfa47 100644 --- a/src/core/model/type-id.h +++ b/src/core/model/type-id.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -182,6 +171,20 @@ class TypeId */ explicit TypeId(const std::string& name); + /** + * Add an deprecated name for a TypeId. + * + * \param [in] name The deprecated name. + * \return This TypeId instance. + * + * To allow for deprecations (such as moving a TypeId into a namespace + * but wishing to preserve the original string from namespace ns3), + * one additional deprecated name can be registered for a TypeId. This + * deprecated name is not retrievable by GetName(). A runtime warning is + * generated if the name is used, and only one deprecated name is supported. + */ + TypeId AddDeprecatedName(const std::string& name); + /** * Get the parent of this TypeId. * @@ -464,6 +467,17 @@ class TypeId */ TypeId HideFromDocumentation(); + /** + * Find an attribute by name in the inheritance tree for a given TypeId. + * + * \param [in] tid The TypeId to start the search from. + * \param [in] name The name of the attribute to search for. + * \return A tuple containing a boolean that indicates whether the attribute was found, the + * TypeId where the attribute was found, and the AttributeInformation of the found attribute. + */ + static std::tuple FindAttribute(const TypeId& tid, + const std::string& name); + /** * Find an Attribute by name, retrieving the associated AttributeInformation. * @@ -471,9 +485,14 @@ class TypeId * \param [in,out] info A pointer to the TypeId::AttributeInformation * data structure where the result value of this method * will be stored. + * \param [in] permissive If false (by default), will generate warnings and errors for + * deprecated and obsolete attributes, respectively. If set to true, warnings for deprecated + * attributes will be suppressed. * \returns \c true if the requested attribute could be found. */ - bool LookupAttributeByName(std::string name, AttributeInformation* info) const; + bool LookupAttributeByName(std::string name, + AttributeInformation* info, + bool permissive = false) const; /** * Find a TraceSource by name. * diff --git a/src/core/model/type-name.h b/src/core/model/type-name.h index 41d73d0d4..c622bf643 100644 --- a/src/core/model/type-name.h +++ b/src/core/model/type-name.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Georgia Tech Research Corporation * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ @@ -37,7 +26,7 @@ namespace ns3 * * Type name strings for AttributeValue types. * Custom classes should add a template specialization of this function - * using the macro \c TYPE_NAME_GET_DEFINE(T). + * using the macro \c TYPENAMEGET_DEFINE(T). * * \tparam T \explicit The type. * \returns The type name as a string. diff --git a/src/core/model/type-traits.h b/src/core/model/type-traits.h index 7f5b4490d..812e0b3c0 100644 --- a/src/core/model/type-traits.h +++ b/src/core/model/type-traits.h @@ -1,24 +1,14 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ #ifndef TYPE_TRAITS_H #define TYPE_TRAITS_H +#include "deprecated.h" #include "ptr.h" /** @@ -36,7 +26,7 @@ namespace ns3 * \tparam T \deduced The type to inspect. */ template -struct TypeTraits +struct NS_DEPRECATED_3_43("Use functions provided by #include ") TypeTraits { private: /** Null value type traits. */ diff --git a/src/core/model/uinteger.cc b/src/core/model/uinteger.cc index a320bf3bf..b998339af 100644 --- a/src/core/model/uinteger.cc +++ b/src/core/model/uinteger.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/uinteger.h b/src/core/model/uinteger.h index 43656b7d0..8d741db9a 100644 --- a/src/core/model/uinteger.h +++ b/src/core/model/uinteger.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/model/uniform-random-bit-generator.h b/src/core/model/uniform-random-bit-generator.h index 3e5a8803c..3ebdc0149 100644 --- a/src/core/model/uniform-random-bit-generator.h +++ b/src/core/model/uniform-random-bit-generator.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Stefano Avallone */ diff --git a/src/core/model/unix-fd-reader.cc b/src/core/model/unix-fd-reader.cc index f73dc356b..0d622ef82 100644 --- a/src/core/model/unix-fd-reader.cc +++ b/src/core/model/unix-fd-reader.cc @@ -2,18 +2,7 @@ /* * Copyright (c) 2010 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Goff */ diff --git a/src/core/model/val-array.h b/src/core/model/val-array.h index d90050be3..1a00daec3 100644 --- a/src/core/model/val-array.h +++ b/src/core/model/val-array.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Biljana Bojovic */ diff --git a/src/core/model/vector.cc b/src/core/model/vector.cc index d3db45630..b76fe8cba 100644 --- a/src/core/model/vector.cc +++ b/src/core/model/vector.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/vector.h b/src/core/model/vector.h index ff4483cdc..819c0220a 100644 --- a/src/core/model/vector.h +++ b/src/core/model/vector.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -394,25 +383,25 @@ Ptr MakeVectorChecker(); // Document these by hand so they go in group attribute_Vector3D -/*! -\ingroup attribute_Vector3D -\fn ns3::Ptr ns3::MakeVectorAccessor (T1 a1) -\copydoc ns3::MakeAccessorHelper(T1) -\see AttributeAccessor -*/ +/** + * \ingroup attribute_Vector3D + * \fn ns3::Ptr ns3::MakeVectorAccessor (T1 a1) + * \copydoc ns3::MakeAccessorHelper(T1) + * \see AttributeAccessor + */ -/*! -\ingroup attribute_Vector3D -\fn ns3::Ptr ns3::MakeVectorAccessor (T1 a1, T2 a2) -\copydoc ns3::MakeAccessorHelper(T1,T2) -\see AttributeAccessor -*/ +/** + * \ingroup attribute_Vector3D + * \fn ns3::Ptr ns3::MakeVectorAccessor (T1 a1, T2 a2) + * \copydoc ns3::MakeAccessorHelper(T1,T2) + * \see AttributeAccessor + */ -/*! -\ingroup attribute_Vector3D -\fn ns3::Ptr ns3::MakeVectorChecker () -\returns The AttributeChecker. -\see AttributeChecker -*/ +/** + * \ingroup attribute_Vector3D + * \fn ns3::Ptr ns3::MakeVectorChecker () + * \returns The AttributeChecker. + * \see AttributeChecker + */ #endif /* NS3_VECTOR_H */ diff --git a/src/core/model/version-defines.h.in b/src/core/model/version-defines.h.in index 319d75e96..428a99163 100644 --- a/src/core/model/version-defines.h.in +++ b/src/core/model/version-defines.h.in @@ -1,19 +1,7 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathew Bielejeski */ @@ -22,16 +10,16 @@ #define NS3_VERSION_DEFINES_H_ /** - * \file - * \ingroup buildversion - * Defines the macro values for printing the build version. - * These will be populated by the build system. - */ + * \file + * \ingroup buildversion + * Defines the macro values for printing the build version. + * These will be populated by the build system. + */ /** - * \ingroup buildversion - * @{ - */ + * \ingroup buildversion + * @{ + */ /** * The first tag found which matches the pattern ns-3*. diff --git a/src/core/model/version.cc b/src/core/model/version.cc index ceb2599e6..58f8462f6 100644 --- a/src/core/model/version.cc +++ b/src/core/model/version.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathew Bielejeski */ diff --git a/src/core/model/version.h b/src/core/model/version.h index 1d8ea3269..f74909b9e 100644 --- a/src/core/model/version.h +++ b/src/core/model/version.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathew Bielejeski */ diff --git a/src/core/model/wall-clock-synchronizer.cc b/src/core/model/wall-clock-synchronizer.cc index f11b84ee2..18a1663e9 100644 --- a/src/core/model/wall-clock-synchronizer.cc +++ b/src/core/model/wall-clock-synchronizer.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "wall-clock-synchronizer.h" diff --git a/src/core/model/wall-clock-synchronizer.h b/src/core/model/wall-clock-synchronizer.h index 4951fa6aa..6bafebd16 100644 --- a/src/core/model/wall-clock-synchronizer.h +++ b/src/core/model/wall-clock-synchronizer.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef WALL_CLOCK_CLOCK_SYNCHRONIZER_H diff --git a/src/core/model/warnings.h b/src/core/model/warnings.h index c9bd2e8ad..281f7b8d8 100644 --- a/src/core/model/warnings.h +++ b/src/core/model/warnings.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/core/model/watchdog.cc b/src/core/model/watchdog.cc index d98f101e0..382078cf6 100644 --- a/src/core/model/watchdog.cc +++ b/src/core/model/watchdog.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/watchdog.h b/src/core/model/watchdog.h index e3fe5eee2..cc022cb15 100644 --- a/src/core/model/watchdog.h +++ b/src/core/model/watchdog.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/model/win32-fd-reader.cc b/src/core/model/win32-fd-reader.cc index 06ab1f2e2..c9f639f94 100644 --- a/src/core/model/win32-fd-reader.cc +++ b/src/core/model/win32-fd-reader.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 The Boeing Company * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Goff */ diff --git a/src/core/test/attribute-container-test-suite.cc b/src/core/test/attribute-container-test-suite.cc index f5e35efef..3efb0bd31 100644 --- a/src/core/test/attribute-container-test-suite.cc +++ b/src/core/test/attribute-container-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Caliola Engineering, LLC. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jared Dulmage */ @@ -26,7 +15,9 @@ #include #include #include +#include #include +#include #include #include @@ -394,7 +385,25 @@ AttributeContainerSerializationTestCase::DoRun() NS_TEST_ASSERT_MSG_EQ(attr.GetN(), 3, "Incorrect container size"); std::string reserialized = attr.SerializeToString(checker); - NS_TEST_ASSERT_MSG_EQ(reserialized, pairs, "Reserealization failed"); + NS_TEST_ASSERT_MSG_EQ(reserialized, pairs, "Reserialization failed"); + } + + { + std::string tupleVec = "{-1, 2, 3.4};{-2, 1, 4.3}"; + AttributeContainerValue, ';'> attr; + auto checker = MakeAttributeContainerChecker(attr); + auto acchecker = DynamicCast(checker); + acchecker->SetItemChecker(MakeTupleChecker( + MakeIntegerChecker(), + MakeUintegerChecker(), + MakeDoubleChecker())); + NS_TEST_ASSERT_MSG_EQ(attr.DeserializeFromString(tupleVec, checker), + true, + "Deserialization failed"); + NS_TEST_ASSERT_MSG_EQ(attr.GetN(), 2, "Incorrect container size"); + + std::string reserialized = attr.SerializeToString(checker); + NS_TEST_ASSERT_MSG_EQ(reserialized, tupleVec, "Reserialization failed"); } } diff --git a/src/core/test/attribute-test-suite.cc b/src/core/test/attribute-test-suite.cc index acdec4e4a..1876cd852 100644 --- a/src/core/test/attribute-test-suite.cc +++ b/src/core/test/attribute-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/boolean.h" diff --git a/src/core/test/build-profile-test-suite.cc b/src/core/test/build-profile-test-suite.cc index 7e2f1af6a..00c8874cc 100644 --- a/src/core/test/build-profile-test-suite.cc +++ b/src/core/test/build-profile-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2015 LLNL * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/callback-test-suite.cc b/src/core/test/callback-test-suite.cc index 7ffda9d43..7b32a6190 100644 --- a/src/core/test/callback-test-suite.cc +++ b/src/core/test/callback-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/callback.h" diff --git a/src/core/test/command-line-test-suite.cc b/src/core/test/command-line-test-suite.cc index a053a3be2..bc9fe0747 100644 --- a/src/core/test/command-line-test-suite.cc +++ b/src/core/test/command-line-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/test/config-test-suite.cc b/src/core/test/config-test-suite.cc index 74589e17b..30203dab6 100644 --- a/src/core/test/config-test-suite.cc +++ b/src/core/test/config-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/test/environment-variable-test-suite.cc b/src/core/test/environment-variable-test-suite.cc index 2efcce15c..9349d5777 100644 --- a/src/core/test/environment-variable-test-suite.cc +++ b/src/core/test/environment-variable-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/event-garbage-collector-test-suite.cc b/src/core/test/event-garbage-collector-test-suite.cc index b0602d341..a8ae4c78a 100644 --- a/src/core/test/event-garbage-collector-test-suite.cc +++ b/src/core/test/event-garbage-collector-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INESC Porto * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Gustavo J. A. M. Carneiro */ diff --git a/src/core/test/examples-as-tests-test-suite.cc b/src/core/test/examples-as-tests-test-suite.cc index e1540b5a9..e95ec86a7 100644 --- a/src/core/test/examples-as-tests-test-suite.cc +++ b/src/core/test/examples-as-tests-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/global-value-test-suite.cc b/src/core/test/global-value-test-suite.cc index aabacd289..12d2052df 100644 --- a/src/core/test/global-value-test-suite.cc +++ b/src/core/test/global-value-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage */ diff --git a/src/core/test/hash-test-suite.cc b/src/core/test/hash-test-suite.cc index 4673040d4..7cf42fd8d 100644 --- a/src/core/test/hash-test-suite.cc +++ b/src/core/test/hash-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/int64x64-test-suite.cc b/src/core/test/int64x64-test-suite.cc index 877a965e8..e4a82bea5 100644 --- a/src/core/test/int64x64-test-suite.cc +++ b/src/core/test/int64x64-test-suite.cc @@ -1,19 +1,7 @@ /* * Copyright (c) 2011 INRIA * - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/int64x64.h" @@ -182,7 +170,8 @@ Int64x64HiLoTestCase::DoRun() if (int64x64_t::implementation == int64x64_t::ld_impl) { // Darwin 12.5.0 (Mac 10.8.5) g++ 4.2.1 - low = static_cast(HP_MAX_64 * std::numeric_limits::epsilon()); + low = static_cast(int64x64_t::HP_MAX_64 * + std::numeric_limits::epsilon()); } Check(0, 0); diff --git a/src/core/test/length-test-suite.cc b/src/core/test/length-test-suite.cc index 748720a12..65ad79259 100644 --- a/src/core/test/length-test-suite.cc +++ b/src/core/test/length-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathew Bielejeski */ diff --git a/src/core/test/many-uniform-random-variables-one-get-value-call-test-suite.cc b/src/core/test/many-uniform-random-variables-one-get-value-call-test-suite.cc index 09a364d62..b901704c2 100644 --- a/src/core/test/many-uniform-random-variables-one-get-value-call-test-suite.cc +++ b/src/core/test/many-uniform-random-variables-one-get-value-call-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mitch Watrous (watrous@u.washington.edu) */ diff --git a/src/core/test/matrix-array-test-suite.cc b/src/core/test/matrix-array-test-suite.cc index 3dc0e1ee0..025f9ef7d 100644 --- a/src/core/test/matrix-array-test-suite.cc +++ b/src/core/test/matrix-array-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Biljana Bojovic */ diff --git a/src/core/test/names-test-suite.cc b/src/core/test/names-test-suite.cc index 30d2532fc..0c7d516ef 100644 --- a/src/core/test/names-test-suite.cc +++ b/src/core/test/names-test-suite.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/names.h" diff --git a/src/core/test/object-test-suite.cc b/src/core/test/object-test-suite.cc index f8bfe0cc0..5b8c241cf 100644 --- a/src/core/test/object-test-suite.cc +++ b/src/core/test/object-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA, Gustavo Carneiro * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Gustavo Carneiro , * Mathieu Lacage diff --git a/src/core/test/one-uniform-random-variable-many-get-value-calls-test-suite.cc b/src/core/test/one-uniform-random-variable-many-get-value-calls-test-suite.cc index 8c0505687..862dfd032 100644 --- a/src/core/test/one-uniform-random-variable-many-get-value-calls-test-suite.cc +++ b/src/core/test/one-uniform-random-variable-many-get-value-calls-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mitch Watrous (watrous@u.washington.edu) */ diff --git a/src/core/test/pair-value-test-suite.cc b/src/core/test/pair-value-test-suite.cc index b62ae3aa7..7746c39cd 100644 --- a/src/core/test/pair-value-test-suite.cc +++ b/src/core/test/pair-value-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Caliola Engineering, LLC. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Jared Dulmage */ diff --git a/src/core/test/ptr-test-suite.cc b/src/core/test/ptr-test-suite.cc index a977ee0e1..a7dd37c6f 100644 --- a/src/core/test/ptr-test-suite.cc +++ b/src/core/test/ptr-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/test/random-variable-stream-test-suite.cc b/src/core/test/random-variable-stream-test-suite.cc index 145bd49bd..3046033af 100644 --- a/src/core/test/random-variable-stream-test-suite.cc +++ b/src/core/test/random-variable-stream-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009-12 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * This file is based on rng-test-suite.cc. * @@ -29,6 +18,7 @@ #include "ns3/shuffle.h" #include "ns3/string.h" #include "ns3/test.h" +#include "ns3/uinteger.h" #include #include @@ -140,6 +130,25 @@ class TestCaseBase : public TestCase return valueMean; } + /** + * Compute the variance of a random variable. + * \param [in] rng The random variable to sample. + * \param [in] average The previously calculated average value. + * \returns The variance of \c N_MEASUREMENTS samples. + */ + double Variance(Ptr rng, double average) const + { + NS_LOG_FUNCTION(this << rng); + auto sum = 0.0; + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + const auto value = rng->GetValue(); + sum += std::pow(value - average, 2); + } + const auto valueVariance = sum / N_MEASUREMENTS; + return valueVariance; + } + /** A factory base class to create new instances of a random variable. */ class RngGeneratorBase { @@ -1242,12 +1251,12 @@ WeibullTestCase::DoRun() SetTestSuiteSeed(); auto generator = RngGenerator(); - double sum = ChiSquaredsAverage(&generator, N_RUNS); - double maxStatistic = gsl_cdf_chisq_Qinv(0.05, N_BINS); + const auto sum = ChiSquaredsAverage(&generator, N_RUNS); + const auto maxStatistic = gsl_cdf_chisq_Qinv(0.05, N_BINS); NS_TEST_ASSERT_MSG_LT(sum, maxStatistic, "Chi-squared statistic out of range"); - double scale = 5.0; - double shape = 1.0; + const auto scale = 5.0; + const auto shape = 1.0; // Create the RNG with the specified range. Ptr x = CreateObject(); @@ -1255,7 +1264,7 @@ WeibullTestCase::DoRun() x->SetAttribute("Shape", DoubleValue(shape)); // Calculate the mean of these values. - double valueMean = Average(x); + const auto measuredMean = Average(x); // The expected value for the mean of the values returned by a // Weibull distributed random variable is @@ -1279,13 +1288,17 @@ WeibullTestCase::DoRun() // // E[value] = scale . // - double expectedMean = scale; + const auto expectedMean = scale; + + // Test calculated and expected mean values are identical. + const auto valueMean = x->GetMean(); + NS_TEST_ASSERT_MSG_EQ(valueMean, expectedMean, "Wrong calculated mean value."); // Test that values have approximately the right mean value. - NS_TEST_ASSERT_MSG_EQ_TOL(valueMean, + NS_TEST_ASSERT_MSG_EQ_TOL(measuredMean, expectedMean, expectedMean * TOLERANCE, - "Wrong mean value."); + "Wrong measured mean value."); } /** @@ -2938,6 +2951,142 @@ ShuffleElementsTest::DoRun() "Expected vector {4, 1, 9, 3, 2, 7}"); } +/** + * \ingroup rng-tests + * Test case for laplacian distribution random variable stream generator + */ +class LaplacianTestCase : public TestCaseBase +{ + public: + LaplacianTestCase(); + + private: + void DoRun() override; + + /** + * Tolerance for testing rng values against expectation, + * as a fraction of mean value. + */ + static constexpr double TOLERANCE{1e-2}; +}; + +LaplacianTestCase::LaplacianTestCase() + : TestCaseBase("Laplacian Random Variable Stream Generator") +{ +} + +void +LaplacianTestCase::DoRun() +{ + NS_LOG_FUNCTION(this); + SetTestSuiteSeed(); + + double mu = -5.0; + double scale = 4.0; + double bound = 20.0; + + // Create unbounded RNG with the specified range. + auto x1 = CreateObject(); + x1->SetAttribute("Location", DoubleValue(mu)); + x1->SetAttribute("Scale", DoubleValue(scale)); + + // Calculate the mean of these values. + auto valueMean = Average(x1); + + // Calculate the variance of these values. + auto valueVariance = Variance(x1, valueMean); + + // Test that values have approximately the right mean value. + const auto expectedMean = mu; + NS_TEST_ASSERT_MSG_EQ_TOL(valueMean, expectedMean, TOLERANCE, "Wrong mean value."); + + // Test that values have approximately the right variance value. + const auto expectedVariance = LaplacianRandomVariable::GetVariance(scale); + NS_TEST_ASSERT_MSG_EQ_TOL(valueVariance, + expectedVariance, + TOLERANCE * expectedVariance, + "Wrong variance value."); + + // Create bounded RNG with the specified range. + auto x2 = CreateObject(); + x2->SetAttribute("Location", DoubleValue(mu)); + x2->SetAttribute("Scale", DoubleValue(scale)); + x2->SetAttribute("Bound", DoubleValue(bound)); + + // Calculate the mean of these values. + valueMean = Average(x2); + + // Test that values have approximately the right mean value. + NS_TEST_ASSERT_MSG_EQ_TOL(valueMean, expectedMean, TOLERANCE, "Wrong mean value."); + + // Check that only the correct values are returned + const auto lowerBound = mu - bound; + const auto upperBound = mu + bound; + for (uint32_t i = 0; i < N_MEASUREMENTS; ++i) + { + const auto value = x2->GetValue(); + NS_TEST_EXPECT_MSG_EQ((value >= lowerBound) || (value <= upperBound), + true, + "Value not in expected boundaries."); + } +} + +/** + * \ingroup rng-tests + * Test case for largest extreme value distribution random variable stream generator + */ +class LargestExtremeValueTestCase : public TestCaseBase +{ + public: + LargestExtremeValueTestCase(); + + private: + void DoRun() override; + + /** + * Tolerance for testing rng values against expectation, + * as a fraction of mean value. + */ + static constexpr double TOLERANCE{1e-2}; +}; + +LargestExtremeValueTestCase::LargestExtremeValueTestCase() + : TestCaseBase("Largest Extreme Value Random Variable Stream Generator") +{ +} + +void +LargestExtremeValueTestCase::DoRun() +{ + NS_LOG_FUNCTION(this); + SetTestSuiteSeed(); + + double mu = 2.0; + double scale = 1.0; + + // Create RNG with the specified range. + auto x = CreateObject(); + x->SetAttribute("Location", DoubleValue(mu)); + x->SetAttribute("Scale", DoubleValue(scale)); + + // Calculate the mean of these values. + auto valueMean = Average(x); + + // Calculate the variance of these values. + auto valueVariance = Variance(x, valueMean); + + // Test that values have approximately the right mean value. + const auto expectedMean = LargestExtremeValueRandomVariable::GetMean(mu, scale); + NS_TEST_ASSERT_MSG_EQ_TOL(valueMean, expectedMean, TOLERANCE, "Wrong mean value."); + + // Test that values have approximately the right variance value. + const auto expectedVariance = LargestExtremeValueRandomVariable::GetVariance(scale); + NS_TEST_ASSERT_MSG_EQ_TOL(valueVariance, + expectedVariance, + TOLERANCE * expectedVariance, + "Wrong variance value."); +} + /** * \ingroup rng-tests * RandomVariableStream test suite, covering all random number variable @@ -2995,6 +3144,8 @@ RandomVariableSuite::RandomVariableSuite() AddTestCase(new BinomialTestCase); AddTestCase(new BinomialAntitheticTestCase); AddTestCase(new ShuffleElementsTest); + AddTestCase(new LaplacianTestCase); + AddTestCase(new LargestExtremeValueTestCase); } static RandomVariableSuite randomVariableSuite; //!< Static variable for test initialization diff --git a/src/core/test/rng-test-suite.cc b/src/core/test/rng-test-suite.cc index 4cad7d7de..71db98332 100644 --- a/src/core/test/rng-test-suite.cc +++ b/src/core/test/rng-test-suite.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/double.h" diff --git a/src/core/test/sample-test-suite.cc b/src/core/test/sample-test-suite.cc index 5b41a8331..090f0325f 100644 --- a/src/core/test/sample-test-suite.cc +++ b/src/core/test/sample-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/core/test/simulator-test-suite.cc b/src/core/test/simulator-test-suite.cc index 0f56d3030..e48481b98 100644 --- a/src/core/test/simulator-test-suite.cc +++ b/src/core/test/simulator-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/test/splitstring-test-suite.cc b/src/core/test/splitstring-test-suite.cc index 48dadea2d..e42ecd971 100644 --- a/src/core/test/splitstring-test-suite.cc +++ b/src/core/test/splitstring-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/threaded-test-suite.cc b/src/core/test/threaded-test-suite.cc index 3490822ac..e20cf66a0 100644 --- a/src/core/test/threaded-test-suite.cc +++ b/src/core/test/threaded-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Claudio Freire */ diff --git a/src/core/test/time-test-suite.cc b/src/core/test/time-test-suite.cc index 0e644b96d..c28770b34 100644 --- a/src/core/test/time-test-suite.cc +++ b/src/core/test/time-test-suite.cc @@ -2,18 +2,7 @@ * Copyright (c) 2005,2006 INRIA * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * TimeStep support by Emmanuelle Laprise diff --git a/src/core/test/timer-test-suite.cc b/src/core/test/timer-test-suite.cc index 3c2df83c1..4c88bf8af 100644 --- a/src/core/test/timer-test-suite.cc +++ b/src/core/test/timer-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/core/test/traced-callback-test-suite.cc b/src/core/test/traced-callback-test-suite.cc index 441225ca2..dc2957f46 100644 --- a/src/core/test/traced-callback-test-suite.cc +++ b/src/core/test/traced-callback-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/test.h" diff --git a/src/core/test/trickle-timer-test-suite.cc b/src/core/test/trickle-timer-test-suite.cc index c3c0b9c53..dfaf10d91 100644 --- a/src/core/test/trickle-timer-test-suite.cc +++ b/src/core/test/trickle-timer-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/core/test/tuple-value-test-suite.cc b/src/core/test/tuple-value-test-suite.cc index 932444ccb..835c0a634 100644 --- a/src/core/test/tuple-value-test-suite.cc +++ b/src/core/test/tuple-value-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Stefano Avallone */ diff --git a/src/core/test/type-id-test-suite.cc b/src/core/test/type-id-test-suite.cc index 265845726..535409c43 100644 --- a/src/core/test/type-id-test-suite.cc +++ b/src/core/test/type-id-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 Lawrence Livermore National Laboratory * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Peter D. Barnes, Jr. */ diff --git a/src/core/test/type-traits-test-suite.cc b/src/core/test/type-traits-test-suite.cc index 70f509f71..320b64631 100644 --- a/src/core/test/type-traits-test-suite.cc +++ b/src/core/test/type-traits-test-suite.cc @@ -1,22 +1,12 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ns3/test.h" #include "ns3/type-traits.h" +#include "ns3/warnings.h" /** * \file @@ -59,6 +49,12 @@ TypeTraitsTestCase::TypeTraitsTestCase() void TypeTraitsTestCase::DoRun() { + // NS_DEPRECATED_3_43 + // The TypeTraits struct has been deprecated in ns-3.43. + // While the struct isn't removed, the deprecation warnings must be silenced. + // Once the struct is removed, this test suite should be deleted. + NS_WARNING_PUSH_DEPRECATED; + NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, 1, "Check pointer to member function ()"); @@ -79,6 +75,8 @@ TypeTraitsTestCase::DoRun() TypeTraits::PointerToMemberTraits::nArgs, 1, "Check number of arguments for pointer to member function (int) const"); + + NS_WARNING_POP; } /** diff --git a/src/core/test/val-array-test-suite.cc b/src/core/test/val-array-test-suite.cc index 609217302..63abf4d4b 100644 --- a/src/core/test/val-array-test-suite.cc +++ b/src/core/test/val-array-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Biljana Bojovic */ diff --git a/src/core/test/watchdog-test-suite.cc b/src/core/test/watchdog-test-suite.cc index f9400fbc1..974a50c2d 100644 --- a/src/core/test/watchdog-test-suite.cc +++ b/src/core/test/watchdog-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/csma-layout/examples/csma-star.cc b/src/csma-layout/examples/csma-star.cc index 859cd8ea2..670d41efa 100644 --- a/src/csma-layout/examples/csma-star.cc +++ b/src/csma-layout/examples/csma-star.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/csma-layout/model/csma-star-helper.cc b/src/csma-layout/model/csma-star-helper.cc index d05282c3b..ca2690882 100644 --- a/src/csma-layout/model/csma-star-helper.cc +++ b/src/csma-layout/model/csma-star-helper.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "csma-star-helper.h" diff --git a/src/csma-layout/model/csma-star-helper.h b/src/csma-layout/model/csma-star-helper.h index e02fde6db..2ec9bf01f 100644 --- a/src/csma-layout/model/csma-star-helper.h +++ b/src/csma-layout/model/csma-star-helper.h @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Define an object to create a star topology. diff --git a/src/csma/examples/csma-broadcast.cc b/src/csma/examples/csma-broadcast.cc index 10efb8ebd..87418c7cc 100644 --- a/src/csma/examples/csma-broadcast.cc +++ b/src/csma/examples/csma-broadcast.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // diff --git a/src/csma/examples/csma-multicast.cc b/src/csma/examples/csma-multicast.cc index 61d51a712..f6a52551e 100644 --- a/src/csma/examples/csma-multicast.cc +++ b/src/csma/examples/csma-multicast.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/csma/examples/csma-one-subnet.cc b/src/csma/examples/csma-one-subnet.cc index e05de1fc5..76dfdc03a 100644 --- a/src/csma/examples/csma-one-subnet.cc +++ b/src/csma/examples/csma-one-subnet.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/csma/examples/csma-packet-socket.cc b/src/csma/examples/csma-packet-socket.cc index 79cfd927d..23a91846b 100644 --- a/src/csma/examples/csma-packet-socket.cc +++ b/src/csma/examples/csma-packet-socket.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // diff --git a/src/csma/examples/csma-ping.cc b/src/csma/examples/csma-ping.cc index ca663a0f8..22509acc3 100644 --- a/src/csma/examples/csma-ping.cc +++ b/src/csma/examples/csma-ping.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/csma/examples/csma-raw-ip-socket.cc b/src/csma/examples/csma-raw-ip-socket.cc index 2be6a2ac0..f9b4bf2d5 100644 --- a/src/csma/examples/csma-raw-ip-socket.cc +++ b/src/csma/examples/csma-raw-ip-socket.cc @@ -1,16 +1,5 @@ /* - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // diff --git a/src/csma/helper/csma-helper.cc b/src/csma/helper/csma-helper.cc index 2057b6b37..83c05a46a 100644 --- a/src/csma/helper/csma-helper.cc +++ b/src/csma/helper/csma-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/csma/helper/csma-helper.h b/src/csma/helper/csma-helper.h index 4d78f6e68..e38304fef 100644 --- a/src/csma/helper/csma-helper.h +++ b/src/csma/helper/csma-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/csma/model/backoff.cc b/src/csma/model/backoff.cc index ae40bb717..6fd6aa373 100644 --- a/src/csma/model/backoff.cc +++ b/src/csma/model/backoff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007, Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Emmanuelle Laprise */ diff --git a/src/csma/model/backoff.h b/src/csma/model/backoff.h index 40ec8e15a..5ff47d045 100644 --- a/src/csma/model/backoff.h +++ b/src/csma/model/backoff.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Emmanuelle Laprise */ diff --git a/src/csma/model/csma-channel.h b/src/csma/model/csma-channel.h index 92263545e..5f321fdd0 100644 --- a/src/csma/model/csma-channel.h +++ b/src/csma/model/csma-channel.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Emmanuelle Laprise */ diff --git a/src/csma/model/csma-net-device.cc b/src/csma/model/csma-net-device.cc index a28164089..caf602802 100644 --- a/src/csma/model/csma-net-device.cc +++ b/src/csma/model/csma-net-device.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Emmanuelle Laprise */ diff --git a/src/csma/model/csma-net-device.h b/src/csma/model/csma-net-device.h index af092bfa6..bbe8092ab 100644 --- a/src/csma/model/csma-net-device.h +++ b/src/csma/model/csma-net-device.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 Emmanuelle Laprise * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Emmanuelle Laprise * Author: Yufei Cheng diff --git a/src/dsdv/examples/dsdv-manet.cc b/src/dsdv/examples/dsdv-manet.cc index 0606322c9..ac2716df2 100644 --- a/src/dsdv/examples/dsdv-manet.cc +++ b/src/dsdv/examples/dsdv-manet.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/helper/dsdv-helper.cc b/src/dsdv/helper/dsdv-helper.cc index d0827316b..3a93c3e60 100644 --- a/src/dsdv/helper/dsdv-helper.cc +++ b/src/dsdv/helper/dsdv-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hemanth Narra , written after OlsrHelper by Mathieu Lacage * diff --git a/src/dsdv/helper/dsdv-helper.h b/src/dsdv/helper/dsdv-helper.h index 7a701c7a0..b6c098b6e 100644 --- a/src/dsdv/helper/dsdv-helper.h +++ b/src/dsdv/helper/dsdv-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hemanth Narra , written after OlsrHelper by Mathieu Lacage * diff --git a/src/dsdv/model/dsdv-packet-queue.cc b/src/dsdv/model/dsdv-packet-queue.cc index 57ea72f54..ee39a55c1 100644 --- a/src/dsdv/model/dsdv-packet-queue.cc +++ b/src/dsdv/model/dsdv-packet-queue.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/model/dsdv-packet-queue.h b/src/dsdv/model/dsdv-packet-queue.h index 927b798a1..e24a0922f 100644 --- a/src/dsdv/model/dsdv-packet-queue.h +++ b/src/dsdv/model/dsdv-packet-queue.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/model/dsdv-packet.cc b/src/dsdv/model/dsdv-packet.cc index b52f77a2a..1287fce69 100644 --- a/src/dsdv/model/dsdv-packet.cc +++ b/src/dsdv/model/dsdv-packet.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/model/dsdv-packet.h b/src/dsdv/model/dsdv-packet.h index 6158d1107..e6c493317 100644 --- a/src/dsdv/model/dsdv-packet.h +++ b/src/dsdv/model/dsdv-packet.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/model/dsdv-routing-protocol.cc b/src/dsdv/model/dsdv-routing-protocol.cc index 0a693588e..56852453a 100644 --- a/src/dsdv/model/dsdv-routing-protocol.cc +++ b/src/dsdv/model/dsdv-routing-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra, Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * Author: Yufei Cheng diff --git a/src/dsdv/model/dsdv-routing-protocol.h b/src/dsdv/model/dsdv-routing-protocol.h index 3af825297..fb51969d8 100644 --- a/src/dsdv/model/dsdv-routing-protocol.h +++ b/src/dsdv/model/dsdv-routing-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra, Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * Author: Yufei Cheng diff --git a/src/dsdv/model/dsdv-rtable.cc b/src/dsdv/model/dsdv-rtable.cc index 5e1a58e64..006287aec 100644 --- a/src/dsdv/model/dsdv-rtable.cc +++ b/src/dsdv/model/dsdv-rtable.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/model/dsdv-rtable.h b/src/dsdv/model/dsdv-rtable.h index e62bd06f1..c5045467a 100644 --- a/src/dsdv/model/dsdv-rtable.h +++ b/src/dsdv/model/dsdv-rtable.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsdv/test/dsdv-testcase.cc b/src/dsdv/test/dsdv-testcase.cc index 22a8d457a..417660c40 100644 --- a/src/dsdv/test/dsdv-testcase.cc +++ b/src/dsdv/test/dsdv-testcase.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hemanth Narra * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Hemanth Narra * diff --git a/src/dsr/doc/dsr.h b/src/dsr/doc/dsr.h index 2186fa3c0..2f75ba790 100644 --- a/src/dsr/doc/dsr.h +++ b/src/dsr/doc/dsr.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/examples/CMakeLists.txt b/src/dsr/examples/CMakeLists.txt index 0ec0132b5..6f980f3bf 100644 --- a/src/dsr/examples/CMakeLists.txt +++ b/src/dsr/examples/CMakeLists.txt @@ -1,6 +1,6 @@ build_lib_example( - NAME dsr - SOURCE_FILES dsr.cc + NAME dsr-example + SOURCE_FILES dsr-example.cc LIBRARIES_TO_LINK ${libcore} ${libnetwork} diff --git a/src/dsr/examples/dsr.cc b/src/dsr/examples/dsr-example.cc similarity index 92% rename from src/dsr/examples/dsr.cc rename to src/dsr/examples/dsr-example.cc index 7b20127dc..6c0f1811d 100644 --- a/src/dsr/examples/dsr.cc +++ b/src/dsr/examples/dsr-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/helper/dsr-helper.cc b/src/dsr/helper/dsr-helper.cc index d53da7875..54edd59cf 100644 --- a/src/dsr/helper/dsr-helper.cc +++ b/src/dsr/helper/dsr-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/helper/dsr-helper.h b/src/dsr/helper/dsr-helper.h index 13995b8e2..290dc6ce0 100644 --- a/src/dsr/helper/dsr-helper.h +++ b/src/dsr/helper/dsr-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/helper/dsr-main-helper.cc b/src/dsr/helper/dsr-main-helper.cc index abca309e1..8fce1d4ec 100644 --- a/src/dsr/helper/dsr-main-helper.cc +++ b/src/dsr/helper/dsr-main-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/helper/dsr-main-helper.h b/src/dsr/helper/dsr-main-helper.h index 12afe59db..ec59f6e09 100644 --- a/src/dsr/helper/dsr-main-helper.h +++ b/src/dsr/helper/dsr-main-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-errorbuff.cc b/src/dsr/model/dsr-errorbuff.cc index d5c3440bd..a966ecfdf 100644 --- a/src/dsr/model/dsr-errorbuff.cc +++ b/src/dsr/model/dsr-errorbuff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-errorbuff.h b/src/dsr/model/dsr-errorbuff.h index 20a8f6cab..aa7890e12 100644 --- a/src/dsr/model/dsr-errorbuff.h +++ b/src/dsr/model/dsr-errorbuff.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-fs-header.cc b/src/dsr/model/dsr-fs-header.cc index c04921676..5ac4b9027 100644 --- a/src/dsr/model/dsr-fs-header.cc +++ b/src/dsr/model/dsr-fs-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-fs-header.h b/src/dsr/model/dsr-fs-header.h index b166f7aac..8217a4dd9 100644 --- a/src/dsr/model/dsr-fs-header.h +++ b/src/dsr/model/dsr-fs-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-gratuitous-reply-table.cc b/src/dsr/model/dsr-gratuitous-reply-table.cc index a8ac5f504..61540dff9 100644 --- a/src/dsr/model/dsr-gratuitous-reply-table.cc +++ b/src/dsr/model/dsr-gratuitous-reply-table.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-gratuitous-reply-table.h b/src/dsr/model/dsr-gratuitous-reply-table.h index 6bf9b0329..490151934 100644 --- a/src/dsr/model/dsr-gratuitous-reply-table.h +++ b/src/dsr/model/dsr-gratuitous-reply-table.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-maintain-buff.cc b/src/dsr/model/dsr-maintain-buff.cc index f420c80d4..79d0aae7e 100644 --- a/src/dsr/model/dsr-maintain-buff.cc +++ b/src/dsr/model/dsr-maintain-buff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-maintain-buff.h b/src/dsr/model/dsr-maintain-buff.h index 2229c2de1..9aeaa2e87 100644 --- a/src/dsr/model/dsr-maintain-buff.h +++ b/src/dsr/model/dsr-maintain-buff.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-network-queue.cc b/src/dsr/model/dsr-network-queue.cc index f68d2f794..7a88e4e61 100644 --- a/src/dsr/model/dsr-network-queue.cc +++ b/src/dsr/model/dsr-network-queue.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-network-queue.h b/src/dsr/model/dsr-network-queue.h index e389fcfd4..0752af77d 100644 --- a/src/dsr/model/dsr-network-queue.h +++ b/src/dsr/model/dsr-network-queue.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-option-header.cc b/src/dsr/model/dsr-option-header.cc index fbfb85826..b650d0e73 100644 --- a/src/dsr/model/dsr-option-header.cc +++ b/src/dsr/model/dsr-option-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-option-header.h b/src/dsr/model/dsr-option-header.h index 0e49503d0..85b2968a6 100644 --- a/src/dsr/model/dsr-option-header.h +++ b/src/dsr/model/dsr-option-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * @@ -46,15 +35,15 @@ class Time; namespace dsr { /** - * \class DsrOptionHeader - * \brief Header for Dsr Options. + * \ingroup dsr + * \brief header for Dsr Options. */ class DsrOptionHeader : public Header { public: /** * \struct Alignment - * \brief represents the alignment requirements of an option header + * \brief Represents the alignment requirements of an option header */ struct Alignment { @@ -146,7 +135,7 @@ class DsrOptionHeader : public Header }; /** - * \class DsrOptionPad1Header + * \ingroup dsr * \brief Header of Dsr Option Pad1 */ class DsrOptionPad1Header : public DsrOptionHeader @@ -194,7 +183,7 @@ class DsrOptionPad1Header : public DsrOptionHeader }; /** - * \class DsrOptionPadnHeader + * \ingroup dsr * \brief Header of Dsr Option Padn */ class DsrOptionPadnHeader : public DsrOptionHeader @@ -243,18 +232,16 @@ class DsrOptionPadnHeader : public DsrOptionHeader }; /** - * \class DsrOptionRouteRequestHeader + * \ingroup dsr * \brief Header of Dsr Option Route Request - */ + * + * \verbatim + Route Request (RREQ) Message Format -/** -* \ingroup dsr -* \brief Route Request (RREQ) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Option Type | Opt Data Len | Identification | + | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -266,9 +253,8 @@ class DsrOptionPadnHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - + \endverbatim + */ class DsrOptionRreqHeader : public DsrOptionHeader { public: @@ -398,14 +384,12 @@ class DsrOptionRreqHeader : public DsrOptionHeader }; /** - * \class DsrOptionRrepHeader + * \ingroup dsr * \brief Header of Dsr Option Route Reply - */ + * + * \verbatim + Standard Route Reply (RREP) Message Format -/** -* \ingroup dsr -* \brief Route Reply (RREP) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -419,14 +403,13 @@ class DsrOptionRreqHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ + \endverbatim + * + * The Route Reply header modified for ns-3 implementation: + * + * \verbatim + ns-3 Route Reply (RREP) Message Format -// The Route Reply header modified for ns-3 implementation -/** -* \ingroup dsr -* \brief Route Reply (RREP) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -440,9 +423,8 @@ class DsrOptionRreqHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - + \endverbatim + */ class DsrOptionRrepHeader : public DsrOptionHeader { public: @@ -530,7 +512,7 @@ class DsrOptionRrepHeader : public DsrOptionHeader */ Ipv4Address m_address; /** - * \brief type def A vector of IPv4 Address. + * \brief typedef for a vector of IPv4 Addresses. */ typedef std::vector VectorIpv4Address_t; /** @@ -540,14 +522,12 @@ class DsrOptionRrepHeader : public DsrOptionHeader }; /** - * \class DsrOptionSRHeader + * \ingroup dsr * \brief Header of Dsr Option Source Route - */ + * + * \verbatim + Source Route (SR) Message Format -/** -* \ingroup dsr -* \brief Source Route (SR) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -561,9 +541,8 @@ class DsrOptionRrepHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - + \endverbatim + */ class DsrOptionSRHeader : public DsrOptionHeader { public: @@ -695,14 +674,24 @@ class DsrOptionSRHeader : public DsrOptionHeader }; /** - * \class DsrOptionRerrHeader - * \brief Header of Dsr Option Route Error + * \ingroup dsr + * \enum ErrorType + * \brief Error type used in several DSR Option Headers */ +enum ErrorType +{ + NODE_UNREACHABLE = 1, // !< NODE_UNREACHABLE + FLOW_STATE_NOT_SUPPORTED = 2, // !< FLOW_STATE_NOT_SUPPORTED + OPTION_NOT_SUPPORTED = 3, // !< OPTION_NOT_SUPPORTED +}; /** -* \ingroup dsr -* \brief Route Error (RERR) Message Format - \verbatim + * \ingroup dsr + * \brief Header of Dsr Option Route Error + * + * \verbatim + Route Error (RERR) Message Format + | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -716,17 +705,11 @@ class DsrOptionSRHeader : public DsrOptionHeader . Type-Specific Information . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - -/// Error type -enum ErrorType -{ - NODE_UNREACHABLE = 1, // !< NODE_UNREACHABLE - FLOW_STATE_NOT_SUPPORTED = 2, // !< FLOW_STATE_NOT_SUPPORTED - OPTION_NOT_SUPPORTED = 3, // !< OPTION_NOT_SUPPORTED -}; - + \endverbatim + * + * The type-specific information field varies by type of error, + * as detailed in the derived classes. + */ class DsrOptionRerrHeader : public DsrOptionHeader { public: @@ -843,27 +826,12 @@ class DsrOptionRerrHeader : public DsrOptionHeader }; /** -* \ingroup dsr -* \brief Route Error (RERR) Unreachable node address option Message Format - \verbatim - | 0 | 1 | 2 | 3 | - 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Option Type | Opt Data Len | Error Type |Reservd| Salvage| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Error Source Address | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Error Destination Address | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - . . - . Type-Specific Information . - . . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ -/* - * \brief The type-specific info field + * \ingroup dsr + * \brief Route Error (RERR) Unreachable node address option Message Format + * * \verbatim + Route Error Unreachable type-specific info field + | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -871,7 +839,6 @@ class DsrOptionRerrHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \endverbatim */ - class DsrOptionRerrUnreachHeader : public DsrOptionRerrHeader { public: @@ -998,28 +965,14 @@ class DsrOptionRerrUnreachHeader : public DsrOptionRerrHeader }; /** -* \ingroup dsr -* \brief Route Error (RERR) Unsupported option Message Format - \verbatim - | 0 | 1 | 2 | 3 | - 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Option Type | Opt Data Len | Error Type |Reservd| Salvage| - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Error Source Address | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Error Destination Address | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - . . - . Type-Specific Information . - . . - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ -/* - * \brief The type-specific info field - * \unsupported option + * \ingroup dsr + * \brief Route Error (RERR) Unsupported option Message Format + * + * The type-specific info field of DsrOptionRerrHeader contains + * * \verbatim + Route Error Unsupported type-specific info field + | 0 | 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ @@ -1027,7 +980,6 @@ class DsrOptionRerrUnreachHeader : public DsrOptionRerrHeader +-+-+-+-+-+-+-+-+ \endverbatim */ - class DsrOptionRerrUnsupportedHeader : public DsrOptionRerrHeader { public: @@ -1140,22 +1092,19 @@ class DsrOptionRerrUnsupportedHeader : public DsrOptionRerrHeader }; /** - * \class DsrOptionAckReqHeader + * \ingroup dsr * \brief Header of Dsr Option ack request - */ + * + * \verbatim + Acknowledgement Request (ACK_RREQ) Message Format -/** -* \ingroup dsr -* \brief Acknowledgement Request (ACK_RREQ) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - + \endverbatim + */ class DsrOptionAckReqHeader : public DsrOptionHeader { public: @@ -1222,14 +1171,12 @@ class DsrOptionAckReqHeader : public DsrOptionHeader }; /** - * \class DsrOptionAckHeader + * \ingroup dsr * \brief Header of Dsr Option ack - */ + * + * \verbatim + Acknowledgement (ACK) Message Format -/** -* \ingroup dsr -* \brief Acknowledgement (ACK) Message Format - \verbatim | 0 | 1 | 2 | 3 | 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -1239,9 +1186,8 @@ class DsrOptionAckReqHeader : public DsrOptionHeader +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - \endverbatim -*/ - + \endverbatim + */ class DsrOptionAckHeader : public DsrOptionHeader { public: @@ -1322,15 +1268,15 @@ class DsrOptionAckHeader : public DsrOptionHeader private: /** - * \brief identification field + * \brief Identification field */ uint16_t m_identification; /** - * \brief ack source address + * \brief Ack source address */ Ipv4Address m_realSrcAddress; /** - * \brief ack destination address + * \brief Ack destination address */ Ipv4Address m_realDstAddress; }; diff --git a/src/dsr/model/dsr-options.cc b/src/dsr/model/dsr-options.cc index c1f2edea6..2d547256a 100644 --- a/src/dsr/model/dsr-options.cc +++ b/src/dsr/model/dsr-options.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-options.h b/src/dsr/model/dsr-options.h index 3b32034be..55a07f042 100644 --- a/src/dsr/model/dsr-options.h +++ b/src/dsr/model/dsr-options.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-passive-buff.cc b/src/dsr/model/dsr-passive-buff.cc index 781c8d279..56299422f 100644 --- a/src/dsr/model/dsr-passive-buff.cc +++ b/src/dsr/model/dsr-passive-buff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-passive-buff.h b/src/dsr/model/dsr-passive-buff.h index 55c1a95fc..2a5169148 100644 --- a/src/dsr/model/dsr-passive-buff.h +++ b/src/dsr/model/dsr-passive-buff.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-rcache.cc b/src/dsr/model/dsr-rcache.cc index 774721aa6..03ef3492d 100644 --- a/src/dsr/model/dsr-rcache.cc +++ b/src/dsr/model/dsr-rcache.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * Song Luan (Implemented Link Cache using Dijsktra diff --git a/src/dsr/model/dsr-rcache.h b/src/dsr/model/dsr-rcache.h index 9401e1f82..6359ca96f 100644 --- a/src/dsr/model/dsr-rcache.h +++ b/src/dsr/model/dsr-rcache.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * Song Luan (Implemented Link Cache using dijsktra algorithm diff --git a/src/dsr/model/dsr-routing.cc b/src/dsr/model/dsr-routing.cc index a0b230c6f..b8b21315f 100644 --- a/src/dsr/model/dsr-routing.cc +++ b/src/dsr/model/dsr-routing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-routing.h b/src/dsr/model/dsr-routing.h index 0b11ac889..52aaa7a5a 100644 --- a/src/dsr/model/dsr-routing.h +++ b/src/dsr/model/dsr-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-rreq-table.cc b/src/dsr/model/dsr-rreq-table.cc index e3568b211..482ea6626 100644 --- a/src/dsr/model/dsr-rreq-table.cc +++ b/src/dsr/model/dsr-rreq-table.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-rreq-table.h b/src/dsr/model/dsr-rreq-table.h index e4fe2ed0a..c47d806a5 100644 --- a/src/dsr/model/dsr-rreq-table.h +++ b/src/dsr/model/dsr-rreq-table.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-rsendbuff.cc b/src/dsr/model/dsr-rsendbuff.cc index 109624458..fd773895d 100644 --- a/src/dsr/model/dsr-rsendbuff.cc +++ b/src/dsr/model/dsr-rsendbuff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/model/dsr-rsendbuff.h b/src/dsr/model/dsr-rsendbuff.h index dcec110ed..095d6e058 100644 --- a/src/dsr/model/dsr-rsendbuff.h +++ b/src/dsr/model/dsr-rsendbuff.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/dsr/test/dsr-test-suite.cc b/src/dsr/test/dsr-test-suite.cc index f469372eb..bbf85ed00 100644 --- a/src/dsr/test/dsr-test-suite.cc +++ b/src/dsr/test/dsr-test-suite.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Yufei Cheng * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Yufei Cheng * diff --git a/src/energy/doc/energy.rst b/src/energy/doc/energy.rst index ea2daf140..320efd772 100644 --- a/src/energy/doc/energy.rst +++ b/src/energy/doc/energy.rst @@ -3,7 +3,7 @@ .. highlight:: bash Energy Framework ----------------- +================ Energy is a key issue for wireless devices, and network researchers often need to investigate the energy consumption at a node or in the @@ -16,9 +16,6 @@ simulations requires support for modeling diverse energy models in ns-3. The |ns3| energy framework provides the basis for energy storing consumption and harvesting. - -Model Description -***************** The framework is implemented into the ``src/energy/`` folder. The |ns3| energy framework is composed of 3 essential parts: @@ -37,7 +34,7 @@ The |ns3| energy framework is composed of 3 essential parts: Energy Source Models -==================== +-------------------- An energy source represents a power supply. In |ns3|, nodes can have one or more energy sources. Likewise, energy sources can be @@ -68,7 +65,7 @@ Harvester update triggers an update to the connected Energy Source. The ``EnergySource`` base class keeps a list of devices (``DeviceEnergyModel`` objects) and energy harvesters (``EnergyHarvester`` objects) that are using the particular Energy Source as power supply. When energy is completely drained, the Energy Source will notify all devices on this list. Each device can then handle this event independently, based on the desired behavior that should be followed in case of power outage. Generic Battery Model -##################### +~~~~~~~~~~~~~~~~~~~~~ The Generic battery model is able to represent 4 basic types of batteries chemistries: Lithium-Ion (LiIon) or Lithium Polymer (LiPo), Nickel Cadmium (NiCd), @@ -134,7 +131,7 @@ batteries using helpers. Details on helpers usage are detailed in the following RV Battery Model -################ +~~~~~~~~~~~~~~~~ Attributes: @@ -147,7 +144,7 @@ Attributes: * ``RvBatteryModelNumOfTerms``: The number of terms of the infinite sum for estimating battery level. Basic Energy Source -################### +~~~~~~~~~~~~~~~~~~~ Attributes: @@ -158,7 +155,7 @@ Attributes: Energy Consumption Models -========================= +------------------------- A ``DeviceEnergyModel`` is the energy consumption model of a device installed on the node. It is designed to be a state based model where each device is assumed to have a number of states, and each state is associated with a power consumption value. @@ -169,7 +166,7 @@ Since the vehicle's speed can take continuous values within a certain range, it However, by converting the speed value into current draw directly, the same set of ``DeviceEnergyModel`` APIs can still be used. WiFi Radio Energy Model -####################### +~~~~~~~~~~~~~~~~~~~~~~~ The WiFi Radio Energy Model is the energy consumption model of a Wifi net device. It provides a state for each of the available states of @@ -219,7 +216,7 @@ Attributes * ``TxCurrentModel``: A pointer to the attached tx current model. Energy Harvesting Models -======================== +------------------------ The energy harvester represents the elements that supply energy from the environment and recharge an energy source to which it is @@ -233,7 +230,7 @@ power consumption of the device needs to be jointly modeled. Usage -***** +----- The main way that ns-3 users will typically interact with the Energy Framework is through the helper API and through the publicly visible @@ -260,7 +257,7 @@ regarding the current harvestable power and the total energy harvested by the harvester. Helpers -======= +~~~~~~~ **Energy Source Helper:** @@ -344,7 +341,7 @@ The following table is a list of the available presents in |ns3|: Tracing -======= +~~~~~~~ Traced values differ between Energy Sources, Devices Energy Models and Energy Harvesters implementations, please look at the specific child @@ -369,7 +366,7 @@ class for details. * ``TotalEnergyHarvested``: Total energy harvested by the BasicEnergyHarvester. Examples -======== +~~~~~~~~ The following examples have been written. @@ -388,12 +385,15 @@ Examples in ``examples/energy``: Tests -===== +~~~~~ The following tests have been written, which can be found in ``src/energy/tests/``: +* ``basic-energy-harvester-test.cc``: Test energy harvester procedure +* ``li-ion-energy-source-test.cc``: Test the procedure of the li-ion energy source (Deprecated). Use generic-battery-model instead. + Validation -********** +---------- The RV battery model is validated by comparing results with what was presented in the original RV battery model paper. The generic battery model is validated by superimposing the obtained discharge curves with manufacturer's datasheets plots. The following shows the results of the ``generic-battery-discharge-example.cc`` superimposed to manufacturer's datasheets charts: @@ -425,7 +425,7 @@ The RV battery model is validated by comparing results with what was presented i Scope and Limitations -===================== +--------------------- * In the ``GenericBatteryModel`` charging behavior (voltage as a function of SoC) is included but is not been thoroughly tested. Testing requires the implementation of a harvesting device (A charger) capable of providing a CCCV charging method typically used in batteries. * In the ``GenericBatteryModel`` impedance (battery resistance) is constant, battery aging or temperature effects are not considered. @@ -433,7 +433,7 @@ Scope and Limitations * The harvesting mode can only be used with basic energy sources because it does not consider the current capacity or voltage of the battery. Future Work -=========== +----------- * Support of device energy models for PHY layers (lr-wpan, WiMax, etc) and other pieces of hardware (UAV, sensors, CPU). * Support for realistic charging batteries in the ``GenericBatteryModule``. @@ -441,7 +441,7 @@ Future Work * Implement an energy harvester that recharges the energy sources according to the power levels defined in a user customizable dataset of real measurements. References -========== +---------- Energy source models and energy consumption models: diff --git a/src/energy/examples/basic-energy-model-test.cc b/src/energy/examples/basic-energy-model-test.cc index c19186f1d..ae33499bf 100644 --- a/src/energy/examples/basic-energy-model-test.cc +++ b/src/energy/examples/basic-energy-model-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: He Wu */ diff --git a/src/energy/examples/generic-battery-discharge-example.cc b/src/energy/examples/generic-battery-discharge-example.cc index 43473a8d8..5256d9726 100644 --- a/src/energy/examples/generic-battery-discharge-example.cc +++ b/src/energy/examples/generic-battery-discharge-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Tokushima University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alberto Gallegos Ramonet */ diff --git a/src/energy/examples/generic-battery-discharge-example.py b/src/energy/examples/generic-battery-discharge-example.py index 27aaf3968..991ab4f8d 100644 --- a/src/energy/examples/generic-battery-discharge-example.py +++ b/src/energy/examples/generic-battery-discharge-example.py @@ -1,17 +1,6 @@ # Copyright (c) 2023 Tokushima University # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Author: Alberto Gallegos Ramonet # diff --git a/src/energy/examples/generic-battery-wifiradio-example.cc b/src/energy/examples/generic-battery-wifiradio-example.cc index f4985c465..3963569e9 100644 --- a/src/energy/examples/generic-battery-wifiradio-example.cc +++ b/src/energy/examples/generic-battery-wifiradio-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Tokushima University, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alberto Gallegos Ramonet */ diff --git a/src/energy/examples/li-ion-energy-source-example.cc b/src/energy/examples/li-ion-energy-source-example.cc index d2d01b0d1..e02d4fdad 100644 --- a/src/energy/examples/li-ion-energy-source-example.cc +++ b/src/energy/examples/li-ion-energy-source-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ @@ -45,9 +34,19 @@ using namespace ns3::energy; * http://www.panasonic.com/industrial/includes/pdf/Panasonic_LiIon_CGR18650DA.pdf */ +// NS_DEPRECATED_3_43() - tag for future removal +// LiIonEnergySource was deprecated in commit +// https://gitlab.com/nsnam/ns-3-dev/-/commit/086913b0 +// +// The new battery model is illustrated in +// `src/energy/examples/generic-battery-discharge-example.cc` + +NS_WARNING_PUSH_DEPRECATED; + static void PrintCellInfo(Ptr es) { + NS_WARNING_POP; std::cout << "At " << Simulator::Now().As(Time::S) << " Cell voltage: " << es->GetSupplyVoltage() << " V Remaining Capacity: " << es->GetRemainingEnergy() / (3.6 * 3600) << " Ah" @@ -72,7 +71,9 @@ main(int argc, char** argv) Ptr sem = CreateObject(); Ptr esCont = CreateObject(); + NS_WARNING_PUSH_DEPRECATED; Ptr es = CreateObject(); + NS_WARNING_POP; esCont->Add(es); es->SetNode(node); sem->SetEnergySource(es); diff --git a/src/energy/examples/rv-battery-model-test.cc b/src/energy/examples/rv-battery-model-test.cc index fee226d5f..e05f774b8 100644 --- a/src/energy/examples/rv-battery-model-test.cc +++ b/src/energy/examples/rv-battery-model-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: He Wu */ diff --git a/src/energy/helper/basic-energy-harvester-helper.cc b/src/energy/helper/basic-energy-harvester-helper.cc index d311b2d5a..d5b7efdfe 100644 --- a/src/energy/helper/basic-energy-harvester-helper.cc +++ b/src/energy/helper/basic-energy-harvester-helper.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -27,7 +16,7 @@ namespace ns3 BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper() { - m_basicEnergyHarvester.SetTypeId("ns3::BasicEnergyHarvester"); + m_basicEnergyHarvester.SetTypeId("ns3::energy::BasicEnergyHarvester"); } BasicEnergyHarvesterHelper::~BasicEnergyHarvesterHelper() diff --git a/src/energy/helper/basic-energy-harvester-helper.h b/src/energy/helper/basic-energy-harvester-helper.h index da044a1eb..7ca9be019 100644 --- a/src/energy/helper/basic-energy-harvester-helper.h +++ b/src/energy/helper/basic-energy-harvester-helper.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/src/energy/helper/basic-energy-source-helper.cc b/src/energy/helper/basic-energy-source-helper.cc index e2efaf91c..636bdb679 100644 --- a/src/energy/helper/basic-energy-source-helper.cc +++ b/src/energy/helper/basic-energy-source-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -26,7 +15,7 @@ namespace ns3 BasicEnergySourceHelper::BasicEnergySourceHelper() { - m_basicEnergySource.SetTypeId("ns3::BasicEnergySource"); + m_basicEnergySource.SetTypeId("ns3::energy::BasicEnergySource"); } BasicEnergySourceHelper::~BasicEnergySourceHelper() diff --git a/src/energy/helper/basic-energy-source-helper.h b/src/energy/helper/basic-energy-source-helper.h index e9fa8d04a..e0fb8c8d3 100644 --- a/src/energy/helper/basic-energy-source-helper.h +++ b/src/energy/helper/basic-energy-source-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/helper/energy-harvester-container.cc b/src/energy/helper/energy-harvester-container.cc index 4eb57cbd4..c82bc029c 100644 --- a/src/energy/helper/energy-harvester-container.cc +++ b/src/energy/helper/energy-harvester-container.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -34,7 +23,8 @@ NS_OBJECT_ENSURE_REGISTERED(EnergyHarvesterContainer); TypeId EnergyHarvesterContainer::GetTypeId() { - static TypeId tid = TypeId("ns3::EnergyHarvesterContainer") + static TypeId tid = TypeId("ns3::energy::EnergyHarvesterContainer") + .AddDeprecatedName("ns3::EnergyHarvesterContainer") .SetParent() .SetGroupName("Energy") .AddConstructor(); diff --git a/src/energy/helper/energy-harvester-container.h b/src/energy/helper/energy-harvester-container.h index 3b40b0534..47f02bdf7 100644 --- a/src/energy/helper/energy-harvester-container.h +++ b/src/energy/helper/energy-harvester-container.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/src/energy/helper/energy-harvester-helper.cc b/src/energy/helper/energy-harvester-helper.cc index a8514746d..c8be95de6 100644 --- a/src/energy/helper/energy-harvester-helper.cc +++ b/src/energy/helper/energy-harvester-helper.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -57,7 +46,7 @@ EnergyHarvesterHelper::Install(energy::EnergySourceContainer sourceContainer) co if (!EnergyHarvesterContainerOnNode) { ObjectFactory fac; - fac.SetTypeId("ns3::EnergyHarvesterContainer"); + fac.SetTypeId("ns3::energy::EnergyHarvesterContainer"); EnergyHarvesterContainerOnNode = fac.Create(); EnergyHarvesterContainerOnNode->Add(harvester); node->AggregateObject(EnergyHarvesterContainerOnNode); diff --git a/src/energy/helper/energy-harvester-helper.h b/src/energy/helper/energy-harvester-helper.h index dbee2faf8..32330fa21 100644 --- a/src/energy/helper/energy-harvester-helper.h +++ b/src/energy/helper/energy-harvester-helper.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/src/energy/helper/energy-model-helper.cc b/src/energy/helper/energy-model-helper.cc index 48ae9bf63..f20f9c232 100644 --- a/src/energy/helper/energy-model-helper.cc +++ b/src/energy/helper/energy-model-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -55,7 +44,7 @@ EnergySourceHelper::Install(NodeContainer c) const if (!EnergySourceContainerOnNode) { ObjectFactory fac; - fac.SetTypeId("ns3::EnergySourceContainer"); + fac.SetTypeId("ns3::energy::EnergySourceContainer"); EnergySourceContainerOnNode = fac.Create(); EnergySourceContainerOnNode->Add(src); (*i)->AggregateObject(EnergySourceContainerOnNode); diff --git a/src/energy/helper/energy-model-helper.h b/src/energy/helper/energy-model-helper.h index 6442d83a2..d26b9e65a 100644 --- a/src/energy/helper/energy-model-helper.h +++ b/src/energy/helper/energy-model-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/helper/energy-source-container.cc b/src/energy/helper/energy-source-container.cc index d22e83edd..430c7fef2 100644 --- a/src/energy/helper/energy-source-container.cc +++ b/src/energy/helper/energy-source-container.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage * Sidharth Nabar , He Wu @@ -33,7 +22,8 @@ NS_OBJECT_ENSURE_REGISTERED(EnergySourceContainer); TypeId EnergySourceContainer::GetTypeId() { - static TypeId tid = TypeId("ns3::EnergySourceContainer") + static TypeId tid = TypeId("ns3::energy::EnergySourceContainer") + .AddDeprecatedName("ns3::EnergySourceContainer") .SetParent() .SetGroupName("Energy") .AddConstructor(); diff --git a/src/energy/helper/energy-source-container.h b/src/energy/helper/energy-source-container.h index 928e932aa..ae6b0d1aa 100644 --- a/src/energy/helper/energy-source-container.h +++ b/src/energy/helper/energy-source-container.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage * Sidharth Nabar , He Wu diff --git a/src/energy/helper/generic-battery-model-helper.cc b/src/energy/helper/generic-battery-model-helper.cc index 186cfbd0c..0c340fcaf 100644 --- a/src/energy/helper/generic-battery-model-helper.cc +++ b/src/energy/helper/generic-battery-model-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Tokushima University, Japan. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Alberto Gallegos Ramonet */ @@ -24,7 +13,7 @@ namespace ns3 GenericBatteryModelHelper::GenericBatteryModelHelper() { - m_batteryModel.SetTypeId("ns3::GenericBatteryModel"); + m_batteryModel.SetTypeId("ns3::energy::GenericBatteryModel"); } GenericBatteryModelHelper::~GenericBatteryModelHelper() diff --git a/src/energy/helper/generic-battery-model-helper.h b/src/energy/helper/generic-battery-model-helper.h index 5370724e6..ef69bae8e 100644 --- a/src/energy/helper/generic-battery-model-helper.h +++ b/src/energy/helper/generic-battery-model-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2023 Tokushima University, Japan. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Alberto Gallegos Ramonet */ diff --git a/src/energy/helper/li-ion-energy-source-helper.cc b/src/energy/helper/li-ion-energy-source-helper.cc index ddad6caa1..0b979d8d6 100644 --- a/src/energy/helper/li-ion-energy-source-helper.cc +++ b/src/energy/helper/li-ion-energy-source-helper.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hoda Ayatollahi * Cristiano Tapparello @@ -28,7 +17,7 @@ namespace ns3 LiIonEnergySourceHelper::LiIonEnergySourceHelper() { - m_liIonEnergySource.SetTypeId("ns3::LiIonEnergySource"); + m_liIonEnergySource.SetTypeId("ns3::energy::LiIonEnergySource"); } LiIonEnergySourceHelper::~LiIonEnergySourceHelper() diff --git a/src/energy/helper/li-ion-energy-source-helper.h b/src/energy/helper/li-ion-energy-source-helper.h index 31af7dc3f..11340650a 100644 --- a/src/energy/helper/li-ion-energy-source-helper.h +++ b/src/energy/helper/li-ion-energy-source-helper.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hoda Ayatollahi * Cristiano Tapparello diff --git a/src/energy/helper/rv-battery-model-helper.cc b/src/energy/helper/rv-battery-model-helper.cc index b1ce17841..c0c93f211 100644 --- a/src/energy/helper/rv-battery-model-helper.cc +++ b/src/energy/helper/rv-battery-model-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -26,7 +15,7 @@ namespace ns3 RvBatteryModelHelper::RvBatteryModelHelper() { - m_rvBatteryModel.SetTypeId("ns3::RvBatteryModel"); + m_rvBatteryModel.SetTypeId("ns3::energy::RvBatteryModel"); } RvBatteryModelHelper::~RvBatteryModelHelper() diff --git a/src/energy/helper/rv-battery-model-helper.h b/src/energy/helper/rv-battery-model-helper.h index d7ac398ed..c2d43f8cc 100644 --- a/src/energy/helper/rv-battery-model-helper.h +++ b/src/energy/helper/rv-battery-model-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/model/basic-energy-harvester.cc b/src/energy/model/basic-energy-harvester.cc index f49f9d563..f2e86c537 100644 --- a/src/energy/model/basic-energy-harvester.cc +++ b/src/energy/model/basic-energy-harvester.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -39,7 +28,8 @@ TypeId BasicEnergyHarvester::GetTypeId() { static TypeId tid = - TypeId("ns3::BasicEnergyHarvester") + TypeId("ns3::energy::BasicEnergyHarvester") + .AddDeprecatedName("ns3::BasicEnergyHarvester") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/basic-energy-harvester.h b/src/energy/model/basic-energy-harvester.h index a5d1e41ee..77a4d32ac 100644 --- a/src/energy/model/basic-energy-harvester.h +++ b/src/energy/model/basic-energy-harvester.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/src/energy/model/basic-energy-source.cc b/src/energy/model/basic-energy-source.cc index 51f233036..9b5ba7c11 100644 --- a/src/energy/model/basic-energy-source.cc +++ b/src/energy/model/basic-energy-source.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -37,7 +26,8 @@ TypeId BasicEnergySource::GetTypeId() { static TypeId tid = - TypeId("ns3::BasicEnergySource") + TypeId("ns3::energy::BasicEnergySource") + .AddDeprecatedName("ns3::BasicEnergySource") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/basic-energy-source.h b/src/energy/model/basic-energy-source.h index 0d59d39ff..0fb9f7ed1 100644 --- a/src/energy/model/basic-energy-source.h +++ b/src/energy/model/basic-energy-source.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/model/device-energy-model-container.cc b/src/energy/model/device-energy-model-container.cc index e79085f4b..5eb2ed5a8 100644 --- a/src/energy/model/device-energy-model-container.cc +++ b/src/energy/model/device-energy-model-container.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage * Sidharth Nabar , He Wu diff --git a/src/energy/model/device-energy-model-container.h b/src/energy/model/device-energy-model-container.h index 0a8f7f8d6..934a71156 100644 --- a/src/energy/model/device-energy-model-container.h +++ b/src/energy/model/device-energy-model-container.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 INRIA * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Mathieu Lacage * Sidharth Nabar , He Wu diff --git a/src/energy/model/device-energy-model.cc b/src/energy/model/device-energy-model.cc index abdf71f26..9b128826a 100644 --- a/src/energy/model/device-energy-model.cc +++ b/src/energy/model/device-energy-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -32,7 +21,10 @@ NS_OBJECT_ENSURE_REGISTERED(DeviceEnergyModel); TypeId DeviceEnergyModel::GetTypeId() { - static TypeId tid = TypeId("ns3::DeviceEnergyModel").SetParent().SetGroupName("Energy"); + static TypeId tid = TypeId("ns3::energy::DeviceEnergyModel") + .AddDeprecatedName("ns3::DeviceEnergyModel") + .SetParent() + .SetGroupName("Energy"); return tid; } diff --git a/src/energy/model/device-energy-model.h b/src/energy/model/device-energy-model.h index 4bb625cb3..df372a995 100644 --- a/src/energy/model/device-energy-model.h +++ b/src/energy/model/device-energy-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/model/energy-harvester.cc b/src/energy/model/energy-harvester.cc index b93f713c0..bd633e19e 100644 --- a/src/energy/model/energy-harvester.cc +++ b/src/energy/model/energy-harvester.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -33,7 +22,10 @@ NS_OBJECT_ENSURE_REGISTERED(EnergyHarvester); TypeId EnergyHarvester::GetTypeId() { - static TypeId tid = TypeId("ns3::EnergyHarvester").SetParent().SetGroupName("Energy"); + static TypeId tid = TypeId("ns3::energy::EnergyHarvester") + .AddDeprecatedName("ns3::EnergyHarvester") + .SetParent() + .SetGroupName("Energy"); return tid; } diff --git a/src/energy/model/energy-harvester.h b/src/energy/model/energy-harvester.h index 2c8ae416a..ad5a6ac7f 100644 --- a/src/energy/model/energy-harvester.h +++ b/src/energy/model/energy-harvester.h @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ diff --git a/src/energy/model/energy-source.cc b/src/energy/model/energy-source.cc index e64d60e11..4c69c9be8 100644 --- a/src/energy/model/energy-source.cc +++ b/src/energy/model/energy-source.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sidharth Nabar , He Wu * @@ -37,7 +26,10 @@ NS_OBJECT_ENSURE_REGISTERED(EnergySource); TypeId EnergySource::GetTypeId() { - static TypeId tid = TypeId("ns3::EnergySource").SetParent().SetGroupName("Energy"); + static TypeId tid = TypeId("ns3::energy::EnergySource") + .AddDeprecatedName("ns3::EnergySource") + .SetParent() + .SetGroupName("Energy"); return tid; } diff --git a/src/energy/model/energy-source.h b/src/energy/model/energy-source.h index 316ced095..4b21e1fb8 100644 --- a/src/energy/model/energy-source.h +++ b/src/energy/model/energy-source.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu * diff --git a/src/energy/model/generic-battery-model.cc b/src/energy/model/generic-battery-model.cc index 628181ed7..0c7fe3bb7 100644 --- a/src/energy/model/generic-battery-model.cc +++ b/src/energy/model/generic-battery-model.cc @@ -3,18 +3,7 @@ * Copyright (c) 2023 Tokushima University, Japan: * NiMh,NiCd,LeaAcid batteries and preset and multicell extensions. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco * Alberto Gallegos Ramonet @@ -42,7 +31,8 @@ TypeId GenericBatteryModel::GetTypeId() { static TypeId tid = - TypeId("ns3::GenericBatteryModel") + TypeId("ns3::energy::GenericBatteryModel") + .AddDeprecatedName("ns3::GenericBatteryModel") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/generic-battery-model.h b/src/energy/model/generic-battery-model.h index 6b922a554..3d1864415 100644 --- a/src/energy/model/generic-battery-model.h +++ b/src/energy/model/generic-battery-model.h @@ -3,18 +3,7 @@ * Copyright (c) 2023 Tokushima University, Japan: * NiMh,NiCd,LeaAcid batteries and preset and multi-cell extensions. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco * Alberto Gallegos Ramonet diff --git a/src/energy/model/li-ion-energy-source.cc b/src/energy/model/li-ion-energy-source.cc index 2d201a5c6..27c69fe7d 100644 --- a/src/energy/model/li-ion-energy-source.cc +++ b/src/energy/model/li-ion-energy-source.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ @@ -39,7 +28,8 @@ TypeId LiIonEnergySource::GetTypeId() { static TypeId tid = - TypeId("ns3::LiIonEnergySource") + TypeId("ns3::energy::LiIonEnergySource") + .AddDeprecatedName("ns3::LiIonEnergySource") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/li-ion-energy-source.h b/src/energy/model/li-ion-energy-source.h index d54b2a015..36b7ec79b 100644 --- a/src/energy/model/li-ion-energy-source.h +++ b/src/energy/model/li-ion-energy-source.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ @@ -36,9 +25,6 @@ namespace energy * \ingroup energy * \brief Model a generic Lithium Ion Battery basing on [1][2]. * - * \deprecated The LiIonEnergySource was deprecated in ns-3.40 in favor of GenericBatteryModel, and - * will be removed in a future release. - * * The model can be fitted to any type of Li-Ion Battery, simply changing the * model parameters. * The default values are fitted for the Panasonic CGR18650DA Li-Ion Battery [3]. @@ -76,9 +62,15 @@ namespace energy * Generic Battery Model for the Dynamic Simulation of Hybrid Electric Vehicles," Ecole de * Technologie Superieure, Universite du Quebec, 2007 [3] * http://www.panasonic.com/industrial/includes/pdf/Panasonic_LiIon_CGR18650DA.pdf - * + */ -class LiIonEnergySource : public EnergySource +// clang-format off +class +NS_DEPRECATED_3_40("The LiIonEnergySource was deprecated in ns-3.40 " + "in favor of GenericBatteryModel, and will be removed " + "in a future release.") +LiIonEnergySource : public EnergySource +// clang-format on { public: /** diff --git a/src/energy/model/rv-battery-model.cc b/src/energy/model/rv-battery-model.cc index 7ece15129..444f4ca87 100644 --- a/src/energy/model/rv-battery-model.cc +++ b/src/energy/model/rv-battery-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ @@ -39,7 +28,8 @@ TypeId RvBatteryModel::GetTypeId() { static TypeId tid = - TypeId("ns3::RvBatteryModel") + TypeId("ns3::energy::RvBatteryModel") + .AddDeprecatedName("ns3::RvBatteryModel") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/rv-battery-model.h b/src/energy/model/rv-battery-model.h index 7eb8bc946..e944cc009 100644 --- a/src/energy/model/rv-battery-model.h +++ b/src/energy/model/rv-battery-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Sidharth Nabar , He Wu */ diff --git a/src/energy/model/simple-device-energy-model.cc b/src/energy/model/simple-device-energy-model.cc index 515742b65..0a89dd5d0 100644 --- a/src/energy/model/simple-device-energy-model.cc +++ b/src/energy/model/simple-device-energy-model.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ @@ -36,7 +25,8 @@ NS_OBJECT_ENSURE_REGISTERED(SimpleDeviceEnergyModel); TypeId SimpleDeviceEnergyModel::GetTypeId() { - static TypeId tid = TypeId("ns3::SimpleDeviceEnergyModel") + static TypeId tid = TypeId("ns3::energy::SimpleDeviceEnergyModel") + .AddDeprecatedName("ns3::SimpleDeviceEnergyModel") .SetParent() .SetGroupName("Energy") .AddConstructor() diff --git a/src/energy/model/simple-device-energy-model.h b/src/energy/model/simple-device-energy-model.h index 2994ceeb7..ff3667ed8 100644 --- a/src/energy/model/simple-device-energy-model.h +++ b/src/energy/model/simple-device-energy-model.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ diff --git a/src/energy/test/basic-energy-harvester-test.cc b/src/energy/test/basic-energy-harvester-test.cc index e6b92efe2..28cb8a416 100644 --- a/src/energy/test/basic-energy-harvester-test.cc +++ b/src/energy/test/basic-energy-harvester-test.cc @@ -2,18 +2,7 @@ * Copyright (c) 2014 Wireless Communications and Networking Group (WCNG), * University of Rochester, Rochester, NY, USA. * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Cristiano Tapparello */ @@ -68,8 +57,8 @@ void BasicEnergyHarvesterTestCase::DoRun() { // set types - m_energySource.SetTypeId("ns3::BasicEnergySource"); - m_energyHarvester.SetTypeId("ns3::BasicEnergyHarvester"); + m_energySource.SetTypeId("ns3::energy::BasicEnergySource"); + m_energyHarvester.SetTypeId("ns3::energy::BasicEnergyHarvester"); // create node Ptr node = CreateObject(); diff --git a/src/energy/test/li-ion-energy-source-test.cc b/src/energy/test/li-ion-energy-source-test.cc index e70f4cbac..78322ed73 100644 --- a/src/energy/test/li-ion-energy-source-test.cc +++ b/src/energy/test/li-ion-energy-source-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Andrea Sacco * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Andrea Sacco */ @@ -27,6 +16,18 @@ using namespace ns3; using namespace ns3::energy; +// NS_DEPRECATED_3_43() - tag for future removal +// LiIonEnergySource was deprecated in commit +// https://gitlab.com/nsnam/ns-3-dev/-/commit/086913b0 +// +// The new battery model is illustrated in +// `src/energy/examples/generic-battery-discharge-example.cc` +// +// A GenericBatteryModelTestCase is being developed in MR 2181 +// https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/2181 +// which will be in +// `src/energy/test/generic-battery-model-test.cc` + NS_LOG_COMPONENT_DEFINE("LiIonEnergySourceTestSuite"); /** @@ -61,7 +62,10 @@ LiIonEnergyTestCase::DoRun() m_node = CreateObject(); Ptr sem = CreateObject(); + + NS_WARNING_PUSH_DEPRECATED; Ptr es = CreateObject(); + NS_WARNING_POP; es->SetNode(m_node); sem->SetEnergySource(es); diff --git a/src/fd-net-device/examples/dummy-network.cc b/src/fd-net-device/examples/dummy-network.cc index bae9c1983..b0a5132f6 100644 --- a/src/fd-net-device/examples/dummy-network.cc +++ b/src/fd-net-device/examples/dummy-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/fd-net-device/examples/fd-emu-onoff.cc b/src/fd-net-device/examples/fd-emu-onoff.cc index e28abcf19..adc192918 100644 --- a/src/fd-net-device/examples/fd-emu-onoff.cc +++ b/src/fd-net-device/examples/fd-emu-onoff.cc @@ -3,18 +3,7 @@ * 2017 Università' degli Studi di Napoli Federico II * 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * Extended by: Pasquale Imputato diff --git a/src/fd-net-device/examples/fd-emu-ping.cc b/src/fd-net-device/examples/fd-emu-ping.cc index f41b2a149..f17388a79 100644 --- a/src/fd-net-device/examples/fd-emu-ping.cc +++ b/src/fd-net-device/examples/fd-emu-ping.cc @@ -3,18 +3,7 @@ * 2017 Università' degli Studi di Napoli Federico II * 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Allow ns-3 to ping a real host somewhere, using emulation mode diff --git a/src/fd-net-device/examples/fd-emu-send.cc b/src/fd-net-device/examples/fd-emu-send.cc index cea8aa620..99a062511 100644 --- a/src/fd-net-device/examples/fd-emu-send.cc +++ b/src/fd-net-device/examples/fd-emu-send.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/fd-net-device/examples/fd-emu-tc.cc b/src/fd-net-device/examples/fd-emu-tc.cc index cab3aa7b3..1e9cfcd96 100644 --- a/src/fd-net-device/examples/fd-emu-tc.cc +++ b/src/fd-net-device/examples/fd-emu-tc.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/fd-net-device/examples/fd-emu-udp-echo.cc b/src/fd-net-device/examples/fd-emu-udp-echo.cc index 0fd6cf7dc..6c2fc411e 100644 --- a/src/fd-net-device/examples/fd-emu-udp-echo.cc +++ b/src/fd-net-device/examples/fd-emu-udp-echo.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Network topology diff --git a/src/fd-net-device/examples/fd-tap-ping.cc b/src/fd-net-device/examples/fd-tap-ping.cc index d94a69424..dd472b44a 100644 --- a/src/fd-net-device/examples/fd-tap-ping.cc +++ b/src/fd-net-device/examples/fd-tap-ping.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Allow ns-3 to ping a real host somewhere, using emulation mode and ping diff --git a/src/fd-net-device/examples/fd-tap-ping6.cc b/src/fd-net-device/examples/fd-tap-ping6.cc index c0fd4f217..6dadcbf49 100644 --- a/src/fd-net-device/examples/fd-tap-ping6.cc +++ b/src/fd-net-device/examples/fd-tap-ping6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ // Allow ns-3 to ping a TAP device in the host machine. diff --git a/src/fd-net-device/examples/fd2fd-onoff.cc b/src/fd-net-device/examples/fd2fd-onoff.cc index fbd222ef8..e603a9d4e 100644 --- a/src/fd-net-device/examples/fd2fd-onoff.cc +++ b/src/fd-net-device/examples/fd2fd-onoff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * diff --git a/src/fd-net-device/examples/realtime-dummy-network.cc b/src/fd-net-device/examples/realtime-dummy-network.cc index 20631f529..8a8d183ac 100644 --- a/src/fd-net-device/examples/realtime-dummy-network.cc +++ b/src/fd-net-device/examples/realtime-dummy-network.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/fd-net-device/examples/realtime-fd2fd-onoff.cc b/src/fd-net-device/examples/realtime-fd2fd-onoff.cc index 2d35cffaa..ba0de22cc 100644 --- a/src/fd-net-device/examples/realtime-fd2fd-onoff.cc +++ b/src/fd-net-device/examples/realtime-fd2fd-onoff.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 University of Washington, 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * diff --git a/src/fd-net-device/helper/creator-utils.cc b/src/fd-net-device/helper/creator-utils.cc index b7e5cb82c..73dad6aad 100644 --- a/src/fd-net-device/helper/creator-utils.cc +++ b/src/fd-net-device/helper/creator-utils.cc @@ -1,18 +1,7 @@ /* * Copyright (c) University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "creator-utils.h" diff --git a/src/fd-net-device/helper/creator-utils.h b/src/fd-net-device/helper/creator-utils.h index 8280181a5..c85fe4c69 100644 --- a/src/fd-net-device/helper/creator-utils.h +++ b/src/fd-net-device/helper/creator-utils.h @@ -1,18 +1,7 @@ /* * Copyright (c) University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef CREATOR_UTILS_H diff --git a/src/fd-net-device/helper/dpdk-net-device-helper.cc b/src/fd-net-device/helper/dpdk-net-device-helper.cc index 9b57768ec..7a9ec2419 100644 --- a/src/fd-net-device/helper/dpdk-net-device-helper.cc +++ b/src/fd-net-device/helper/dpdk-net-device-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Harsh Patel * Hrishikesh Hiraskar diff --git a/src/fd-net-device/helper/dpdk-net-device-helper.h b/src/fd-net-device/helper/dpdk-net-device-helper.h index b155327fd..ff070a92d 100644 --- a/src/fd-net-device/helper/dpdk-net-device-helper.h +++ b/src/fd-net-device/helper/dpdk-net-device-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2020 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Harsh Patel * Hrishikesh Hiraskar diff --git a/src/fd-net-device/helper/emu-fd-net-device-helper.cc b/src/fd-net-device/helper/emu-fd-net-device-helper.cc index 8bddf4908..e33abaee1 100644 --- a/src/fd-net-device/helper/emu-fd-net-device-helper.cc +++ b/src/fd-net-device/helper/emu-fd-net-device-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "emu-fd-net-device-helper.h" diff --git a/src/fd-net-device/helper/emu-fd-net-device-helper.h b/src/fd-net-device/helper/emu-fd-net-device-helper.h index 3a1453967..795abcf89 100644 --- a/src/fd-net-device/helper/emu-fd-net-device-helper.h +++ b/src/fd-net-device/helper/emu-fd-net-device-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/fd-net-device/helper/encode-decode.cc b/src/fd-net-device/helper/encode-decode.cc index e7be2e41c..af746603b 100644 --- a/src/fd-net-device/helper/encode-decode.cc +++ b/src/fd-net-device/helper/encode-decode.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include diff --git a/src/fd-net-device/helper/encode-decode.h b/src/fd-net-device/helper/encode-decode.h index 196d5b76d..d94e4b4b6 100644 --- a/src/fd-net-device/helper/encode-decode.h +++ b/src/fd-net-device/helper/encode-decode.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef ENCODE_DECODE_H diff --git a/src/fd-net-device/helper/fd-net-device-helper.cc b/src/fd-net-device/helper/fd-net-device-helper.cc index 8ea4b7093..1b9b2098c 100644 --- a/src/fd-net-device/helper/fd-net-device-helper.cc +++ b/src/fd-net-device/helper/fd-net-device-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * diff --git a/src/fd-net-device/helper/fd-net-device-helper.h b/src/fd-net-device/helper/fd-net-device-helper.h index 779a523c1..4476fd979 100644 --- a/src/fd-net-device/helper/fd-net-device-helper.h +++ b/src/fd-net-device/helper/fd-net-device-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * diff --git a/src/fd-net-device/helper/netmap-device-creator.cc b/src/fd-net-device/helper/netmap-device-creator.cc index e0e1fa368..178ce49b9 100644 --- a/src/fd-net-device/helper/netmap-device-creator.cc +++ b/src/fd-net-device/helper/netmap-device-creator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "creator-utils.h" diff --git a/src/fd-net-device/helper/netmap-net-device-helper.cc b/src/fd-net-device/helper/netmap-net-device-helper.cc index 65cdfdd7e..b8a66ae0e 100644 --- a/src/fd-net-device/helper/netmap-net-device-helper.cc +++ b/src/fd-net-device/helper/netmap-net-device-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/fd-net-device/helper/netmap-net-device-helper.h b/src/fd-net-device/helper/netmap-net-device-helper.h index 30a9ef89f..4dca7bc51 100644 --- a/src/fd-net-device/helper/netmap-net-device-helper.h +++ b/src/fd-net-device/helper/netmap-net-device-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/fd-net-device/helper/raw-sock-creator.cc b/src/fd-net-device/helper/raw-sock-creator.cc index 94593d49e..56c97d5df 100644 --- a/src/fd-net-device/helper/raw-sock-creator.cc +++ b/src/fd-net-device/helper/raw-sock-creator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "creator-utils.h" diff --git a/src/fd-net-device/helper/tap-device-creator.cc b/src/fd-net-device/helper/tap-device-creator.cc index ccfa97311..b2140c337 100644 --- a/src/fd-net-device/helper/tap-device-creator.cc +++ b/src/fd-net-device/helper/tap-device-creator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "creator-utils.h" diff --git a/src/fd-net-device/helper/tap-fd-net-device-helper.cc b/src/fd-net-device/helper/tap-fd-net-device-helper.cc index 9c981cc60..5007895b8 100644 --- a/src/fd-net-device/helper/tap-fd-net-device-helper.cc +++ b/src/fd-net-device/helper/tap-fd-net-device-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "tap-fd-net-device-helper.h" diff --git a/src/fd-net-device/helper/tap-fd-net-device-helper.h b/src/fd-net-device/helper/tap-fd-net-device-helper.h index caf6d2b42..25a52cb61 100644 --- a/src/fd-net-device/helper/tap-fd-net-device-helper.h +++ b/src/fd-net-device/helper/tap-fd-net-device-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/fd-net-device/model/dpdk-net-device.cc b/src/fd-net-device/model/dpdk-net-device.cc index 486d3fa1a..33ef28e8e 100644 --- a/src/fd-net-device/model/dpdk-net-device.cc +++ b/src/fd-net-device/model/dpdk-net-device.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Harsh Patel * Hrishikesh Hiraskar diff --git a/src/fd-net-device/model/dpdk-net-device.h b/src/fd-net-device/model/dpdk-net-device.h index e908f66fd..fe784d4b4 100644 --- a/src/fd-net-device/model/dpdk-net-device.h +++ b/src/fd-net-device/model/dpdk-net-device.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Harsh Patel * Hrishikesh Hiraskar diff --git a/src/fd-net-device/model/fd-net-device.cc b/src/fd-net-device/model/fd-net-device.cc index 05023ece7..f07907025 100644 --- a/src/fd-net-device/model/fd-net-device.cc +++ b/src/fd-net-device/model/fd-net-device.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * Claudio Freire diff --git a/src/fd-net-device/model/fd-net-device.h b/src/fd-net-device/model/fd-net-device.h index 20a17b4ad..490b804b9 100644 --- a/src/fd-net-device/model/fd-net-device.h +++ b/src/fd-net-device/model/fd-net-device.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2012 INRIA, 2012 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alina Quereilhac * Claudio Freire diff --git a/src/fd-net-device/model/netmap-net-device.cc b/src/fd-net-device/model/netmap-net-device.cc index 7af7de7bd..8e9a264b9 100644 --- a/src/fd-net-device/model/netmap-net-device.cc +++ b/src/fd-net-device/model/netmap-net-device.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/fd-net-device/model/netmap-net-device.h b/src/fd-net-device/model/netmap-net-device.h index 8065f74f8..7795ad3f9 100644 --- a/src/fd-net-device/model/netmap-net-device.h +++ b/src/fd-net-device/model/netmap-net-device.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Pasquale Imputato */ diff --git a/src/flow-monitor/examples/wifi-olsr-flowmon.py b/src/flow-monitor/examples/wifi-olsr-flowmon.py index af4fa3e9f..8fd51bbd2 100644 --- a/src/flow-monitor/examples/wifi-olsr-flowmon.py +++ b/src/flow-monitor/examples/wifi-olsr-flowmon.py @@ -1,18 +1,7 @@ # -*- Mode: Python; -*- # Copyright (c) 2009 INESC Porto # -# 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 +# SPDX-License-Identifier: GPL-2.0-only # # Authors: Gustavo Carneiro diff --git a/src/flow-monitor/helper/flow-monitor-helper.cc b/src/flow-monitor/helper/flow-monitor-helper.cc index 44b9e5c01..94c067465 100644 --- a/src/flow-monitor/helper/flow-monitor-helper.cc +++ b/src/flow-monitor/helper/flow-monitor-helper.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/helper/flow-monitor-helper.h b/src/flow-monitor/helper/flow-monitor-helper.h index 82b2cd0f7..6e55255aa 100644 --- a/src/flow-monitor/helper/flow-monitor-helper.h +++ b/src/flow-monitor/helper/flow-monitor-helper.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/flow-classifier.cc b/src/flow-monitor/model/flow-classifier.cc index 4fec3009c..4959efec9 100644 --- a/src/flow-monitor/model/flow-classifier.cc +++ b/src/flow-monitor/model/flow-classifier.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/flow-classifier.h b/src/flow-monitor/model/flow-classifier.h index e02cd397b..bc709cd51 100644 --- a/src/flow-monitor/model/flow-classifier.h +++ b/src/flow-monitor/model/flow-classifier.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/flow-monitor.cc b/src/flow-monitor/model/flow-monitor.cc index a948357b4..32791e6e2 100644 --- a/src/flow-monitor/model/flow-monitor.cc +++ b/src/flow-monitor/model/flow-monitor.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // @@ -24,6 +13,7 @@ #include "ns3/simulator.h" #include +#include #include #define PERIODIC_CHECK_INTERVAL (Seconds(1)) @@ -128,6 +118,8 @@ FlowMonitor::GetStatsForFlow(FlowId flowId) ref.delaySum = Seconds(0); ref.jitterSum = Seconds(0); ref.lastDelay = Seconds(0); + ref.maxDelay = Seconds(0); + ref.minDelay = Seconds(std::numeric_limits::max()); ref.txBytes = 0; ref.rxBytes = 0; ref.txPackets = 0; @@ -283,6 +275,14 @@ FlowMonitor::ReportLastRx(Ptr probe, } } stats.lastDelay = delay; + if (delay > stats.maxDelay) + { + stats.maxDelay = delay; + } + if (delay < stats.minDelay) + { + stats.minDelay = delay; + } stats.rxBytes += packetSize; stats.packetSizeHistogram.AddValue((double)packetSize); @@ -495,15 +495,14 @@ FlowMonitor::SerializeToXmlStream(std::ostream& os, for (auto flowI = m_flowStats.begin(); flowI != m_flowStats.end(); flowI++) { os << std::string(indent, ' '); -#define ATTRIB(name) << " " #name "=\"" << flowI->second.name << "\"" -#define ATTRIB_TIME(name) << " " #name "=\"" << flowI->second.name.As(Time::NS) << "\"" - os << "first - << "\"" ATTRIB_TIME(timeFirstTxPacket) ATTRIB_TIME(timeFirstRxPacket) - ATTRIB_TIME(timeLastTxPacket) ATTRIB_TIME(timeLastRxPacket) ATTRIB_TIME(delaySum) - ATTRIB_TIME(jitterSum) ATTRIB_TIME(lastDelay) ATTRIB(txBytes) ATTRIB(rxBytes) - ATTRIB(txPackets) ATTRIB(rxPackets) ATTRIB(lostPackets) - ATTRIB(timesForwarded) - << ">\n"; +#define ATTRIB(name) " " #name "=\"" << flowI->second.name << "\"" +#define ATTRIB_TIME(name) " " #name "=\"" << flowI->second.name.As(Time::NS) << "\"" + os << "first << "\"" << ATTRIB_TIME(timeFirstTxPacket) + << ATTRIB_TIME(timeFirstRxPacket) << ATTRIB_TIME(timeLastTxPacket) + << ATTRIB_TIME(timeLastRxPacket) << ATTRIB_TIME(delaySum) << ATTRIB_TIME(jitterSum) + << ATTRIB_TIME(lastDelay) << ATTRIB_TIME(maxDelay) << ATTRIB_TIME(minDelay) + << ATTRIB(txBytes) << ATTRIB(rxBytes) << ATTRIB(txPackets) << ATTRIB(rxPackets) + << ATTRIB(lostPackets) << ATTRIB(timesForwarded) << ">\n"; #undef ATTRIB_TIME #undef ATTRIB @@ -591,6 +590,8 @@ FlowMonitor::ResetAllStats() flowStat.delaySum = Seconds(0); flowStat.jitterSum = Seconds(0); flowStat.lastDelay = Seconds(0); + flowStat.maxDelay = Seconds(0); + flowStat.minDelay = Seconds(std::numeric_limits::max()); flowStat.txBytes = 0; flowStat.rxBytes = 0; flowStat.txPackets = 0; diff --git a/src/flow-monitor/model/flow-monitor.h b/src/flow-monitor/model/flow-monitor.h index 3a2082ba8..ccce84a60 100644 --- a/src/flow-monitor/model/flow-monitor.h +++ b/src/flow-monitor/model/flow-monitor.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // @@ -90,6 +79,10 @@ class FlowMonitor : public Object /// Contains the last measured delay of a packet /// It is stored to measure the packet's Jitter Time lastDelay; + /// Contains the largest measured delay of a received packet + Time maxDelay; + /// Contains the smallest measured delay of a received packet + Time minDelay; /// Total number of transmitted bytes for the flow uint64_t txBytes; diff --git a/src/flow-monitor/model/flow-probe.cc b/src/flow-monitor/model/flow-probe.cc index 827fe7f68..4c81e7b8d 100644 --- a/src/flow-monitor/model/flow-probe.cc +++ b/src/flow-monitor/model/flow-probe.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/flow-probe.h b/src/flow-monitor/model/flow-probe.h index ae3365e75..5a5313648 100644 --- a/src/flow-monitor/model/flow-probe.h +++ b/src/flow-monitor/model/flow-probe.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/ipv4-flow-classifier.cc b/src/flow-monitor/model/ipv4-flow-classifier.cc index 5374aed84..d263ce5bc 100644 --- a/src/flow-monitor/model/ipv4-flow-classifier.cc +++ b/src/flow-monitor/model/ipv4-flow-classifier.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/ipv4-flow-classifier.h b/src/flow-monitor/model/ipv4-flow-classifier.h index 33c5e698e..e9d3e3c44 100644 --- a/src/flow-monitor/model/ipv4-flow-classifier.h +++ b/src/flow-monitor/model/ipv4-flow-classifier.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/ipv4-flow-probe.cc b/src/flow-monitor/model/ipv4-flow-probe.cc index 77dae4954..5946363a5 100644 --- a/src/flow-monitor/model/ipv4-flow-probe.cc +++ b/src/flow-monitor/model/ipv4-flow-probe.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/ipv4-flow-probe.h b/src/flow-monitor/model/ipv4-flow-probe.h index ab208174d..32c23900f 100644 --- a/src/flow-monitor/model/ipv4-flow-probe.h +++ b/src/flow-monitor/model/ipv4-flow-probe.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // diff --git a/src/flow-monitor/model/ipv6-flow-classifier.cc b/src/flow-monitor/model/ipv6-flow-classifier.cc index 7800fc508..d686c1a9a 100644 --- a/src/flow-monitor/model/ipv6-flow-classifier.cc +++ b/src/flow-monitor/model/ipv6-flow-classifier.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // Modifications: Tommaso Pecorella diff --git a/src/flow-monitor/model/ipv6-flow-classifier.h b/src/flow-monitor/model/ipv6-flow-classifier.h index e1d3d2364..86d13dc94 100644 --- a/src/flow-monitor/model/ipv6-flow-classifier.h +++ b/src/flow-monitor/model/ipv6-flow-classifier.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // Modifications: Tommaso Pecorella diff --git a/src/flow-monitor/model/ipv6-flow-probe.cc b/src/flow-monitor/model/ipv6-flow-probe.cc index 32f7e42f5..19b664321 100644 --- a/src/flow-monitor/model/ipv6-flow-probe.cc +++ b/src/flow-monitor/model/ipv6-flow-probe.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // Modifications: Tommaso Pecorella diff --git a/src/flow-monitor/model/ipv6-flow-probe.h b/src/flow-monitor/model/ipv6-flow-probe.h index 576adc0c4..bd0cef07e 100644 --- a/src/flow-monitor/model/ipv6-flow-probe.h +++ b/src/flow-monitor/model/ipv6-flow-probe.h @@ -1,18 +1,7 @@ // // Copyright (c) 2009 INESC Porto // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Gustavo J. A. M. Carneiro // Modifications: Tommaso Pecorella diff --git a/src/internet-apps/doc/internet-apps.h b/src/internet-apps/doc/internet-apps.h index 360cb3b2e..0067c5c06 100644 --- a/src/internet-apps/doc/internet-apps.h +++ b/src/internet-apps/doc/internet-apps.h @@ -1,33 +1,5 @@ /* - * 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 - * - */ - -/* - * 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 - * + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef INTERNET_APPS_H diff --git a/src/internet-apps/examples/dhcp-example.cc b/src/internet-apps/examples/dhcp-example.cc index b926e9bba..441ec9599 100644 --- a/src/internet-apps/examples/dhcp-example.cc +++ b/src/internet-apps/examples/dhcp-example.cc @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/examples/ping-example.cc b/src/internet-apps/examples/ping-example.cc index ca0e4e955..9b3dff205 100644 --- a/src/internet-apps/examples/ping-example.cc +++ b/src/internet-apps/examples/ping-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 Chandrakant Jena * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Chandrakant Jena */ diff --git a/src/internet-apps/examples/traceroute-example.cc b/src/internet-apps/examples/traceroute-example.cc index e321bf169..55a08e9c1 100644 --- a/src/internet-apps/examples/traceroute-example.cc +++ b/src/internet-apps/examples/traceroute-example.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alberto Gallegos Ramonet * diff --git a/src/internet-apps/helper/dhcp-helper.cc b/src/internet-apps/helper/dhcp-helper.cc index fd31acd13..7fc9553c4 100644 --- a/src/internet-apps/helper/dhcp-helper.cc +++ b/src/internet-apps/helper/dhcp-helper.cc @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/helper/dhcp-helper.h b/src/internet-apps/helper/dhcp-helper.h index 6b3c5ea01..43d9332ed 100644 --- a/src/internet-apps/helper/dhcp-helper.h +++ b/src/internet-apps/helper/dhcp-helper.h @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/helper/ping-helper.cc b/src/internet-apps/helper/ping-helper.cc index c76c84021..a72011bec 100644 --- a/src/internet-apps/helper/ping-helper.cc +++ b/src/internet-apps/helper/ping-helper.cc @@ -3,18 +3,7 @@ * Copyright (c) 2008-2009 Strasbourg University (original Ping6 helper) * Copyright (c) 2008 INRIA (original v4Ping helper) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella * diff --git a/src/internet-apps/helper/ping-helper.h b/src/internet-apps/helper/ping-helper.h index 29604969c..0881f87e4 100644 --- a/src/internet-apps/helper/ping-helper.h +++ b/src/internet-apps/helper/ping-helper.h @@ -3,18 +3,7 @@ * Copyright (c) 2008-2009 Strasbourg University (original Ping6 helper) * Copyright (c) 2008 INRIA (original v4Ping helper) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella * diff --git a/src/internet-apps/helper/radvd-helper.cc b/src/internet-apps/helper/radvd-helper.cc index 389594bd2..3030ce33a 100644 --- a/src/internet-apps/helper/radvd-helper.cc +++ b/src/internet-apps/helper/radvd-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet-apps/helper/radvd-helper.h b/src/internet-apps/helper/radvd-helper.h index dab52efed..34e009a07 100644 --- a/src/internet-apps/helper/radvd-helper.h +++ b/src/internet-apps/helper/radvd-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet-apps/helper/v4traceroute-helper.cc b/src/internet-apps/helper/v4traceroute-helper.cc index 5525bf95a..62448b765 100644 --- a/src/internet-apps/helper/v4traceroute-helper.cc +++ b/src/internet-apps/helper/v4traceroute-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * * Author: Alberto Gallegos Ramonet diff --git a/src/internet-apps/helper/v4traceroute-helper.h b/src/internet-apps/helper/v4traceroute-helper.h index 16a7b4937..a1563eae4 100644 --- a/src/internet-apps/helper/v4traceroute-helper.h +++ b/src/internet-apps/helper/v4traceroute-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * * Alberto Gallegos Ramonet diff --git a/src/internet-apps/model/dhcp-client.cc b/src/internet-apps/model/dhcp-client.cc index 31c9bbf22..0c9975f6a 100644 --- a/src/internet-apps/model/dhcp-client.cc +++ b/src/internet-apps/model/dhcp-client.cc @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/model/dhcp-client.h b/src/internet-apps/model/dhcp-client.h index de342582c..8790d8734 100644 --- a/src/internet-apps/model/dhcp-client.h +++ b/src/internet-apps/model/dhcp-client.h @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/model/dhcp-header.cc b/src/internet-apps/model/dhcp-header.cc index 42c382015..7b18791de 100644 --- a/src/internet-apps/model/dhcp-header.cc +++ b/src/internet-apps/model/dhcp-header.cc @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/model/dhcp-header.h b/src/internet-apps/model/dhcp-header.h index 2e6e80be5..f92da88b8 100644 --- a/src/internet-apps/model/dhcp-header.h +++ b/src/internet-apps/model/dhcp-header.h @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak @@ -41,13 +30,13 @@ namespace ns3 * \ingroup dhcp * * \class DhcpHeader - * \brief BOOTP header with DHCP messages supports the following options: + * \brief BOOTP header with DHCP messages. This supports the following options: * Subnet Mask (1), Address Request (50), Refresh Lease Time (51), * DHCP Message Type (53), DHCP Server ID (54), Renew Time (58), * Rebind Time (59) and End (255) of BOOTP - - \verbatim - 0 1 2 3 + * + * \verbatim + 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | op (1) | htype (1) | hlen (1) | hops (1) | @@ -78,8 +67,7 @@ namespace ns3 | | | options (variable) | +---------------------------------------------------------------+ - \endverbatim - + \endverbatim */ class DhcpHeader : public Header { diff --git a/src/internet-apps/model/dhcp-server.cc b/src/internet-apps/model/dhcp-server.cc index 43ff27dc6..077c2c38f 100644 --- a/src/internet-apps/model/dhcp-server.cc +++ b/src/internet-apps/model/dhcp-server.cc @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/model/dhcp-server.h b/src/internet-apps/model/dhcp-server.h index 1cdb46459..794206254 100644 --- a/src/internet-apps/model/dhcp-server.h +++ b/src/internet-apps/model/dhcp-server.h @@ -2,18 +2,7 @@ * Copyright (c) 2011 UPB * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Radu Lupu * Ankit Deepak diff --git a/src/internet-apps/model/ping.cc b/src/internet-apps/model/ping.cc index 23a3c50c8..5c40c63a4 100644 --- a/src/internet-apps/model/ping.cc +++ b/src/internet-apps/model/ping.cc @@ -3,18 +3,7 @@ * Copyright (c) 2007-2009 Strasbourg University (original Ping6 code) * Copyright (c) 2008 INRIA (original Ping code) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Chandrakant Jena * Tommaso Pecorella diff --git a/src/internet-apps/model/ping.h b/src/internet-apps/model/ping.h index 3de37f312..866320410 100644 --- a/src/internet-apps/model/ping.h +++ b/src/internet-apps/model/ping.h @@ -3,18 +3,7 @@ * Copyright (c) 2007-2009 Strasbourg University (original Ping6 code) * Copyright (c) 2008 INRIA (original v4Ping code) * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Chandrakant Jena * diff --git a/src/internet-apps/model/radvd-interface.cc b/src/internet-apps/model/radvd-interface.cc index 03a079cf3..6073f03dc 100644 --- a/src/internet-apps/model/radvd-interface.cc +++ b/src/internet-apps/model/radvd-interface.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet-apps/model/radvd-interface.h b/src/internet-apps/model/radvd-interface.h index afb713f66..85f1dd397 100644 --- a/src/internet-apps/model/radvd-interface.h +++ b/src/internet-apps/model/radvd-interface.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet-apps/model/radvd-prefix.cc b/src/internet-apps/model/radvd-prefix.cc index e97dcc30a..fccb32f3c 100644 --- a/src/internet-apps/model/radvd-prefix.cc +++ b/src/internet-apps/model/radvd-prefix.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet-apps/model/radvd-prefix.h b/src/internet-apps/model/radvd-prefix.h index 13be439dd..6363a1511 100644 --- a/src/internet-apps/model/radvd-prefix.h +++ b/src/internet-apps/model/radvd-prefix.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet-apps/model/radvd.cc b/src/internet-apps/model/radvd.cc index 2e62bdfac..9caba53f9 100644 --- a/src/internet-apps/model/radvd.cc +++ b/src/internet-apps/model/radvd.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 Telecom Bretagne * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Mehdi Benamor diff --git a/src/internet-apps/model/radvd.h b/src/internet-apps/model/radvd.h index a599aeac8..eccbd51e3 100644 --- a/src/internet-apps/model/radvd.h +++ b/src/internet-apps/model/radvd.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 Telecom Bretagne * Copyright (c) 2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Mehdi Benamor diff --git a/src/internet-apps/model/v4traceroute.cc b/src/internet-apps/model/v4traceroute.cc index 6cefc2194..e33ec29bb 100644 --- a/src/internet-apps/model/v4traceroute.cc +++ b/src/internet-apps/model/v4traceroute.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alberto Gallegos Ramonet * diff --git a/src/internet-apps/model/v4traceroute.h b/src/internet-apps/model/v4traceroute.h index a9c9585e4..9ef318603 100644 --- a/src/internet-apps/model/v4traceroute.h +++ b/src/internet-apps/model/v4traceroute.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Alberto Gallegos Ramonet */ diff --git a/src/internet-apps/test/dhcp-test.cc b/src/internet-apps/test/dhcp-test.cc index db001851c..115dcccd2 100644 --- a/src/internet-apps/test/dhcp-test.cc +++ b/src/internet-apps/test/dhcp-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2017 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Ankit Deepak * Deepti Rajagopal diff --git a/src/internet-apps/test/ipv6-radvd-test.cc b/src/internet-apps/test/ipv6-radvd-test.cc index 1f0e89642..2d39c6e1d 100644 --- a/src/internet-apps/test/ipv6-radvd-test.cc +++ b/src/internet-apps/test/ipv6-radvd-test.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2021 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Tommaso Pecorella * diff --git a/src/internet-apps/test/ping-test.cc b/src/internet-apps/test/ping-test.cc index fe7114c48..e6a830015 100644 --- a/src/internet-apps/test/ping-test.cc +++ b/src/internet-apps/test/ping-test.cc @@ -3,18 +3,7 @@ * Copyright (c) 2022 Universita' di Firenze, Italy * Copyright (c) 2022 Tom Henderson * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Chandrakant Jena * Tommaso Pecorella diff --git a/src/internet/doc/tcp.rst b/src/internet/doc/tcp.rst index 1de27d188..64cb9a934 100644 --- a/src/internet/doc/tcp.rst +++ b/src/internet/doc/tcp.rst @@ -464,11 +464,11 @@ by (1/cwnd) with a rounding off due to type casting into int. if (m_cWndCnt >= w) { - uint32_t delta = m_cWndCnt / w; + uint32_t delta = m_cWndCnt / w; - m_cWndCnt -= delta * w; - tcb->m_cWnd += delta * tcb->m_segmentSize; - NS_LOG_DEBUG("Subtracting delta * w from m_cWndCnt " << delta * w); + m_cWndCnt -= delta * w; + tcb->m_cWnd += delta * tcb->m_segmentSize; + NS_LOG_DEBUG("Subtracting delta * w from m_cWndCnt " << delta * w); } @@ -476,13 +476,13 @@ by (1/cwnd) with a rounding off due to type casting into int. :caption: New Reno `cwnd` update if (segmentsAcked > 0) - { - double adder = static_cast(tcb->m_segmentSize * tcb->m_segmentSize) / tcb->m_cWnd.Get(); - adder = std::max(1.0, adder); - tcb->m_cWnd += static_cast(adder); - NS_LOG_INFO("In CongAvoid, updated to cwnd " << tcb->m_cWnd << + { + double adder = static_cast(tcb->m_segmentSize * tcb->m_segmentSize) / tcb->m_cWnd.Get(); + adder = std::max(1.0, adder); + tcb->m_cWnd += static_cast(adder); + NS_LOG_INFO("In CongAvoid, updated to cwnd " << tcb->m_cWnd << " ssthresh " << tcb->m_ssThresh); - } + } So, there are two main difference between the TCP Linux Reno and TCP NewReno @@ -821,9 +821,9 @@ consecutive congestion events is considered for beta calculation. The transport ``TcpHtcp`` can be selected in the program ``examples/tcp/tcp-variants-comparison.cc`` to perform an experiment with H-TCP, although it is useful to increase the bandwidth in this example (e.g. -to 20 Mb/s) to create a higher BDP link, such as +to 20 Mb/s) to create a higher BDP link, such as: -:: +.. code-block:: bash ./ns3 run "tcp-variants-comparison --transport_prot=TcpHtcp --bandwidth=20Mbps --duration=10" @@ -844,11 +844,11 @@ As a first approximation, the LEDBAT sender operates as shown below: On receipt of an ACK:: - currentdelay = acknowledgement.delay - basedelay = min(basedelay, currentdelay) - queuingdelay = currentdelay - basedelay - offtarget =(TARGET - queuingdelay) / TARGET - cWnd += GAIN * offtarget * bytesnewlyacked * MSS / cWnd + currentdelay = acknowledgement.delay; + basedelay = min(basedelay, currentdelay); + queuingdelay = currentdelay - basedelay; + offtarget =(TARGET - queuingdelay) / TARGET; + cWnd += GAIN * offtarget * bytesnewlyacked * MSS / cWnd; ``TARGET`` is the maximum queueing delay that LEDBAT itself may introduce in the network, and ``GAIN`` determines the rate at which the cwnd responds to changes in @@ -899,14 +899,14 @@ On receipt of an ACK: .. math:: - One way delay = Receiver timestamp - Receiver timestamp echo reply - Smoothed one way delay = 7/8 * Old Smoothed one way delay + 1/8 * one way delay - If smoothed one way delay > owdMin + 15 * (owdMax - owdMin) / 100 - if LP_WITHIN_INF - cwnd = 1 - else - cwnd = cwnd / 2 - Inference timer is set + \text{One way delay} &= \text{Receiver timestamp} - \text{Receiver timestamp echo reply} \\ + \text{Smoothed one way delay} &= \frac{7}{8} \times \text{Old Smoothed one way delay} + \frac{1}{8} \times \text{one way delay} \\ + \text{If smoothed one way delay} &> \text{owdMin} + \frac{15 \times (\text{owdMax} - \text{owdMin})}{100} \\ + &\text{if LP\_WITHIN\_INF} \\ + &\quad \text{cwnd} = 1 \\ + &\text{else} \\ + &\quad \text{cwnd} = \frac{\text{cwnd}}{2} \\ + &\text{Inference timer is set} where owdMin and owdMax are the minimum and maximum one way delays experienced throughout the connection, LP_WITHIN_INF indicates if TCP-LP is in inference @@ -948,7 +948,7 @@ latency, and high throughput with shallow-buffered switches. .. math:: - \alpha = (1 - g) * \alpha + g * F + \alpha = (1 - g) * \alpha + g * F In the above EWMA: @@ -961,7 +961,7 @@ window as follows, once for every window of data: .. math:: - cwnd = cwnd * (1 - \alpha / 2) + cwnd = cwnd * (1 - \alpha / 2) Following the recommendation of RFC 8257, the default values of the parameters are: @@ -1056,31 +1056,36 @@ limiting the rate at which packets are sent. It caps the cwnd to one BDP and paces out packets at a rate which is adjusted based on the latest estimate of delivery rate. BBR algorithm is agnostic to packet losses and ECN marks. -pacing_gain controls the rate of sending data and cwnd_gain controls the amount +``pacing_gain`` controls the rate of sending data and ``cwnd_gain`` controls the amount of data to send. The following is a high level overview of BBR congestion control algorithm: On receiving an ACK:: - rtt = now - packet.sent_time - update_minimum_rtt(rtt) - delivery_rate = estimate_delivery_rate(packet) - update_maximum_bandwidth(delivery_rate) + rtt = now - packet.sent_time; + update_minimum_rtt(rtt); + delivery_rate = estimate_delivery_rate(packet); + update_maximum_bandwidth(delivery_rate); After transmitting a data packet:: - bdp = max_bandwidth * min_rtt - if (cwnd * bdp < inflight) - return - if (now > nextSendTime) - { - transmit(packet) - nextSendTime = now + packet.size /(pacing_gain * max_bandwidth) - } - else - return - Schedule(nextSendTime, Send) + bdp = max_bandwidth * min_rtt; + if (cwnd * bdp < inflight) + { + return; + } + if (now > nextSendTime) + { + transmit(packet); + nextSendTime = now + packet.size / (pacing_gain * max_bandwidth); + } + else + { + return; + } + Schedule(nextSendTime, Send); + To enable BBR on all TCP sockets, the following configuration can be used:: @@ -1099,10 +1104,10 @@ In addition, the following unit tests have been written to validate the implementation of BBR in ns-3: * BBR should enable (if not already done) TCP pacing feature. -* Test to validate the values of pacing_gain and cwnd_gain in different phases +* Test to validate the values of ``pacing_gain`` and ``cwnd_gain`` in different phases of BBR. -An example program, examples/tcp/tcp-bbr-example.cc, is provided to experiment +An example program, ``examples/tcp/tcp-bbr-example.cc``, is provided to experiment with BBR for one long running flow. This example uses a simple topology consisting of one sender, one receiver and two routers to examine congestion window, throughput and queue control. A program similar to this has been run @@ -1134,25 +1139,25 @@ The following ECN states are declared in ``src/internet/model/tcp-socket-state.h :: - typedef enum - { + enum EcnStates_t + { ECN_DISABLED = 0, //!< ECN disabled traffic ECN_IDLE, //!< ECN is enabled but currently there is no action pertaining to ECE or CWR to be taken ECN_CE_RCVD, //!< Last packet received had CE bit set in IP header ECN_SENDING_ECE, //!< Receiver sends an ACK with ECE bit set in TCP header ECN_ECE_RCVD, //!< Last ACK received had ECE bit set in TCP header ECN_CWR_SENT //!< Sender has reduced the congestion window, and sent a packet with CWR bit set in TCP header. This is used for tracing. - } EcnStates_t; + }; Current implementation of ECN is based on RFC 3168 and is referred as Classic ECN. The following enum represents the mode of ECN:: - typedef enum - { + enum EcnMode_t + { ClassicEcn, //!< ECN functionality as described in RFC 3168. DctcpEcn, //!< ECN functionality as described in RFC 8257. Note: this mode is specific to DCTCP. - } EcnMode_t; + }; The following are some important ECN parameters:: @@ -1170,12 +1175,12 @@ Linux: https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt :: - typedef enum - { + enum UseEcn_t + { Off = 0, //!< Disable On = 1, //!< Enable AcceptOnly = 2, //!< Enable only when the peer endpoint is ECN capable - } UseEcn_t; + }; For example:: @@ -1190,43 +1195,43 @@ ECN capability is negotiated during the three-way TCP handshake: :: - if (m_useEcn == UseEcn_t::On) - { - SendEmptyPacket(TcpHeader::SYN | TcpHeader::ECE | TcpHeader::CWR); - } - else - { - SendEmptyPacket(TcpHeader::SYN); - } - m_ecnState = ECN_DISABLED; + if (m_useEcn == UseEcn_t::On) + { + SendEmptyPacket(TcpHeader::SYN | TcpHeader::ECE | TcpHeader::CWR); + } + else + { + SendEmptyPacket(TcpHeader::SYN); + } + m_ecnState = ECN_DISABLED; 2. Receiver sends SYN + ACK + ECE :: - if (m_useEcn != UseEcn_t::Off &&(tcpHeader.GetFlags() &(TcpHeader::CWR | TcpHeader::ECE)) == (TcpHeader::CWR | TcpHeader::ECE)) - { - SendEmptyPacket(TcpHeader::SYN | TcpHeader::ACK |TcpHeader::ECE); - m_ecnState = ECN_IDLE; - } - else - { - SendEmptyPacket(TcpHeader::SYN | TcpHeader::ACK); - m_ecnState = ECN_DISABLED; - } + if (m_useEcn != UseEcn_t::Off &&(tcpHeader.GetFlags() &(TcpHeader::CWR | TcpHeader::ECE)) == (TcpHeader::CWR | TcpHeader::ECE)) + { + SendEmptyPacket(TcpHeader::SYN | TcpHeader::ACK |TcpHeader::ECE); + m_ecnState = ECN_IDLE; + } + else + { + SendEmptyPacket(TcpHeader::SYN | TcpHeader::ACK); + m_ecnState = ECN_DISABLED; + } 3. Sender sends ACK :: - if (m_useEcn != UseEcn_t::Off && (tcpHeader.GetFlags() &(TcpHeader::CWR | TcpHeader::ECE)) == (TcpHeader::ECE)) - { - m_ecnState = ECN_IDLE; - } - else - { - m_ecnState = ECN_DISABLED; - } + if (m_useEcn != UseEcn_t::Off && (tcpHeader.GetFlags() &(TcpHeader::CWR | TcpHeader::ECE)) == (TcpHeader::ECE)) + { + m_ecnState = ECN_IDLE; + } + else + { + m_ecnState = ECN_DISABLED; + } Once the ECN-negotiation is successful, the sender sends data packets with ECT bits set in the IP header. @@ -1657,6 +1662,42 @@ After limit calculation, the cWnd is updated as given below: .. math:: sndcnt = MIN (ssThresh - pipe, limit) .. math:: cWnd = pipe + sndcnt +Thanks to Neal Cardwell for providing the following documentation of |ns3| PRR model: +The |ns3| implementation of PRR has something like this (note that m_isRetransDataAcked is true exactly when retransmitted data is cumulatively ACKed, and there is no RACK-TLP or similar mechanism to detect lost retransmits as of now): + +:: + + // PRR-CRB by default + int limit = std::max(m_prrDelivered - m_prrOut, deliveredBytes); + // safeACK should be true iff ACK advances SND.UNA with no further loss indicated. + // We approximate that here (given the current lack of RACK-TLP in ns-3): + bool safeACK = tcb->m_isRetransDataAcked; // retransmit cumulatively ACKed? + if (safeACK) // PRR-SSRB when recovery makes good progress + limit += tcb->m_segmentSize; + // Attempt to catch up, as permitted + sendCount = std::min(limit, static_cast(tcb->m_ssThresh - tcb->m_bytesInFlight)); + } + // Force a fast retransmit upon entering fast recovery: + if (m_prrOut == 0 && sendCount == 0) + sendCount = tcb->m_segmentSize; + +which is close to the Linux implementation (which matches the RFC): + +:: + + int delta = tp->snd_ssthresh - tcp_packets_in_flight(tp); + ... + sndcnt = max_t(int, tp->prr_delivered - tp->prr_out, + newly_acked_sacked); + if (flag & FLAG_SND_UNA_ADVANCED && !newly_lost) + sndcnt++; + sndcnt = min(delta, sndcnt); + } + /* Force a fast retransmit upon entering fast recovery */ + sndcnt = max(sndcnt, (tp->prr_out ? 0 : 1)); + +For reference, the Linux TCP PRR implementation is entirely contained in tcp_init_cwnd_reduction(), tcp_cwnd_reduction(), tcp_end_cwnd_reduction() and the updates elsewhere to prr_out. + More information (paper): https://dl.acm.org/citation.cfm?id=2068832 More information (RFC): https://tools.ietf.org/html/rfc6937 @@ -1779,10 +1820,10 @@ The code is the following: :: - TcpZeroWindowTest::TcpZeroWindowTest(const std::string &desc) - : TcpGeneralTest(desc) - { - } + TcpZeroWindowTest::TcpZeroWindowTest(const std::string &desc) + : TcpGeneralTest(desc) + { + } Then, one should define the general parameters for the TCP connection, which will be one-sided (one node is acting as SENDER, while the other is acting as @@ -1808,15 +1849,15 @@ the method ConfigureEnvironment: :: - void - TcpZeroWindowTest::ConfigureEnvironment() - { - TcpGeneralTest::ConfigureEnvironment(); - SetAppPktCount(20); - SetMTU(500); - SetTransmitStart(Seconds(2.0)); - SetPropagationDelay(MilliSeconds(50)); - } + void + TcpZeroWindowTest::ConfigureEnvironment() + { + TcpGeneralTest::ConfigureEnvironment(); + SetAppPktCount(20); + SetMTU(500); + SetTransmitStart(Seconds(2.0)); + SetPropagationDelay(MilliSeconds(50)); + } For other properties, set after the object creation, one can use ConfigureProperties (). @@ -1828,12 +1869,12 @@ documentation for an exhaustive list of the tunable properties. :: - void - TcpZeroWindowTest::ConfigureProperties() - { - TcpGeneralTest::ConfigureProperties(); - SetInitialCwnd(SENDER, 10); - } + void + TcpZeroWindowTest::ConfigureProperties() + { + TcpGeneralTest::ConfigureProperties(); + SetInitialCwnd(SENDER, 10); + } To see the default value for the experiment, please see the implementation of both methods inside TcpGeneralTest class. @@ -1857,13 +1898,13 @@ following code): Ptr TcpZeroWindowTest::CreateReceiverSocket(Ptr node) { - Ptr socket = TcpGeneralTest::CreateReceiverSocket(node); + Ptr socket = TcpGeneralTest::CreateReceiverSocket(node); - socket->SetAttribute("RcvBufSize", UintegerValue(0)); - Simulator::Schedule(Seconds(10.0), + socket->SetAttribute("RcvBufSize", UintegerValue(0)); + Simulator::Schedule(Seconds(10.0), &TcpZeroWindowTest::IncreaseBufSize, this); - return socket; + return socket; } Even so, to check the active window update, we should schedule an increase @@ -1872,11 +1913,11 @@ IncreaseBufSize. :: - void - TcpZeroWindowTest::IncreaseBufSize() - { - SetRcvBufSize(RECEIVER, 2500); - } + void + TcpZeroWindowTest::IncreaseBufSize() + { + SetRcvBufSize(RECEIVER, 2500); + } Which utilizes the SetRcvBufSize method to edit the RxBuffer object of the RECEIVER. As said before, check the Doxygen documentation for class TcpGeneralTest @@ -1896,17 +1937,17 @@ to be aware of the various possibilities that it offers. void TcpGeneralTest::SetRcvBufSize(SocketWho who, uint32_t size) { - if (who == SENDER) + if (who == SENDER) { - m_senderSocket->SetRcvBufSize(size); + m_senderSocket->SetRcvBufSize(size); } - else if (who == RECEIVER) + else if (who == RECEIVER) { - m_receiverSocket->SetRcvBufSize(size); + m_receiverSocket->SetRcvBufSize(size); } - else + else { - NS_FATAL_ERROR("Not defined"); + NS_FATAL_ERROR("Not defined"); } } @@ -1929,22 +1970,23 @@ the first SYN-ACK has 0 as advertised window size: :: - void - TcpZeroWindowTest::Tx(const Ptr p, const TcpHeader &h, SocketWho who) - { - ... - else if (who == RECEIVER) - { - NS_LOG_INFO("\tRECEIVER TX " << h << " size " << p->GetSize()); + void + TcpZeroWindowTest::Tx(const Ptr p, const TcpHeader &h, SocketWho who) + { + ... + else if (who == RECEIVER) + { + NS_LOG_INFO("\tRECEIVER TX " << h << " size " << p->GetSize()); - if (h.GetFlags() & TcpHeader::SYN) - { - NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), 0, - "RECEIVER window size is not 0 in the SYN-ACK"); - } - } - .... - } + if (h.GetFlags() & TcpHeader::SYN) + { + NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), + 0, + "RECEIVER window size is not 0 in the SYN-ACK"); + } + } + ... + } Practically, we are checking that every SYN packet sent by the RECEIVER has the advertised window set to 0. The same thing is done also by checking, in the Rx @@ -1977,20 +2019,22 @@ processing of the SYN-ACK: :: - void - TcpZeroWindowTest::ProcessedAck(const Ptr tcb, - const TcpHeader& h, SocketWho who) - { - if (who == SENDER) - { - if (h.GetFlags() & TcpHeader::SYN) - { - EventId persistentEvent = GetPersistentEvent(SENDER); - NS_TEST_ASSERT_MSG_EQ(persistentEvent.IsPending(), true, - "Persistent event not started"); - } - } - } + void + TcpZeroWindowTest::ProcessedAck(const Ptr tcb, + const TcpHeader& h, + SocketWho who) + { + if (who == SENDER) + { + if (h.GetFlags() & TcpHeader::SYN) + { + EventId persistentEvent = GetPersistentEvent(SENDER); + NS_TEST_ASSERT_MSG_EQ(persistentEvent.IsPending(), + true, + "Persistent event not started"); + } + } + } Since we programmed the increase of the buffer size after 10 simulated seconds, we expect the persistent timer to fire before any rWnd changes. When it fires, @@ -1998,28 +2042,31 @@ the SENDER should send a window probe, and the receiver should reply reporting again a zero window situation. At first, we investigates on what the sender sends: .. code-block:: c++ - :linenos: - :emphasize-lines: 1,6,7,11 + :linenos: + :emphasize-lines: 1,6,7,11 - if (Simulator::Now().GetSeconds() <= 6.0) - { - NS_TEST_ASSERT_MSG_EQ(p->GetSize() - h.GetSerializedSize(), 0, - "Data packet sent anyway"); - } - else if (Simulator::Now().GetSeconds() > 6.0 && - Simulator::Now().GetSeconds() <= 7.0) - { - NS_TEST_ASSERT_MSG_EQ(m_zeroWindowProbe, false, "Sent another probe"); + if (Simulator::Now().GetSeconds() <= 6.0) + { + NS_TEST_ASSERT_MSG_EQ(p->GetSize() - h.GetSerializedSize(), + 0, + "Data packet sent anyway"); + } + else if (Simulator::Now().GetSeconds() > 6.0 && + Simulator::Now().GetSeconds() <= 7.0) + { + NS_TEST_ASSERT_MSG_EQ(m_zeroWindowProbe, false, "Sent another probe"); - if (! m_zeroWindowProbe) - { - NS_TEST_ASSERT_MSG_EQ(p->GetSize() - h.GetSerializedSize(), 1, - "Data packet sent instead of window probe"); - NS_TEST_ASSERT_MSG_EQ(h.GetSequenceNumber(), SequenceNumber32(1), - "Data packet sent instead of window probe"); - m_zeroWindowProbe = true; - } - } + if (!m_zeroWindowProbe) + { + NS_TEST_ASSERT_MSG_EQ(p->GetSize() - h.GetSerializedSize(), + 1, + "Data packet sent instead of window probe"); + NS_TEST_ASSERT_MSG_EQ(h.GetSequenceNumber(), + SequenceNumber32(1), + "Data packet sent instead of window probe"); + m_zeroWindowProbe = true; + } + } We divide the events by simulated time. At line 1, we check everything that happens before the 6.0 seconds mark; for instance, that no data packets are sent, @@ -2031,17 +2078,19 @@ to check (line 6) between 6.0 and 7.0 simulated seconds that the probe is sent. Only one probe is allowed, and this is the reason for the check at line 11. .. code-block:: c++ - :linenos: - :emphasize-lines: 6,7 + :linenos: + :emphasize-lines: 6,7 - if (Simulator::Now().GetSeconds() > 6.0 && - Simulator::Now().GetSeconds() <= 7.0) - { - NS_TEST_ASSERT_MSG_EQ(h.GetSequenceNumber(), SequenceNumber32(1), - "Data packet sent instead of window probe"); - NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), 0, - "No zero window advertised by RECEIVER"); - } + if (Simulator::Now().GetSeconds() > 6.0 && + Simulator::Now().GetSeconds() <= 7.0) + { + NS_TEST_ASSERT_MSG_EQ(h.GetSequenceNumber(), + SequenceNumber32(1), + "Data packet sent instead of window probe"); + NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), + 0, + "No zero window advertised by RECEIVER"); + } For the RECEIVER, the interval between 6 and 7 seconds is when the zero-window segment is sent. @@ -2051,21 +2100,23 @@ exchange between the 7 and 10 seconds mark. :: - else if (Simulator::Now().GetSeconds() > 7.0 && - Simulator::Now().GetSeconds() < 10.0) - { - NS_FATAL_ERROR("No packets should be sent before the window update"); - } + else if (Simulator::Now().GetSeconds() > 7.0 && + Simulator::Now().GetSeconds() < 10.0) + { + NS_FATAL_ERROR("No packets should be sent before the window update"); + } The state checks are performed at the end of the methods, since they are valid in every condition: :: - NS_TEST_ASSERT_MSG_EQ(GetCongStateFrom(GetTcb(SENDER)), TcpSocketState::CA_OPEN, - "Sender State is not OPEN"); - NS_TEST_ASSERT_MSG_EQ(GetCongStateFrom(GetTcb(RECEIVER)), TcpSocketState::CA_OPEN, - "Receiver State is not OPEN"); + NS_TEST_ASSERT_MSG_EQ(GetCongStateFrom(GetTcb(SENDER)), + TcpSocketState::CA_OPEN, + "Sender State is not OPEN"); + NS_TEST_ASSERT_MSG_EQ(GetCongStateFrom(GetTcb(RECEIVER)), + TcpSocketState::CA_OPEN, + "Receiver State is not OPEN"); Now, the interesting part in the Tx method is to check that after the 10.0 seconds mark (when the RECEIVER sends the active window update) the value of @@ -2073,11 +2124,12 @@ the window should be greater than zero (and precisely, set to 2500): :: - else if (Simulator::Now().GetSeconds() >= 10.0) - { - NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), 2500, - "Receiver window not updated"); - } + else if (Simulator::Now().GetSeconds() >= 10.0) + { + NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), + 2500, + "Receiver window not updated"); + } To be sure that the sender receives the window update, we can use the Rx method: @@ -2087,11 +2139,12 @@ method: :emphasize-lines: 5 if (Simulator::Now().GetSeconds() >= 10.0) - { - NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), 2500, + { + NS_TEST_ASSERT_MSG_EQ(h.GetWindowSize(), + 2500, "Receiver window not updated"); m_windowUpdated = true; - } + } We check every packet after the 10 seconds mark to see if it has the window updated. At line 5, we also set to true a boolean variable, to check @@ -2102,18 +2155,18 @@ the connection ends with a success: :: - void - TcpZeroWindowTest::NormalClose(SocketWho who) - { - if (who == SENDER) - { - m_senderFinished = true; - } - else if (who == RECEIVER) - { - m_receiverFinished = true; - } - } + void + TcpZeroWindowTest::NormalClose(SocketWho who) + { + if (who == SENDER) + { + m_senderFinished = true; + } + else if (who == RECEIVER) + { + m_receiverFinished = true; + } + } The method is called only if all bytes are transmitted successfully. Then, in the method FinalChecks(), we check all variables, which should be true (which @@ -2121,33 +2174,37 @@ indicates that we have perfectly closed the connection). :: - void - TcpZeroWindowTest::FinalChecks() - { - NS_TEST_ASSERT_MSG_EQ(m_zeroWindowProbe, true, - "Zero window probe not sent"); - NS_TEST_ASSERT_MSG_EQ(m_windowUpdated, true, - "Window has not updated during the connection"); - NS_TEST_ASSERT_MSG_EQ(m_senderFinished, true, - "Connection not closed successfully(SENDER)"); - NS_TEST_ASSERT_MSG_EQ(m_receiverFinished, true, - "Connection not closed successfully(RECEIVER)"); - } + void + TcpZeroWindowTest::FinalChecks() + { + NS_TEST_ASSERT_MSG_EQ(m_zeroWindowProbe, + true, + "Zero window probe not sent"); + NS_TEST_ASSERT_MSG_EQ(m_windowUpdated, + true, + "Window has not updated during the connection"); + NS_TEST_ASSERT_MSG_EQ(m_senderFinished, + true, + "Connection not closed successfully(SENDER)"); + NS_TEST_ASSERT_MSG_EQ(m_receiverFinished, + true, + "Connection not closed successfully(RECEIVER)"); + } To run the test, the usual way is .. code-block:: bash - ./test.py -s tcp-zero-window-test + ./test.py -s tcp-zero-window-test - PASS: TestSuite tcp-zero-window-test - 1 of 1 tests passed (1 passed, 0 skipped, 0 failed, 0 crashed, 0 valgrind errors) + PASS: TestSuite tcp-zero-window-test + 1 of 1 tests passed (1 passed, 0 skipped, 0 failed, 0 crashed, 0 valgrind errors) To see INFO messages, use a combination of ./ns3 shell and gdb (really useful): .. code-block:: bash - ./ns3 shell && gdb --args ./build/utils/ns3-dev-test-runner-debug --test-name=tcp-zero-window-test --stop-on-failure --fullness=QUICK --assert-on-failure --verbose + ./ns3 shell && gdb --args ./build/utils/ns3-dev-test-runner-debug --test-name=tcp-zero-window-test --stop-on-failure --fullness=QUICK --assert-on-failure --verbose and then, hit "Run". diff --git a/src/internet/examples/main-simple.cc b/src/internet/examples/main-simple.cc index d092f515a..bc91cba0c 100644 --- a/src/internet/examples/main-simple.cc +++ b/src/internet/examples/main-simple.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/examples/neighbor-cache-dynamic.cc b/src/internet/examples/neighbor-cache-dynamic.cc index 1ed9dabb9..0b6e308e2 100644 --- a/src/internet/examples/neighbor-cache-dynamic.cc +++ b/src/internet/examples/neighbor-cache-dynamic.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 ZHIHENG DONG * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Zhiheng Dong */ diff --git a/src/internet/examples/neighbor-cache-example.cc b/src/internet/examples/neighbor-cache-example.cc index 50b332ba2..47875c706 100644 --- a/src/internet/examples/neighbor-cache-example.cc +++ b/src/internet/examples/neighbor-cache-example.cc @@ -1,23 +1,21 @@ /* * Copyright (c) 2022 ZHIHENG DONG * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Zhiheng Dong */ /** + * \file + * Generating neighbor caches in various scopes + */ + +/** + * \file + * + * This example shows how to generate neighbor caches in various scopes. + * * This example shows how to generate neighbor caches on the scope of * a channel, a NetDeviceContainer, an InterfaceContainer and globally. * The example also shows a scenario that auto-generated neighbor caches @@ -35,248 +33,233 @@ * * IPv4 Network Topology * \verbatim - - LAN 10.1.1.0/24 - n0 --------------- n1 n2 n3 - | | | - =============== - LAN 10.1.2.0/24 - \endverbatim + IPv4 Network Topology + LAN 10.1.1.0/24 + n0 --------------- n1 n2 n3 + | | | + =============== + LAN 10.1.2.0/24 + \endverbatim * - *IPv6 Network Topology * \verbatim - - LAN 2001:1::/64 - n0 --------------- n1 n2 n3 - | | | - =============== - LAN 2001:2::/64 - \endverbatim + IPv6 Network Topology + LAN 2001:1::/64 + n0 --------------- n1 n2 n3 + | | | + =============== + LAN 2001:2::/64 + \endverbatim * * Expected Outputs: * IPv4 (default): * Generate ARP caches for all devices (default) : * \verbatim - ARP Cache of node 0 at time 0 - 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - ARP Cache of node 1 at time 0 - 10.1.1.1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - 10.1.2.2 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - 10.1.2.3 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - ARP Cache of node 2 at time 0 - 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 10.1.2.3 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - ARP Cache of node 3 at time 0 - 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + ARP Cache of node 0 at time 0 + 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + ARP Cache of node 1 at time 0 + 10.1.1.1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + 10.1.2.2 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + 10.1.2.3 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + ARP Cache of node 2 at time 0 + 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 10.1.2.3 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + ARP Cache of node 3 at time 0 + 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Generate ARP caches for the left channel (--useChannel): * \verbatim - ARP Cache of node 0 at time 0 - 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - ARP Cache of node 1 at time 0 - 10.1.1.1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - ARP Cache of node 2 at time 0 - ARP Cache of node 3 at time 0 + ARP Cache of node 0 at time 0 + 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + ARP Cache of node 1 at time 0 + 10.1.1.1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + ARP Cache of node 2 at time 0 + ARP Cache of node 3 at time 0 \endverbatim * * Generate ARP caches for devices on the right side (--useNetDeviceContainer): * \verbatim - ARP Cache of node 0 at time 0 - ARP Cache of node 1 at time 0 - 10.1.2.2 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - 10.1.2.3 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - ARP Cache of node 2 at time 0 - 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 10.1.2.3 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - ARP Cache of node 3 at time 0 - 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + ARP Cache of node 0 at time 0 + ARP Cache of node 1 at time 0 + 10.1.2.2 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + 10.1.2.3 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + ARP Cache of node 2 at time 0 + 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 10.1.2.3 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + ARP Cache of node 3 at time 0 + 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Generate ARP caches for specific interfaces (--useInterfaceContainer): * \verbatim - ARP Cache of node 0 at time 0 - 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - ARP Cache of node 1 at time 0 - ARP Cache of node 2 at time 0 - ARP Cache of node 3 at time 0 - 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + ARP Cache of node 0 at time 0 + 10.1.1.2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + ARP Cache of node 1 at time 0 + ARP Cache of node 2 at time 0 + ARP Cache of node 3 at time 0 + 10.1.2.1 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 10.1.2.2 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Do not generate neighbor cache (--noGenerate): * \verbatim - ARP Cache of node 0 at time 0 - ARP Cache of node 1 at time 0 - ARP Cache of node 2 at time 0 - ARP Cache of node 3 at time 0 + ARP Cache of node 0 at time 0 + ARP Cache of node 1 at time 0 + ARP Cache of node 2 at time 0 + ARP Cache of node 3 at time 0 \endverbatim * + */ +// clang-format off +/** * sending packet with pre-generated neighbor caches(--sendTraffic) * \verbatim - Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=0 - time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND - (seq=1 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) - AND (seq=2 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> - (size=512) AND (seq=3 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to - 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=4 time=+1s) Rx pkt from - 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=5 time=+1s) Rx pkt - from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=6 time=+1s) Rx - pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=7 - time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND - (seq=8 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) - AND (seq=9 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> - (size=512) AND (seq=10 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to - 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=11 time=+1s) Rx pkt from - 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=12 time=+1.00001s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=0 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=1 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=2 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=3 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=4 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=5 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=6 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=7 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=8 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=9 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=10 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=11 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=12 time=+1.00001s) \endverbatim * * sending packet without pre-generated neighbor caches(--sendTraffic --noGenerate) * \verbatim - Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=0 - time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND - (seq=1 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) - AND (seq=2 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> - (size=512) AND (seq=8 time=+1s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to - 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=9 time=+1s) Rx pkt from - 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=10 time=+1s) Rx pkt - from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=11 time=+1s) - Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=12 - time=+1.00001s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) - AND (seq=13 time=+1.00001s) Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> - (size=512) AND (seq=14 time=+1.00001s) \endverbatim + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=0 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=1 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=2 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=8 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=9 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=10 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=11 time=+1s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=12 time=+1.00001s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=13 time=+1.00001s) + Rx pkt from 03-07-0a:01:01:01:01:c0:00 to 03-07-0a:01:01:02:09:00:00 -> (size=512) AND (seq=14 time=+1.00001s) + \endverbatim * + */ +// clang-format on +/** * IPv6 (--useIPv6): * Generate NDISC caches for all devices (default) : * \verbatim - NDISC Cache of node 0 at time +0s - 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - NDISC Cache of node 1 at time +0s - 2001:1::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - fe80::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - fe80::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - fe80::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - NDISC Cache of node 2 at time +0s - 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - fe80::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - NDISC Cache of node 3 at time +0s - 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + NDISC Cache of node 0 at time +0s + 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + NDISC Cache of node 1 at time +0s + 2001:1::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + fe80::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + fe80::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + fe80::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + NDISC Cache of node 2 at time +0s + 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + fe80::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + NDISC Cache of node 3 at time +0s + 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Generate NDISC caches for the left channel (--useChannel): * \verbatim - NDISC Cache of node 0 at time +0s - 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - NDISC Cache of node 1 at time +0s - 2001:1::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - fe80::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED - NDISC Cache of node 2 at time +0s - NDISC Cache of node 3 at time +0s + NDISC Cache of node 0 at time +0s + 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + NDISC Cache of node 1 at time +0s + 2001:1::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + fe80::200:ff:fe00:1 dev 0 lladdr 02-06-00:00:00:00:00:01 STATIC_AUTOGENERATED + NDISC Cache of node 2 at time +0s + NDISC Cache of node 3 at time +0s \endverbatim * * Generate NDISC caches for devices on the right side (--useNetDeviceContainer): * \verbatim - NDISC Cache of node 0 at time +0s - NDISC Cache of node 1 at time +0s - 2001:2::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - fe80::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - fe80::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - NDISC Cache of node 2 at time +0s - 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - fe80::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED - NDISC Cache of node 3 at time +0s - 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + NDISC Cache of node 0 at time +0s + NDISC Cache of node 1 at time +0s + 2001:2::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + fe80::200:ff:fe00:4 dev 1 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + fe80::200:ff:fe00:5 dev 1 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + NDISC Cache of node 2 at time +0s + 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + fe80::200:ff:fe00:5 dev 0 lladdr 02-06-00:00:00:00:00:05 STATIC_AUTOGENERATED + NDISC Cache of node 3 at time +0s + 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Generate NDISC caches for specific interfaces (--useInterfaceContainer): * \verbatim - NDISC Cache of node 0 at time +0s - 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED - NDISC Cache of node 1 at time +0s - NDISC Cache of node 2 at time +0s - NDISC Cache of node 3 at time +0s - 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED - fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED - fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + NDISC Cache of node 0 at time +0s + 2001:1::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + fe80::200:ff:fe00:2 dev 0 lladdr 02-06-00:00:00:00:00:02 STATIC_AUTOGENERATED + NDISC Cache of node 1 at time +0s + NDISC Cache of node 2 at time +0s + NDISC Cache of node 3 at time +0s + 2001:2::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + 2001:2::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED + fe80::200:ff:fe00:3 dev 0 lladdr 02-06-00:00:00:00:00:03 STATIC_AUTOGENERATED + fe80::200:ff:fe00:4 dev 0 lladdr 02-06-00:00:00:00:00:04 STATIC_AUTOGENERATED \endverbatim * * Do not generate neighbor cache (--noGenerate): * \verbatim - NDISC Cache of node 0 at time +0s - NDISC Cache of node 1 at time +0s - NDISC Cache of node 2 at time +0s - NDISC Cache of node 3 at time +0s + NDISC Cache of node 0 at time +0s + NDISC Cache of node 1 at time +0s + NDISC Cache of node 2 at time +0s + NDISC Cache of node 3 at time +0s \endverbatim * + */ +// clang-format off +/** * sending packet with pre-generated neighbor caches(--sendTraffic) * \verbatim - Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=0 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=1 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=2 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=3 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=4 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=5 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=6 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=7 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=8 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=9 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=10 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=11 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=0 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=1 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=2 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=3 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=4 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=5 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=6 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=7 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=8 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=9 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=10 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=11 time=+1s) \endverbatim * * sending packet without pre-generated neighbor caches(--sendTraffic --noGenerate) * \verbatim - Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=8 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=9 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=10 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=11 time=+1s) Rx - pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=12 - time=+1.00001s) Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=13 - time=+1.00001s) Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=14 - time=+1.00001s) Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=15 - time=+1.00001s) Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to - 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=16 - time=+1.00001s) \endverbatim + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=8 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=9 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=10 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=11 time=+1s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=12 time=+1.00001s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=13 time=+1.00001s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=14 time=+1.00001s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=15 time=+1.00001s) + Rx pkt from 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:01:01:c0 to 04-12-20:01:00:01:00:00:00:00:02:00:00:ff:fe:00:00:02:09:00 -> (size=512) AND (seq=16 time=+1.00001s) + \endverbatim */ +// clang-format on #include "ns3/applications-module.h" #include "ns3/core-module.h" diff --git a/src/internet/helper/internet-stack-helper.cc b/src/internet/helper/internet-stack-helper.cc index 0760a4d57..cba3b138b 100644 --- a/src/internet/helper/internet-stack-helper.cc +++ b/src/internet/helper/internet-stack-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage * Author: Faker Moatamri diff --git a/src/internet/helper/internet-stack-helper.h b/src/internet/helper/internet-stack-helper.h index eef43fe7e..461144686 100644 --- a/src/internet/helper/internet-stack-helper.h +++ b/src/internet/helper/internet-stack-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/internet-trace-helper.cc b/src/internet/helper/internet-trace-helper.cc index c75919b17..85a7e050e 100644 --- a/src/internet/helper/internet-trace-helper.cc +++ b/src/internet/helper/internet-trace-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "internet-trace-helper.h" diff --git a/src/internet/helper/internet-trace-helper.h b/src/internet/helper/internet-trace-helper.h index dfd8a5105..598027015 100644 --- a/src/internet/helper/internet-trace-helper.h +++ b/src/internet/helper/internet-trace-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef INTERNET_TRACE_HELPER_H diff --git a/src/internet/helper/ipv4-address-helper.cc b/src/internet/helper/ipv4-address-helper.cc index 266e96267..cd456571b 100644 --- a/src/internet/helper/ipv4-address-helper.cc +++ b/src/internet/helper/ipv4-address-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv4-address-helper.h" diff --git a/src/internet/helper/ipv4-address-helper.h b/src/internet/helper/ipv4-address-helper.h index e6996d25f..9f599ad64 100644 --- a/src/internet/helper/ipv4-address-helper.h +++ b/src/internet/helper/ipv4-address-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_ADDRESS_HELPER_H diff --git a/src/internet/helper/ipv4-global-routing-helper.cc b/src/internet/helper/ipv4-global-routing-helper.cc index 32bdd8c99..f8c1b108a 100644 --- a/src/internet/helper/ipv4-global-routing-helper.cc +++ b/src/internet/helper/ipv4-global-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-global-routing-helper.h b/src/internet/helper/ipv4-global-routing-helper.h index b3eac3ab9..3631f7945 100644 --- a/src/internet/helper/ipv4-global-routing-helper.h +++ b/src/internet/helper/ipv4-global-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-interface-container.cc b/src/internet/helper/ipv4-interface-container.cc index 0a80d6d5c..5d5b180ba 100644 --- a/src/internet/helper/ipv4-interface-container.cc +++ b/src/internet/helper/ipv4-interface-container.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-interface-container.h b/src/internet/helper/ipv4-interface-container.h index 58c449391..7d98f37c4 100644 --- a/src/internet/helper/ipv4-interface-container.h +++ b/src/internet/helper/ipv4-interface-container.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-list-routing-helper.cc b/src/internet/helper/ipv4-list-routing-helper.cc index 22db916e7..f7d791390 100644 --- a/src/internet/helper/ipv4-list-routing-helper.cc +++ b/src/internet/helper/ipv4-list-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-list-routing-helper.h b/src/internet/helper/ipv4-list-routing-helper.h index b6b1d2250..88f77065d 100644 --- a/src/internet/helper/ipv4-list-routing-helper.h +++ b/src/internet/helper/ipv4-list-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-routing-helper.cc b/src/internet/helper/ipv4-routing-helper.cc index 248e5f62e..cea6722bc 100644 --- a/src/internet/helper/ipv4-routing-helper.cc +++ b/src/internet/helper/ipv4-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-routing-helper.h b/src/internet/helper/ipv4-routing-helper.h index a373ac1be..1a16cc06f 100644 --- a/src/internet/helper/ipv4-routing-helper.h +++ b/src/internet/helper/ipv4-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv4-static-routing-helper.cc b/src/internet/helper/ipv4-static-routing-helper.cc index 87c8f8854..d99c736b1 100644 --- a/src/internet/helper/ipv4-static-routing-helper.cc +++ b/src/internet/helper/ipv4-static-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv4-static-routing-helper.h" diff --git a/src/internet/helper/ipv4-static-routing-helper.h b/src/internet/helper/ipv4-static-routing-helper.h index ee685540c..aad1373f7 100644 --- a/src/internet/helper/ipv4-static-routing-helper.h +++ b/src/internet/helper/ipv4-static-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_STATIC_ROUTING_HELPER_H diff --git a/src/internet/helper/ipv6-address-helper.cc b/src/internet/helper/ipv6-address-helper.cc index 28db659fc..aec720535 100644 --- a/src/internet/helper/ipv6-address-helper.cc +++ b/src/internet/helper/ipv6-address-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/helper/ipv6-address-helper.h b/src/internet/helper/ipv6-address-helper.h index 7fe398dd8..d7012ef81 100644 --- a/src/internet/helper/ipv6-address-helper.h +++ b/src/internet/helper/ipv6-address-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * modified by Tom Henderson for ns-3.14 release diff --git a/src/internet/helper/ipv6-interface-container.cc b/src/internet/helper/ipv6-interface-container.cc index 2f9003763..07f7bfc8f 100644 --- a/src/internet/helper/ipv6-interface-container.cc +++ b/src/internet/helper/ipv6-interface-container.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008-2009 Strasbourg University * 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Tommaso Pecorella diff --git a/src/internet/helper/ipv6-interface-container.h b/src/internet/helper/ipv6-interface-container.h index 77f5bf2bb..90684702a 100644 --- a/src/internet/helper/ipv6-interface-container.h +++ b/src/internet/helper/ipv6-interface-container.h @@ -2,18 +2,7 @@ * Copyright (c) 2008-2009 Strasbourg University * 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Tommaso Pecorella diff --git a/src/internet/helper/ipv6-list-routing-helper.cc b/src/internet/helper/ipv6-list-routing-helper.cc index 4547ac59f..5b20a8077 100644 --- a/src/internet/helper/ipv6-list-routing-helper.cc +++ b/src/internet/helper/ipv6-list-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv6-list-routing-helper.h b/src/internet/helper/ipv6-list-routing-helper.h index e62c5a728..87ea0dadc 100644 --- a/src/internet/helper/ipv6-list-routing-helper.h +++ b/src/internet/helper/ipv6-list-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv6-routing-helper.cc b/src/internet/helper/ipv6-routing-helper.cc index 33fd379df..be65e88d9 100644 --- a/src/internet/helper/ipv6-routing-helper.cc +++ b/src/internet/helper/ipv6-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv6-routing-helper.h b/src/internet/helper/ipv6-routing-helper.h index e43ba68e3..5707a1500 100644 --- a/src/internet/helper/ipv6-routing-helper.h +++ b/src/internet/helper/ipv6-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/helper/ipv6-static-routing-helper.cc b/src/internet/helper/ipv6-static-routing-helper.cc index 82f886405..b29669fa8 100644 --- a/src/internet/helper/ipv6-static-routing-helper.cc +++ b/src/internet/helper/ipv6-static-routing-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv6-static-routing-helper.h" diff --git a/src/internet/helper/ipv6-static-routing-helper.h b/src/internet/helper/ipv6-static-routing-helper.h index b76a70013..11ab9708c 100644 --- a/src/internet/helper/ipv6-static-routing-helper.h +++ b/src/internet/helper/ipv6-static-routing-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV6_STATIC_ROUTING_HELPER_H diff --git a/src/internet/helper/neighbor-cache-helper.cc b/src/internet/helper/neighbor-cache-helper.cc index a56eb310a..ab66657e0 100644 --- a/src/internet/helper/neighbor-cache-helper.cc +++ b/src/internet/helper/neighbor-cache-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 ZHIHENG DONG * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Zhiheng Dong */ diff --git a/src/internet/helper/neighbor-cache-helper.h b/src/internet/helper/neighbor-cache-helper.h index 53b5cee59..4d8c56575 100644 --- a/src/internet/helper/neighbor-cache-helper.h +++ b/src/internet/helper/neighbor-cache-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2022 ZHIHENG DONG * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Zhiheng Dong */ diff --git a/src/internet/helper/rip-helper.cc b/src/internet/helper/rip-helper.cc index 1f7b18842..b4db7c8d7 100644 --- a/src/internet/helper/rip-helper.cc +++ b/src/internet/helper/rip-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/helper/rip-helper.h b/src/internet/helper/rip-helper.h index dc7064347..079435e90 100644 --- a/src/internet/helper/rip-helper.h +++ b/src/internet/helper/rip-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/helper/ripng-helper.cc b/src/internet/helper/ripng-helper.cc index de11d924f..44e8ad183 100644 --- a/src/internet/helper/ripng-helper.cc +++ b/src/internet/helper/ripng-helper.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/helper/ripng-helper.h b/src/internet/helper/ripng-helper.h index caf33c07b..fdbde8f4f 100644 --- a/src/internet/helper/ripng-helper.h +++ b/src/internet/helper/ripng-helper.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/arp-cache.cc b/src/internet/model/arp-cache.cc index 4d48a8716..36f674b09 100644 --- a/src/internet/model/arp-cache.cc +++ b/src/internet/model/arp-cache.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-cache.h b/src/internet/model/arp-cache.h index 5f5eef96e..a9fd628a2 100644 --- a/src/internet/model/arp-cache.h +++ b/src/internet/model/arp-cache.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-header.cc b/src/internet/model/arp-header.cc index d2f287efe..93ca2a0f3 100644 --- a/src/internet/model/arp-header.cc +++ b/src/internet/model/arp-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-header.h b/src/internet/model/arp-header.h index beb74520b..c0a5eac29 100644 --- a/src/internet/model/arp-header.h +++ b/src/internet/model/arp-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-l3-protocol.cc b/src/internet/model/arp-l3-protocol.cc index 790dab17c..a732b97e2 100644 --- a/src/internet/model/arp-l3-protocol.cc +++ b/src/internet/model/arp-l3-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-l3-protocol.h b/src/internet/model/arp-l3-protocol.h index f35a6ea15..512310e86 100644 --- a/src/internet/model/arp-l3-protocol.h +++ b/src/internet/model/arp-l3-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/arp-queue-disc-item.cc b/src/internet/model/arp-queue-disc-item.cc index 734d68554..c3f67ca53 100644 --- a/src/internet/model/arp-queue-disc-item.cc +++ b/src/internet/model/arp-queue-disc-item.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "arp-queue-disc-item.h" diff --git a/src/internet/model/arp-queue-disc-item.h b/src/internet/model/arp-queue-disc-item.h index fcf9b3bb3..6be7ecc5f 100644 --- a/src/internet/model/arp-queue-disc-item.h +++ b/src/internet/model/arp-queue-disc-item.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef ARP_QUEUE_DISC_ITEM_H diff --git a/src/internet/model/candidate-queue.cc b/src/internet/model/candidate-queue.cc index b39d867c9..65b21581b 100644 --- a/src/internet/model/candidate-queue.cc +++ b/src/internet/model/candidate-queue.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "candidate-queue.h" diff --git a/src/internet/model/candidate-queue.h b/src/internet/model/candidate-queue.h index 509413212..d1f56bca5 100644 --- a/src/internet/model/candidate-queue.h +++ b/src/internet/model/candidate-queue.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Craig Dowell (craigdo@ee.washington.edu) */ @@ -163,7 +152,7 @@ class CandidateQueue /** * \brief return true if v1 < v2 * - * SPFVertexes are added into the queue according to the ordering + * SPFVertex items are added into the queue according to the ordering * defined by this method. If v1 should be popped before v2, this * method return true; false otherwise * diff --git a/src/internet/model/global-route-manager-impl.cc b/src/internet/model/global-route-manager-impl.cc index 7c3d34287..93edf9e7a 100644 --- a/src/internet/model/global-route-manager-impl.cc +++ b/src/internet/model/global-route-manager-impl.cc @@ -2,18 +2,7 @@ * Copyright 2007 University of Washington * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Tom Henderson (tomhend@u.washington.edu) * diff --git a/src/internet/model/global-route-manager-impl.h b/src/internet/model/global-route-manager-impl.h index 1721bf5a2..ca497c6a4 100644 --- a/src/internet/model/global-route-manager-impl.h +++ b/src/internet/model/global-route-manager-impl.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Craig Dowell (craigdo@ee.washington.edu) * Tom Henderson (tomhend@u.washington.edu) @@ -542,7 +531,7 @@ class SPFVertex Ipv4Address m_nextHop; //!< next hop typedef std::list ListOfNodeExit_t; //!< container of Exit nodes ListOfNodeExit_t m_ecmpRootExits; //!< store the multiple root's exits for supporting ECMP - typedef std::list ListOfSPFVertex_t; //!< container of SPFVertexes + typedef std::list ListOfSPFVertex_t; //!< container of SPFVertex items ListOfSPFVertex_t m_parents; //!< parent list ListOfSPFVertex_t m_children; //!< Children list bool m_vertexProcessed; //!< Flag to note whether vertex has been processed in stage two of SPF @@ -552,7 +541,7 @@ class SPFVertex * \brief Stream insertion operator. * * \param os the reference to the output stream - * \param vs a list of SPFVertexes + * \param vs a list of SPFVertex items * \returns the reference to the output stream */ friend std::ostream& operator<<(std::ostream& os, const SPFVertex::ListOfSPFVertex_t& vs); diff --git a/src/internet/model/global-route-manager.cc b/src/internet/model/global-route-manager.cc index ca292a9f4..5b42623e8 100644 --- a/src/internet/model/global-route-manager.cc +++ b/src/internet/model/global-route-manager.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tom Henderson (tomhend@u.washington.edu) */ diff --git a/src/internet/model/global-route-manager.h b/src/internet/model/global-route-manager.h index 369f9185b..d076c76ee 100644 --- a/src/internet/model/global-route-manager.h +++ b/src/internet/model/global-route-manager.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Craig Dowell (craigdo@ee.washington.edu) * Tom Henderson (tomhend@u.washington.edu) diff --git a/src/internet/model/global-router-interface.cc b/src/internet/model/global-router-interface.cc index 2e83ebe12..ded56422a 100644 --- a/src/internet/model/global-router-interface.cc +++ b/src/internet/model/global-router-interface.cc @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Tom Henderson (tomhend@u.washington.edu) */ diff --git a/src/internet/model/global-router-interface.h b/src/internet/model/global-router-interface.h index 5b0af67a9..6bf5a98ca 100644 --- a/src/internet/model/global-router-interface.h +++ b/src/internet/model/global-router-interface.h @@ -1,18 +1,7 @@ /* * Copyright 2007 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Craig Dowell (craigdo@ee.washington.edu) * Tom Henderson (tomhend@u.washington.edu) diff --git a/src/internet/model/global-routing.h b/src/internet/model/global-routing.h index 1b2986d9b..660604927 100644 --- a/src/internet/model/global-routing.h +++ b/src/internet/model/global-routing.h @@ -1,18 +1,7 @@ /* * Copyright 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/internet/model/icmpv4-l4-protocol.cc b/src/internet/model/icmpv4-l4-protocol.cc index 8f823b795..07bce25a1 100644 --- a/src/internet/model/icmpv4-l4-protocol.cc +++ b/src/internet/model/icmpv4-l4-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/icmpv4-l4-protocol.h b/src/internet/model/icmpv4-l4-protocol.h index 6f558bb0b..b236cc249 100644 --- a/src/internet/model/icmpv4-l4-protocol.h +++ b/src/internet/model/icmpv4-l4-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/icmpv4.cc b/src/internet/model/icmpv4.cc index 04cbb2f22..2c162839a 100644 --- a/src/internet/model/icmpv4.cc +++ b/src/internet/model/icmpv4.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/icmpv4.h b/src/internet/model/icmpv4.h index b3c110aed..5f5da039b 100644 --- a/src/internet/model/icmpv4.h +++ b/src/internet/model/icmpv4.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/icmpv6-header.cc b/src/internet/model/icmpv6-header.cc index 3f12240fd..782eb1ce7 100644 --- a/src/internet/model/icmpv6-header.cc +++ b/src/internet/model/icmpv6-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Mehdi Benamor diff --git a/src/internet/model/icmpv6-header.h b/src/internet/model/icmpv6-header.h index d43030937..741ebb927 100644 --- a/src/internet/model/icmpv6-header.h +++ b/src/internet/model/icmpv6-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * Mehdi Benamor diff --git a/src/internet/model/icmpv6-l4-protocol.cc b/src/internet/model/icmpv6-l4-protocol.cc index 6d02650ed..b5d887bae 100644 --- a/src/internet/model/icmpv6-l4-protocol.cc +++ b/src/internet/model/icmpv6-l4-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * David Gross @@ -142,7 +131,16 @@ Icmpv6L4Protocol::GetTypeId() "Multicast RS maximum retransmission duration (0 means unbound).", TimeValue(Seconds(0)), MakeTimeAccessor(&Icmpv6L4Protocol::m_rsMaxRetransmissionDuration), - MakeTimeChecker()); + MakeTimeChecker()) + .AddTraceSource("DadFailure", + "Duplicate Address detected during DAD, the address is now INVALID", + MakeTraceSourceAccessor(&Icmpv6L4Protocol::m_dadFailureAddressTrace), + "ns3::Ipv6Address::TracedCallback") + .AddTraceSource( + "DadSuccess", + "Duplicate Address not detected during DAD, the address is now PREFERRED", + MakeTraceSourceAccessor(&Icmpv6L4Protocol::m_dadSuccessAddressTrace), + "ns3::Ipv6Address::TracedCallback"); return tid; } @@ -441,6 +439,15 @@ Icmpv6L4Protocol::HandleRA(Ptr packet, p->RemoveHeader(raHeader); + // If 'M' flag is set, we need to start DHCPv6. + if (raHeader.GetFlagM()) + { + if (!m_startDhcpv6.IsNull()) + { + m_startDhcpv6(ipv6->GetInterfaceForDevice(interface->GetDevice())); + } + } + if (raHeader.GetLifeTime()) { defaultRouter = src; @@ -873,6 +880,7 @@ Icmpv6L4Protocol::HandleNA(Ptr packet, if (ifaddr.GetState() == Ipv6InterfaceAddress::TENTATIVE || ifaddr.GetState() == Ipv6InterfaceAddress::TENTATIVE_OPTIMISTIC) { + m_dadFailureAddressTrace(ifaddr.GetAddress()); interface->SetState(ifaddr.GetAddress(), Ipv6InterfaceAddress::INVALID); } } @@ -1853,6 +1861,7 @@ Icmpv6L4Protocol::FunctionDadTimeout(Ipv6Interface* interface, Ipv6Address addr) */ if (found && ifaddr.GetState() != Ipv6InterfaceAddress::INVALID) { + m_dadSuccessAddressTrace(ifaddr.GetAddress()); interface->SetState(ifaddr.GetAddress(), Ipv6InterfaceAddress::PREFERRED); NS_LOG_LOGIC("DAD OK, interface in state PREFERRED"); diff --git a/src/internet/model/icmpv6-l4-protocol.h b/src/internet/model/icmpv6-l4-protocol.h index 7f9802626..d0e3bbc25 100644 --- a/src/internet/model/icmpv6-l4-protocol.h +++ b/src/internet/model/icmpv6-l4-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent * David Gross @@ -28,6 +17,7 @@ #include "ns3/ipv6-address.h" #include "ns3/random-variable-stream.h" +#include "ns3/traced-callback.h" #include @@ -423,6 +413,16 @@ class Icmpv6L4Protocol : public IpL4Protocol */ Time GetDadTimeout() const; + /** + * Set DHCPv6 callback. + * Invoked when an RA is received with the M flag set. + * \param cb the callback function + */ + void SetDhcpv6Callback(Callback cb) + { + m_startDhcpv6 = cb; + } + protected: /** * \brief Dispose this object. @@ -697,6 +697,25 @@ class Icmpv6L4Protocol : public IpL4Protocol EventId m_handleRsTimeoutEvent; IpL4Protocol::DownTargetCallback6 m_downTarget; //!< callback to Ipv6::Send + + /** + * The trace fired when a DAD fails, changing the address state to INVALID. + * Includes the address whose state has been changed. + */ + ns3::TracedCallback m_dadFailureAddressTrace; + + /** + * The trace fired when a DAD completes and no duplicate address has + * been detected. The address state changes to PREFERRED. + * Includes the address whose state has been changed. + */ + ns3::TracedCallback m_dadSuccessAddressTrace; + + /** + * The DHCPv6 callback when the M flag is set in a Router Advertisement. + * Includes the interface on which the RA was received. + */ + Callback m_startDhcpv6; }; } /* namespace ns3 */ diff --git a/src/internet/model/ip-l4-protocol.cc b/src/internet/model/ip-l4-protocol.cc index 775e63e1f..a527b9a78 100644 --- a/src/internet/model/ip-l4-protocol.cc +++ b/src/internet/model/ip-l4-protocol.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // diff --git a/src/internet/model/ip-l4-protocol.h b/src/internet/model/ip-l4-protocol.h index b2d0e01a3..418382671 100644 --- a/src/internet/model/ip-l4-protocol.h +++ b/src/internet/model/ip-l4-protocol.h @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // diff --git a/src/internet/model/ipv4-address-generator.cc b/src/internet/model/ipv4-address-generator.cc index 9181f8c02..aab7bb3c8 100644 --- a/src/internet/model/ipv4-address-generator.cc +++ b/src/internet/model/ipv4-address-generator.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv4-address-generator.h" diff --git a/src/internet/model/ipv4-address-generator.h b/src/internet/model/ipv4-address-generator.h index ab1d394ce..4b21e486a 100644 --- a/src/internet/model/ipv4-address-generator.h +++ b/src/internet/model/ipv4-address-generator.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_ADDRESS_GENERATOR_H diff --git a/src/internet/model/ipv4-end-point-demux.cc b/src/internet/model/ipv4-end-point-demux.cc index c23018a07..f9b0c0670 100644 --- a/src/internet/model/ipv4-end-point-demux.cc +++ b/src/internet/model/ipv4-end-point-demux.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-end-point-demux.h b/src/internet/model/ipv4-end-point-demux.h index bbec6370c..61e3d3903 100644 --- a/src/internet/model/ipv4-end-point-demux.h +++ b/src/internet/model/ipv4-end-point-demux.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-end-point.cc b/src/internet/model/ipv4-end-point.cc index 0bfc3814f..402397079 100644 --- a/src/internet/model/ipv4-end-point.cc +++ b/src/internet/model/ipv4-end-point.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-end-point.h b/src/internet/model/ipv4-end-point.h index ba96bbfb2..3cd762f8c 100644 --- a/src/internet/model/ipv4-end-point.h +++ b/src/internet/model/ipv4-end-point.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-global-routing.cc b/src/internet/model/ipv4-global-routing.cc index bf8f5deb1..8dbb4b1ff 100644 --- a/src/internet/model/ipv4-global-routing.cc +++ b/src/internet/model/ipv4-global-routing.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2008 University of Washington // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // #include "ipv4-global-routing.h" diff --git a/src/internet/model/ipv4-global-routing.h b/src/internet/model/ipv4-global-routing.h index 27322f4f4..5b053f4d9 100644 --- a/src/internet/model/ipv4-global-routing.h +++ b/src/internet/model/ipv4-global-routing.h @@ -1,19 +1,7 @@ // // Copyright (c) 2008 University of Washington // -// 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 -// +// SPDX-License-Identifier: GPL-2.0-only // #ifndef IPV4_GLOBAL_ROUTING_H diff --git a/src/internet/model/ipv4-header.cc b/src/internet/model/ipv4-header.cc index 31cacf900..b6f556552 100644 --- a/src/internet/model/ipv4-header.cc +++ b/src/internet/model/ipv4-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-header.h b/src/internet/model/ipv4-header.h index c5d8d218c..5ce850ab0 100644 --- a/src/internet/model/ipv4-header.h +++ b/src/internet/model/ipv4-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-interface-address.cc b/src/internet/model/ipv4-interface-address.cc index 3b7c79b60..893f7aa77 100644 --- a/src/internet/model/ipv4-interface-address.cc +++ b/src/internet/model/ipv4-interface-address.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-interface-address.h b/src/internet/model/ipv4-interface-address.h index d046fb5f7..0612ca830 100644 --- a/src/internet/model/ipv4-interface-address.h +++ b/src/internet/model/ipv4-interface-address.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/internet/model/ipv4-interface.cc b/src/internet/model/ipv4-interface.cc index 334ec3265..05f24e34d 100644 --- a/src/internet/model/ipv4-interface.cc +++ b/src/internet/model/ipv4-interface.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-interface.h b/src/internet/model/ipv4-interface.h index 1f9ba2969..434a81342 100644 --- a/src/internet/model/ipv4-interface.h +++ b/src/internet/model/ipv4-interface.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005,2006,2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: * Mathieu Lacage , diff --git a/src/internet/model/ipv4-l3-protocol.cc b/src/internet/model/ipv4-l3-protocol.cc index 469086b17..5cd008163 100644 --- a/src/internet/model/ipv4-l3-protocol.cc +++ b/src/internet/model/ipv4-l3-protocol.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // diff --git a/src/internet/model/ipv4-l3-protocol.h b/src/internet/model/ipv4-l3-protocol.h index e8c0c55c7..f754f8152 100644 --- a/src/internet/model/ipv4-l3-protocol.h +++ b/src/internet/model/ipv4-l3-protocol.h @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // @@ -256,6 +245,7 @@ class Ipv4L3Protocol : public Ipv4 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal typedef void (*TxRxTracedCallback)(Ptr packet, Ptr ipv4, uint32_t interface); @@ -271,6 +261,7 @@ class Ipv4L3Protocol : public Ipv4 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal typedef void (*DropTracedCallback)(const Ipv4Header& header, Ptr packet, DropReason reason, @@ -297,8 +288,10 @@ class Ipv4L3Protocol : public Ipv4 void SetIpForward(bool forward) override; bool GetIpForward() const override; + /** \copydoc Ipv4::SetWeakEsModel */ NS_DEPRECATED_3_41("Use SetStrongEndSystemModel instead") void SetWeakEsModel(bool model) override; + /** \copydoc Ipv4::GetWeakEsModel */ NS_DEPRECATED_3_41("Use GetStrongEndSystemModel instead") bool GetWeakEsModel() const override; @@ -490,15 +483,18 @@ class Ipv4L3Protocol : public Ipv4 /// Trace of transmitted packets /// \deprecated The non-const \c Ptr argument is deprecated /// and will be changed to \c Ptr in a future release. + // NS_DEPRECATED() - tag for future removal TracedCallback, Ptr, uint32_t> m_txTrace; /// Trace of received packets /// \deprecated The non-const \c Ptr argument is deprecated /// and will be changed to \c Ptr in a future release. + // NS_DEPRECATED() - tag for future removal TracedCallback, Ptr, uint32_t> m_rxTrace; // (ifindex not valid if reason is DROP_NO_ROUTE) /// Trace of dropped packets /// \deprecated The non-const \c Ptr argument is deprecated /// and will be changed to \c Ptr in a future release. + // NS_DEPRECATED() - tag for future removal TracedCallback, DropReason, Ptr, uint32_t> m_dropTrace; diff --git a/src/internet/model/ipv4-list-routing.cc b/src/internet/model/ipv4-list-routing.cc index b3bd1e306..fe2f1188b 100644 --- a/src/internet/model/ipv4-list-routing.cc +++ b/src/internet/model/ipv4-list-routing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/internet/model/ipv4-list-routing.h b/src/internet/model/ipv4-list-routing.h index 2eefd6afe..75db95f95 100644 --- a/src/internet/model/ipv4-list-routing.h +++ b/src/internet/model/ipv4-list-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_LIST_ROUTING_H diff --git a/src/internet/model/ipv4-packet-filter.cc b/src/internet/model/ipv4-packet-filter.cc index d4d52ce9d..d202f078d 100644 --- a/src/internet/model/ipv4-packet-filter.cc +++ b/src/internet/model/ipv4-packet-filter.cc @@ -2,18 +2,7 @@ * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * 2016 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Stefano Avallone * Tom Henderson diff --git a/src/internet/model/ipv4-packet-filter.h b/src/internet/model/ipv4-packet-filter.h index 7dc24714c..8c0d68685 100644 --- a/src/internet/model/ipv4-packet-filter.h +++ b/src/internet/model/ipv4-packet-filter.h @@ -2,18 +2,7 @@ * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * 2016 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Stefano Avallone * Tom Henderson diff --git a/src/internet/model/ipv4-packet-info-tag.cc b/src/internet/model/ipv4-packet-info-tag.cc index 3712745f9..8f5a6671c 100644 --- a/src/internet/model/ipv4-packet-info-tag.cc +++ b/src/internet/model/ipv4-packet-info-tag.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hajime Tazaki * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hajime Tazaki */ diff --git a/src/internet/model/ipv4-packet-info-tag.h b/src/internet/model/ipv4-packet-info-tag.h index c0e672b9b..7b8366467 100644 --- a/src/internet/model/ipv4-packet-info-tag.h +++ b/src/internet/model/ipv4-packet-info-tag.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hajime Tazaki * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hajime Tazaki */ diff --git a/src/internet/model/ipv4-packet-probe.cc b/src/internet/model/ipv4-packet-probe.cc index 0c5ffa0fe..33f13e426 100644 --- a/src/internet/model/ipv4-packet-probe.cc +++ b/src/internet/model/ipv4-packet-probe.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/internet/model/ipv4-packet-probe.h b/src/internet/model/ipv4-packet-probe.h index 400e30033..9a486698b 100644 --- a/src/internet/model/ipv4-packet-probe.h +++ b/src/internet/model/ipv4-packet-probe.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/internet/model/ipv4-queue-disc-item.cc b/src/internet/model/ipv4-queue-disc-item.cc index 24ce79d24..852241d7c 100644 --- a/src/internet/model/ipv4-queue-disc-item.cc +++ b/src/internet/model/ipv4-queue-disc-item.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv4-queue-disc-item.h" diff --git a/src/internet/model/ipv4-queue-disc-item.h b/src/internet/model/ipv4-queue-disc-item.h index 361e14b0d..4747c79c5 100644 --- a/src/internet/model/ipv4-queue-disc-item.h +++ b/src/internet/model/ipv4-queue-disc-item.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_QUEUE_DISC_ITEM_H diff --git a/src/internet/model/ipv4-raw-socket-factory-impl.cc b/src/internet/model/ipv4-raw-socket-factory-impl.cc index a3a10e55d..ef2689846 100644 --- a/src/internet/model/ipv4-raw-socket-factory-impl.cc +++ b/src/internet/model/ipv4-raw-socket-factory-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-raw-socket-factory-impl.h b/src/internet/model/ipv4-raw-socket-factory-impl.h index 552c272e3..beebd25fa 100644 --- a/src/internet/model/ipv4-raw-socket-factory-impl.h +++ b/src/internet/model/ipv4-raw-socket-factory-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-raw-socket-factory.cc b/src/internet/model/ipv4-raw-socket-factory.cc index 2f1fcad41..e4c813246 100644 --- a/src/internet/model/ipv4-raw-socket-factory.cc +++ b/src/internet/model/ipv4-raw-socket-factory.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-raw-socket-factory.h b/src/internet/model/ipv4-raw-socket-factory.h index ec8d1924e..5495869d7 100644 --- a/src/internet/model/ipv4-raw-socket-factory.h +++ b/src/internet/model/ipv4-raw-socket-factory.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-route.cc b/src/internet/model/ipv4-route.cc index ffddaa9e9..a8da225cf 100644 --- a/src/internet/model/ipv4-route.cc +++ b/src/internet/model/ipv4-route.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/internet/model/ipv4-route.h b/src/internet/model/ipv4-route.h index 9d77f13b8..a2712eacb 100644 --- a/src/internet/model/ipv4-route.h +++ b/src/internet/model/ipv4-route.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ #ifndef IPV4_ROUTE_H @@ -33,7 +22,7 @@ class NetDevice; /** * \ingroup ipv4Routing * - *\brief IPv4 route cache entry (similar to Linux struct rtable) + * \brief IPv4 route cache entry (similar to Linux struct rtable) * * This is a reference counted object. In the future, we will add other * entries from struct dst_entry, struct rtable, and struct dst_ops as needed. diff --git a/src/internet/model/ipv4-routing-protocol.cc b/src/internet/model/ipv4-routing-protocol.cc index e8cb7d90e..60e93f6dc 100644 --- a/src/internet/model/ipv4-routing-protocol.cc +++ b/src/internet/model/ipv4-routing-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv4-routing-protocol.h" diff --git a/src/internet/model/ipv4-routing-protocol.h b/src/internet/model/ipv4-routing-protocol.h index ba5f7b976..b1781c4ef 100644 --- a/src/internet/model/ipv4-routing-protocol.h +++ b/src/internet/model/ipv4-routing-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV4_ROUTING_PROTOCOL_H #define IPV4_ROUTING_PROTOCOL_H diff --git a/src/internet/model/ipv4-routing-table-entry.cc b/src/internet/model/ipv4-routing-table-entry.cc index e4ec9115e..01ae870ea 100644 --- a/src/internet/model/ipv4-routing-table-entry.cc +++ b/src/internet/model/ipv4-routing-table-entry.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-routing-table-entry.h b/src/internet/model/ipv4-routing-table-entry.h index 38f6d9fac..77aed3098 100644 --- a/src/internet/model/ipv4-routing-table-entry.h +++ b/src/internet/model/ipv4-routing-table-entry.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2005 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4-static-routing.cc b/src/internet/model/ipv4-static-routing.cc index 2d81e8d36..13f086f28 100644 --- a/src/internet/model/ipv4-static-routing.cc +++ b/src/internet/model/ipv4-static-routing.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: George F. Riley // Gustavo Carneiro diff --git a/src/internet/model/ipv4-static-routing.h b/src/internet/model/ipv4-static-routing.h index 8efde3a82..e9af855ae 100644 --- a/src/internet/model/ipv4-static-routing.h +++ b/src/internet/model/ipv4-static-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2006 Georgia Tech Research Corporation * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: George F. Riley * Gustavo Carneiro diff --git a/src/internet/model/ipv4.cc b/src/internet/model/ipv4.cc index 3059120e2..f0cbd0d16 100644 --- a/src/internet/model/ipv4.cc +++ b/src/internet/model/ipv4.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv4.h b/src/internet/model/ipv4.h index 72c194504..4dd76ada9 100644 --- a/src/internet/model/ipv4.h +++ b/src/internet/model/ipv4.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ @@ -460,7 +449,6 @@ class Ipv4 : public Object * * RFC1122 term for whether host accepts datagram with a dest. address on another interface * \returns true for Weak Es Model activated - * \deprecated Deprecated since ns-3.41. Use SetStrongEndSystemModel instead. */ NS_DEPRECATED_3_41("Use GetStrongEndSystemModel instead") virtual bool GetWeakEsModel() const = 0; @@ -470,7 +458,6 @@ class Ipv4 : public Object * * RFC1122 term for whether host accepts datagram with a dest. address on another interface * \param model true for Weak Es Model - * \deprecated Deprecated since ns-3.41. Use SetStrongEndSystemModel instead. */ NS_DEPRECATED_3_41("Use SetStrongEndSystemModel instead") virtual void SetWeakEsModel(bool model) = 0; diff --git a/src/internet/model/ipv6-address-generator.cc b/src/internet/model/ipv6-address-generator.cc index 031d7b166..a24b39513 100644 --- a/src/internet/model/ipv6-address-generator.cc +++ b/src/internet/model/ipv6-address-generator.cc @@ -2,18 +2,7 @@ * Copyright (c) 2008 University of Washington * Copyright (c) 2011 Atishay Jain * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv6-address-generator.h" diff --git a/src/internet/model/ipv6-address-generator.h b/src/internet/model/ipv6-address-generator.h index 40d1059dc..5eb614c3b 100644 --- a/src/internet/model/ipv6-address-generator.h +++ b/src/internet/model/ipv6-address-generator.h @@ -2,18 +2,7 @@ * Copyright (c) 2008 University of Washington * Copyright (c) 2011 Atishay Jain * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV6_ADDRESS_GENERATOR_H diff --git a/src/internet/model/ipv6-autoconfigured-prefix.cc b/src/internet/model/ipv6-autoconfigured-prefix.cc index 27e824833..2a9f3ca4b 100644 --- a/src/internet/model/ipv6-autoconfigured-prefix.cc +++ b/src/internet/model/ipv6-autoconfigured-prefix.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mehdi Benamor */ diff --git a/src/internet/model/ipv6-autoconfigured-prefix.h b/src/internet/model/ipv6-autoconfigured-prefix.h index b924f3076..dd2bc1185 100644 --- a/src/internet/model/ipv6-autoconfigured-prefix.h +++ b/src/internet/model/ipv6-autoconfigured-prefix.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mehdi Benamor */ diff --git a/src/internet/model/ipv6-end-point-demux.cc b/src/internet/model/ipv6-end-point-demux.cc index f22a72811..9ff19c5d1 100644 --- a/src/internet/model/ipv6-end-point-demux.cc +++ b/src/internet/model/ipv6-end-point-demux.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-end-point-demux.h b/src/internet/model/ipv6-end-point-demux.h index 441043f6d..4b3e22603 100644 --- a/src/internet/model/ipv6-end-point-demux.h +++ b/src/internet/model/ipv6-end-point-demux.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-end-point.cc b/src/internet/model/ipv6-end-point.cc index 7daaeebed..c1aea8f1b 100644 --- a/src/internet/model/ipv6-end-point.cc +++ b/src/internet/model/ipv6-end-point.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-end-point.h b/src/internet/model/ipv6-end-point.h index e7d3dfd4a..cad346c3f 100644 --- a/src/internet/model/ipv6-end-point.h +++ b/src/internet/model/ipv6-end-point.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-extension-demux.cc b/src/internet/model/ipv6-extension-demux.cc index f7e9eb45d..9a30238e7 100644 --- a/src/internet/model/ipv6-extension-demux.cc +++ b/src/internet/model/ipv6-extension-demux.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-extension-demux.h b/src/internet/model/ipv6-extension-demux.h index 4cf36510d..95df0a33e 100644 --- a/src/internet/model/ipv6-extension-demux.h +++ b/src/internet/model/ipv6-extension-demux.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-extension-header.cc b/src/internet/model/ipv6-extension-header.cc index 154da98c5..82fa47a2c 100644 --- a/src/internet/model/ipv6-extension-header.cc +++ b/src/internet/model/ipv6-extension-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-extension-header.h b/src/internet/model/ipv6-extension-header.h index 82c4a6d04..a68b3f864 100644 --- a/src/internet/model/ipv6-extension-header.h +++ b/src/internet/model/ipv6-extension-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-extension.cc b/src/internet/model/ipv6-extension.cc index 8f66e5978..42905b2cc 100644 --- a/src/internet/model/ipv6-extension.cc +++ b/src/internet/model/ipv6-extension.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-extension.h b/src/internet/model/ipv6-extension.h index 627978633..4d1149016 100644 --- a/src/internet/model/ipv6-extension.h +++ b/src/internet/model/ipv6-extension.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-header.cc b/src/internet/model/ipv6-header.cc index 94f500e3a..bcb7310f9 100644 --- a/src/internet/model/ipv6-header.cc +++ b/src/internet/model/ipv6-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2008 Louis Pasteur University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-header.h b/src/internet/model/ipv6-header.h index 073863a9b..1e82034ae 100644 --- a/src/internet/model/ipv6-header.h +++ b/src/internet/model/ipv6-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2008 Louis Pasteur University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-interface-address.cc b/src/internet/model/ipv6-interface-address.cc index 17da9b1c7..683cdd54d 100644 --- a/src/internet/model/ipv6-interface-address.cc +++ b/src/internet/model/ipv6-interface-address.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-interface-address.h b/src/internet/model/ipv6-interface-address.h index ee0f56731..9e98f863c 100644 --- a/src/internet/model/ipv6-interface-address.h +++ b/src/internet/model/ipv6-interface-address.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-interface.cc b/src/internet/model/ipv6-interface.cc index a2ee722a5..4768fb5b2 100644 --- a/src/internet/model/ipv6-interface.cc +++ b/src/internet/model/ipv6-interface.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-interface.h b/src/internet/model/ipv6-interface.h index 8497ed356..e6c739564 100644 --- a/src/internet/model/ipv6-interface.h +++ b/src/internet/model/ipv6-interface.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-l3-protocol.cc b/src/internet/model/ipv6-l3-protocol.cc index f90c46aef..9714494ad 100644 --- a/src/internet/model/ipv6-l3-protocol.cc +++ b/src/internet/model/ipv6-l3-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-l3-protocol.h b/src/internet/model/ipv6-l3-protocol.h index 8dec87998..3b52c3879 100644 --- a/src/internet/model/ipv6-l3-protocol.h +++ b/src/internet/model/ipv6-l3-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ @@ -405,6 +394,7 @@ class Ipv6L3Protocol : public Ipv6 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal typedef void (*TxRxTracedCallback)(Ptr packet, Ptr ipv6, uint32_t interface); @@ -420,6 +410,7 @@ class Ipv6L3Protocol : public Ipv6 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal typedef void (*DropTracedCallback)(const Ipv6Header& header, Ptr packet, DropReason reason, @@ -568,6 +559,7 @@ class Ipv6L3Protocol : public Ipv6 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal TracedCallback, Ptr, uint32_t> m_txTrace; /** @@ -575,6 +567,7 @@ class Ipv6L3Protocol : public Ipv6 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal TracedCallback, Ptr, uint32_t> m_rxTrace; /** @@ -582,6 +575,7 @@ class Ipv6L3Protocol : public Ipv6 * \deprecated The non-const \c Ptr argument is deprecated * and will be changed to \c Ptr in a future release. */ + // NS_DEPRECATED() - tag for future removal TracedCallback, DropReason, Ptr, uint32_t> m_dropTrace; diff --git a/src/internet/model/ipv6-list-routing.cc b/src/internet/model/ipv6-list-routing.cc index 32b041b2e..b191ecab9 100644 --- a/src/internet/model/ipv6-list-routing.cc +++ b/src/internet/model/ipv6-list-routing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * */ diff --git a/src/internet/model/ipv6-list-routing.h b/src/internet/model/ipv6-list-routing.h index 7d54820bf..93b972a27 100644 --- a/src/internet/model/ipv6-list-routing.h +++ b/src/internet/model/ipv6-list-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV6_LIST_ROUTING_H diff --git a/src/internet/model/ipv6-option-demux.cc b/src/internet/model/ipv6-option-demux.cc index 4f8ea668a..def6f16fd 100644 --- a/src/internet/model/ipv6-option-demux.cc +++ b/src/internet/model/ipv6-option-demux.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-option-demux.h b/src/internet/model/ipv6-option-demux.h index e6e155d3d..5e8a1ae46 100644 --- a/src/internet/model/ipv6-option-demux.h +++ b/src/internet/model/ipv6-option-demux.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-option-header.cc b/src/internet/model/ipv6-option-header.cc index d4af08cde..6793ecf51 100644 --- a/src/internet/model/ipv6-option-header.cc +++ b/src/internet/model/ipv6-option-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-option-header.h b/src/internet/model/ipv6-option-header.h index bcda20f22..b92d1489f 100644 --- a/src/internet/model/ipv6-option-header.h +++ b/src/internet/model/ipv6-option-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-option.cc b/src/internet/model/ipv6-option.cc index fcd435de0..5f64195d8 100644 --- a/src/internet/model/ipv6-option.cc +++ b/src/internet/model/ipv6-option.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-option.h b/src/internet/model/ipv6-option.h index 5b4bb17cf..4b4c58105 100644 --- a/src/internet/model/ipv6-option.h +++ b/src/internet/model/ipv6-option.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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, MA02111-1307USA + * SPDX-License-Identifier: GPL-2.0-only * * Author: David Gross */ diff --git a/src/internet/model/ipv6-packet-filter.cc b/src/internet/model/ipv6-packet-filter.cc index 27a9de98f..186f672cc 100644 --- a/src/internet/model/ipv6-packet-filter.cc +++ b/src/internet/model/ipv6-packet-filter.cc @@ -2,18 +2,7 @@ * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * 2016 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Stefano Avallone * Tom Henderson diff --git a/src/internet/model/ipv6-packet-filter.h b/src/internet/model/ipv6-packet-filter.h index a6cc93dbb..7d51eaf4c 100644 --- a/src/internet/model/ipv6-packet-filter.h +++ b/src/internet/model/ipv6-packet-filter.h @@ -2,18 +2,7 @@ * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * 2016 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Stefano Avallone * Tom Henderson diff --git a/src/internet/model/ipv6-packet-info-tag.cc b/src/internet/model/ipv6-packet-info-tag.cc index 541a30147..092548e3c 100644 --- a/src/internet/model/ipv6-packet-info-tag.cc +++ b/src/internet/model/ipv6-packet-info-tag.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hajime Tazaki * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hajime Tazaki */ diff --git a/src/internet/model/ipv6-packet-info-tag.h b/src/internet/model/ipv6-packet-info-tag.h index ebc3e43d3..d94005f38 100644 --- a/src/internet/model/ipv6-packet-info-tag.h +++ b/src/internet/model/ipv6-packet-info-tag.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2010 Hajime Tazaki * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Hajime Tazaki */ diff --git a/src/internet/model/ipv6-packet-probe.cc b/src/internet/model/ipv6-packet-probe.cc index a382b6c43..e4f77d045 100644 --- a/src/internet/model/ipv6-packet-probe.cc +++ b/src/internet/model/ipv6-packet-probe.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/internet/model/ipv6-packet-probe.h b/src/internet/model/ipv6-packet-probe.h index 7016ce6c0..091a345bf 100644 --- a/src/internet/model/ipv6-packet-probe.h +++ b/src/internet/model/ipv6-packet-probe.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2011 Bucknell University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: L. Felipe Perrone (perrone@bucknell.edu) * Tiago G. Rodrigues (tgr002@bucknell.edu) diff --git a/src/internet/model/ipv6-pmtu-cache.cc b/src/internet/model/ipv6-pmtu-cache.cc index 3f5c156e8..741cdb61a 100644 --- a/src/internet/model/ipv6-pmtu-cache.cc +++ b/src/internet/model/ipv6-pmtu-cache.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ipv6-pmtu-cache.h b/src/internet/model/ipv6-pmtu-cache.h index a5e9237d9..98d28a061 100644 --- a/src/internet/model/ipv6-pmtu-cache.h +++ b/src/internet/model/ipv6-pmtu-cache.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2013 Universita' di Firenze * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ipv6-queue-disc-item.cc b/src/internet/model/ipv6-queue-disc-item.cc index e010832e5..22a6e51c1 100644 --- a/src/internet/model/ipv6-queue-disc-item.cc +++ b/src/internet/model/ipv6-queue-disc-item.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #include "ipv6-queue-disc-item.h" diff --git a/src/internet/model/ipv6-queue-disc-item.h b/src/internet/model/ipv6-queue-disc-item.h index 7c84be98d..657f0eed4 100644 --- a/src/internet/model/ipv6-queue-disc-item.h +++ b/src/internet/model/ipv6-queue-disc-item.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ #ifndef IPV6_QUEUE_DISC_ITEM_H diff --git a/src/internet/model/ipv6-raw-socket-factory-impl.cc b/src/internet/model/ipv6-raw-socket-factory-impl.cc index fc7a019b7..6b31322cc 100644 --- a/src/internet/model/ipv6-raw-socket-factory-impl.cc +++ b/src/internet/model/ipv6-raw-socket-factory-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv6-raw-socket-factory-impl.h b/src/internet/model/ipv6-raw-socket-factory-impl.h index 050cf1904..09363fb38 100644 --- a/src/internet/model/ipv6-raw-socket-factory-impl.h +++ b/src/internet/model/ipv6-raw-socket-factory-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv6-raw-socket-factory.cc b/src/internet/model/ipv6-raw-socket-factory.cc index 6942667a0..c1b8adb3d 100644 --- a/src/internet/model/ipv6-raw-socket-factory.cc +++ b/src/internet/model/ipv6-raw-socket-factory.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv6-raw-socket-factory.h b/src/internet/model/ipv6-raw-socket-factory.h index 9130e12e3..8403304c0 100644 --- a/src/internet/model/ipv6-raw-socket-factory.h +++ b/src/internet/model/ipv6-raw-socket-factory.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv6-raw-socket-impl.cc b/src/internet/model/ipv6-raw-socket-impl.cc index 9fadddabe..18e72d0d7 100644 --- a/src/internet/model/ipv6-raw-socket-impl.cc +++ b/src/internet/model/ipv6-raw-socket-impl.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-raw-socket-impl.h b/src/internet/model/ipv6-raw-socket-impl.h index 8d8d31d71..8c9d9b629 100644 --- a/src/internet/model/ipv6-raw-socket-impl.h +++ b/src/internet/model/ipv6-raw-socket-impl.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-route.cc b/src/internet/model/ipv6-route.cc index abb82fd37..d558b361e 100644 --- a/src/internet/model/ipv6-route.cc +++ b/src/internet/model/ipv6-route.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-route.h b/src/internet/model/ipv6-route.h index 58b9035eb..2fdef233e 100644 --- a/src/internet/model/ipv6-route.h +++ b/src/internet/model/ipv6-route.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-routing-protocol.cc b/src/internet/model/ipv6-routing-protocol.cc index c073d20a5..9cf5aa5d4 100644 --- a/src/internet/model/ipv6-routing-protocol.cc +++ b/src/internet/model/ipv6-routing-protocol.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ /* taken from src/node/ipv4-routing-protocol.cc and adapted to IPv6 */ diff --git a/src/internet/model/ipv6-routing-protocol.h b/src/internet/model/ipv6-routing-protocol.h index b9cbcb700..c56122d41 100644 --- a/src/internet/model/ipv6-routing-protocol.h +++ b/src/internet/model/ipv6-routing-protocol.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2009 University of Washington * - * 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 + * SPDX-License-Identifier: GPL-2.0-only */ /* taken from src/node/ipv4-routing-protocol.h and adapted to IPv6 */ diff --git a/src/internet/model/ipv6-routing-table-entry.cc b/src/internet/model/ipv6-routing-table-entry.cc index 94464d117..1cd962185 100644 --- a/src/internet/model/ipv6-routing-table-entry.cc +++ b/src/internet/model/ipv6-routing-table-entry.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-routing-table-entry.h b/src/internet/model/ipv6-routing-table-entry.h index 7014fa27f..c54f9913d 100644 --- a/src/internet/model/ipv6-routing-table-entry.h +++ b/src/internet/model/ipv6-routing-table-entry.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-static-routing.cc b/src/internet/model/ipv6-static-routing.cc index b3c086d04..1ab9ed1d4 100644 --- a/src/internet/model/ipv6-static-routing.cc +++ b/src/internet/model/ipv6-static-routing.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6-static-routing.h b/src/internet/model/ipv6-static-routing.h index bac08249e..0f11101b8 100644 --- a/src/internet/model/ipv6-static-routing.h +++ b/src/internet/model/ipv6-static-routing.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ipv6.cc b/src/internet/model/ipv6.cc index f41de0e36..9fc383ea0 100644 --- a/src/internet/model/ipv6.cc +++ b/src/internet/model/ipv6.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ipv6.h b/src/internet/model/ipv6.h index 99976fd4e..680391252 100644 --- a/src/internet/model/ipv6.h +++ b/src/internet/model/ipv6.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/loopback-net-device.cc b/src/internet/model/loopback-net-device.cc index bb02588c2..9e2aa92d1 100644 --- a/src/internet/model/loopback-net-device.cc +++ b/src/internet/model/loopback-net-device.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/loopback-net-device.h b/src/internet/model/loopback-net-device.h index 2a5df2769..c33d36996 100644 --- a/src/internet/model/loopback-net-device.h +++ b/src/internet/model/loopback-net-device.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2008 INRIA * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Mathieu Lacage */ diff --git a/src/internet/model/ndisc-cache.cc b/src/internet/model/ndisc-cache.cc index 3f9b97095..db3723018 100644 --- a/src/internet/model/ndisc-cache.cc +++ b/src/internet/model/ndisc-cache.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/ndisc-cache.h b/src/internet/model/ndisc-cache.h index 8186b1b80..ee3d6fc1e 100644 --- a/src/internet/model/ndisc-cache.h +++ b/src/internet/model/ndisc-cache.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2007-2009 Strasbourg University * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Sebastien Vincent */ diff --git a/src/internet/model/rip-header.cc b/src/internet/model/rip-header.cc index 766412e86..795ff165b 100644 --- a/src/internet/model/rip-header.cc +++ b/src/internet/model/rip-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/rip-header.h b/src/internet/model/rip-header.h index 7a6f75959..65404d70d 100644 --- a/src/internet/model/rip-header.h +++ b/src/internet/model/rip-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/rip.cc b/src/internet/model/rip.cc index acba6fdf6..1d0c0c0b1 100644 --- a/src/internet/model/rip.cc +++ b/src/internet/model/rip.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/rip.h b/src/internet/model/rip.h index ba3908944..889d6f0fc 100644 --- a/src/internet/model/rip.h +++ b/src/internet/model/rip.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2016 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ripng-header.cc b/src/internet/model/ripng-header.cc index 3deb38d71..836d907aa 100644 --- a/src/internet/model/ripng-header.cc +++ b/src/internet/model/ripng-header.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ripng-header.h b/src/internet/model/ripng-header.h index 1351f6b2b..da8ab21ee 100644 --- a/src/internet/model/ripng-header.h +++ b/src/internet/model/ripng-header.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ripng.cc b/src/internet/model/ripng.cc index 45b10ef87..6abbfe021 100644 --- a/src/internet/model/ripng.cc +++ b/src/internet/model/ripng.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/ripng.h b/src/internet/model/ripng.h index da1365709..0551532fe 100644 --- a/src/internet/model/ripng.h +++ b/src/internet/model/ripng.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2014 Universita' di Firenze, Italy * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Author: Tommaso Pecorella */ diff --git a/src/internet/model/rtt-estimator.cc b/src/internet/model/rtt-estimator.cc index 65ab7f36d..8455a184d 100644 --- a/src/internet/model/rtt-estimator.cc +++ b/src/internet/model/rtt-estimator.cc @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Rajib Bhattacharjea // diff --git a/src/internet/model/rtt-estimator.h b/src/internet/model/rtt-estimator.h index e44fee895..ab5596b63 100644 --- a/src/internet/model/rtt-estimator.h +++ b/src/internet/model/rtt-estimator.h @@ -1,18 +1,7 @@ // // Copyright (c) 2006 Georgia Tech Research Corporation // -// 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 +// SPDX-License-Identifier: GPL-2.0-only // // Author: Rajib Bhattacharjea // diff --git a/src/internet/model/tcp-bbr.cc b/src/internet/model/tcp-bbr.cc index 889e66f03..58b5b5948 100644 --- a/src/internet/model/tcp-bbr.cc +++ b/src/internet/model/tcp-bbr.cc @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Vivek Jain * Viyom Mittal @@ -75,7 +64,20 @@ TcpBbr::GetTypeId() "Max allowed val for m_ackEpochAcked, after which sampling epoch is reset", UintegerValue(1 << 12), MakeUintegerAccessor(&TcpBbr::m_ackEpochAckedResetThresh), - MakeUintegerChecker()); + MakeUintegerChecker()) + .AddTraceSource("MinRtt", + "Estimated two-way round-trip propagation delay of the path, estimated " + "from the windowed minimum recent round-trip delay sample", + MakeTraceSourceAccessor(&TcpBbr::m_minRtt), + "ns3::TracedValueCallback::Time") + .AddTraceSource("PacingGain", + "The dynamic pacing gain factor", + MakeTraceSourceAccessor(&TcpBbr::m_pacingGain), + "ns3::TracedValueCallback::Double") + .AddTraceSource("CwndGain", + "The dynamic congestion window gain factor", + MakeTraceSourceAccessor(&TcpBbr::m_cWndGain), + "ns3::TracedValueCallback::Double"); return tid; } @@ -230,6 +232,7 @@ TcpBbr::SetPacingRate(Ptr tcb, double gain) if (m_isPipeFilled || rate > tcb->m_pacingRate) { tcb->m_pacingRate = rate; + NS_LOG_DEBUG("Pacing rate updated. New value: " << tcb->m_pacingRate); } } @@ -475,6 +478,7 @@ TcpBbr::UpdateTargetCwnd(Ptr tcb) uint32_t TcpBbr::AckAggregationCwnd() { + NS_LOG_FUNCTION(this); uint32_t maxAggrBytes; // MaxBW * 0.1 secs uint32_t aggrCwndBytes = 0; @@ -490,6 +494,7 @@ TcpBbr::AckAggregationCwnd() void TcpBbr::UpdateAckAggregation(Ptr tcb, const TcpRateOps::TcpRateSample& rs) { + NS_LOG_FUNCTION(this << tcb << rs); uint32_t expectedAcked; uint32_t extraAck; uint32_t epochProp; @@ -588,6 +593,7 @@ TcpBbr::SetCwnd(Ptr tcb, const TcpRateOps::TcpRateSample& rs) tcb->m_cWnd = tcb->m_cWnd.Get() + rs.m_ackedSacked; } tcb->m_cWnd = std::max(tcb->m_cWnd.Get(), m_minPipeCwnd); + NS_LOG_DEBUG("Congestion window updated. New value:" << tcb->m_cWnd); done: ModulateCwndForProbeRTT(tcb); @@ -711,7 +717,7 @@ TcpBbr::CongestionStateSet(Ptr tcb, const TcpSocketState::TcpCon if (newState == TcpSocketState::CA_OPEN && !m_isInitialized) { NS_LOG_DEBUG("CongestionStateSet triggered to CA_OPEN :: " << newState); - m_minRtt = tcb->m_lastRtt.Get() != Time::Max() ? tcb->m_lastRtt.Get() : Time::Max(); + m_minRtt = tcb->m_srtt.Get() != Time::Max() ? tcb->m_srtt.Get() : Time::Max(); m_minRttStamp = Simulator::Now(); m_priorCwnd = tcb->m_cWnd; tcb->m_ssThresh = tcb->m_initialSsThresh; diff --git a/src/internet/model/tcp-bbr.h b/src/internet/model/tcp-bbr.h index 4977cf1b6..2d629a4e8 100644 --- a/src/internet/model/tcp-bbr.h +++ b/src/internet/model/tcp-bbr.h @@ -1,18 +1,7 @@ /* * Copyright (c) 2018 NITK Surathkal * - * 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 + * SPDX-License-Identifier: GPL-2.0-only * * Authors: Vivek Jain * Viyom Mittal @@ -352,8 +341,8 @@ class TcpBbr : public TcpCongestionOps MaxBandwidthFilter_t m_maxBwFilter; //!< Maximum bandwidth filter uint32_t m_bandwidthWindowLength{0}; //!< A constant specifying the length of the BBR.BtlBw max //!< filter window, default 10 packet-timed round trips. - double m_pacingGain{0}; //!< The dynamic pacing gain factor - double m_cWndGain{0}; //!< The dynamic congestion window gain factor + TracedValue m_pacingGain{0}; //!< The dynamic pacing gain factor + TracedValue m_cWndGain{0}; //!< The dynamic congestion window gain factor double m_highGain{0}; //!< A constant specifying highest gain factor, default is 2.89 bool m_isPipeFilled{false}; //!< A boolean that records whether BBR has filled the pipe uint32_t m_minPipeCwnd{ @@ -373,7 +362,7 @@ class TcpBbr : public TcpCongestionOps uint32_t m_targetCWnd{0}; //!< Target value for congestion window, adapted to the estimated BDP DataRate m_fullBandwidth{0}; //!< Value of full bandwidth recorded uint32_t m_fullBandwidthCount{0}; //!< Count of full bandwidth recorded consistently - Time m_minRtt{ + TracedValue