#include <TurnMsgLib.h>
Public Member Functions | |
StunMsgChannel (u16bits cn, int length) | |
StunMsgChannel (u08bits *buffer, size_t total_sz, size_t sz, bool constructed) throw (WrongStunBufferFormatException) | |
virtual | ~StunMsgChannel () |
u16bits | getChannelNumber () const |
void | setChannelNumber (u16bits cn) |
size_t | getLength () const |
void | setLength (size_t len) |
Protected Member Functions | |
virtual void | constructBuffer () |
virtual bool | check () |
Definition at line 781 of file TurnMsgLib.h.
StunMsgChannel::StunMsgChannel | ( | u16bits | cn, |
int | length | ||
) | [inline] |
Definition at line 783 of file TurnMsgLib.h.
: _cn(cn), _len(length) {};
StunMsgChannel::StunMsgChannel | ( | u08bits * | buffer, |
size_t | total_sz, | ||
size_t | sz, | ||
bool | constructed | ||
) | throw (WrongStunBufferFormatException) [inline] |
Definition at line 784 of file TurnMsgLib.h.
: StunMsg(buffer,total_sz,sz,constructed),_cn(0) { if(constructed) { if(!stun_is_channel_message_str(buffer,sz,&_cn)) { throw WrongStunBufferFormatException(); } if(_sz>0xFFFF || _sz<4) throw WrongStunBufferFormatException(); _len = _sz-4; } else { if(total_sz>0xFFFF || total_sz<4) throw WrongStunBufferFormatException(); _len = 0; } }
virtual StunMsgChannel::~StunMsgChannel | ( | ) | [inline, virtual] |
Definition at line 803 of file TurnMsgLib.h.
{}
virtual bool StunMsgChannel::check | ( | ) | [inline, protected, virtual] |
Implements StunMsg.
Definition at line 827 of file TurnMsgLib.h.
{ if(!_constructed) return false; u16bits cn = 0; if(!stun_is_channel_message_str(_buffer,_sz,&cn)) { return false; } if(_cn != cn) { return false; } return true; }
virtual void StunMsgChannel::constructBuffer | ( | ) | [inline, protected, virtual] |
Implements StunMsg.
Definition at line 822 of file TurnMsgLib.h.
{ stun_init_channel_message_str(_cn,_buffer,&_sz,(int)_len); _constructed = true; }
u16bits StunMsgChannel::getChannelNumber | ( | ) | const [inline] |
Definition at line 805 of file TurnMsgLib.h.
{
return _cn;
}
size_t StunMsgChannel::getLength | ( | ) | const [inline] |
Definition at line 813 of file TurnMsgLib.h.
{
return _len;
}
void StunMsgChannel::setChannelNumber | ( | u16bits | cn | ) | [inline] |
Definition at line 809 of file TurnMsgLib.h.
{ _cn = cn; }
void StunMsgChannel::setLength | ( | size_t | len | ) | [inline] |
Definition at line 817 of file TurnMsgLib.h.
{ _len = len; }