aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/c1222
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-02-17 22:15:16 +0000
committerMichael Mann <mmann78@netscape.net>2013-02-17 22:15:16 +0000
commitfd44f9a33940527be92a2c9c7d53f2c6da00270d (patch)
tree49d927a32339d0be07989e0e0b3b965f1c2e6c8f /asn1/c1222
parent73ef143f95ee3d313bf467e1a0a953429831594b (diff)
Remove C++ incompatibilities in c1222 dissector.
Also addresses an implicit cast in the epan/uat.h file Bug 8342 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8342) svn path=/trunk/; revision=47721
Diffstat (limited to 'asn1/c1222')
-rw-r--r--asn1/c1222/c1222.cnf6
-rw-r--r--asn1/c1222/packet-c1222-template.c20
2 files changed, 9 insertions, 17 deletions
diff --git a/asn1/c1222/c1222.cnf b/asn1/c1222/c1222.cnf
index 2808a527ce..34721343f4 100644
--- a/asn1/c1222/c1222.cnf
+++ b/asn1/c1222/c1222.cnf
@@ -23,7 +23,7 @@ Calling-authentication-value-c1222/_untag/iv-element BLURB="c1222.iv-element"
Calling-authentication-value-c1222/_untag/key-id-element BLURB = "c1222.key-id-element"
#.FN_BODY User-information
- gint8 class;
+ gint8 end_device_class;
gboolean pc, ind;
gint32 tag;
guint32 len;
@@ -32,11 +32,11 @@ Calling-authentication-value-c1222/_untag/key-id-element BLURB = "c1222.key-id-e
FILL_START;
/* get Tag and Length */
- offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
+ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &end_device_class, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
FILL_TABLE_TRUNCATE(user_information, len+offset-start_offset);
if (tag == 0x8) { /* BER_TAG_EXTERNAL */
- offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
+ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &end_device_class, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
if (tag == 0x1) { /* implicit octet string */
tf = proto_tree_add_item(tree, hf_c1222_user_information, tvb, offset, len, ENC_NA);
diff --git a/asn1/c1222/packet-c1222-template.c b/asn1/c1222/packet-c1222-template.c
index 893ffdbb66..1733e02bbc 100644
--- a/asn1/c1222/packet-c1222-template.c
+++ b/asn1/c1222/packet-c1222-template.c
@@ -27,7 +27,6 @@
#include <glib.h>
#include <epan/conversation.h>
-#include <wsutil/crc16.h>
#include <epan/expert.h>
#include <epan/packet.h>
#include <epan/prefs.h>
@@ -115,7 +114,6 @@ static int hf_c1222_epsem_total = -1;
static int hf_c1222_cmd = -1;
static int hf_c1222_err = -1;
static int hf_c1222_data = -1;
-static int hf_c1222_crc = -1;
/* individual epsem fields */
static int hf_c1222_logon_id = -1;
static int hf_c1222_logon_user = -1;
@@ -286,11 +284,11 @@ static uat_t *c1222_uat;
#define FILL_START int length, start_offset = offset;
#define FILL_TABLE(fieldname) \
length = offset - start_offset; \
- fieldname = tvb_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(tvb, start_offset, length); \
fieldname##_len = length;
#define FILL_TABLE_TRUNCATE(fieldname, len) \
length = 1 + 2*(offset - start_offset); \
- fieldname = tvb_memdup(tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(tvb, start_offset, length); \
fieldname##_len = len;
#else /* HAVE_LIBGCRYPT */
#define FILL_TABLE(fieldname)
@@ -669,7 +667,7 @@ encode_ber_len(guint8 *ptr, guint32 n, int maxsize)
static void
c1222_uat_data_update_cb(void* n, const char** err)
{
- c1222_uat_data_t* new_rec = n;
+ c1222_uat_data_t* new_rec = (c1222_uat_data_t *)n;
if (new_rec->keynum > 0xff) {
*err = "Invalid key number; must be less than 256";
@@ -889,7 +887,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
return offset;
encrypted = TRUE;
if (c1222_decrypt) {
- buffer = tvb_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(tvb, offset, len2);
if (!decrypt_packet(buffer, len2, TRUE)) {
g_free(buffer);
crypto_bad = TRUE;
@@ -908,7 +906,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
len2 = tvb_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
- buffer = tvb_memdup(tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(tvb, offset, len2);
epsem_buffer = tvb_new_subset(tvb, offset, -1, -1);
if (c1222_decrypt) {
if (!decrypt_packet(buffer, len2, FALSE)) {
@@ -1249,12 +1247,6 @@ void proto_register_c1222(void) {
NULL, 0x0,
NULL, HFILL }
},
- { &hf_c1222_crc,
- { "C12.22 CRC", "c1222.crc",
- FT_UINT16, BASE_HEX,
- NULL, 0x0,
- NULL, HFILL }
- },
{ &hf_c1222_epsem_crypto_good,
{ "Crypto good", "c1222.crypto_good",
FT_BOOLEAN, BASE_NONE,
@@ -1310,7 +1302,7 @@ void proto_register_c1222(void) {
sizeof(c1222_uat_data_t), /* record size */
"c1222_decryption_table", /* filename */
TRUE, /* from_profile */
- (void*)&c1222_uat_data, /* data_ptr */
+ (void**)&c1222_uat_data, /* data_ptr */
&num_c1222_uat_data, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */