#include <TurnMsgLib.h>
Public Member Functions | |
| StunMsgRequest (u16bits method) | |
| StunMsgRequest (u08bits *buffer, size_t total_sz, size_t sz, bool constructed) throw (WrongStunBufferFormatException) | |
| virtual | ~StunMsgRequest () |
| u16bits | getMethod () const |
| void | setMethod (u16bits method) |
| void | constructBindingRequest () |
| bool | isBindingRequest () const |
| void | constructAllocateRequest (u32bits lifetime, int address_family) |
| void | constructChannelBindRequest (const ioa_addr &peer_addr, u16bits channel_number) |
Protected Member Functions | |
| virtual void | constructBuffer () |
| virtual bool | check () |
Class that represents the "request" flavor of STUN/TURN messages.
Definition at line 773 of file TurnMsgLib.h.
| turn::StunMsgRequest::StunMsgRequest | ( | u16bits | method | ) | [inline] |
Definition at line 775 of file TurnMsgLib.h.
: _method(method) {};
| turn::StunMsgRequest::StunMsgRequest | ( | u08bits * | buffer, |
| size_t | total_sz, | ||
| size_t | sz, | ||
| bool | constructed | ||
| ) | throw (WrongStunBufferFormatException) [inline] |
Definition at line 776 of file TurnMsgLib.h.
:
StunMsg(buffer,total_sz,sz,constructed),_method(0) {
if(constructed) {
if(!stun_is_request_str(buffer,sz)) {
throw WrongStunBufferFormatException();
}
_method = stun_get_method_str(buffer,sz);
}
}
| virtual turn::StunMsgRequest::~StunMsgRequest | ( | ) | [inline, virtual] |
Definition at line 787 of file TurnMsgLib.h.
{}
| virtual bool turn::StunMsgRequest::check | ( | ) | [inline, protected, virtual] |
Implements turn::StunMsg.
Definition at line 835 of file TurnMsgLib.h.
{
if(!_constructed)
return false;
if(!stun_is_request_str(_buffer,_sz)) {
return false;
}
if(_method != stun_get_method_str(_buffer,_sz)) {
return false;
}
return true;
}
| void turn::StunMsgRequest::constructAllocateRequest | ( | u32bits | lifetime, |
| int | address_family | ||
| ) | [inline] |
Construct allocate request
Definition at line 817 of file TurnMsgLib.h.
{
stun_set_allocate_request_str(_buffer, &_sz, lifetime, address_family);
}
| void turn::StunMsgRequest::constructBindingRequest | ( | ) | [inline] |
Construct binding request
Definition at line 806 of file TurnMsgLib.h.
{
stun_set_binding_request_str(_buffer, &_sz);
}
| virtual void turn::StunMsgRequest::constructBuffer | ( | ) | [inline, protected, virtual] |
Implements turn::StunMsg.
Definition at line 830 of file TurnMsgLib.h.
{
stun_init_request_str(_method,_buffer,&_sz);
_constructed = true;
}
| void turn::StunMsgRequest::constructChannelBindRequest | ( | const ioa_addr & | peer_addr, |
| u16bits | channel_number | ||
| ) | [inline] |
Construct channel bind request
Definition at line 824 of file TurnMsgLib.h.
{
stun_set_channel_bind_request_str(_buffer, &_sz,
&peer_addr, channel_number);
}
| u16bits turn::StunMsgRequest::getMethod | ( | ) | const [inline] |
| bool turn::StunMsgRequest::isBindingRequest | ( | ) | const [inline] |
Definition at line 810 of file TurnMsgLib.h.
{
return stun_is_binding_request_str(_buffer,_sz,0);
}
| void turn::StunMsgRequest::setMethod | ( | u16bits | method | ) | [inline] |
1.8.0