#include <string.h> and/or #include <stdio.h> not needed.
[obnox/wireshark/wip.git] / epan / dissectors / packet-ipmi-pps.c
1 /* packet-ipmi-pps.c
2  * Sub-dissectors for IPMI messages (netFn=OEM/Group, defining body = PPS)
3  * Copyright 2007-2008, Alexey Neyman, Pigeon Point Systems <avn@pigeonpoint.com>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #ifdef HAVE_SYS_TYPES_H
31 #include <sys/types.h>
32 #endif
33
34 #include <epan/packet.h>
35
36 #include "packet-ipmi.h"
37
38 static ipmi_cmd_t cmd_pps[] = {
39   { 0x00, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Status", 0 },
40   { 0x01, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Serial Interface Properties", 0 },
41   { 0x02, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Serial Interface Properties", 0 },
42   { 0x03, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Debug Level", 0 },
43   { 0x04, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Debug Level", 0 },
44   { 0x05, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Hardware Address", 0 },
45   { 0x06, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Hardware Address", 0 },
46   { 0x07, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Handle Switch", 0 },
47   { 0x08, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Handle Switch", 0 },
48   { 0x09, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Payload Communication Timeout", 0 },
49   { 0x0a, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Payload Communication Timeout", 0 },
50   { 0x0b, IPMI_TBD,   NULL, NULL, "[PPS OEM] Enable Payload Control", 0 },
51   { 0x0c, IPMI_TBD,   NULL, NULL, "[PPS OEM] Disable Payload Control", 0 },
52   { 0x0d, IPMI_TBD,   NULL, NULL, "[PPS OEM] Reset IPMC", 0 },
53   { 0x0e, IPMI_TBD,   NULL, NULL, "[PPS OEM] Hang IPMC", 0 },
54   { 0x0f, IPMI_TBD,   NULL, NULL, "[PPS OEM] Bused Resource Control", 0 },
55   { 0x10, IPMI_TBD,   NULL, NULL, "[PPS OEM] Bused Resource Status", 0 },
56   { 0x11, IPMI_TBD,   NULL, NULL, "[PPS OEM] Graceful Reset", 0 },
57   { 0x12, IPMI_TBD,   NULL, NULL, "[PPS OEM] Diagnostic Interrupt Results", 0 },
58   { 0x13, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set/Clear Telco Alarm", 0 },
59   { 0x14, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Telco Alarm Sensor Number", 0 },
60   { 0x15, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Payload Shutdown Timeout", 0 },
61   { 0x16, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Payload Shutdown Timeout", 0 },
62   { 0x17, IPMI_TBD,   NULL, NULL, "[PPS OEM] Switch over Serial Debug", 0 },
63   { 0x18, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Local FRU LED State", 0 },
64   { 0x19, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Local FRU LED State", 0 },
65   { 0x1a, IPMI_TBD,   NULL, NULL, "[PPS OEM] Update Discrete Sensor", 0 },
66   { 0x1b, IPMI_TBD,   NULL, NULL, "[PPS OEM] Update Threshold Sensor", 0 },
67   { 0x1c, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Prepare", 0 },
68   { 0x1d, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Write", 0 },
69   { 0x1e, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Complete", 0 },
70   { 0x1f, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Start", 0 },
71   { 0x20, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Stop", 0 },
72   { 0x21, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Resume", 0 },
73   { 0x22, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Script Cease", 0 },
74   { 0x23, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Sensor Set", 0 },
75   { 0x24, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Notify", 0 },
76   { 0x25, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Get FRU State", 0 },
77   { 0x26, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Invalidate Hardware Address", 0 },
78   { 0x27, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Module Status", 0 },
79   { 0x28, IPMI_TBD,   NULL, NULL, "[PPS OEM] Enable AMC Site", 0 },
80   { 0x29, IPMI_TBD,   NULL, NULL, "[PPS OEM] Disable AMC Site", 0 },
81   { 0x2a, IPMI_TBD,   NULL, NULL, "[PPS OEM] BTI Wait for Payload Notify", 0 },
82   { 0x2b, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Test Flags", 0 },
83   { 0x2c, IPMI_TBD,   NULL, NULL, "[PPS OEM] Get Geographic Address", 0 },
84   { 0x2d, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set Geographic Address", 0 },
85   { 0x30, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set EEPROM Sensor Data", 0 },
86   { 0x31, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set EEPROM Sensor Hysteresis", 0 },
87   { 0x32, IPMI_TBD,   NULL, NULL, "[PPS OEM] Set EEPROM Sensor Threshold", 0 },
88   { 0x33, IPMI_TBD,   NULL, NULL, "[PPS OEM] Reset EEPROM SDR Repository", 0 },
89   { 0x34, IPMI_TBD,   NULL, NULL, "[PPS OEM] Backend Power Control", 0 },
90   { 0x35, IPMI_TBD,   NULL, NULL, "[PPS OEM] Read CPLD Register", 0 },
91   { 0x36, IPMI_TBD,   NULL, NULL, "[PPS OEM] Write CPLD Register", 0 }
92 };
93
94 void
95 ipmi_register_pps(gint proto_ipmi _U_)
96 {
97         static guint8 sig_pps[3] = { 0x0a, 0x40, 0x00 };
98         static guint8 sig_pps_rev[3] = { 0x00, 0x40, 0x0a };
99
100         ipmi_register_netfn_cmdtab(IPMI_OEM_REQ, IPMI_OEM_NONE, sig_pps, 3,
101                         "Pigeon Point Systems", cmd_pps, array_length(cmd_pps));
102         ipmi_register_netfn_cmdtab(IPMI_OEM_REQ, IPMI_OEM_NONE, sig_pps_rev, 3,
103                         "Pigeon Point Systems (reversed)", cmd_pps, array_length(cmd_pps));
104 }