diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-06-20 07:18:10 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-06-20 07:18:10 +0000 |
commit | 5f334f7f7b452c3a9896334e7fdfbe601ef0dae7 (patch) | |
tree | 8fc45176a3f19e3d1be9b0bb4375d5ea7ab3f777 | |
parent | b958accede1a3aefa0d43dae2b6c52ce98f84bf6 (diff) |
move two functions that are not used by tcap and only used by gsm_a and gsm_ss into gsm_ss.
remove the include <epan.asn1.h> from tcap since it no longer needs that file.
only 9 dissectors remain that use asn1.h
svn path=/trunk/; revision=14710
-rw-r--r-- | asn1/tcap/packet-tcap-template.c | 60 | ||||
-rw-r--r-- | asn1/tcap/packet-tcap-template.h | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_ss.c | 55 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_ss.h | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-tcap.c | 60 | ||||
-rw-r--r-- | epan/dissectors/packet-tcap.h | 6 |
6 files changed, 60 insertions, 132 deletions
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c index ab52f8b7c9..c32a9bf917 100644 --- a/asn1/tcap/packet-tcap-template.c +++ b/asn1/tcap/packet-tcap-template.c @@ -35,7 +35,6 @@ #include <stdio.h> #include <string.h> -#include <epan/asn1.h> #include "packet-ber.h" #include "packet-tcap.h" @@ -257,65 +256,6 @@ proto_reg_handoff_tcap(void) -/* some functions from packet_tcap which are needed by some other dissectors */ - -#define TC_DS_OK 1 -#define TC_DS_FAIL 0 - - -int -tcap_find_eoc(ASN1_SCK *asn1) -{ - guint saved_offset; - gint prev_offset; - guint tag; - guint len; - gboolean def_len; - - saved_offset = asn1->offset; - - while (!asn1_eoc(asn1, -1)) - { - prev_offset = asn1->offset; - asn1_id_decode1(asn1, &tag); - asn1_length_decode(asn1, &def_len, &len); - - if (def_len) - { - asn1->offset += len; - } - else - { - asn1->offset += tcap_find_eoc(asn1); - asn1_eoc_decode(asn1, -1); - } - if (prev_offset >= asn1->offset) - THROW(ReportedBoundsError); - } - - len = asn1->offset - saved_offset; - asn1->offset = saved_offset; - - return(len); -} - -gboolean -tcap_check_tag(ASN1_SCK *asn1, guint tag) -{ - guint saved_offset, real_tag; - - if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) - { - return (FALSE); - } - - saved_offset = asn1->offset; - asn1_id_decode1(asn1, &real_tag); - asn1->offset = saved_offset; - return (tag == real_tag); -} - - static int dissect_tcap_param(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { diff --git a/asn1/tcap/packet-tcap-template.h b/asn1/tcap/packet-tcap-template.h index 5adee776ba..491392af7d 100644 --- a/asn1/tcap/packet-tcap-template.h +++ b/asn1/tcap/packet-tcap-template.h @@ -58,10 +58,4 @@ extern gint tcap_standard; extern const value_string tcap_component_type_str[]; -extern int tcap_find_eoc(ASN1_SCK *asn1); - -extern gboolean tcap_check_tag(ASN1_SCK *asn1, guint tag); - - - #endif /* PACKET_INAP_H */ diff --git a/epan/dissectors/packet-gsm_ss.c b/epan/dissectors/packet-gsm_ss.c index f91bf761d1..75f96da6e3 100644 --- a/epan/dissectors/packet-gsm_ss.c +++ b/epan/dissectors/packet-gsm_ss.c @@ -174,6 +174,61 @@ static gboolean gsm_ss_ucs2 = FALSE; static gboolean gsm_ss_compressed = FALSE; + +int +tcap_find_eoc(ASN1_SCK *asn1) +{ + guint saved_offset; + gint prev_offset; + guint tag; + guint len; + gboolean def_len; + + saved_offset = asn1->offset; + + while (!asn1_eoc(asn1, -1)) + { + prev_offset = asn1->offset; + asn1_id_decode1(asn1, &tag); + asn1_length_decode(asn1, &def_len, &len); + + if (def_len) + { + asn1->offset += len; + } + else + { + asn1->offset += tcap_find_eoc(asn1); + asn1_eoc_decode(asn1, -1); + } + if (prev_offset >= asn1->offset) + THROW(ReportedBoundsError); + } + + len = asn1->offset - saved_offset; + asn1->offset = saved_offset; + + return(len); +} + +gboolean +tcap_check_tag(ASN1_SCK *asn1, guint tag) +{ + guint saved_offset, real_tag; + + if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) + { + return (FALSE); + } + + saved_offset = asn1->offset; + asn1_id_decode1(asn1, &real_tag); + asn1->offset = saved_offset; + return (tag == real_tag); +} + + + typedef struct dgt_set_t { unsigned char out[15]; diff --git a/epan/dissectors/packet-gsm_ss.h b/epan/dissectors/packet-gsm_ss.h index 8c6c6f7f49..71f5246686 100644 --- a/epan/dissectors/packet-gsm_ss.h +++ b/epan/dissectors/packet-gsm_ss.h @@ -38,3 +38,8 @@ extern const value_string gsm_ss_err_code_strings[]; extern void param_AddressString(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field); extern void gsm_ss_dissect(ASN1_SCK *asn1, proto_tree *tree, guint exp_len, guint opr_code, guint comp_type_tag); + +extern int tcap_find_eoc(ASN1_SCK *asn1); + +extern gboolean tcap_check_tag(ASN1_SCK *asn1, guint tag); + diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c index a6ca6fd9c3..7146ae5e84 100644 --- a/epan/dissectors/packet-tcap.c +++ b/epan/dissectors/packet-tcap.c @@ -42,7 +42,6 @@ #include <stdio.h> #include <string.h> -#include <epan/asn1.h> #include "packet-ber.h" #include "packet-tcap.h" @@ -2892,65 +2891,6 @@ proto_reg_handoff_tcap(void) -/* some functions from packet_tcap which are needed by some other dissectors */ - -#define TC_DS_OK 1 -#define TC_DS_FAIL 0 - - -int -tcap_find_eoc(ASN1_SCK *asn1) -{ - guint saved_offset; - gint prev_offset; - guint tag; - guint len; - gboolean def_len; - - saved_offset = asn1->offset; - - while (!asn1_eoc(asn1, -1)) - { - prev_offset = asn1->offset; - asn1_id_decode1(asn1, &tag); - asn1_length_decode(asn1, &def_len, &len); - - if (def_len) - { - asn1->offset += len; - } - else - { - asn1->offset += tcap_find_eoc(asn1); - asn1_eoc_decode(asn1, -1); - } - if (prev_offset >= asn1->offset) - THROW(ReportedBoundsError); - } - - len = asn1->offset - saved_offset; - asn1->offset = saved_offset; - - return(len); -} - -gboolean -tcap_check_tag(ASN1_SCK *asn1, guint tag) -{ - guint saved_offset, real_tag; - - if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) - { - return (FALSE); - } - - saved_offset = asn1->offset; - asn1_id_decode1(asn1, &real_tag); - asn1->offset = saved_offset; - return (tag == real_tag); -} - - static int dissect_tcap_param(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { diff --git a/epan/dissectors/packet-tcap.h b/epan/dissectors/packet-tcap.h index 0c7c003c45..fb328fcabc 100644 --- a/epan/dissectors/packet-tcap.h +++ b/epan/dissectors/packet-tcap.h @@ -65,10 +65,4 @@ extern gint tcap_standard; extern const value_string tcap_component_type_str[]; -extern int tcap_find_eoc(ASN1_SCK *asn1); - -extern gboolean tcap_check_tag(ASN1_SCK *asn1, guint tag); - - - #endif /* PACKET_INAP_H */ |