diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2015-02-25 10:26:19 +0900 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2015-02-25 13:50:49 +0900 |
| commit | 3667936aadcabddc708797ac38ce1ffb2f992cb3 (patch) | |
| tree | 5b2945957c1f42dc3dbcfb68555dc524b49b4161 /server/NetworkController.cpp | |
| parent | 799625cd5b0a2191632f5b042bf9ff559c18a848 (diff) | |
Add a dummy network that discards all packets.
Bug: 19500693
Change-Id: Ic25f2d8c481f1528e887e43ca3fa868189582110
Diffstat (limited to 'server/NetworkController.cpp')
| -rw-r--r-- | server/NetworkController.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/NetworkController.cpp b/server/NetworkController.cpp index 20d8e977..76e4a6af 100644 --- a/server/NetworkController.cpp +++ b/server/NetworkController.cpp @@ -32,6 +32,7 @@ #include "NetworkController.h" +#include "DummyNetwork.h" #include "Fwmark.h" #include "LocalNetwork.h" #include "PhysicalNetwork.h" @@ -53,7 +54,8 @@ const unsigned MAX_NET_ID = 65535; const unsigned NetworkController::MIN_OEM_ID = 1; const unsigned NetworkController::MAX_OEM_ID = 50; -// NetIds 51..98 are reserved for future use. +const unsigned NetworkController::DUMMY_NET_ID = 51; +// NetIds 52..98 are reserved for future use. const unsigned NetworkController::LOCAL_NET_ID = 99; // All calls to methods here are made while holding a write lock on mRWLock. @@ -132,6 +134,7 @@ int NetworkController::DelegateImpl::modifyFallthrough(const std::string& physic NetworkController::NetworkController() : mDelegateImpl(new NetworkController::DelegateImpl(this)), mDefaultNetId(NETID_UNSET) { mNetworks[LOCAL_NET_ID] = new LocalNetwork(LOCAL_NET_ID); + mNetworks[DUMMY_NET_ID] = new DummyNetwork(DUMMY_NET_ID); } unsigned NetworkController::getDefaultNetwork() const { |
