diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2007-04-03 19:08:00 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2007-04-03 19:08:00 +0000 |
commit | 9709011a9b553b9c3a9db0931366b6216b7ba4c6 (patch) | |
tree | 1ede0f1dc1100843504dacfa6fdfdf154ef95549 /asn1/tcap | |
parent | 8177d0f4a9242b0dd1b6c6a3aca63c819d1bda4c (diff) |
Implement a proposal from Elefterios Gabriel for SCCP:
Add a table of DPCs and SSNs that allow to override the protocol that would be choosen
so that the same SSN can use two different protocols in two different DPCs.
I did not believe it someone could have done it, then I saw the captures...
svn path=/trunk/; revision=21321
Diffstat (limited to 'asn1/tcap')
-rw-r--r-- | asn1/tcap/packet-tcap-template.c | 29 | ||||
-rw-r--r-- | asn1/tcap/packet-tcap-template.h | 3 |
2 files changed, 31 insertions, 1 deletions
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c index 343a77ad16..f2acd89017 100644 --- a/asn1/tcap/packet-tcap-template.c +++ b/asn1/tcap/packet-tcap-template.c @@ -70,6 +70,8 @@ gint ett_tcap_stat = -1; static struct tcapsrt_info_t * gp_tcapsrt_info; static gboolean tcap_subdissector_used=FALSE; +static dissector_handle_t requested_subdissector_handle = NULL; + static struct tcaphash_context_t * gp_tcap_context=NULL; #include "packet-tcap-ett.c" @@ -568,7 +570,13 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, subdissector_handle=p_tcap_context->subdissector_handle; is_subdissector=TRUE; } - + + /* Have SccpUsersTable protocol taking precedence over sccp.ssn table */ + if (!is_subdissector && requested_subdissector_handle) { + is_subdissector = TRUE; + subdissector_handle = requested_subdissector_handle; + } + if (!is_subdissector) { /* * If we do not currently know the subdissector, we have to find it @@ -607,6 +615,7 @@ dissect_tcap_TheComponent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } else { /* We have it already */ } + /* Call the sub dissector if present, and not already called */ if (is_subdissector) call_dissector(subdissector_handle, next_tvb, pinfo, tcap_top_tree); @@ -647,3 +656,21 @@ dissect_tcap_TheExternUserInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int off return offset; } + + +void call_tcap_dissector(dissector_handle_t handle, tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) { + + requested_subdissector_handle = handle; + + TRY { + dissect_tcap(tvb, pinfo, tree); + } CATCH_ALL { + requested_subdissector_handle = NULL; + RETHROW; + } ENDTRY; + + requested_subdissector_handle = NULL; + +} + + diff --git a/asn1/tcap/packet-tcap-template.h b/asn1/tcap/packet-tcap-template.h index 430cab67d2..060c64ddca 100644 --- a/asn1/tcap/packet-tcap-template.h +++ b/asn1/tcap/packet-tcap-template.h @@ -41,6 +41,7 @@ #define ANSI_TC_INVOKE_N 0xed #define ANSI_TC_RRN 0xee + #define TCAP_SEQ_TAG 0x30 #define TCAP_SET_TAG 0x31 @@ -76,4 +77,6 @@ extern void add_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector); extern void delete_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector); +extern void call_tcap_dissector(dissector_handle_t, tvbuff_t*, packet_info*, proto_tree*); + #endif /* PACKET_tcap_H */ |