xref: /openbmc/ipmitool/src/plugins/lan/asf.h (revision c18ec02f)
1 /*
2  * Copyright (c) 2003 Sun Microsystems, Inc.  All Rights Reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistribution of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistribution in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * Neither the name of Sun Microsystems, Inc. or the names of
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * This software is provided "AS IS," without a warranty of any kind.
20  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
21  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
22  * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
23  * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
24  * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
25  * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.  IN NO EVENT WILL
26  * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
27  * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
28  * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
29  * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
30  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
31  */
32 
33 #ifndef IPMI_ASF_H
34 #define IPMI_ASF_H
35 
36 #include <ipmitool/helper.h>
37 #include "lan.h"
38 
39 #define ASF_RMCP_IANA		0x000011be
40 
41 #define ASF_TYPE_PING		0x80
42 #define ASF_TYPE_PONG		0x40
43 
44 static const struct valstr asf_type_vals[] __attribute__((unused)) = {
45 	{ 0x10, "Reset" },
46 	{ 0x11, "Power-up" },
47 	{ 0x12, "Unconditional Power-down" },
48 	{ 0x13, "Power Cycle" },
49 	{ 0x40, "Presence Pong" },
50 	{ 0x41, "Capabilities Response" },
51 	{ 0x42, "System State Response" },
52 	{ 0x80, "Presence Ping" },
53 	{ 0x81, "Capabilities Request" },
54 	{ 0x82, "System State Request" },
55 	{ 0x00, NULL }
56 };
57 
58 /* ASF message header */
59 #ifdef HAVE_PRAGMA_PACK
60 #pragma pack(1)
61 #endif
62 struct asf_hdr {
63 	uint32_t	iana;
64 	uint8_t		type;
65 	uint8_t		tag;
66 	uint8_t		__reserved;
67 	uint8_t		len;
68 } ATTRIBUTE_PACKING;
69 #ifdef HAVE_PRAGMA_PACK
70 #pragma pack(0)
71 #endif
72 
73 int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len);
74 
75 #endif /* IPMI_ASF_H */
76