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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45417
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-05-06 15:50:55 -03:00
committed by Daniel Carvalho
parent 90aab2f926
commit 06fb0753fe
9 changed files with 26 additions and 23 deletions

View File

@@ -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 @@ hsplit(const EthPacketPtr &ptr)
return split_point;
}
} // namespace Net
} // namespace networking

View File

@@ -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 @@ uint16_t cksum(const UdpPtr &ptr);
*/
int hsplit(const EthPacketPtr &ptr);
} // namespace Net
} // namespace networking
#endif // __BASE_INET_HH__

View File

@@ -133,8 +133,8 @@ EtherSwitch::Interface::Interface(const std::string &name,
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::switchingDelay()
}
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 @@ EtherSwitch::Interface::lookupDestPort(Net::EthAddr destMacAddr)
}
void
EtherSwitch::Interface::learnSenderAddr(Net::EthAddr srcMacAddr,
EtherSwitch::Interface::learnSenderAddr(networking::EthAddr srcMacAddr,
Interface *sender)
{
// learn the port for the sending MAC address

View File

@@ -81,8 +81,8 @@ class EtherSwitch : public SimObject
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);

View File

@@ -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),

View File

@@ -85,7 +85,7 @@ const char *NsDmaState[] =
"dmaWriteWaiting"
};
using namespace Net;
using namespace networking;
///////////////////////////////////////////////////////////////////////
//

View File

@@ -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

View File

@@ -934,7 +934,7 @@ def NextEthernetAddr():
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 @@ class EthernetAddr(ParamValue):
@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 @@ class IpAddress(ParamValue):
# 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 @@ class IpNetmask(IpAddress):
# 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

View File

@@ -179,22 +179,22 @@ init_net(py::module_ &m_native)
{
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>())
;