| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:52 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of M_PROTODescription: Manual PageKeywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpciM_PROTOSection: Linux Fast-STREAMS DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEM_PROTO - STREAMS protocol messageFORMATThe M_PROTO message block is a datab(9) structure and associated data buffer that contains unstructured data. (Any structure imposed on the M_PROTO data buffer is defined outside of STREAMS.) An M_PROTO message is a normal priority message that consists of one or more M_PROTO message blocks followed by zero or more M_DATA(9) message blocks. INTERFACEDESCRIPTIONThe M_PROTO message is intended to contain control information and associated data. The message format is one or more M_PROTO message blocks followed by zero or more M_DATA(9) message blocks. (Note that a user level process can only generate M_PROTO messages containing a single M_PROTO message block followed by one or more M_DATA(9) message blocks when using the putmsg(2) or putpmsg(2s) system calls.) The semantics of the M_PROTO and M_DATA(9) message blocks are determined by the STREAMS module that receives the message, and is normally defined as part of the service interface description between modules. For example, the Transport Provider Interface, tpi(7), describes the format of M_PROTO and M_DATA(9) message blocks contained in M_PROTO messages that are passed to a driver or module implementing the tpi(7) service interface. The service interface exists between the user level process and the receiving driver or module, or, between drivers and modules. The M_PROTO message block will normally contain service interface control information and the M_DATA(9) message blocks will normally contain service interface user data. M_PROTO messages are generally sent in both the downstream and upstream directions on a Stream. M_PROTO messages sent upstream and arriving at the Stream head are available to be read by user level processes using the read(2s), getmsg(2), or getpmsg(2s) system calls. M_PROTO messages can be sent downstream from the Stream head by a user level process using the putmsg(2), or putpmsg(2s) system calls. (The write(2s) cannot be used to generate M_PROTO messages.) When describing STREAMS-specific system calls, the contents of the M_PROTO message block is referred to as the control part, and any M_DATA(9) message blocks contained in the message are referred to collectively as the data part. For the getmsg(2), getpmsg(2s), putmsg(2), and putpmsg(2s) system calls, the control and data parts are passed separately. For the read(2s) system call, the control and data parts are optionally passed together, or the the control part is discarded. Although its use is not recommended, the format of M_PROTO and M_PCPROTO(9) (generically PROTO) messages sent upstream to the Stream head allows multiple PROTO blocks at the beginning of the message. getmsg(2), getpmsg(2s), and read(2s), will compact multiple PROTO blocks into a single control part, multiple M_DATA(9) blocks, as single data part, when passing them to the user process. The putmsg(2) and putpmsg(2s) system calls will never generate a M_PROTO message with more than one M_PROTO message block, but may generate M_PROTO messages that contain more than one M_DATA(9) message block. M_PROTO messages, by nature of the initial block message type, are normal (or priority) messages, and are, therefore, subject to flow control restrictions within a Stream. In contrast, the M_PCPROTO(9) message is a high priority message serving the same purpose, that is not subject to flow control restrictions. M_PROTO messages can be generated directly by user level processes using the putmsg(2) and putpmsg(2s) system calls. M_PROTO messages can be consumed by user level processes using the read(2s), getmsg(2), and getpmsg(2s) system calls. M_PROTO message can be generated by drivers and modules. USAGEM_PROTO and M_PCPROTO(9) messages are the work horses of a service interface under STREAMS. They are generated by both user level processes as well as drivers and modules. These messages normally represent service primitives within a service interface definition at a message passing boundary within a Stream. The M_PROTO data buffer usually has a defined structure with an initial member that identifies the service primitive, and additional members that provide the parameters associated with the service primitive. The M_DATA(9) data buffers that follow usually contain unstructured user data. EXAMPLESFor example, one service primitive definition from the Transport Provider Interface, tpi(7), the T_CONN_REQ(7) connection request primitive, is illustrated below:
The T_CONN_REQ(7) service primitive consists of one M_PROTO message blocks followed by zero or more M_DATA(9) blocks representing connection data. The format of the M_PROTO data buffer is the T_conn_req structure shown above. The first element of the structure, the PRIM_type is used to distinguish on M_PROTO message from another. In this case, the PRIM_type is always set to T_CONN_REQ to identify the connection request primitive. The T_conn_req structure definition is used both by user level processes accessing the tpi(7) service interface, as well as drivers or modules implementing the service interface. The following code fragment is an example of a user level process formulating and passing a connection request to a Stream.
Following code fragment is an example of a module generating a connection request and passing it downstream. In this case, the primitive is expedited (priority band 1).
In both code fragments, the same structure definition as part of a service interface definition is used by both the user level process and the STREAMS driver or module. This service interface definition is normally contained in a header file that is used by both kernel modules and user processes (in this example <sys/tihdr.h>). SEE ALSOread(2s), write(2s), getmsg(2), putmsg(2), getpmsg(2s), putpmsg(2s), datab(9), msgb(9). COMPATIBILITYThe M_PROTO STREAMS message is compatible with SVR 4.2 MP STREAMS, and implementations based on SVR 4.2, with the following portability considerations:
See STREAMS(9) for additional compatibility information. CONFORMANCEHISTORYThe M_PROTO message first appeared in SVR 3[2]. REFERENCES
TRADEMARKS
Other trademarks are the property of their respective owners. IDENTIFICATION
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
Index
This document was created by man2html, using the manual pages. Time: 11:32:57 GMT, May 22, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:52 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |