aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/pres
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2010-01-04 23:17:37 +0000
committerAnders Broman <anders.broman@ericsson.com>2010-01-04 23:17:37 +0000
commite8042d8eec671096cac639dd03ae611ca1c7c6e7 (patch)
tree40a7dfc37bec4c4206a020ce16010cb6a89d62a3 /asn1/pres
parent38b0b13b2308048d79602b7655505ce115cbb530 (diff)
From gonzalocas:
GSSE message dissector. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4370 svn path=/trunk/; revision=31442
Diffstat (limited to 'asn1/pres')
-rw-r--r--asn1/pres/ISO8823-PRESENTATION.asn40
-rw-r--r--asn1/pres/packet-pres-template.c65
-rw-r--r--asn1/pres/pres.cnf2
3 files changed, 92 insertions, 15 deletions
diff --git a/asn1/pres/ISO8823-PRESENTATION.asn b/asn1/pres/ISO8823-PRESENTATION.asn
index 2255198774..d36d5a2c12 100644
--- a/asn1/pres/ISO8823-PRESENTATION.asn
+++ b/asn1/pres/ISO8823-PRESENTATION.asn
@@ -388,5 +388,45 @@ User-session-requirements ::= BIT STRING {
END
+-- Module ISO9576-PRESENTATION (X.236)
+ISO9576-CONNECTIONLESS-PRESENTATION DEFINITIONS ::=
+BEGIN
+
+--
+-- The value of the SS-user data parameter of the S-UNIT-DATA request and indication
+-- session-service primitives shall be a UD-type value, followed as a requestor’s
+-- option by zero or more UDC-type values.
+--
+
+UD-type ::= SEQUENCE {
+ protocol-version [0] IMPLICIT Protocol-version DEFAULT {version-1},
+ calling-presentation-selector [1] IMPLICIT Calling-presentation-selector OPTIONAL,
+ called-presentation-selector [2] IMPLICIT Called-presentation-selector OPTIONAL,
+ presentation-context-definition-list [4] IMPLICIT
+ Presentation-context-definition-list OPTIONAL,
+ user-data User-data
+}
+
+-- Shall be the parameters of the UD PPDU.
+--
+-- As an initiator’s option, the presentation data values contained in a UD PPDU may be
+-- encoded more than once, using UDC-type values, to allow the transfer of the same
+-- presentation data values using a number of different transfer syntaxes.
+--
+
+UDC-type ::= User-data
+-- Shall not be present if the Presentation context definition list parameter is not present
+-- in the UD PPDU. Each instance of this data type shall contain all of the presentation data
+-- values which were contained in the User data parameter of the UD PPDU.
+-- This shall be the same set of presentation data values which were contained in the UD-type.
+--
+
+-- WS: trunkated here as the rest is present in the previous ASN1 def.
+END
+
+
+
+
+
-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index f7cba4b951..1f73ec85ed 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -1,6 +1,6 @@
/* packet-pres.c
* Routine to dissect ISO 8823 OSI Presentation Protocol packets
- * Based on the dissector by
+ * Based on the dissector by
* Yuriy Sidelnikov <YSidelnikov@hotmail.com>
*
* $Id$
@@ -51,9 +51,17 @@
#define PSNAME "PRES"
#define PFNAME "pres"
+#define CLPNAME "ISO 9576-1 OSI Connectionless Presentation Protocol"
+#define CLPSNAME "CLPRES"
+#define CLPFNAME "clpres"
+
/* Initialize the protocol and registered fields */
static int proto_pres = -1;
+/* Initialize the connectionles protocol */
+static int proto_clpres = -1;
+
+
/* type of session envelop */
static struct SESSION_DATA_STRUCTURE* session = NULL;
@@ -137,7 +145,7 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
pco=se_alloc(sizeof(pres_ctx_oid_t));
pco->ctx_id=idx;
pco->oid=se_strdup(oid);
- conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
+ conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
if (conversation) {
pco->index = conversation->index;
@@ -161,7 +169,7 @@ find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx)
conversation_t *conversation;
pco.ctx_id=idx;
- conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
+ conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
if (conversation) {
pco.index = conversation->index;
@@ -201,7 +209,7 @@ pres_try_users_table(guint32 ctx_id, tvbuff_t *tvb, int offset, packet_info *pin
{
tvbuff_t *next_tvb;
guint i;
-
+
for (i = 0; i < num_pres_users; i++) {
pres_user_t *u = &(pres_users[i]);
@@ -300,25 +308,48 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
int offset = 0, old_offset;
+ session = ((struct SESSION_DATA_STRUCTURE*)(pinfo->private_data));
+
/* first, try to check length */
/* do we have at least 4 bytes */
if (!tvb_bytes_exist(tvb, 0, 4)){
- session = ((struct SESSION_DATA_STRUCTURE*)(pinfo->private_data));
if (session && session->spdu_type != SES_MAJOR_SYNC_POINT) {
- proto_tree_add_text(parent_tree, tvb, offset,
+ proto_tree_add_text(parent_tree, tvb, offset,
tvb_reported_length_remaining(tvb,offset),"User data");
return; /* no, it isn't a presentation PDU */
}
}
+ /* save pointers for calling the acse dissector */
+ global_tree = parent_tree;
+ global_pinfo = pinfo;
+
+ /* if the session unit-data packet then we process it */
+ /* as a connectionless presentation protocol unit data */
+ if(session && session->spdu_type == CLSES_UNIT_DATA)
+ {
+ proto_tree * clpres_tree = NULL;
+ proto_item *ti;
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "CL-PRES");
+ col_clear(pinfo->cinfo, COL_INFO);
+
+ if (parent_tree)
+ {
+ ti = proto_tree_add_item(parent_tree, proto_clpres, tvb, offset, -1, FALSE);
+ clpres_tree = proto_item_add_subtree(ti, ett_pres);
+ }
+
+ /* dissect the packet */
+ dissect_UD_type_PDU(tvb, pinfo, clpres_tree);
+ return;
+ }
+
/* we can't make any additional checking here */
/* postpone it before dissector will have more information */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PRES");
col_clear(pinfo->cinfo, COL_INFO);
- /* save pointers for calling the acse dissector */
- global_tree = parent_tree;
- global_pinfo = pinfo;
if (session && session->spdu_type == SES_MAJOR_SYNC_POINT) {
/* This is a reassembly initiated in packet-ses */
@@ -326,12 +357,12 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
if (oid) {
call_ber_oid_callback (oid, tvb, offset, pinfo, parent_tree);
} else {
- proto_tree_add_text(parent_tree, tvb, offset,
+ proto_tree_add_text(parent_tree, tvb, offset,
tvb_reported_length_remaining(tvb,offset),"User data");
}
return;
}
-
+
while (tvb_reported_length_remaining(tvb, offset) > 0){
old_offset = offset;
offset = dissect_ppdu(tvb, offset, pinfo, parent_tree);
@@ -378,7 +409,7 @@ void proto_register_pres(void) {
&ett_pres,
#include "packet-pres-ettarr.c"
};
-
+
static uat_field_t users_flds[] = {
UAT_FLD_DEC(pres_users,ctx_id,"Context Id","Presentation Context Identifier"),
UAT_FLD_CSTRING(pres_users,oid,"Syntax Name OID","Abstract Syntax Name (Object Identifier)"),
@@ -397,12 +428,16 @@ void proto_register_pres(void) {
NULL,
pres_free_cb,
users_flds);
-
+
static module_t *pres_module;
-
+
/* Register protocol */
proto_pres = proto_register_protocol(PNAME, PSNAME, PFNAME);
register_dissector("pres", dissect_pres, proto_pres);
+
+ /* Register connectionless protocol (just for the description) */
+ proto_clpres = proto_register_protocol(CLPNAME, CLPSNAME, CLPFNAME);
+
/* Register fields and subtrees */
proto_register_field_array(proto_pres, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -420,7 +455,7 @@ void proto_register_pres(void) {
/*--- proto_reg_handoff_pres ---------------------------------------*/
void proto_reg_handoff_pres(void) {
-/* register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_pres, proto_pres,
+/* register_ber_oid_dissector("0.4.0.0.1.1.1.1", dissect_pres, proto_pres,
"itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) abstractSyntax(1) pres(1) version1(1)"); */
}
diff --git a/asn1/pres/pres.cnf b/asn1/pres/pres.cnf
index 9bc98ea6fa..bfefbfd120 100644
--- a/asn1/pres/pres.cnf
+++ b/asn1/pres/pres.cnf
@@ -8,6 +8,8 @@
#.EXPORTS
#.PDU
+UD-type
+UDC-type
#.NO_EMIT