1
0
mirror of https://github.com/wfjm/w11.git synced 2026-01-12 00:43:01 +00:00

RethBuf: improved Info/Dump methods

- tools
  - src/librw11/RethBuf: improved Info/Dump methods
  - src/librw11/RethTools: add IpAddr2String
  - src/librw11/Rw11CntlDEUN: use RethBuf::HeaderInfoAll
  - oskit/211bsd_rpeth/211bsd_rpeth_boot.tcl: enable EType filter
  - oskit/hook/hook_trace_xua.tcl: use tracelevel 3
This commit is contained in:
wfjm 2023-02-23 11:47:52 +01:00
parent bb61927fb1
commit cc7f8365cd
8 changed files with 298 additions and 71 deletions

View File

@ -1,4 +1,4 @@
# $Id: 211bsd_rpeth_boot.tcl 1154 2019-05-30 13:21:01Z mueller $
# $Id: 211bsd_rpeth_boot.tcl 1378 2023-02-23 10:45:17Z mueller $
#
# Setup file for 211bsd RP06 based system with ethernet
#
@ -31,6 +31,7 @@ cpu0rpa0 att 211bsd_rpeth.dsk
# setup network
cpu0xua set type deuna
cpu0xua set dpa retro:00
cpu0xua set etfena 1
cpu0xua0 att tap:tap0

View File

@ -1,7 +1,7 @@
# $Id: hook_trace_xua.tcl 1169 2019-06-21 07:00:59Z mueller $
# $Id: hook_trace_xua.tcl 1378 2023-02-23 10:45:17Z mueller $
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2017-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
puts "hook: trace DEUNA to rlc.log"
rlc set logfile rlc.log
cpu0xua set trace 2
cpu0xua set trace 3

View File

@ -1,9 +1,10 @@
// $Id: RethBuf.cpp 1186 2019-07-12 17:49:59Z mueller $
// $Id: RethBuf.cpp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 1.1 improved Info/Dump methods
// 2017-04-16 880 1.0 Initial version
// 2017-02-12 850 0.1 First draft
// ---------------------------------------------------------------------------
@ -41,9 +42,38 @@ namespace Retro {
const size_t RethBuf::kMaxSize;
const size_t RethBuf::kMinSize;
const size_t RethBuf::kCrcSize;
const size_t RethBuf::kWOffDstMac;
const size_t RethBuf::kWOffSrcMac;
const size_t RethBuf::kWOffTyp;
const size_t RethBuf::kEOffDstMac;
const size_t RethBuf::kEOffSrcMac;
const size_t RethBuf::kEOffEType;
const size_t RethBuf::kElength;
const size_t RethBuf::kArpOffOper;
const size_t RethBuf::kArpOffSha;
const size_t RethBuf::kArpOffSpa;
const size_t RethBuf::kArpOffTha;
const size_t RethBuf::kArpOffTpa;
const size_t RethBuf::kIpOffLen;
const size_t RethBuf::kIpOffFlags;
const size_t RethBuf::kIpOffTTL;
const size_t RethBuf::kIpOffProt;
const size_t RethBuf::kIpOffSrcIP;
const size_t RethBuf::kIpOffDstIP;
const size_t RethBuf::kImcpType;
const size_t RethBuf::kImcpCode;
const size_t RethBuf::kImcpEchoSN;
const size_t RethBuf::kTcpOffSrcPort;
const size_t RethBuf::kTcpOffDstPort;
const size_t RethBuf::kTcpOffSeqNum;
const size_t RethBuf::kTcpOffAckNum;
const size_t RethBuf::kTcpOffDatOff;
const size_t RethBuf::kTcpOffFlags;
const size_t RethBuf::kUdpOffSrcPort;
const size_t RethBuf::kUdpOffDstPort;
const size_t RethBuf::kUdpOffLen;
const size_t RethBuf::kETypeIPv4;
const size_t RethBuf::kETypeARP;
const size_t RethBuf::kIpProtICMP;
const size_t RethBuf::kIpProtTCP;
const size_t RethBuf::kIpProtUDP;
//------------------------------------------+-----------------------------------
//! Default constructor
@ -60,9 +90,37 @@ RethBuf::~RethBuf()
//------------------------------------------+-----------------------------------
//! FIXME_docs
uint16_t RethBuf::Type() const
uint8_t RethBuf::GetB(size_t boff) const
{
return ntohs(Buf16()[kWOffTyp]);
return fBuf[boff];
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
uint16_t RethBuf::GetS(size_t boff) const
{
uint8_t* pdatb = const_cast<uint8_t*>(fBuf+boff);
uint16_t* pdats = reinterpret_cast<uint16_t*>(pdatb);
return ntohs(*pdats);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
uint32_t RethBuf::GetL(size_t boff) const
{
uint8_t* pdatb = const_cast<uint8_t*>(fBuf+boff);
uint32_t* pdatl = reinterpret_cast<uint32_t*>(pdatb);
return ntohl(*pdatl);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
uint16_t RethBuf::EType() const
{
return ntohs(Buf16()[kEOffEType/2]);
}
//------------------------------------------+-----------------------------------
@ -88,11 +146,135 @@ ssize_t RethBuf::Write(int fd) const
std::string RethBuf::FrameInfo() const
{
std::ostringstream sos;
auto etype = EType();
ostringstream sos;
sos << RethTools::Mac2String(MacSource())
<< " > " << RethTools::Mac2String(MacDestination())
<< " typ: " << RosPrintBvi(Type(),16)
<< " siz: " << RosPrintf(Size(),"d",4);
<< " typ: " << RosPrintBvi(etype,16);
if (etype == kETypeIPv4) {
sos << "/" << RosPrintf(Buf8()[kElength+kIpOffProt],"d",3);
}
sos << " siz: " << RosPrintf(Size(),"d",4);
return sos.str();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RethBuf::HeaderInfo1() const
{
auto etype = EType();
if (etype != kETypeARP && etype != kETypeIPv4) string("");
ostringstream sos;
if (etype == kETypeARP) {
auto oper = GetS(kElength+kArpOffOper);
auto sha = RethTools::WList2Mac(Buf16()+(kElength+kArpOffSha)/2);
sos << "ARP: "
<< (oper==1 ? "req" : "res")
<< " sha: " << RethTools::Mac2String(sha);
if (oper == 1) {
sos << " tpa: " << RethTools::IpAddr2String(Buf8()+kElength+kArpOffTpa);
} else {
sos << " spa: " << RethTools::IpAddr2String(Buf8()+kElength+kArpOffSpa);
}
} else if (etype == kETypeIPv4) {
auto prot = GetB(kElength+kIpOffProt);
auto tlen = GetS(kElength+kIpOffLen);
auto flags = GetB(kElength+kIpOffFlags);
sos << "IPv4: prot " << RosPrintf(prot,"d",3)
<< ": " << RethTools::IpAddr2String(Buf8()+kElength+kIpOffSrcIP)
<< " > " << RethTools::IpAddr2String(Buf8()+kElength+kIpOffDstIP)
<< " siz: " << RosPrintf(tlen,"d", 4);
if (flags & 0x04) sos << " DF";
if (flags & 0x08) sos << " MF";
}
return sos.str();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RethBuf::HeaderInfo2() const
{
auto etype = EType();
if (etype != kETypeIPv4) return string("");
auto prot = Buf8()[kElength+kIpOffProt];
if (prot != kIpProtICMP && prot != kIpProtTCP &&
prot != kIpProtUDP) return string("");
ostringstream sos;
size_t iphlen = 4 * (Buf8()[kElength] & 0x0f); // IP header length
size_t hdroff = kElength + iphlen; // offset to next header
if (prot == kIpProtICMP) {
auto type = GetB(hdroff+kImcpType);
auto code = GetB(hdroff+kImcpCode);
sos << "IMCP: type: " << RosPrintf(type,"d", 3)
<< " code: " << RosPrintf(code,"d", 3);
if (type == 0 || type == 8) {
auto seqnum = ntohs(Buf16()[(hdroff+kImcpEchoSN)/2]);
sos << " echo snum: " << RosPrintf(seqnum,"d", 5)
<< (type == 0 ? " reply (ping)" : " request (ping)");
}
} else if (prot == kIpProtTCP) {
auto iptlen = GetS(kElength+kIpOffLen);
auto srcport = GetS(hdroff+kTcpOffSrcPort);
auto dstport = GetS(hdroff+kTcpOffDstPort);
auto seqnum = GetL(hdroff+kTcpOffSeqNum);
auto acknum = GetL(hdroff+kTcpOffAckNum);
auto flags = GetB(hdroff+kTcpOffFlags);
auto datoff = GetB(hdroff+kTcpOffDatOff);
size_t tcplen = iptlen - iphlen - 4*(datoff>>4 & 0x0f);
sos << "TCP: " << RosPrintf(srcport,"d", 5)
<< " > " << RosPrintf(dstport,"d", 5)
<< " n:" << RosPrintf(seqnum,"d", 10)
<< "," << RosPrintf(acknum,"d", 10)
<< " siz: " << RosPrintf(tcplen,"d", 4);
if (flags & 0x01) sos << " FIN";
if (flags & 0x02) sos << " SYN";
if (flags & 0x04) sos << " RST";
if (flags & 0x08) sos << " PSH";
if (flags & 0x10) sos << " ACK";
if (flags & 0x20) sos << " URG";
if (flags & 0x40) sos << " ECE";
if (flags & 0x80) sos << " CWR";
} else if (prot == kIpProtUDP) {
auto srcport = GetS(hdroff+kUdpOffSrcPort);
auto dstport = GetS(hdroff+kUdpOffDstPort);
auto udplen = GetS(hdroff+kUdpOffLen);
sos << "UDP: " << RosPrintf(srcport,"d", 5)
<< " > " << RosPrintf(dstport,"d", 5)
<< " siz: " << RosPrintf(udplen,"d", 4);
if (srcport == 53 || dstport == 53) sos << " DNS";
if (srcport == 67 || dstport == 67) sos << " BOOTP";
if (srcport == 68 || dstport == 68) sos << " BOOTP";
if (srcport == 69 || dstport == 69) sos << " TFTP";
if (srcport == 138 || dstport == 138) sos << " NETBIOS";
if (srcport == 5353 || dstport == 5353) sos << " mDNS";
}
return sos.str();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string RethBuf::HeaderInfoAll(bool ext, int ind) const
{
if (!ext) return FrameInfo();
RosFill bl(ind);
ostringstream sos;
sos << FrameInfo();
string info = HeaderInfo1();
if (info.size()) {
sos << endl << bl << info;
info = HeaderInfo2();
if (info.size()) {
sos << endl << bl << info;
}
}
return sos.str();
}
@ -105,15 +287,15 @@ void RethBuf::Dump(std::ostream& os, int ind, const char* text,
RosFill bl(ind);
os << bl << (text?text:"--") << "RethBuf @ " << this << endl;
os << bl << " fTime: " << fTime << endl;
os << bl << " fBuf: " << FrameInfo() << endl;
os << bl << " fBuf: " << HeaderInfoAll(detail>0, ind+9) << endl;
if (detail < 0) return; // detail<0 --> info only
if (detail <= 1) return; // detail<=1 --> info only
int ibeg = 0;
int imax = int(Size())-1;
for (int iline=0; ; iline++) {
if (ibeg > imax) break;
if (detail <= 0 && iline >= 6) break; // detail>1 --> full buffer
if (detail <= 2 && iline >= 6) break; // detail>2 --> full buffer
int iend = ibeg + 15;
int igap = 0;
if (iend > imax) {

View File

@ -1,9 +1,10 @@
// $Id: RethBuf.hpp 1186 2019-07-12 17:49:59Z mueller $
// $Id: RethBuf.hpp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 1.1 improved Info/Dump methods
// 2018-12-22 1091 1.0.1 Dump() not longer virtual (-Wnon-virtual-dtor fix)
// 2017-04-17 880 1.0 Initial version
// 2017-02-12 850 0.1 First draft
@ -41,18 +42,20 @@ namespace Retro {
const uint8_t* Buf8() const;
const uint16_t* Buf16() const;
const uint32_t* Buf32() const;
uint8_t* Buf8();
uint16_t* Buf16();
uint32_t* Buf32();
uint8_t GetB(size_t boff) const;
uint16_t GetS(size_t boff) const;
uint32_t GetL(size_t boff) const;
void SetMacDestination(uint64_t mac);
void SetMacSource(uint64_t mac);
uint64_t MacDestination() const;
uint64_t MacSource() const;
uint16_t Type() const;
uint16_t EType() const;
bool IsMcast() const;
bool IsBcast() const;
@ -60,6 +63,9 @@ namespace Retro {
ssize_t Write(int fd) const;
std::string FrameInfo() const;
std::string HeaderInfo1() const;
std::string HeaderInfo2() const;
std::string HeaderInfoAll(bool ext, int ind=0) const;
void Dump(std::ostream& os, int ind=0, const char* text=0,
int detail=0) const;
@ -68,9 +74,38 @@ namespace Retro {
static const size_t kMaxSize = 1514; //!< max ethernet frame size
static const size_t kMinSize = 60; //!< min ethernet frame size
static const size_t kCrcSize = 4; //!< size of ethernet CRC
static const size_t kWOffDstMac = 0; //!< offset dst mac in 16 bit wrds
static const size_t kWOffSrcMac = 3; //!< offset src mac in 16 bit wrds
static const size_t kWOffTyp = 6; //!< offset type in 16 bit wrds
static const size_t kEOffDstMac = 0; //!< Eth frame: offset dst MAC
static const size_t kEOffSrcMac = 6; //!< Eth frame: offset src MAC
static const size_t kEOffEType = 12; //!< Eth frame: offset EtherType
static const size_t kElength = 14; //!< Eth frame: length
static const size_t kArpOffOper = 6; //!< ARP: offset OPER
static const size_t kArpOffSha = 8; //!< ARP: offset SHA
static const size_t kArpOffSpa = 14; //!< ARP: offset SPA
static const size_t kArpOffTha = 18; //!< ARP: offset THA
static const size_t kArpOffTpa = 24; //!< ARP: offset TPA
static const size_t kIpOffLen = 2; //!< IP4 hdr: offset tot length
static const size_t kIpOffFlags = 6; //!< IP4 hdr: offset flags
static const size_t kIpOffTTL = 8; //!< IP4 hdr: offset TimeToLive
static const size_t kIpOffProt = 9; //!< IP4 hdr: offset protocol
static const size_t kIpOffSrcIP = 12; //!< IP4 hdr: offset src IP
static const size_t kIpOffDstIP = 16; //!< IP4 hdr: offset dst IP
static const size_t kImcpType = 0; //!< IMCP hdr: offset type
static const size_t kImcpCode = 1; //!< IMCP hdr: offset code
static const size_t kImcpEchoSN = 6; //!< IMCP hdr: echo seq number
static const size_t kTcpOffSrcPort = 0; //!< TCP hdr: offset src port
static const size_t kTcpOffDstPort = 2; //!< TCP hdr: offset dst port
static const size_t kTcpOffSeqNum = 4; //!< TCP hdr: offset seq num
static const size_t kTcpOffAckNum = 8; //!< TCP hdr: offset ack num
static const size_t kTcpOffDatOff = 12; //!< TCP hdr: offset data off
static const size_t kTcpOffFlags = 13; //!< TCP hdr: offset flags
static const size_t kUdpOffSrcPort = 0; //!< UDP hdr: offset src port
static const size_t kUdpOffDstPort = 2; //!< UDP hdr: offset dst port
static const size_t kUdpOffLen = 4; //!< UDP hdr: dgram length
static const size_t kETypeIPv4 = 0x0800; //!< EtherType IPv4
static const size_t kETypeARP = 0x0806; //!< EtherType ARP
static const size_t kIpProtICMP = 1; //!< IP protocol: ICMP
static const size_t kIpProtTCP = 6; //!< IP protocol: TCP
static const size_t kIpProtUDP = 17; //!< IP protocol: UDP
protected:
Rtime fTime;

View File

@ -1,9 +1,10 @@
// $Id: RethBuf.ipp 1186 2019-07-12 17:49:59Z mueller $
// $Id: RethBuf.ipp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 1.1 improved Info/Dump methods
// 2018-12-18 1089 1.0.1 use c++ style casts
// 2017-02-25 856 1.0 Initial version
// 2017-02-12 850 0.1 First draft
@ -89,14 +90,6 @@ inline const uint16_t* RethBuf::Buf16() const
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline const uint32_t* RethBuf::Buf32() const
{
return reinterpret_cast<uint32_t*>(const_cast<uint8_t*>(fBuf));
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline uint8_t* RethBuf::Buf8()
{
return fBuf;
@ -113,17 +106,9 @@ inline uint16_t* RethBuf::Buf16()
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline uint32_t* RethBuf::Buf32()
{
return reinterpret_cast<uint32_t*>(fBuf);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void RethBuf::SetMacDestination(uint64_t mac)
{
RethTools::Mac2WList(mac, Buf16()+kWOffDstMac);
RethTools::Mac2WList(mac, Buf16()+kEOffDstMac/2);
return;
}
@ -132,7 +117,7 @@ inline void RethBuf::SetMacDestination(uint64_t mac)
inline void RethBuf::SetMacSource(uint64_t mac)
{
RethTools::Mac2WList(mac, Buf16()+kWOffSrcMac);
RethTools::Mac2WList(mac, Buf16()+kEOffSrcMac/2);
return;
}
@ -141,7 +126,7 @@ inline void RethBuf::SetMacSource(uint64_t mac)
inline uint64_t RethBuf::MacDestination() const
{
return RethTools::WList2Mac(Buf16()+kWOffDstMac);
return RethTools::WList2Mac(Buf16()+kEOffDstMac/2);
}
//------------------------------------------+-----------------------------------
@ -149,7 +134,7 @@ inline uint64_t RethBuf::MacDestination() const
inline uint64_t RethBuf::MacSource() const
{
return RethTools::WList2Mac(Buf16()+kWOffSrcMac);
return RethTools::WList2Mac(Buf16()+kEOffSrcMac/2);
}
//------------------------------------------+-----------------------------------

View File

@ -1,9 +1,10 @@
// $Id: RethTools.cpp 1186 2019-07-12 17:49:59Z mueller $
// $Id: RethTools.cpp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 1.1 add IpAddr2String
// 2017-04-15 875 1.0 Initial version
// 2017-02-04 849 0.1 First draft
// ---------------------------------------------------------------------------
@ -12,6 +13,8 @@
\brief Implemenation of RethTools .
*/
#include <sstream>
#include "librtools/Rexception.hpp"
#include "librtools/Rtools.hpp"
@ -83,5 +86,18 @@ uint64_t String2Mac(const std::string& str)
return mac;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
std::string IpAddr2String(const uint8_t ipaddr[4])
{
ostringstream sos;
sos << uint16_t(ipaddr[0])
<< "." << uint16_t(ipaddr[1])
<< "." << uint16_t(ipaddr[2])
<< "." << uint16_t(ipaddr[3]);
return sos.str();
}
} // end namespace RethTools
} // end namespace Retro

View File

@ -1,9 +1,10 @@
// $Id: RethTools.hpp 1186 2019-07-12 17:49:59Z mueller $
// $Id: RethTools.hpp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2017-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 1.1 add IpAddr2String
// 2017-04-15 875 1.0 Initial version
// 2017-02-04 849 0.1 First draft
// ---------------------------------------------------------------------------
@ -29,6 +30,7 @@ namespace Retro {
uint64_t String2Mac(const std::string& str);
void Mac2WList(uint64_t mac, uint16_t wlist[3]);
uint64_t WList2Mac(const uint16_t wlist[3]);
std::string IpAddr2String(const uint8_t ipaddr[4]);
} // end namespace RethTools

View File

@ -1,9 +1,10 @@
// $Id: Rw11CntlDEUNA.cpp 1377 2023-02-21 10:05:30Z mueller $
// $Id: Rw11CntlDEUNA.cpp 1378 2023-02-23 10:45:17Z mueller $
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2014-2023 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// Revision History:
// Date Rev Version Comment
// 2023-02-22 1378 0.6.1 use RethBuf::HeaderInfoAll
// 2023-02-21 1377 0.6 add EtherType filter
// 2023-02-20 1376 0.5.11 log transitions into and out of kStateRxPoll
// 2019-06-15 1164 0.5.10 adapt to new RtimerFd API
@ -553,6 +554,22 @@ bool Rw11CntlDEUNA::RcvCallback(RethBuf::pbuf_t& pbuf)
return true;
}
if (EtfEnable()) { // EtherType filter enabled ?
uint16_t etype = pbuf->EType();
bool etfok = false;
etfok |= etype == 0x0800; // EtherType APV4
etfok |= etype == 0x0806; // EtherType ARP
if (!etfok) { // drop by EtherType
fStats.Inc(kStatNRxFraETDrop);
if (fTraceLevel>1 && EtfTrace()) {
RlogMsg lmsg(LogFile());
lmsg << "-I " << Name() << ": edr "
<< pbuf->HeaderInfoAll(fTraceLevel>2, 12) << endl;
}
return true;
}
}
uint64_t macdst = pbuf->MacDestination();
int matchdst = MacFilter(macdst);
@ -567,25 +584,12 @@ bool Rw11CntlDEUNA::RcvCallback(RethBuf::pbuf_t& pbuf)
}
if (fTraceLevel>1) {
RlogMsg lmsg(LogFile());
lmsg << "-I " << Name() << ": fdr " << pbuf->FrameInfo() << endl;
lmsg << "-I " << Name() << ": fdr "
<< pbuf->HeaderInfoAll(fTraceLevel>2, 12) << endl;
}
return true;
}
} else { // matched
if (EtfEnable()) { // EtherType filer enabled ?
uint16_t etype = pbuf->Type();
bool etfok = false;
etfok |= etype == 0x0800; // EtherType APV4
etfok |= etype == 0x0806; // EtherType ARP
if (!etfok) { // drop by EtherType
fStats.Inc(kStatNRxFraETDrop);
if (fTraceLevel>1 && EtfTrace()) {
RlogMsg lmsg(LogFile());
lmsg << "-I " << Name() << ": edr " << pbuf->FrameInfo() << endl;
}
return true;
}
}
if (matchdst == 0) {
fStats.Inc(kStatNRxFraFDst);
} else if (matchdst == 1) {
@ -599,7 +603,8 @@ bool Rw11CntlDEUNA::RcvCallback(RethBuf::pbuf_t& pbuf)
fStats.Inc(kStatNRxFraQLDrop);
if (fTraceLevel>0) {
RlogMsg lmsg(LogFile());
lmsg << "-I " << Name() << ": qdr " << pbuf->FrameInfo() << endl;
lmsg << "-I " << Name() << ": qdr "
<< pbuf->HeaderInfoAll(fTraceLevel>2, 12) << endl;
}
return true;
}
@ -696,7 +701,7 @@ void Rw11CntlDEUNA::Dump(std::ostream& os, int ind, const char* text,
os << bl << " fRxBufQueue.size: " << RosPrintf(rxquesize,"d", 4) << endl;
for (size_t i=0; i<rxquesize; i++) {
os << bl << " fRxBufQueue[" << RosPrintf(i,"d", 4)
<< "]: " << fRxBufQueue[i]->FrameInfo() << endl;
<< "]: " << fRxBufQueue[i]->HeaderInfoAll(detail>0,12) << endl;
}
if (fRxBufCurr) {
fRxBufCurr->Dump(os, ind+2, "fRxBufCurr:", detail);
@ -1603,7 +1608,7 @@ int Rw11CntlDEUNA::TxRingHandler()
}
}
if (fTraceLevel>2) {
if (fTraceLevel>3) {
RlogMsg lmsg(LogFile());
std::ostringstream sos;
fTxBuf.Dump(sos, 4, "fTxBuf: ");
@ -1880,7 +1885,8 @@ void Rw11CntlDEUNA::LogFrameInfo(char rxtx, const RethBuf& buf)
bool tx = (rxtx == 't');
RlogMsg lmsg(LogFile());
lmsg << "-I " << Name() << ":" << (tx ? " snd " : " rcv ") << buf.FrameInfo();
lmsg << "-I " << Name() << ":" << (tx ? " snd " : " rcv ")
<< buf.HeaderInfoAll(fTraceLevel>2, 12);
return;
}