From cabfd83031903064bb99a953a67d246410b22e89 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 19 Mar 2008 11:10:37 -0700 Subject: [PATCH] improve pretty-printing output. --- src/devices/wifi/wifi-mac-header.cc | 5 ++--- src/internet-node/arp-header.cc | 8 ++------ src/internet-node/ipv4-header.cc | 5 ++--- src/internet-node/udp-header.cc | 5 ++--- src/node/ethernet-header.cc | 2 +- src/node/ethernet-trailer.cc | 2 +- src/node/llc-snap-header.cc | 3 +-- 7 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/devices/wifi/wifi-mac-header.cc b/src/devices/wifi/wifi-mac-header.cc index 065ddb39b..109906d98 100644 --- a/src/devices/wifi/wifi-mac-header.cc +++ b/src/devices/wifi/wifi-mac-header.cc @@ -786,11 +786,10 @@ WifiMacHeader::GetInstanceTypeId (void) const void WifiMacHeader::PrintFrameControl (std::ostream &os) const { - os << "(" - << "ToDS=" << m_ctrlToDs << ", FromDS=" << m_ctrlFromDs + os << "ToDS=" << m_ctrlToDs << ", FromDS=" << m_ctrlFromDs << ", MoreFrag=" << m_ctrlMoreFrag << ", Retry=" << m_ctrlRetry << ", MoreData=" << m_ctrlMoreData - << ")"; + ; } void diff --git a/src/internet-node/arp-header.cc b/src/internet-node/arp-header.cc index a4a0b04fb..5bf781c24 100644 --- a/src/internet-node/arp-header.cc +++ b/src/internet-node/arp-header.cc @@ -102,24 +102,20 @@ ArpHeader::Print (std::ostream &os) const { if (IsRequest ()) { - os << "(" - << "request " + os << "request " << "source mac: " << m_macSource << " " << "source ipv4: " << m_ipv4Source << " " << "dest ipv4: " << m_ipv4Dest - << ")" ; } else { NS_ASSERT (IsReply ()); - os << "(" - << "reply " + os << "reply " << "source mac: " << m_macSource << " " << "source ipv4: " << m_ipv4Source << " " << "dest mac: " << m_macDest << " " << "dest ipv4: " < " << m_destination ; } diff --git a/src/internet-node/udp-header.cc b/src/internet-node/udp-header.cc index 15aa6ba2d..08a2962a0 100644 --- a/src/internet-node/udp-header.cc +++ b/src/internet-node/udp-header.cc @@ -110,9 +110,8 @@ UdpHeader::GetInstanceTypeId (void) const void UdpHeader::Print (std::ostream &os) const { - os << "(" - << "length: " << m_payloadSize + GetSerializedSize () - << ") " + os << "length: " << m_payloadSize + GetSerializedSize () + << " " << m_sourcePort << " > " << m_destinationPort ; } diff --git a/src/node/ethernet-header.cc b/src/node/ethernet-header.cc index 9bafd3f30..ef9c40956 100644 --- a/src/node/ethernet-header.cc +++ b/src/node/ethernet-header.cc @@ -120,7 +120,7 @@ EthernetHeader::Print (std::ostream &os) const // ethernet, right ? if (m_enPreambleSfd) { - os << " preamble/sfd=" << m_preambleSfd << ","; + os << "preamble/sfd=" << m_preambleSfd << ","; } os << " length/type=0x" << std::hex << m_lengthType << std::dec diff --git a/src/node/ethernet-trailer.cc b/src/node/ethernet-trailer.cc index d032a1314..a2cb27583 100644 --- a/src/node/ethernet-trailer.cc +++ b/src/node/ethernet-trailer.cc @@ -103,7 +103,7 @@ EthernetTrailer::GetInstanceTypeId (void) const void EthernetTrailer::Print (std::ostream &os) const { - os << " fcs=" << m_fcs; + os << "fcs=" << m_fcs; } uint32_t EthernetTrailer::GetSerializedSize (void) const diff --git a/src/node/llc-snap-header.cc b/src/node/llc-snap-header.cc index 8aacb47ff..7b079d158 100644 --- a/src/node/llc-snap-header.cc +++ b/src/node/llc-snap-header.cc @@ -64,11 +64,10 @@ LlcSnapHeader::GetInstanceTypeId (void) const void LlcSnapHeader::Print (std::ostream &os) const { - os << "(type 0x"; + os << "type 0x"; os.setf (std::ios::hex, std::ios::basefield); os << m_etherType; os.setf (std::ios::dec, std::ios::basefield); - os << ")"; } void