diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-05-14 19:28:07 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-05-14 19:28:07 +0000 |
commit | 4ec2c4ff47ac90fcb232d6fdd99b5e09b0d5da1e (patch) | |
tree | 369cabcf0a2d69aa832b80c867d33e038c53e36f /epan/dissectors | |
parent | 5f538e901da1c56b5392e8f7f99f4709f28c11f4 (diff) |
Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization
svn path=/trunk/; revision=28363
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-ipsec.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-isakmp.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-iscsi.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-jxta.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 24 |
5 files changed, 12 insertions, 26 deletions
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 3a186c9c58..44246eb9c8 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -2378,9 +2378,8 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(decrypt_ok) { - tvb_decrypted = tvb_new_real_data(g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len,(decrypted_len - esp_iv_len)*sizeof(guint8)), decrypted_len - esp_iv_len, decrypted_len - esp_iv_len); + tvb_decrypted = tvb_new_child_real_data(tvb, g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len,(decrypted_len - esp_iv_len)*sizeof(guint8)), decrypted_len - esp_iv_len, decrypted_len - esp_iv_len); g_free(decrypted_data); - tvb_set_child_real_data_tvbuff(tvb, tvb_decrypted); add_new_data_source(pinfo, tvb_decrypted, diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 1904b4267e..fe4b6d0223 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -631,9 +631,7 @@ decrypt_payload(tvbuff_t *tvb, packet_info *pinfo, const guint8 *buf, guint buf_ } gcry_cipher_close(decr_ctx); - encr_tvb = tvb_new_real_data(decrypted_data, buf_len, buf_len); - - tvb_set_child_real_data_tvbuff(tvb, encr_tvb); + encr_tvb = tvb_new_child_real_data(tvb, decrypted_data, buf_len, buf_len); /* Add the decrypted data to the data source list. */ add_new_data_source(pinfo, encr_tvb, "Decrypted IKE"); diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 8be9b19085..300e727b08 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -1496,12 +1496,10 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off /* the remainder of the cdb from the ahs */ tvb_memcpy(tvb, cdb_buf+16, ahs_cdb_offset, ahs_cdb_length); - cdb_tvb = tvb_new_real_data(cdb_buf, + cdb_tvb = tvb_new_child_real_data(tvb, cdb_buf, ahs_cdb_length+16, ahs_cdb_length+16); - tvb_set_child_real_data_tvbuff(tvb, cdb_tvb); - add_new_data_source(pinfo, cdb_tvb, "CDB+AHS"); } else { if(tvb_len>16){ diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index ab41386ef7..8fcf0cf35d 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -2267,10 +2267,9 @@ static int dissect_media( const gchar* fullmediatype, tvbuff_t * tvb, packet_inf dissected = call_dissector(ssl_handle, tvb, pinfo, tree); } } else if (0 == strcmp("application/gzip", mediatype)) { - tvbuff_t *uncomp_tvb = tvb_uncompress(tvb, 0, tvb_length(tvb)); + tvbuff_t *uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_length(tvb)); if( NULL != uncomp_tvb ) { - tvb_set_child_real_data_tvbuff(tvb, uncomp_tvb); add_new_data_source(pinfo, uncomp_tvb, "Uncompressed Element Content"); /* XXX bondolo 20060201 Force XML for uncompressed data. */ diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index bb6f5d95ce..766637a6d7 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -2110,11 +2110,10 @@ dissect_krb5_decrypt_PA_ENC_TIMESTAMP (proto_tree *tree, tvbuff_t *tvb, int offs if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -3496,11 +3495,10 @@ dissect_krb5_decrypt_PRIV (proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -3650,11 +3648,10 @@ dissect_krb5_decrypt_EncKrbCredPart (proto_tree *tree, tvbuff_t *tvb, int offset if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "EncKrbCredPart"); @@ -3809,11 +3806,10 @@ dissect_krb5_decrypt_enc_authorization_data(proto_tree *tree, tvbuff_t *tvb, int if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -4003,11 +3999,10 @@ dissect_krb5_decrypt_authenticator_data (proto_tree *tree, tvbuff_t *tvb, int of if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -4081,11 +4076,10 @@ dissect_krb5_decrypt_Ticket_data (proto_tree *tree, tvbuff_t *tvb, int offset, a */ if( (plaintext=decrypt_krb5_data(tree, actx->pinfo, 2, length, tvb_get_ptr(tvb, offset, length), Ticket_etype, NULL)) ){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -4216,11 +4210,10 @@ dissect_krb5_decrypt_AP_REP_data(proto_tree *tree, tvbuff_t *tvb, int offset, as if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); @@ -4330,11 +4323,10 @@ dissect_krb5_decrypt_KDC_REP_data (proto_tree *tree, tvbuff_t *tvb, int offset, if(plaintext){ tvbuff_t *next_tvb; - next_tvb = tvb_new_real_data (plaintext, + next_tvb = tvb_new_child_real_data(tvb, plaintext, length, length); tvb_set_free_cb(next_tvb, g_free); - tvb_set_child_real_data_tvbuff(tvb, next_tvb); /* Add the decrypted data to the data source list. */ add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5"); |