1 /*****************************************************************************\
2  *  $Id: ipmi-fru_.h,v 1.17 2010-02-08 22:20:58 chu11 Exp $
3  *****************************************************************************
4  *  Copyright (C) 2007-2015 Lawrence Livermore National Security, LLC.
5  *  Copyright (C) 2007 The Regents of the University of California.
6  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7  *  Written by Albert Chu <chu11@llnl.gov>
8  *  UCRL-CODE-232183
9  *
10  *  This file is part of Ipmi-fru, a tool used for retrieving
11  *  motherboard field replaceable unit (FRU) information. For details,
12  *  see http://www.llnl.gov/linux/.
13  *
14  *  Ipmi-fru is free software; you can redistribute it and/or modify
15  *  it under the terms of the GNU General Public License as published by the
16  *  Free Software Foundation; either version 3 of the License, or (at your
17  *  option) any later version.
18  *
19  *  Ipmi-fru is distributed in the hope that it will be useful, but
20  *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22  *  for more details.
23  *
24  *  You should have received a copy of the GNU General Public License along
25  *  with Ipmi-fru.  If not, see <http://www.gnu.org/licenses/>.
26 \*****************************************************************************/
27 
28 /* file is named ipmi-fru_.h to differentiate itself from the
29  * library ipmi-fru_.h.
30  *
31  * I am scared of the portability of the #include_next directive, so
32  * that's why I'm doing it this way.
33  */
34 
35 /* file is "ipmi-fru_.h", so double underscore */
36 
37 #ifndef IPMI_FRU__H
38 #define IPMI_FRU__H
39 
40 #include <stdint.h>
41 #include <freeipmi/freeipmi.h>
42 
43 #include "tool-cmdline-common.h"
44 #include "tool-oem-common.h"
45 #include "pstdout.h"
46 
47 enum ipmi_fru_argp_option_keys
48   {
49     DEVICE_ID_KEY = 'e',
50     VERBOSE_KEY = 'v',
51     /* legacy */
52     SKIP_CHECKS_KEY = 's',
53     BRIDGE_FRU_KEY = 160,
54     INTERPRET_OEM_DATA_KEY = 161,
55     FRU_FILE_KEY = 162,
56   };
57 
58 struct ipmi_fru_arguments
59 {
60   struct common_cmd_args common_args;
61   uint8_t device_id;
62   int device_id_set;
63   unsigned int verbose_count;
64   /* legacy */
65   int skip_checks;
66   int bridge_fru;
67   int interpret_oem_data;
68   char *fru_file;
69 };
70 
71 typedef struct ipmi_fru_prog_data
72 {
73   char *progname;
74   struct ipmi_fru_arguments *args;
75 } ipmi_fru_prog_data_t;
76 
77 typedef struct ipmi_fru_state_data
78 {
79   ipmi_fru_prog_data_t *prog_data;
80   ipmi_ctx_t ipmi_ctx;
81   pstdout_state_t pstate;
82   char *hostname;
83   ipmi_fru_ctx_t fru_ctx;
84   ipmi_sdr_ctx_t sdr_ctx;
85   struct ipmi_oem_data oem_data;
86 } ipmi_fru_state_data_t;
87 
88 #endif /* IPMI_FRU__H */
89