diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-18 13:02:15 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-18 21:02:40 +0000 |
commit | 050bc7d100e9846663ac2c14eadde15e9cd9fdb9 (patch) | |
tree | 29b58df68f42d396d1507e89df1e9d8631713368 /epan/dissectors | |
parent | 929d41c6856139168c441a14498210d31574de97 (diff) |
Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.
Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.
Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.
Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-bacapp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcm.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-spdy.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-zbee-aps.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-zbee-security.c | 16 |
6 files changed, 20 insertions, 16 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index bc4dd2e479..1058edf70b 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -5093,7 +5093,7 @@ register_bacapp_stat_trees(void) bacapp_stats_tree_instanceid, bacapp_instanceid_stats_tree_init, NULL); } -/* 'data' must be ep_ allocated */ +/* 'data' must be allocated with wmem packet scope */ static gint updateBacnetInfoValue(gint whichval, const gchar *data) { diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 36518c4462..d8a95fa97d 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -873,8 +873,8 @@ static void init_pol_hash(void) /* Initialise hash table */ if (pol_hash) { - /* Everything in the table is se_ allocated so there's no - * need to go through and free it all. + /* Everything in the table is allocated with wmem file + * scope so there's no need to go through and free it all. */ g_hash_table_destroy(pol_hash); } diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index fa57050e7e..3b69ed6759 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -36,6 +36,10 @@ * - Read private tags from configuration and parse in capture * - dissect_dcm_heuristic() to return proper data type * + * September 2013 - Pascal Quantin + * + * - Replace all ep_ and se_ allocation with wmem_ allocations + * * February 2013 - Stefan Allers * * - Support for dissection of Extended Negotiation (Query/Retrieve @@ -6099,7 +6103,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_sequence = FALSE; /* True for Sequence Tags */ gboolean is_item = FALSE; /* True for Sequence Item Tags */ - *tag_description = NULL; /* Reset description. It's ep_ memory, so not really bad*/ + *tag_description = NULL; /* Reset description. It's wmem packet scope memory, so not really bad*/ tag_value = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); @@ -6351,7 +6355,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean local_end_of_seq_or_item = FALSE; gboolean is_first_desc = TRUE; - const gchar *item_description = NULL; /* Will be allocated as ep_ memory in dissect_dcm_tag() */ + const gchar *item_description = NULL; /* Will be allocated as wmem packet scope memory in dissect_dcm_tag() */ if (vl == 0xFFFFFFFF) { /* Undefined length */ diff --git a/epan/dissectors/packet-spdy.c b/epan/dissectors/packet-spdy.c index b9a0277dfa..6a0a63dfe3 100644 --- a/epan/dissectors/packet-spdy.c +++ b/epan/dissectors/packet-spdy.c @@ -948,7 +948,7 @@ body_dissected: * Performs header decompression. * * The returned buffer is automatically scoped to the lifetime of the capture - * (via se_memdup()). + * (via wmem_memdup() with file scope). */ #define DECOMPRESS_BUFSIZE 16384 diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c index b28393ac7f..cabd99771c 100644 --- a/epan/dissectors/packet-zbee-aps.c +++ b/epan/dissectors/packet-zbee-aps.c @@ -1290,6 +1290,10 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree /* Create an empty key ring for this pan. Use g_malloc0() because we must free * GSLists after a capture is closed and wireshark frees seasonal memory * with se_free_all() before calling the registered init routine. + * + * XXX - we don't use seasonal memory any more, and libwireshark + * just does wmem_enter_file_scope() before calling registered init + * routines; does this still apply? */ nwk_keyring = (GSList **)g_malloc0(sizeof(GSList*)); g_hash_table_insert(zbee_table_nwk_keyring, diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c index ea2fd1e3bc..c2312a1b1f 100644 --- a/epan/dissectors/packet-zbee-security.c +++ b/epan/dissectors/packet-zbee-security.c @@ -47,7 +47,7 @@ /* Helper Functions */ #ifdef HAVE_LIBGCRYPT -static guint8 * zbee_sec_key_hash(guint8 *, guint8, guint8 *); +static void zbee_sec_key_hash(guint8 *, guint8, guint8 *); static void zbee_sec_make_nonce (zbee_security_packet *, guint8 *); static gboolean zbee_sec_decrypt_payload(zbee_security_packet *, const gchar *, const gchar, guint8 *, guint, guint, guint8 *); @@ -1213,18 +1213,15 @@ zbee_sec_hash(guint8 *input, guint input_len, guint8 *output) * ipad = 0x36 repeated. * opad = 0x5c repeated. * H() = ZigBee Cryptographic Hash (B.1.3 and B.6). - * - * The output of this function is an ep_alloced buffer containing - * the key-hashed output, and is garaunteed never to return NULL. * PARAMETERS - * guint8 *key - ZigBee Security Key (must be ZBEE_SEC_CONST_KEYSIZE) in length. - * guint8 input - ZigBee CCM* Nonce (must be ZBEE_SEC_CONST_NONCE_LEN) in length. - * packet_info *pinfo - pointer to packet information fields + * guint8 *key - ZigBee Security Key (must be ZBEE_SEC_CONST_KEYSIZE) in length. + * guint8 input - ZigBee CCM* Nonce (must be ZBEE_SEC_CONST_NONCE_LEN) in length. + * guint8 *hash_out - buffer into which the key-hashed output is placed * RETURNS - * guint8* + * void *--------------------------------------------------------------- */ -static guint8 * +static void zbee_sec_key_hash(guint8 *key, guint8 input, guint8 *hash_out) { guint8 hash_in[2*ZBEE_SEC_CONST_BLOCKSIZE]; @@ -1244,7 +1241,6 @@ zbee_sec_key_hash(guint8 *key, guint8 input, guint8 *hash_out) zbee_sec_hash(hash_out, ZBEE_SEC_CONST_BLOCKSIZE+1, hash_in+ZBEE_SEC_CONST_BLOCKSIZE); /* Hash the contents of hash_in to get the final result. */ zbee_sec_hash(hash_in, 2*ZBEE_SEC_CONST_BLOCKSIZE, hash_out); - return hash_out; } /* zbee_sec_key_hash */ #else /* HAVE_LIBGCRYPT */ gboolean |