~ubuntu-branches/ubuntu/precise/openipmi/precise

« back to all changes in this revision

Viewing changes to sample/ipmicmd.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2005-10-20 23:01:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051020230155-32ns8hnb1es8hntb
Tags: 2.0.2-2
added missing libgdbm-dev to libopenipmi-dev
(closes: Bug#334623)

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
{
123
123
}
124
124
 
125
 
void
126
 
posix_vlog(char *format, enum ipmi_log_type_e log_type, va_list ap)
127
 
{
128
 
    vfprintf(stderr, format, ap);
129
 
    fprintf(stderr, "\n");
130
 
}
131
 
 
132
125
static void
133
126
leave(int ret)
134
127
{
171
164
}
172
165
 
173
166
void
174
 
dump_msg_data(ipmi_msg_t *msg, ipmi_addr_t *addr, char *type)
 
167
dump_msg_data(const ipmi_msg_t *msg, const ipmi_addr_t *addr, const char *type)
175
168
{
176
169
    ipmi_system_interface_addr_t *smi_addr = NULL;
177
170
    int                          i;
246
239
}
247
240
 
248
241
void
249
 
cmd_handler(ipmi_con_t   *ipmi,
250
 
            ipmi_addr_t  *addr,
251
 
            unsigned int addr_len,
252
 
            ipmi_msg_t   *cmd,
253
 
            long         sequence,
254
 
            void         *data1,
255
 
            void         *data2,
256
 
            void         *data3)
 
242
cmd_handler(ipmi_con_t        *ipmi,
 
243
            const ipmi_addr_t *addr,
 
244
            unsigned int      addr_len,
 
245
            const ipmi_msg_t  *cmd,
 
246
            long              sequence,
 
247
            void              *data1,
 
248
            void              *data2,
 
249
            void              *data3)
257
250
{
258
251
    dump_msg_data(cmd, addr, "command");
259
252
    printf("Command sequence = 0x%lx\n", sequence);
269
262
}
270
263
 
271
264
void
272
 
event_handler(ipmi_con_t   *ipmi,
273
 
              ipmi_addr_t  *addr,
274
 
              unsigned int addr_len,
275
 
              ipmi_event_t *event,
276
 
              void         *cb_data)
 
265
event_handler(ipmi_con_t        *ipmi,
 
266
              const ipmi_addr_t *addr,
 
267
              unsigned int      addr_len,
 
268
              ipmi_event_t      *event,
 
269
              void              *cb_data)
277
270
{
278
 
    unsigned int  record_id = ipmi_event_get_record_id(event);
279
 
    unsigned int  type = ipmi_event_get_type(event);
280
 
    unsigned int  data_len = ipmi_event_get_data_len(event);
281
 
    unsigned char *data = ipmi_event_get_data_ptr(event);
282
 
    int           i;
 
271
    unsigned int        record_id = ipmi_event_get_record_id(event);
 
272
    unsigned int        type = ipmi_event_get_type(event);
 
273
    unsigned int        data_len = ipmi_event_get_data_len(event);
 
274
    const unsigned char *data = ipmi_event_get_data_ptr(event);
 
275
    int                 i;
283
276
 
284
277
    printf("Got event:\n");
285
278
    printf("  %4.4x (%2.2x):", record_id, type);