merge implicit conversion tree
This commit is contained in:
@@ -127,7 +127,7 @@ int main (int argc, char *argv[])
|
||||
// from n0 to n1
|
||||
Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
|
||||
n0,
|
||||
InetSocketAddress (Ipv4Address("10.1.1.2"), 80).ConvertTo (),
|
||||
InetSocketAddress ("10.1.1.2", 80),
|
||||
"Udp",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
@@ -138,7 +138,7 @@ int main (int argc, char *argv[])
|
||||
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
|
||||
ooff = Create<OnOffApplication> (
|
||||
n3,
|
||||
InetSocketAddress (Ipv4Address("10.1.1.1"), 80).ConvertTo (),
|
||||
InetSocketAddress ("10.1.1.1", 80),
|
||||
"Udp",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
|
||||
@@ -105,7 +105,7 @@ int main (int argc, char *argv[])
|
||||
// from n0 to n1
|
||||
Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
|
||||
n0,
|
||||
n0ToN1.ConvertTo (),
|
||||
n0ToN1,
|
||||
"Packet",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
@@ -116,7 +116,7 @@ int main (int argc, char *argv[])
|
||||
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
|
||||
ooff = Create<OnOffApplication> (
|
||||
n3,
|
||||
n3ToN0.ConvertTo (),
|
||||
n3ToN0,
|
||||
"Packet",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
|
||||
@@ -144,7 +144,7 @@ int main (int argc, char *argv[])
|
||||
// 210 bytes at a rate of 448 Kb/s
|
||||
Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
|
||||
n0,
|
||||
InetSocketAddress (Ipv4Address("10.1.3.2"), 80).ConvertTo (),
|
||||
InetSocketAddress ("10.1.3.2", 80),
|
||||
"Udp",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
@@ -155,7 +155,7 @@ int main (int argc, char *argv[])
|
||||
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
|
||||
ooff = Create<OnOffApplication> (
|
||||
n3,
|
||||
InetSocketAddress (Ipv4Address("10.1.2.1"), 80).ConvertTo (),
|
||||
InetSocketAddress ("10.1.2.1", 80),
|
||||
"Udp",
|
||||
ConstantVariable(1),
|
||||
ConstantVariable(0));
|
||||
|
||||
@@ -46,11 +46,11 @@ RunSimulation (void)
|
||||
|
||||
Ptr<Socket> sink = socketFactory->CreateSocket ();
|
||||
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
|
||||
sink->Bind (local.ConvertTo ());
|
||||
sink->Bind (local);
|
||||
|
||||
Ptr<Socket> source = socketFactory->CreateSocket ();
|
||||
InetSocketAddress remote = InetSocketAddress (Ipv4Address::GetLoopback (), 80);
|
||||
source->Connect (remote.ConvertTo ());
|
||||
source->Connect (remote);
|
||||
|
||||
GenerateTraffic (source, 500);
|
||||
PrintTraffic (sink);
|
||||
|
||||
@@ -46,7 +46,7 @@ CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node)
|
||||
|
||||
CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node, Eui48Address addr,
|
||||
CsmaCdEncapsulationMode encapMode)
|
||||
: NetDevice(node, addr.ConvertTo ()),
|
||||
: NetDevice(node, addr),
|
||||
m_bps (DataRate (0xffffffff))
|
||||
{
|
||||
NS_DEBUG ("CsmaCdNetDevice::CsmaCdNetDevice (" << node << ")");
|
||||
@@ -58,7 +58,7 @@ CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node, Eui48Address addr,
|
||||
CsmaCdNetDevice::CsmaCdNetDevice (Ptr<Node> node, Eui48Address addr,
|
||||
CsmaCdEncapsulationMode encapMode,
|
||||
bool sendEnable, bool receiveEnable)
|
||||
: NetDevice(node, addr.ConvertTo ()),
|
||||
: NetDevice(node, addr),
|
||||
m_bps (DataRate (0xffffffff))
|
||||
{
|
||||
NS_DEBUG ("CsmaCdNetDevice::CsmaCdNetDevice (" << node << ")");
|
||||
@@ -105,7 +105,7 @@ CsmaCdNetDevice::Init(bool sendEnable, bool receiveEnable)
|
||||
m_channel = 0;
|
||||
m_queue = 0;
|
||||
|
||||
EnableBroadcast (Eui48Address ("ff:ff:ff:ff:ff:ff").ConvertTo ());
|
||||
EnableBroadcast (Eui48Address ("ff:ff:ff:ff:ff:ff"));
|
||||
EnableMulticast();
|
||||
EnablePointToPoint();
|
||||
|
||||
@@ -210,10 +210,8 @@ CsmaCdNetDevice::ProcessHeader (Packet& p, uint16_t & param)
|
||||
trailer.CheckFcs(p);
|
||||
p.RemoveHeader(header);
|
||||
|
||||
Eui48Address broadcast = Eui48Address::ConvertFrom (GetBroadcast ());
|
||||
Eui48Address destination = Eui48Address::ConvertFrom (GetAddress ());
|
||||
if ((header.GetDestination() != broadcast) &&
|
||||
(header.GetDestination() != destination))
|
||||
if ((header.GetDestination() != GetBroadcast ()) &&
|
||||
(header.GetDestination() != GetAddress ()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -261,8 +259,8 @@ CsmaCdNetDevice::SendTo (Packet& p, const Address& dest, uint16_t protocolNumber
|
||||
if (!IsSendEnabled())
|
||||
return false;
|
||||
|
||||
Eui48Address address = Eui48Address::ConvertFrom (dest);
|
||||
AddHeader(p, address, protocolNumber);
|
||||
Eui48Address destination = Eui48Address::ConvertFrom (dest);
|
||||
AddHeader(p, destination, protocolNumber);
|
||||
|
||||
// Place the packet to be sent on the send queue
|
||||
if (m_queue->Enqueue(p) == false )
|
||||
|
||||
@@ -43,7 +43,7 @@ DataRateDefaultValue PointToPointNetDevice::g_defaultRate(
|
||||
PointToPointNetDevice::PointToPointNetDevice (Ptr<Node> node,
|
||||
const DataRate& rate)
|
||||
:
|
||||
NetDevice(node, Eui48Address::Allocate ().ConvertTo ()),
|
||||
NetDevice(node, Eui48Address::Allocate ()),
|
||||
m_txMachineState (READY),
|
||||
m_bps (rate),
|
||||
m_tInterframeGap (Seconds(0)),
|
||||
@@ -56,7 +56,7 @@ PointToPointNetDevice::PointToPointNetDevice (Ptr<Node> node,
|
||||
// BUGBUG FIXME
|
||||
//
|
||||
// You _must_ support broadcast to get any sort of packet from the ARP layer.
|
||||
EnableBroadcast (Eui48Address ("ff:ff:ff:ff:ff:ff").ConvertTo ());
|
||||
EnableBroadcast (Eui48Address ("ff:ff:ff:ff:ff:ff"));
|
||||
EnableMulticast();
|
||||
EnablePointToPoint();
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ UdpSocket::ForwardUp (const Packet &packet, Ipv4Address ipv4, uint16_t port)
|
||||
return;
|
||||
}
|
||||
|
||||
Address address = InetSocketAddress (ipv4, port).ConvertTo ();
|
||||
Address address = InetSocketAddress (ipv4, port);
|
||||
Packet p = packet;
|
||||
if (!m_dummyRxCallback.IsNull ())
|
||||
{
|
||||
|
||||
@@ -95,6 +95,14 @@ Eui48Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 6);
|
||||
}
|
||||
Eui48Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
Eui48Address::Eui48Address (const Address &address)
|
||||
{
|
||||
*this = ConvertFrom (address);
|
||||
}
|
||||
Address
|
||||
Eui48Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -55,28 +55,37 @@ public:
|
||||
* Copy the internal address to the input buffer.
|
||||
*/
|
||||
void CopyTo (uint8_t buffer[6]) const;
|
||||
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
operator Address ();
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
* \returns a new Eui48Address from the polymorphic address
|
||||
*
|
||||
* This function performs a type check and asserts if the
|
||||
* type of the input address is not compatible with an
|
||||
* Eui48Address.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui48Address.
|
||||
*/
|
||||
static Eui48Address Allocate (void);
|
||||
private:
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
*
|
||||
* Convert a polymorphic address to an Eui48Address instance.
|
||||
* The conversion performs a type check.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui48Address.
|
||||
*/
|
||||
static Eui48Address Allocate (void);
|
||||
private:
|
||||
static uint8_t GetType (void);
|
||||
uint8_t m_address[6];
|
||||
};
|
||||
|
||||
@@ -95,6 +95,14 @@ Eui64Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 8);
|
||||
}
|
||||
Eui48Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
Eui48Address::Eui48Address (const Address &address)
|
||||
{
|
||||
*this = ConvertFrom (address);
|
||||
}
|
||||
Address
|
||||
Eui64Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -60,12 +60,22 @@ public:
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
operator Address ();
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
* \returns a new Eui48Address from the polymorphic address
|
||||
*
|
||||
* This function performs a type check and asserts if the
|
||||
* type of the input address is not compatible with an
|
||||
* Eui48Address.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
<<<<<<< /auto/fugue/u/fugue/home/mlacage/code/ns-3-dev/src/node/eui64-address.h
|
||||
* \param address a polymorphic address
|
||||
*
|
||||
* Convert a polymorphic address to an Eui64Address instance.
|
||||
@@ -74,9 +84,18 @@ public:
|
||||
static Eui64Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui64Address.
|
||||
=======
|
||||
* Allocate a new Eui48Address.
|
||||
>>>>>>> /tmp/eui48-address.h~other.OBFjbL
|
||||
*/
|
||||
static Eui64Address Allocate (void);
|
||||
private:
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
static uint8_t GetType (void);
|
||||
uint8_t m_address[8];
|
||||
};
|
||||
|
||||
@@ -51,6 +51,11 @@ InetSocketAddress::IsMatchingType (const Address &address)
|
||||
return address.CheckCompatible (GetType (), 6);
|
||||
}
|
||||
|
||||
InetSocketAddress::operator Address () const
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
|
||||
Address
|
||||
InetSocketAddress::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -73,14 +73,18 @@ public:
|
||||
* \returns an Address instance which represents this
|
||||
* InetSocketAddress instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
operator Address () const;
|
||||
|
||||
/**
|
||||
* \param address the Address instance to convert from.
|
||||
* \returns an InetSocketAddress which corresponds to the input
|
||||
*
|
||||
* Returns an InetSocketAddress which corresponds to the input
|
||||
* Address
|
||||
*/
|
||||
static InetSocketAddress ConvertFrom (const Address &address);
|
||||
private:
|
||||
Address ConvertTo (void) const;
|
||||
|
||||
static uint8_t GetType (void);
|
||||
Ipv4Address m_ipv4;
|
||||
uint16_t m_port;
|
||||
|
||||
@@ -222,6 +222,11 @@ Ipv4Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 4);
|
||||
}
|
||||
Ipv4Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
|
||||
Address
|
||||
Ipv4Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
Ipv4Address CombineMask (Ipv4Mask const &mask) const;
|
||||
|
||||
static bool IsMatchingType (const Address &address);
|
||||
Address ConvertTo (void) const;
|
||||
operator Address ();
|
||||
static Ipv4Address ConvertFrom (const Address &address);
|
||||
|
||||
static Ipv4Address GetZero (void);
|
||||
@@ -129,6 +129,7 @@ public:
|
||||
static Ipv4Address GetBroadcast (void);
|
||||
static Ipv4Address GetLoopback (void);
|
||||
private:
|
||||
Address ConvertTo (void) const;
|
||||
static uint8_t GetType (void);
|
||||
uint32_t m_address;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user