lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


No, it isn't specific to wireshark. I only needed this:

function extract_com.packet()

    local values = { ctxId() }
    -- {} is a table constructor, so values is a table

    -- then you can iterate over the entries in your "values" table
    for i,value in ipairs(values) do
        
        print (i, value)
        
        test = tostring(value)
        print (test)
    end

    -- You can even return all values if you want using unpack:
    return unpack(values)
end

Thanks
Joseph

-----Message d'origine-----
De : lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]De la part de Sam Roberts
Envoyé : mercredi 21 février 2007 17:46
À : lua@bazar2.conectiva.com.br
Objet : [SPAM] - Re: LUA userdata - Email found in subject


On Wed, Feb 21, 2007 at 09:59:20AM +0100, Verriere Joseph wrote:
> I'm using LUA with wireshark and as I get context or termination ids
> orelse, I get a userdata type. In it, there are several values and I'd
> like to cut it in pieces of string or number to work on each. How can
> I put it in a table or in a number or string type ?

This is a wireshark specific question. There is no generoc way to access
internals of userdata (lua doesn't know what's in a userdata, its
untyped memory from its point of view), you have to use the functions
that the implementor of the wireshark provided to work with that
userdata.

Sam


----------------------------------------------------------------------------------------------------

Ce message et tout document joint sont confidentiels et à l'intention exclusive des destinataires. S'ils vous ont été adressés par erreur, merci d'en informer immédiatement l'expéditeur et de les détruire. Toute copie, diffusion ou utilisation non autorisée est interdite. Tout message électronique est susceptible d'altération : Astellia décline toute responsabilité si le message ou les documents joints ont subi une quelconque modification.

This message and any attachment are confidential and intended solely to its addressees. If you are not the intended recipient please cancel it and inform immediately the sender. Any unauthorised copy or dissemination is prohibited. Electronic messages may be altered: Astellia shall not be liable for those circumstances.

----------------------------------------------------------------------------------------------------