Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 1 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | # |
Saurab Dulal | 576a419 | 2020-08-25 00:55:22 -0500 | [diff] [blame] | 3 | # Copyright (C) 2015-2020, The University of Memphis, |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 4 | # Arizona Board of Regents, |
| 5 | # Regents of the University of California. |
| 6 | # |
| 7 | # This file is part of Mini-NDN. |
| 8 | # See AUTHORS.md for a complete list of Mini-NDN authors and contributors. |
| 9 | # |
| 10 | # Mini-NDN is free software: you can redistribute it and/or modify |
| 11 | # it under the terms of the GNU General Public License as published by |
| 12 | # the Free Software Foundation, either version 3 of the License, or |
| 13 | # (at your option) any later version. |
| 14 | # |
| 15 | # Mini-NDN is distributed in the hope that it will be useful, |
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | # GNU General Public License for more details. |
| 19 | # |
| 20 | # You should have received a copy of the GNU General Public License |
| 21 | # along with Mini-NDN, e.g., in COPYING.md file. |
| 22 | # If not, see <http://www.gnu.org/licenses/>. |
| 23 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 24 | from mininet.log import setLogLevel, info |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 25 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 26 | from minindn.minindn import Minindn |
| 27 | from minindn.util import MiniNDNCLI |
| 28 | from minindn.apps.app_manager import AppManager |
| 29 | from minindn.apps.nfd import Nfd |
| 30 | from minindn.apps.nlsr import Nlsr |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 31 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 32 | if __name__ == '__main__': |
| 33 | setLogLevel('info') |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 34 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 35 | Minindn.cleanUp() |
| 36 | Minindn.verifyDependencies() |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 37 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 38 | ndn = Minindn() |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 39 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 40 | ndn.start() |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 41 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 42 | info('Starting NFD on nodes\n') |
| 43 | nfds = AppManager(ndn, ndn.net.hosts, Nfd) |
| 44 | info('Starting NLSR on nodes\n') |
| 45 | nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr) |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 46 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 47 | MiniNDNCLI(ndn.net) |
Philipp Moll | 61a2be8 | 2019-07-12 08:33:09 +0200 | [diff] [blame] | 48 | |
Ashlesh Gawande | 6c86e30 | 2019-09-17 22:27:05 -0500 | [diff] [blame] | 49 | ndn.stop() |