summaryrefslogtreecommitdiff
path: root/epan/wslua/wslua_tvb.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-01-01 21:34:16 -0500
committerAnders Broman <a.broman58@gmail.com>2015-01-03 13:18:17 +0000
commitd7c3edd39c8f90c5d5878db1fdf758867957d3cb (patch)
tree4c46263f1efda01af5529df3b33dd35df70d4a79 /epan/wslua/wslua_tvb.c
parent61c6fb828123a2dd6c77687cba52cf59b1f956bb (diff)
downloadwireshark-d7c3edd39c8f90c5d5878db1fdf758867957d3cb.tar.gz
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/wslua_tvb.c')
-rw-r--r--epan/wslua/wslua_tvb.c22
1 files changed, 11 insertions, 11 deletions
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;
}