X hits on this document

PDF document

February 10, 2006 - page 192 / 238

1169 views

0 shares

0 downloads

0 comments

192 / 238

180

APPENDIX H. SAMPLE PROGRAM SHOWING BASIC OPERATIONS

int rv; int id, instance;

id = ipmi_entity_get_entity_id(entity); instance = ipmi_entity_get_entity_instance(entity);

if (op == IPMI_ADDED) { printf("Entity added: %d.%d\n"

, id, instance);

/* Register callback so that when the status of a sensor changes, sensor_change is called */ r v = i p m i _ e n t i t y _ a d d _ s e n s o r _ u p d a t e _ h a n d l e r ( e n t i t y sensor_change, entity); if (rv) { , p r i n t f ( " i p m i _ e n t i t y _ s e t _ s e n s o r _ u p d a t e _ h a n d l e r : 0 x % x " , exit(1); r v ) ;

}

r v = i p m i _ e n t i t y _ a d d _ f r u _ u p d a t e _ h a n d l e r ( e n t i fru_change, NULL); if (rv) { t y , p r i n t f ( " i p m i _ e n t i t y _ s e t _ f r u _ u p d a t e _ h a n d l e r : 0 x % x exit(1); " , r v ) ;

}

}

}

_ _ setup_done(ipmi domain t *domain,

int

err,

unsigned int

_ conn num,

unsigned int

_ port num,

int

_ still connected,

void

_ *user data)

/* After we have established connection to domain, this function get called

At this time, we can do whatever things we want to do. Herr we want to search all entities in the system */ void

{

int rv;

/* Register a callback functin entity_change. When a new entities

is created, entity_change is called */ rv = ipmi_domain_add_entity_update_handler(domain, entity_change, domain); if (rv) {

p r i n t f ( " 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 r e t u r n e r r o r : % d \ n " , return; r v ) ;

Document info
Document views1169
Page views1169
Page last viewedTue Jan 24 09:46:15 UTC 2017
Pages238
Paragraphs8090
Words85809

Comments