blob: 5ca513ee86182b06b1932985b220d06b2909a4d7 [file] [log] [blame]
Harald Welte9a8f5032017-07-25 08:23:52 +02001///////////////////////////////////////////////////////////////////////////////
2// //
3// Copyright Test Competence Center(TCC) ETH 2003 //
4// //
5// The copyright to the computer program(s) herein is the property of TCC. //
6// The program(s) may be used and/or copied only with the written permission //
7// of TCC or in accordance with the terms and conditions stipulated in the //
8// agreement/contract under which the program(s) has been supplied. //
9// //
10///////////////////////////////////////////////////////////////////////////////
11//
12// File: ROHC_Types.ttcn
13// Description: ROHC
14// Rev: R3A01
15// Prodnr: CNL 113 426
16// Updated: 2006.04.13
17// Contact: http://ttcn.ericsson.se
18//
19
20/* Based on RFC 3095, July 2001 */
21
22/* TODO: improvements::
23- Profile4_Dynamic_Chain_u should not contain the sn field
24
25ethesi */
26
27module ROHC_Types
28{
29import from General_Types all;
30
31external function f_ROHC_enc(in ROHC_packet_u pdu, in ROHC_config p_config)
32return octetstring;
33external function f_ROHC_dec(in octetstring data, inout ROHC_config p_config)
34return ROHC_packet_u;
35external function f_ROHC_CRC(in octetstring data, in integer crclen)
36return integer;
37external function f_FBCK_enc(in Feedback_data pdu, in ROHC_config p_config)
38return octetstring;
39external function f_FBCK_dec(in octetstring data, in ROHC_config p_config)
40return Feedback_data;
41
42/* Constants for ROHC mode field values including mode cancellation */
43const integer cg_ROHC_mode_C := 0;
44const integer cg_ROHC_mode_U := 1;
45const integer cg_ROHC_mode_O := 2;
46const integer cg_ROHC_mode_R := 3;
47
48/* Constants for ROHC feedback type */
49const integer cg_ROHC_fbck_type_ACK := 0;
50const integer cg_ROHC_fbck_type_NACK := 1;
51const integer cg_ROHC_fbck_type_SNACK := 2;
52const integer cg_ROHC_fbck_type_reserved := 3;
53
54type bitstring ROHC_BIT7_BO_LAST length (7) with {variant "BYTEORDER(last)"};
55
56type enumerated Packet_type { R_0(0), R_0_CRC(1), UO_0(2), R_1(3), R_1_ID(4),
57 R_1_TS(5), UO_1(6), UO_1_ID(7), UO_1_TS(8), UOR_2(9), UOR_2_ID(10),
58 UOR_2_TS(11), IR(12), IR_DYN(13), NOPKT(14) };
59
60/* ==================== ROHC configuration and context ==================== */
61
62 type record IP_context {
63 /* Version of this IP level. MSB bit may be set (Profile 4 only). */
64 integer version,
65 /* RND bit of this IP level (RND or RND2) */
66 boolean rnd_bit,
67 /* Whether AH is present in the IPX index list */
68 boolean ah_present,
69 /* Whether GRE is present in the IPX index list */
70 boolean gre_present,
71 /* Whether ESP is present in the IPX index list */
72 boolean esp_present,
73 /* Length of the compressed AH data field after the base header */
74 integer ah_data_len,
75 /* Whether GRE header has GRE checksum or not */
76 boolean gre_cksum_present
77 };
78
79 type record UDP_context {
80 boolean udp_cksum
81 };
82
83 type record of IP_context IP_contexts;
84
85 type record ROHC_context {
86 integer mode,
87 integer profile,
88 /* The decoded packet type */
89 Packet_type pkt,
90 IP_contexts ip_ctx,
91 UDP_context udp_ctx
92 };
93
94 type record of integer int_array;
95
96 type record of ROHC_context ROHC_context_rof;
97
98 type record ROHC_config {
99 boolean large_cid,
100 int_array rtp_ports,
101 ROHC_context_rof context
102 };
103
104 type port ROHC_ASP_SP_PT message
105 {
106 inout ROHC_packet_u;
107 inout octetstring;
108 } with { extension "internal" }
109
110
111 /* ROHC Configuration port */
112 type record ROHC_ROHCCFG_REQ_setconfig
113 {
114 ROHC_config config
115 }
116
117 type enumerated ROHC_ROHCCFG_REQ_operation { rohccfg_getconfig }
118
119 type union ROHC_ROHCCFG_REQ
120 {
121 ROHC_ROHCCFG_REQ_operation simpleop,
122 ROHC_ROHCCFG_REQ_setconfig setconfig
123 }
124
125 type enumerated ROHC_ROHCCFG_RSP_operation { rohccfg_ok }
126
127 type record ROHC_ROHCCFG_RSP_config
128 {
129 ROHC_config config
130 }
131
132 type union ROHC_ROHCCFG_RSP
133 {
134 ROHC_ROHCCFG_RSP_operation simpleop,
135 ROHC_ROHCCFG_RSP_config config
136 }
137
138 type port ROHC_PORTCFG_PT message
139 {
140 inout ROHC_config;
141 inout charstring;
142 inout ROHC_ROHCCFG_REQ;
143 inout ROHC_ROHCCFG_RSP;
144 } with { extension "internal" }
145
146 type union ROHC_packet_u
147 {
148 ROHC_packet rohc,
149 Segment_packet segment
150 }
151
152 type record ROHC_packet /* p.42 */
153 {
154 Padding padding optional,
155 Feedback feedback optional,
156 Header header,
157 Payload payload optional
158 };
159
160/* TODO CHECK: why this is needed ?
161type record Reconstructed_unit
162{
163 octetstring reconstructed_packet,
164 OCT4 CRC
165}; */
166
167 type record Segment_packet /* p.50 */
168 {
169 Padding padding optional,
170 Feedback feedback optional,
171 INT7b segment_header_id, /* Must be 127 (0x7F) */
172 boolean final,
173 Payload payload optional,
174 integer crc optional
175 };
176
177 type octetstring Padding; /* Must be a serie of 0xE0 */
178 type octetstring Payload;
179
180 type OCT1n Feedback1; /* p.91 */
181
182 type record Feedback_opts_u /* p.91 */
183 {
184 INT4b opt_type,
185 INT4b opt_len,
186 octetstring opt_data optional
187 };
188
189 type record of Feedback_opts_u Feedback_opts; /* p.91 */
190
191 type record Feedback2 /* p.91 */
192 {
193 INT2b acktype,
194 INT2b mode,
195 INT12b_BO_LAST sn,
196 Feedback_opts feedback_opts optional
197 };
198
199 type union Feedback_type /* p.46 */
200 {
201 Feedback1 feedback1,
202 Feedback2 feedback2
203 };
204
205 type record Feedback_data /* p.46 */
206 {
207 INT14b_BO_LAST cid,
208 Feedback_type feedback_type
209 };
210
211 type record Feedback_u /* p.45 */
212 {
213 BIT5 feedback_type, /* Must be '11110'B */
214 INT3b code,
215 LIN1 size optional,
216 /* TODO: size could be 0, so feedback_data should be optional;
217 although it's a weird case, but still possible */
218 Feedback_data feedback_data
219 };
220
221 type record of Feedback_u Feedback; /* p.42 */
222
223 type union Header /* p.77 */
224 {
225 Profile0_headers prof0,
226 Profile1_headers prof1,
227 Profile2_headers prof2,
228 Profile4_headers prof4
229 };
230
231 //Profile0
232
233 type union Profile0_headers
234 {
235 Profile0_IR_packet ir,
236 Profile0_normal_packet normal
237 };
238
239 type record Profile0_IR_packet /* p.127 */
240 {
241 INT14b_BO_LAST cid,
242 BIT7 type_ind, /* Must be '1111110'B */
243 BIT1 d, /* Must be 0 */
244 LIN1 profile, /* Must be 0 */
245 LIN1 crc,
246 octetstring orig_packet
247 };
248
249 type record Profile0_normal_packet /* p.128 */
250 {
251 INT14b_BO_LAST cid,
252 octetstring orig_packet
253 };
254
255 //Profile1
256
257 type record Profile1_headers /* p.77 */
258 {
259 Profile1_base_header base_header,
260 Profile1_Extension ext optional,
261 LIN2_BO_LAST ip_id_outer optional,
262 octetstring ah_outer optional,
263 LIN2_BO_LAST gre_cksum1 optional,
264 LIN2_BO_LAST ip_id_inner optional,
265 octetstring ah_inner optional,
266 LIN2_BO_LAST gre_cksum2 optional,
267 LIN2_BO_LAST udp_cksum optional
268 };
269
270 type union Profile1_base_header
271 {
272 Profile1_IR_header ir,
273 Profile1_IR_DYN_header ir_dyn,
274 Profile1_R_0_header r_0,
275 Profile1_R_0_CRC_header r_0_crc,
276 Profile1_UO_0_header uo_0,
277 Profile1_R_1_header r_1,
278 Profile1_R_1_ID_header r_1_id,
279 Profile1_R_1_TS_header r_1_ts,
280 Profile1_UO_1_header uo_1,
281 Profile1_UO_1_ID_header uo_1_id,
282 Profile1_UO_1_TS_header uo_1_ts,
283 Profile1_UOR_2_header uor_2,
284 Profile1_UOR_2_ID_header uor_2_id,
285 Profile1_UOR_2_TS_header uor_2_ts
286 };
287
288 type union Static_Chain_u /* p.91 */
289 {
290 IPv4_Static ipv4_stat,
291 IPv6_Static ipv6_stat,
292 UDP_Static udp_stat,
293 RTP_Static rtp_stat,
294 ESP_Static esp_stat
295 };
296
297 type union Dynamic_Chain_u /* p.91 */
298 {
299 IPv4_Dynamic ipv4_dyn,
300 IPv6_Dynamic ipv6_dyn,
301 UDP_Dynamic udp_dyn,
302 RTP_Dynamic rtp_dyn,
303 ESP_Dynamic esp_dyn
304 };
305
306 type record of Static_Chain_u Static_Chain; /* p.91 */
307
308 type record of Dynamic_Chain_u Dynamic_Chain; /* p.91 */
309
310 type record Profile1_IR_header /* p.45 */ /* p.91 */
311 {
312 INT14b_BO_LAST cid,
313 BIT7 type_ind, /* Must be '1111110'B */
314 BIT1 d,
315 LIN1 profile, /* Must be 1 */
316 LIN1 crc,
317 Static_Chain stat_chain,
318 Dynamic_Chain dyn_chain optional
319 };
320
321 type record Profile1_IR_DYN_header /* p.46 */ /* p.92 */
322 {
323 INT14b_BO_LAST cid,
324 BIT8 type_ind, /* Must be '11111000'B */
325 LIN1 profile, /* Must be 1 */
326 LIN1 crc,
327 Dynamic_Chain dyn_chain
328 };
329
330 type record Profile1_R_0_header /* p.74 */
331 {
332 INT14b_BO_LAST cid,
333 BIT2 type_ind, /* Must be '00'B */
334 INT6b sn
335 };
336
337 type record Profile1_R_0_CRC_header /* p.74 */
338 {
339 INT14b_BO_LAST cid,
340 BIT2 type_ind, /* Must be '01'B */
341 INT7b sn,
342 INT7b crc
343 };
344
345 type record Profile1_UO_0_header /* p.75 */
346 {
347 INT14b_BO_LAST cid,
348 BIT1 type_ind, /* Must be '0'B */
349 INT4b sn,
350 INT3b crc
351 };
352
353 type record Profile1_R_1_header /* p.75 */
354 {
355 INT14b_BO_LAST cid,
356 BIT2 type_ind, /* Must be '10'B */
357 INT6b sn,
358 BIT1 m_bit,
359 BIT1 x_bit,
360 INT6b ts
361 };
362
363 type record Profile1_R_1_ID_header /* p.75 */
364 {
365 INT14b_BO_LAST cid,
366 BIT2 type_ind, /* Must be '10'B */
367 INT6b sn,
368 BIT1 m_bit,
369 BIT1 x_bit,
370 BIT1 t_bit, /* Must be '0'B */
371 INT5b ip_id
372 };
373
374 type record Profile1_R_1_TS_header /* p.75 */
375 {
376 INT14b_BO_LAST cid,
377 BIT2 type_ind, /* Must be '10'B */
378 INT6b sn,
379 BIT1 m_bit,
380 BIT1 x_bit,
381 BIT1 t_bit, /* Must be '1'B */
382 INT5b ts
383 };
384
385 type record Profile1_UO_1_header /* p.76 */
386 {
387 INT14b_BO_LAST cid,
388 BIT2 type_ind, /* Must be '10'B */
389 INT6b ts,
390 BIT1 m_bit,
391 INT4b sn,
392 INT3b crc
393 };
394
395 type record Profile1_UO_1_ID_header /* p.76 */
396 {
397 INT14b_BO_LAST cid,
398 BIT2 type_ind, /* Must be '10'B */
399 BIT1 t_bit, /* Must be '0'B */
400 INT5b ip_id,
401 BIT1 x_bit,
402 INT4b sn,
403 INT3b crc
404 };
405
406 type record Profile1_UO_1_TS_header /* p.76 */
407 {
408 INT14b_BO_LAST cid,
409 BIT2 type_ind, /* Must be '10'B */
410 BIT1 t_bit, /* Must be '1'B */
411 INT5b ts,
412 BIT1 m_bit,
413 INT4b sn,
414 INT3b crc
415 };
416
417 type record Profile1_UOR_2_header /* p.77 */
418 {
419 INT14b_BO_LAST cid,
420 BIT3 type_ind, /* Must be '110'B */
421 INT6b ts,
422 BIT1 m_bit,
423 INT6b sn,
424 BIT1 x_bit,
425 INT7b crc
426 };
427
428 type record Profile1_UOR_2_ID_header /* p.77 */
429 {
430 INT14b_BO_LAST cid,
431 BIT3 type_ind, /* Must be '110'B */
432 INT5b ip_id,
433 BIT1 t_bit, /* Must be '0'B */
434 BIT1 m_bit,
435 INT6b sn,
436 BIT1 x_bit,
437 INT7b crc
438 };
439
440 type record Profile1_UOR_2_TS_header /* p.77 */
441 {
442 INT14b_BO_LAST cid,
443 BIT3 type_ind, /* Must be '110'B */
444 INT5b ts,
445 BIT1 t_bit, /* Must be '1'B */
446 BIT1 m_bit,
447 INT6b sn,
448 BIT1 x_bit,
449 INT7b crc
450 };
451
452 type record Short_Seqnum /* p.120 */
453 {
454 BIT1 ind, /* Must be '0'B */
455 INT7b lsb_of_seqnum
456 };
457
458 type record Long_Seqnum /* p.120 */
459 {
460 BIT1 ind, /* Must be '1'B */
461 INT31b_BO_LAST lsb_of_seqnum
462 };
463
464 type union AEGSeqnum /* p.112 */
465 {
466 Short_Seqnum short_form,
467 Long_Seqnum long_form
468 };
469
470 type record XI_Item4_r /* p.121 */
471 {
472 BIT1 x_ind,
473 INT3b index
474 };
475
476 type record XI_Item8_r /* p.121 */
477 {
478 BIT1 x_ind,
479 INT7b index
480 };
481
482 type record of XI_Item4_r XI_Item4;
483
484 type record of XI_Item8_r XI_Item8;
485
486 type union XI_list /* p.113 */
487 {
488 XI_Item4 xi_item4,
489 XI_Item8 xi_item8
490 };
491
492 type record IPv6_ext_item
493 {
494 LIN1 nexthead,
495 LIN1 hdr_ext_len,
496 octetstring data
497 }
498
499 type record MINE_item {
500 LIN1 protocol,
501 BIT1 s_bit,
502 ROHC_BIT7_BO_LAST reserved,
503 LIN2_BO_LAST cksum,
504 OCT4 dstaddr,
505 OCT4 srcaddr optional
506 } with {
507 variant "FIELDORDER(msb)";
508 variant (srcaddr) "PRESENCE(s_bit = '1'B)";
509 }
510
511/* TODO: check why better use INTn intead of OCTn */
512 type record AH_item /* RFC 2402, p.3 */
513 {
514 LIN1 nexthead, /* Must be 51 */
515 LIN1 payload_len,
516 LIN2_BO_LAST reserved, /* Must be 0 */
517 LIN4_BO_LAST spi,
518 LIN4_BO_LAST sn,
519 octetstring auth_data optional
520 }
521
522 type record ESP_item
523 {
524 LIN1 nexthead, /* Must be 50 */
525 LIN4_BO_LAST spi,
526 LIN4_BO_LAST sn
527 }
528
529 type record GRE_item
530 {
531 LIN1 nexthead, /* Must be 47 */
532 BIT1 C_bit,
533 BIT1 reserved_1, /* Must be '0'B */
534 BIT1 K_bit,
535 BIT1 S_bit,
536 BIT1 reserved_2, /* Must be '0'B */
537 BIT3 version,
538 LIN2_BO_LAST cksum optional,
539 LIN4_BO_LAST key optional,
540 LIN4_BO_LAST sn optional
541 }
542
543 type union Item
544 {
545 IPv6_ext_item ipv6_ext_item,
546 AH_item ah_item,
547 ESP_item esp_item,
548 GRE_item gre_item,
549 MINE_item mine_item
550/* TODO CHECK: could we use it ?
551 octetstring any_item */
552 }
553
554 type record of Item IP_Item_list;
555
556 type record of OCT4n CSRC_Item_list;
557
558 /* TODO: temporary solution for profile4 tests */
559 type record of octetstring RAW_data;
560
561 type union Item_list
562 {
563 CSRC_Item_list csrc_item_list,
564 IP_Item_list ip_item_list,
565 /* TODO: temporary solution for profile4 tests */
566 RAW_data raw_data
567 }
568
569 type record Enc_Type_0 /* p.112 */
570 {
571 BIT2 et, /* Must be '00'B */
572 BIT1 gp_bit,
573 BIT1 ps_bit,
574 INT4b cc,
575 LIN1 gen_id optional,
576 XI_list xi_list optional,
577 BIT4 padding optional, /* Must be '0000'B */
578 Item_list item_list optional
579 };
580
581 type record Enc_Type_1 /* p.114 */
582 {
583 BIT2 et, /* Must be '01'B */
584 BIT1 gp_bit,
585 BIT1 ps_bit,
586 INT4b xi1,
587 LIN1 gen_id optional,
588 LIN1 ref_id,
589 octetstring insbitmask,
590 XI_list xi_list optional,
591 BIT4 padding optional, /* Must be '0000'B */
592 Item_list item_list optional
593 };
594
595 type record Enc_Type_2 /* p.115 */
596 {
597 BIT2 et, /* Must be '10'B */
598 BIT1 gp_bit,
599 BIT1 res,
600 INT4b count,
601 LIN1 gen_id optional,
602 LIN1 ref_id,
603 octetstring rembitmask
604 };
605
606 type record Enc_Type_3 /* p.115 */
607 {
608 BIT2 et, /* Must be '11'B */
609 BIT1 gp_bit,
610 BIT1 ps_bit,
611 INT4b xi1,
612 LIN1 gen_id optional,
613 LIN1 ref_id,
614 octetstring rembitmask,
615 octetstring insbitmask,
616 XI_list xi_list optional,
617 BIT4 padding optional, /* Must be '0000'B */
618 Item_list item_list optional
619 };
620
621 type record IPv4_Static /* p.94 */
622 {
623 INT4b version, /* Must be '0100'B */
624 INT4b reserved, /* Must be '0000'B */
625 LIN1 proto,
626 OCT4 srcaddr,
627 OCT4 dstaddr
628 };
629
630 type record IPv4_Dynamic /* p.94 */
631 {
632 LIN1 tos,
633 LIN1 ttl,
634 LIN2_BO_LAST identification,
635 BIT1 df_bit,
636 BIT1 rnd_bit,
637 BIT1 nbo_bit,
638 BIT5 reserved, /* Must be '00000'B */
639 Enc_Type_0 genextheadlist
640 };
641
642 type record IPv6_Static /* p.93 */
643 {
644 INT4b version, /* Must be '0110'B */
645 INT20b_BO_LAST flowlabel,
646 LIN1 nexthead,
647 OCT16 srcaddr,
648 OCT16 dstaddr
649 };
650
651 type record IPv6_Dynamic /* p.93 */
652 {
653 LIN1 trafficclass,
654 LIN1 hoplimit,
655 Enc_Type_0 genextheadlist
656 };
657
658 type record UDP_Static /* p.95 */
659 {
660 LIN2_BO_LAST srcport,
661 LIN2_BO_LAST dstport
662 };
663
664 type record UDP_Dynamic /* p.95 */
665 {
666 LIN2_BO_LAST cksum
667 };
668
669 type record RTP_Static /* p.96 */
670 {
671 OCT4 ssrc
672 };
673
674 type record Rx_Field /* p.96 */
675 {
676 BIT3 reserved, /* Must be '000'B */
677 BIT1 xbit,
678 INT2b mode,
679 BIT1 tisbit,
680 BIT1 tssbit
681 };
682
683 type record RTP_Dynamic /* p.96 */
684 {
685 INT2b vfield, /* Must be '10'B */
686 BIT1 pbit,
687 BIT1 rxbit,
688 INT4b ccfield,
689 BIT1 mbit,
690 INT7b ptfield,
691 LIN2_BO_LAST rtpseqnum,
692 LIN4_BO_LAST rtpts,
693 Enc_Type_0 gencsrclist,
694 Rx_Field rx_field optional,
695 integer ts_stride optional,
696 integer time_stride optional
697 };
698
699 type record ESP_Static /* p.97 */
700 {
701 LIN4_BO_LAST spi
702 };
703
704 type record ESP_Dynamic /* p.97 */
705 {
706 LIN4_BO_LAST seqnum
707 };
708
709 type union Compr_head_list /* p.112 */
710 {
711 Enc_Type_0 enctype0,
712 Enc_Type_1 enctype1,
713 Enc_Type_2 enctype2,
714 Enc_Type_3 enctype3
715 };
716
717 type record IP_Ext_heads /* p.111 */
718 {
719 BIT1 cl,
720 BIT1 aseq,
721 BIT1 eseq,
722 BIT1 gseq,
723 BIT4 res,
724 AEGSeqnum ah_seq optional,
725 AEGSeqnum esp_seq optional,
726 AEGSeqnum gre_seq optional,
727 Compr_head_list compr_head_list optional
728 };
729
730 type record Outer_IP_fields /* p.82 */
731 {
732 LIN1 tos optional,
733 LIN1 ttl optional,
734 LIN1 proto optional,
735 IP_Ext_heads ext_heads optional,
736 LIN2_BO_LAST ip_id optional
737 };
738
739 type record Outer_IP_flags /* p.81 */
740 {
741 BIT1 tos2,
742 BIT1 ttl2,
743 BIT1 df2,
744 BIT1 pr2,
745 BIT1 ipx2,
746 BIT1 nbo2,
747 BIT1 rnd2,
748 BIT1 i2_bit
749 };
750
751 type record Inner_IP_fields /* p.81 */
752 {
753 LIN1 tos optional,
754 LIN1 ttl optional,
755 LIN1 proto optional,
756 IP_Ext_heads ext_heads optional
757 };
758
759 type record Inner_IP_flags /* p.80 */
760 {
761 BIT1 tos,
762 BIT1 ttl,
763 BIT1 df,
764 BIT1 pr,
765 BIT1 ipx,
766 BIT1 nbo,
767 BIT1 rnd_bit,
768 BIT1 ip2_bit
769 };
770
771 type record RTP_flags
772 {
773 BIT1 r_p,
774 INT7b rtp_pt
775 }
776
777 type record RTP_flags_fields /* p.82 */
778 {
779 INT2b mode,
780 BIT1 r_pt,
781 BIT1 m_bit,
782 BIT1 r_x,
783 BIT1 csrc,
784 BIT1 tss,
785 BIT1 tis,
786 RTP_flags flags optional,
787 Compr_head_list csrc_list optional,
788 integer ts_stride optional,
789 integer time_stride optional
790 }
791
792 type record Extension0 /* p.79 */
793 {
794 BIT2 ext_type, /* Must be '00'B */
795 INT3b sn,
796 INT3b plust
797 }
798
799 type record Extension1 /* p.79 */
800 {
801 BIT2 ext_type, /* Must be '01'B */
802 INT3b sn,
803 INT3b plust,
804 LIN1 minust
805 };
806
807 type record Extension2 /* p.79 */
808 {
809 BIT2 ext_type, /* Must be '10'B */
810 INT3b sn,
811 INT11b_BO_LAST plust,
812 LIN1 minust
813 };
814
815 type record Extension3 /* p.79 */
816 {
817 BIT2 ext_type, /* Must be '11'B */
818 BIT1 s_bit,
819 BIT1 r_ts_bit,
820 BIT1 tsc_bit,
821 BIT1 i_bit,
822 BIT1 ip_bit,
823 BIT1 rtp_bit,
824 Inner_IP_flags inner_ip_flags optional,
825 Outer_IP_flags outer_ip_flags optional,
826 LIN1 sn optional,
827 integer ts optional,
828 /* This field contains the length of the SDVL encoded TS value counted in
829 octets. */
830 integer ts_length optional,
831 Inner_IP_fields inner_ip_hdr optional,
832 LIN2_BO_LAST ip_id optional,
833 Outer_IP_fields outer_ip_hdr optional,
834 RTP_flags_fields rtp_fl_fi optional
835 };
836
837 type union Profile1_Extension /* p.79 */
838 {
839 Extension0 ext0,
840 Extension1 ext1,
841 Extension2 ext2,
842 Extension3 ext3
843 };
844
845 //Profile2
846
847 type record Profile2_headers /* p.77 */
848 {
849 Profile2_base_header base_header,
850 Profile2_Extension ext optional,
851 LIN2_BO_LAST ip_id_outer optional,
852 octetstring ah_outer optional,
853 LIN2_BO_LAST gre_cksum1 optional,
854 LIN2_BO_LAST ip_id_inner optional,
855 octetstring ah_inner optional,
856 LIN2_BO_LAST gre_cksum2 optional,
857 LIN2_BO_LAST udp_cksum optional
858 };
859
860 type union Profile2_base_header
861 {
862 Profile2_IR_header ir,
863 Profile2_IR_DYN_header ir_dyn,
864 Profile1_R_0_header r_0,
865 Profile1_R_0_CRC_header r_0_crc,
866 Profile1_UO_0_header uo_0,
867 Profile2_R_1_header r_1,
868 Profile2_UO_1_header uo_1,
869 Profile2_UOR_2_header uor_2
870 };
871
872 type union Profile2_Static_Chain_u
873 {
874 IPv4_Static ipv4_stat,
875 IPv6_Static ipv6_stat,
876 UDP_Static udp_stat
877 };
878
879 type record Profile2_UDP_Dynamic
880 {
881 LIN2_BO_LAST cksum,
882 LIN2_BO_LAST udp_sn
883 };
884
885 type union Profile2_Dynamic_Chain_u
886 {
887 IPv4_Dynamic ipv4_dyn,
888 IPv6_Dynamic ipv6_dyn,
889 Profile2_UDP_Dynamic udp_dyn
890 };
891
892 type record of Profile2_Static_Chain_u Profile2_Static_Chain;
893
894 type record of Profile2_Dynamic_Chain_u Profile2_Dynamic_Chain;
895
896 type record Profile2_IR_header
897 {
898 INT14b_BO_LAST cid,
899 BIT7 type_ind, /* Must be '1111110'B */
900 BIT1 d,
901 LIN1 profile, /* Must be 2 */
902 LIN1 crc,
903 Profile2_Static_Chain stat_chain,
904 Profile2_Dynamic_Chain dyn_chain optional
905 };
906
907 type record Profile2_IR_DYN_header /* p.46 */ /* p.92 */
908 {
909 INT14b_BO_LAST cid,
910 BIT8 type_ind, /* Must be '11111000'B */
911 LIN1 profile, /* Must be 2 */
912 LIN1 crc,
913 Profile2_Dynamic_Chain dyn_chain
914 };
915
916 type record Profile2_R_1_header
917 {
918 INT14b_BO_LAST cid,
919 BIT2 type_ind, /* Must be '10'B */
920 INT6b sn,
921 BIT1 x_bit,
922 INT7b ip_id
923 };
924
925 type record Profile2_UO_1_header
926 {
927 INT14b_BO_LAST cid,
928 BIT2 type_ind, /* Must be '10'B */
929 INT6b ip_id,
930 INT5b sn,
931 INT3b crc
932 };
933
934 type record Profile2_UOR_2_header
935 {
936 INT14b_BO_LAST cid,
937 BIT3 type_ind, /* Must be '110'B */
938 INT5b sn,
939 BIT1 x_bit,
940 INT7b crc
941 };
942
943 type record Profile2_Inner_IP_flags
944 {
945 BIT1 tos,
946 BIT1 ttl,
947 BIT1 df,
948 BIT1 pr,
949 BIT1 ipx,
950 BIT1 nbo,
951 BIT1 rnd_bit,
952 BIT1 reserved /* Must be '0'B */
953 };
954
955 type union Profile2_Extension
956 {
957 Profile2_Extension0 ext0,
958 Profile2_Extension1 ext1,
959 Profile2_Extension2 ext2,
960 Profile2_Extension3 ext3
961 };
962
963 type record Profile2_Extension0
964 {
965 BIT2 ext_type, /* Must be '00'B */
966 INT3b sn,
967 INT3b ip_id
968 }
969
970 type record Profile2_Extension1
971 {
972 BIT2 ext_type, /* Must be '01'B */
973 INT3b sn,
974 INT11b_BO_LAST ip_id
975 };
976
977 type record Profile2_Extension2
978 {
979 BIT2 ext_type, /* Must be '10'B */
980 INT3b sn,
981 INT11b_BO_LAST ip_id2,
982 LIN1 ip_id
983 };
984
985 type record Profile2_Extension3
986 {
987 BIT2 ext_type, /* Must be '11'B */
988 BIT1 s_bit,
989 INT2b mode,
990 BIT1 i_bit,
991 BIT1 ip_bit,
992 BIT1 ip2_bit,
993 Profile2_Inner_IP_flags inner_ip_flags optional,
994 Outer_IP_flags outer_ip_flags optional,
995 LIN1 sn optional,
996 Inner_IP_fields inner_ip_hdr optional,
997 LIN2_BO_LAST ip_id optional,
998 Outer_IP_fields outer_ip_hdr optional
999 };
1000
1001 //Profile4
1002
1003 type record Profile4_headers
1004 {
1005 Profile4_base_header base_header,
1006 Profile2_Extension ext optional,
1007 LIN2_BO_LAST ip_id_outer optional,
1008 octetstring ah_outer optional,
1009 LIN2_BO_LAST gre_cksum1 optional,
1010 LIN2_BO_LAST ip_id_inner optional,
1011 octetstring ah_inner optional,
1012 LIN2_BO_LAST gre_cksum2 optional,
1013 Profile4_Dynamic_Chain additional_IP optional
1014 };
1015
1016 type union Profile4_base_header
1017 {
1018 Profile4_IR_header ir,
1019 Profile4_IR_DYN_header ir_dyn,
1020 Profile1_R_0_header r_0,
1021 Profile1_R_0_CRC_header r_0_crc,
1022 Profile1_UO_0_header uo_0,
1023 Profile2_R_1_header r_1,
1024 Profile2_UO_1_header uo_1,
1025 Profile2_UOR_2_header uor_2
1026 };
1027
1028 type union Profile4_Static_Chain_u
1029 {
1030 IPv4_Static ipv4_stat,
1031 IPv6_Static ipv6_stat
1032 };
1033
1034 type record Profile4_IPv4_Dynamic
1035 {
1036 LIN1 tos,
1037 LIN1 ttl,
1038 LIN2_BO_LAST identification,
1039 BIT1 df_bit,
1040 BIT1 rnd_bit,
1041 BIT1 nbo_bit,
1042 BIT1 sid_bit,
1043 BIT4 reserved, /* Must be '0000'B */
1044 Enc_Type_0 genextheadlist
1045 };
1046
1047 type union Profile4_Dynamic_Chain_u
1048 {
1049 Profile4_IPv4_Dynamic ipv4_dyn,
1050 IPv6_Dynamic ipv6_dyn,
1051 LIN2_BO_LAST sn
1052 };
1053
1054 type record of Profile4_Static_Chain_u Profile4_Static_Chain;
1055
1056 type record of Profile4_Dynamic_Chain_u Profile4_Dynamic_Chain;
1057
1058 type record Profile4_IR_header
1059 {
1060 INT14b_BO_LAST cid,
1061 BIT7 type_ind, /* Must be '1111110'B */
1062 BIT1 d,
1063 LIN1 profile, /* Must be 4 */
1064 LIN1 crc,
1065 Profile4_Static_Chain stat_chain,
1066 Profile4_Dynamic_Chain dyn_chain optional
1067 };
1068
1069 type record Profile4_IR_DYN_header
1070 {
1071 INT14b_BO_LAST cid,
1072 BIT8 type_ind, /* Must be '11111000'B */
1073 LIN1 profile, /* Must be 4 */
1074 LIN1 crc,
1075 Profile4_Dynamic_Chain dyn_chain
1076 };
1077
1078} with { encode "RAW" }
1079