X hits on this document

PDF document

February 10, 2006 - page 110 / 238

954 views

0 shares

0 downloads

0 comments

110 / 238

98

CHAPTER 7. ENTITIES

}

This is relatively simple to do, but you will not be able to know immediately when new entities are added to the system. To know that, you must register a callback function as follows:

static void h a n d l e _ e n t i t y ( e n u m i p m i _ u p d a t e _ e o p , i p m i _ d o m a i n _ t * d o m a i n , i p m i _ e n t i t y _ t * e n t i void *cb_data) t y ,

{

my_data_t *my_data = cb_data; /* Process the entity here */

}

void h a n d l e _ n e w _ d o m a i n ( i p m i _ d o m a i n _ t * d o m a i n , m y _ d a t a _ t * m y _ d { int rv; a t a ) r v = i p m i _ d o m a i n _ a d d _ e n t i t y _ u p d a t e _ h a n d l e r ( d o m a i n , h a n d l e _ e n t i t y , m y if (rv) _ d a t a ) ; h a n d l e _ e r r o r ( ) ;

}

You should call the function to add an entity update handler when the domain is reported up (or even before); that way you will not miss any entities.

7.2

Entity Containment and OpenIPMI

Entities may be contained inside other entities. For instance, a chassis may contain a board, and a board may have a processor on it. This is expressed in specific entity SDRs. OpenIPMI represents this by entities having children and parents.

To discover the parents of an entity, they may be iterated. It seems possible for an entity to have more than one parent; there is no direct prohibition of this in IPMI, although it would be a little wierd. To iterate the parents, use the following call:

t y p e d e f v o i d ( * i p m i _ e n t i t y _ i t e r a t e _ c h i l d _ c b ) ( i p m i _ e n t i t y _ t * e n t , i p m i _ e n t i t y _ t * c h i l d ,

* c b _ d a t a ) *ent, void ; v o i d i p m i _ e n t i t y _ i t e r a t e _ c h i l d r e n ( i p m i _ e n t i t y _ t i p m i _ e n t i t y _ i t e r a t e _ c h i l d _ c b h a n d l e r ,

void

* c b _ d a t a ) ;

Similarly, an entity may have children, but it is certain that more than one child is allowed. To iterate entities children, use the following call:

Document info
Document views954
Page views954
Page last viewedMon Jan 16 11:37:54 UTC 2017
Pages238
Paragraphs8090
Words85809

Comments