* @revision 03 * @license http://creativecommons.org/licenses/by-sa/2.0/de/ Creative Commons Attribution-Share Alike 2.0 Germany * @homepage http://oss.tiggerswelt.net/oscar/ * @copyright Copyright © 2008 tiggersWelt.net */ class Oscar_TLV_DC_Info extends Oscar_TLV { /* Type of this TLV */ const TYPE = 0x000C; const MAX_LENGTH = 0x25; const LENGTH = 0x25; const DC_DISABLED = 0x0000; const DC_HTTPS = 0x0001; const DC_SOCKS = 0x0002; const DC_NORMAL = 0x0004; const DC_WEB = 0x0006; public $IP = ""; public $Port = 0; public $Type = Oscar_TLV_DC_Info::DC_DISABLED; public $Version = 0; public $Cookie = 0; public $Webport = 0; public $Features = 0; // {{{ parse /** * @access public * @return void * @todo Add support for additional features */ public function parse () { $this->IP = long2ip (Oscar_Common::str2int32 ($this->Data, 0, true)); $this->Port = Oscar_Common::str2int32 ($this->Data, 0, true); $this->Type = Oscar_Common::str2int8 ($this->Data, 0, true); $this->Version = Oscar_Common::str2int16 ($this->Data, 0, true); $this->Cookie = Oscar_Common::str2int32 ($this->Data, 0, true); $this->Webport = Oscar_Common::str2int32 ($this->Data, 0, true); $this->Features = Oscar_Common::str2int32 ($this->Data, 0, true); // Additional Data 0x00000000 0x00000000 0x00000000 0x0000 } // }}} // {{{ generate /** * @access public * @return string * @todo Add support for additional features */ public function generate () { $this->Data = Oscar_Common::int32tostr (ip2long ($this->IP)) . Oscar_Common::int32tostr ($this->Port) . Oscar_Common::int8tostr ($this->Type) . Oscar_Common::int16tostr ($this->Version) . Oscar_Common::int32tostr ($this->Cookie) . Oscar_Common::int32tostr ($this->Webport) . Oscar_Common::int32tostr ($this->Features) . Oscar_Common::int32tostr (0) . Oscar_Common::int32tostr (0) . Oscar_Common::int32tostr (0) . Oscar_Common::int16tostr (0); return parent::generate (); } // }}} } ?>