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