aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-11-16 19:52:00 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-11-16 19:52:00 +0000
commitedafe33a4621153bcdd9a0d51b23027179f5da36 (patch)
tree41a542c5dd8d58eed7fcf2979893072ffea9067d /asn1
parentb5ef3aebc94a3433077f544c90599b9bfdee40c6 (diff)
Dissect national Opcode.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39887 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ansi_tcap/ansi_tcap.cnf64
-rw-r--r--asn1/ansi_tcap/packet-ansi_tcap-template.c50
2 files changed, 110 insertions, 4 deletions
diff --git a/asn1/ansi_tcap/ansi_tcap.cnf b/asn1/ansi_tcap/ansi_tcap.cnf
index 079c9f4d9f..a013a6e6ef 100644
--- a/asn1/ansi_tcap/ansi_tcap.cnf
+++ b/asn1/ansi_tcap/ansi_tcap.cnf
@@ -11,12 +11,74 @@ Priority
#.FN_PARS
OperationCode VAL_PTR = &ansi_tcap_private.d.OperationCode
-OperationCode/national VAL_PTR = &ansi_tcap_private.d.OperationCode_national
OperationCode/private VAL_PTR = &ansi_tcap_private.d.OperationCode_private
#.FN_FTR OperationCode
ansi_tcap_private.d.OperationCode_item = actx->created_item;
#.END
+#.FN_BODY OperationCode/national VAL_PTR = &ansi_tcap_private.d.OperationCode_national
+ proto_tree *subtree;
+ proto_item *spcifier_item;
+ int start_offset = offset;
+ guint8 family;
+ guint8 specifier;
+
+ %(DEFAULT_BODY)s
+ /* mask off the H bit */
+ ansi_tcap_private.d.OperationCode_national = (ansi_tcap_private.d.OperationCode_national&0x7fff);
+
+ subtree = proto_item_add_subtree(actx->created_item, ett_ansi_tcap_op_code_nat);
+ /* Bit H is used to distinguish between Operations that require a reply and those that do not. A value of 1
+ * indicates that a reply is required; a value of 0 indicates that a reply is not required.
+ */
+ family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
+ specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff);
+ proto_tree_add_item(subtree, hf_ansi_tcap_bit_h, tvb, start_offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(subtree, hf_ansi_tcap_op_family, tvb, start_offset, 2, ENC_BIG_ENDIAN);
+ spcifier_item = proto_tree_add_item(subtree, hf_ansi_tcap_op_specifier, tvb, start_offset, 2, ENC_BIG_ENDIAN);
+
+ switch(family){
+ case 0:
+ /* All Families ( Not used ) */
+ break;
+ case 1:
+ /* Parameter */
+ if(specifier== 1){
+ proto_item_append_text(spcifier_item, " Provide Value");
+ }else if (specifier== 2){
+ proto_item_append_text(spcifier_item, " Set Value");
+ }
+ break;
+ case 2:
+ /* Charging */
+ if (specifier== 1){
+ proto_item_append_text(spcifier_item, " Bill Call");
+ }
+ break;
+ case 3:
+ /* Provide Instructions */
+ if (specifier== 1){
+ proto_item_append_text(spcifier_item, " Start");
+ }else if (specifier== 2){
+ proto_item_append_text(spcifier_item, " Assist");
+ }
+ break;
+ case 4:
+ /* Connection Control */
+ if (specifier== 1){
+ proto_item_append_text(spcifier_item, " Connect");
+ }else if (specifier== 2){
+ proto_item_append_text(spcifier_item, " Temporary Connect");
+ }else if (specifier== 3){
+ proto_item_append_text(spcifier_item, " Disconnect");
+ }else if (specifier== 4){
+ proto_item_append_text(spcifier_item, " Forward Disconnect");
+ }
+ break;
+ default:
+ break;
+ }
+
#--- INVOKE ---
#.FN_BODY Invoke/parameter
diff --git a/asn1/ansi_tcap/packet-ansi_tcap-template.c b/asn1/ansi_tcap/packet-ansi_tcap-template.c
index f375007e6e..063fd5bf8a 100644
--- a/asn1/ansi_tcap/packet-ansi_tcap-template.c
+++ b/asn1/ansi_tcap/packet-ansi_tcap-template.c
@@ -58,12 +58,16 @@ static int hf_ansi_tcapsrt_Duplicate = -1;
static int hf_ansi_tcapsrt_BeginSession = -1;
static int hf_ansi_tcapsrt_EndSession = -1;
static int hf_ansi_tcapsrt_SessionTime = -1;
+static int hf_ansi_tcap_bit_h = -1;
+static int hf_ansi_tcap_op_family = -1;
+static int hf_ansi_tcap_op_specifier = -1;
#include "packet-ansi_tcap-hf.c"
/* Initialize the subtree pointers */
static gint ett_tcap = -1;
static gint ett_param = -1;
+static gint ett_ansi_tcap_op_code_nat = -1;
static gint ett_otid = -1;
static gint ett_dtid = -1;
@@ -101,6 +105,24 @@ static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) {
a_tcap_ctx->TransactionID_str = NULL;
}
+static const value_string ansi_tcap_national_op_code_family_vals[] = {
+ { 0x0, "All Families" },
+ { 0x1, "Parameter" },
+ { 0x2, "Charging" },
+ { 0x3, "Provide Instructions" },
+ { 0x4, "Connection Control" },
+ { 0x5, "Caller Interaction" },
+ { 0x6, "Send Notification" },
+ { 0x7, "Network Management" },
+ { 0x8, "Procedural" },
+ { 0x9, "Operation Control" },
+ { 0xa, "Report Event" },
+ /* Spare */
+ { 0x7e, "Miscellaneous" },
+ { 0x7f, "Reserved" },
+ { 0, NULL }
+};
+
static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
/*
@@ -301,16 +323,20 @@ find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){
}
if(ansi_tcap_private.d.OperationCode == 0){
/* national */
+ guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
+ guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff);
item = proto_tree_add_text(tree, tvb, 0, -1,
- "Dissector for ANSI TCAP NATIONAL code:%u not implemented. Contact Wireshark developers if you want this supported",
- ansi_tcap_private.d.OperationCode_national);
+ "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n"
+ "not implemented. Contact Wireshark developers if you want this supported(Spec required)",
+ ansi_tcap_private.d.OperationCode_national, family, specifier);
PROTO_ITEM_SET_GENERATED(item);
return FALSE;
}else if(ansi_tcap_private.d.OperationCode == 1){
/* private */
if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){
item = proto_tree_add_text(tree, tvb, 0, -1,
- "Dissector for ANSI TCAP PRIVATE code:%u not implemented. Contact Wireshark developers if you want this supported",
+ "Dissector for ANSI TCAP PRIVATE code:%u not implemented.\n"
+ "Contact Wireshark developers if you want this supported(Spec required)",
ansi_tcap_private.d.OperationCode_private);
PROTO_ITEM_SET_GENERATED(item);
return FALSE;
@@ -450,6 +476,23 @@ proto_register_ansi_tcap(void)
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_ansi_tcap_bit_h,
+ { "Require Reply", "ansi_tcap.req_rep",
+ FT_BOOLEAN, 16, NULL, 0x8000,
+ NULL, HFILL }
+ },
+ { &hf_ansi_tcap_op_family,
+ { "Family",
+ "ansi_tcap.op_family",
+ FT_UINT16, BASE_DEC, VALS(ansi_tcap_national_op_code_family_vals), 0x7f00,
+ NULL, HFILL }
+ },
+ { &hf_ansi_tcap_op_specifier,
+ { "Specifier",
+ "ansi_tcap.op_specifier",
+ FT_UINT16, BASE_DEC, NULL, 0x00ff,
+ NULL, HFILL }
+ },
#include "packet-ansi_tcap-hfarr.c"
};
@@ -460,6 +503,7 @@ proto_register_ansi_tcap(void)
&ett_otid,
&ett_dtid,
&ett_ansi_tcap_stat,
+ &ett_ansi_tcap_op_code_nat,
#include "packet-ansi_tcap-ettarr.c"
};