masterIoInit( )

NAME

masterIoInit( ) - create the IPC mechanism at the SNMP master agent

SYNOPSIS

STATUS masterIoInit ( void )

DESCRIPTION

This routine, called from snmpIoInit( ), creates the SNMP master agent side of the inter-process communication (IPC) mechanism used to carry messages between the subagents and the master agent. In this implementation, masterIoInit( ) creates a single message queue. The identity of this message queue is hard coded into every subagent. The subagent puts a message on this queue when it needs to send a message to the master agent.

The message queue created by masterIoInit( ) is monitored by tMonQue. The tMonQue task is one of the two tasks used to implement the SNMP master agent. The purpose of tMonQue is to note which messages in its queue are registration requests and which are responses to queries. If the message is a subagent registration request, tMonQue handles the request and sends a message back to the subagent telling it whether the registration was successful or not.

If the message is a response to a query, tMonQue transfers the message to the message queue monitored by tSnmpd. The tSnmpd task then encodes the response in an SNMP packet and transmits the packet over a socket to the SNMP manager.

Although the shipped version of this function uses message queues as the IPC between the master agent and its subagents, the IPC mechanism is isolated to the relatively small number functions defined in masterIoLib. Thus, if necessary, you should have little trouble porting the code to use an IPC more suitable to your transport needs.

For example, you could use sockets instead of message queues. However, if you decide to change the IPC mechanism, you must do so both in the master agent and in its subagents. This means that you must also modify the functions defined in saIoLib, the library that defines the agent side of the IPC mechanism.

RETURNS

OK or ERROR.

SEE ALSO

masterIoLib