{ DESCRIPTION: AMI Message System Definition File File: [Message]Message.typ AUTHOR: Jim Bostwick LAST EDIT: 20-OCT-1989 01:47:22 History: 20-OCT-1989 JMB Dropped useless router_node field, plus both user-flag and user-protocol fields. Presumably these are adequately covered by id and sub... 18-OCT-1989 JMB Incorporate MSGPACKET.TYP into unified Message_rec record. 9-OCT-1989 JMB Major happy munging... Add Auto_size flag 7-OCT-1988 JMB Delete MSG_Size, Msg_Ptr 4-OCT-1988 JMB Add Msg_Ptr type **** Last PTH Edit to MSGPACKET.TYP ---- 8-Aug-89. Philip Hannay. Added "SCALE_" prefix to PK_SCALE fields, changed PK_RECORD length count to words from bytes. **** It is assumed that PAS$EXT:GENERAL.TYP and PAS$EXT:STRING.PKG precede this include file. } {*USER* The message system uses a combination of the RSX Variable Send/Receive directives and custom DECNET server tasks to provide node-transparent intertask messaging for Pascal programs. DECNET and the server tasks are only involved as required (e.g. across nodes). Otherwise, simple RSX VSRD directives are employed. This avoids unnecessary DECNET overhead. Messages are of type MESSAGE_REC, which consists of a uniform header part, and a major-league variant record part. This record essentially consists of a MESSAGE_PACKET_TYPE record grafted onto the required header fields. The message procedures all begin with the letters "MS", and all scalar types begin with the letters "Msg_" and record types begin with "Message_". } {*WIZARD Immediately following is a portion to be extracted into a MACRO-11 include file which defines portions of the Message_rec as macro offsets. Use this extract with PASMAC for the macro externals. } {**** Extract the following into file [MESSAGE]MESSAGE.MAC for use by the external macro sources! ; ; Sorry, but these have to be manually kept in synch with the ; Message_rec and it's subtypes. ; ; Define the Message Record. This differs from the Pascal record ; definition in MESSAGE.TYP only in that an additional address is ; always appended to the header. The net effect of all pascal ; message records is the same. ; RECORD MSG Field rtr, 2*Integer Field stsk, 2*Integer Field snode, 6*CHAR Field dtsk, 2*Integer Field dnode, 6*CHAR Field prot, Integer Field flags, Integer Field Msgsiz, Integer Field pkid, Integer ; packed id Field pksub, 2*Integer ; packed sub-id Field body, 200.*CHAR ; what a hack Field msnd, char ; marker - NOT a real field ENDREC ; max message size bdymax = 206. ; max body size ; Message flag definitions ; msg_flags: prefix = MF. ; Msg_Flag_typ = (Msg_Router_Ctrl, Msg_Run_Dest,Msg_Wake_Dest,Msg_Auto_Size); mf.rct = 1 mf.run = 2 mf.wak = 4 mf.siz = 10 ; Packet Type definitions - Must match Msg_packet_id_type pk.msc = 0 ; misc message - always the first id pk.dbg = 1. ; modify your debug mode pk.mon = 2. ; modify your monitor mode pk.vew = 3. ; modify your view (single step) mode pk.ish = 4. ; short general info le 20 bytes pk.ilg = 5. ; long general info gt 20 bytes pk.cco = 6. ; review your current configuration pk.oab = 7. ; you stop as soon as possible pk.wak = 8. ; wake me up or notify me of events pk.lit = 9. ; send this to a device verbatim pk.ACK = 10. ; I sent transaction to device = it ACKed pk.NAK = 11. ; I sent transaction to device = it NAKed pk.res = 12. ; do something about a resource pk.id = 13. ; general identity info pk.gat = 14. ; general gate info pk.rpt = 15. ; report your status pk.syn = 16. ; synchronize with eachother pk.scl = 17. ; general scale info pk.css = 18. ; control system symbol info pk.csa = 19. ; control sys alpha value pk.csn = 20. ; control sys numeric value(s) pk.bin = 21. ; general bin info pk.val = 22. ; field name = value and status pk.rec = 23. ; generic record field pk.r9 = 24. pk.r10 = 25. pk.r11 = 26. pk.r12 = 27. pk.r13 = 28. pk.r14 = 29. pk.r15 = 30. pk.r16 = 31. pk.r17 = 32. pk.r18 = 33. pk.r19 = 34. pk.r20 = 35. pk.r21 = 36. pk.r22 = 37. pk.r23 = 38. pk.com = 39. ; general comment ; ; now the site/system specific packets ; pk.pth = 40. ; used in NSSO/NDT (NN) system ; and the trailer - always present = AMI generic pk.unk = 41. ; unrecognized = always last id ; ; Message.packet.sub.type - must track pascal definition. ; ps.ack = 0 ; you asked for ack = I got your packet ps.nak = 1. ; you asked for ack = I don't do these ps.arq = 2. ; you ack this packet on receipt ps.rqi = 3. ; you send me info ps.fsi = 4. ; you fill in some/all info = return to me ps.noi = 5. ; I give you no info - couldn't find any ps.soi = 6. ; I give you partial info ps.fui = 7. ; I give you complete info ps.sta = 8. ; you start something at beginning ps.sto = 9. ; you stop something in progress ps.res = 10. ; you continue on from stop ps.fin = 11. ; you finish and end something ps.eve = 12. ; event occurred = I notify you ps.all = 13. ; can I have it? ps.gra = 14. ; I give it to you ps.den = 15. ; I cannot give it to you ps.exe = 16. ; you execute something ps.ope = 17. ; you open a channel ps.get = 18. ; you get something = send it to me ps.put = 19. ; here is something = you put it away ps.clo = 20. ; you close a channel ps.wat = 21. ; watch for change = let me know ps.nfw = 22. ; I cannot do what you asked ps.r3 = 23. ; spare ps.r4 = 24. ; spare ps.r5 = 25. ; spare ps.r6 = 26. ; spare ps.r7 = 27. ; spare ps.r8 = 28. ; spare ps.r9 = 29. ; spare ps.r10 = 30. ; spare ps.r11 = 31. ; spare ****} { The next series of definitions are for the 'header' portion of the message record. Although no longer a separate record, the 'header' is used to control routing and destination actions for messages. } { The following constant is convenient in several message procedures. } CONST Null_task_name = RAD56(0,0); { Transmission control flags. These specifically effect the transmission and routing of messages. MSG_USER_FLAGs are reserved for user-defined control functions. } TYPE Msg_Flag_typ = ( Msg_Router_Ctrl, { this message for router itself } Msg_Run_Dest, { run destination task before send } Msg_Wake_Dest, { wake (unstop) destination task after send } Msg_Auto_Size { call MSSIZE before each send } ); Msg_Flag_set = SET OF Msg_Flag_typ; { The following are message packet ids that can be used to identify a message packet contents. The first 40 packet types are defined as generic types so that they will map the same packets used on all AMI systems. The packet types after that point (following pk_comment) will be site or system specific. At this time, they will be unique for all locations. At some future time, we may need to change MSGPACKET.TYP from a "general" to a "site specific" type file to allow for a wider variety of message packets. At that future time we will still retain the first 40 packets as generic so that different systems can still communicate if they restrict themseleves to the first 40 packets. The packet type "pk_unknown" will always be the last packet type on all systems. This lets us do an ord(pk_unknown) to find out packet range.} { NOTE - old style packets begin with "@", that will translate into the 65th element of the packet id type. If we ever need it, we will define it as such in a site specific packet. } Type { Message packet ids identify the general type of message packet. The comments are from the sender's point of view } Message_packet_id_type = ( { from here to pk_comment are AMI generic } pk_misc, { misc message, always the first id } pk_debug, { modify your debug mode } pk_monitor, { modify your monitor mode } pk_view, { modify your view (single step) mode } pk_info_short, { short general info le 20 bytes } pk_info_long, { long general info gt 20 bytes } pk_check_config, { review your current configuration } pk_orderly_abort, { you stop as soon as possible } pk_wake_up_sender, { wake me up or notify me of events } pk_send_as_is, { send this to a device verbatim} pk_ACKed_transaction, { I sent transaction to device, it ACKed } pk_NAKed_transaction, { I sent transaction to device, it NAKed } pk_resource, { do something about a resource } pk_identity, { general identity info } pk_gate, { general gate info } pk_report_status, { report your status } pk_synch, { synchronize with eachother } pk_scale, { general scale info } pk_control_symbol, { control system symbol info } pk_control_alpha, { control sys alpha value } pk_control_numeric, { control sys numeric value(s) } pk_bin, { general bin info } pk_field_value, { field name, value and status } pk_record, { generic record field } pk_reserved9, pk_reserved10, pk_reserved11, pk_reserved12, pk_reserved13, pk_reserved14, pk_reserved15, pk_reserved16, pk_reserved17, pk_reserved18, pk_reserved19, pk_reserved20, pk_reserved21, pk_reserved22, pk_reserved23, pk_comment, { general comment } { now the site/system specific packets } pk_phil, { used in NSSO/NDT (NN) system } { and the trailer - always present, AMI generic } pk_unknown { unrecognized, always last id } ); { Message paacket sub types further modify the message packet id. The comments are from the sender's point of view. There is a maxium of 32 elements that we can define in the set without changing the message packet record length. } Message_packet_sub_type = ( ps_ack, { you asked for ack, I got your packet } ps_nak, { you asked for ack, I don't do these } ps_ack_requested, { you ack this packet on receipt } ps_req_info, { you send me info } ps_fill_info, { you fill in some/all info, return to me} ps_no_info, { I give you no info - couldn't find any} ps_some_info, { I give you partial info } ps_full_info, { I give you complete info } ps_start, { you start something at beginning} ps_stop, { you stop something in progress } ps_resume, { you continue on from stop } ps_finish, { you finish and end something } ps_event, { event occurred, I notify you } ps_allocate, { can I have it? } ps_grant, { I give it to you } ps_deny, { I cannot give it to you } ps_execute, { you execute something } ps_open, { you open a channel } ps_get, { you get something, send it to me } ps_put, { here is something, you put it away } ps_close, { you close a channel } ps_watch, { watch for change, let me know } ps_nocando, { I cannot do what you asked } ps_reserved3, { spare } ps_reserved4, { spare } ps_reserved5, { spare } ps_reserved6, { spare } ps_reserved7, { spare } ps_reserved8, { spare } ps_reserved9, { spare } ps_reserved10,{ spare } ps_reserved11 { spare } ); Message_packet_sub_set = packed set of message_packet_sub_type; { Message_packet_type is a variant record allowing easy access to the contents of a message packet. In general we put the variable part of a message packet at the end of the record, allowing us to use byte/word count indicators to signal the actual length of the message for transmission purposes which can be used by the LENMSG routine in MSGPACKET.PAS to determine the actual message packet length (used). The variant part of the record can be up to 200 bytes, and will be word aligned. } Message_rec = RECORD Router : RAD56; { name of router or destination task } Src_Task : RAD56; { original sender name } Src_Node : Ch6; { original node name } Dest_Task: RAD56; { destination task name } Dest_Node : Ch6; { destination node name } Protocol: Word; { message system protocol number } Flags : Msg_Flag_set; Msg_Size: Word; { Body size in bytes} id: message_packet_id_type; sub: message_packet_sub_set; { here endeth the 'header'... } case message_packet_id_type of { from here to pk_comment are AMI generic } pk_misc: (value: ch200); pk_debug: (deb_level: char; { 0 thru 9 } deb_device: ch60); pk_monitor: (mon_level: char; { 0 thru 9 } mon_device: ch60); pk_view: (view_level: char; { 0 thru 9 } view_device: ch60); pk_info_short: (sinfo: ch20); pk_info_long: (linfo: str199); {type0 string} pk_check_config: (config_file: ch60); pk_orderly_abort: (); pk_wake_up_sender: (); pk_send_as_is: (content: str199); {type0 string} pk_ACKed_transaction: {ack from device} (ACK_content: str199); {type0} pk_NAKed_transaction: {nak from device} (NAK_content: str199); {type0} pk_resource: (resource_name: ch10; resource_owner: ch10; resource_detail: ch10); pk_identity: (ident: ch20); pk_gate: (gate_name: ch6; { name } gate_status: word; { status bits } gate_set: integer; { requested opening } gate_current: integer; { current opening } gate_max: integer; { maximum open except shakeout } gate_shake: integer); { shakeout percent } pk_report_status: (device_stat: ch60); pk_synch: (synch_text: ch10; synch_num: integer); pk_scale: (scale_order_type: char; { R or S } scale_header1: ch80; scale_header2: ch80; scale_product: ch4; scale_order_size: ch8; scale_draft_size: ch6; scale_gate_open: ch2); pk_control_symbol: (symbol_type: word; {word,float,...} symbol_name: ch18; {alpha name} symbol_DB: word; {database,station,node...} symbol_offset: word); {starting offset into database} pk_control_alpha: (alpha_type: word; {ascii, asciz,...} alpha_DB: word; {database,station,node...} alpha_offset: word; {starting offset into database} alpha_value: str193); {value} {type0 string} pk_control_numeric: (numeric_type: word; {word,float,...} numeric_DB: word; {database,station,node...} numeric_offset: word; {starting offset into database} numeric_len: integer; {word count of value(s)} numeric_value: array [1..96] of integer); {value(s)} pk_bin: (bin_name: ch6; { name } bin_status: word; { status bits } bin_level: integer; { measured from bottom } bin_height: integer; { max height measured from bottom } bin_cgrade: ch6; { grade code } bin_grade: ch10; { grade name } bin_sgrade: ch10; { subgrade name } bin_priority: char); { bin priority } pk_field_value: (field_name: ch6; { name } field_status: word; { free form status like attributes } field_term: word; { field terminator code } field_value: str80); { value (contents) } {type0 string} pk_record: (record_len: integer; { record length in 2byte words } record_value: array [1..99] of integer); { value } pk_reserved9: (); pk_reserved10: (); pk_reserved11: (); pk_reserved12: (); pk_reserved13: (); pk_reserved14: (); pk_reserved15: (); pk_reserved16: (); pk_reserved17: (); pk_reserved18: (); pk_reserved19: (); pk_reserved20: (); pk_reserved21: (); pk_reserved22: (); pk_reserved23: (); pk_comment: (comment: str199); {type0 string} { now the site/system specific packets } pk_phil: (philnote: ch60); { and the trailer - always present, AMI generic } pk_unknown: (); end; {record}