Daniel Carvalho has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/45417 )

Change subject: base,dev,python: Rename Net namespace as networking
......................................................................

base,dev,python: Rename Net namespace as networking

As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

::Net became ::networking.

Change-Id: I6a77e36c84918174104e507453d53dfe3cb52d35
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45417
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[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, 26 insertions(+), 23 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/inet.cc b/src/base/inet.cc
index bc9c516..f8fe944 100644
--- a/src/base/inet.cc
+++ b/src/base/inet.cc
@@ -50,7 +50,9 @@
 #include "base/logging.hh"
 #include "base/types.hh"

-namespace Net {
+GEM5_DEPRECATED_NAMESPACE(Net, networking);
+namespace networking
+{

 EthAddr::EthAddr()
 {
@@ -407,5 +409,4 @@
     return split_point;
 }

-
-} // namespace Net
+} // namespace networking
diff --git a/src/base/inet.hh b/src/base/inet.hh
index f0d1f75..3a2f4c4 100644
--- a/src/base/inet.hh
+++ b/src/base/inet.hh
@@ -65,7 +65,9 @@
 #include "dnet/blob.h"
 #include "dnet/rand.h"

-namespace Net {
+GEM5_DEPRECATED_NAMESPACE(Net, networking);
+namespace networking
+{

 /*
  * Ethernet Stuff
@@ -828,6 +830,6 @@
  */
 int hsplit(const EthPacketPtr &ptr);

-} // namespace Net
+} // namespace networking

 #endif // __BASE_INET_HH__
diff --git a/src/dev/net/etherswitch.cc b/src/dev/net/etherswitch.cc
index 27fbc78..cd22d46 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]);
+    networking::EthAddr destMacAddr(packet->data);
+    networking::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(networking::EthAddr destMacAddr)
 {
     auto it = parent->forwardingTable.find(uint64_t(destMacAddr));

@@ -230,7 +230,7 @@
 }

 void
-EtherSwitch::Interface::learnSenderAddr(Net::EthAddr srcMacAddr,
+EtherSwitch::Interface::learnSenderAddr(networking::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..6cba36a 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(networking::EthAddr destAddr);
+ void learnSenderAddr(networking::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 34a1e7e..fd9005a 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 networking;

 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 6d1313d..bb38acb 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 networking;

 ///////////////////////////////////////////////////////////////////////
 //
diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc
index 4f844f6..8491674 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 networking;

 GEM5_DEPRECATED_NAMESPACE(Sinic, sinic);
 namespace sinic
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 460a7d0..6ee8b5c 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 = 'networking::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 = networking::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 = 'networking::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 = 'networking::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 = 'networking::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..dbd8a0f 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_<networking::EthAddr>(m, "EthAddr")
         .def(py::init<>())
         .def(py::init<const std::string &>())
         ;

-    py::class_<Net::IpAddress>(m, "IpAddress")
+    py::class_<networking::IpAddress>(m, "IpAddress")
         .def(py::init<>())
         .def(py::init<uint32_t>())
         ;

-    py::class_<Net::IpNetmask, Net::IpAddress>(m, "IpNetmask")
+ py::class_<networking::IpNetmask, networking::IpAddress>(m, "IpNetmask")
         .def(py::init<>())
         .def(py::init<uint32_t, uint8_t>())
         ;

-    py::class_<Net::IpWithPort, Net::IpAddress>(m, "IpWithPort")
+ py::class_<networking::IpWithPort, networking::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: 10
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to