summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Makefile.nmake2
-rw-r--r--plugins/easy_codec/easy_codec_plugin.c2
-rw-r--r--plugins/ethercat/packet-ecatmb.c16
-rw-r--r--plugins/gryphon/packet-gryphon.c6
-rw-r--r--plugins/irda/packet-ircomm.c16
-rw-r--r--plugins/irda/packet-irda.c138
-rw-r--r--plugins/lwres/Makefile.nmake2
-rw-r--r--plugins/lwres/packet-lwres.c6
-rw-r--r--plugins/stats_tree/Makefile.nmake2
-rw-r--r--plugins/wimax/Makefile.nmake4
-rwxr-xr-xtools/checkAPIs.pl30
11 files changed, 123 insertions, 101 deletions
diff --git a/plugins/Makefile.nmake b/plugins/Makefile.nmake
index ef74c80038..48f19e4d26 100644
--- a/plugins/Makefile.nmake
+++ b/plugins/Makefile.nmake
@@ -8,7 +8,7 @@ include ..\config.nmake
## To add a plugin: Add entry to process-plugins and to install-plugins
-all:
+all: checkapi
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET= process-plugins
clean: clean-local
diff --git a/plugins/easy_codec/easy_codec_plugin.c b/plugins/easy_codec/easy_codec_plugin.c
index 6ef0b76b10..d8ca1aeffc 100644
--- a/plugins/easy_codec/easy_codec_plugin.c
+++ b/plugins/easy_codec/easy_codec_plugin.c
@@ -34,6 +34,7 @@
#include "codec-g7231.h"
#include "codec-g729a.h"
#include "codec-g722.h"
+#include "codec-amr.h"
G_MODULE_EXPORT const gchar version[] = "0.0.1";
@@ -42,6 +43,7 @@ G_MODULE_EXPORT void register_codec_module(void)
register_codec("g723", codec_g7231_init, codec_g7231_release, codec_g7231_decode);
register_codec("g729", codec_g729a_init, codec_g729a_release, codec_g729a_decode);
register_codec("g722", codec_g722_init, codec_g722_release, codec_g722_decode);
+ register_codec("amr", codec_amr_init, codec_amr_release, codec_amr_decode);
}
#endif
diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c
index db5cf1a738..c850ad3e57 100644
--- a/plugins/ethercat/packet-ecatmb.c
+++ b/plugins/ethercat/packet-ecatmb.c
@@ -547,21 +547,21 @@ static void SoeFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax, gu
if ( !soe.anSoeHeaderControlUnion.v.InComplete )
{
SoEIdToString(tmp, soe.anSoeHeaderDataUnion.IDN, sizeof(tmp)-1);
- elm[0] = 0;
+ elm[0] = '\0';
if ( soe.anSoeHeaderControlUnion.v.DataState )
- strncat(elm, "D", 2);
+ g_strlcat(elm, "D", 50);
if ( soe.anSoeHeaderControlUnion.v.Name )
- strncat(elm, "N", 2);
+ g_strlcat(elm, "N", 50);
if ( soe.anSoeHeaderControlUnion.v.Attribute )
- strncat(elm, "A", 2);
+ g_strlcat(elm, "A", 50);
if ( soe.anSoeHeaderControlUnion.v.Unit )
- strncat(elm, "U", 2);
+ g_strlcat(elm, "U", 50);
if ( soe.anSoeHeaderControlUnion.v.Min )
- strncat(elm, "I", 2);
+ g_strlcat(elm, "I", 50);
if ( soe.anSoeHeaderControlUnion.v.Max )
- strncat(elm, "X", 2);
+ g_strlcat(elm, "X", 50);
if ( soe.anSoeHeaderControlUnion.v.Value )
- strncat(elm, "V", 2);
+ g_strlcat(elm, "V", 50);
switch ( soe.anSoeHeaderControlUnion.v.OpCode )
{
case ECAT_SOE_OPCODE_RRQ:
diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c
index b531b0473a..c3b1778023 100644
--- a/plugins/gryphon/packet-gryphon.c
+++ b/plugins/gryphon/packet-gryphon.c
@@ -937,11 +937,11 @@ cmd_setfilt(tvbuff_t *tvb, int offset, proto_tree *pt)
length = tvb_get_guint8(tvb, offset+4) + tvb_get_guint8(tvb, offset+5)
+ tvb_get_ntohs(tvb, offset+6);
if (flag)
- strncpy (mode, "Pass", 10);
+ g_strlcpy (mode, "Pass", 30);
else
- strncpy (mode, "Block", 10);
+ g_strlcpy (mode, "Block", 30);
if (length == 0)
- strncat (mode, " all", 10);
+ g_strlcat (mode, " all", 30);
proto_tree_add_text(pt, tvb, offset, 4, "Pass/Block flag: %s", mode);
proto_tree_add_text(pt, tvb, offset+4, 4, "Length of Pattern & Mask: %d", length);
offset += 8;
diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c
index a35c3d9dcf..900566ed40 100644
--- a/plugins/irda/packet-ircomm.c
+++ b/plugins/irda/packet-ircomm.c
@@ -292,15 +292,15 @@ static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset, packet
pv = tvb_get_guint8(tvb, offset+2);
if (pv & IRCOMM_3_WIRE_RAW)
- strncat(buf, ", 3-Wire raw", 256 - strlen(buf));
+ g_strlcat(buf, ", 3-Wire raw", 256);
if (pv & IRCOMM_3_WIRE)
- strncat(buf, ", 3-Wire", 256 - strlen(buf));
+ g_strlcat(buf, ", 3-Wire", 256);
if (pv & IRCOMM_9_WIRE)
- strncat(buf, ", 9-Wire", 256 - strlen(buf));
+ g_strlcat(buf, ", 9-Wire", 256);
if (pv & IRCOMM_CENTRONICS)
- strncat(buf, ", Centronics", 256 - strlen(buf));
+ g_strlcat(buf, ", Centronics", 256);
- strncat(buf, ")", 256 - strlen(buf));
+ g_strlcat(buf, ")", 256);
proto_item_append_text(ti, buf+2);
@@ -311,11 +311,11 @@ static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset, packet
pv = tvb_get_guint8(tvb, offset+2);
if (pv & IRCOMM_SERIAL)
- strncat(buf, ", serial", 256 - strlen(buf));
+ g_strlcat(buf, ", serial", 256);
if (pv & IRCOMM_PARALLEL)
- strncat(buf, ", parallel", 256 - strlen(buf));
+ g_strlcat(buf, ", parallel", 256);
- strncat(buf, ")", 256 - strlen(buf));
+ g_strlcat(buf, ")", 256);
proto_item_append_text(ti, buf+2);
diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c
index baa1bc100d..7cb1f8eb5b 100644
--- a/plugins/irda/packet-irda.c
+++ b/plugins/irda/packet-irda.c
@@ -1303,25 +1303,25 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Baud Rate (");
if (pv & 0x01)
- strncat(buf, ", 2400", 256 - strlen(buf));
+ g_strlcat(buf, ", 2400", 256);
if (pv & 0x02)
- strncat(buf, ", 9600", 256 - strlen(buf));
+ g_strlcat(buf, ", 9600", 256);
if (pv & 0x04)
- strncat(buf, ", 19200", 256 - strlen(buf));
+ g_strlcat(buf, ", 19200", 256);
if (pv & 0x08)
- strncat(buf, ", 38400", 256 - strlen(buf));
+ g_strlcat(buf, ", 38400", 256);
if (pv & 0x10)
- strncat(buf, ", 57600", 256 - strlen(buf));
+ g_strlcat(buf, ", 57600", 256);
if (pv & 0x20)
- strncat(buf, ", 115200", 256 - strlen(buf));
+ g_strlcat(buf, ", 115200", 256);
if (pv & 0x40)
- strncat(buf, ", 576000", 256 - strlen(buf));
+ g_strlcat(buf, ", 576000", 256);
if (pv & 0x80)
- strncat(buf, ", 1152000", 256 - strlen(buf));
+ g_strlcat(buf, ", 1152000", 256);
if ((p_len > 1) && (tvb_get_guint8(tvb, offset+3) & 0x01))
- strncat(buf, ", 4000000", 256 - strlen(buf));
+ g_strlcat(buf, ", 4000000", 256);
- strncat(buf, " bps)", 256 - strlen(buf));
+ g_strlcat(buf, " bps)", 256);
proto_item_append_text(ti, buf+2);
@@ -1331,15 +1331,15 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Maximum Turn Time (");
if (pv & 0x01)
- strncat(buf, ", 500", 256 - strlen(buf));
+ g_strlcat(buf, ", 500", 256);
if (pv & 0x02)
- strncat(buf, ", 250", 256 - strlen(buf));
+ g_strlcat(buf, ", 250", 256);
if (pv & 0x04)
- strncat(buf, ", 100", 256 - strlen(buf));
+ g_strlcat(buf, ", 100", 256);
if (pv & 0x08)
- strncat(buf, ", 50", 256 - strlen(buf));
+ g_strlcat(buf, ", 50", 256);
- strncat(buf, " ms)", 256 - strlen(buf));
+ g_strlcat(buf, " ms)", 256);
proto_item_append_text(ti, buf+2);
@@ -1349,19 +1349,19 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Data Size (");
if (pv & 0x01)
- strncat(buf, ", 64", 256 - strlen(buf));
+ g_strlcat(buf, ", 64", 256);
if (pv & 0x02)
- strncat(buf, ", 128", 256 - strlen(buf));
+ g_strlcat(buf, ", 128", 256);
if (pv & 0x04)
- strncat(buf, ", 256", 256 - strlen(buf));
+ g_strlcat(buf, ", 256", 256);
if (pv & 0x08)
- strncat(buf, ", 512", 256 - strlen(buf));
+ g_strlcat(buf, ", 512", 256);
if (pv & 0x10)
- strncat(buf, ", 1024", 256 - strlen(buf));
+ g_strlcat(buf, ", 1024", 256);
if (pv & 0x20)
- strncat(buf, ", 2048", 256 - strlen(buf));
+ g_strlcat(buf, ", 2048", 256);
- strncat(buf, " bytes)", 256 - strlen(buf));
+ g_strlcat(buf, " bytes)", 256);
proto_item_append_text(ti, buf+2);
@@ -1371,21 +1371,21 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Window Size (");
if (pv & 0x01)
- strncat(buf, ", 1", 256 - strlen(buf));
+ g_strlcat(buf, ", 1", 256);
if (pv & 0x02)
- strncat(buf, ", 2", 256 - strlen(buf));
+ g_strlcat(buf, ", 2", 256);
if (pv & 0x04)
- strncat(buf, ", 3", 256 - strlen(buf));
+ g_strlcat(buf, ", 3", 256);
if (pv & 0x08)
- strncat(buf, ", 4", 256 - strlen(buf));
+ g_strlcat(buf, ", 4", 256);
if (pv & 0x10)
- strncat(buf, ", 5", 256 - strlen(buf));
+ g_strlcat(buf, ", 5", 256);
if (pv & 0x20)
- strncat(buf, ", 6", 256 - strlen(buf));
+ g_strlcat(buf, ", 6", 256);
if (pv & 0x40)
- strncat(buf, ", 7", 256 - strlen(buf));
+ g_strlcat(buf, ", 7", 256);
- strncat(buf, " frame window)", 256 - strlen(buf));
+ g_strlcat(buf, " frame window)", 256);
proto_item_append_text(ti, buf+2);
@@ -1395,23 +1395,23 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Additional BOFs (");
if (pv & 0x01)
- strncat(buf, ", 48", 256 - strlen(buf));
+ g_strlcat(buf, ", 48", 256);
if (pv & 0x02)
- strncat(buf, ", 24", 256 - strlen(buf));
+ g_strlcat(buf, ", 24", 256);
if (pv & 0x04)
- strncat(buf, ", 12", 256 - strlen(buf));
+ g_strlcat(buf, ", 12", 256);
if (pv & 0x08)
- strncat(buf, ", 5", 256 - strlen(buf));
+ g_strlcat(buf, ", 5", 256);
if (pv & 0x10)
- strncat(buf, ", 3", 256 - strlen(buf));
+ g_strlcat(buf, ", 3", 256);
if (pv & 0x20)
- strncat(buf, ", 2", 256 - strlen(buf));
+ g_strlcat(buf, ", 2", 256);
if (pv & 0x40)
- strncat(buf, ", 1", 256 - strlen(buf));
+ g_strlcat(buf, ", 1", 256);
if (pv & 0x80)
- strncat(buf, ", 0", 256 - strlen(buf));
+ g_strlcat(buf, ", 0", 256);
- strncat(buf, " additional BOFs at 115200)", 256 - strlen(buf));
+ g_strlcat(buf, " additional BOFs at 115200)", 256);
proto_item_append_text(ti, buf+2);
@@ -1421,23 +1421,23 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Minimum Turn Time (");
if (pv & 0x01)
- strncat(buf, ", 10", 256 - strlen(buf));
+ g_strlcat(buf, ", 10", 256);
if (pv & 0x02)
- strncat(buf, ", 5", 256 - strlen(buf));
+ g_strlcat(buf, ", 5", 256);
if (pv & 0x04)
- strncat(buf, ", 1", 256 - strlen(buf));
+ g_strlcat(buf, ", 1", 256);
if (pv & 0x08)
- strncat(buf, ", 0.5", 256 - strlen(buf));
+ g_strlcat(buf, ", 0.5", 256);
if (pv & 0x10)
- strncat(buf, ", 0.1", 256 - strlen(buf));
+ g_strlcat(buf, ", 0.1", 256);
if (pv & 0x20)
- strncat(buf, ", 0.05", 256 - strlen(buf));
+ g_strlcat(buf, ", 0.05", 256);
if (pv & 0x40)
- strncat(buf, ", 0.01", 256 - strlen(buf));
+ g_strlcat(buf, ", 0.01", 256);
if (pv & 0x80)
- strncat(buf, ", 0", 256 - strlen(buf));
+ g_strlcat(buf, ", 0", 256);
- strncat(buf, " ms)", 256 - strlen(buf));
+ g_strlcat(buf, " ms)", 256);
proto_item_append_text(ti, buf+2);
@@ -1447,23 +1447,23 @@ static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned of
proto_item_append_text(ti, ": Link Disconnect/Threshold Time (");
if (pv & 0x01)
- strncat(buf, ", 3/0", 256 - strlen(buf));
+ g_strlcat(buf, ", 3/0", 256);
if (pv & 0x02)
- strncat(buf, ", 8/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 8/3", 256);
if (pv & 0x04)
- strncat(buf, ", 12/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 12/3", 256);
if (pv & 0x08)
- strncat(buf, ", 16/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 16/3", 256);
if (pv & 0x10)
- strncat(buf, ", 20/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 20/3", 256);
if (pv & 0x20)
- strncat(buf, ", 25/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 25/3", 256);
if (pv & 0x40)
- strncat(buf, ", 30/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 30/3", 256);
if (pv & 0x80)
- strncat(buf, ", 40/3", 256 - strlen(buf));
+ g_strlcat(buf, ", 40/3", 256);
- strncat(buf, " s)", 256 - strlen(buf));
+ g_strlcat(buf, " s)", 256);
proto_item_append_text(ti, buf+2);
@@ -1592,29 +1592,29 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro
service_hints[0] = 0;
if (hint1 & 0x01)
- strncat(service_hints, ", PnP Compatible", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", PnP Compatible", 256);
if (hint1 & 0x02)
- strncat(service_hints, ", PDA/Palmtop", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", PDA/Palmtop", 256);
if (hint1 & 0x04)
- strncat(service_hints, ", Computer", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", Computer", 256);
if (hint1 & 0x08)
- strncat(service_hints, ", Printer", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", Printer", 256);
if (hint1 & 0x10)
- strncat(service_hints, ", Modem", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", Modem", 256);
if (hint1 & 0x20)
- strncat(service_hints, ", Fax", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", Fax", 256);
if (hint1 & 0x40)
- strncat(service_hints, ", LAN Access", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", LAN Access", 256);
if (hint2 & 0x01)
- strncat(service_hints, ", Telephony", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", Telephony", 256);
if (hint2 & 0x02)
- strncat(service_hints, ", File Server", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", File Server", 256);
if (hint2 & 0x04)
- strncat(service_hints, ", IrCOMM", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", IrCOMM", 256);
if (hint2 & 0x20)
- strncat(service_hints, ", OBEX", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ", OBEX", 256);
- strncat(service_hints, ")", 256 - strlen(service_hints));
+ g_strlcat(service_hints, ")", 256);
service_hints[0] = ' ';
service_hints[1] = '(';
diff --git a/plugins/lwres/Makefile.nmake b/plugins/lwres/Makefile.nmake
index 38320642e4..151b3c060a 100644
--- a/plugins/lwres/Makefile.nmake
+++ b/plugins/lwres/Makefile.nmake
@@ -100,4 +100,4 @@ distclean: clean
maintainer-clean: distclean
checkapi:
-# $(PERL) ../../tools/checkAPIs.pl $(DISSECTOR_SRC)
+ $(PERL) ../../tools/checkAPIs.pl $(DISSECTOR_SRC)
diff --git a/plugins/lwres/packet-lwres.c b/plugins/lwres/packet-lwres.c
index 0c6d57aad7..42967ba256 100644
--- a/plugins/lwres/packet-lwres.c
+++ b/plugins/lwres/packet-lwres.c
@@ -315,7 +315,7 @@ lwres_get_dns_name(tvbuff_t *tvb, int offset, int dns_data_offset,
break;
default:
- strncpy(name, "<Unknown extended label>", maxname);
+ g_strlcpy(name, "<Unknown extended label>", maxname);
/* Parsing will propably fail from here on, since the */
/* label length is unknown... */
len = offset - start_offset;
@@ -345,7 +345,7 @@ lwres_get_dns_name(tvbuff_t *tvb, int offset, int dns_data_offset,
will make us look at some character again, which means we're
looping. */
if (chars_processed >= data_size) {
- strncpy(name, "<Name contains a pointer that loops>", maxname);
+ g_strlcpy(name, "<Name contains a pointer that loops>", maxname);
if (len < min_len)
THROW(ReportedBoundsError);
return len;
@@ -363,7 +363,7 @@ lwres_get_dns_name(tvbuff_t *tvb, int offset, int dns_data_offset,
len = offset - start_offset;
/* Zero-length name means "root server" */
if (*name == '\0')
- strncpy(name, "<Root>", maxname);
+ g_strlcpy(name, "<Root>", maxname);
if (len < min_len)
THROW(ReportedBoundsError);
return len;
diff --git a/plugins/stats_tree/Makefile.nmake b/plugins/stats_tree/Makefile.nmake
index f8908dc204..b26ad07d76 100644
--- a/plugins/stats_tree/Makefile.nmake
+++ b/plugins/stats_tree/Makefile.nmake
@@ -54,4 +54,4 @@ distclean: clean
maintainer-clean: distclean
checkapi:
- $(PERL) ../../tools/checkAPIs.pl $(DISSECTOR_SRC)
+ $(PERL) ../../tools/checkAPIs.pl $(TAP_SRC)
diff --git a/plugins/wimax/Makefile.nmake b/plugins/wimax/Makefile.nmake
index 151b3c060a..4c2f20f0dc 100644
--- a/plugins/wimax/Makefile.nmake
+++ b/plugins/wimax/Makefile.nmake
@@ -100,4 +100,6 @@ distclean: clean
maintainer-clean: distclean
checkapi:
- $(PERL) ../../tools/checkAPIs.pl $(DISSECTOR_SRC)
+ $(PERL) ../../tools/checkAPIs.pl \
+ $(DISSECTOR_SRC) \
+ $(DISSECTOR_SUPPORT_SRC)
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 8b17aef693..51248d6189 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -70,12 +70,6 @@ my @prohibitedAPIs=
'g_strdown',
'g_string_up',
'g_string_down',
- # Depreciated glib functions
- 'g_string_sprintf',
- # use g_string_printf().
- 'g_string_sprintfa',
- # use g_string_append_print
- 'g_tree_traverse',
# Use the eth_* version of these:
# (Necessary because on Windows we use UTF8 for throughout the code
# so we must tweak that to UTF16 before operating on the file. Code
@@ -94,6 +88,30 @@ my @prohibitedAPIs=
# APIs that SHOULD NOT be used in Wireshark (any more)
my @deprecatedAPIs=
(
+ # Depreciated glib functions
+ 'g_string_sprintf',
+ # use g_string_printf().
+ 'g_string_sprintfa',
+ # use g_string_append_printf
+ 'g_tree_traverse',
+ 'g_basename',
+ 'g_dirname',
+ 'g_hash_table_freeze',
+ 'g_hash_table_thaw',
+ 'G_HAVE_GINT64',
+ 'g_io_channel_close',
+ 'g_io_channel_read',
+ 'g_io_channel_seek',
+ 'g_io_channel_write',
+ 'g_main_new',
+ 'g_main_destroy',
+ 'g_main_run',
+ 'g_main_set_poll_func',
+ 'g_scanner_add_symbol',
+ 'g_scanner_remove_symbol',
+ 'g_scanner_foreach_symbol',
+ 'g_scanner_freeze_symbol_table',
+ 'g_scanner_thaw_symbol_table',
# Wireshark should not write to stdout (?)
# (Of course tshark should!)
'printf',