aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-csn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-csn1.c')
-rw-r--r--epan/dissectors/packet-csn1.c66
1 files changed, 35 insertions, 31 deletions
diff --git a/epan/dissectors/packet-csn1.c b/epan/dissectors/packet-csn1.c
index 447b6e35cf..b54b672a5f 100644
--- a/epan/dissectors/packet-csn1.c
+++ b/epan/dissectors/packet-csn1.c
@@ -531,25 +531,26 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
csnStream_t arT = *ar;
proto_item *ti;
proto_tree *test_tree;
-
- test_tree = proto_tree_add_subtree_format(tree, tvb, bit_offset>>3, 1, ett_csn1, &ti, "%s", pDescr->sz);
-
- csnStreamInit(&arT, bit_offset, remaining_bits_len, ar->pinfo);
- Status = csnStreamDissector(test_tree, &arT, (const CSN_DESCR*)pDescr->descr.ptr, tvb, pvDATA(data, pDescr->offset), ett_csn1);
-
- if (Status >= 0)
- {
- proto_item_set_len(ti,((arT.bit_offset-1)>>3) - (bit_offset>>3)+1);
- remaining_bits_len = arT.remaining_bits_len;
- bit_offset = arT.bit_offset;
- pDescr++;
- }
- else
+ if (pDescr->may_be_null && remaining_bits_len == 0)
{
- /* Has already been processed: ProcessError("csnStreamDissector", Status, pDescr); */
- return Status;
+ proto_tree_add_none_format(tree, hf_null_data, tvb, 0, 0, "[NULL data]: %s Not Present", pDescr->sz);
+ } else {
+ test_tree = proto_tree_add_subtree_format(tree, tvb, bit_offset>>3, 1, ett_csn1, &ti, "%s", pDescr->sz);
+ csnStreamInit(&arT, bit_offset, remaining_bits_len, ar->pinfo);
+ Status = csnStreamDissector(test_tree, &arT, (const CSN_DESCR*)pDescr->descr.ptr, tvb, pvDATA(data, pDescr->offset), ett_csn1);
+ if (Status >= 0)
+ {
+ proto_item_set_len(ti,((arT.bit_offset-1)>>3) - (bit_offset>>3)+1);
+ remaining_bits_len = arT.remaining_bits_len;
+ bit_offset = arT.bit_offset;
+ }
+ else
+ {
+ /* Has already been processed: ProcessError("csnStreamDissector", Status, pDescr); */
+ return Status;
+ }
}
-
+ pDescr++;
break;
}
@@ -1002,22 +1003,25 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
proto_item *ti;
proto_tree *test_tree;
- test_tree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, 1, ett_csn1, &ti, pDescr->sz);
-
- csnStreamInit(&arT, bit_offset, remaining_bits_len, ar->pinfo);
- Status = csnStreamDissector(test_tree, &arT, (const CSN_DESCR *)pDescr->descr.ptr, tvb, pvDATA(data, pDescr->offset), ett_csn1);
- if (Status >= 0)
+ if (pDescr->may_be_null && remaining_bits_len == 0)
{
- proto_item_set_len(ti,((arT.bit_offset-1)>>3) - (bit_offset>>3)+1);
- remaining_bits_len = arT.remaining_bits_len;
- bit_offset = arT.bit_offset;
- pDescr++;
- }
- else
- { /* return error code Has already been processed: */
- return Status;
+ proto_tree_add_none_format(tree, hf_null_data, tvb, 0, 0, "[NULL data]: %s Not Present", pDescr->sz);
+ } else {
+ test_tree = proto_tree_add_subtree(tree, tvb, bit_offset>>3, 1, ett_csn1, &ti, pDescr->sz);
+ csnStreamInit(&arT, bit_offset, remaining_bits_len, ar->pinfo);
+ Status = csnStreamDissector(test_tree, &arT, (const CSN_DESCR *)pDescr->descr.ptr, tvb, pvDATA(data, pDescr->offset), ett_csn1);
+ if (Status >= 0)
+ {
+ proto_item_set_len(ti,((arT.bit_offset-1)>>3) - (bit_offset>>3)+1);
+ remaining_bits_len = arT.remaining_bits_len;
+ bit_offset = arT.bit_offset;
+ }
+ else
+ { /* return error code Has already been processed: */
+ return Status;
+ }
}
-
+ pDescr++;
break;
}