1 /* BEGIN INCLUDE FILE ... mseg_message.incl.pl1 */
 2 /* Created:  April 1985 by G. Palter from ms_block_hdr.incl.pl1 and ms_block_trailer.incl.pl1 */
 3 
 4 /* format: style3,linecom */
 5 
 6 /* NOTE: This include file references components of the mseg_segment structure which is defined separately in
 7    mseg_segment.incl.pl1.  Programs which use this include file must also include mseg_segment.incl.pl1 to prevent
 8    compilation errors. */
 9 
10 
11 /* Definition of the structure of a message stored in a message segment --
12 
13    When a message is added to a message segment, it is split into one or more fixed sized blocks.  These blocks are then
14    allocated in the blocks space of the message segment.  (See mseg_message.incl.pl1 and mseg_message_.pl1 for more
15    information).  Each block includes a header which records where the next block of the message, if any, resides and how
16    many bits of data is actually recorded in the block.
17 
18    In addition, the first block allocated for a message always includes a message descriptor.  This descriptor includes
19    various pieces of information about the message such as its total length, access class, author, etc. */
20 
21 
22 /* Definition of the header found in all message blocks */
23 
24 declare   1 message_block_header
25                               aligned based (mb_ptr),
26             2 next_block      fixed binary (18) unaligned unsigned,
27             2 descriptor_present                            /* ON => a descriptor is in the last 22 words of the block */
28                               bit (1) unaligned,
29             2 data_lth                                      /* ... in bits */
30                               fixed binary (17) unaligned unsigned;
31 
32 declare   mb_ptr              pointer;
33 
34 
35 /* Definition of the descriptor for a message recorded in the first block of the message */
36 
37 declare   1 message_descriptor
38                               aligned based (md_ptr),
39             2 sentinel        bit (36) aligned,             /* proves that this is a message descriptor */
40             2 message_chain,                                /* the chronological chain of messages in the segment */
41               3 next_message  fixed binary (18) unaligned unsigned,
42               3 prev_message  fixed binary (18) unaligned unsigned,
43             2 sender_level    fixed binary (3) unaligned unsigned,
44             2 pad1            bit (5) unaligned,
45             2 prev_message_in_hash_chain
46                               fixed binary (18) unaligned unsigned,
47             2 pad2            bit (10) unaligned,
48             2 ms_id           bit (72) aligned,
49             2 ms_len          fixed binary (24) unaligned unsigned,
50             2 pad3            bit (12) unaligned,
51             2 sender_id       char (32) aligned,
52             2 sender_authorization
53                               bit (72) aligned,
54             2 ms_access_class bit (72) aligned,
55             2 sender_max_authorization
56                               bit (72) aligned,
57             2 sender_process_id
58                               bit (36) aligned,
59             2 sender_audit    bit (36) aligned;
60 
61 declare   md_ptr              pointer;
62 
63 declare   MESSAGE_DESCRIPTOR_SENTINEL
64                               bit (36) aligned static options (constant) initial ("777777777777"b3);
65 
66 
67 /* Definition of the first block allocated for a message in a message segment */
68 
69 declare   1 first_message_block
70                               aligned based (mb_ptr),
71             2 header          aligned like message_block_header,
72             2 data_space,
73               3 data          bit (0 refer (first_message_block.data_lth)) unaligned,
74               3 pad           bit (36
75                               * (mseg_segment.block_size - currentsize (message_block_header)
76                               - currentsize (message_descriptor)) - first_message_block.data_lth) unaligned,
77             2 descriptor      aligned like message_descriptor;
78 
79 
80 /* Definition of all but the first block allocated for a message in a message segment */
81 
82 declare   1 other_message_block
83                               aligned based (mb_ptr),
84             2 header          aligned like message_block_header,
85             2 data_space,
86               3 data          bit (0 refer (other_message_block.data_lth)) unaligned,
87               3 pad           bit (36 * (mseg_segment.block_size - currentsize (message_block_header))
88                               - other_message_block.data_lth) unaligned;
89 
90 /* END INCLUDE FILE ... mseg_message.incl.pl1 */