Added raw and SCCP dumper types.

git-svn-id: http://voip.null.ro/svn/yate@2200 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-09-16 12:08:42 +00:00
parent 5fe1de4532
commit 4ec224e5a3
2 changed files with 12 additions and 3 deletions

View File

@ -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;
}

View File

@ -155,10 +155,12 @@ public:
* Type of dumper output
*/
enum Type {
Raw,
Hexa,
Hdlc,
Mtp2,
Mtp3,
Sccp,
};
/**