aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/camel
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-03-26 19:41:23 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-03-26 19:41:23 +0000
commit49c7005ab5d8ae17efd3cf1e5c8364944ddddea4 (patch)
tree9a1cb13788ba8981732d9c7ce34a02f09b27900a /asn1/camel
parentbeee8db906487ae7f5dd5f247058ee287fff8d9b (diff)
In dissect_invokeData(), fixup the default case of the switch statement. Fixes 2 instances of Coverity CID 813: UNREACHABLE.
svn path=/trunk/; revision=41775
Diffstat (limited to 'asn1/camel')
-rw-r--r--asn1/camel/camel.cnf68
1 files changed, 35 insertions, 33 deletions
diff --git a/asn1/camel/camel.cnf b/asn1/camel/camel.cnf
index 040bd071cc..3ab2a3769a 100644
--- a/asn1/camel/camel.cnf
+++ b/asn1/camel/camel.cnf
@@ -11,8 +11,8 @@ CS1-DataTypes inap
CS2-datatypes inap
#.ASSIGNED_OBJECT_IDENTIFIER classes
-#.ASSIGNED_OBJECT_IDENTIFIER ros-InformationObjects
-#.ASSIGNED_OBJECT_IDENTIFIER tc-Messages
+#.ASSIGNED_OBJECT_IDENTIFIER ros-InformationObjects
+#.ASSIGNED_OBJECT_IDENTIFIER tc-Messages
#.ASSIGNED_OBJECT_IDENTIFIER tc-NotationExtensions
#.ASSIGNED_OBJECT_IDENTIFIER gprsSSF-gsmSCF-Operations
#.ASSIGNED_OBJECT_IDENTIFIER gsmSCF-gsmSRF-Operations
@@ -99,7 +99,7 @@ const value_string camel_opr_code_strings[] = {
/* CAMEL ERRORS */
static const value_string camel_err_code_string_vals[] = {
#.TABLE_BODY ERROR
- { %(&errorCode)s, "%(_ident)s" },
+ { %(&errorCode)s, "%(_ident)s" },
#.TABLE_FTR
{ 0, NULL }
};
@@ -118,10 +118,12 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_
offset= %(_argument_pdu)s(tvb, actx->pinfo , tree);
break;
#.TABLE2_FTR
- cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
- proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
- expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode);
- /* todo call the asn.1 dissector */
+ default:
+ cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
+ proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
+ expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode);
+ /* todo call the asn.1 dissector */
+ break;
}
return offset;
}
@@ -169,18 +171,18 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a
if (is_ExtensionField){
hf_index = hf_camel_extension_code_local;
}else if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
- hf_index = hf_camel_error_code_local;
- }
+ hf_index = hf_camel_error_code_local;
+ }
%(DEFAULT_BODY)s
if (is_ExtensionField == FALSE){
if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
- errorCode = opcode;
- col_append_str(actx->pinfo->cinfo, COL_INFO,
+ errorCode = opcode;
+ col_append_str(actx->pinfo->cinfo, COL_INFO,
val_to_str(errorCode, camel_err_code_string_vals, "Unknown CAMEL error (%%u)"));
col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
col_set_fence(actx->pinfo->cinfo, COL_INFO);
}else{
- col_append_str(actx->pinfo->cinfo, COL_INFO,
+ col_append_str(actx->pinfo->cinfo, COL_INFO,
val_to_str(opcode, camel_opr_code_strings, "Unknown CAMEL (%%u)"));
col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
col_set_fence(actx->pinfo->cinfo, COL_INFO);
@@ -322,7 +324,7 @@ proto_tree *subtree;
#.FN_BODY DateAndTime
-/*
+/*
* date_option = 1 european dd:mm:yyyy
* date_option = 2 american mm:dd:yyyy
*/
@@ -334,17 +336,17 @@ proto_tree *subtree;
*/
guint8 digit_pair;
- guint8 i = 0, curr_offset;
+ guint8 i = 0, curr_offset;
char camel_time[CAMEL_DATE_AND_TIME_LEN];
char c[CAMEL_DATE_AND_TIME_LEN]; /*temporary container*/
/* 2 digits per octet, 7 octets total + 5 delimiters */
-
- for (curr_offset = 0; curr_offset < 7 ; curr_offset++)
+
+ for (curr_offset = 0; curr_offset < 7 ; curr_offset++)
/*Loop to extract date*/
{
digit_pair = tvb_get_guint8(tvb, curr_offset);
-
+
proto_tree_add_uint(tree,
hf_digit,
tvb,
@@ -358,18 +360,18 @@ proto_tree *subtree;
curr_offset,
1,
digit_pair >>4);
-
-
+
+
c[i] = camel_number_to_char( digit_pair & 0x0F);
i++;
c[i] = camel_number_to_char( digit_pair >>4);
i++;
}
-
+
/* Pretty print date */
/* XXX - Should we use sprintf here instead of assembling the string by
* hand? */
-
+
camel_time[0] = c[8];
camel_time[1] = c[9];
camel_time[2] = ':';
@@ -383,7 +385,7 @@ proto_tree *subtree;
{
camel_time[9] = c[6]; /*day*/
camel_time[10] = c[7];
- camel_time[11] = '/';
+ camel_time[11] = '/';
camel_time[12] = c[4]; /*month*/
camel_time[13] = c[5];
}
@@ -391,7 +393,7 @@ proto_tree *subtree;
{
camel_time[9] = c[4]; /*month*/
camel_time[10] = c[5];
- camel_time[11] = '/';
+ camel_time[11] = '/';
camel_time[12] = c[6]; /*day*/
camel_time[13] = c[7];
}
@@ -402,14 +404,14 @@ proto_tree *subtree;
camel_time[18] = c[3];
camel_time[CAMEL_DATE_AND_TIME_LEN - 1] = '\0';
-
+
/*start = 0, length = 7*/
-
- proto_tree_add_string(tree,
- hf_index,
+
+ proto_tree_add_string(tree,
+ hf_index,
tvb,
- 0,
- 7,
+ 0,
+ 7,
camel_time);
return 7; /* 7 octets eaten*/
@@ -440,11 +442,11 @@ proto_tree *subtree;
#.END
#----------------------------------------------------------------------------------------
-#.FN_PARS RedirectingPartyID
+#.FN_PARS RedirectingPartyID
VAL_PTR = &parameter_tvb
-#.FN_BODY RedirectingPartyID
+#.FN_BODY RedirectingPartyID
tvbuff_t *parameter_tvb;
@@ -465,7 +467,7 @@ proto_tree *subtree;
if (!parameter_tvb)
return offset;
- PDPTypeOrganization = (tvb_get_guint8(parameter_tvb,0) &0x0f);
+ PDPTypeOrganization = (tvb_get_guint8(parameter_tvb,0) &0x0f);
#.END
#----------------------------------------------------------------------------------------
@@ -478,7 +480,7 @@ proto_tree *subtree;
if (!parameter_tvb)
return offset;
- PDPTypeNumber = tvb_get_guint8(parameter_tvb,0);
+ PDPTypeNumber = tvb_get_guint8(parameter_tvb,0);
subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
switch (PDPTypeOrganization){
case 0: /* ETSI */