how to precompile and use precompiled lua dissectors
Hi,
i just finished writing my first small dissector. I'm impressed that i could do it within some hours without real LUA experience. I'm not a professional programmer, so copy pasting and adjusting stuff was my main method...
so... i could use luac to compile the final .lua script.
However: how do i use that piece now?
If i name the file "compiled_lua.lua" it fails because wireshark think it is plain/text lua. If i name it "luac" it is ignored If i leave the extension it is also ignored
I compiled it using "luac script.lua" ...
Before anyone interjects: i read 10 times now that it does not bring any performance benefits. The reason i'm doing this is mainly to be able to share it witout disclosing the source directly...
Thanks for any hints!
I don't know if the GPL licence Wireshark is distributed under allows you to withhold the source of a Lua dissector if you distribute (as defined by the GPL) the "compiled" version. That's certainly not permissible for a C-based dissector.
As per cmaynards comment it doesn't even seem to be possible right now. Anyway i had read about that GPL issue and it is the topic of many discussions. As far as i understood the GPL allows "private" code. I.e. if i share this only in my organization it would not be distributed in a broader manner and no distribution means no sharing of the source is necessary. But as i see, it is not possible anyway, so i'll live with the fact that my ugly code remains visible ;)
As for providing source code, that would be my understanding as well - that if you only distribute it within your own organization, then you don't have to release the source code outside of your organization. Basically, the same rules as for built-in or plugin C dissectors.
I find this feature potentially beneficial for a couple of reasons:
I wouldn't worry too much about your ugly code being visible to others in your organization though. Others can always provide feedback, fixes, recommendations, etc., and that's how you improve both the ...(more)
Well... sure... I understand and most important I appreciate the benefits of Open Source, I'll be happy to contribute to common knowledge. However i wrote the dissector on company time and hence must check the policy of whether i'm allowed to open source this piece of work or not. As i did not wanted to open pandoras box, i have not yet asked for approval. We're a huge corporation and i think finding out how to open source this might take as much or even more time than writing it... I'll check this in January after my christmas vacation.