|
|
1.1 root 1: -- VTPM: decode ASQ PDU
2:
3: -- $Header: /f/osi/vt/RCS/rcv_asq.py,v 7.0 89/11/23 22:31:34 mrose Rel $
4: --
5: --
6: -- $Log: rcv_asq.py,v $
7: -- Revision 7.0 89/11/23 22:31:34 mrose
8: -- Release 6.0
9: --
10:
11: --
12: -- NOTICE
13: --
14: -- Acquisition, use, and distribution of this module and related
15: -- materials are subject to the restrictions of a license agreement.
16: -- Consult the Preface in the User's Manual for the full terms of
17: -- this agreement.
18: --
19: --
20:
21:
22: ASQPDU DEFINITIONS ::=
23:
24: %{
25: #include <stdio.h>
26: #include "sector1.h"
27:
28: #undef PEPYPARM
29: #define PEPYPARM int *
30:
31: #undef PEPYTEST
32:
33: static int l,m,n,q;
34:
35: #ifdef PEPYTEST
36:
37: char *myname;
38: ASQ_MSG ud;
39:
40: rcv_asq(pe)
41: PE pe;
42: {
43: int i,j;
44:
45: if(unbuild_ASQPDU_ASQpdu(pe,1,NULLIP,NULLVP,&ud) == NOTOK)return;
46:
47: (void)printf("\n\n\nASQ Message:\n");
48: (void)printf("Class = %d Valid_Imp = %d Functional Units(%d) = %x\n",
49: ud.class,ud.valid_imp,ud.func_units.bitcount,ud.func_units.bitstring);
50: (void)printf("Version = %x Valid_coll = %d Valid_Prof = %d\n",
51: ud.version.bitstring,ud.valid_coll,ud.valid_prof);
52: if(ud.valid_prof)printf("OID_true = %d\n",
53: ud.asq_profile.oid_true);
54:
55: if(!ud.valid_prof)
56: return;
57: (void)printf("Specials=%d CDS=%d CSS=%d DEV=%d\n",
58: ud.asq_profile.num_sp_param,
59: ud.asq_profile.num_cds_objects,ud.asq_profile.num_css_objects,
60: ud.asq_profile.num_dev_objects);
61:
62: for(i=0; i < ud.asq_profile.num_sp_param; i++)
63: {
64: (void)printf("\n");
65: (void)printf("Special Num = %d Special Type = %d ",
66: ud.asq_profile.sp_offer_list[i].param_num,
67: ud.asq_profile.sp_offer_list[i].param_type);
68: if(ud.asq_profile.sp_offer_list[i].param_type == 0)
69: {
70: (void)printf("Boolean = %c\n",
71: ud.asq_profile.sp_offer_list[i].args.bool_arg);
72: }
73: else if(ud.asq_profile.sp_offer_list[i].param_type == 1)
74: {
75: (void)printf("Integer type = %d Integer value = %d\n",
76: ud.asq_profile.sp_offer_list[i].args.int_arg.type,
77: ud.asq_profile.sp_offer_list[i].args.int_arg.value);
78: }
79: else (void)printf("Invalid type\n");
80: }
81:
82:
83: for(i=0; i<ud.asq_profile.num_cds_objects; i++)
84: {
85: (void)printf("\n");
86: (void)printf("name: %s x=%d y=%d z=%d\n",
87: ud.asq_profile.cds_offer_list[i].obj_name,
88: ud.asq_profile.cds_offer_list[i].valid_x_dim,
89: ud.asq_profile.cds_offer_list[i].valid_y_dim,
90: ud.asq_profile.cds_offer_list[i].valid_z_dim);
91:
92: (void)printf("erase=%d repertoire=%d emphasis=%d\n",
93: ud.asq_profile.cds_offer_list[i].erasure.bitcount,
94: ud.asq_profile.cds_offer_list[i].valid_rep_list,
95: ud.asq_profile.cds_offer_list[i].valid_emp_list);
96:
97: (void)printf("ForeColor=%d BackColor=%d Access Right=%d\n",
98: ud.asq_profile.cds_offer_list[i].valid_fore_color,
99: ud.asq_profile.cds_offer_list[i].valid_back_color,
100: ud.asq_profile.cds_offer_list[i].access_right.bitcount);
101:
102: if(ud.asq_profile.cds_offer_list[i].valid_x_dim)
103: {
104: (void)printf("Bound=%d Add=%d Abs=%d Window=%d\n",
105: ud.asq_profile.cds_offer_list[i].x_dim.bound_type,
106: ud.asq_profile.cds_offer_list[i].x_dim.addressing.bitcount,
107: ud.asq_profile.cds_offer_list[i].x_dim.absolute.bitcount,
108: ud.asq_profile.cds_offer_list[i].x_dim.window_type);
109:
110: if(ud.asq_profile.cds_offer_list[i].x_dim.window_type)
111: {
112: (void)printf("windowtype=%d windowvalue=%d\n",
113: ud.asq_profile.cds_offer_list[i].x_dim.window.type,
114: ud.asq_profile.cds_offer_list[i].x_dim.window.value);
115: }
116: }
117: if(ud.asq_profile.cds_offer_list[i].valid_rep_list)
118: {
119: (void)printf("\n");
120: (void)printf("validcap=%d Number of Repertoires=%d\n",
121: ud.asq_profile.cds_offer_list[i].rep_offer.valid_cap,
122: ud.asq_profile.cds_offer_list[i].rep_offer.num_reps);
123: for(j=0;j<ud.asq_profile.cds_offer_list[i].rep_offer.num_reps;j++)
124: {
125: (void)printf("\n");
126: (void)printf("reptype=%d fontcap=%d numfonts=%d\n",
127: ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[j].rep_type, ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[j].valid_font_cap, ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[j].num_fonts);
128: if(ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[j].rep_type == 2)
129: (void)printf("Repertoire = %s\n", ud.asq_profile.cds_offer_list[i].rep_offer.repertoire[j].rep_assign);
130: }
131: }
132: }
133: }
134:
135: #endif
136:
137:
138: #define bitstr2int(arg,val,cnt) \
139: { \
140: char *cp; \
141: \
142: cp = bitstr2strb (arg, &cnt); \
143: val = strb2int (cp, cnt); \
144: free (cp); \
145: }
146:
147: %}
148:
149: BEGIN
150:
151: SECTIONS none unbuild none
152:
153: ASQpdu ::= CHOICE
154:
155: {
156: asqpdu [0] IMPLICIT ASQcontent [[p (PEPYPARM)parm]]
157: }
158:
159: ASQcontent
160: %{
161: ASQ_MSG *arg =
162: (ASQ_MSG *) parm;
163: %}
164: ::= SEQUENCE
165: %{
166: arg->valid_imp = 0;
167: arg->valid_prof = 0;
168: arg->valid_coll = 0;
169: %}
170: {
171: [0] IMPLICIT INTEGER [[i arg->class]],
172:
173: [1] IMPLICIT ImplemIdent [[p (PEPYPARM)&(arg->imp_id)]]
174: %{arg->valid_imp = 1;%}
175: OPTIONAL,
176:
177: [2] IMPLICIT BIT STRING
178: %{ bitstr2int ($$, arg->func_units.bitstring, arg->func_units.bitcount); %},
179:
180: [3] IMPLICIT Profile [[p (PEPYPARM)&(arg->asq_profile)]]
181: %{arg->valid_prof = 1;%}
182: OPTIONAL,
183:
184: [4] IMPLICIT BIT STRING
185: %{ bitstr2int ($$, arg->version.bitstring, arg->version.bitcount); %}
186: OPTIONAL,
187:
188: [5] IMPLICIT INTEGER [[i arg->coll_winner]]
189: %{arg->valid_coll = 1;%}
190: OPTIONAL
191: }
192:
193: ImplemIdent
194: %{
195: IMPLEM_ID *arg = (IMPLEM_ID *)parm;
196: %}
197: ::= SEQUENCE
198: %{
199: arg->oid_true = 0;
200: arg->name_true = 0;
201: arg->version_true = 0;
202: %}
203: {
204: impIdent [0] IMPLICIT OBJECT IDENTIFIER
205: [[O arg->imp_oid]]
206: %{arg->oid_true = 1;%}
207: OPTIONAL,
208:
209: impName [1] IMPLICIT PrintableString
210: [[s arg->name]]
211: %{arg->name_true = 1;%}
212: OPTIONAL,
213:
214: impVersion [2] IMPLICIT PrintableString
215: [[s arg->version]]
216: %{arg->version_true = 1;%}
217: }
218:
219: Profile
220: %{
221: ARG_OFFER_LIST *arg = (ARG_OFFER_LIST *)parm;
222: %}
223: ::= SEQUENCE
224: %{
225: arg->oid_true = 0;
226: arg->num_sp_param = 0;
227: arg->num_cds_objects = 0;
228: arg->num_css_objects = 0;
229: arg->num_dev_objects = 0;
230: arg->del_ctrl.bitcount = 0;
231: %}
232: {
233: name OBJECT IDENTIFIER [[O arg->prof_oid]]
234: %{arg->oid_true = 1;%},
235:
236: ProfileArgList [[p parm]]
237: OPTIONAL
238:
239: }
240:
241: ProfileArgList
242: %{
243: int k;
244: ARG_OFFER_LIST *arg = (ARG_OFFER_LIST *)parm;
245:
246: %} ::=
247: SEQUENCE OF %{
248:
249: q = arg->num_sp_param;
250: %}
251:
252: CHOICE
253: {
254: specialArgs [0] IMPLICIT SEQUENCE
255: {
256: identifier INTEGER
257: [[i arg->sp_offer_list[q].param_num]],
258:
259: offeredValues CHOICE
260: {
261: boolean [0] IMPLICIT BIT STRING
262: [[x arg->sp_offer_list[q].args.bool_arg $ k]]
263: %{arg->sp_offer_list[q].param_type = 0;%},
264:
265: integer [1] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->sp_offer_list[q].args.int_arg)]]
266: %{arg->sp_offer_list[q].param_type = 1;%},
267:
268: string [2] IMPLICIT SET OF <<j=0; j<1; j++>>
269: PrintableString
270: [[s arg->sp_offer_list[q].args.string_arg]]
271: %{arg->sp_offer_list[q].param_type = 2;%}
272: }
273:
274: %{++arg->num_sp_param;
275: if(arg->num_sp_param >= MAXSPARGS) return(OK);
276: %}
277: },
278:
279: vteParams [1] IMPLICIT ParamOfferList [[p parm]]
280:
281: }
282:
283: ParamOfferList
284: %{
285: ARG_OFFER_LIST *arg = (ARG_OFFER_LIST *)parm;
286: %}
287: ::= SEQUENCE
288: {
289: displayObjects [0] IMPLICIT CDSOffer [[p parm]]
290: OPTIONAL,
291:
292: -- controlObjects [1] IMPLICIT CSSOffer [[p parm]]
293: -- OPTIONAL,
294:
295: -- deviceObjects [2] IMPLICIT DEVOffer [[p parm]]
296: -- OPTIONAL,
297:
298: deliveryControl [3] IMPLICIT BIT STRING
299: %{ bitstr2int ($$,
300: arg->del_ctrl.bitstring,
301: arg->del_ctrl.bitcount); %}
302: OPTIONAL
303: }
304:
305: --Note Problem with IMPLICIT SEQUENCE Definition below. PEPY does not accept
306: --it as defined in 9041 and in fact that definition is ridiculous. At the
307: --moment it is not clear if even hand coding available in ISODE 3.0 can
308: --produce the requirement of 9041.
309:
310: CDSOffer
311: %{
312: ARG_OFFER_LIST *arg = (ARG_OFFER_LIST *)parm;
313: %}
314: ::=
315: SET OF
316: %{
317: l = arg->num_cds_objects;
318: %} SEQUENCE
319: {
320: objectName PrintableString
321: [[s arg->cds_offer_list[l].obj_name]],
322:
323: ObjectOffer [[p (PEPYPARM)&(arg->cds_offer_list[l])]]
324:
325: %{ ++arg->num_cds_objects;
326: if(arg->num_cds_objects >= MAXCDSOBJ) return(OK);
327: %}
328: }
329:
330: --CSSOffer ::= NULL
331:
332: --DEVOffer ::= NULL
333:
334: ObjectOffer
335: %{
336: CDS_OFFER *arg = (CDS_OFFER *)parm;
337: %}
338: ::= SEQUENCE
339: %{
340: arg->dimensions.bitcount = 0;
341: arg->valid_x_dim = 0;
342: arg->valid_y_dim = 0;
343: arg->valid_z_dim = 0;
344: arg->erasure.bitcount = 0;
345: arg->valid_rep_list = 0;
346: arg->valid_emp_list = 0;
347: arg->valid_fore_color = 0;
348: arg->valid_back_color = 0;
349: arg->access_right.bitcount = 0;
350: %}
351: {
352: dimensionOffer [0] IMPLICIT BIT STRING
353: %{ bitstr2int ($$,
354: arg->dimensions.bitstring,
355: arg->dimensions.bitcount); %}
356: OPTIONAL,
357:
358: xParamOffer [1] IMPLICIT DimOffer [[p (PEPYPARM)&(arg->x_dim)]]
359: %{arg->valid_x_dim = 1;%}
360: OPTIONAL,
361:
362: yParamOffer [2] IMPLICIT DimOffer [[p (PEPYPARM)&(arg->y_dim)]]
363: %{arg->valid_y_dim = 1;%}
364: OPTIONAL,
365:
366: zParamOffer [3] IMPLICIT DimOffer [[p (PEPYPARM)&(arg->z_dim)]]
367: %{arg->valid_z_dim = 1;%}
368: OPTIONAL,
369:
370: -- erasuroffer [4] IMPLICIT BIT STRING
371: -- %{ bitstr2int ($$,
372: -- arg->erasure.bitstring,
373: -- arg->erasure.bitcount); %}
374: -- OPTIONAL,
375:
376: repOfferList [5] IMPLICIT CompRepOffer [[p (PEPYPARM)&(arg->rep_offer)]]
377: %{arg->valid_rep_list = 1;%}
378: OPTIONAL,
379:
380: -- empOfferList [6] IMPLICIT CompEmpOffer [[p (PEPYPRAM)&(arg->emp_offer)]]
381: -- %{arg->valid_emp_list = 1;%}
382: -- OPTIONAL,
383:
384: -- foreColorList [7] IMPLICIT ColorOffer [[p (PEPYPARM)&(arg->fore_color_list)]]
385: -- %{arg->valid_fore_color = 1;%}
386: -- OPTIONAL,
387:
388: -- backColorList [8] IMPLICIT ColorOffer [[p (PEPYPARM)&(arg->back_color_list)]]
389: -- %{arg->valid_back_color = 1;%}
390: -- OPTIONAL,
391:
392: objectAccRight [9] IMPLICIT BIT STRING
393: %{ bitstr2int ($$,
394: arg->access_right.bitstring,
395: arg->access_right.bitcount); %}
396: OPTIONAL
397: }
398:
399: DimOffer
400: %{
401: DIMEN_PARAM *arg = (DIMEN_PARAM *)parm;
402: %}
403: ::= SEQUENCE
404: %{
405: arg->bound_type = 0;
406: arg->addressing.bitcount = 0;
407: arg->absolute.bitcount = 0;
408: arg->window_type = 0;
409: %}
410:
411: {
412: bound [0] IMPLICIT SEQUENCE
413: {
414: unbounded NULL
415: %{arg->bound_type = 1;%}
416: OPTIONAL,
417:
418: limit IntOffer [[p (PEPYPARM)&(arg->bound)]]
419: %{arg->bound_type = 2;%}
420: }
421: OPTIONAL,
422:
423: addressing [1] IMPLICIT BIT STRING
424: %{ bitstr2int ($$,
425: arg->addressing.bitstring,
426: arg->addressing.bitcount); %}
427: OPTIONAL,
428:
429: absolute [2] IMPLICIT BIT STRING
430: %{ bitstr2int ($$,
431: arg->absolute.bitstring,
432: arg->absolute.bitcount); %}
433: OPTIONAL,
434:
435: window [3] IMPLICIT SEQUENCE
436: {
437: unbounded NULL
438: %{arg->window_type = 1;%}
439: OPTIONAL,
440:
441: limit IntOffer [[p (PEPYPARM)&(arg->window)]]
442: %{arg->window_type = 2;%}
443: OPTIONAL
444: }
445: OPTIONAL
446: }
447:
448: CompRepOffer
449: %{
450: REP_LIST *arg = (REP_LIST *)parm;
451: %}
452: ::= SEQUENCE
453: %{
454: arg->valid_cap = 0;
455: arg->num_reps = 0;
456: arg->repertoire[m].valid_font_cap = 0;
457: arg->repertoire[m].num_fonts = 0;
458: /* arg->repertoire[m].rep_assign = 0; */
459: %}
460:
461: {
462: repCapability [0] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
463: %{arg->valid_cap = 1;%}
464: OPTIONAL,
465:
466: [1] IMPLICIT SEQUENCE OF
467: %{m = arg->num_reps;%}
468: RepFontOffer [[p (PEPYPARM)&(arg->repertoire[m])]]
469: %{++arg->num_reps;
470: if(arg->num_reps >= MAXREPS) return(OK);
471: %}
472: }
473:
474: RepFontOffer
475: %{
476: REP_FONT *arg = (REP_FONT *)parm;
477: %}
478: ::=
479: CHOICE
480: {
481: NULL
482: %{arg->rep_type = 1;%},
483:
484: SEQUENCE
485: {
486: repertoire [0] IMPLICIT PrintableString
487: [[s arg->rep_assign]]
488: OPTIONAL,
489:
490: fontCapability [1] IMPLICIT IntOffer [[p (PEPYPARM)&(arg->capability)]]
491: %{arg->valid_font_cap = 1;%}
492: OPTIONAL,
493:
494: [2] IMPLICIT SEQUENCE OF
495: %{n = arg->num_fonts;%}
496: PrintableString
497: [[s arg->font_names[n] ]]
498: %{++arg->num_fonts;%}
499: OPTIONAL
500: }
501: %{arg->rep_type = 2;%}
502: }
503:
504: --CompEmpOffer ::= SEQUENCE
505: --%{ parm->asq_profile.cds_offer_list[l].emp_offer.valid_cap = 0;
506: -- parm->asq_profile.cds_offer_list[l].emp_offer.num_emps = 0;
507: --%}
508:
509: --{
510: -- empCap [0] IMPLICIT IntOffer [[p parm]]
511: -- %{parm->asq_profile.cds_offer_list[l].emp_offer.valid_cap = 1;%}
512: -- OPTIONAL,
513:
514: -- SEQUENCE OF %{m = parm->asq_profile.cds_offer_list[l].emp_offer.num_emps;%}
515: -- PrintableString
516: -- [[s parm->asq_profile.cds_offer_list[l].emp_offer.emp_string[m] ]]
517: -- %{++parm->asq_profile.cds_offer_list[l].emp_offer.num_emps;
518: -- if(parm->asq_profile.cds_offer_list[l].emp_offer.num_emps >= MAXEMPS) return(OK);
519: -- %}
520: -- OPTIONAL
521: --}
522:
523: --ColorOffer %{int i;%} ::= SEQUENCE
524: --%{
525: -- COLOR_LIST *arg = parm;
526: --
527: -- arg->valid_cap = 0;
528: -- arg->num_colors = 0;
529: --%}
530:
531: --{
532: -- colorCap [0] IMPLICIT FCIntOffer [[p parm]]
533: -- %{arg->valid_cap = 1;%}
534: -- OPTIONAL,
535:
536: -- colorNames SEQUENCE OF %{m = parm->asq_profile.cds_offer_list[l].fore_color_list.num_colors;%}
537: -- PrintableString
538: -- [[s parm->asq_profile.cds_offer_list[l].fore_color_list.color_string[m] ]]
539: -- %{++parm->asq_profile.cds_offer_list[l].fore_color_list.num_colors;
540: -- if(parm->asq_profile.cds_offer_list[l].fore_color_list.num_colors >= MAXCOLORS) return(OK);
541: -- %}
542: -- OPTIONAL
543: --}
544:
545: IntOffer
546: %{
547: INT_OFFER *arg = (INT_OFFER *)parm;
548: %}
549: ::= SEQUENCE OF
550:
551: CHOICE
552: {
553: indivValue [0] IMPLICIT INTEGER
554: [[i arg->value]]
555: %{arg->type = 0;%},
556:
557: range [1] IMPLICIT SEQUENCE
558: %{arg->type = 1;%}
559: {
560: INTEGER [[i arg->min_val]],
561: INTEGER [[i arg->max_val]]
562: }
563: }
564:
565: END
566:
567: %{
568:
569: %}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.