SND - Send/Receive Packets Program ================================== SND is a generalised Send/Receive Task which allows you dynamically to create packets to send around the system, and to receive packets from other tasks and examine. For full details on the operation of SND consult the SND User's Manual. The basic action switches supported are:- /AL - Perform for all tasks /CL:y - Flush receive queue /DQ:y - Receive packet /ED:tx - Edit packet /ID - Use long prompts /IM - Define current task as task /LI:list - Display lists/status /OP:n - Repeat operations /PR - Temp task for receive /PS - Temp task for send /RC:y - Send pkt from rcv buf /RQ:p:s:g:o - Request task /SN:y - Send pkt from snd buf TKn:= - set task names /TR:n - Define task for receive /TS:n - Define task for send /WT:T:n:A - Delay operation For help on a given switch type HELP SND For a (very long) summary of all the function switches type HELP SND SUMMARY For help on Editing packets type HELP SND EDIT 2 SUMMARY This summarises the available commands in their order of execution. The following symbols are used in defining parameters for the functions: n - a positive integer, assumed to be octal unless terminated by a point (.). t - a packet buffer type where t = S - Send packet buffer R - Receive packet buffer x - a single packet buffer identification, being A,B,C,D,E,F,G, or H in the basic configuration. y - a list of up to 8 buffer identifications. The same identification may be repeated in the list. A command consists of one or more functions, terminated by a comma (,) an equals sign (=) or a carriage return (). Any number of commands may be supplied in one command line, but a command may not appear to the right of an equals sign. Task names must follow an equals and cannot precede it. /ED:tx - Select packet buffer for edit This function puts the user in edit mode. The function must be the only function in a command, and the command must be the last command in a command line. The default buffer selection is packet 'SA'. TKn:=task1, task2... - Set task name list This function sets the task names 'task1', 'task2' ... in the task name list entries n, n+1... The range of 'n' is 0 to 17 octal. The default value is 0. /TS:n - Define task name for send operations The task name which is in the entry 'n' of the task name list is used as the destination task for send operations. Default value of 'n' is 0. The range of 'n' is 0 to 17 octal. /TR:n - Define task name for receive operations The task name which is in the entry 'n' of the task name list defines the name of the task for which data packets will be dequeued. Default value of 'n' is 0. The range of 'n' is 0 to 17 octal. /IM - Define task name as this image The task name used in send or receive operations is the name of this image of 'SND'. This switch over-rides '/TS' and '/TR'. /PS:task - Define temporary send task name Packets are sent to the named task. This function over-rides '/IM' and '/TS'. The defined task name exists only for the current command. /PR:task - Define temporary receive task name Packets are dequeued only from the named task. This function over-rides '/IM' and '/TK'. The defined task name exists only for the current command. /WT:T:n:A - Delay This functon causes a delay to occur. Its point of execution depends on the value 'A'. The parameters are:- T = Units of delay T = Clock ticks S = Seconds M = Minutes n = Magnitude of delay A = Point of delay C = Before executing repeat functions (default) S = Before sending each data packet R = Before receiving each data packet P = Combines S and R /RC:y - Send packet from receive buffer This function allos a previously received packet to be forwarded to another task. The default receive buffer is buffer A. /SN:y - Send packet from send buffer This function will send a packet from a defined send buffer.The default send buffer is buffer A. /DQ:y - Receive data packet This function will attempt to receive a queued packet into a receive buffer. The default receive buffer is A. /RQ:p:s:g:o - Activate Task The specified task(s) are activated once during the command repeat sequence. The parameters and their defaults are: p - Partition name (GEN) s - Task's run priority (50) g - Group UIC (200) 0 - Owner UIC (200) /AL - Repeat for all tasks in task name list The repeatable operations (/WT,/RC,/SN and /DQ) are repeated for every task defined in the task name list. If the functions '/IM' or '/PR' are supplied, then the task name used for 'TK:0' is the name supplied by '/IM' or '/PR'. /OP:n - Repeat all operations The repeatable operations (/WT,/RC,/SN,/DQ and /AL) are repeated 'n' times. The range of 'n' is 1 to 99, the default value is 1. /CL:task - Flush receive queue All packets in the receive queue of this image of 'SND' are received into a temporary receive buffer. The queue is cleared and the packets are lost. If a task name is specified, packets are removed from the queue that originated from the named task. All other packets remain in the queue. /ID - Append prompts to task name The function and edit prompts are appended to the task name of this image of 'SND'. Thus, for each prompt, the task will identify itself. /-ID - Display basic prompts The basic prompts are displayed. This is the default condition. /LI:list - Display lists and statuses This function displays the lists and statuses that are maintained by 'SND'. The parameter may take the following values. ALL = Display all lists (default) ID = Display the task identification parameters TSK = Display the task name list PKT = Display the packet buffer usage statistics 2 /EDIT EDIT REQUEST (/ED:tx) This function must always be the only function in a command which must be the last or only command in a command line. The function changes the operation of 'SND' from function command processing to edit command processing. A particular packet can be selected to be available for editing on entry to edit mode by supplying the packet buffer identification as the parameter to the switch. The buffer identification consists of the buffer type, which must be one of the following two characters:- S = Send buffer R = Receive buffer and the buffer reference, which is any one of the reference letters defined in the task identification parameters. The default packet buffer that is selected is 'send buffer A' (SA). For a (long) summary of editing commands type HELP SND EDIT SUMMARY 3 SUMMARY The list of symbols below are used in this section to define the format and grammar of the edit commands. d Data type The legal data types are A = ASCII O = Octal R = Radix-50 f Data access mode The data access mode determines the method of data transfer. The legal access modes are: / = words \ = byte = use existing access mode o Packet ofset This value is always a positive octal number in the range of 0 to 31. It must always be an even number when word access mode is used or implied. r Repeat count This value defines the repeat range for repeatable operations. The legal range is 0 to 32 octal. The repeat is performed using the defined access mode, thus the values of (r + o) must not exceed the packet buffer limits. t Packet type The data packet type selects a group of packet buffers which are defined as: S = Send packet buffers R = Receive packet buffers v Data value This is the data that is to be entered into the addressed location. The method of interpretation is dependent upon the data type (r) and the access mode (f). x Packet buffer identification The required Send or Receive buffer is identified by the single ASCII character,which is A,B,C,D,E,F,G, or H in the standard task configuration. Two additional symbols are used to identify terminating characters. These characters may be used on any command, but only have any significance when supplying data in the sequential insert function (I). The symbols are:- = Carriage return = Escape or altmode When using the sequential insert function, or the mask function, a complete data word will always be displayed. However, if byte access mode is being used, then the word will be displayed as two successive bytes. When using this access mode, the first data value will set the first byte in the displayed word. If the second byte is required to be set, then the data value should be preceded by a comma(,). Command Function Performed d Dump current packet in the selected data type according to existing data access mode. dofv Set addressed location in packet buffer, using the defined access mode and interpreting the data (v) according to the defined data type. Iofd Open the addressed packet location for optional modification, according to the access mode and data type. If the data value is terminated by then open the next location. If the data value is terminated by then terminate this command function. Mfd Open the data mask for optional modification, according to the access mode and data type. Fofr Fill the current packet, starting at offset 'o' and the next 'r' locations from the mask, according to the selected access mode. Zofr Clear locations in the current packet starting at offset 'o' and the next 'r' locations, according to the selected access mode. B Change the access mode to bytes W Change the access mode to words L Display the current packet buffer identification as 'tx' and if present, an associated task name. X Exit from edit mode. Ct1x1o1=t2x2o2fr Copy 'r' successive words or bytes from the packet buffer 't2x2' starting at offset 'o2' to the packet buffer 't1x1' starting at offset 'o1'. Stx Select a packet buffer for edit. 2 TK ENTERING TASK NAMES IN THE TASK NAME LIST This command takes the following format:- TKn:=x..... This function is the only one which is not defined as a switch. It is always the first function processed during the execution of a command. The value of 'n' determines the task list entry that begins the task name set up. A number of task names can be supplied in one command line, each task name is separated from the next by a comma (,), the last task name is terminated by carriage return (). Two consecutive commas define a null task name and will cause the appropriate entry in the task name list to be cleared. Task names are entered into the list sequentially from the defined entry. The default entry identifier is zero (0). The legal range of 'n' is 0 to 17 octal (2 *(Total number of packet buffers) -1). 2 /TS Send to Defined Task (/TS:n) Data packets are sent to the task named in the task list, whose task list entry number is given by 'n' (Default = 0). The range of 'n' is the same as the range defined for entering task names in the task name list (0 to 17 octal). 2 /TR Receive from Defined Task (/TR:n) Data packets are received from the named task in the task list whose task list entry number is given by 'n' (default=0). The range of 'n' is the same as the range defined for entering task names in the task name list (0 to 17 octal). 2 /IM Send to and Receive from this Task Image (/IM) Data packets are sent to the sending task and are received only from the receiving task. Thus, the current image of 'SND' will send packets to itself and receive only its own packets. This function over-rides '/TS' and '/TR'. 2 /PS Send to Named Task (/PS:task) Data packets are sent to the task identified as the parameter in the switch. This task name is a temporary task name and is discarded after command processing is complete. This function over-rides '/IM' and '/TS' for send operations. 2 /PR Receive from Named Task (/PR:task) Data packets are received only from the task identified as the parameter in the switch. This task name is a temporary task name and is discarded after command processing is complete. This function over-rides '/TR' and '/IM' for receive operations. 2 /WT Mark Time (/WT:T:M:A) This function performs a delay for a defined period. Although this is the first of the repeatable functions to be processed, its point of execution depends upon the parameters supplied. The command parameters are:- T = Units of delay T = Clock ticks S = Seconds M = Minutes M = Magnitude of delay A = Point of delay C = Before executing repeat functions S = Before sending each data packet R = Before receiving each data packet P = Combines S and R 2 /RC Send a Packet from a Receive Buffer (/RC:list) A data packet is sent from a data packet receive buffer. This function allows received packets to be forwarded to another task. The parameter defines a list of receive buffers from which a packet is to be sent. A maximum of 'n' receive buffers can be specified, where 'n' is the total number of receive buffers available. A buffer may be specified more than once in the parameter specification. The default parameter is the single buffer identified as 'A'. 2 /SN Send a Packet from a Send Buffer (/SN:list) This function causes packets to be dispatched from a send buffer. The parameter defines a list of send buffers. A maximum of 'n' send buffers can be specified, where 'n' is the total number of send buffers available. A buffer may be specified more than once in the parameter specification. The default buffer identification is 'A'. 2 /DQ Dequeue a Packet (/DQ:list) A data packet is received into a receive buffer. The parameter defines a list of receive buffers. A maximum of 'n' buffers can be specified, where 'n' is the total number of receive buffers available. As with '/RC' and '/SN', a buffer may be specified more than once in the parameter list. The default buffer identification is 'A'. 2 /AL Repeat for all Defined Task Names (/AL) This function repeats all the repeatable functions for all tasks defined in the task name list. If either of the functions '/IM' or '/PR' are present in the command, then the first task name in the task name list (TL0:) is effectively replaced by the name implied or specified by the additional switch. The task name defined in TK0: is not used or changed by this function. 2 /RP Repeat Operations (/RP:n) All repeatable operations are repeated 'n' times. The legal range of 'n' is 1 to 99, the default value is 1. The two functions '/RP' and '/AL' should be used with care, since the total repeat count is 'n' * 'the number of task names defined'. Thus if 8 'send' packets, 8 'receive' packets, and a full task name list (containing 20 task names) and a maximum repeat count is specified, then the number of packets that will be sent is:- (8 + 8)*20 *99 = 31680 This is the maximum number of packets that can be sent. From this example it can be seen that the dynamic storge region can be easily and quickly consumed. Each data packet requires 18 words of the RSX-11M Dynamic Storage Region (DSR) whilst residing in a task receive queue. 2 /RQ Activate Task (/RQ:par:pri:grp:own) This function is performed only once for each task specified in the repeat sequence. No distinction is made between sending and receiving task names, except that a temporary receive task name is not used. With this function, it is possible for programs to be activated without having to perform any associated send or receive functions. The specified task is activated at the end of the first repeat operation for that task. The parameters to this function apply to every task that is specified in the operation and cannot be varied within a command. Defaults apply to each of the parameters and are only changed if specified by the user. The parameters are defined below and the default settings are enclosed in brackets. par - Partition name (GEN) pri - Task's run priority (50.) grp - Group UIC (200) own - Owner UIC (200) 2 /CL Flush the Receive Queue (/CL:task) This function de-queues all queued packets. They are received into a temporary buffer which is not available to the user and are effectively lost. If any packets are de-queued, then the number of packets flushed from the queue is repoted. If a task name is supplied as the parameter then only packets that have originated from the named task will be flushed from the queue. All remaining packets, if any, will remain queued to this image of SND. 2 /ID Alter the prompt (/ID) This function alters the prompting sequence of 'SND'. The function may be negated by repeating the function in another command, which defines the default prompts. The default function prompt is 'SND>' and the default edit prompt is '*'. The prompts are appended to the installed task name of the current image of 'SND'.Thus if the task name of 'SND' is 'XXX...', then the extended function prompt becomes:- 'XXX...SND>' and the extended edit prompt becomes:- 'XXX...*' 2 /LI List and Status Reports (/LI:type) The requested list or report is displayed on the TI: device. The parameter defines the option required, the default is 'ALL'. ALL - Display all lists and status reports. ID - Display task identification parameters. TSK - Display all task names in the task name list. PKT - Display the packet usage statistics, consisting of the buffer type and ID, the task name associated with the last send or receive opertion and the total send and receives performed using the idenfitied buffer.