Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/45417 )
Change subject: base,dev,python: Rename Net namespace as network
......................................................................
base,dev,python: Rename Net namespace as network
As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.
::Net became ::network.
Change-Id: I6a77e36c84918174104e507453d53dfe3cb52d35
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/base/inet.cc
M src/base/inet.hh
M src/dev/net/etherswitch.cc
M src/dev/net/etherswitch.hh
M src/dev/net/i8254xGBe.cc
M src/dev/net/ns_gige.cc
M src/dev/net/sinic.cc
M src/python/m5/params.py
M src/python/pybind11/core.cc
9 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/src/base/inet.cc b/src/base/inet.cc
index 7ae36c3..7ac6858 100644
--- a/src/base/inet.cc
+++ b/src/base/inet.cc
@@ -50,7 +50,7 @@
#include "base/logging.hh"
#include "base/types.hh"
-namespace Net {
+namespace network {
EthAddr::EthAddr()
{
@@ -401,5 +401,4 @@
return split_point;
}
-
-} // namespace Net
+} // namespace network
diff --git a/src/base/inet.hh b/src/base/inet.hh
index b6f0eb1..c5ebc9e 100644
--- a/src/base/inet.hh
+++ b/src/base/inet.hh
@@ -47,6 +47,7 @@
#include <utility>
#include <vector>
+#include "base/compiler.hh"
#include "base/types.hh"
#include "dev/net/etherpkt.hh"
#include "dnet/os.h"
@@ -64,7 +65,8 @@
#include "dnet/blob.h"
#include "dnet/rand.h"
-namespace Net {
+GEM5_DEPRECATED_NAMESPACE(Net, network);
+namespace network {
/*
* Ethernet Stuff
@@ -828,6 +830,6 @@
*/
int hsplit(const EthPacketPtr &ptr);
-} // namespace Net
+} // namespace network
#endif // __BASE_INET_HH__
diff --git a/src/dev/net/etherswitch.cc b/src/dev/net/etherswitch.cc
index 13439f8..4bf3c52 100644
--- a/src/dev/net/etherswitch.cc
+++ b/src/dev/net/etherswitch.cc
@@ -133,8 +133,8 @@
bool
EtherSwitch::Interface::recvPacket(EthPacketPtr packet)
{
- Net::EthAddr destMacAddr(packet->data);
- Net::EthAddr srcMacAddr(&packet->data[6]);
+ network::EthAddr destMacAddr(packet->data);
+ network::EthAddr srcMacAddr(&packet->data[6]);
learnSenderAddr(srcMacAddr, this);
Interface *receiver = lookupDestPort(destMacAddr);
@@ -206,7 +206,7 @@
}
EtherSwitch::Interface*
-EtherSwitch::Interface::lookupDestPort(Net::EthAddr destMacAddr)
+EtherSwitch::Interface::lookupDestPort(network::EthAddr destMacAddr)
{
auto it = parent->forwardingTable.find(uint64_t(destMacAddr));
@@ -230,7 +230,7 @@
}
void
-EtherSwitch::Interface::learnSenderAddr(Net::EthAddr srcMacAddr,
+EtherSwitch::Interface::learnSenderAddr(network::EthAddr srcMacAddr,
Interface *sender)
{
// learn the port for the sending MAC address
diff --git a/src/dev/net/etherswitch.hh b/src/dev/net/etherswitch.hh
index 3c6a4c8..7cc2c3d 100644
--- a/src/dev/net/etherswitch.hh
+++ b/src/dev/net/etherswitch.hh
@@ -81,8 +81,8 @@
void sendDone() {}
Tick switchingDelay();
- Interface* lookupDestPort(Net::EthAddr destAddr);
- void learnSenderAddr(Net::EthAddr srcMacAddr, Interface *sender);
+ Interface* lookupDestPort(network::EthAddr destAddr);
+ void learnSenderAddr(network::EthAddr srcMacAddr, Interface
*sender);
void serialize(CheckpointOut &cp) const;
void unserialize(CheckpointIn &cp);
diff --git a/src/dev/net/i8254xGBe.cc b/src/dev/net/i8254xGBe.cc
index 88cd0d5..b3b5122 100644
--- a/src/dev/net/i8254xGBe.cc
+++ b/src/dev/net/i8254xGBe.cc
@@ -53,7 +53,7 @@
#include "sim/system.hh"
using namespace igbreg;
-using namespace Net;
+using namespace network;
IGbE::IGbE(const Params &p)
: EtherDevice(p), etherInt(NULL),
diff --git a/src/dev/net/ns_gige.cc b/src/dev/net/ns_gige.cc
index a350762..986b043 100644
--- a/src/dev/net/ns_gige.cc
+++ b/src/dev/net/ns_gige.cc
@@ -85,7 +85,7 @@
"dmaWriteWaiting"
};
-using namespace Net;
+using namespace network;
///////////////////////////////////////////////////////////////////////
//
diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc
index e6ebfd3..ad50539 100644
--- a/src/dev/net/sinic.cc
+++ b/src/dev/net/sinic.cc
@@ -43,7 +43,7 @@
#include "sim/eventq.hh"
#include "sim/stats.hh"
-using namespace Net;
+using namespace network;
namespace sinic {
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 460a7d0..91a7241 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -934,7 +934,7 @@
return value
class EthernetAddr(ParamValue):
- cxx_type = 'Net::EthAddr'
+ cxx_type = 'network::EthAddr'
ex_str = "00:90:00:00:00:01"
cmd_line_settable = True
@@ -981,13 +981,13 @@
@classmethod
def cxx_ini_parse(self, code, src, dest, ret):
- code('%s = Net::EthAddr(%s);' % (dest, src))
+ code('%s = network::EthAddr(%s);' % (dest, src))
code('%s true;' % ret)
# When initializing an IpAddress, pass in an existing IpAddress, a string
of
# the form "a.b.c.d", or an integer representing an IP.
class IpAddress(ParamValue):
- cxx_type = 'Net::IpAddress'
+ cxx_type = 'network::IpAddress'
ex_str = "127.0.0.1"
cmd_line_settable = True
@@ -1039,7 +1039,7 @@
# the form "a.b.c.d/n" or "a.b.c.d/e.f.g.h", or an ip and netmask as
# positional or keyword arguments.
class IpNetmask(IpAddress):
- cxx_type = 'Net::IpNetmask'
+ cxx_type = 'network::IpNetmask'
ex_str = "127.0.0.0/24"
cmd_line_settable = True
@@ -1113,7 +1113,7 @@
# When initializing an IpWithPort, pass in an existing IpWithPort, a
string of
# the form "a.b.c.d:p", or an ip and port as positional or keyword
arguments.
class IpWithPort(IpAddress):
- cxx_type = 'Net::IpWithPort'
+ cxx_type = 'network::IpWithPort'
ex_str = "127.0.0.1:80"
cmd_line_settable = True
diff --git a/src/python/pybind11/core.cc b/src/python/pybind11/core.cc
index 8eac65c..b1a11ab 100644
--- a/src/python/pybind11/core.cc
+++ b/src/python/pybind11/core.cc
@@ -179,22 +179,22 @@
{
py::module_ m = m_native.def_submodule("net");
- py::class_<Net::EthAddr>(m, "EthAddr")
+ py::class_<network::EthAddr>(m, "EthAddr")
.def(py::init<>())
.def(py::init<const std::string &>())
;
- py::class_<Net::IpAddress>(m, "IpAddress")
+ py::class_<network::IpAddress>(m, "IpAddress")
.def(py::init<>())
.def(py::init<uint32_t>())
;
- py::class_<Net::IpNetmask, Net::IpAddress>(m, "IpNetmask")
+ py::class_<network::IpNetmask, network::IpAddress>(m, "IpNetmask")
.def(py::init<>())
.def(py::init<uint32_t, uint8_t>())
;
- py::class_<Net::IpWithPort, Net::IpAddress>(m, "IpWithPort")
+ py::class_<network::IpWithPort, network::IpAddress>(m, "IpWithPort")
.def(py::init<>())
.def(py::init<uint32_t, uint16_t>())
;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45417
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6a77e36c84918174104e507453d53dfe3cb52d35
Gerrit-Change-Number: 45417
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s