aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/snmp
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-06-18 18:09:58 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2014-06-18 16:15:42 +0000
commite308e7c4de81c2ff7159e444b865ac59de4faa2b (patch)
treee24dcf58137a30395cc0ce87f1e84e2b32d6a34b /asn1/snmp
parentb5a462b087bdd7670e1a69786ebbe3f073084ac3 (diff)
Update ASN.1 source files with the API changes done in g021e7af
Change-Id: I52ecfccbce423206242e3cf99401a8c9e1655d88 Reviewed-on: https://code.wireshark.org/review/2385 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'asn1/snmp')
-rw-r--r--asn1/snmp/packet-snmp-template.c24
-rw-r--r--asn1/snmp/snmp.cnf4
2 files changed, 14 insertions, 14 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 7e2bfb9e5e..49ef8202c4 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -357,7 +357,7 @@ dissect_snmp_variable_string(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree_add_item(tree, hf_snmp_var_bind_str, tvb, 0, -1, ENC_ASCII|ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1512,8 +1512,8 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
if (! ( user_tvb && engine_tvb ) ) return NULL;
- given_username_len = tvb_length(user_tvb);
- given_engine_len = tvb_length(engine_tvb);
+ given_username_len = tvb_captured_length(user_tvb);
+ given_engine_len = tvb_captured_length(engine_tvb);
if (! ( given_engine_len && given_username_len ) ) return NULL;
given_username = (guint8*)tvb_memdup(wmem_packet_scope(),user_tvb,0,-1);
given_engine = (guint8*)tvb_memdup(wmem_packet_scope(),engine_tvb,0,-1);
@@ -1563,14 +1563,14 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length_remaining(p->auth_tvb,0);
if (auth_len != 12) {
*error = "Authenticator length wrong";
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length_remaining(p->msg_tvb,0);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1627,7 +1627,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length_remaining(p->auth_tvb,0);
if (auth_len != 12) {
@@ -1635,7 +1635,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length_remaining(p->msg_tvb,0);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1681,7 +1681,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
guint i;
- salt_len = tvb_length_remaining(p->priv_tvb,0);
+ salt_len = tvb_captured_length_remaining(p->priv_tvb,0);
if (salt_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1697,7 +1697,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
iv[i] = pre_iv[i] ^ salt[i];
}
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length_remaining(encryptedData,0);
if ((cryptgrm_len <= 0) || (cryptgrm_len % 8)) {
*error = "decryptionError: the length of the encrypted data is not a mutiple of 8 octets";
@@ -1754,7 +1754,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
guint8* cryptgrm;
tvbuff_t* clear_tvb;
- priv_len = tvb_length_remaining(p->priv_tvb,0);
+ priv_len = tvb_captured_length_remaining(p->priv_tvb,0);
if (priv_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1771,7 +1771,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
iv[7] = (p->time & 0x000000ff);
tvb_memcpy(p->priv_tvb,&(iv[8]),0,8);
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length_remaining(encryptedData,0);
if (cryptgrm_len <= 0) {
*error = "Not enough data remaining";
return NULL;
@@ -1925,7 +1925,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
* have that routine deal with ASN.1, and just use
* "tcp_dissect_pdus()"?)
*/
- length_remaining = tvb_ensure_length_remaining(tvb, offset);
+ length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
/* NOTE: we have to parse the message piece by piece, since the
* capture length may be less than the message length: a 'global'
diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf
index f30b6c1464..95586e857b 100644
--- a/asn1/snmp/snmp.cnf
+++ b/asn1/snmp/snmp.cnf
@@ -90,7 +90,7 @@ gint pdu_type=-1;
&usm_p.engine_tvb);
if (usm_p.engine_tvb) {
proto_tree* engine_tree = proto_item_add_subtree(%(ACTX)s->created_item,ett_engineid);
- dissect_snmp_engineid(engine_tree, usm_p.engine_tvb, 0, tvb_length_remaining(usm_p.engine_tvb,0));
+ dissect_snmp_engineid(engine_tree, usm_p.engine_tvb, 0, tvb_captured_length_remaining(usm_p.engine_tvb,0));
}
#.FN_BODY SnmpEngineID
@@ -100,7 +100,7 @@ gint pdu_type=-1;
&param_tvb);
if (param_tvb) {
proto_tree* engine_tree = proto_item_add_subtree(%(ACTX)s->created_item,ett_engineid);
- dissect_snmp_engineid(engine_tree, param_tvb, 0, tvb_length_remaining(param_tvb,0));
+ dissect_snmp_engineid(engine_tree, param_tvb, 0, tvb_captured_length_remaining(param_tvb,0));
}
#.FN_PARS UsmSecurityParameters/msgUserName