Esempio n. 1
0
function TVL_Create($TVL)
{
    /****************************************************************************/
    $__args_types = array('array');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = '';
    #-----------------------------------------------------------------------------
    foreach (Array_Keys($TVL) as $WordID) {
        #---------------------------------------------------------------------------
        $Word = $TVL[$WordID];
        #---------------------------------------------------------------------------
        if (!Is_Array($Word)) {
            $Size = StrLen($Word);
        } else {
            $Word = Bytes_I2B($Size = Next($Word), Prev($Word));
        }
        #---------------------------------------------------------------------------
        $Result .= Bytes_I2B(WORD, HexDec($WordID)) . Bytes_I2B(WORD, $Size) . $Word;
        # Значение
    }
    #-----------------------------------------------------------------------------
    return $Result;
}
Esempio n. 2
0
function FLAP_Create($Chanel, $Data)
{
    #-----------------------------------------------------------------------------
    static $FlapID = 1;
    /****************************************************************************/
    $__args_types = array('integer', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    return Chr(0x2a) . Bytes_I2B(BUTE, $Chanel) . Bytes_I2B(WORD, $FlapID++) . Bytes_I2B(WORD, StrLen($Data)) . $Data;
    # Сам пакет
}
Esempio n. 3
0
function SNAC_Create($FamilyID, $SubTypeID, $Data = '')
{
    /****************************************************************************/
    $__args_types = array('integer', 'integer', 'string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = Bytes_I2B(WORD, HexDec($FamilyID)) . Bytes_I2B(WORD, HexDec($SubTypeID)) . Bytes_I2B(BUTE, 0) . Bytes_I2B(BUTE, 0) . Bytes_I2B(DWORD, Rand(1, 65025));
    # Номер запроса
    #-----------------------------------------------------------------------------
    $Result .= $Data;
    # Сам пакет
    #-----------------------------------------------------------------------------
    return $Result;
}