DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Network services

The Service Access Controller

The SAC creates two environment variables for each port monitor it starts:


PMTAG
is set to a unique port monitor tag by the SAC. The port monitor uses this tag to identify itself in response to SAC messages.

ISTATE
is used to show to the port monitor what its initial internal state should be. ISTATE is set to ``enabled'' or ``disabled'' to show that the port monitor is to start in the enabled or disabled state, respectively. The SAC performs a periodic sanity poll of the port monitors.

The SAC communicates with port monitors through FIFOs. A port monitor should open _pmpipe, in the current directory, to receive messages from the SAC and ../_sacpipe to send return messages to the SAC.

``SAC messages'' describes the messages that may be sent from the SAC to a port monitor (SAC messages), and from a port monitor to the SAC (port monitor messages). These messages are sent through FIFOs and are in the form of C structures (see ``The sac.h header file'').

SAC messages

The format of messages from the SAC is defined by the structure sacmsg:

struct  sacmsg {
        int     sc_size;     /* size of optional data portion */
        char    sc_type;     /* type of message */
};
The SAC may send four types of messages to port monitors. The type of message is indicated by setting the sc_type field of the sacmsg structure to one of the following:

SC_STATUS
status request

SC_ENABLE
enable message

SC_DISABLE
disable message

SC_READDB
message indicating that the port monitor's _pmtab file should be read

sc_size indicates the size of the optional data part of the message. For System V Release 4, sc_size should always be set to 0. It is discussed in ``Message classes''.

A port monitor must respond to every message sent by the SAC.

Port monitor messages

The format of messages from a port monitor to the SAC is defined by the structure pmmsg:


struct  pmmsg {
     char    pm_type;      /* type of message */
     unchar  pm_state;     /* current state of port monitor */
     char    pm_maxclass;  /* maximum message class this
                              port monitor understands */
     char    pm_tag[PMTAGSIZE + 1];
                           /* port monitor's tag */
     int     pm_size;      /* size of optional data portion */
};
Port monitors may send two types of messages to the SAC. The type of message is indicated by setting the pm_type field of the pmmsg structure to one of the following:

PM_STATUS
state information

PM_UNKNOWN
negative acknowledgement
For both types of messages, the pm_tag field is set to the port monitor's tag and the pm_state field is set to the port monitor's current state. Valid states are:

PM_STARTING
starting

PM_ENABLED
enabled

PM_DISABLED
disabled

PM_STOPPING
stopping
The current state reflects any changes caused by the last message from the SAC.

The status message is the normal return message. The negative acknowledgment should be sent only when the message received is not understood.

pm_size indicates the size of the optional data part of the message. pm_maxclass is used to specify a message class. Both are discussed in ``Message classes''. For System V Release 4, pm_maxclass should always be set to 1 and sc_size should always be set to 0.

Port monitors may never initiate messages; they may only respond to messages that they receive.

Message classes

The concept of a message class has been included to accommodate possible SAF extensions. The messages described above are all class 1 messages. None of these messages contains a variable data portion; all pertinent information is contained in the message header.

If new messages are added to the protocol, they will be defined as new message classes (for example, class 2). The first message the SAC sends to a port monitor will always be a class 1 message. Since all port monitors, by definition, understand class 1 messages, the first message the SAC sends is guaranteed to be understood. In its response to the SAC, the port monitor sets the pm_maxclass field to the maximum message class number for that port monitor. The SAC will not send messages to a port monitor from a class with a larger number than the value of pm_maxclass. Requests that require messages of a higher class than the port monitor can understand will fail. For System V Release 4, pm_maxclass should always be set to 1.


NOTE: For any given port monitor, messages of class pm_maxclass and messages of all classes with values lower than pm_maxclass are valid. Thus, if the pm_maxclass field is set to 3, the port monitor understands messages of classes 1, 2, and 3.

Port monitors may not generate messages; they may only respond to messages. A port monitor's response must be of the same class as the originating message.

Since only the SAC can generate messages, this protocol will function even if the port monitor is capable of dealing with messages of a higher class than the SAC can generate.

pm_size (an element of the pmmsg structure) and sc_size (an element of the sacmsg structure) show the size of the optional data part of the message. The format of this part of the message is undefined. Its definition is inherent in the type of message. For System V Release 4, both sc_size and pm_size should always be set to 0.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004