Commit Graph

15 Commits

Author SHA1 Message Date
Gerald Combs 4ec08045aa wslua: Fix wsluarm defines. 2023-01-09 03:17:30 +00:00
Developer Alexander 3107af85a7 lua: ByteArray integer parsing APIs
Adds APIs for parsing different kinds of integer from a lua ByteArray:

-16, 32 and 64 bit

-singed or unsigned

-encoded little endian or big endian
2023-01-04 07:47:13 +00:00
Gerald Combs b9ee6f4563 wslua: Fix more argument definitions. 2022-07-21 17:38:22 -07:00
Gerald Combs 56a9666a3a wslua: Fix our argument definitions.
Make sure our argument definitions match their corresponding function
names.
2022-07-19 18:53:11 +00:00
Dario Lombardo ea929d6401 wsutils: add local implementation of g_memdup2.
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68,
we provide our own copy of g_memdup2() for older GLib versions.
2021-03-25 09:38:10 +00:00
David Perry c03011b906 Lua: base64_decode: handle unpadded data
As noted in bug #16386, glib's `g_base64_decode_inplace()` aborts
decoding of base64 strings that aren't padded. This addresses that by
adding padding "=" characters if needed to the buffer which will be
decoded.

I added the test case from the bug report to the test suite, though the
location therein may not be ideal.

Closes #16386
2020-10-19 08:38:31 +00:00
Gerald Combs da04d89f1e wslua: Update the ByteArray and Tvb docs.
Add content from https://wiki.wireshark.org/LuaAPI/ByteArray and
https://wiki.wireshark.org/LuaAPI/Tvb. Update as needed.

Remove an extraneous trailing semicolon.

Change-Id: I857b748821c21413ecb563c150525575fc9b947a
Reviewed-on: https://code.wireshark.org/review/36635
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-31 04:13:01 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Stig Bjørlykke 0b80a42187 epan: Guard g_base64_decode_inplace() against zero length string
The g_base64_decode_inplace() does not handle zero length string
so add a guard for this before calling.

Bug: 15113
Change-Id: I89fa17dd62af238f4282835c317e5c8be6e0c8a1
Reviewed-on: https://code.wireshark.org/review/29428
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-05 17:19:42 +00:00
Stig Bjørlykke 65b342f749 epan: Use g_base64_decode_inplace()
Replace ws_base64_decode_inplace() with g_base64_decode_inplace()
or g_base64_decode(), which was introduced in glib 2.12.

The only observed difference is a need for zero-terminate the buffer
after decoding.

Change-Id: Ia102d0d8e9bec575ffeddf448191a3f6de9fb1ed
Reviewed-on: https://code.wireshark.org/review/29382
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-03 04:05:13 +00:00
Dario Lombardo ff6e2fbb1b wslua: use SPDX identifiers.
Change-Id: I80d9d4e3ffc25eebf09e6ef693c378b77554e1b8
Reviewed-on: https://code.wireshark.org/review/25693
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-09 12:31:21 +00:00
Peter Wu 8a1adf1a66 wslua: fix errors in documentation, add notational conventions
Improve example with better formatting, clarification comments and more
common variable names.

Extend make-wsluarm.pl to support arguments containing underscores.
Fixes the description of dissect_tcp_pdus.

Change TvbRange.tvb(tvb) into tvbrange:tvb() and ByteArray.tvb(name)
into bytearray:tvb(name), these are really instance methods.

Change-Id: I1e20ef46195dc6c06f9ac790d3432db283d21a5e
Reviewed-on: https://code.wireshark.org/review/18226
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-18 04:09:14 +00:00
Peter Wu f6e223c895 wslua: Drop unused "push_code" macro parameter
Reduce noise, no caller has used this parameter since its introduction.
Msotly automated regex search and replace.

Change-Id: I4b1180bfee8544b38d19c9c440ff5b9b0dc080b2
Reviewed-on: https://code.wireshark.org/review/14790
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-14 18:32:51 +00:00
Peter Wu 884795e60f wslua: do not free TVB for data sources
Bug: 12050
Change-Id: If094f78f683776ba2ea3ddd848ec9018cba064b8
Reviewed-on: https://code.wireshark.org/review/13554
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-27 09:25:39 +00:00
Hadriel Kaplan 0caf0616ba Lua: split up wslua files into class-based files
The size of some of the wslua source files has grown large, and it's hard
to quickly find things. So split them up based on class name, as much as
seems reasonable. Also have the make-wsluarm.pl Perl script handle this.

Change-Id: Ib495ec5c2a4df90495c0a05504856288a0b09213
Reviewed-on: https://code.wireshark.org/review/9579
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-12 02:08:24 +00:00