changes to build lua plugin with MSVC6:
- nmake makefile for lua plugin added. - declare variables at the beginning of a function. - proto_reg_handoff_lua was removed, remove remaining calls, too. - missing functions to libethereal.def added. add lua plugin to installer, if available. svn path=/trunk/; revision=17196
This commit is contained in:
parent
baed8f0888
commit
5f1e470cc2
19
config.nmake
19
config.nmake
|
@ -156,6 +156,15 @@ PCRE_DIR=$(ETHEREAL_LIBS)\pcre-6.4
|
||||||
#
|
#
|
||||||
# NETTLE_DIR=$(ETHEREAL_LIBS)\nettle-1.10
|
# NETTLE_DIR=$(ETHEREAL_LIBS)\nettle-1.10
|
||||||
|
|
||||||
|
#
|
||||||
|
# If you have the LUA library, set this to the pathname
|
||||||
|
# of the directory in which the LUA package has been extracted.
|
||||||
|
#
|
||||||
|
# If you don't have LUA, comment this line out, so that LUA_DIR
|
||||||
|
# isn't defined.
|
||||||
|
#
|
||||||
|
# LUA_DIR=$(ETHEREAL_LIBS)\lua-5.0.2
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set ICONV_DIR to the pathname of the directory in which the
|
# Set ICONV_DIR to the pathname of the directory in which the
|
||||||
# ICONV include files and library resides.
|
# ICONV include files and library resides.
|
||||||
|
@ -419,6 +428,16 @@ GNUTLS_LIBS=
|
||||||
GNUTLS_CONFIG=
|
GNUTLS_CONFIG=
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
LUA_CFLAGS=/I$(LUA_DIR)\include
|
||||||
|
LUA_LIBS=$(LUA_DIR)\bin\LibLua.lib $(LUA_DIR)\bin\LibLuaLib.lib
|
||||||
|
# Nmake uses carets to escape special characters
|
||||||
|
LUA_CONFIG=^#define HAVE_LUA 1
|
||||||
|
!else
|
||||||
|
LUA_CFLAGS=
|
||||||
|
LUA_LIBS=
|
||||||
|
LUA_CONFIG=
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
# Construct the path
|
# Construct the path
|
||||||
PATH=$(PATH);$(CYGWIN_PATH);$(DLL_PATH);$(ZLIB_PATH);$(ADNS_PATH)
|
PATH=$(PATH);$(CYGWIN_PATH);$(DLL_PATH);$(ZLIB_PATH);$(ADNS_PATH)
|
||||||
|
|
|
@ -326,6 +326,8 @@ get_dissector_table_ui_name
|
||||||
get_ether_name
|
get_ether_name
|
||||||
get_hostname
|
get_hostname
|
||||||
get_hostname6
|
get_hostname6
|
||||||
|
get_host_ipaddr
|
||||||
|
get_host_ipaddr6
|
||||||
get_manuf_name_if_known
|
get_manuf_name_if_known
|
||||||
get_persconffile_path
|
get_persconffile_path
|
||||||
get_plugins_global_dir
|
get_plugins_global_dir
|
||||||
|
@ -387,6 +389,7 @@ nstime_to_sec
|
||||||
nt_cmd_vals DATA
|
nt_cmd_vals DATA
|
||||||
num_tap_filters DATA
|
num_tap_filters DATA
|
||||||
num_tree_types DATA
|
num_tree_types DATA
|
||||||
|
offset_from_real_beginning
|
||||||
plugin_list DATA
|
plugin_list DATA
|
||||||
postseq_cleanup_all_protocols
|
postseq_cleanup_all_protocols
|
||||||
prefs DATA
|
prefs DATA
|
||||||
|
@ -524,6 +527,7 @@ register_all_protocols
|
||||||
register_all_protocol_handoffs
|
register_all_protocol_handoffs
|
||||||
register_dissector
|
register_dissector
|
||||||
register_dissector_table
|
register_dissector_table
|
||||||
|
register_final_registration_routine
|
||||||
register_giop_user
|
register_giop_user
|
||||||
register_giop_user_module
|
register_giop_user_module
|
||||||
register_heur_dissector_list
|
register_heur_dissector_list
|
||||||
|
@ -536,6 +540,7 @@ register_tap_listener
|
||||||
RegistrationRejectReason_vals DATA
|
RegistrationRejectReason_vals DATA
|
||||||
ReleaseCompleteReason_vals DATA
|
ReleaseCompleteReason_vals DATA
|
||||||
relinquish_special_privs_perm
|
relinquish_special_privs_perm
|
||||||
|
rel_time_to_str
|
||||||
remove_tap_listener
|
remove_tap_listener
|
||||||
report_failure
|
report_failure
|
||||||
report_open_failure
|
report_open_failure
|
||||||
|
|
|
@ -76,6 +76,9 @@ PLUGINS=../../plugins/acn/acn.dll \
|
||||||
../../plugins/gryphon/gryphon.dll \
|
../../plugins/gryphon/gryphon.dll \
|
||||||
../../plugins/h223/h223.dll \
|
../../plugins/h223/h223.dll \
|
||||||
../../plugins/irda/irda.dll \
|
../../plugins/irda/irda.dll \
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
../../plugins/lua/lua.dll \
|
||||||
|
!ENDIF
|
||||||
../../plugins/lwres/lwres.dll \
|
../../plugins/lwres/lwres.dll \
|
||||||
../../plugins/mate/mate.dll \
|
../../plugins/mate/mate.dll \
|
||||||
../../plugins/megaco/megaco.dll \
|
../../plugins/megaco/megaco.dll \
|
||||||
|
@ -143,6 +146,9 @@ $(DEST)-setup-$(VERSION).exe : $(NSI) $(DELIVERABLES) Makefile.nmake
|
||||||
!ENDIF
|
!ENDIF
|
||||||
!IF "$(ZLIB_DIR)" != ""
|
!IF "$(ZLIB_DIR)" != ""
|
||||||
/DZLIB_DIR=$(ZLIB_DIR) \
|
/DZLIB_DIR=$(ZLIB_DIR) \
|
||||||
|
!ENDIF
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
/DLUA_DIR=$(LUA_DIR) \
|
||||||
!ENDIF
|
!ENDIF
|
||||||
ethereal.nsi
|
ethereal.nsi
|
||||||
|
|
||||||
|
|
|
@ -719,6 +719,14 @@ SetOutPath $INSTDIR\plugins\${VERSION}
|
||||||
File "..\..\plugins\mate\mate.dll"
|
File "..\..\plugins\mate\mate.dll"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
!ifdef LUA_DIR
|
||||||
|
Section "LUA Plugin" SecLua
|
||||||
|
;-------------------------------------------
|
||||||
|
SetOutPath $INSTDIR\plugins\${VERSION}
|
||||||
|
File "..\..\plugins\lua\lua.dll"
|
||||||
|
SectionEnd
|
||||||
|
!endif
|
||||||
|
|
||||||
Section "SNMP MIBs" SecMIBs
|
Section "SNMP MIBs" SecMIBs
|
||||||
;-------------------------------------------
|
;-------------------------------------------
|
||||||
!ifdef GTK1_DIR & GTK2_DIR
|
!ifdef GTK1_DIR & GTK2_DIR
|
||||||
|
@ -984,6 +992,9 @@ SectionEnd
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Plugins with some extended dissections."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Plugin for some extended statistics."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)."
|
||||||
|
!ifdef LUA_DIR
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecLua} "Plugin - LUA (Experimental)."
|
||||||
|
!endif
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools."
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Editcap is a program that reads a capture file and writes some or all of the packets into another capture file."
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Editcap is a program that reads a capture file and writes some or all of the packets into another capture file."
|
||||||
|
|
|
@ -18,6 +18,7 @@ all: \
|
||||||
gryphon \
|
gryphon \
|
||||||
h223 \
|
h223 \
|
||||||
irda \
|
irda \
|
||||||
|
lua\
|
||||||
lwres \
|
lwres \
|
||||||
mate \
|
mate \
|
||||||
megaco \
|
megaco \
|
||||||
|
@ -88,6 +89,13 @@ irda::
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
lua::
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
cd lua
|
||||||
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
||||||
|
cd ..
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
lwres::
|
lwres::
|
||||||
cd lwres
|
cd lwres
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
|
||||||
|
@ -176,6 +184,8 @@ clean:
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
||||||
cd ../irda
|
cd ../irda
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
||||||
|
cd ../lua
|
||||||
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
||||||
cd ../lwres
|
cd ../lwres
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
|
||||||
cd ../mate
|
cd ../mate
|
||||||
|
@ -227,6 +237,8 @@ distclean: clean
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
||||||
cd ../irda
|
cd ../irda
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
||||||
|
cd ../lua
|
||||||
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
||||||
cd ../lwres
|
cd ../lwres
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
|
||||||
cd ../mate
|
cd ../mate
|
||||||
|
@ -278,6 +290,8 @@ maintainer-clean: distclean
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
||||||
cd ../irda
|
cd ../irda
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
||||||
|
cd ../lua
|
||||||
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
||||||
cd ../lwres
|
cd ../lwres
|
||||||
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
|
||||||
cd ../mate
|
cd ../mate
|
||||||
|
@ -324,6 +338,9 @@ install-plugins:
|
||||||
xcopy gryphon\*.dll $(VERSION) /d
|
xcopy gryphon\*.dll $(VERSION) /d
|
||||||
xcopy h223\*.dll $(VERSION) /d
|
xcopy h223\*.dll $(VERSION) /d
|
||||||
xcopy irda\*.dll $(VERSION) /d
|
xcopy irda\*.dll $(VERSION) /d
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
xcopy lua\*.dll $(VERSION) /d
|
||||||
|
!ENDIF
|
||||||
xcopy lwres\*.dll $(VERSION) /d
|
xcopy lwres\*.dll $(VERSION) /d
|
||||||
xcopy mate\*.dll $(VERSION) /d
|
xcopy mate\*.dll $(VERSION) /d
|
||||||
xcopy megaco\*.dll $(VERSION) /d
|
xcopy megaco\*.dll $(VERSION) /d
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
include ..\..\config.nmake
|
||||||
|
|
||||||
|
############### no need to modify below this line #########
|
||||||
|
|
||||||
|
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) $(LUA_CFLAGS)\
|
||||||
|
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
|
||||||
|
|
||||||
|
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
|
||||||
|
|
||||||
|
!IFDEF LUA_DIR
|
||||||
|
!IFDEF ENABLE_LIBETHEREAL
|
||||||
|
LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
|
||||||
|
CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
|
||||||
|
|
||||||
|
OBJECTS= \
|
||||||
|
lua_tvb.obj \
|
||||||
|
lua_proto.obj \
|
||||||
|
lua_tree.obj \
|
||||||
|
lua_pinfo.obj \
|
||||||
|
lua_tap.obj \
|
||||||
|
lua_gui.obj \
|
||||||
|
packet-lua.obj \
|
||||||
|
plugin.obj
|
||||||
|
|
||||||
|
lua.dll lua.exp lua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
|
||||||
|
link -dll /out:lua.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
|
||||||
|
$(GLIB_LIBS) $(LUA_LIBS)
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJECTS) lua.dll lua.exp lua.lib *.pdb
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
maintainer-clean: distclean
|
|
@ -34,20 +34,20 @@ LUA_CLASS_DEFINE(ByteArray,BYTE_ARRAY,if (! *p) luaL_argerror(L,index,"null byte
|
||||||
|
|
||||||
static int ByteArray_new(lua_State* L) {
|
static int ByteArray_new(lua_State* L) {
|
||||||
GByteArray* ba = g_byte_array_new();
|
GByteArray* ba = g_byte_array_new();
|
||||||
|
const gchar* s;
|
||||||
|
/* XXX: slow! */
|
||||||
|
int nibble[2];
|
||||||
|
int i = 0;
|
||||||
|
gchar c;
|
||||||
|
|
||||||
if (lua_gettop(L) == 1) {
|
if (lua_gettop(L) == 1) {
|
||||||
const gchar* s = luaL_checkstring(L,1);
|
s = luaL_checkstring(L,1);
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
luaL_argerror(L,1,"not a string");
|
luaL_argerror(L,1,"not a string");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: slow! */
|
|
||||||
int nibble[2];
|
|
||||||
int i = 0;
|
|
||||||
gchar c;
|
|
||||||
|
|
||||||
for (; (c = *s); s++) {
|
for (; (c = *s); s++) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case '0': case '1': case '2': case '3': case '4': case '5' : case '6' : case '7': case '8' : case '9' :
|
case '0': case '1': case '2': case '3': case '4': case '5' : case '6' : case '7': case '8' : case '9' :
|
||||||
|
@ -282,6 +282,9 @@ int ByteArray_register(lua_State* L) {
|
||||||
|
|
||||||
static int Tvb_new_real (lua_State *L) {
|
static int Tvb_new_real (lua_State *L) {
|
||||||
ByteArray ba = checkByteArray(L,1);
|
ByteArray ba = checkByteArray(L,1);
|
||||||
|
const gchar* name = luaL_optstring(L,2,"Unnamed") ;
|
||||||
|
guint8* data;
|
||||||
|
Tvb tvb;
|
||||||
|
|
||||||
if (!ba) return 0;
|
if (!ba) return 0;
|
||||||
|
|
||||||
|
@ -294,14 +297,12 @@ static int Tvb_new_real (lua_State *L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar* name = luaL_optstring(L,2,"Unnamed") ;
|
|
||||||
guint8* data;
|
|
||||||
|
|
||||||
if (! ba) return 0;
|
if (! ba) return 0;
|
||||||
|
|
||||||
data = g_memdup(ba->data, ba->len);
|
data = g_memdup(ba->data, ba->len);
|
||||||
|
|
||||||
Tvb tvb = tvb_new_real_data(data, ba->len,ba->len);
|
tvb = tvb_new_real_data(data, ba->len,ba->len);
|
||||||
tvb_set_free_cb(tvb, g_free);
|
tvb_set_free_cb(tvb, g_free);
|
||||||
|
|
||||||
add_new_data_source(lua_pinfo, tvb, name);
|
add_new_data_source(lua_pinfo, tvb, name);
|
||||||
|
@ -334,11 +335,12 @@ static int Tvb_new_subset (lua_State *L) {
|
||||||
static int Tvb_tostring(lua_State* L) {
|
static int Tvb_tostring(lua_State* L) {
|
||||||
Tvb tvb = checkTvb(L,1);
|
Tvb tvb = checkTvb(L,1);
|
||||||
int len;
|
int len;
|
||||||
|
gchar* str;
|
||||||
|
|
||||||
if (!tvb) return 0;
|
if (!tvb) return 0;
|
||||||
|
|
||||||
len = tvb_length(tvb);
|
len = tvb_length(tvb);
|
||||||
gchar* str = ep_strdup_printf("TVB(%i) : %s",len,tvb_bytes_to_str(tvb,0,len));
|
str = ep_strdup_printf("TVB(%i) : %s",len,tvb_bytes_to_str(tvb,0,len));
|
||||||
lua_pushstring(L,str);
|
lua_pushstring(L,str);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void proto_register_lua(void);
|
void proto_register_lua(void);
|
||||||
void proto_reg_handoff_lua(void);
|
|
||||||
|
|
||||||
static gboolean initialized = FALSE;
|
static gboolean initialized = FALSE;
|
||||||
|
|
||||||
|
@ -67,8 +66,5 @@ G_MODULE_EXPORT void plugin_reg_handoff(void)
|
||||||
proto_register_lua();
|
proto_register_lua();
|
||||||
initialized = 1;
|
initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
proto_reg_handoff_lua();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue