mkDPIregister()--Make a DPI Register Packet


  Syntax
 #include <qtossapi.h>

 unsigned char     *mkDPIregister(
     unsigned short     timeout,
     long int           priority,
     char               *group_p,
     char               bulk_select);   


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The mkDPIregister() function makes a Distributed Protocol Interface (DPI®) register packet and returns a pointer to the packet.


Authorities and Locks

None.


Parameters

timeout
(Input) The requested timeout in seconds. An agent often has a limit for this value, and it will use that limit if this value is larger. The value zero has special meaning in the sense that it tells the agent to use the timeout value that was specified in the DPI OPEN packet.

priority
(Input) The requested priority, relative to other DPI subagents. This field may contain any of these values:
group_p
(Input) A pointer to a NULL-terminated character string that represents the subtree to be registered. This group ID must have a trailing dot.

bulk_select
(Input) Whether you want the agent to pass GETBULK on to the subagent or to map them into multiple GETNEXT requests. End of changeThis value is ignored. GETBULK requests are always mapped into multiple GETNEXT requests.End of change

Return Value

Be aware that the static buffer for the DPI packet is shared by other mkDPIxxxx() functions that create a serialized DPI packet.

For more information, see the Simple Network Management Protocol (SNMP) SupportLink to PDF manual.


Usage Notes

The mkDPIregister() function creates a serialized DPI REGISTER packet that can then be sent to the SNMP agent.

The SNMP agent will send a DPI response packet back to the subagent with a code that can be used to determine if the register request was successful. This will be one of the SNMP_ERROR_DPI_* return codes found in <qtossapi.h>. Following receipt of this response packet, the subagent will need to call the pDPIpacket() to parse the incoming DPI packet and to check the response packet error_code. Then, fDPIparse() would normally be called to free the parsed DPI packet.

If the response from the SNMP agent is SNMP_ERROR_DPI_higherPriorityRegistered, then a DPI subagent has already registered the same subtree at a higher priority than requested in this call. If so, this subagent will be contained in the subagent Management Information Base (MIB), and using an appropriate SNMP management application, you can determine its priority. You may want to consider requesting a higher priority or even -1 (best available) for your subagent.

If the response from the SNMP agent is SNMP_ERROR_DPI_alreadyRegistered, then the requested subtree registration was for a portion of the overall MIB that is supported by an SNMP agent directly or by other system-implemented programs. Generally, registration of any subtree root, which would have the effect of masking all or portions of these subtrees (if allowed to occur), is prohibited.

Not all protected subtrees are currently supplied on a System i® platform, although most are. If a subtree is currently not supplied, then the first subagent that dynamically registers it will be allowed, and later subagents will be disallowed. Refer to the "SNMP Agent Set Processing and Supported SNMP MIBs" in the Simple Network Management Protocol (SNMP) Support Link to PDF manual for information about the MIB groups currently supplied with IBM® i.

Following are the protected subtrees and the associated MIB name:


Related Information


Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

  #include <qtossapi.h>
  unsigned char *pack_p;

  pack_p = mkDPIregister(0,0L,"1.3.6.1.2.3.4.5.",
                         DPI_BULK_NO);
  if (pack_p) {
     /* Send packet to agent and await response. */
  }



API introduced: V3R6

[ Back to top | UNIX-Type APIs | APIs by category ]