ONC+ Developer's Guide

Message Formats

This section 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 Example F-2.

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. See "Message Classes". For Solaris, sc_size should always be set to 0.

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 acknowledgment

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 under "Message Classes". In Solaris, always set pm_maxclass to 1 and sc_size to 0.

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