X hits on this document

PDF document

February 10, 2006 - page 67 / 238

979 views

0 shares

0 downloads

0 comments

67 / 238

3.11. USER MANAGEMENT

55

3.11.1

User management

in OpenIPMI

int

err,

_ _ _ ipmi user list t *list,

void

_ *cb data);

Enabling a user is a complicated process. The user must have a name and password assigned. It must be set with the proper authentication enables. Then it must be enabled with a separate enable command.

Fortunately, OpenIPMI handles a lot of this process for you. The functions are found in the ipmi user.h include file. You may get a list of users (or a specific user in a one-user list) with the command:

t y p e d e f v o i d ( * i p m i _ u s e r _ l i s t _ c b ) ( i p m i _ m c _ t

*mc,

unsigned int

channel,

unsigned int

user,

_ _ _ ipmi user list cb handler,

void

_ *cb data);

*mc,

0

#define IPMI MC ALL USERS

_ _ i _ n t i p m i _ m c _ g e t _ u s e r s ( i p m i _ m c _ t

Using IPMI_MC_ALL_USERS will fetch all users, otherwise the user specified will be used. The channel-specific information will be fetched for only the given channel. Once you have the list, you can fetch information from the list:

int ipmi_user_list_get_channel(ipmi_user_list_t *list, unsigned int *channel); int ipmi_user_list_get_max_user(ipmi_user_list_t *list, unsigned int *max); int ipmi_user_list_get_enabled_users(ipmi_user_list_t *list, unsigned int *e); int ipmi_user_list_get_fixed_users(ipmi_user_list_t *list, unsigned int *f);

You can also fetch individual users from the user list. Note that if you fetch a user this way, you must free it with ipmi_user_free().

u n s i g n e d i n t i p m i _ u s e r _ l i s t _ g e t _ u s e r _ c o u n t ( i p m i _ u s e r _ l i s t _ t * u s e r s ) ; i p m i _ u s e r _ t * i p m i _ u s e r _ l i s t _ g e t _ u s e r ( i p m i _ u s e r _ l i s t _ t * l i s t ,

unsigned int

idx);

Once you fetch a user, you can get information from it. You can also set information for the user. This only sets the local copy, it must be written out into the real data to activate it on the BMC.

int ipmi_user_get_channel(ipmi_user_t *user, unsigned int *channel);

/*

* Get/set the number for the user. */ i n t i p m i _ u s e r _ g e t _ n u m ( i p m i _ u s e r _ t * u s e r , u n s i g n e d i n t * n u m ) ; i n t i p m i _ u s e r _ s e t _ n u m ( i p m i _ u s e r _ t * u s e r , u n s i g n e d i n t n u m ) ;

/*

  • *

    Get/set the name for the user.

When getting the name, the pointer

  • *

    to "len" should point to a value of the length of "name".

    • *

      will be updated to the actual number of characters copied.

"len" The

Document info
Document views979
Page views979
Page last viewedTue Jan 17 08:15:42 UTC 2017
Pages238
Paragraphs8090
Words85809

Comments