diff options
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/acse/acse.cnf | 2 | ||||
-rw-r--r-- | asn1/acse/packet-acse-template.c | 44 | ||||
-rw-r--r-- | asn1/pres/ISO8823-PRESENTATION.asn | 40 | ||||
-rw-r--r-- | asn1/pres/packet-pres-template.c | 65 | ||||
-rw-r--r-- | asn1/pres/pres.cnf | 2 |
5 files changed, 129 insertions, 24 deletions
diff --git a/asn1/acse/acse.cnf b/asn1/acse/acse.cnf index 9b41f16336..c9c8b0ac33 100644 --- a/asn1/acse/acse.cnf +++ b/asn1/acse/acse.cnf @@ -40,7 +40,7 @@ AARE-apdu/_untag/protocol-version aARE_protocol_version AARQ-apdu/_untag/aSO-context-name aARQ_aSO_context_name AARE-apdu/_untag/aSO-context-name aARE_aSO_context_name ACRQ-apdu/_untag/aSO-context-name aCRQ_aSO_context_name - +PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned #.FN_PARS Authentication-value-other/other-mechanism-name FN_VARIANT = _str VAL_PTR = &object_identifier_id diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c index 4764c9e20a..46056b166e 100644 --- a/asn1/acse/packet-acse-template.c +++ b/asn1/acse/packet-acse-template.c @@ -58,10 +58,19 @@ #define PSNAME "ACSE" #define PFNAME "acse" +#define CLPNAME "ISO 10035-1 OSI Connectionless Association Control Service" +#define CLPSNAME "CLACSE" +#define CLPFNAME "clacse" + + #define ACSE_APDU_OID "2.2.1.0.1" /* Initialize the protocol and registered fields */ -static int proto_acse = -1; +int proto_acse = -1; +int proto_clacse = -1; + + + #include "packet-acse-hf.c" /* Initialize the subtree pointers */ @@ -196,6 +205,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) case SES_DISCONNECT: /* RLRQ */ case SES_FINISH: /* RLRE */ case SES_ABORT: /* ABRT */ + case CLSES_UNIT_DATA: /* AARQ Connetctionless session */ break; case SES_DATA_TRANSFER: oid=find_oid_by_pres_ctx_id(pinfo, indir_ref); @@ -217,14 +227,28 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) return; } - /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE); - tree = proto_item_add_subtree(item, ett_acse); + if(session->spdu_type == CLSES_UNIT_DATA) + { + /* create display subtree for the connectionless protocol */ + if(parent_tree) + { + item = proto_tree_add_item(parent_tree, proto_clacse, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_acse); + } + col_set_str(pinfo->cinfo, COL_PROTOCOL, "CL-ACSE"); + col_clear(pinfo->cinfo, COL_INFO); + } + else + { + /* create display subtree for the protocol */ + if(parent_tree) + { + item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_acse); + } + col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE"); + col_clear(pinfo->cinfo, COL_INFO); } - col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE"); - col_clear(pinfo->cinfo, COL_INFO); - /* we can't make any additional checking here */ /* postpone it before dissector will have more information */ @@ -258,6 +282,10 @@ void proto_register_acse(void) { proto_acse = proto_register_protocol(PNAME, PSNAME, PFNAME); register_dissector("acse", dissect_acse, proto_acse); + /* Register connectionless protocol */ + proto_clacse = proto_register_protocol(CLPNAME, CLPSNAME, CLPFNAME); + + /* Register fields and subtrees */ proto_register_field_array(proto_acse, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); 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 |