Debian Codegraph @

libfreeipmi/sel/ipmi-sel-string-supermicro-overheat-common.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2003-2015 FreeIPMI Core Team
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */
18
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif /* HAVE_CONFIG_H */
22
23 #include <stdio.h>
24 #include <stdlib.h>
25 #if STDC_HEADERS
26 #include <string.h>
27 #include <stdarg.h>
28 #endif /* STDC_HEADERS */
29 #include <assert.h>
30 #include <errno.h>
31
32 #include "freeipmi/sel/ipmi-sel.h"
33
34 #include "freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h"
35 #include "freeipmi/spec/ipmi-product-id-spec.h"
36
37 #include "ipmi-sel-common.h"
38 #include "ipmi-sel-defs.h"
39 #include "ipmi-sel-string.h"
40 #include "ipmi-sel-string-supermicro-common.h"
41 #include "ipmi-sel-trace.h"
42 #include "ipmi-sel-util.h"
43
44 #include "freeipmi-portability.h"
45
46 /* return (0) - no OEM match
47 * return (1) - OEM match
48 * return (-1) - error, cleanup and return error
49 */
50 int
51 sel_string_output_supermicro_overheat_mobo_event_data1_class_oem (ipmi_sel_ctx_t ctx,
52 struct ipmi_sel_entry *sel_entry,
53 uint8_t sel_record_type,
54 char *tmpbuf,
55 unsigned int tmpbuflen,
56 unsigned int flags,
57 unsigned int *wlen,
58 struct ipmi_sel_system_event_record_data *system_event_record_data)
59 {
60 int ret;
61
62 assert (ctx);
63 assert (ctx->magic == IPMI_SEL_CTX_MAGIC);
64 assert (ctx->manufacturer_id == IPMI_IANA_ENTERPRISE_ID_SUPERMICRO
65 || ctx->manufacturer_id == IPMI_IANA_ENTERPRISE_ID_SUPERMICRO_WORKAROUND);
66 assert (sel_entry);
67 assert (tmpbuf);
68 assert (tmpbuflen);
69 assert (!(flags & ~IPMI_SEL_STRING_FLAGS_MASK));
70 assert (flags & IPMI_SEL_STRING_FLAGS_INTERPRET_OEM_DATA);
71 assert (wlen);
72 assert (system_event_record_data);
73 assert (ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTH
74 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTG
75 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTU
76 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DT3_LN4F
77 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTU_6PLUS
78 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTL
79 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTL_3F
80 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8SIL_F
81 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9SCL
82 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9SCM
83 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8DTNPLUS_F
84 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X8SIE
85 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9SCA_F_O
86 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_H8DGU_F
87 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_H8DGU
88 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_H8DG6
89 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9DRI_F
90 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9DRI_LN4F_PLUS
91 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9SPU_F_O
92 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_X9SCM_IIF
93 || ctx->product_id == IPMI_SUPERMICRO_PRODUCT_ID_H8SGL_F);
94
95 if ((ret = sel_string_output_supermicro_overheat_event_data1_class_oem (ctx,
96 sel_entry,
97 sel_record_type,
98 tmpbuf,
99 tmpbuflen,
100 flags,
101 wlen,
102 system_event_record_data)) < 0)
103 return (-1);
104
105 if (ret)
106 return (1);
107
108 return (0);
109 }
110
111 struct sel_string_oem sel_string_oem_supermicro_overheat_common =
112 {
113 NULL,
114 NULL,
115 &sel_string_output_supermicro_overheat_mobo_event_data1_class_oem,
116 NULL,
117 NULL,
118 NULL,
119 NULL,
120 NULL,
121 NULL,
122 NULL,
123 NULL,
124 NULL,
125 };