From 4ec224e5a3ea92b0b63c36f5a4ec426cbfe6ccab Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 16 Sep 2008 12:08:42 +0000 Subject: [PATCH] Added raw and SCCP dumper types. git-svn-id: http://voip.null.ro/svn/yate@2200 acf43c95-373e-0410-b603-e72c3f656dc1 --- libs/ysig/dumper.cpp | 13 ++++++++++--- libs/ysig/yatesig.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/ysig/dumper.cpp b/libs/ysig/dumper.cpp index 449e55b8..77c081f3 100644 --- a/libs/ysig/dumper.cpp +++ b/libs/ysig/dumper.cpp @@ -64,7 +64,11 @@ bool SignallingDumper::dump(void* buf, unsigned int len, bool sent, int link) { if (!(active() && buf && len)) return false; - if (m_type == Hexa) { + if (m_type == Raw) { + int wr = m_output->writeData(buf,len); + return (wr == (int)len); + } + else if (m_type == Hexa) { String str; str.hexify(buf,len); str = "0 " + str + "\n"; @@ -92,7 +96,7 @@ void SignallingDumper::head() { if (!active()) return; - if (m_type == Hexa) + if (m_type == Raw || m_type == Hexa) return; u_int32_t hdr[6]; hdr[0] = 0xa1b2c3d4; // libpcap magic @@ -111,7 +115,10 @@ void SignallingDumper::head() case Mtp3: hdr[5] = 141; break; - case Hexa: + case Sccp: + hdr[5] = 142; + break; + default: // compiler, please shut up break; } diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index 5e1c5c74..4c52290e 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -155,10 +155,12 @@ public: * Type of dumper output */ enum Type { + Raw, Hexa, Hdlc, Mtp2, Mtp3, + Sccp, }; /**