LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
11 * | 11 * |
12 * You should have received a copy of the GNU General Public License | 12 * You should have received a copy of the GNU General Public License |
13 * along with this program; if not, write to the Free Software | 13 * along with this program; if not, write to the Free Software |
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 * | 15 * |
16 * Author: George F. Riley<riley@ece.gatech.edu> | 16 * Author: George F. Riley<riley@ece.gatech.edu> |
17 * Modified by: John Abraham <john.abraham@gatech.edu> | 17 * Modified by: John Abraham <john.abraham@gatech.edu> |
18 * Contributions: Eugene Kalishenko <ydginster@gmail.com> (Open Source and Linux
Laboratory http://dev.osll.ru/) | 18 * Contributions: Eugene Kalishenko <ydginster@gmail.com> (Open Source and Linux
Laboratory http://dev.osll.ru/) |
19 * Tommaso Pecorella <tommaso.pecorella@unifi.it> | 19 * Tommaso Pecorella <tommaso.pecorella@unifi.it> |
20 * Pavel Vasilyev <pavel.vasilyev@sredasolutions.com> | 20 * Pavel Vasilyev <pavel.vasilyev@sredasolutions.com> |
21 */ | 21 */ |
22 | 22 |
23 // Interface between ns-3 and the network animator | 23 // Interface between ns-3 and the network animator |
24 | 24 |
25 | 25 |
26 | 26 |
27 #include <cstdio> | 27 #include <cstdio> |
28 #ifndef WIN32 | 28 #ifndef _WIN32 |
29 #include <unistd.h> | 29 #include <unistd.h> |
30 #endif | 30 #endif |
31 #include <sstream> | 31 #include <sstream> |
32 #include <fstream> | 32 #include <fstream> |
33 #include <string> | 33 #include <string> |
34 #include <iomanip> | 34 #include <iomanip> |
35 #include <map> | 35 #include <map> |
36 | 36 |
37 // ns3 includes | 37 // ns3 includes |
38 #include "ns3/animation-interface.h" | 38 #include "ns3/animation-interface.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 void· | 230 void· |
231 AnimationInterface::SetMaxPktsPerTraceFile (uint64_t maxPacketsPerFile) | 231 AnimationInterface::SetMaxPktsPerTraceFile (uint64_t maxPacketsPerFile) |
232 { | 232 { |
233 m_maxPktsPerFile = maxPacketsPerFile; | 233 m_maxPktsPerFile = maxPacketsPerFile; |
234 } | 234 } |
235 | 235 |
236 uint32_t· | 236 uint32_t· |
237 AnimationInterface::AddNodeCounter (std::string counterName, CounterType counter
Type) | 237 AnimationInterface::AddNodeCounter (std::string counterName, CounterType counter
Type) |
238 { | 238 { |
239 m_nodeCounters.push_back (counterName); | 239 m_nodeCounters.push_back (counterName); |
240 uint32_t counterId = m_nodeCounters.size () - 1; // counter ID is zero-indexed | 240 uint32_t counterId = static_cast<uint32_t> (m_nodeCounters.size () - 1); // co
unter ID is zero-indexed |
241 WriteXmlAddNodeCounter (counterId, counterName, counterType); | 241 WriteXmlAddNodeCounter (counterId, counterName, counterType); |
242 return counterId;· | 242 return counterId;· |
243 } | 243 } |
244 | 244 |
245 uint32_t· | 245 uint32_t· |
246 AnimationInterface::AddResource (std::string resourcePath) | 246 AnimationInterface::AddResource (std::string resourcePath) |
247 { | 247 { |
248 m_resources.push_back (resourcePath); | 248 m_resources.push_back (resourcePath); |
249 uint32_t resourceId = m_resources.size () - 1; // resource ID is zero-indexed | 249 uint32_t resourceId = static_cast<uint32_t> (m_resources.size () - 1); // res
ource ID is zero-indexed |
250 WriteXmlAddResource (resourceId, resourcePath); | 250 WriteXmlAddResource (resourceId, resourcePath); |
251 return resourceId;· | 251 return resourceId;· |
252 } | 252 } |
253 | 253 |
254 void· | 254 void· |
255 AnimationInterface::EnablePacketMetadata (bool enable) | 255 AnimationInterface::EnablePacketMetadata (bool enable) |
256 { | 256 { |
257 m_enablePacketMetadata = enable; | 257 m_enablePacketMetadata = enable; |
258 if (enable) | 258 if (enable) |
259 { | 259 { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 void· | 322 void· |
323 AnimationInterface::UpdateNodeCounter (uint32_t nodeCounterId, uint32_t nodeId,
double counter) | 323 AnimationInterface::UpdateNodeCounter (uint32_t nodeCounterId, uint32_t nodeId,
double counter) |
324 { | 324 { |
325 if (nodeCounterId > (m_nodeCounters.size () - 1)) | 325 if (nodeCounterId > (m_nodeCounters.size () - 1)) |
326 { | 326 { |
327 NS_FATAL_ERROR ("NodeCounter Id:" << nodeCounterId << " not found. Did you
use AddNodeCounter?"); | 327 NS_FATAL_ERROR ("NodeCounter Id:" << nodeCounterId << " not found. Did you
use AddNodeCounter?"); |
328 } | 328 } |
329 WriteXmlUpdateNodeCounter (nodeCounterId, nodeId, counter); | 329 WriteXmlUpdateNodeCounter (nodeCounterId, nodeId, counter); |
330 } | 330 } |
331 | 331 |
332 void· | 332 void |
| 333 AnimationInterface::UpdateNodeCounter(uint32_t nodeCounterId, uint32_t nodeId, u
int64_t counter) |
| 334 { |
| 335 UpdateNodeCounter(nodeCounterId, nodeId, static_cast<double> (counter)); |
| 336 } |
| 337 |
| 338 void |
333 AnimationInterface::SetBackgroundImage (std::string fileName, double x, double y
, double scaleX, double scaleY, double opacity) | 339 AnimationInterface::SetBackgroundImage (std::string fileName, double x, double y
, double scaleX, double scaleY, double opacity) |
334 { | 340 { |
335 if ((opacity < 0) || (opacity > 1)) | 341 if ((opacity < 0) || (opacity > 1)) |
336 { | 342 { |
337 NS_FATAL_ERROR ("Opacity must be between 0.0 and 1.0"); | 343 NS_FATAL_ERROR ("Opacity must be between 0.0 and 1.0"); |
338 } | 344 } |
339 WriteXmlUpdateBackground (fileName, x, y, scaleX, scaleY, opacity); | 345 WriteXmlUpdateBackground (fileName, x, y, scaleX, scaleY, opacity); |
340 } | 346 } |
341 | 347 |
342 void· | 348 void· |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 AnimationInterface::WriteN (const std::string& st, FILE * f) | 505 AnimationInterface::WriteN (const std::string& st, FILE * f) |
500 { | 506 { |
501 if (!f) | 507 if (!f) |
502 { | 508 { |
503 return 0; | 509 return 0; |
504 } | 510 } |
505 if (m_writeCallback) | 511 if (m_writeCallback) |
506 { | 512 { |
507 m_writeCallback (st.c_str ()); | 513 m_writeCallback (st.c_str ()); |
508 } | 514 } |
509 return WriteN (st.c_str (), st.length (), f); | 515 return WriteN (st.c_str (), static_cast<uint32_t> (st.length ()), f); |
510 } | 516 } |
511 | 517 |
512 int· | 518 int· |
513 AnimationInterface::WriteN (const char* data, uint32_t count, FILE * f) | 519 AnimationInterface::WriteN (const char* data, uint32_t count, FILE * f) |
514 {· | 520 {· |
515 if (!f) | 521 if (!f) |
516 { | 522 { |
517 return 0; | 523 return 0; |
518 } | 524 } |
519 // Write count bytes to h from data | 525 // Write count bytes to h from data |
520 uint32_t nLeft = count; | 526 uint32_t nLeft = count; |
521 const char* p = data; | 527 const char* p = data; |
522 uint32_t written = 0; | 528 uint32_t written = 0; |
523 while (nLeft) | 529 while (nLeft) |
524 { | 530 { |
525 int n = std::fwrite (p, 1, nLeft, f); | 531 int n = static_cast<uint32_t> (std::fwrite (p, 1, nLeft, f)); |
526 if (n <= 0)· | 532 if (n <= 0)· |
527 { | 533 { |
528 return written; | 534 return written; |
529 } | 535 } |
530 written += n; | 536 written += n; |
531 nLeft -= n; | 537 nLeft -= n; |
532 p += n; | 538 p += n; |
533 } | 539 } |
534 return written; | 540 return written; |
535 } | 541 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 AnimationInterface::AddByteTag (uint64_t animUid, Ptr<const Packet> p) | 635 AnimationInterface::AddByteTag (uint64_t animUid, Ptr<const Packet> p) |
630 { | 636 { |
631 AnimByteTag tag; | 637 AnimByteTag tag; |
632 tag.Set (animUid); | 638 tag.Set (animUid); |
633 p->AddByteTag (tag); | 639 p->AddByteTag (tag); |
634 } | 640 } |
635 | 641 |
636 void· | 642 void· |
637 AnimationInterface::RemainingEnergyTrace (std::string context, double previousEn
ergy, double currentEnergy) | 643 AnimationInterface::RemainingEnergyTrace (std::string context, double previousEn
ergy, double currentEnergy) |
638 { | 644 { |
| 645 NS_UNUSED (previousEnergy); |
639 CHECK_STARTED_INTIMEWINDOW; | 646 CHECK_STARTED_INTIMEWINDOW; |
640 const Ptr <const Node> node = GetNodeFromContext (context); | 647 const Ptr <const Node> node = GetNodeFromContext (context); |
641 const uint32_t nodeId = node->GetId (); | 648 const uint32_t nodeId = node->GetId (); |
642 | 649 |
643 NS_LOG_INFO ("Remaining energy on one of sources on node " << nodeId << ": " <
< currentEnergy); | 650 NS_LOG_INFO ("Remaining energy on one of sources on node " << nodeId << ": " <
< currentEnergy); |
644 | 651 |
645 const Ptr<EnergySource> energySource = node->GetObject<EnergySource> (); | 652 const Ptr<EnergySource> energySource = node->GetObject<EnergySource> (); |
646 | 653 |
647 NS_ASSERT (energySource); | 654 NS_ASSERT (energySource); |
648 // Don't call GetEnergyFraction () because of recursion | 655 // Don't call GetEnergyFraction () because of recursion |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 void | 727 void |
721 AnimationInterface::LrWpanMacRxDropTrace (std::string context, Ptr<const Packet>
p) | 728 AnimationInterface::LrWpanMacRxDropTrace (std::string context, Ptr<const Packet>
p) |
722 { | 729 { |
723 const Ptr <const Node> node = GetNodeFromContext (context); | 730 const Ptr <const Node> node = GetNodeFromContext (context); |
724 ++m_nodeLrWpanMacRxDrop[node->GetId ()]; | 731 ++m_nodeLrWpanMacRxDrop[node->GetId ()]; |
725 } | 732 } |
726 | 733 |
727 void | 734 void |
728 AnimationInterface::Ipv4TxTrace (std::string context, Ptr<const Packet> p, Ptr<I
pv4> ipv4, uint32_t interfaceIndex) | 735 AnimationInterface::Ipv4TxTrace (std::string context, Ptr<const Packet> p, Ptr<I
pv4> ipv4, uint32_t interfaceIndex) |
729 { | 736 { |
| 737 NS_UNUSED (interfaceIndex); |
730 const Ptr <const Node> node = GetNodeFromContext (context); | 738 const Ptr <const Node> node = GetNodeFromContext (context); |
731 ++m_nodeIpv4Tx[node->GetId ()]; | 739 ++m_nodeIpv4Tx[node->GetId ()]; |
732 } | 740 } |
733 · | 741 · |
734 void | 742 void |
735 AnimationInterface::Ipv4RxTrace (std::string context, Ptr<const Packet> p, Ptr<I
pv4> ipv4, uint32_t interfaceIndex) | 743 AnimationInterface::Ipv4RxTrace (std::string context, Ptr<const Packet> p, Ptr<I
pv4> ipv4, uint32_t interfaceIndex) |
736 { | 744 { |
| 745 NS_UNUSED (interfaceIndex); |
737 const Ptr <const Node> node = GetNodeFromContext (context); | 746 const Ptr <const Node> node = GetNodeFromContext (context); |
738 ++m_nodeIpv4Rx[node->GetId ()]; | 747 ++m_nodeIpv4Rx[node->GetId ()]; |
739 } | 748 } |
740 | 749 |
741 void | 750 void |
742 AnimationInterface::Ipv4DropTrace (std::string context,· | 751 AnimationInterface::Ipv4DropTrace (std::string context,· |
743 const Ipv4Header & ipv4Header,· | 752 const Ipv4Header & ipv4Header,· |
744 Ptr<const Packet> p,· | 753 Ptr<const Packet> p,· |
745 Ipv4L3Protocol::DropReason dropReason,· | 754 Ipv4L3Protocol::DropReason dropReason,· |
746 Ptr<Ipv4> ipv4,· | 755 Ptr<Ipv4> ipv4,· |
747 uint32_t) | 756 uint32_t) |
748 { | 757 { |
| 758 NS_UNUSED (ipv4Header); |
| 759 NS_UNUSED (dropReason); |
749 const Ptr <const Node> node = GetNodeFromContext (context); | 760 const Ptr <const Node> node = GetNodeFromContext (context); |
750 ++m_nodeIpv4Drop[node->GetId ()]; | 761 ++m_nodeIpv4Drop[node->GetId ()]; |
751 } | 762 } |
752 | 763 |
753 void | 764 void |
754 AnimationInterface::EnqueueTrace (std::string context, | 765 AnimationInterface::EnqueueTrace (std::string context, |
755 Ptr<const Packet> p) | 766 Ptr<const Packet> p) |
756 { | 767 { |
757 const Ptr <const Node> node = GetNodeFromContext (context); | 768 const Ptr <const Node> node = GetNodeFromContext (context); |
758 ++m_nodeQueueEnqueue[node->GetId ()]; | 769 ++m_nodeQueueEnqueue[node->GetId ()]; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1045 } |
1035 /// \todo NS_ASSERT (WavePacketIsPending (animUid) == true); | 1046 /// \todo NS_ASSERT (WavePacketIsPending (animUid) == true); |
1036 m_pendingWavePackets[animUid].ProcessRxBegin (ndev, Simulator::Now ().GetSecon
ds ()); | 1047 m_pendingWavePackets[animUid].ProcessRxBegin (ndev, Simulator::Now ().GetSecon
ds ()); |
1037 OutputWirelessPacketRxInfo (p, m_pendingWavePackets[animUid], animUid); | 1048 OutputWirelessPacketRxInfo (p, m_pendingWavePackets[animUid], animUid); |
1038 } | 1049 } |
1039 | 1050 |
1040 | 1051 |
1041 void | 1052 void |
1042 AnimationInterface::WimaxTxTrace (std::string context, Ptr<const Packet> p, cons
t Mac48Address & m) | 1053 AnimationInterface::WimaxTxTrace (std::string context, Ptr<const Packet> p, cons
t Mac48Address & m) |
1043 { | 1054 { |
| 1055 NS_UNUSED (m); |
1044 NS_LOG_FUNCTION (this); | 1056 NS_LOG_FUNCTION (this); |
1045 return GenericWirelessTxTrace (context, p, AnimationInterface::WIMAX); | 1057 return GenericWirelessTxTrace (context, p, AnimationInterface::WIMAX); |
1046 } | 1058 } |
1047 | 1059 |
1048 | 1060 |
1049 void· | 1061 void· |
1050 AnimationInterface::WimaxRxTrace (std::string context, Ptr<const Packet> p, cons
t Mac48Address & m) | 1062 AnimationInterface::WimaxRxTrace (std::string context, Ptr<const Packet> p, cons
t Mac48Address & m) |
1051 { | 1063 { |
| 1064 NS_UNUSED (m); |
1052 NS_LOG_FUNCTION (this); | 1065 NS_LOG_FUNCTION (this); |
1053 return GenericWirelessRxTrace (context, p, AnimationInterface::WIMAX); | 1066 return GenericWirelessRxTrace (context, p, AnimationInterface::WIMAX); |
1054 } | 1067 } |
1055 | 1068 |
1056 void· | 1069 void· |
1057 AnimationInterface::LteTxTrace (std::string context, Ptr<const Packet> p, const
Mac48Address & m) | 1070 AnimationInterface::LteTxTrace (std::string context, Ptr<const Packet> p, const
Mac48Address & m) |
1058 { | 1071 { |
| 1072 NS_UNUSED (m); |
1059 NS_LOG_FUNCTION (this); | 1073 NS_LOG_FUNCTION (this); |
1060 return GenericWirelessTxTrace (context, p, AnimationInterface::LTE); | 1074 return GenericWirelessTxTrace (context, p, AnimationInterface::LTE); |
1061 } | 1075 } |
1062 | 1076 |
1063 void· | 1077 void· |
1064 AnimationInterface::LteRxTrace (std::string context, Ptr<const Packet> p, const
Mac48Address & m) | 1078 AnimationInterface::LteRxTrace (std::string context, Ptr<const Packet> p, const
Mac48Address & m) |
1065 { | 1079 { |
| 1080 NS_UNUSED (m); |
1066 NS_LOG_FUNCTION (this); | 1081 NS_LOG_FUNCTION (this); |
1067 return GenericWirelessRxTrace (context, p, AnimationInterface::LTE); | 1082 return GenericWirelessRxTrace (context, p, AnimationInterface::LTE); |
1068 } | 1083 } |
1069 | 1084 |
1070 void· | 1085 void· |
1071 AnimationInterface::LteSpectrumPhyTxStart (std::string context, Ptr<const Packet
Burst> pb) | 1086 AnimationInterface::LteSpectrumPhyTxStart (std::string context, Ptr<const Packet
Burst> pb) |
1072 { | 1087 { |
1073 NS_LOG_FUNCTION (this); | 1088 NS_LOG_FUNCTION (this); |
1074 CHECK_STARTED_INTIMEWINDOW_TRACKPACKETS; | 1089 CHECK_STARTED_INTIMEWINDOW_TRACKPACKETS; |
1075 if (!pb)· | 1090 if (!pb)· |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 | 1919 |
1905 void· | 1920 void· |
1906 AnimationInterface::WriteLinkProperties () | 1921 AnimationInterface::WriteLinkProperties () |
1907 { | 1922 { |
1908 for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) | 1923 for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) |
1909 { | 1924 { |
1910 Ptr<Node> n = *i; | 1925 Ptr<Node> n = *i; |
1911 UpdatePosition (n); | 1926 UpdatePosition (n); |
1912 uint32_t n1Id = n->GetId (); | 1927 uint32_t n1Id = n->GetId (); |
1913 uint32_t nDev = n->GetNDevices (); // Number of devices | 1928 uint32_t nDev = n->GetNDevices (); // Number of devices |
1914 for (uint32_t i = 0; i < nDev; ++i) | 1929 for (uint32_t j = 0; j < nDev; ++j) |
1915 { | 1930 { |
1916 Ptr<NetDevice> dev = n->GetDevice (i); | 1931 Ptr<NetDevice> dev = n->GetDevice (j); |
1917 NS_ASSERT (dev); | 1932 NS_ASSERT (dev); |
1918 Ptr<Channel> ch = dev->GetChannel (); | 1933 Ptr<Channel> ch = dev->GetChannel (); |
1919 std::string channelType = "Unknown channel"; | 1934 std::string channelType = "Unknown channel"; |
1920 if (ch) | 1935 if (ch) |
1921 { | 1936 { |
1922 channelType = ch->GetInstanceTypeId ().GetName (); | 1937 channelType = ch->GetInstanceTypeId ().GetName (); |
1923 } | 1938 } |
1924 NS_LOG_DEBUG("Got ChannelType" << channelType); | 1939 NS_LOG_DEBUG("Got ChannelType" << channelType); |
1925 | 1940 |
1926 if (!ch || (channelType != std::string("ns3::PointToPointChannel"))) | 1941 if (!ch || (channelType != std::string("ns3::PointToPointChannel"))) |
(...skipping 23 matching lines...) Expand all Loading... |
1950 NS_LOG_INFO ("Writing Ipv6 link"); | 1965 NS_LOG_INFO ("Writing Ipv6 link"); |
1951 WriteNonP2pLinkProperties(n->GetId (), GetIpv6Address (dev) +
"~" + GetMacAddress (dev), channelType); | 1966 WriteNonP2pLinkProperties(n->GetId (), GetIpv6Address (dev) +
"~" + GetMacAddress (dev), channelType); |
1952 } | 1967 } |
1953 continue; | 1968 continue; |
1954 } | 1969 } |
1955 | 1970 |
1956 else if (channelType == std::string ("ns3::PointToPointChannel")) | 1971 else if (channelType == std::string ("ns3::PointToPointChannel")) |
1957 { // Since these are duplex links, we only need to dump | 1972 { // Since these are duplex links, we only need to dump |
1958 // if srcid < dstid | 1973 // if srcid < dstid |
1959 uint32_t nChDev = ch->GetNDevices (); | 1974 uint32_t nChDev = ch->GetNDevices (); |
1960 for (uint32_t j = 0; j < nChDev; ++j) | 1975 for (uint32_t k = 0; k < nChDev; ++k) |
1961 { | 1976 { |
1962 Ptr<NetDevice> chDev = ch->GetDevice (j); | 1977 Ptr<NetDevice> chDev = ch->GetDevice (k); |
1963 uint32_t n2Id = chDev->GetNode ()->GetId (); | 1978 uint32_t n2Id = chDev->GetNode ()->GetId (); |
1964 if (n1Id < n2Id) | 1979 if (n1Id < n2Id) |
1965 {· | 1980 {· |
1966 | 1981 |
1967 std::vector<std::string> ipv4Addresses = GetIpv4Addresses
(dev); | 1982 std::vector<std::string> ipv4Addresses = GetIpv4Addresses
(dev); |
1968 AddToIpv4AddressNodeIdTable (ipv4Addresses, n1Id); | 1983 AddToIpv4AddressNodeIdTable (ipv4Addresses, n1Id); |
1969 ipv4Addresses = GetIpv4Addresses (chDev); | 1984 ipv4Addresses = GetIpv4Addresses (chDev); |
1970 AddToIpv4AddressNodeIdTable (ipv4Addresses, n2Id); | 1985 AddToIpv4AddressNodeIdTable (ipv4Addresses, n2Id); |
1971 std::vector<std::string> ipv6Addresses = GetIpv6Addresses
(dev); | 1986 std::vector<std::string> ipv6Addresses = GetIpv6Addresses
(dev); |
1972 AddToIpv6AddressNodeIdTable(ipv6Addresses, n1Id); | 1987 AddToIpv6AddressNodeIdTable(ipv6Addresses, n1Id); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 element.AddAttribute ("t", Simulator::Now ().GetSeconds ()); | 2450 element.AddAttribute ("t", Simulator::Now ().GetSeconds ()); |
2436 element.AddAttribute ("fromId", fromId); | 2451 element.AddAttribute ("fromId", fromId); |
2437 element.AddAttribute ("toId", toId); | 2452 element.AddAttribute ("toId", toId); |
2438 element.AddAttribute ("ld", linkDescription, true); | 2453 element.AddAttribute ("ld", linkDescription, true); |
2439 WriteN (element.ToString (), m_f); | 2454 WriteN (element.ToString (), m_f); |
2440 } | 2455 } |
2441 | 2456 |
2442 void· | 2457 void· |
2443 AnimationInterface::WriteXmlLink (uint32_t fromId, uint32_t toLp, uint32_t toId) | 2458 AnimationInterface::WriteXmlLink (uint32_t fromId, uint32_t toLp, uint32_t toId) |
2444 { | 2459 { |
| 2460 NS_UNUSED (toLp); |
2445 AnimXmlElement element ("link"); | 2461 AnimXmlElement element ("link"); |
2446 element.AddAttribute ("fromId", fromId); | 2462 element.AddAttribute ("fromId", fromId); |
2447 element.AddAttribute ("toId", toId); | 2463 element.AddAttribute ("toId", toId); |
2448 | 2464 |
2449 LinkProperties lprop ; | 2465 LinkProperties lprop ; |
2450 lprop.fromNodeDescription = ""; | 2466 lprop.fromNodeDescription = ""; |
2451 lprop.toNodeDescription = ""; | 2467 lprop.toNodeDescription = ""; |
2452 lprop.linkDescription = ""; | 2468 lprop.linkDescription = ""; |
2453 | 2469 |
2454 P2pLinkNodeIdPair p1 = { fromId, toId }; | 2470 P2pLinkNodeIdPair p1 = { fromId, toId }; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 } | 2709 } |
2694 | 2710 |
2695 | 2711 |
2696 | 2712 |
2697 /***** AnimXmlElement *****/ | 2713 /***** AnimXmlElement *****/ |
2698 | 2714 |
2699 AnimationInterface::AnimXmlElement::AnimXmlElement(std::string tagName, bool emp
tyElement) : | 2715 AnimationInterface::AnimXmlElement::AnimXmlElement(std::string tagName, bool emp
tyElement) : |
2700 m_tagName(tagName), | 2716 m_tagName(tagName), |
2701 m_text("") | 2717 m_text("") |
2702 { | 2718 { |
| 2719 NS_UNUSED (emptyElement); |
2703 } | 2720 } |
2704 | 2721 |
2705 template <typename T> | 2722 template <typename T> |
2706 void | 2723 void |
2707 AnimationInterface::AnimXmlElement::AddAttribute(std::string attribute, T value,
bool xmlEscape) | 2724 AnimationInterface::AnimXmlElement::AddAttribute(std::string attribute, T value,
bool xmlEscape) |
2708 { | 2725 { |
2709 std::ostringstream oss; | 2726 std::ostringstream oss; |
2710 oss << std::setprecision(10); | 2727 oss << std::setprecision(10); |
2711 oss << value; | 2728 oss << value; |
2712 std::string attributeString = attribute.c_str(); | 2729 std::string attributeString = attribute.c_str(); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2898 | 2915 |
2899 void· | 2916 void· |
2900 AnimationInterface::AnimPacketInfo::ProcessRxBegin (Ptr<const NetDevice> nd, con
st double fbRx) | 2917 AnimationInterface::AnimPacketInfo::ProcessRxBegin (Ptr<const NetDevice> nd, con
st double fbRx) |
2901 { | 2918 { |
2902 Ptr <Node> n = nd->GetNode (); | 2919 Ptr <Node> n = nd->GetNode (); |
2903 m_fbRx = fbRx; | 2920 m_fbRx = fbRx; |
2904 m_rxnd = nd; | 2921 m_rxnd = nd; |
2905 } | 2922 } |
2906 | 2923 |
2907 } // namespace ns3 | 2924 } // namespace ns3 |
LEFT | RIGHT |