diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-01-01 21:34:16 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-01-03 13:18:17 +0000 |
commit | d7c3edd39c8f90c5d5878db1fdf758867957d3cb (patch) | |
tree | 4c46263f1efda01af5529df3b33dd35df70d4a79 /epan/wslua | |
parent | 61c6fb828123a2dd6c77687cba52cf59b1f956bb (diff) |
Lua: replace deprecated functions
Remove deprecated functions from Lua API code: tvb_length and
tvb_length_remaining. The calls to proto_tree_add_text() are
left in, as I have no idea what to replace them with. The calls
to ep_* are being left in, as they're removed by change-id
I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55.
Bug: 10822
Change-Id: Ib0686f90be1edc892d3ecf401b91eb7484540b3e
Reviewed-on: https://code.wireshark.org/review/6247
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/init_wslua.c | 2 | ||||
-rw-r--r-- | epan/wslua/wslua_internals.c | 2 | ||||
-rw-r--r-- | epan/wslua/wslua_struct.c | 1 | ||||
-rw-r--r-- | epan/wslua/wslua_tvb.c | 22 |
4 files changed, 12 insertions, 15 deletions
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index bee9fb6d3d..3b6d29479f 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -144,7 +144,7 @@ static int wslua_not_register_menu(lua_State* LS) { } int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { - int consumed_bytes = tvb_length(tvb); + int consumed_bytes = tvb_captured_length(tvb); lua_pinfo = pinfo; lua_tvb = tvb; diff --git a/epan/wslua/wslua_internals.c b/epan/wslua/wslua_internals.c index 1ef53352bf..e27f5cba6b 100644 --- a/epan/wslua/wslua_internals.c +++ b/epan/wslua/wslua_internals.c @@ -7,8 +7,6 @@ * * (c) 2013, Hadriel Kaplan <hadrielk@yahoo.com> * - * $Id: wslua_internals.c 47885 2013-02-25 22:05:28Z hadrielk $ - * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs diff --git a/epan/wslua/wslua_struct.c b/epan/wslua/wslua_struct.c index a05d69760d..ea9e36d2c5 100644 --- a/epan/wslua/wslua_struct.c +++ b/epan/wslua/wslua_struct.c @@ -23,7 +23,6 @@ /* ** {====================================================== ** Library for packing/unpacking structures. -** $Id: struct.c,v 1.4 2012/07/04 18:54:29 roberto Exp $ ** See Copyright Notice above. ** ** Small changes were made by Hadriel Kaplan - those changes diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c index 7c02a8cfd2..8d0a359050 100644 --- a/epan/wslua/wslua_tvb.c +++ b/epan/wslua/wslua_tvb.c @@ -504,7 +504,7 @@ WSLUA_METAMETHOD Tvb__tostring(lua_State* L) { int len; gchar* str; - len = tvb_length(tvb->ws_tvb); + len = tvb_captured_length(tvb->ws_tvb); str = wmem_strdup_printf(NULL, "TVB(%i) : %s",len,tvb_bytes_to_ep_str(tvb->ws_tvb,0,len)); lua_pushstring(L,str); wmem_free(NULL, str); @@ -533,7 +533,7 @@ WSLUA_METHOD Tvb_len(lua_State* L) { /* Obtain the actual (captured) length of a `Tvb`. */ Tvb tvb = checkTvb(L,1); - lua_pushnumber(L,tvb_length(tvb->ws_tvb)); + lua_pushnumber(L,tvb_captured_length(tvb->ws_tvb)); WSLUA_RETURN(1); /* The captured length of the `Tvb`. */ } @@ -581,12 +581,12 @@ gboolean push_TvbRange(lua_State* L, tvbuff_t* ws_tvb, int offset, int len) { } if (len == -1) { - len = tvb_length_remaining(ws_tvb,offset); + len = tvb_captured_length_remaining(ws_tvb,offset); if (len < 0) { luaL_error(L,"out of bounds"); return FALSE; } - } else if ( (guint)(len + offset) > tvb_length(ws_tvb)) { + } else if ( (guint)(len + offset) > tvb_captured_length(ws_tvb)) { luaL_error(L,"Range is out of bounds"); return FALSE; } @@ -635,18 +635,18 @@ WSLUA_METHOD Tvb_raw(lua_State* L) { return 0; } - if ((guint)offset > tvb_length(tvb->ws_tvb)) { + if ((guint)offset > tvb_captured_length(tvb->ws_tvb)) { WSLUA_OPTARG_ERROR(Tvb_raw,OFFSET,"offset beyond end of Tvb"); return 0; } if (len == -1) { - len = tvb_length_remaining(tvb->ws_tvb,offset); + len = tvb_captured_length_remaining(tvb->ws_tvb,offset); if (len < 0) { luaL_error(L,"out of bounds"); return FALSE; } - } else if ( (guint)(len + offset) > tvb_length(tvb->ws_tvb)) { + } else if ( (guint)(len + offset) > tvb_captured_length(tvb->ws_tvb)) { luaL_error(L,"Range is out of bounds"); return FALSE; } @@ -1470,7 +1470,7 @@ static int TvbRange_uncompress(lua_State* L) { uncompr_tvb = tvb_child_uncompress(tvbr->tvb->ws_tvb, tvbr->tvb->ws_tvb, tvbr->offset, tvbr->len); if (uncompr_tvb) { add_new_data_source (lua_pinfo, uncompr_tvb, name); - if (push_TvbRange(L,uncompr_tvb,0,tvb_length(uncompr_tvb))) { + if (push_TvbRange(L,uncompr_tvb,0,tvb_captured_length(uncompr_tvb))) { WSLUA_RETURN(1); /* The TvbRange */ } } @@ -1531,18 +1531,18 @@ WSLUA_METHOD TvbRange_raw(lua_State* L) { return 0; } - if ((guint)offset > tvb_length(tvbr->tvb->ws_tvb)) { + if ((guint)offset > tvb_captured_length(tvbr->tvb->ws_tvb)) { WSLUA_OPTARG_ERROR(Tvb_raw,OFFSET,"offset beyond end of Tvb"); return 0; } if (len == -1) { - len = tvb_length_remaining(tvbr->tvb->ws_tvb,offset); + len = tvb_captured_length_remaining(tvbr->tvb->ws_tvb,offset); if (len < 0) { luaL_error(L,"out of bounds"); return FALSE; } - } else if ( (guint)(len + offset) > tvb_length(tvbr->tvb->ws_tvb)) { + } else if ( (guint)(len + offset) > tvb_captured_length(tvbr->tvb->ws_tvb)) { luaL_error(L,"Range is out of bounds"); return FALSE; } |