CHAPTER 3. IPMI INTERFACES
Handling Incoming Traps
OpenIPMI has some ability to handle SNMP traps. It does not implement its own SNMP stack though, so it cannot do all the work for you. Indeed, different SNMP exist and OpenIPMI would not want to presume that you would only use one of them. Also, since the SNMP trap port is fixed, some cooperative mechanism may be required between different pieces of software. You must have your own stack, like NetSNMP, and
catch the traps with that. Once you have a trap, you must call:
_ _ src addr len,
i n t i p m i _ h a n d l e _ s n m p _ t r a p _ d a t a ( v o i d
* s r c _ a d d r ,
Where src_addr is the IP source address (struct sockaddr_in) and length is the length of the address structure. Only IP is supported for now, so src_addr_type must be IPMI_EXTERN_ADDR_IP. The specific field is the field of the same name from the SNMP Protocol Data Unit (PDU). The data field is a pointer to the user data from the SNMP PDU, and the length of that data is in data_len.
The data in the trap is not enough information to fully decode the event, so currently an incoming trap will only cause an SEL fetch on the proper SEL. OpenIPMI will automatically send the PET Acknowledge command described in Table 3.35.
Note that SNMP traps can only be recieved on one port, and that port is privileged, so you must run as root to receive SNMP traps.
The Alert Immediate Command
The OpenIPMI driver and library use a common addressing scheme. This attempts to normalize the mes- saging from the user’s point of view. The message data will look the same no matter where you send it. The only difference is the message.
The main OpenIPMI address structure is:
i p m i _ a d d r
_ data[IPMI MAX
The addr_type and channel are common to all OpenIPMI addresses. You have to look at the addr_type to determine the type of address being used and cast it to the proper address. The specific messages are overlays on this structure.