mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 10:13:35 +00:00
Compare commits
781 Commits
IPMITOOL_1
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
7dcb8d3b02 | |||
4433696ae4 | |||
c9b2eb04f6 | |||
be79973194 | |||
8e12bc0299 | |||
b253fd5da3 | |||
811c894d78 | |||
65d1b0a623 | |||
e667785bd3 | |||
cf74129ba8 | |||
3a30f4d0b8 | |||
ac40435a4a | |||
b800400c41 | |||
9132b30b6c | |||
dd29a141ed | |||
9f86c0601a | |||
f7cfe44ce7 | |||
1ad5d3d0b2 | |||
9b4766a767 | |||
a43c37e6ce | |||
ee044f0169 | |||
a089b441f9 | |||
adef82354e | |||
ee59c4d0f1 | |||
9fd9b29cb5 | |||
35a7fad915 | |||
905892b5a7 | |||
8fd02275a0 | |||
133cf86058 | |||
7467b928c1 | |||
cfd5783232 | |||
c44a3a85f6 | |||
7e029dbb87 | |||
e3be943843 | |||
4b1ccbfdc3 | |||
e37e785449 | |||
66ffa994e9 | |||
21fb127ce2 | |||
c65b206144 | |||
a3d206523d | |||
06ad21054f | |||
e2cc94d96b | |||
56c495455c | |||
64af2f2bdb | |||
d80fa31411 | |||
271c681609 | |||
fa8c8116e1 | |||
5532b6856e | |||
58ea8803f9 | |||
99070e730e | |||
115df86f23 | |||
a94f0e612c | |||
e21475c78d | |||
6f3e247274 | |||
b8d9ada302 | |||
29dbaf6882 | |||
f367905bef | |||
66cb3143dc | |||
79befbb112 | |||
185b762fa9 | |||
5d7197d467 | |||
b0498d93cf | |||
9f49913c2f | |||
73d088de1f | |||
d4a64e17f2 | |||
e855ba03df | |||
68cdacb211 | |||
85643e52a2 | |||
776080c88a | |||
f0cd89fea6 | |||
d6e85b8427 | |||
ed8a467f6d | |||
715add8fef | |||
da9252ceba | |||
ae1fe95cb1 | |||
f42f7c701c | |||
29f43931e4 | |||
2ea87e639b | |||
8ec87a396e | |||
cd7e75a9d5 | |||
738cf02694 | |||
f7519e00eb | |||
c546582e92 | |||
22c7f92135 | |||
f449928806 | |||
8a0559a651 | |||
6cb97e4327 | |||
a15d6a31ac | |||
77275ab616 | |||
32c94e3eae | |||
36e388648d | |||
aac4cc9e05 | |||
c552839583 | |||
9dd625a215 | |||
f50160a9e4 | |||
67a60f1c9d | |||
7eeae98fb4 | |||
ae92538cbb | |||
558f279597 | |||
4e9fb18ef6 | |||
dc7c60b7a8 | |||
38d0926d9f | |||
661a80433e | |||
a4c5e7bda0 | |||
cf40042856 | |||
92876549ab | |||
141721d220 | |||
1e0164c253 | |||
ecb214d423 | |||
1196369aaf | |||
bfe06ebd98 | |||
58e4e355f8 | |||
9d762b82a0 | |||
9ad01e6eed | |||
53c97bc5b4 | |||
6ab2eb972e | |||
e25e0b8e71 | |||
cfd7f610cb | |||
f9d19aa0c5 | |||
6a90734a67 | |||
2440c09d50 | |||
1f597a78e2 | |||
f4dd419fe6 | |||
b3472220af | |||
54d6016a31 | |||
864ac5ad26 | |||
17d68a4289 | |||
907d8b30f5 | |||
c2d9746775 | |||
51a92c0917 | |||
07f4139e70 | |||
6514de2b13 | |||
89f6d591e0 | |||
f9f0599908 | |||
c792f6e7e1 | |||
bce51c05f8 | |||
e0912fc6b7 | |||
2c117c95ea | |||
e7140ed0c8 | |||
6049aa0fe4 | |||
96876bb061 | |||
4d2f9ebdc2 | |||
54dfc91b2b | |||
86d54446e9 | |||
a7bcb2422e | |||
4067bafa57 | |||
624392f798 | |||
ac2cc29ac0 | |||
87540ecf2a | |||
6d77f698f2 | |||
083e6afc46 | |||
384f9219ba | |||
fef402714f | |||
312b564091 | |||
a85bd201df | |||
e633524d34 | |||
a892bb499a | |||
836149f966 | |||
694f92918f | |||
1fe48e8a36 | |||
380f330e15 | |||
fe38fb4e7b | |||
ffd03bc964 | |||
f9e30a894c | |||
f733bcf2f1 | |||
51e906b7c6 | |||
70cc60d8a4 | |||
c2c1204cb1 | |||
f87420b587 | |||
33cad9b907 | |||
b42902f880 | |||
8e77031a97 | |||
b7962d85dc | |||
36fefdabc3 | |||
0ad17ece4a | |||
990a9a4b6b | |||
df7d0e6ee6 | |||
0f3c980b49 | |||
8cfb4c0897 | |||
650f12ab23 | |||
fb0cc0187c | |||
723b7c0614 | |||
bac5e21634 | |||
2ef302401e | |||
cd174d8e73 | |||
718232945c | |||
fa3bb0960b | |||
b8a2890ace | |||
5a7385f780 | |||
9708c8326f | |||
b1cf8c6a2b | |||
3af858eecf | |||
f04b6d858f | |||
12c19f88ca | |||
4385f3c403 | |||
f598c42e2e | |||
a567ac9426 | |||
2d0c486541 | |||
1a4399a9eb | |||
58c0fa890b | |||
06147e6a37 | |||
d559b1fa2d | |||
bd30ca98db | |||
e5a6d23f9c | |||
81aa0855f8 | |||
281777996b | |||
57c49ef9b8 | |||
adb40e53a1 | |||
db3da49158 | |||
6f9b34313e | |||
081baa7e24 | |||
bbaf882dd1 | |||
9e4ad72524 | |||
ea0e9ca5fd | |||
ace510828f | |||
6cc2c67671 | |||
d5d36e1941 | |||
b65ec95257 | |||
6b8d9243c2 | |||
5c2cd09f6a | |||
e34c7eeb5c | |||
eb8653f02a | |||
24a0b44a98 | |||
d69b8e8b7f | |||
8b68086fdb | |||
35c6bb4a9d | |||
928c500484 | |||
2da00b9a47 | |||
04802db0e0 | |||
85d612fa35 | |||
1340786bda | |||
30eec7d0ac | |||
5298b1ca71 | |||
a292d94239 | |||
26557547b4 | |||
2c2437239d | |||
7b3fac2071 | |||
763abe4889 | |||
2a574a3e8b | |||
f108b55d13 | |||
13659fb466 | |||
412798482c | |||
90448837ec | |||
fecfc09c8b | |||
820d9e6bb3 | |||
251de396a1 | |||
774c74a64c | |||
c7c5b2de37 | |||
762f6fff1c | |||
4ea12d4308 | |||
ce01d13e98 | |||
1c4f38bba8 | |||
b2c96c3a1f | |||
4c99a6f676 | |||
78049bf3b7 | |||
6052a2b57a | |||
392454c646 | |||
805835ca69 | |||
c86c21e734 | |||
897b3c5a46 | |||
4e93bf01ed | |||
9573ee3eed | |||
ef4e6f3dad | |||
3d30271e73 | |||
c39a8026da | |||
20a4a2f950 | |||
55ac08dc49 | |||
3fa867b222 | |||
8169fc6b3f | |||
505ec7615d | |||
116c7a7cf9 | |||
5c1661707c | |||
c105728a9a | |||
08e8e99fe2 | |||
596ef14553 | |||
0d3daba614 | |||
b42a8d7d6f | |||
75ae0675c2 | |||
a427845e41 | |||
d2364e50b2 | |||
e05098f802 | |||
d7e971d92f | |||
4e59621e64 | |||
3da7fea17f | |||
9c476f36aa | |||
c575d4b028 | |||
775f349d04 | |||
69c50e3d73 | |||
e9c27522c0 | |||
14042e4021 | |||
47e42d3f32 | |||
344cd68cc1 | |||
8974794475 | |||
3a96ee3272 | |||
1fbd130b9b | |||
d2bee0687a | |||
34474dcb2a | |||
e7f78a54f9 | |||
2c87bfc701 | |||
d4b64f4277 | |||
9caeb52ec1 | |||
b27e296399 | |||
f29c7e699c | |||
04561e2433 | |||
6d1f8521e6 | |||
90e2c17543 | |||
1df7ca9588 | |||
6dae08746d | |||
413078f80b | |||
e2cd941c34 | |||
ca85cb4688 | |||
e067d97a41 | |||
ac3e23b9b9 | |||
a60b6acce1 | |||
daf5180838 | |||
3979342536 | |||
a12c0c31bb | |||
7094b4f838 | |||
f0b24c9a0e | |||
674eb706a3 | |||
fe4f77cfdd | |||
cd5ee61d23 | |||
f7dc0a57de | |||
c6db0382e5 | |||
761ce85d28 | |||
3d29ed01a5 | |||
bc17282c3a | |||
247ad8f661 | |||
5679de9984 | |||
15ed988689 | |||
34ddf53870 | |||
42e73b39de | |||
aca415c287 | |||
c4699aba9c | |||
be2c0c4b03 | |||
0d72cd27cc | |||
e4ba0c3de3 | |||
96bd14b905 | |||
8a2a11c520 | |||
9164d3b69e | |||
80a9f3acb2 | |||
94f272e8e2 | |||
682caca7ea | |||
d6274af150 | |||
1d7e045d47 | |||
8dd12afdad | |||
174b13e835 | |||
ff89a0e2f2 | |||
9dbab242bd | |||
658b502e64 | |||
b8d8587b2a | |||
445025f2f4 | |||
55ee755de8 | |||
e9281ea912 | |||
58ef4f8af6 | |||
2e5d0c2921 | |||
79421577cc | |||
651466fc41 | |||
072986b669 | |||
ada87b8255 | |||
81d5b08b3d | |||
08844ec93b | |||
218094310b | |||
38fc65ae88 | |||
777cdb124c | |||
eb75ecf114 | |||
264a45de0f | |||
704f4c87c6 | |||
c7a6be575d | |||
f763641c2e | |||
5575a33119 | |||
dd376289c5 | |||
9c160b5a07 | |||
46f3f3d4db | |||
ad932e0cfd | |||
b5306e1aa6 | |||
e72103d30f | |||
21837864cc | |||
cfa8f69f97 | |||
55969d4a32 | |||
87234ecd0f | |||
14ee3f2362 | |||
db9614572b | |||
014040610f | |||
9c848916cc | |||
de7de91f99 | |||
dbbeee1b6f | |||
32cba5f174 | |||
f5c8042629 | |||
e23dde507e | |||
4db9739e17 | |||
b6852fc77b | |||
356fad232e | |||
30bc6b18cb | |||
3dfa1a4209 | |||
d25bd0a5e7 | |||
0007006347 | |||
7dcd5cec76 | |||
929d330424 | |||
d17909e3ec | |||
2e46c84218 | |||
b0ccfba549 | |||
49cc30816a | |||
f4e4d8433c | |||
a718edf808 | |||
dce547bcfd | |||
f045c0fa3d | |||
c58b02fa94 | |||
ae735c748d | |||
dba187190f | |||
914159b3b5 | |||
33d9b75951 | |||
a5012d1901 | |||
1a34cc960e | |||
2e1f1ef750 | |||
17b43f1b45 | |||
0aba9fc8b6 | |||
279053aa84 | |||
3c58698736 | |||
d23d74ce9f | |||
a87957ac7f | |||
7723fb41b3 | |||
6cdcd8555a | |||
1cf302c89e | |||
b696e2ceb3 | |||
9ec6a6d154 | |||
66fbb6fbbc | |||
4e7e7ae0a6 | |||
79f3994cfb | |||
e7e901c935 | |||
3836cb00e8 | |||
d52c8f01c5 | |||
c3df0b8851 | |||
99320869d2 | |||
1f36312b41 | |||
62574d281c | |||
e75fb44b4c | |||
848646514c | |||
4edd58a744 | |||
2d3af919ba | |||
2c189f0663 | |||
a3a95fb770 | |||
5c846a6eb6 | |||
3ebe119a94 | |||
b49691a272 | |||
0ef81e301f | |||
c5d65ba940 | |||
b60c6cea30 | |||
c72e3333eb | |||
ac931daa86 | |||
3d4acbd829 | |||
3d790edc6e | |||
4e025b3e0e | |||
62f52f0598 | |||
f874a93ccb | |||
1f7ba3dd66 | |||
e298b0b99f | |||
c84c9dceba | |||
7eee9c5916 | |||
19fc46049b | |||
ef11b94155 | |||
7ad880076e | |||
acc6c80b2d | |||
517c045873 | |||
7855f9b4ff | |||
df2b4c2da1 | |||
5e2361ab9c | |||
e3e67fbc57 | |||
2407e86e90 | |||
6247d67ec1 | |||
ed1ee73953 | |||
9626375cfb | |||
d8b9ae6c8a | |||
cb105b246f | |||
4883543139 | |||
c8aad7df14 | |||
ba2cfe98a5 | |||
bdf90c59bc | |||
72f6d0b977 | |||
23dc958548 | |||
7e140a2c5f | |||
4022cb1c63 | |||
94245169c1 | |||
3c78114ccc | |||
8e7361bb6c | |||
6c43afe6f3 | |||
e05ab344af | |||
eab79363a2 | |||
c1fd61b419 | |||
4763dcf560 | |||
a745d83af2 | |||
6da8379fe4 | |||
ea146566c5 | |||
bbf1909161 | |||
f6495ddf0e | |||
e092eedd5b | |||
8f5e3e0d95 | |||
8da3a449cb | |||
639df0246c | |||
72417c67db | |||
cbc8cbdff4 | |||
f0cbc9b2ba | |||
a8e2fc03e7 | |||
4d8ec39062 | |||
4f9cbb3f38 | |||
0603bd8f98 | |||
69501d7827 | |||
f9c23d8a54 | |||
6ce168af6f | |||
68be9c40e6 | |||
dd8b1806b5 | |||
d92b9920d7 | |||
45a4c1a9c8 | |||
66aaa91ff2 | |||
c52b6e80ba | |||
d5b598c93d | |||
c452979e74 | |||
81c73bd164 | |||
0173930abd | |||
087e8e5a0b | |||
1ea4e2e540 | |||
b85e953ab9 | |||
3c61e45ae4 | |||
2364cd86e8 | |||
7931368837 | |||
d08d147528 | |||
f059085532 | |||
1157a0e498 | |||
2eeceac233 | |||
7ef44c8a8c | |||
3f58f3f2aa | |||
3fbcd758ca | |||
f068a200b6 | |||
f4a014cac9 | |||
10212fecb5 | |||
720ad12aaf | |||
40f77f63a1 | |||
7c9030bf3b | |||
6f1f26a1b1 | |||
5859e5cd57 | |||
54c8afcf60 | |||
b27ddb4902 | |||
5713ee5fc3 | |||
285a4d9ce2 | |||
b5c97ace65 | |||
14638f0876 | |||
bf5e378272 | |||
9627ab3253 | |||
744a151854 | |||
6174b3b923 | |||
9a980d55b7 | |||
ca11ec7f52 | |||
fe98eff12f | |||
b90b6f0257 | |||
6801a7300c | |||
a3295bba5e | |||
c4a390fa77 | |||
c5246ce35d | |||
e687d531a3 | |||
de2c6447f0 | |||
d4edb349a4 | |||
00b6abee9d | |||
781d59161e | |||
3d0abad22b | |||
9c24a1efb8 | |||
3aed8f0233 | |||
b997633cdc | |||
ee4a11550d | |||
a33c9103f3 | |||
53a67cfc12 | |||
e18fb8b260 | |||
7cd6cfa6e7 | |||
f357316b7f | |||
9f72a2203a | |||
fc176f764a | |||
00e0c7d7fb | |||
85ed419117 | |||
df13ead528 | |||
12d6d12bb7 | |||
3de1ef09d2 | |||
3f7c483766 | |||
c1b3c9d95a | |||
2d24d4e3fb | |||
db90c6dbdf | |||
a45fb5e859 | |||
620f9d4aaf | |||
0e9aaceaa7 | |||
a0b29c3f59 | |||
a5acadbd21 | |||
d3d78bb7bb | |||
c8454885b6 | |||
4168b3c939 | |||
6e7b8f1af8 | |||
5dd687134e | |||
39167b6ae8 | |||
31b25430c1 | |||
352c2e36ea | |||
6ca108ef78 | |||
1e043d1188 | |||
cf563a2e18 | |||
4c83f69cae | |||
77cf4b9622 | |||
61a6e7df12 | |||
873352643a | |||
7810d7191b | |||
ac3b1c8eda | |||
f72472a649 | |||
fd96022ec2 | |||
4a76c7f66c | |||
6b8ebca452 | |||
f30ef24600 | |||
5750269c28 | |||
a1f58f6009 | |||
87b893267c | |||
a18557d779 | |||
0405266402 | |||
c96ef9d425 | |||
9ba83a2c5d | |||
9b0b5ed676 | |||
ebc1a83c9a | |||
c19b71c28c | |||
182fd656d2 | |||
85e70c1b8d | |||
a1a7a13e56 | |||
68a27c2067 | |||
a21bc00e1c | |||
f179e04459 | |||
2ab696dc17 | |||
3b58655b89 | |||
94ea137687 | |||
ff4e172e8e | |||
cdd1cb6afc | |||
99f7f7f61e | |||
45e3a3a04a | |||
13c79fa23e | |||
61f44e20a1 | |||
db7ce70e24 | |||
ac328c98bf | |||
d0317a2716 | |||
bbb7cc35ab | |||
7d4b1e8bee | |||
9f055476c3 | |||
a7bb4e2ba7 | |||
ae3c316bbb | |||
77268f7daa | |||
a6793b9430 | |||
e8170fd6b6 | |||
0b3db22dab | |||
c7bc504b87 | |||
50b4815cf0 | |||
4677f14f6c | |||
6e6d775ac8 | |||
44cbf081a6 | |||
42c1c9123c | |||
3bf0d0c68e | |||
99fc2e8a83 | |||
d7af26b64b | |||
630be3c669 | |||
6f2eeed320 | |||
15b8801d0b | |||
d47cd125fe | |||
6bc047da44 | |||
224844746a | |||
222180ca52 | |||
970a87eb1a | |||
68556c2a43 | |||
c634d2a080 | |||
95044acb5d | |||
c199b86143 | |||
e09dc5950c | |||
85d138da01 | |||
69eeda859e | |||
05344c9a45 | |||
2a5ea8b9ee | |||
a502ab31d1 | |||
ccf104d610 | |||
572f2df8bb | |||
9c87f801a4 | |||
59b1d83751 | |||
ef055c6246 | |||
0710a0a98e | |||
706bb54764 | |||
d234596ac5 | |||
4bfdf06132 | |||
6e5cdb2c20 | |||
eb116adf53 | |||
8f48a7021a | |||
41a64a0f93 | |||
1e1058db49 | |||
569b8bf5d7 | |||
ceae2f37bf | |||
1070546b2a | |||
e0f8bb52bb | |||
1435321c86 | |||
db7f0ba560 | |||
072c5d8461 | |||
5b8ff924e5 | |||
079f451dd0 | |||
9e06705aa4 | |||
26dd8d1429 | |||
edaf1aba33 | |||
f7590819fa | |||
2c898cfc85 | |||
0e5cbcd112 | |||
e7c7d7d2e9 | |||
122f422da7 | |||
d68bf042b1 | |||
a76f069b0a | |||
3012023e7e | |||
51104a0cb4 | |||
779a863a0c | |||
fb89d1e6ea | |||
23cf8254e2 | |||
62eeecb378 | |||
1cc46a898e | |||
98035ca03d | |||
ccd0920f37 | |||
187e25e658 | |||
90cd4acb4f | |||
3b17fb7dd8 | |||
84cd061ad4 | |||
11a35b0452 | |||
3f17e0f508 | |||
320853217c | |||
a56df3a244 | |||
7ee80165ec | |||
60b14feb65 | |||
9e08347965 | |||
8efaddec02 | |||
becaec236c | |||
45a0fa0324 | |||
81ae330e9b | |||
db3d59fe08 | |||
7b11ad75c0 | |||
c51c2b94d6 | |||
8c1dbf31c4 | |||
1c9f5127e6 | |||
b61d4cc2fb | |||
ff2d92d08c | |||
348f402739 | |||
b39d7a2015 | |||
45d8b901de | |||
402418ab6e | |||
f33274ee4d | |||
d6e686bffb | |||
3f83dc4e2e | |||
a5e813318a | |||
1a7873b684 | |||
c79cb2e740 | |||
2ee612d62b | |||
43a65a47b7 | |||
43db890016 | |||
6890e1f002 | |||
fc29d57ffc | |||
85dc962bc0 | |||
4879ab9d21 | |||
7d910260e4 | |||
18a1ff5e60 | |||
ceaa360249 | |||
37dcdc8615 | |||
b86dd5e8b8 | |||
dd87b050b8 | |||
702627f6b3 | |||
57a1ea3801 | |||
ff9c8dd094 | |||
c42d2caaa7 | |||
41720d46ec | |||
c56a70c0d9 | |||
19c0f522ed | |||
d52f792652 | |||
3177b09272 | |||
4de32a37e8 | |||
05df8eb9a2 | |||
5c337dcdf6 | |||
897e1c6a20 | |||
b502dc0bc7 | |||
fcb6595b6e | |||
2cca8ad7ba | |||
5d55d7dcfe | |||
003b4ee57e | |||
357d98b74d |
4
ipmitool/AUTHORS
Normal file
4
ipmitool/AUTHORS
Normal file
@ -0,0 +1,4 @@
|
||||
Duncan Laurie <duncan@iceblink.org>
|
||||
Fredrik <20>hrn <ohrn@chl.chalmers.se>
|
||||
Jon Cassorla <jon.cassorla@newisys.com>
|
||||
Jeremy Ellington <jeremy@jeremye.net>
|
@ -28,6 +28,3 @@ PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
170
ipmitool/ChangeLog
Normal file
170
ipmitool/ChangeLog
Normal file
@ -0,0 +1,170 @@
|
||||
version 1.8.8
|
||||
* Fix segfaults in sensor data repository list
|
||||
* Fix ipmievd to open interface before daemonizing
|
||||
* Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
* Fix cipher suite display bug in lan print
|
||||
* Fix typo in IPMIv2 SOL output when sending break
|
||||
* Fix improper LUN handling with Tyan SOL
|
||||
* Add LUN support to OpenIPMI interface
|
||||
* Add support for Kontron OEM commands
|
||||
* Update to Kontron Firmware Update command
|
||||
|
||||
version 1.8.7
|
||||
* Remove nuclear clause from license
|
||||
* Add Sun OEM command for blades
|
||||
* Increase argument size for raw commands in shell/exec
|
||||
* Fix handling of LUNs for LAN interfaces
|
||||
* Add IPMIv2 SOL loopback test
|
||||
* Add support for IBM OEM SEL messages
|
||||
* Disable file paranoia checks on read files by default
|
||||
* Support IPMIv2 SOL on older Intel boxes
|
||||
* Display message and exit if keepalive fails during SOL
|
||||
* Add support for setting VLAN id and priority
|
||||
* Add support for FreeBSD OpenIPMI-compatible driver
|
||||
* Add support for IPMIv2 Firmware Firewall
|
||||
* Fix gcc4 compile warnings
|
||||
* Make ipmievd generate pidfile
|
||||
* Add initscripts for ipmievd
|
||||
|
||||
version 1.8.6
|
||||
* Fix memory corruption when sending encrypted SOL traffic
|
||||
* Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
version 1.8.5
|
||||
* Add support for settable SOL escape character with -e option
|
||||
* Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
* Add support for Tyan IPMIv1.5 SOL with tsol command
|
||||
* Add support for PICMG devices
|
||||
* Add support for OEM SEL event parsing
|
||||
* Add support for command bridging over lan and lanplus interfaces
|
||||
* New 'chassis selftest' command
|
||||
* Many bufxies and patches from contributors
|
||||
|
||||
version 1.8.3
|
||||
* Add support for 'sel readraw' and 'sel writeraw' commands.
|
||||
* Add support for entering NetFn as a string for RAW commands.
|
||||
* Add support for appending distro tag to integrated RPM builds.
|
||||
* Fix LAN parameter printing to handle Invalid Data Field response
|
||||
without errors.
|
||||
* Add 5ms delay to IPMIv2 SOL retry packets
|
||||
* IPMIv2 interface will now correctly set session privilege level
|
||||
to requested level after session is opened.
|
||||
|
||||
version 1.8.2 (released May 18 2005)
|
||||
* Fix FRU reading for large (>255 bytes) areas.
|
||||
* Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
|
||||
* Fix LAN parameter segfault when no Ciphers supported by BMC.
|
||||
* Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
|
||||
* Separate option parsing code from main ipmitool source file.
|
||||
* Add raw I2C support with IPMI Master Read-Write command.
|
||||
* Add support for new 'sdr elist' extended output format.
|
||||
* Add support for listing sensors by type with 'sdr type' command.
|
||||
* Add support for new 'sel elist' extended output format that
|
||||
cross-references events with sensors.
|
||||
* Add support for sending dynamically generated platform events
|
||||
based on existing sensor information.
|
||||
* New '-S' argument to read local SDR cache created with 'sdr dump'.
|
||||
* Updated manpage for ipmitool and ipmievd.
|
||||
|
||||
version 1.8.1
|
||||
* ipmievd installs in /usr/sbin
|
||||
|
||||
version 1.8.0
|
||||
* Fix IPMIv2.0 issues
|
||||
* Fix chassis boot parameter support
|
||||
* Add support for linear sensors
|
||||
|
||||
version 1.7.1
|
||||
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
|
||||
for interface detection and new STREAMS message-based interface)
|
||||
|
||||
version 1.7.0
|
||||
* Propogate errors correctly so exit status will be useful
|
||||
* More consistent display of errors including completion code text
|
||||
* Errors and debug is send to stderr now
|
||||
* New "sel get" command that will print details about SEL entry
|
||||
and corresponding SDR records as well as FRUs via entity association
|
||||
* Improved event generator, now supports reading events from text file
|
||||
* New "-o oemtype" option for specifying OEM boards
|
||||
exsting types are "supermicro" and "intelwv2"
|
||||
* New PEF subsystem from Tim Murphy at Dell
|
||||
* New "bmc" plugin for Solaris 10 x86
|
||||
* Many bugfixes and contributed patches
|
||||
|
||||
version 1.6.2
|
||||
* Support for Supermicro BMC OEM authentication method
|
||||
|
||||
version 1.6.1
|
||||
* Fix minor problem with LAN parameter setting
|
||||
|
||||
version 1.6.0
|
||||
* Add a README file
|
||||
* Add Solaris x86 interface plugin
|
||||
* Add support for building Solaris packages
|
||||
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
|
||||
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
|
||||
* Add command "bmc info" and related output (from ebrower@sourceforge)
|
||||
* Add support for IPMIv2 and Serial-over-LAN from Jeremy at Newisys
|
||||
* Add support for building RPMs as non-root user
|
||||
* Add new "shell" and "exec" commands
|
||||
* Lots of other contributed patches
|
||||
|
||||
version 1.5.9
|
||||
* Add ability to get a particular sensor by name
|
||||
* Add ability to set a particular sensor threshold
|
||||
* Add support for displaying V2 channel authentication levels
|
||||
* Add README for rrdtool scripts in contrib directory
|
||||
* Improve lan interface retry handling
|
||||
* Support prompting for password or reading from environment
|
||||
* Move chaninfo command into channel subcommand
|
||||
* Fix reservation ID handling when two sessions open to BMC
|
||||
* Fix reading of large FRU data
|
||||
* Add configure option for changing binary to ipmiadm for Solaris
|
||||
* Fix compile problem on Solaris 8
|
||||
|
||||
version 1.5.8
|
||||
* Enable static compilation of interfaces
|
||||
* Fix types to be 64-bit safe
|
||||
* Fix compilation problems on Solaris
|
||||
* Fix multiple big-endian problems for Solaris/SPARC
|
||||
* Fix channel access to save settings to NVRAM
|
||||
* Set channel privilege limit to ADMIN during "access on"
|
||||
* Enable gratuitous ARP in bmcautoconf.sh
|
||||
* Add support for Linux kernel panic messages in SEL output
|
||||
* Add support for type 3 SDR records
|
||||
|
||||
version 1.5.7
|
||||
* Add IPMIv1.5 eratta fixes
|
||||
* Additions to FRU printing and FRU multirecords
|
||||
* Better handling of SDR printing
|
||||
* Contrib scripts for creating rrdtool graphs
|
||||
|
||||
version 1.5.6
|
||||
* Fix SEL event decoding for generic events
|
||||
* Handle empty SEL gracefully when doing "sel list"
|
||||
* Fix sdr handling of sensors that do not return a reading
|
||||
* Fix for CSV display of sensor readings/units from Fredrik <20>hrn
|
||||
|
||||
version 1.5.5
|
||||
* Add -U option for setting LAN username
|
||||
* Fix -v usage for plugin interfaces
|
||||
|
||||
version 1.5.4
|
||||
* Put interface plugin API into library
|
||||
* Fix ipmievd
|
||||
|
||||
version 1.5.3
|
||||
* Add -g option to work with grizzly bmc
|
||||
|
||||
version 1.5.2
|
||||
* Add support for setting gratuitous arp interval
|
||||
|
||||
version 1.5.1
|
||||
* Better SEL support
|
||||
* Fix display bug in SDR list
|
||||
|
||||
version 1.5.0
|
||||
* More robust UDP packet handling
|
||||
* Add Intel IMB driver support
|
||||
* Use autoconf/automake/libtool
|
||||
|
@ -27,21 +27,53 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
EXTRA_DIST = ipmitool.spec.in control/pkginfo control/prototype debian/*
|
||||
DOCDIR = $(DESTDIR)/$(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = README COPYING AUTHORS ChangeLog
|
||||
|
||||
EXTRA_DIST = $(DOCLIST) \
|
||||
debian/changelog debian/control debian/copyright \
|
||||
debian/dirs debian/docs debian/rules
|
||||
|
||||
AUTOMAKE_OPTIONS = dist-bzip2
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
|
||||
config.guess config.sub depcomp install-sh ltmain.sh missing \
|
||||
mkinstalldirs config.h.in stamp-h.in $(distdir).tar.gz
|
||||
mkinstalldirs config.h.in stamp-h.in \
|
||||
$(distdir).tar.gz $(distdir).tar.bz2
|
||||
|
||||
SUBDIRS = libltdl lib src include doc
|
||||
SUBDIRS = lib src include doc contrib control
|
||||
|
||||
INCLUDES = $(LTDLINCL)
|
||||
dist-hook:
|
||||
cp control/ipmitool.spec $(distdir)
|
||||
|
||||
dist-hook: ipmitool.spec
|
||||
cp ipmitool.spec $(distdir)
|
||||
install-data-local:
|
||||
mkdir -p $(DOCDIR)
|
||||
install -m 644 $(DOCLIST) $(DOCDIR)
|
||||
|
||||
.PHONY: pkg
|
||||
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
|
||||
pkg: control/pkginfo
|
||||
$(STRIP) src/ipmitool
|
||||
$(STRIP) src/ipmitool
|
||||
(cd control ; pkgmk -o -d /tmp)
|
||||
pkgtrans -s /tmp $(PKG) ipmitool
|
||||
gzip -c /tmp/$(PKG) > $(PKG).gz
|
||||
-rm -rf /tmp/ipmitool /tmp/$(PKG)
|
||||
|
||||
BUILDDIR = ${shell cd $(top_builddir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
|
||||
SRCDIR = ${shell cd $(top_srcdir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
|
||||
RPMDIR = $(BUILDDIR)/rpmbuild
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: control/ipmitool.spec dist
|
||||
mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS,tmp}
|
||||
cp control/ipmitool.spec $(RPMDIR)/SPECS
|
||||
BUILDDIR=$(RPMDIR) CONFIGDIR=$(BUILDDIR)/control \
|
||||
@RPMBUILD@ -ba --rcfile $(SRCDIR)/control/rpmrc \
|
||||
$(RPMDIR)/SPECS/ipmitool.spec
|
||||
|
||||
.PHONY: clean-rpm
|
||||
clean-rpm:
|
||||
-rm -rf $(RPMDIR)
|
||||
|
||||
|
309
ipmitool/README
Normal file
309
ipmitool/README
Normal file
@ -0,0 +1,309 @@
|
||||
|
||||
ipmitool
|
||||
Duncan Laurie
|
||||
duncan@iceblink.org
|
||||
|
||||
Overview
|
||||
========
|
||||
ipmitool is a utility for managing and configuring devices that support
|
||||
the Intelligent Platform Management Interface. IPMI is an open standard
|
||||
for monitoring, logging, recovery, inventory, and control of hardware
|
||||
that is implemented independent of the main CPU, BIOS, and OS. The
|
||||
service processor (or Baseboard Management Controller, BMC) is the brain
|
||||
behind platform management and its primary purpose is to handle the
|
||||
autonomous sensor monitoring and event logging features.
|
||||
|
||||
The ipmitool program provides a simple command-line interface to this BMC.
|
||||
It features the ability to read the sensor data repository (SDR) and print
|
||||
sensor values, display the contents of the System Event Log (SEL), print
|
||||
Field Replaceable Unit (FRU) inventory information, read and set LAN
|
||||
configuration parameters, and perform remote chassis power control.
|
||||
|
||||
|
||||
Background
|
||||
==========
|
||||
I originally wrote ipmitool while between projects and employeed at Sun
|
||||
Microsystems. Sun had just embarked on a new line of general-purpose x86
|
||||
servers that inclued an OEM Intel board with an IPMIv1.5 BMC on board.
|
||||
It started with an idea that remote chassis power control would be a handy
|
||||
feature for my systems in the lab and from there it grew into a multi-
|
||||
purpose tool that lots of people found useful. I decided to release it
|
||||
under a BSD license and give others the chance to make use of it.
|
||||
|
||||
ipmitool was not written to provide large-scale (aka Enterprise) management
|
||||
application functionality. The functionality that ipmitool proivides is
|
||||
easily accomplished by sending simple IPMI request messages and parsing
|
||||
the returned response. It is intended to be used by system administrators
|
||||
who like the simplicity and scriptability of command-line utilities, as
|
||||
well as those debugging or developing their own BMC implementations.
|
||||
|
||||
|
||||
Requirements
|
||||
============
|
||||
Obviously the largest requirement is hardware with a service processor
|
||||
that supports the IPMI specification. Many x86-based servers are now
|
||||
comming with IPMI support, check with your preferred hardware vendor
|
||||
about available prodcuts.
|
||||
|
||||
Once you are certain you have the required hardware, you then need to
|
||||
decide how you want to access the BMC. The most common case involve
|
||||
access through the System Interface or over the LAN. (or serial, but
|
||||
currently ipmitool does not support the serial interface)
|
||||
|
||||
|
||||
System Interface
|
||||
----------------
|
||||
There are multiple types of system interfaces, but they are all similar
|
||||
enough to allow a single well-designed driver to support them all.
|
||||
Different types of system interfaces include Keyboard Controller Style
|
||||
(KCS), Block Transfer (BT), System Management Interface Chip (SMIC) and
|
||||
SMBus. Different hardware vendors will have different preference and
|
||||
implementations.
|
||||
|
||||
On Linux the OpenIPMI kernel driver should support all of these system
|
||||
interfaces and it should be a simple matter of loading the right
|
||||
kernel modules and setting up the device node to use it. The driver
|
||||
module names vary slightly in different kernel versions, but for all
|
||||
releases you need these two modules:
|
||||
|
||||
ipmi_msghandler: incoming and outgoing message handler
|
||||
ipmi_devintf: character device interface to IPMI driver
|
||||
|
||||
For 2.4.x and early 2.6.x kernels you need to choose a module based on
|
||||
the type of system interface your hardware supports. For example:
|
||||
|
||||
ipmi_kcs_drv: Keyboard Controller Style driver
|
||||
|
||||
More recent 2.6.x kernels have combined these into a single module:
|
||||
|
||||
ipmi_si: a universal IPMI system interface driver
|
||||
|
||||
See the documentation that comes with your distribution and/or kernel
|
||||
for more information on what kernel modules are required. Once the
|
||||
required modules are loaded and the driver has found a suitable system
|
||||
interface to the BMC then you need to ensure the device node at
|
||||
/dev/ipmi0 is pointing at the correct major number.
|
||||
|
||||
This is because OpenIPMI is given a dynamically assigned major number
|
||||
when it is loaded, but depending on what other modules are present
|
||||
this number may be anywhere from 254 on down. The easiest way to tell
|
||||
is to check the output of /proc/devices and see what major number the
|
||||
"ipmidev" device is assigned to.
|
||||
|
||||
There is a sample script included with ipmitool called ipmi.init that
|
||||
can be used to automate this process at bootup.
|
||||
|
||||
|
||||
LAN Interface
|
||||
-------------
|
||||
This is often referred to as "IPMI-over-LAN" and defines how IPMI messages
|
||||
can be sent to and from the BMC encapsulated in Remote Management Control
|
||||
Protocol (RMCP) packets which are then transferred as UDP datagrams.
|
||||
|
||||
IPMI-over-LAN is only supported with version 1.5 and higher of the IPMI
|
||||
specification. The RMCP packet format is defined by the Alert Standard
|
||||
Forum, and it has been followed up with the RMCP+ protocol that adds
|
||||
encryption and payload support. The IPMIv2 specification was updated
|
||||
accordingly to to support the RMCP+ protocol and brings with it enhanced
|
||||
security with encryption as well as support for Serial over LAN.
|
||||
|
||||
There are different types of LAN interfaces as well. Some systems have
|
||||
shared management networks where the NIC will intercept UDP packets to
|
||||
port 623 and redirect them to the BMC over SMBUS. This type of LAN
|
||||
interface requires that the BMC be configured with the same settings that
|
||||
the system uses. It also suffers from an increased security risk just by
|
||||
the nature of sharing that interface with normal traffic.
|
||||
|
||||
I have also seen bugs in some implementations that have rendered the
|
||||
IPMI-over-LAN feature "dangerous" to enable in some situations. (in
|
||||
particular there can be an issue with RPC because it will sometimes choose
|
||||
to use port 623 and you will lose response packets...)
|
||||
|
||||
There is a sample shell script included with ipmitool called bmclanconf
|
||||
that can be used to simplify the LAN settings configuration process using
|
||||
the System Interface to configure the settings. In some cases the
|
||||
hardware will come with a utility (often a DOS bootable CD) for configuring
|
||||
enabling the LAN interface as well.
|
||||
|
||||
In order to support the IPMIv2.0 interface you must have an OpenSSL library
|
||||
with the required encrytion functions. Recent distributions should have
|
||||
no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
|
||||
hash function at compile time but if that is not found it will use an
|
||||
internal library.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
All invocations of ipmitool require specifying an interface to use, unless
|
||||
you want to use the default interface as set at compile time. Each call
|
||||
must also specify a command to run. You can see the list of supported
|
||||
interfaces and which is default as well as a list of top level commands in
|
||||
the usage output available with the -h option:
|
||||
|
||||
usage: ipmitool [options...] <command>
|
||||
|
||||
-h This help
|
||||
-V Show version information
|
||||
-v Verbose (can use multiple times)
|
||||
-c Display output in comma separated format
|
||||
-I intf Interface to use
|
||||
-H hostname Remote host name for LAN interface
|
||||
-p port Remote RMCP port [default=623]
|
||||
-L level Remote session privilege level [default=USER]
|
||||
-A authtype Force use of authtype NONE, PASSWORD, MD2 or MD5
|
||||
-U username Remote session username
|
||||
-P password Remote session password
|
||||
-f file Read remote session password from file
|
||||
-a Prompt for remote password
|
||||
-E Read password from IPMI_PASSWORD environment variable
|
||||
-m address Set local IPMB address
|
||||
-t address Bridge request to remote target address
|
||||
|
||||
Interfaces:
|
||||
open Linux OpenIPMI Interface [default]
|
||||
imb Intel IMB Interface
|
||||
lan IPMI v1.5 LAN Interface
|
||||
lanplus IPMI v2.0 RMCP+ LAN Interface
|
||||
|
||||
Commands:
|
||||
raw Send a RAW IPMI request and print response
|
||||
lan Configure LAN Channels
|
||||
chassis Get chassis status and set power state
|
||||
event Send pre-defined events to BMC
|
||||
bmc Print BMC status and configure global enables
|
||||
sdr Print Sensor Data Repository entries and readings
|
||||
sensor Print detailed sensor information
|
||||
fru Print built-in FRU and scan SDR for FRU locators
|
||||
sel Print System Evelnt Log
|
||||
sol Configure IPMIv2.0 Serial-over-LAN
|
||||
user Configure BMC users
|
||||
channel Configure BMC channels
|
||||
session Print session information
|
||||
shell Launch interactive IPMI shell
|
||||
exec Run list of commands from file
|
||||
set Set runtime variable for shell and exec
|
||||
|
||||
|
||||
Commands
|
||||
========
|
||||
More help on the supported commands can be found by running them with the
|
||||
help argument, for example "chassis help". There are a few commands with
|
||||
special meaning:
|
||||
|
||||
> shell: This command will launch an shell interface to the ipmitool
|
||||
command set. You can use this for interactively entering commands to
|
||||
monitor system status. An example session:
|
||||
|
||||
# ipmitool -I open shell
|
||||
ipmitool> chassis status
|
||||
System Power : off
|
||||
Power Overload : false
|
||||
Power Interlock : inactive
|
||||
Main Power Fault : false
|
||||
Power Control Fault : false
|
||||
Power Restore Policy : always-off
|
||||
Last Power Event : command
|
||||
Chassis Intrusion : active
|
||||
Front-Panel Lockout : inactive
|
||||
Drive Fault : false
|
||||
Cooling/Fan Fault : false
|
||||
ipmitool> user list 7
|
||||
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
|
||||
1 true false true ADMINISTRATOR
|
||||
ipmitool> exit
|
||||
|
||||
> exec: This command will read a text file and execute ipmitool commands
|
||||
in sequence. It can be used for scriptable commands:
|
||||
|
||||
# cat lansetup.scr
|
||||
lan set 7 ipsrc static
|
||||
lan set 7 ipaddr 10.1.1.10
|
||||
lan set 7 netmask 255.255.255.0
|
||||
lan set 7 defgw ipaddr 10.1.1.254
|
||||
# ipmitool -I open exec lansetup.scr
|
||||
Setting LAN IP Address to 10.1.1.10
|
||||
Setting Lan Subnet Mask to 255.255.255.0
|
||||
Setting Lan Default Gateway IP to 10.1.1.254
|
||||
|
||||
> set: This command can be used by the shell and exec modes to configure
|
||||
various session parameters:
|
||||
|
||||
hostname <host> Session hostname
|
||||
username <user> Session username
|
||||
password <pass> Session password
|
||||
privlvl <level> Session privilege level force
|
||||
authtype <type> Authentication type force
|
||||
localaddr <addr> Local IPMB address
|
||||
targetaddr <addr> Remote target IPMB address
|
||||
port <port> Remote RMCP port
|
||||
csv [level] enable output in comma separated format
|
||||
verbose [level] Verbose level
|
||||
|
||||
# cat getstatus.scr
|
||||
set hostname sf-v20z-1
|
||||
set password admin
|
||||
chassis status
|
||||
# ipmitool -I lan exec getstatus.scr
|
||||
Set session hostname to lx50
|
||||
Set session password
|
||||
System Power : off
|
||||
Power Overload : false
|
||||
Power Interlock : inactive
|
||||
Main Power Fault : false
|
||||
Power Control Fault : false
|
||||
Power Restore Policy : always-off
|
||||
Last Power Event : command
|
||||
Chassis Intrusion : active
|
||||
Front-Panel Lockout : inactive
|
||||
Drive Fault : false
|
||||
Cooling/Fan Fault : false
|
||||
|
||||
|
||||
ipmievd
|
||||
=======
|
||||
Included with ipmitool is another utility called ipmievd that is a daemon
|
||||
which will listen for events from the BMC that are being sent to the SEL
|
||||
and also log those messages to syslog. By default when run (as root) with
|
||||
no arguments it will daemonize and poll on the OpenIPMI device waiting for
|
||||
an event notification. Upon receipt of an event it will log it to syslog
|
||||
with the LOG_LOCAL4 facility. You can test ipmievd by sending test events
|
||||
over the LAN interface with ipmitool:
|
||||
|
||||
remote# ipmievd
|
||||
|
||||
local$ ipmitool -I lan -H lx50 -P admin event help
|
||||
usage: event <num>
|
||||
1 : Temperature - Upper Critical - Going High
|
||||
2 : Voltage Threshold - Lower Critical - Going Low
|
||||
3 : Memory - Correctable ECC
|
||||
local$ ipmitool -I lan -H lx50 -P admin event 1
|
||||
Sending Temperature - Upper Critical - Going High event to BMC
|
||||
local$ ipmitool -I lan -H lx50 -P admin event 2
|
||||
Sending Voltage Threshold - Lower Critical - Going Low event to BMC
|
||||
local$ ipmitool -I lan -H lx50 -P admin event 3
|
||||
Sending Memory - Correctable ECC event to BMC
|
||||
|
||||
remote# tail /var/log/messages (timestamps removed)
|
||||
ipmievd: Waiting for events...
|
||||
ipmievd: Temperature Sensor 30 - Upper Critical - going high
|
||||
ipmievd: Voltage Sensor 60 - Lower Critical - going low
|
||||
ipmievd: Memory Sensor 01 - Correctable ECC
|
||||
|
||||
|
||||
Resources
|
||||
=========
|
||||
IPMItool homepage
|
||||
http://ipmitool.sourceforge.net
|
||||
|
||||
IPMItool manpage
|
||||
http://ipmitool.sourceforge.net/manpage.html
|
||||
|
||||
IPMItool overview paper from Linux.conf.au 2004
|
||||
http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
|
||||
|
||||
Intelligent Platform Management Interface specification
|
||||
http://www.intel.com/design/servers/ipmi/spec.htm
|
||||
|
||||
OpenIPMI project: Linux IPMI kernel driver and userland library
|
||||
http://openipmi.sourceforge.net
|
||||
|
@ -1,132 +0,0 @@
|
||||
#!/bin/bash
|
||||
# bmcautoconf [interface] [channel]
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# Redistribution of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# Redistribution in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# Neither the name of Sun Microsystems, Inc. or the names of
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# This software is provided "AS IS," without a warranty of any kind.
|
||||
# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
#
|
||||
|
||||
: ${DEBUG:=0}
|
||||
: ${IFACE:=eth0}
|
||||
: ${CHANNEL:=7}
|
||||
: ${IPMIINTF:=dev}
|
||||
|
||||
# util locations
|
||||
IPMITOOL=/usr/sbin/ipmitool
|
||||
PING=/bin/ping
|
||||
ARP=/sbin/arp
|
||||
IFCONFIG=/sbin/ifconfig
|
||||
ROUTE=/sbin/route
|
||||
|
||||
ipmitool_lan_set ()
|
||||
{
|
||||
[ $# -lt 2 ] && return
|
||||
PARAM=$1
|
||||
VALUE=$2
|
||||
|
||||
if [ $DEBUG -gt 0 ]; then
|
||||
echo "Setting LAN parameter ${PARAM} to ${VALUE}"
|
||||
echo "$IPMITOOL -I $IPMIINTF lan set $CHANNEL $PARAM $VALUE"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -x $IPMITOOL ]; then
|
||||
echo "Error: unable to find $IPMITOOL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
IFACE=$1
|
||||
if ! $IFCONFIG $IFACE | grep -q "inet addr:" >/dev/null 2>&1 ; then
|
||||
echo "Error: unable to find interface $IFACE"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $# -ge 2 ]; then
|
||||
CHANNEL=$2
|
||||
if [ $CHANNEL -ne 6 ] && [ $CHANNEL -ne 7 ]; then
|
||||
echo "Invalid channel: $CHANNEL"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
[ $DEBUG -gt 0 ] && echo "Auto-configuring $IFACE (channel $CHANNEL)"
|
||||
|
||||
# IP Address
|
||||
IP_ADDRESS=$( $IFCONFIG $IFACE | grep "inet addr:" | awk -F"[:[:space:]]+" '{ print $4 }' )
|
||||
if [ X$IP_ADDRESS = X ]; then
|
||||
echo "Unable to determine IP address for interface $IFACE"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Netmask
|
||||
IP_NETMASK=$( $IFCONFIG $IFACE | grep "inet addr:" | awk -F"[:[:space:]]+" '{ print $8 }' )
|
||||
if [ X$IP_NETMASK = X ]; then
|
||||
echo "Unable to determine IP netmask for interface $IFACE"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# MAC Address
|
||||
MAC_ADDRESS=$( $IFCONFIG $IFACE | grep "HWaddr" | awk '{ print $5 }' )
|
||||
if [ X$MAC_ADDRESS = X ]; then
|
||||
echo "Unable to determine MAC address for interface $IFACE"
|
||||
exit 4
|
||||
fi
|
||||
|
||||
# default route IP Address
|
||||
DEF_ROUTE_IP=$( $ROUTE -n | awk '/^0.0.0.0/ { print $2 }' )
|
||||
if [ X$DEF_ROUTE_IP = X ]; then
|
||||
echo "Unable to determine default route IP address"
|
||||
exit 5
|
||||
fi
|
||||
|
||||
# Default Route MAC Address
|
||||
# (ping it first to populate arp table)
|
||||
$PING -q -c1 >/dev/null 2>&1
|
||||
DEF_ROUTE_MAC=$( $ARP -an -i $IFACE | grep $DEF_ROUTE_IP | awk '{ print $4 }' )
|
||||
if [ X$DEF_ROUTE_MAC = X ]; then
|
||||
echo "Unable to determine default route MAC address"
|
||||
exit 6
|
||||
fi
|
||||
|
||||
ipmitool_lan_set "ipsrc" "static"
|
||||
ipmitool_lan_set "ipaddr" $IP_ADDRESS
|
||||
ipmitool_lan_set "netmask" $IP_NETMASK
|
||||
ipmitool_lan_set "macaddr" $MAC_ADDRESS
|
||||
ipmitool_lan_set "defgw ipaddr" $DEF_ROUTE_IP
|
||||
ipmitool_lan_set "defgw macaddr" $DEF_ROUTE_MAC
|
||||
ipmitool_lan_set "auth callback,user,operator,admin"
|
||||
|
||||
exit 0
|
@ -29,13 +29,9 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
aclocal
|
||||
libtoolize --automake --copy --ltdl
|
||||
libtoolize --automake --copy
|
||||
|
||||
autoheader
|
||||
automake --foreign --add-missing --copy
|
||||
|
@ -2,75 +2,46 @@ dnl
|
||||
dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.5.4])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.8])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
IPMITOOL_PKG=ipmitool
|
||||
AC_SUBST(IPMITOOL_PKG)
|
||||
AC_SUBST(ac_configure_args)
|
||||
|
||||
dnl check for programs
|
||||
dnl check for requirements
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
|
||||
AC_CHECK_PROG([SED], [sed], [sed])
|
||||
|
||||
AC_CHECK_PROG(SED, sed, sed)
|
||||
|
||||
dnl setup libtool and ltdl
|
||||
AC_LIB_LTDL
|
||||
AC_LIBTOOL_DLOPEN
|
||||
AC_LIBLTDL_CONVENIENCE
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
AC_SUBST(LTDLINCL)
|
||||
AC_SUBST(LIBLTDL)
|
||||
AC_CONFIG_SUBDIRS(libltdl)
|
||||
|
||||
AC_CHECK_LIB([m], [pow], [], [
|
||||
echo "** libm library pow() not found!"
|
||||
exit 1
|
||||
])
|
||||
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(socket, socket, ,
|
||||
[AC_CHECK_LIB(nsl, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket)])
|
||||
|
||||
AC_CHECK_LIB([ltdl], [lt_dlopen], [], [
|
||||
echo "** libltdl library lt_dlopen() not found!"
|
||||
exit 1
|
||||
])
|
||||
|
||||
dnl check for headers
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h])
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
|
||||
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
|
||||
|
||||
have_openipmi=no
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[have_openipmi=yes],
|
||||
[AC_MSG_WARN([Unable to find OpenIPMI header files])])
|
||||
|
||||
dnl check for typedefs, structs, and compiler options
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl check for lib functions
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_STAT
|
||||
AC_FUNC_STRTOD
|
||||
AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
dnl check for byteswap functionality
|
||||
AC_CHECK_HEADERS([asm/byteorder.h byteswap.h])
|
||||
AC_CHECK_FUNCS([bswap_16 bswap_32])
|
||||
AC_C_BIGENDIAN
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
||||
AC_SEARCH_LIBS([gethostbyname], [nsl])
|
||||
AC_SEARCH_LIBS([socket], [socket], [],
|
||||
[AC_CHECK_LIB([nsl], [socket],
|
||||
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
|
||||
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix="$ac_default_prefix"
|
||||
@ -80,54 +51,317 @@ if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
|
||||
dnl enable plugins for interfaces
|
||||
AC_ARG_WITH([plugin-path],
|
||||
[[ --with-plugin-path=DIR Set plugin path to DIR]],
|
||||
[pluginpath="$withval"],
|
||||
[pluginpath="${exec_prefix}/lib/ipmitool"])
|
||||
enable_all_options=yes
|
||||
|
||||
AC_DEFINE_UNQUOTED(PLUGIN_PATH, "$pluginpath", "IPMI interface plugin path")
|
||||
AC_SUBST(pluginpath)
|
||||
dnl set some things so we build with GNU tools on Solaris
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
MAKE=gmake
|
||||
STRIP=gstrip
|
||||
LD=gld
|
||||
AR=gar
|
||||
# openssl libs are in /usr/sfw/lib on solaris 10
|
||||
LIBS="$LIBS -R/usr/sfw/lib"
|
||||
# disable the linux-specific interfaces
|
||||
# and bmc on SPARC (there is no bmc driver for SPARC)
|
||||
if [[ `mach -p` = sparc ]]; then
|
||||
enable_intf_bmc=no
|
||||
else
|
||||
enable_intf_bmc=yes
|
||||
fi
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_ipmishell=no
|
||||
enable_all_options=no
|
||||
;;
|
||||
*cygwin*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_ipmishell=no
|
||||
;;
|
||||
*darwin*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_ipmishell=no
|
||||
;;
|
||||
*freebsd*)
|
||||
enable_intf_imb=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
;;
|
||||
*netbsd*)
|
||||
enable_intf_imb=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_intf_open=no
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(ARCH, $host_cpu)
|
||||
AC_SUBST(OS, $host_os)
|
||||
AC_SUBST(PSTAMP, $host)
|
||||
AC_SUBST(BASEDIR, $prefix)
|
||||
|
||||
dnl allow solaris builds to include all options
|
||||
AC_ARG_ENABLE([solaris-opt],
|
||||
[AC_HELP_STRING([--enable-solaris-opt],
|
||||
[enable all options for Solaris [default=no]])],
|
||||
[], [enable_solaris_opt=no])
|
||||
if test "x$enable_all_options" = "xyes" || test "x$enable_solaris_opt" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
|
||||
fi
|
||||
|
||||
dnl check for OpenSSL functionality
|
||||
AC_ARG_ENABLE([internal-md5],
|
||||
[AC_HELP_STRING([--enable-internal-md5],
|
||||
[enable internal MD5 library [default=no]])],
|
||||
[], [enable_internal_md5=no])
|
||||
|
||||
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
have_crypto=yes; LIBS="$LIBS -lcrypto"
|
||||
fi], [have_crypto=no], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD5_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
|
||||
fi], [], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD2_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md2=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
|
||||
fi], [], [-lcrypto])
|
||||
|
||||
dnl enable IPMIv1.5 LAN interface
|
||||
AC_ARG_ENABLE([intf-lan],
|
||||
[[ --enable-intf-lan enable IPMI-over-LAN interface [default=yes]]],
|
||||
[if test "x$enableval" = "xyes"; then
|
||||
PLUGINS="$PLUGINS lan"
|
||||
fi],
|
||||
[PLUGINS="$PLUGINS lan"])
|
||||
[AC_HELP_STRING([--enable-intf-lan],
|
||||
[enable IPMIv1.5 LAN interface [default=yes]])],
|
||||
[], [enable_intf_lan=yes])
|
||||
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then
|
||||
enable_intf_lan=yes
|
||||
fi
|
||||
if test "x$enable_intf_lan" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
|
||||
AC_SUBST(INTF_LAN, [lan])
|
||||
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[[ --enable-intf-open enable OpenIPMI device interface [default=no]]],
|
||||
[if test "x$enableval" = "xyes"; then
|
||||
if test "x$have_openipmi" = "xyes"; then
|
||||
PLUGINS="$PLUGINS open"
|
||||
else
|
||||
echo "** Unable to build OpenIPMI interface support!"
|
||||
exit 1
|
||||
dnl enable IPMIv2.0 RMCP+ LAN interface
|
||||
AC_ARG_ENABLE([intf-lanplus],
|
||||
[AC_HELP_STRING([--enable-intf-lanplus],
|
||||
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
|
||||
[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
enable_intf_lanplus=no
|
||||
fi],
|
||||
[enable_intf_lanplus=$have_crypto])
|
||||
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
|
||||
enable_intf_lanplus=yes
|
||||
fi
|
||||
if test "x$enable_intf_lanplus" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
|
||||
AC_SUBST(INTF_LANPLUS, [lanplus])
|
||||
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
|
||||
else
|
||||
enable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
AC_ARG_WITH([kerneldir],
|
||||
[AC_HELP_STRING([--with-kerneldir=DIR],
|
||||
[set kernel include path to DIR])],
|
||||
[if test "x$with_kerneldir" = "xyes"; then
|
||||
with_kerneldir="/lib/modules/`uname -r`/build"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CFLAGS)
|
||||
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
||||
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
||||
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
||||
if test "x$kernelver" = "x2.6"; then
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||
[AC_CHECK_HEADER([sys/ipmi.h],
|
||||
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
|
||||
[Define to 1 if you have the <sys/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
|
||||
|
||||
AC_SUBST(PLUGINS)
|
||||
dnl look for termios header file
|
||||
AC_CHECK_HEADER([termios.h],
|
||||
[AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have <termios.h>.])],
|
||||
[AC_CHECK_HEADER([sys/termios.h],
|
||||
[AC_DEFINE(HAVE_SYS_TERMIOS_H, [1], [Define to 1 if you have <sys/termios.h>.])],
|
||||
[echo "** Unable to find termios header file."])])
|
||||
|
||||
AC_ARG_ENABLE([ipmievd],
|
||||
[[ --enable-ipmievd enable IPMI event daemon [default=no]]],,)
|
||||
dnl set RPM distro tag for use in RPM name
|
||||
AC_ARG_WITH([rpm-distro],
|
||||
[AC_HELP_STRING([--with-rpm-distro=DISTRO],
|
||||
[set Linux distribution tag for use in RPM version string])],
|
||||
[AC_SUBST(DISTRO, $with_rpm_distro)])
|
||||
|
||||
AM_CONDITIONAL(IPMIEVD, test "x$enable_ipmievd" = "xyes")
|
||||
dnl set RPM release tag
|
||||
AC_ARG_WITH([rpm-release],
|
||||
[AC_HELP_STRING([--with-rpm-release=RELEASE],
|
||||
[set release number for RPM release field])],
|
||||
[], [with_rpm_release=1])
|
||||
AC_SUBST(RPM_RELEASE, $with_rpm_release)
|
||||
|
||||
AC_CONFIG_FILES([ipmitool.spec
|
||||
Makefile
|
||||
dnl enable Linux OpenIPMI interface
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[AC_HELP_STRING([--enable-intf-open],
|
||||
[enable Linux OpenIPMI interface [default=auto]])],
|
||||
[], [enable_intf_open=yes])
|
||||
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
|
||||
enable_intf_open=yes
|
||||
fi
|
||||
if test "x$enable_intf_open" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
|
||||
AC_SUBST(INTF_OPEN, [open])
|
||||
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
|
||||
fi
|
||||
|
||||
dnl enable Intel IMB interface
|
||||
AC_ARG_ENABLE([intf-imb],
|
||||
[AC_HELP_STRING([--enable-intf-imb],
|
||||
[enable Intel IMB driver interface [default=auto]])],
|
||||
[], [enable_intf_imb=yes])
|
||||
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
|
||||
enable_intf_imb=yes
|
||||
fi
|
||||
if test "x$enable_intf_imb" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
|
||||
AC_SUBST(INTF_IMB, [imb])
|
||||
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris LIPMI interface
|
||||
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
|
||||
AC_ARG_ENABLE([intf-lipmi],
|
||||
[AC_HELP_STRING([--enable-intf-lipmi],
|
||||
[enable Solaris 9 x86 IPMI interface [default=no]])],
|
||||
[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
|
||||
enable_intf_lipmi=no
|
||||
fi],
|
||||
[enable_intf_lipmi=no])
|
||||
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
|
||||
enable_intf_lipmi=yes
|
||||
fi
|
||||
if test "x$enable_intf_lipmi" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
|
||||
AC_SUBST(INTF_LIPMI, [lipmi])
|
||||
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris BMC interface
|
||||
AC_ARG_ENABLE([intf-bmc],
|
||||
[AC_HELP_STRING([--enable-intf-bmc],
|
||||
[enable Solaris 10 x86 IPMI interface [default=auto]])],,
|
||||
[enable_intf_bmc=no])
|
||||
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then
|
||||
enable_intf_bmc=yes
|
||||
fi
|
||||
if test "x$enable_intf_bmc" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
|
||||
AC_SUBST(INTF_BMC, [bmc])
|
||||
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
|
||||
fi
|
||||
|
||||
AC_SUBST(IPMITOOL_INTF_LIB)
|
||||
|
||||
dnl check for readline library to enable ipmi shell
|
||||
AC_ARG_ENABLE([ipmishell],
|
||||
[AC_HELP_STRING([--enable-ipmishell],
|
||||
[enable IPMI shell interface [default=yes]])],
|
||||
[], [enable_ipmishell=yes])
|
||||
if test "x$enable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [readline ncurses curses termcap])
|
||||
AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Enable -Wall -Werror
|
||||
AC_ARG_ENABLE([buildcheck],
|
||||
[AC_HELP_STRING([--enable-buildcheck],
|
||||
[enable -Wall -Werror for build testing [default=no]])],
|
||||
[if test "x$enable_buildcheck" != "xno"; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
|
||||
fi], [])
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
dnl Enable extra file security paranoia
|
||||
AC_ARG_ENABLE([file-security],
|
||||
[AC_HELP_STRING([--enable-file-security],
|
||||
[enable extra security checks on files opened for read [default=no]])],
|
||||
[if test "x$enable_file_security" != "xno"; then
|
||||
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
|
||||
fi], [])
|
||||
|
||||
dnl Generate files for build
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
contrib/Makefile
|
||||
control/Makefile
|
||||
control/pkginfo
|
||||
control/prototype
|
||||
control/rpmmacros
|
||||
control/ipmitool.spec
|
||||
lib/Makefile
|
||||
include/Makefile
|
||||
include/ipmitool/Makefile
|
||||
src/Makefile
|
||||
src/plugins/Makefile
|
||||
src/plugins/lan/Makefile
|
||||
src/plugins/open/Makefile])
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/open/Makefile
|
||||
src/plugins/imb/Makefile
|
||||
src/plugins/bmc/Makefile
|
||||
src/plugins/lipmi/Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
echo Building $PACKAGE version $VERSION with interface plugins: $PLUGINS
|
||||
echo Plugin Path: $pluginpath
|
||||
echo
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([ipmitool $VERSION])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Interfaces])
|
||||
AC_MSG_RESULT([ lan : $enable_intf_lan])
|
||||
AC_MSG_RESULT([ lanplus : $enable_intf_lanplus])
|
||||
AC_MSG_RESULT([ open : $enable_intf_open])
|
||||
AC_MSG_RESULT([ imb : $enable_intf_imb])
|
||||
AC_MSG_RESULT([ bmc : $enable_intf_bmc])
|
||||
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Extra tools])
|
||||
AC_MSG_RESULT([ ipmievd : yes])
|
||||
AC_MSG_RESULT([])
|
||||
|
||||
|
@ -27,75 +27,12 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
V_MAJ = 1
|
||||
V_MIN = 4
|
||||
V_REV = 1.1
|
||||
VERSION = $(V_MAJ).$(V_MIN).$(V_REV)
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
PROG = ipmitool
|
||||
SPEC = $(PROG).spec
|
||||
MAN = $(PROG).1
|
||||
OBJS = main.o ipmi_sdr.o ipmi_sel.o ipmi_fru.o ipmi_chassis.o ipmi_lanp.o
|
||||
dist_pkgdata_DATA = README oem_ibm_sel_map
|
||||
|
||||
LIB = libipmitool.a
|
||||
LIB_OBJS= lib/helper.o lib/ipmi_dev.o lib/ipmi_lan.o
|
||||
|
||||
CC = gcc
|
||||
RM = rm -f
|
||||
AR = ar rc
|
||||
RANLIB = ranlib
|
||||
STRIP = strip
|
||||
|
||||
INCLUDE = -I include
|
||||
CFLAGS = -g -Wall -Werror -D_GNU_SOURCE -DVERSION=\"$(VERSION)\"
|
||||
LDFLAGS = -L . -lm -lipmitool
|
||||
|
||||
SBINDIR = $(DESTDIR)/usr/sbin
|
||||
MANDIR = $(DESTDIR)/usr/share/man/man1
|
||||
|
||||
.PHONY: all
|
||||
all: $(LIB) $(PROG) man
|
||||
|
||||
$(PROG): $(OBJS)
|
||||
$(CC) $(INCLUDE) -o $@ $(OBJS) $(LDFLAGS)
|
||||
|
||||
$(LIB): $(LIB_OBJS)
|
||||
$(AR) $(LIB) $?
|
||||
$(RANLIB) $(LIB)
|
||||
|
||||
install: $(PROG)
|
||||
strip $(PROG)
|
||||
install -m755 -o root -g root $(PROG) $(SBINDIR)/$(PROG)
|
||||
|
||||
install-man: man
|
||||
gzip -c $(PROG).1 > $(MANDIR)/$(PROG).1.gz
|
||||
|
||||
clean:
|
||||
-$(RM) $(PROG) $(SPEC) $(MAN) $(LIB)
|
||||
-$(RM) $(OBJS)
|
||||
-$(RM) $(LIB_OBJS)
|
||||
|
||||
dist: clean spec
|
||||
tar -C .. -czf ../$(PROG)-$(VERSION).tar.gz $(PROG)
|
||||
|
||||
man:
|
||||
sed -e "s/@@VERSION@@/$(VERSION)/" $(MAN).in > $(MAN)
|
||||
|
||||
spec:
|
||||
sed -e "s/@@VERSION@@/$(VERSION)/" $(SPEC).in > $(SPEC)
|
||||
|
||||
rpm: spec
|
||||
tar -C .. -czf $(PROG).tar.gz $(PROG); \
|
||||
RPM=`which rpmbuild`; \
|
||||
if [ -z "$$RPM" ]; then RPM=rpm; fi; \
|
||||
$$RPM -ta $(PROG).tar.gz; \
|
||||
rm $(PROG).tar.gz
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -c $(@D)/$(<F) -o $(@D)/$(@F)
|
||||
dist_pkgdata_SCRIPTS = bmclanconf ipmi.init.basic ipmi.init.redhat \
|
||||
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
|
||||
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh
|
||||
|
95
ipmitool/contrib/README
Normal file
95
ipmitool/contrib/README
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
Graphs for ipmitool
|
||||
-------------------
|
||||
|
||||
This is a set of shell-scripts to quickly create a webpage with pretty graphs!
|
||||
|
||||
Prerequisites are a webserver with cgi-bin support and RRDtool, a data
|
||||
collection and graphing utility you can get here:
|
||||
|
||||
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
|
||||
|
||||
|
||||
First, decide on a directory where to store the RRDtool database files and make
|
||||
sure it exists. The user that will run the cronjob to collect updates must have
|
||||
write permissions in this dir.
|
||||
|
||||
Next, you'll need to edit some variables at the top of each script.
|
||||
|
||||
Common to all scripts:
|
||||
|
||||
hostname Override this if you are collecting data from a remote host,
|
||||
or if the $HOSTNAME variable is incorrect.
|
||||
|
||||
ipmi_cmd Command line used to call ipmitool. Default is to collect
|
||||
data from the local server using OpenIPMI.
|
||||
|
||||
If you want to collect data from a remote host, add the
|
||||
-I lan, -H, -U and -P options as necessary.
|
||||
|
||||
BIG NOTE! I do not recommend using remote data collection since
|
||||
you'll have to store the password in the script. If you do,
|
||||
make sure unauthorized people can't read or execute the scripts
|
||||
or they'll be able to wreak havoc on your server.
|
||||
|
||||
rrd_dir Enter the dir where to store the RRDtool database here.
|
||||
|
||||
|
||||
Now you can get the data collection going. Run create_rrds.sh to create the
|
||||
RDDtool database, you'll find one .rrd file per sensor in the designated dir.
|
||||
Add a line to your crontab that executes collect_data.sh every 5 minutes.
|
||||
|
||||
Something like this:
|
||||
*/5 * * * * /usr/local/bin/collect_data.sh
|
||||
|
||||
If you are a Solaris user you'll have to write the more verbose:
|
||||
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/collect_data.sh
|
||||
|
||||
|
||||
Finally it's time to create the webpage, begin with editing some more variables
|
||||
in the create_webpage.sh and/or create_webpage_compact.sh scripts:
|
||||
|
||||
rrdcgi Full path to the rrdcgi executable.
|
||||
|
||||
img_dir Directory to store the graph images. This path must be within
|
||||
the document root and writable by the web server user.
|
||||
|
||||
Example: /usr/local/apache2/htdocs/images/graphs
|
||||
|
||||
web_dir Relative path of the URL where the images will show up
|
||||
on the web server.
|
||||
|
||||
Example: With the img_dir path above the corresponding web_dir
|
||||
would be /images/graphs
|
||||
|
||||
graph_width Size of the graph area in pixels (excluding title, legends etc.)
|
||||
graph_height
|
||||
|
||||
graph_daily Decide which of daily, weekly and monthly graphs you want
|
||||
graph_weekly included on the page.
|
||||
graph_monthly
|
||||
|
||||
|
||||
Finally run the create webpage script and store the output as a cgi-script and
|
||||
don't forget to make it executable.
|
||||
|
||||
Example:
|
||||
|
||||
create_webpage.sh > /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
|
||||
chmod 755 /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
|
||||
|
||||
Now you can surf to http://my.server.com/cgi-bin/my_ipmi_graphs.cgi and enjoy!
|
||||
|
||||
|
||||
The difference between create_webpage.sh and create_webpage_compact.sh is that
|
||||
the first script displays sensor thresholds in the graphs. The second script
|
||||
collects all sensors that measure the same unit into the same graph thus
|
||||
producing a lot fewer graphs.
|
||||
|
||||
Note, RRDtool sometimes scales the graphs such that the sensor thresholds
|
||||
fall outside the visible area.
|
||||
|
||||
|
||||
Happy graphing!
|
||||
|
||||
|
308
ipmitool/contrib/bmclanconf
Executable file
308
ipmitool/contrib/bmclanconf
Executable file
@ -0,0 +1,308 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# Redistribution of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# Redistribution in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# Neither the name of Sun Microsystems, Inc. or the names of
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# This software is provided "AS IS," without a warranty of any kind.
|
||||
# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
# This script is designed for Sun Fire LX50, V60x and V65x systems.
|
||||
# It may work with other setups as long as you use the correct channel
|
||||
# and interface settings. It can be used on the V20z as long as you
|
||||
# specify network settings on the command line.
|
||||
#
|
||||
# If the wrong channel is used you could lose network access to the
|
||||
# box because your BMC will be sending out bad Gratuitous ARP packets
|
||||
# with the wrong MAC address. You will need to use a console or
|
||||
# override your local ARP cache with the correct addr.
|
||||
|
||||
usage ()
|
||||
{
|
||||
echo "
|
||||
usage: $0 -c <chan> -i <interface> [options]
|
||||
$0 -c <chan> [-v|w|x|y|z address] [options]
|
||||
|
||||
-c channel Which BMC channel to configure [-c help for more info]
|
||||
-i interface Auto-configure BMC based on interface network settings
|
||||
-v address Use specified IP address
|
||||
-w address Use specified Netmask address
|
||||
-x address Use specified MAC address
|
||||
-y address Use specified Gateway IP address
|
||||
-z address Use specified Gateway MAC address
|
||||
-m interface Which IPMI interface to use [default linux=open solaris=lipmi]
|
||||
-p password Set BMC channel password
|
||||
-s string Set SNMP community string
|
||||
-a interval Set Gratuitous ARP interval, off=0, default=4
|
||||
-r Reset BMC channel, zero all network settings, disable
|
||||
-d Debug mode, does not make any changes
|
||||
"
|
||||
exit 0;
|
||||
}
|
||||
|
||||
channel_usage ()
|
||||
{
|
||||
echo "
|
||||
Sun Fire V60x and V65x - Linux 2.4
|
||||
eth0 = channel 6, top
|
||||
eth1 = channel 7, bottom
|
||||
|
||||
Sun Fire V60x and V65x - Linux 2.6
|
||||
eth0 = channel 7, bottom
|
||||
eth1 = channel 6, top
|
||||
|
||||
Sun Fire V60x and V65x - Solaris x86
|
||||
e1000g0 = channel 7, bottom
|
||||
e1000g1 = channel 6, top
|
||||
|
||||
Sun LX50 - Linux
|
||||
eth0 = channel 7, bottom
|
||||
eth1 = channel 6, top
|
||||
|
||||
Sun LX50 - Solaris x86
|
||||
le0 = channel 7, bottom
|
||||
le1 = channel 6, top
|
||||
|
||||
Sun Fire V20z (-i option does not apply)
|
||||
channel 1
|
||||
"
|
||||
exit 0
|
||||
}
|
||||
|
||||
hex_to_ip ()
|
||||
{
|
||||
test $# -ge 1 || return;
|
||||
local HEX B1 B2 B3 B4;
|
||||
HEX=`echo $1 | tr '[:lower:]' '[:upper:]'`;
|
||||
H1=`echo $HEX | cut -c1-2`
|
||||
H2=`echo $HEX | cut -c3-4`
|
||||
H3=`echo $HEX | cut -c5-6`
|
||||
H4=`echo $HEX | cut -c7-8`
|
||||
B1=`echo 10 o 16 i $H1 p | dc`
|
||||
B2=`echo 10 o 16 i $H2 p | dc`
|
||||
B3=`echo 10 o 16 i $H3 p | dc`
|
||||
B4=`echo 10 o 16 i $H4 p | dc`
|
||||
echo "$B1.$B2.$B3.$B4"
|
||||
}
|
||||
|
||||
ipmitool_lan_set ()
|
||||
{
|
||||
[ $# -lt 1 ] && return
|
||||
local PARAM=$1
|
||||
local VALUE=
|
||||
[ $# -ge 2 ] && VALUE=$2
|
||||
|
||||
if [ $DEBUG -gt 0 ]; then
|
||||
echo "Setting LAN parameter $PARAM $VALUE"
|
||||
echo "$IPMITOOL -I $IPMIINTF lan set $CHANNEL $PARAM $VALUE"
|
||||
return
|
||||
fi
|
||||
|
||||
$IPMITOOL -I $IPMIINTF lan set $CHANNEL $PARAM $VALUE
|
||||
}
|
||||
|
||||
ipmitool_lan_reset ()
|
||||
{
|
||||
ipmitool_lan_set "ipsrc" "static"
|
||||
ipmitool_lan_set "ipaddr" "0.0.0.0"
|
||||
ipmitool_lan_set "netmask" "0.0.0.0"
|
||||
ipmitool_lan_set "macaddr" "00:00:00:00:00:00"
|
||||
ipmitool_lan_set "defgw ipaddr" "0.0.0.0"
|
||||
ipmitool_lan_set "defgw macaddr" "00:00:00:00:00:00"
|
||||
ipmitool_lan_set "password"
|
||||
ipmitool_lan_set "snmp" "public"
|
||||
ipmitool_lan_set "arp generate" "off"
|
||||
ipmitool_lan_set "access" "off"
|
||||
exit 0
|
||||
}
|
||||
|
||||
DEBUG=0
|
||||
LINUX=0
|
||||
SOLARIS=0
|
||||
CHANNEL=0
|
||||
IFACE=
|
||||
PASSWORD=
|
||||
SNMP=
|
||||
GRATARP=8
|
||||
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
|
||||
|
||||
case `uname -s` in
|
||||
Linux)
|
||||
IPMIINTF=open
|
||||
IPMITOOL=ipmitool
|
||||
PING=ping
|
||||
IFCONFIG=ifconfig
|
||||
ARP=arp
|
||||
ROUTE=route
|
||||
;;
|
||||
SunOS)
|
||||
IPMIINTF=lipmi
|
||||
IPMITOOL=ipmiadm
|
||||
PING=ping
|
||||
IFCONFIG=ifconfig
|
||||
ARP=arp
|
||||
ROUTE=route
|
||||
;;
|
||||
*)
|
||||
echo "Invalid OS!"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
while getopts "dhri:c:m:p:s:a:v:w:x:y:z:" OPTION ; do
|
||||
case "$OPTION" in
|
||||
i) IFACE=$OPTARG ;;
|
||||
c) CHANNEL=$OPTARG ; test X$CHANNEL = Xhelp && channel_usage ;;
|
||||
m) IPMIINTF=$OPTARG ;;
|
||||
p) PASSWORD=$OPTARG ;;
|
||||
s) SNMP=$OPTARG ;;
|
||||
a) GRATARP=$OPTARG ;;
|
||||
d) DEBUG=1 ;;
|
||||
v) IP_ADDRESS=$OPTARG ;;
|
||||
w) IP_NETMASK=$OPTARG ;;
|
||||
x) MAC_ADDRESS=$OPTARG ;;
|
||||
y) GATEWAY_IP=$OPTARG ;;
|
||||
z) GATEWAY_MAC=$OPTARG ;;
|
||||
r) ipmitool_lan_reset ;;
|
||||
h) usage ;;
|
||||
*) echo "Ignoring invalid option : -$OPTARG" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -x `which $IPMITOOL` ]; then
|
||||
echo "Error: unable to find $IPMITOOL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $CHANNEL -eq 0 ]; then
|
||||
echo
|
||||
echo "Error: you must specify a channel with -c"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$IFACE" ]; then
|
||||
if ! $IFCONFIG $IFACE 2>/dev/null | grep "inet " >/dev/null 2>&1 ; then
|
||||
echo
|
||||
echo "Error: unable to find interface $IFACE"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
echo "Auto-configuring $IFACE (channel $CHANNEL)"
|
||||
fi
|
||||
|
||||
case `uname -s` in
|
||||
SunOS)
|
||||
if [ X$IFACE != X ]; then
|
||||
if [ X$IP_ADDRESS = X ]; then
|
||||
IP_ADDRESS=`$IFCONFIG $IFACE | grep inet | awk '{print $2}'`
|
||||
fi
|
||||
if [ X$IP_NETMASK = X ]; then
|
||||
HEX_NETMASK=`$IFCONFIG $IFACE | grep netmask | awk '{print $4}'`
|
||||
IP_NETMASK=`hex_to_ip $HEX_NETMASK`
|
||||
fi
|
||||
if [ X$MAC_ADDRESS = X ]; then
|
||||
MAC_ADDRESS=`$IFCONFIG $IFACE | grep ether | awk '{print $2}'`
|
||||
fi
|
||||
if [ X$GATEWAY_IP = X ]; then
|
||||
GATEWAY_IP=`$ROUTE -n get default | grep gateway: | awk '{print $2}'`
|
||||
fi
|
||||
if [ X$GATEWAY_MAC = X ]; then
|
||||
$PING -i $IFACE $GATEWAY_IP 1 >/dev/null 2>&1
|
||||
GATEWAY_MAC=`$ARP $GATEWAY_IP | awk '{print $4}'`
|
||||
if [ X$GATEWAY_MAC = Xno ]; then
|
||||
GATEWAY_MAC=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
Linux)
|
||||
if [ X$IFACE != X ]; then
|
||||
if [ X$IP_ADDRESS = X ]; then
|
||||
IP_ADDRESS=`$IFCONFIG $IFACE | grep "inet addr" | awk -F"[:[:space:]]+" '{print $4}'`
|
||||
fi
|
||||
if [ X$IP_NETMASK = X ]; then
|
||||
IP_NETMASK=`$IFCONFIG $IFACE | grep Bcast | awk -F"[:[:space:]]+" '{print $8}'`
|
||||
fi
|
||||
if [ X$MAC_ADDRESS = X ]; then
|
||||
MAC_ADDRESS=`$IFCONFIG $IFACE | grep HWaddr | awk '{print $5}'`
|
||||
fi
|
||||
if [ X$GATEWAY_IP = X ]; then
|
||||
GATEWAY_IP=`$ROUTE -n | awk '/^0.0.0.0/ {print $2}'`
|
||||
fi
|
||||
if [ X$GATEWAY_MAC = X ]; then
|
||||
$PING -q -c1 $GATEWAY_IP >/dev/null 2>&1
|
||||
GATEWAY_MAC=`$ARP -an | grep "$GATEWAY_IP[^0-9]" | awk '{print $4}'`
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ X$IP_ADDRESS != X ]; then
|
||||
ipmitool_lan_set "ipsrc" "static"
|
||||
ipmitool_lan_set "ipaddr" "$IP_ADDRESS"
|
||||
fi
|
||||
|
||||
if [ X$IP_NETMASK != X ]; then
|
||||
ipmitool_lan_set "netmask" "$IP_NETMASK"
|
||||
fi
|
||||
|
||||
if [ X$MAC_ADDRESS != X ]; then
|
||||
ipmitool_lan_set "macaddr" "$MAC_ADDRESS"
|
||||
fi
|
||||
|
||||
if [ X$GATEWAY_IP != X ]; then
|
||||
ipmitool_lan_set "defgw ipaddr" "$GATEWAY_IP"
|
||||
fi
|
||||
|
||||
if [ X$GATEWAY_MAC != X ]; then
|
||||
ipmitool_lan_set "defgw macaddr" "$GATEWAY_MAC"
|
||||
fi
|
||||
|
||||
if [ X$PASSWORD != X ]; then
|
||||
ipmitool_lan_set "password" "$PASSWORD"
|
||||
fi
|
||||
|
||||
if [ X$SNMP != X ]; then
|
||||
ipmitool_lan_set "snmp" "$SNMP"
|
||||
fi
|
||||
|
||||
if [ "$GRATARP" -ne 0 ]; then
|
||||
ipmitool_lan_set "arp generate" "on"
|
||||
ipmitool_lan_set "arp interval" "$GRATARP"
|
||||
else
|
||||
ipmitool_lan_set "arp generate" "off"
|
||||
fi
|
||||
|
||||
echo "Setting channel authentication capabilities"
|
||||
ipmitool_lan_set "auth callback,user,operator,admin" "md2,md5"
|
||||
|
||||
echo "Enabling channel $CHANNEL"
|
||||
ipmitool_lan_set "access" "on"
|
||||
ipmitool_lan_set "user"
|
||||
|
||||
exit 0
|
29
ipmitool/contrib/collect_data.sh
Executable file
29
ipmitool/contrib/collect_data.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2003 Fredrik Ohrn. All Rights Reserved.
|
||||
#
|
||||
# See the included COPYING file for license details.
|
||||
#
|
||||
|
||||
# Edit the variables
|
||||
|
||||
hostname=$HOSTNAME
|
||||
|
||||
ipmi_cmd="/usr/local/bin/ipmitool -I open"
|
||||
rrd_dir="/some/dir/rrd"
|
||||
|
||||
# No need to edit below this point.
|
||||
|
||||
IFS="
|
||||
"
|
||||
|
||||
for line in `eval $ipmi_cmd -c sdr list full` ; do
|
||||
|
||||
IFS=,
|
||||
|
||||
split=($line)
|
||||
|
||||
file="$rrd_dir/$hostname-${split[0]}.rrd"
|
||||
|
||||
rrdupdate "$file" "N:${split[1]}"
|
||||
done
|
40
ipmitool/contrib/create_rrds.sh
Executable file
40
ipmitool/contrib/create_rrds.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2003 Fredrik Ohrn. All Rights Reserved.
|
||||
#
|
||||
# See the included COPYING file for license details.
|
||||
#
|
||||
|
||||
# Edit the variables
|
||||
|
||||
hostname=$HOSTNAME
|
||||
|
||||
ipmi_cmd="/usr/local/bin/ipmitool -I open"
|
||||
rrd_dir="/some/dir/rrd"
|
||||
|
||||
# No need to edit below this point.
|
||||
|
||||
IFS="
|
||||
"
|
||||
|
||||
for line in `eval $ipmi_cmd -c -v sdr list full` ; do
|
||||
|
||||
IFS=,
|
||||
|
||||
split=($line)
|
||||
|
||||
file="$rrd_dir/$hostname-${split[0]}.rrd"
|
||||
|
||||
if [ -e "$file" ] ; then
|
||||
echo "Skipping existing file $file"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Creating file $file"
|
||||
|
||||
rrdtool create "$file" \
|
||||
--step 300 DS:var:GAUGE:900:${split[16]}:${split[17]} \
|
||||
RRA:AVERAGE:0.5:1:288 \
|
||||
RRA:AVERAGE:0.5:6:336 \
|
||||
RRA:AVERAGE:0.5:12:720
|
||||
done
|
211
ipmitool/contrib/create_webpage.sh
Executable file
211
ipmitool/contrib/create_webpage.sh
Executable file
@ -0,0 +1,211 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2003-2004 Fredrik Ohrn. All Rights Reserved.
|
||||
#
|
||||
# See the included COPYING file for license details.
|
||||
#
|
||||
|
||||
# Edit the variables
|
||||
|
||||
hostname=$HOSTNAME
|
||||
|
||||
ipmi_cmd="/usr/local/bin/ipmitool -I open"
|
||||
rrd_dir="/some/dir/rrd"
|
||||
|
||||
# Full path to the rrdcgi executable.
|
||||
rrdcgi=/usr/local/bin/rrdcgi
|
||||
|
||||
# Where should rrdcgi store the graphs? This path must be within the
|
||||
# document root and writable by the webserver user.
|
||||
img_dir=/usr/local/apache2/htdocs/images/graphs
|
||||
|
||||
# Where will the graphs show up on the webserver?
|
||||
web_dir=/images/graphs
|
||||
|
||||
# Size of graph area (excluding title, legends etc.)
|
||||
graph_width=500
|
||||
graph_height=150
|
||||
|
||||
# Graphs to include on page
|
||||
graph_daily=1
|
||||
graph_weekly=1
|
||||
graph_monthly=0
|
||||
|
||||
|
||||
# No need to edit below this point.
|
||||
|
||||
color[0]="2020FF"
|
||||
color[1]="20FF20"
|
||||
color[2]="FF2020"
|
||||
color[3]="FF21FF"
|
||||
color[4]="21FFFF"
|
||||
color[5]="FFFF21"
|
||||
color[6]="8F21FF"
|
||||
color[7]="21FF8F"
|
||||
color[8]="FF8F21"
|
||||
color[9]="FF2190"
|
||||
color[10]="2190FF"
|
||||
color[11]="90FF21"
|
||||
|
||||
cat << EOF
|
||||
#!$rrdcgi
|
||||
<html>
|
||||
<head>
|
||||
<title>$hostname</title>
|
||||
<RRD::GOODFOR 300>
|
||||
<body>
|
||||
<h2>$hostname</h2>
|
||||
EOF
|
||||
|
||||
|
||||
IFS="
|
||||
"
|
||||
|
||||
i=0
|
||||
groups=
|
||||
|
||||
for line in `eval $ipmi_cmd -c -v sdr list full` ; do
|
||||
|
||||
IFS=,
|
||||
|
||||
split=($line)
|
||||
|
||||
file="$rrd_dir/$hostname-${split[0]}.rrd"
|
||||
group=`echo "${split[2]} ${split[*]:10:6}" | tr ' .-' ___`
|
||||
|
||||
group_color=${group}_color
|
||||
|
||||
if [ -z "${!group}" ] ; then
|
||||
groups="$groups $group"
|
||||
|
||||
declare $group_color=0
|
||||
|
||||
group_unit=${group}_unit
|
||||
declare $group_unit="${split[2]}"
|
||||
|
||||
group_title=${group}_title
|
||||
declare $group_title="${split[5]} / ${split[6]}"
|
||||
|
||||
group_thres=${group}_thres
|
||||
declare $group_thres="${split[10]},${split[11]},${split[12]},${split[13]},${split[14]},${split[15]}"
|
||||
fi
|
||||
|
||||
declare $group="${!group}
|
||||
DEF:var$i=\"$file\":var:AVERAGE LINE1:var$i#${color[${!group_color}]}:\"${split[0]}\""
|
||||
|
||||
declare $group_color=$[ ${!group_color} + 1 ]
|
||||
|
||||
c=$[ c + 1 ]
|
||||
i=$[ i + 1 ]
|
||||
done
|
||||
|
||||
IFS=" "
|
||||
|
||||
for group in $groups ; do
|
||||
|
||||
group_unit=${group}_unit
|
||||
group_title=${group}_title
|
||||
group_thres=${group}_thres
|
||||
|
||||
IFS=,
|
||||
|
||||
split=(${!group_thres})
|
||||
|
||||
thres=
|
||||
|
||||
if [ -n "${split[0]}" ] ; then
|
||||
if [ -n "${split[3]}" ] ; then
|
||||
thres="
|
||||
HRULE:${split[0]}#000000
|
||||
HRULE:${split[3]}#000000:\"Upper & lower non-recoverable thresholds\""
|
||||
else
|
||||
thres="
|
||||
HRULE:${split[0]}#000000:\"Upper non-recoverable threshold\""
|
||||
fi
|
||||
else
|
||||
if [ -n "${split[3]}" ] ; then
|
||||
thres="
|
||||
HRULE:${split[3]}#000000:\"Lower non-recoverable threshold\""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${split[1]}" ] ; then
|
||||
if [ -n "${split[4]}" ] ; then
|
||||
thres="$thres
|
||||
HRULE:${split[1]}#FF0000
|
||||
HRULE:${split[4]}#FF0000:\"Upper & lower critical thresholds\""
|
||||
else
|
||||
thres="$thres
|
||||
HRULE:${split[1]}#FF0000:\"Upper critical threshold\""
|
||||
fi
|
||||
else
|
||||
if [ -n "${split[4]}" ] ; then
|
||||
thres="$thres
|
||||
HRULE:${split[4]}#FF0000:\"Lower critical threshold\""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${split[2]}" ] ; then
|
||||
if [ -n "${split[5]}" ] ; then
|
||||
thres="$thres
|
||||
HRULE:${split[2]}#FFCC00
|
||||
HRULE:${split[5]}#FFCC00:\"Upper & lower warning thresholds\""
|
||||
else
|
||||
thres="$thres
|
||||
HRULE:${split[2]}#FFCC00:\"Upper warning threshold\""
|
||||
fi
|
||||
else
|
||||
if [ -n "${split[5]}" ] ; then
|
||||
thres="$thres
|
||||
HRULE:${split[5]}#FFCC00:\"Lower warning threshold\""
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "<h3>${!group_title}</h3>"
|
||||
|
||||
if [ "$graph_daily" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-daily.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Daily graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group} $thres
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$graph_weekly" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-weekly.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--start -7d
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Weelky graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group} $thres
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$graph_monthly" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-monthly.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--start -30d
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Monthly graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group} $thres
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
|
||||
cat << EOF
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
151
ipmitool/contrib/create_webpage_compact.sh
Executable file
151
ipmitool/contrib/create_webpage_compact.sh
Executable file
@ -0,0 +1,151 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2003-2004 Fredrik Ohrn. All Rights Reserved.
|
||||
#
|
||||
# See the included COPYING file for license details.
|
||||
#
|
||||
|
||||
# Edit the variables
|
||||
|
||||
hostname=$HOSTNAME
|
||||
|
||||
ipmi_cmd="/usr/local/bin/ipmitool -I open"
|
||||
rrd_dir="/some/dir/rrd"
|
||||
|
||||
# Full path to the rrdcgi executable.
|
||||
rrdcgi=/usr/local/bin/rrdcgi
|
||||
|
||||
# Where should rrdcgi store the graphs? This path must be within the
|
||||
# document root and writable by the webserver user.
|
||||
img_dir=/usr/local/apache2/htdocs/images/graphs
|
||||
|
||||
# Where will the graphs show up on the webserver?
|
||||
web_dir=/images/graphs
|
||||
|
||||
# Size of graph area (excluding title, legends etc.)
|
||||
graph_width=500
|
||||
graph_height=150
|
||||
|
||||
# Graphs to include on page
|
||||
graph_daily=1
|
||||
graph_weekly=1
|
||||
graph_monthly=0
|
||||
|
||||
|
||||
# No need to edit below this point.
|
||||
|
||||
color[0]="2020FF"
|
||||
color[1]="20FF20"
|
||||
color[2]="FF2020"
|
||||
color[3]="FF21FF"
|
||||
color[4]="21FFFF"
|
||||
color[5]="FFFF21"
|
||||
color[6]="8F21FF"
|
||||
color[7]="21FF8F"
|
||||
color[8]="FF8F21"
|
||||
color[9]="FF2190"
|
||||
color[10]="2190FF"
|
||||
color[11]="90FF21"
|
||||
|
||||
cat << EOF
|
||||
#!$rrdcgi
|
||||
<html>
|
||||
<head>
|
||||
<title>$hostname</title>
|
||||
<RRD::GOODFOR 300>
|
||||
<body>
|
||||
<h2>$hostname</h2>
|
||||
EOF
|
||||
|
||||
|
||||
IFS="
|
||||
"
|
||||
|
||||
i=0
|
||||
groups=
|
||||
|
||||
for line in `eval $ipmi_cmd -c -v sdr list full` ; do
|
||||
|
||||
IFS=,
|
||||
|
||||
split=($line)
|
||||
|
||||
file="$rrd_dir/$hostname-${split[0]}.rrd"
|
||||
group=`echo "${split[2]}" | tr ' .-' ___`
|
||||
|
||||
group_color=${group}_color
|
||||
|
||||
if [ -z "${!group}" ] ; then
|
||||
groups="$groups $group"
|
||||
|
||||
declare $group_color=0
|
||||
|
||||
group_unit=${group}_unit
|
||||
declare $group_unit="${split[2]}"
|
||||
fi
|
||||
|
||||
declare $group="${!group}
|
||||
DEF:var$i=\"$file\":var:AVERAGE LINE1:var$i#${color[${!group_color}]}:\"${split[0]}\""
|
||||
|
||||
declare $group_color=$[ ${!group_color} + 1 ]
|
||||
|
||||
c=$[ c + 1 ]
|
||||
i=$[ i + 1 ]
|
||||
done
|
||||
|
||||
IFS=" "
|
||||
|
||||
for group in $groups ; do
|
||||
|
||||
group_unit=${group}_unit
|
||||
|
||||
IFS=,
|
||||
|
||||
echo "<h3>${!group_unit}</h3>"
|
||||
|
||||
if [ "$graph_daily" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-daily.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Daily graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group}
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$graph_weekly" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-weekly.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--start -7d
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Weelky graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group}
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$graph_monthly" -ne 0 ] ; then
|
||||
cat << EOF
|
||||
<RRD::GRAPH "$img_dir/$hostname-$group-monthly.gif"
|
||||
--imginfo "<img src="$web_dir/%s" width="%lu" height="%lu">"
|
||||
--lazy
|
||||
--start -30d
|
||||
--vertical-label "${!group_unit}"
|
||||
--title "Monthly graph"
|
||||
--height $graph_height
|
||||
--width $graph_width ${!group}
|
||||
>
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
|
||||
cat << EOF
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
17
ipmitool/contrib/ipmi.init.basic
Executable file
17
ipmitool/contrib/ipmi.init.basic
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Setting up OpenIPMI driver..."
|
||||
|
||||
# load the ipmi modules
|
||||
modprobe ipmi_msghandler
|
||||
modprobe ipmi_devintf
|
||||
if ! modprobe ipmi_kcs_drv ; then
|
||||
modprobe ipmi_si # try new module name
|
||||
fi
|
||||
|
||||
maj=$(cat /proc/devices | awk '/ipmidev/{print $1}')
|
||||
if [ "$maj" ]; then
|
||||
test -e /dev/ipmi0 && rm -f /dev/ipmi0
|
||||
/bin/mknod /dev/ipmi0 c $maj 0
|
||||
fi
|
||||
|
222
ipmitool/contrib/ipmi.init.redhat
Executable file
222
ipmitool/contrib/ipmi.init.redhat
Executable file
@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: 2345 11 60
|
||||
# description: start, stop, or query ipmi system monitoring tools
|
||||
# config: /etc/sysconfig/ipmi
|
||||
#
|
||||
# For Redhat, Fedora, or similar systems. Handles both 2.4 and 2.6
|
||||
# configurations. Requires an /etc/sysconfig/ipmi file to function,
|
||||
# see below.
|
||||
#
|
||||
# Phil Hollenback
|
||||
# philiph@pobox.com
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Exit silently if we don't have a sysconfig file,
|
||||
# and read IPMI setting from it to determine whether or
|
||||
# not to continue.
|
||||
# The only current setting is ipmi={YES|NO}, whether or not
|
||||
# to enable IPMI.
|
||||
[ -f /etc/sysconfig/ipmi ] || exit 0
|
||||
. /etc/sysconfig/ipmi
|
||||
[ "${IPMI}" = "yes" ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
echo -n $"Starting ipmi: "
|
||||
|
||||
# If ipmidev isn't listed in /proc/devices, try
|
||||
# loading the modules.
|
||||
if ! grep -q ipmidev /proc/devices
|
||||
then
|
||||
/sbin/modprobe ipmi_msghandler || RETVAL=1
|
||||
/sbin/modprobe ipmi_devintf || RETVAL=1
|
||||
# Try loading new driver module, fall back to old
|
||||
# module if that fails.
|
||||
if ! /sbin/modprobe ipmi_si >/dev/null 2>&1
|
||||
then
|
||||
/sbin/modprobe ipmi_kcs_drv || RETVAL=1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# If ipmidev still isn't listed in /proc/devices after we load
|
||||
# modules, this just isn't going to work. Set RETVAL to mark
|
||||
# this failure.
|
||||
grep -q ipmidev /proc/devices || RETVAL=1
|
||||
|
||||
# remove old device file always
|
||||
# in case ipmi gets assigned new dynamic major number from kernel
|
||||
if [ -c /dev/ipmi0 ]; then
|
||||
rm -f /dev/ipmi0
|
||||
fi
|
||||
|
||||
# Check if the device file exists and create if not.
|
||||
if [ ! -c /dev/ipmi0 ] && [ $RETVAL -eq 0 ]
|
||||
then
|
||||
major=$(awk '/ ipmidev$/{print $1}' /proc/devices)
|
||||
/bin/mknod -m 0600 /dev/ipmi0 c $major 0 || RETVAL=1
|
||||
fi
|
||||
|
||||
if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipmi ; then
|
||||
echo_success
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Shutting down ipmi: "
|
||||
|
||||
# Stop doesn't actually do anything because we currently don't
|
||||
# unload ipmi modules on stop. That might change in the future
|
||||
# if we decide unloading the ipmi modules is safe.
|
||||
RETVAL=0
|
||||
|
||||
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipmi ; then
|
||||
echo_success
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
dostatus() {
|
||||
# Extract cpu temperatures from ipmitool output.
|
||||
|
||||
# Abort if we don't have the ipmitool program.
|
||||
if ! /usr/bin/ipmitool -V >/dev/null
|
||||
then
|
||||
echo "/usr/bin/ipmitool not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Abort if ipmi isn't loaded.
|
||||
if ! grep -q ipmidev /proc/devices
|
||||
then
|
||||
echo "ipmi not listed in /proc/devices!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we are running on a v1.0 IPMI system, and
|
||||
# change our processor search string appropriately.
|
||||
if /usr/bin/ipmitool -I open bmc info | \
|
||||
grep -q "IPMI Version.*1.0"
|
||||
then
|
||||
IpmiVersion="1.0"
|
||||
fi
|
||||
|
||||
# Determine # of running processors
|
||||
NumProcs=$(grep -c processor /proc/cpuinfo)
|
||||
if [ $NumProcs -eq 0 ]
|
||||
then
|
||||
echo "Can't determine number of processors!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Now build the query string. Concatenate it into
|
||||
# one string because that's more efficient on 2.4 systems.
|
||||
Count=1
|
||||
TempString=""
|
||||
while [ $Count -le $NumProcs ]
|
||||
do
|
||||
if [ x$IpmiVersion = x"1.0" ]
|
||||
then
|
||||
TempString="$TempString CPU\ $Count"
|
||||
else
|
||||
TempString="$TempString Processor$Count\ Temp"
|
||||
fi
|
||||
Count=$((Count + 1))
|
||||
done
|
||||
# building TempString like this and eval'ing it is ugly, but
|
||||
# it's the only way I could make the quoting work. Sorry.
|
||||
TempString="/usr/bin/ipmitool -I open sensor get $TempString"
|
||||
eval $TempString | awk -v "c=$Count" '
|
||||
BEGIN {
|
||||
n = 1
|
||||
}
|
||||
/Sensor Reading/ {
|
||||
printf "CPU%s Temp: %s\n",n,$4
|
||||
n++
|
||||
}
|
||||
END {
|
||||
if ( n != c) {
|
||||
printf "Error: found %s CPUs, but got temps for %s\n",--c,--n >"/dev/stderr"
|
||||
exit 1
|
||||
}
|
||||
exit 0
|
||||
}'
|
||||
RETVAL=$((RETVAL + $?))
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
}
|
||||
|
||||
condrestart() {
|
||||
[ -e /var/lock/subsys/ipmi ] && restart || :
|
||||
}
|
||||
|
||||
remove () {
|
||||
# Actually remove the drivers. Don't do during stop in case
|
||||
# this causes system to become unstable (a la lm_sensors)
|
||||
if /sbin/lsmod | awk '{print $1}' | grep -q ipmi_
|
||||
then
|
||||
# Try removing both 2.4 and 2.6 modules.
|
||||
/sbin/rmmod ipmi_si 2>/dev/null
|
||||
/sbin/rmmod ipmi_kcs_drv 2>/dev/null
|
||||
/sbin/rmmod ipmi_devintf
|
||||
/sbin/rmmod ipmi_msghandler
|
||||
else
|
||||
echo "No ipmi modules loaded!" >&2
|
||||
RETVAL=1
|
||||
return $RETVAL
|
||||
fi
|
||||
|
||||
# Wait a sec to give modules time to unload.
|
||||
sleep 1
|
||||
|
||||
# Check if we failed to remove any modules, and complain if so.
|
||||
if /sbin/lsmod | awk '{print $1}' | grep -q ipmi_
|
||||
then
|
||||
echo "ipmi modules still loaded!" >&2
|
||||
RETVAL=1
|
||||
return $RETVAL
|
||||
fi
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
dostatus
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
condrestart
|
||||
;;
|
||||
remove)
|
||||
remove
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ipmi {start|stop|status|restart|condrestart|remove}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
92
ipmitool/contrib/ipmievd.init.debian
Executable file
92
ipmitool/contrib/ipmievd.init.debian
Executable file
@ -0,0 +1,92 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $local_fs $remote_fs $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Short-Description: IPMI event daemon
|
||||
# Description: ipmievd is a daemon which will listen for events
|
||||
# from the BMC that are being sent to the SEL and
|
||||
# also log those messages to syslog.
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Elmar Hoffmann <elho@elho.net>
|
||||
# Licence: This script is public domain using the same
|
||||
# licence as ipmitool itself.
|
||||
# Modified by: Petter Reinholdtsen
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="IPMI event daemon"
|
||||
NAME=ipmievd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
|
||||
}
|
||||
|
||||
CODE=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
|
||||
d_start || CODE=$?
|
||||
[ "$VERBOSE" != no ] && log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC" "$NAME"
|
||||
d_stop || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC" "$NAME"
|
||||
d_stop || true
|
||||
sleep 1
|
||||
d_start || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
87
ipmitool/contrib/ipmievd.init.redhat
Executable file
87
ipmitool/contrib/ipmievd.init.redhat
Executable file
@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# /etc/rc.d/init.d/ipmievd
|
||||
#
|
||||
# Based on example sysvinitfiles script
|
||||
# Copyright (c) 2000 Red Hat Software, Inc.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon to send events to syslog
|
||||
# processname: ipmievd
|
||||
# config: /etc/sysconfig/ipmievd
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config file
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
start() {
|
||||
echo "Starting ipmievd:"
|
||||
if [ -f /var/lock/subsys/ipmievd ]; then
|
||||
return 0
|
||||
fi
|
||||
daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && touch /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Shutting down ipmievd:"
|
||||
killproc $IPMIEVD_BIN
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && rm -f /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status $IPMIEVD_BIN
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/ipmievd ] && restart || :
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ipmievd {start|stop|status|reload|restart|condrestart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit $?
|
212
ipmitool/contrib/ipmievd.init.suse
Executable file
212
ipmitool/contrib/ipmievd.init.suse
Executable file
@ -0,0 +1,212 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# System startup script for ipmievd
|
||||
# Based on skeleton.compat example script
|
||||
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
|
||||
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work
|
||||
# on other distributions as well, by using the LSB (Linux Standard Base)
|
||||
# or RH functions or by open coding the needed functions.
|
||||
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not
|
||||
# to use this template.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
#
|
||||
|
||||
# Check for missing binaries (stale symlinks should not happen)
|
||||
# Note: Special treatment of stop for LSB conformance
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file and read it
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
if test -e /etc/rc.status; then
|
||||
# SUSE rc script library
|
||||
. /etc/rc.status
|
||||
else
|
||||
export LC_ALL=POSIX
|
||||
_cmd=$1
|
||||
declare -a _SMSG
|
||||
if test "${_cmd}" = "status"; then
|
||||
_SMSG=(running dead dead unused unknown reserved)
|
||||
_RC_UNUSED=3
|
||||
else
|
||||
_SMSG=(done failed failed missed failed skipped unused failed failed reserved)
|
||||
_RC_UNUSED=6
|
||||
fi
|
||||
if test -e /lib/lsb/init-functions; then
|
||||
# LSB
|
||||
. /lib/lsb/init-functions
|
||||
echo_rc()
|
||||
{
|
||||
if test ${_RC_RV} = 0; then
|
||||
log_success_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
log_failure_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
# TODO: Add checking for lockfiles
|
||||
checkproc() { return pidofproc ${1+"$@"} >/dev/null 2>&1; }
|
||||
elif test -e /etc/init.d/functions; then
|
||||
# RHAT
|
||||
. /etc/init.d/functions
|
||||
echo_rc()
|
||||
{
|
||||
#echo -n " [${_SMSG[${_RC_RV}]}] "
|
||||
if test ${_RC_RV} = 0; then
|
||||
success " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
failure " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
checkproc() { return status ${1+"$@"}; }
|
||||
start_daemon() { return daemon ${1+"$@"}; }
|
||||
else
|
||||
# emulate it
|
||||
echo_rc() { echo " [${_SMSG[${_RC_RV}]}] "; }
|
||||
fi
|
||||
rc_reset() { _RC_RV=0; }
|
||||
rc_failed()
|
||||
{
|
||||
if test -z "$1"; then
|
||||
_RC_RV=1;
|
||||
elif test "$1" != "0"; then
|
||||
_RC_RV=$1;
|
||||
fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_check()
|
||||
{
|
||||
return rc_failed $?
|
||||
}
|
||||
rc_status()
|
||||
{
|
||||
rc_failed $?
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-v"; then echo_rc; shift; fi
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_exit() { exit ${_RC_RV}; }
|
||||
rc_active()
|
||||
{
|
||||
if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
|
||||
if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
# Return values acc. to LSB for all commands but status:
|
||||
# 0 - success
|
||||
# 1 - generic or unspecified error
|
||||
# 2 - invalid or excess argument(s)
|
||||
# 3 - unimplemented feature (e.g. "reload")
|
||||
# 4 - user had insufficient privileges
|
||||
# 5 - program is not installed
|
||||
# 6 - program is not configured
|
||||
# 7 - program is not running
|
||||
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
#
|
||||
# Note that starting an already running service, stopping
|
||||
# or restarting a not-running service as well as the restart
|
||||
# with force-reload (in case signaling is not supported) are
|
||||
# considered a success.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ipmievd "
|
||||
start_daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down ipmievd "
|
||||
killproc -TERM $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
## Do a restart only if the service was active before.
|
||||
## Note: try-restart is now part of LSB (as of 1.9).
|
||||
## RH has a similar command named condrestart.
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
force-reload)
|
||||
echo -n "Reload service ipmievd "
|
||||
$0 try-restart
|
||||
rc_status
|
||||
;;
|
||||
reload)
|
||||
rc_failed 3
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service ipmievd "
|
||||
checkproc $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload| reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
202
ipmitool/contrib/oem_ibm_sel_map
Normal file
202
ipmitool/contrib/oem_ibm_sel_map
Normal file
@ -0,0 +1,202 @@
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x04","Chassis Number","Memory Card","Completion Code (0x00=Success)","0x00","Memory hot replace event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x05","Chassis Number","Memory Card","Memory Size (in 512MB units)","0x00","Memory hot add event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","Chassis Number","Scalability Port Number","R","0x00","Scalability link down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","Chassis Number","Scalability Port Number","R","0x00","Scalability link up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x02","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x03","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x80","Chassis Number","Scalability Port Number","R","0x00","Scalability link PFA"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x81","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid port"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x82","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid node"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x83","Chassis Number","Scalability Port Number","R","0x00","Scalability link kill"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Requested resources not available"
|
||||
"0xE0","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x10","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Requested resources not available"
|
||||
"0xE0","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x10","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x01","0x00","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Processor has failed BIST"
|
||||
"0xE0","0x01","0x01","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Unable to apply processor microcode update"
|
||||
"0xE0","0x01","0x02","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","POST does not support current stepping level of processor"
|
||||
"0xE0","0x01","0x03","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","CPU mismatch detected"
|
||||
"0xE0","0x02","0x00","Chassis Number","Memory Card","Memory DIMM","R","R","R","R","R","R","R","0x00","Uncorrectable memory error occurred"
|
||||
"0xE0","0x02","0x01","Chassis Number","Memory Card","Memory DIMM","Failing Symbol","R","R","R","R","R","R","0x00","Correctable memory threshold occurred"
|
||||
"0xE0","0x02","0x02","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM enabled"
|
||||
"0xE0","0x02","0x02 ","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x02 ","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x02 ","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x02 ","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE0","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","R","0x00","Memory card enabled"
|
||||
"0xE0","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","R","0x00","Memory card disabled"
|
||||
"0xE0","0x02","0x00","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM enabled"
|
||||
"0xE0","0x02","0x00","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x00","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x00","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x00","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE1","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","Unknown SERR/PERR detected on PCI bus"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master read parity error"
|
||||
"0xE1","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received target parity error"
|
||||
"0xE1","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master write parity error"
|
||||
"0xE1","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Device signaled SERR"
|
||||
"0xE1","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Slave signaled parity error"
|
||||
"0xE1","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Signaled Target Abort"
|
||||
"0xE1","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received Master Abort"
|
||||
"0xE1","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Completion Discarded"
|
||||
"0xE1","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Correctable ECC Error"
|
||||
"0xE1","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received split completion error"
|
||||
"0xE1","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master read parity error"
|
||||
"0xE1","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received target parity error"
|
||||
"0xE1","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master write parity error"
|
||||
"0xE1","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Device Signaled SERR"
|
||||
"0xE1","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Slave Signaled Parity Error"
|
||||
"0xE1","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Signaled Target Abort"
|
||||
"0xE1","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received Master Abort"
|
||||
"0xE1","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Split Completion Discarded"
|
||||
"0xE1","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Correctable ECC Error"
|
||||
"0xE1","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received split completion error"
|
||||
"0xE1","0x00","0x20","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x21","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Address Parity Error"
|
||||
"0xE1","0x00","0x22","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x23","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Asserted"
|
||||
"0xE1","0x00","0x24","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PERR Received by Calgary on a PCIX Split Completion"
|
||||
"0xE1","0x00","0x25","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Address"
|
||||
"0xE1","0x00","0x27","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: TCE Extent Error"
|
||||
"0xE1","0x00","0x29","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Page Fault"
|
||||
"0xE1","0x00","0x2B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unauthorized Access"
|
||||
"0xE1","0x00","0x2D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Parity Error in DMA Read Data Buffer"
|
||||
"0xE1","0x00","0x2F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Time Out"
|
||||
"0xE1","0x00","0x31","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Delayed Read Timeout"
|
||||
"0xE1","0x00","0x33","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal Error on PCIX Split Completion"
|
||||
"0xE1","0x00","0x35","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Read Reply (RIO) Timeout"
|
||||
"0xE1","0x00","0x37","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on DMA Write"
|
||||
"0xE1","0x00","0x39","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Valid Bit Off"
|
||||
"0xE1","0x00","0x3B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Index Invalid"
|
||||
"0xE1","0x00","0x40","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x41","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Detected"
|
||||
"0xE1","0x00","0x42","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x43","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: No DEVSEL#"
|
||||
"0xE1","0x00","0x45","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bus Time Out"
|
||||
"0xE1","0x00","0x47","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Retry Count Expired"
|
||||
"0xE1","0x00","0x49","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target-Abort"
|
||||
"0xE1","0x00","0x4B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Size"
|
||||
"0xE1","0x00","0x4D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Access Not Enabled"
|
||||
"0xE1","0x00","0x4F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Store"
|
||||
"0xE1","0x00","0x51","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Response Received"
|
||||
"0xE1","0x00","0x53","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Error Status Received"
|
||||
"0xE1","0x00","0x55","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected PCIX Split Completion Received"
|
||||
"0xE1","0x00","0x57","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Timeout"
|
||||
"0xE1","0x00","0x59","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Recoverable Error Summary Bit"
|
||||
"0xE1","0x00","0x5B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: CSR Error Summary Bit"
|
||||
"0xE1","0x00","0x5D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Load"
|
||||
"0xE1","0x00","0x61","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bad Command"
|
||||
"0xE1","0x00","0x63","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Length Field Invalid"
|
||||
"0xE1","0x00","0x65","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Load Greater Than 8 & No Write Buffer Enabled"
|
||||
"0xE1","0x00","0x67","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Discontiguous Byte Enable Error"
|
||||
"0xE1","0x00","0x69","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: 4K Address Boundary Crossing Error"
|
||||
"0xE1","0x00","0x6B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Store Wrap State Machine Check"
|
||||
"0xE1","0x00","0x6D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target State Machine Check"
|
||||
"0xE1","0x00","0x6F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DW"
|
||||
"0xE1","0x00","0x71","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DR"
|
||||
"0xE1","0x00","0x73","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PS/DW"
|
||||
"0xE1","0x00","0x75","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Write Command FIFO Parity Error"
|
||||
"0xE1","0x00","0x76","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x77","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x81","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PCI-to-PCI Bridge Discard Timer Error"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","SERR detected on PCI bus"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","PERR detected on PCI bus"
|
||||
"0xE1","0x01","0x00","R","R","Bank (LSB)","Bank (MSB)","Apic ID (LSB)","Apic ID (MSB)","CK4(LSB)","CK4","CK4","CK4(MSB)","0x00","Processor Error Information Data A"
|
||||
"0xE1","0x01","0x01","R","R","Address high (LSB)","Address high","Address high","Address high (MSB)","Address low (LSB)","Address low ","Address low ","Address low (MSB)","0x00","Processor Error Information Data B1"
|
||||
"0xE1","0x01","0x02","R","R","Timestamp high (LSB)","Timestamp high","Timestamp high","Timestamp high (MSB)","Timestamp Low (LSB)","Timestamp low","Timestamp low","Timestamp low (MSB)","0x00","Processor Error Information Data B2"
|
||||
"0xE1","0x01","0x03","R","R","MCA status register high (LSB)","MCA status register high","MCA status register high","MCA status register high (MSB)","MCA status register low (LSB)","MCA status register low","MCA status register low","MCA status register low (MSB)","0x00","Processor Error Information Data C"
|
||||
"0xE1","0x01","0x04","Chassis","0x00","Processor ID","R","R","R","R","R","R","R","0x00","Processor recoverable error"
|
||||
"0xE1","0x01","0x04","Chassis","0x01","Processor ID","R","R","R","R","R","R","R","0x00","Processor unrecoverable error"
|
||||
"0xE1","0x02","0x00","0x00","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, done 1"
|
||||
"0xE1","0x02","0x00","0x01","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, start 2"
|
||||
"0xE1","0x02","0x00","0x03","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, done 2"
|
||||
"0xE1","0x02","0x01","Failed Port","Spare Port","R","R","R","R","R","R","R","R","0x00","Memory mirroring failover occurred"
|
||||
"0xE1","0x04","0x00","0x00","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Fatal"
|
||||
"0xE1","0x04","0x00","0x01","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Nonfatal"
|
||||
"0xE1","0x04","0x00","0x02","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Fatal"
|
||||
"0xE1","0x04","0x00","0x03","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Nonfatal"
|
||||
"0xE1","0x05","0x00","0x02","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Fatal"
|
||||
"0xE1","0x05","0x00","0x03","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Nonfatal"
|
||||
"0xE1","0x05","0x01","0x02","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Fatal internal north bridge error"
|
||||
"0xE1","0x05","0x01","0x03","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Nonfatal internal north bridge error"
|
||||
"0xE2","0x00","Register ID","R","First Fire Bit","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Industry Standard Register Dump"
|
||||
"0xE2","0x01","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI-X Industry Standard Register Dump"
|
||||
"0xE2","0x02","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Express Industry Standard Register Dump"
|
||||
"0xE3","Platform ID","Register ID","R","R","R","R","R","R","Register Data (LSB)","Register Data","Register Data","Register Data (MSB)","0x00","RAW Hex Dump"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x00","0x00","R","R","R","0x00","PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","R","R","R","0x00","Processor Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x02","0x00","R","R","R","0x00","Memory Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","R","R","R","0x00"," Scalability Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x04","0x00","R","R","R","0x00","Bus PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x05","0x00","R","R","R","0x00","Chipset Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
37
ipmitool/control/Makefile.am
Normal file
37
ipmitool/control/Makefile.am
Normal file
@ -0,0 +1,37 @@
|
||||
# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# Redistribution of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# Redistribution in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# Neither the name of Sun Microsystems, Inc. or the names of
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# This software is provided "AS IS," without a warranty of any kind.
|
||||
# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EXTRA_DIST = pkginfo.in prototype.in \
|
||||
ipmitool.spec.in rpmmacros.in rpmrc
|
||||
|
||||
dist-hook: pkginfo prototype rpmmacros
|
||||
|
236
ipmitool/control/ipmitool.spec.in
Normal file
236
ipmitool/control/ipmitool.spec.in
Normal file
@ -0,0 +1,236 @@
|
||||
Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
|
||||
License: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
Buildroot: /var/tmp/ipmitool-root
|
||||
|
||||
%description
|
||||
This package contains a utility for interfacing with devices that support
|
||||
the Intelligent Platform Management Interface specification. IPMI is
|
||||
an open standard for machine health, inventory, and remote power control.
|
||||
|
||||
This utility can communicate with IPMI-enabled devices through either a
|
||||
kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in
|
||||
the IPMI specification. IPMIv2 adds support for encrypted LAN
|
||||
communications and remote Serial-over-LAN functionality.
|
||||
|
||||
It provides commands for reading the Sensor Data Repository (SDR) and
|
||||
displaying sensor values, displaying the contents of the System Event
|
||||
Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
|
||||
setting LAN configuration, and chassis power control.
|
||||
|
||||
%prep
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure --with-kerneldir \
|
||||
--with-rpm-distro=@DISTRO@ \
|
||||
--prefix=%{_prefix} \
|
||||
--bindir=%{_bindir} \
|
||||
--sbindir=%{_sbindir} \
|
||||
--datadir=%{_datadir} \
|
||||
--includedir=%{_includedir} \
|
||||
--libdir=%{_libdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--sysconfdir=%{_sysconfdir}
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
|
||||
%clean
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_sbindir}/*
|
||||
%{_datadir}/ipmitool/*
|
||||
%doc %{_mandir}/man1/*
|
||||
%doc %{_mandir}/man8/*
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
|
||||
%changelog
|
||||
* Tue May 02 2006 <duncan@iceblink.org> 1.8.8-1
|
||||
- Fix segfaults in sensor data repository list
|
||||
- Fix ipmievd to open interface before daemonizing
|
||||
- Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
- Fix cipher suite display bug in lan print
|
||||
- Fix typo in IPMIv2 SOL output when sending break
|
||||
- Fix improper LUN handling with Tyan SOL
|
||||
- Add LUN support to OpenIPMI interface
|
||||
- Add support for Kontron OEM commands
|
||||
- Update to Kontron Firmware Update command
|
||||
|
||||
* Sun Mar 19 2006 <duncan@iceblink.org> 1.8.7-1
|
||||
- Add Sun OEM command for blades
|
||||
- Increase argument size for raw commands in shell/exec
|
||||
- Fix handling of LUNs for LAN interfaces
|
||||
- Add IPMIv2 SOL loopback test
|
||||
- Add support for IBM OEM SEL messages
|
||||
- Disable file paranoia checks on read files by default
|
||||
- Support IPMIv2 SOL on older Intel boxes
|
||||
- Display message and exit if keepalive fails during SOL
|
||||
- Add support for setting VLAN id and priority
|
||||
- Add support for FreeBSD OpenIPMI-compatible driver
|
||||
- Add support for IPMIv2 Firmware Firewall
|
||||
- Fix gcc4 compile warnings
|
||||
- Make ipmievd generate pidfile
|
||||
- Add initscripts for ipmievd
|
||||
|
||||
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
|
||||
- Fix memory corruption when sending encrypted SOL traffic
|
||||
- Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
* Sat Jan 14 2006 <duncan@iceblink.org> 1.8.5-1
|
||||
- Raise privilege level after creating IPMIv2 session
|
||||
- Add support for settable SOL escape character with -e option
|
||||
- Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
- Add support for Tyan IPMIv1.5 SOL with tsol command
|
||||
- Add support for PICMG devices
|
||||
- Add support for OEM SEL event parsing
|
||||
- Add support for command bridging over lan and lanplus interfaces
|
||||
- New 'chassis selftest' command
|
||||
- Many bufxies and patches from contributors
|
||||
|
||||
* Wed May 18 2005 <duncan@iceblink.org> 1.8.2-1
|
||||
- Fix FRU reading for large (>255 bytes) areas.
|
||||
- Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
|
||||
- Fix LAN parameter segfault when no Ciphers supported by BMC.
|
||||
- Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
|
||||
- Separate option parsing code from main ipmitool source file.
|
||||
- Add raw I2C support with IPMI Master Read-Write command.
|
||||
- Add support for new 'sdr elist' extended output format.
|
||||
- Add support for listing sensors by type with 'sdr type' command.
|
||||
- Add support for new 'sel elist' extended output format that
|
||||
cross-references events with sensors.
|
||||
- Add support for sending dynamically generated platform events
|
||||
based on existing sensor information.
|
||||
- New '-S' argument to read local SDR cache created with 'sdr dump'.
|
||||
- Updated manpage for ipmitool and ipmievd.
|
||||
|
||||
* Wed Apr 06 2005 <duncan@iceblink.org> 1.8.1-1
|
||||
- Install ipmievd into /usr/sbin
|
||||
|
||||
* Wed Mar 16 2005 <duncan@iceblink.org> 1.8.0-1
|
||||
- Fix IPMIv2.0 issues
|
||||
- Fix chassis boot parameter support
|
||||
- Add support for linear sensors
|
||||
- Update bmc plugin to work with new Solaris bmc driver (new ioctl
|
||||
for interface detection and new STREAMS message-based interface)
|
||||
|
||||
* Tue Jan 18 2005 <duncan@iceblink.org> 1.7.0-1
|
||||
- Propogate errors correctly so exit status will be useful
|
||||
- More consistent display of errors including completion code text
|
||||
- Errors and debug is send to stderr now
|
||||
- New "sel get" command that will print details about SEL entry
|
||||
and corresponding SDR records as well as FRUs via entity association
|
||||
- Improved event generator, now supports reading events from text file
|
||||
- New "-o oemtype" option for specifying OEM boards
|
||||
exsting types are "supermicro" and "intelwv2"
|
||||
- New PEF subsystem from Tim Murphy at Dell
|
||||
- New "bmc" plugin for Solaris 10 x86
|
||||
- Many bugfixes and contributed patches
|
||||
- Support for Supermicro BMC OEM authentication method
|
||||
- Fix minor problem with LAN parameter setting
|
||||
|
||||
* Wed Aug 18 2004 <duncan@iceblink.org> 1.6.0-1
|
||||
- Add a README
|
||||
- Add support for IPMIv2 and Serial-over-LAN from Newisys
|
||||
- Add Solaris x86 lipmi interface
|
||||
- Add support for building Solaris packages
|
||||
- Add support for building RPMs as non-root user
|
||||
- Fix segfault when doing "sel list" (from Matthew Braithwaite)
|
||||
- Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
|
||||
- Add "bmc info" and related output (from ebrower@sourceforge)
|
||||
- new "shell" and "exec" commands
|
||||
- lots of other contributed patches
|
||||
|
||||
* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
|
||||
- Add ability to get a particular sensor by name
|
||||
- Add ability to set a particular sensor threshold
|
||||
- Add support for displaying V2 channel authentication levels
|
||||
- Add README for rrdtool scripts in contrib directory
|
||||
- Improve lan interface retry handling
|
||||
- Support prompting for password or reading from environment
|
||||
- Move chaninfo command into channel subcommand
|
||||
- Fix reservation ID handling when two sessions open to BMC
|
||||
- Fix reading of large FRU data
|
||||
- Add configure option for changing binary to ipmiadm for Solaris
|
||||
- Fix compile problem on Solaris 8
|
||||
|
||||
* Tue Jan 27 2004 <duncan@iceblink.org> 1.5.8-1
|
||||
- Enable static compilation of interfaces
|
||||
- Fix types to be 64-bit safe
|
||||
- Fix compilation problems on Solaris
|
||||
- Fix multiple big-endian problems for Solaris/SPARC
|
||||
- Fix channel access to save settings to NVRAM
|
||||
- Set channel privilege limit to ADMIN during "access on"
|
||||
- Enable gratuitous ARP in bmcautoconf.sh
|
||||
- Add support for Linux kernel panic messages in SEL output
|
||||
- Add support for type 3 SDR records
|
||||
|
||||
* Mon Jan 5 2004 <duncan@iceblink.org> 1.5.7-1
|
||||
- add IPMIv1.5 eratta fixes
|
||||
- additions to FRU printing and FRU multirecords
|
||||
- better handling of SDR printing
|
||||
- contrib scripts for creating rrdtool graphs
|
||||
|
||||
* Thu Dec 4 2003 <duncan@iceblink.org> 1.5.6-1
|
||||
- Fix SEL event decoding for generic events
|
||||
- Handle empty SEL gracefully when doing "sel list"
|
||||
- Fix sdr handling of sensors that do not return a reading
|
||||
- Fix for CSV display of sensor readings/units from Fredrik <EFBFBD>hrn
|
||||
|
||||
* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
|
||||
- Add -U option for setting LAN username
|
||||
- Fix -v usage for plugin interfaces
|
||||
|
||||
* Fri Nov 14 2003 <duncan@iceblink.org> 1.5.4-1
|
||||
- pull interface plugin api into library
|
||||
- fix ipmievd
|
||||
|
||||
* Fri Oct 31 2003 <duncan@iceblink.org> 1.5.3-1
|
||||
- add -g optin for pedantic ipmi-over-lan communication
|
||||
|
||||
* Fri Oct 24 2003 <duncan@iceblink.org> 1.5.2-1
|
||||
- add gratuitous arp interval setting
|
||||
|
||||
* Wed Oct 8 2003 <duncan@iceblink.org> 1.5.1-1
|
||||
- better SEL support
|
||||
- fix display bug in SDR list
|
||||
|
||||
* Fri Sep 5 2003 <duncan@iceblink.org> 1.5.0-1
|
||||
- use automake/autoconf/libtool
|
||||
- dynamic loading interface plugins
|
||||
|
||||
* Wed May 28 2003 <duncan@iceblink.org> 1.4.0-1
|
||||
- make UDP packet handling more robust
|
||||
- fix imb driver support
|
||||
|
||||
* Thu May 22 2003 <duncan@iceblink.org> 1.3-1
|
||||
- update manpage
|
||||
- rework of low-level network handling
|
||||
- add basic imb driver support
|
||||
|
||||
* Wed Apr 2 2003 <duncan@iceblink.org> 1.2-1
|
||||
- change command line option parsing
|
||||
- support for more chassis commands
|
||||
|
||||
* Tue Apr 1 2003 <duncan@iceblink.org> 1.1-1
|
||||
- minor fixes.
|
||||
|
||||
* Sun Mar 30 2003 <duncan@iceblink.org> 1.0-1
|
||||
- Initial release.
|
||||
|
10
ipmitool/control/pkginfo.in
Normal file
10
ipmitool/control/pkginfo.in
Normal file
@ -0,0 +1,10 @@
|
||||
PKG="@PACKAGE@"
|
||||
NAME="@PACKAGE@ - Utility for Intelligent Platform Management Interface (IPMI) control"
|
||||
ARCH="@ARCH@"
|
||||
VERSION="@VERSION@"
|
||||
CATEGORY="system"
|
||||
VENDOR="Duncan Laurie"
|
||||
EMAIL="duncan@iceblink.org"
|
||||
PSTAMP="@PSTAMP@"
|
||||
BASEDIR="@BASEDIR@"
|
||||
CLASSES="none"
|
12
ipmitool/control/prototype.in
Normal file
12
ipmitool/control/prototype.in
Normal file
@ -0,0 +1,12 @@
|
||||
i pkginfo
|
||||
d none bin ? ? ?
|
||||
f none bin/@PACKAGE@=../src/@PACKAGE@ 0755 root bin
|
||||
d none sbin ? ? ?
|
||||
f none sbin/ipmievd=../src/ipmievd 0755 root bin
|
||||
d none share ? ? ?
|
||||
d none share/man ? ? ?
|
||||
d none share/man/man1 ? ? ?
|
||||
f none share/man/man1/@PACKAGE@.1=../doc/@PACKAGE@.1 0644 root bin
|
||||
d none share/man/man8 ? ? ?
|
||||
f none share/man/man8/ipmievd.8=../doc/ipmievd.8 0644 root bin
|
||||
|
12
ipmitool/control/rpmmacros.in
Normal file
12
ipmitool/control/rpmmacros.in
Normal file
@ -0,0 +1,12 @@
|
||||
%_topdir %(echo $BUILDDIR)
|
||||
%_sourcedir %{_topdir}/..
|
||||
%_specdir %{_sourcedir}
|
||||
%_tmppath %{_topdir}/tmp
|
||||
%_builddir %{_topdir}/BUILD
|
||||
%_buildroot %{_topdir}/%{_tmppath}/%{name}-%{version}-root
|
||||
%_rpmdir %{_topdir}/RPMS
|
||||
%_srcrpmdir %{_topdir}/SRPMS
|
||||
%_distro @DISTRO@
|
||||
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
|
||||
%packager duncan@iceblink.org
|
||||
%distribution Sourceforge Build
|
8
ipmitool/control/rpmrc
Normal file
8
ipmitool/control/rpmrc
Normal file
@ -0,0 +1,8 @@
|
||||
macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros:/etc/rpm/%{_target}/macros:%(echo $CONFIGDIR)/rpmmacros
|
||||
|
||||
buildarchtranslate: athlon: i386
|
||||
buildarchtranslate: i686: i386
|
||||
buildarchtranslate: i586: i386
|
||||
buildarchtranslate: i486: i386
|
||||
buildarchtranslate: i386: i386
|
||||
|
5
ipmitool/debian/README.Debian
Normal file
5
ipmitool/debian/README.Debian
Normal file
@ -0,0 +1,5 @@
|
||||
For more information about setting up your Debian system with IPMI
|
||||
please see the excellent howto by Tim Small:
|
||||
|
||||
http://buttersideup.com/docs/howto/IPMI_on_Debian.html
|
||||
|
@ -1,28 +1,241 @@
|
||||
ipmitool (1.8.7-2) unstable; urgency=low
|
||||
|
||||
* Fix typo in init.d/ipmievd. (Closes: #361309)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 8 Apr 2006 06:44:31 +0200
|
||||
|
||||
ipmitool (1.8.7-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Dropped nuclear clause from the copyright. Updated debian/copyright
|
||||
to reflect this.
|
||||
- ipmievd now store pid in /var/run/ipmievd.pid. Adjust init.d
|
||||
script to use it.
|
||||
* Rename /etc/default/ipmievd variable IPMIEVD_OPTS is renamed to
|
||||
IPMIEVD_OPTIONS to stay compatible with upstream and other
|
||||
distributions. Add backwards compatibility code with a warning to
|
||||
the users of the old variable.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Mar 2006 21:11:08 +0200
|
||||
|
||||
ipmitool (1.8.6-2) unstable; urgency=low
|
||||
|
||||
* Add ia64 as an supported arch. (Closes: #355930)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Fri, 10 Mar 2006 23:34:50 +0100
|
||||
|
||||
ipmitool (1.8.6-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Avoid crashing when setting lan IP address. (Closes: #351205)
|
||||
* Avoid changing history by reverding upstream change
|
||||
to email addresses in debian/changelog.
|
||||
* Correct typo in control file: Suggest -> Suggests. Thanks
|
||||
to Philipp Matthias Hahn for the report.
|
||||
* Add init.d/ipmievd script. Based on script from Elmar Hoffmann,
|
||||
slightly modified to use lsb-base functions. Added dependency on
|
||||
lsb-base. (Closes: #345994)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Feb 2006 10:31:14 +0100
|
||||
|
||||
ipmitool (1.8.2-2) unstable; urgency=low
|
||||
|
||||
* Add build-dependency on 'libreadline5-dev | libreadline-dev' to make
|
||||
sure all archs get readline support. (Closes: #326341)
|
||||
* Add build-dependency on libssl-dev to enable SSL support on
|
||||
all archs.
|
||||
* Updated Standards-Version to 3.6.2.1. (No updates required)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 3 Sep 2005 19:18:51 +0200
|
||||
|
||||
ipmitool (1.8.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Fix FRU reading for large (>255 bytes) areas.
|
||||
- Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
|
||||
- Fix LAN parameter segfault when no Ciphers supported by
|
||||
BMC. (Closes: #306806)
|
||||
- Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
|
||||
- Separate option parsing code from main ipmitool source file.
|
||||
- Add raw I2C support with IPMI Master Read-Write command.
|
||||
- Add support for new 'sdr elist' extended output format.
|
||||
- Add support for listing sensors by type with 'sdr type' command.
|
||||
- Add support for new 'sel elist' extended output format that
|
||||
cross-references events with sensors.
|
||||
- Add support for sending dynamically generated platform events
|
||||
based on existing sensor information.
|
||||
- New '-S' argument to read local SDR cache created with 'sdr dump'.
|
||||
- Updated manpage for ipmitool and ipmievd. (Closes: #306894)
|
||||
* Correct the upstream URL in debian/changelog to the current one.
|
||||
* Suggest package openipmi. (Closes: #305629)
|
||||
* Add debian/watch file to detect new source versions.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 5 Jun 2005 10:29:18 +0200
|
||||
|
||||
ipmitool (1.8.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Install ipmievd into /usr/sbin/.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Thu, 7 Apr 2005 01:18:44 +0200
|
||||
|
||||
ipmitool (1.8.0-1) unstable; urgency=low
|
||||
|
||||
* Initial upload into Debian, based on the upstream build
|
||||
rules. (Closes: #299924)
|
||||
* Convert debian/changelog to UTF-8.
|
||||
* Change section from 'contrib' to 'utils'.
|
||||
* Build-depend on debhelper (>> 4.0.0) to match the rules file.
|
||||
* Set Standards-version to 3.6.1.
|
||||
* Make sure binary dependency is properly generated.
|
||||
* Add long description, copied from the project README.
|
||||
* Drop useless provides 'ipmitool', as the package is called 'ipmitool'.
|
||||
* Don't install the COPYING file, as the license text already is
|
||||
included in debian/copyright.
|
||||
* Remove unused parts of the rules file.
|
||||
* Correct clean target in rules file, to use 'distclean' and remove
|
||||
configure-stamp not bogus config-stamp.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 3 Apr 2005 20:52:02 +0200
|
||||
|
||||
ipmitool (1.8.0) unstable; urgency=low
|
||||
|
||||
* Fix IPMIv2.0 issues
|
||||
* Fix chassis boot parameter support
|
||||
* Add support for linear sensors
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Wed, Mar 16 2005 17:08:12 -0700
|
||||
|
||||
ipmitool (1.7.1) unstable; urgency=low
|
||||
|
||||
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
|
||||
for interface detection and new STREAMS message-based interface).
|
||||
|
||||
-- Seth Goldberg <sethmeisterg@hotmail.com> Mon, Mar 7 2005 18:03:00 -0800
|
||||
|
||||
ipmitool (1.7.0) unstable; urgency=low
|
||||
|
||||
* Propogate errors correctly so exit status will be useful
|
||||
* More consistent display of errors including completion code text
|
||||
* Errors and debug is send to stderr now
|
||||
* New "sel get" command that will print details about SEL entry
|
||||
and corresponding SDR records as well as FRUs via entity association
|
||||
* Improved event generator, now supports reading events from text file
|
||||
* New "-o oemtype" option for specifying OEM boards
|
||||
exsting types are "supermicro" and "intelwv2"
|
||||
* New PEF subsystem
|
||||
* New "bmc" plugin for Solaris 10 x86
|
||||
* Many bugfixes and contributed patches
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Fri, Jan 7 2005 19:58:22 -0700
|
||||
|
||||
ipmitool (1.6.2) unstable; urgency=low
|
||||
|
||||
* Support for Supermicro BMC OEM authentication method
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Mon, 16 Nov 2004 08:20:01 -0700
|
||||
|
||||
ipmitool (1.6.1) unstable; urgency=low
|
||||
|
||||
* Fix minor problem with LAN parameter setting
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Wed, 29 Sep 2004 11:19:17 -0700
|
||||
|
||||
ipmitool (1.6.0) unstable; urgency=low
|
||||
|
||||
* Add a README
|
||||
* Add support for IPMIv2 and Serial-over-LAN from Newisys
|
||||
* Add Solaris x86 lipmi interface
|
||||
* Add support for building Solaris packages
|
||||
* Add support for building RPMs as non-root user
|
||||
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
|
||||
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
|
||||
* Add "bmc info" and related output (from ebrower@sourceforge)
|
||||
* new "shell" and "exec" commands
|
||||
* lots of other contributed patches
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Thu, 9 Sep 2004 21:39:37 -0700
|
||||
|
||||
ipmitool (1.5.9) unstable; urgency=low
|
||||
|
||||
* Add ability to get a particular sensor by name
|
||||
* Add ability to set a particular sensor threshold
|
||||
* Add support for displaying V2 channel authentication levels
|
||||
* Add README for rrdtool scripts in contrib directory
|
||||
* Improve lan interface retry handling
|
||||
* Support prompting for password or reading from environment
|
||||
* Move chaninfo command into channel subcommand
|
||||
* Fix reservation ID handling when two sessions open to BMC
|
||||
* Fix reading of large FRU data
|
||||
* Add configure option for changing binary to ipmiadm for Solaris
|
||||
* Fix compile problem on Solaris 8
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Sat, 27 Mar 2004 00:11:37 -0700
|
||||
|
||||
ipmitool (1.5.8) unstable; urgency=low
|
||||
|
||||
* Enable static compilation of interfaces
|
||||
* Fix types to be 64-bit safe
|
||||
* Fix compilation problems on Solaris
|
||||
* Fix multiple big-endian problems for Solaris/SPARC
|
||||
* Fix channel access to save settings to NVRAM
|
||||
* Set channel privilege limit to ADMIN during "access on"
|
||||
* Enable gratuitous ARP in bmcautoconf.sh
|
||||
* Add support for Linux kernel panic messages in SEL output
|
||||
* Add support for type 3 SDR records
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Tue, 27 Jan 2004 16:23:25 -0700
|
||||
|
||||
ipmitool (1.5.7) unstable; urgency=low
|
||||
|
||||
* add IPMIv1.5 eratta fixes
|
||||
* additions to FRU printing and FRU multirecords
|
||||
* better handling of SDR printing
|
||||
* contrib scripts for creating rrdtool graphs
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Mon, 5 Jan 2004 17:29:50 -0700
|
||||
|
||||
ipmitool (1.5.6) unstable; urgency=low
|
||||
|
||||
* Fix SEL event decoding for generic events
|
||||
* Handle empty SEL gracefully when doing "sel list"
|
||||
* Fix sdr handling of sensors that do not return a reading
|
||||
* Fix for CSV display of sensor readings/units from Fredrik Öhrn
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Thu, 4 Dec 2003 14:47:19 -0700
|
||||
|
||||
ipmitool (1.5.5) unstable; urgency=low
|
||||
|
||||
* Add -U option for setting LAN username
|
||||
* Fix -v usage for plugin interfaces
|
||||
|
||||
-- Duncan Laurie <duncan@iceblink.org> Tue, 25 Nov 2003 15:10:48 -0700
|
||||
|
||||
ipmitool (1.5.4) unstable; urgency=low
|
||||
|
||||
* Put interface plugin API into library
|
||||
* Fix ipmievd
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Fri, 14 Nov 2003 15:16:34 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Fri, 14 Nov 2003 15:16:34 -0700
|
||||
|
||||
ipmitool (1.5.3) unstable; urgency=low
|
||||
|
||||
* Add -g option to work with grizzly bmc
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Mon, 3 Nov 2003 18:04:07 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Mon, 3 Nov 2003 18:04:07 -0700
|
||||
|
||||
ipmitool (1.5.2) unstable; urgency=low
|
||||
|
||||
* add support for setting gratuitous arp interval
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Fri, 24 Oct 2003 11:00:00 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Fri, 24 Oct 2003 11:00:00 -0700
|
||||
|
||||
ipmitool (1.5.1) unstable; urgency=low
|
||||
|
||||
* better SEL support
|
||||
* fix display bug in SDR list
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Wed, 8 Oct 2003 17:28:51 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Wed, 8 Oct 2003 17:28:51 -0700
|
||||
|
||||
ipmitool (1.5.0) unstable; urgency=low
|
||||
|
||||
@ -30,24 +243,24 @@ ipmitool (1.5.0) unstable; urgency=low
|
||||
* add Intel IMB driver support
|
||||
* use autoconf/automake/libtool
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Fri, 5 Sep 2003 11:57:32 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Fri, 5 Sep 2003 11:57:32 -0700
|
||||
|
||||
ipmitool (1.2-1) unstable; urgency=low
|
||||
|
||||
* New command line option parsing
|
||||
* More chassis commands supported
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Wed, 2 Apr 2003 17:44:17 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Wed, 2 Apr 2003 17:44:17 -0700
|
||||
|
||||
ipmitool (1.1-1) unstable; urgency=low
|
||||
|
||||
* Minor fixes.
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Tue, 1 Apr 2003 14:31:10 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Tue, 1 Apr 2003 14:31:10 -0700
|
||||
|
||||
ipmitool (1.0-1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Sun, 30 Mar 2003 21:30:46 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Sun, 30 Mar 2003 21:30:46 -0700
|
||||
|
||||
|
@ -1,12 +1,28 @@
|
||||
Source: ipmitool
|
||||
Section: contrib
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Duncan Laurie <duncan@sun.com>
|
||||
Build-Depends: debhelper (>> 3.0.0)
|
||||
Standards-Version: 3.5.8
|
||||
Maintainer: Petter Reinholdtsen <pere@debian.org>
|
||||
Uploaders: Duncan Laurie <duncan@iceblink.org>
|
||||
Build-Depends: debhelper (>> 4.0.0), libreadline5-dev | libreadline-dev, libssl-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: ipmitool
|
||||
Architecture: i386
|
||||
Provides: ipmitool
|
||||
Description: Utility for IPMI control with kernel driver or LAN interface
|
||||
Architecture: i386 amd64 ia64
|
||||
Depends: ${shlibs:Depends}, lsb-base
|
||||
Suggests: openipmi
|
||||
Description: utility for IPMI control with kernel driver or LAN interface
|
||||
A utility for managing and configuring devices that support the
|
||||
Intelligent Platform Management Interface. IPMI is an open standard
|
||||
for monitoring, logging, recovery, inventory, and control of hardware
|
||||
that is implemented independent of the main CPU, BIOS, and OS. The
|
||||
service processor (or Baseboard Management Controller, BMC) is the
|
||||
brain behind platform management and its primary purpose is to handle
|
||||
the autonomous sensor monitoring and event logging features.
|
||||
.
|
||||
The ipmitool program provides a simple command-line interface to this
|
||||
BMC. It features the ability to read the sensor data repository
|
||||
(SDR) and print sensor values, display the contents of the System
|
||||
Event Log (SEL), print Field Replaceable Unit (FRU) inventory
|
||||
information, read and set LAN configuration parameters, and perform
|
||||
remote chassis power control.
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
ipmitool
|
||||
Duncan Laurie <duncan@sun.com>
|
||||
http://www.iceblink.org/ipmitool/
|
||||
This package was debianized by Duncan Laurie before
|
||||
2003-11-18 17:55:21 +0100.
|
||||
|
||||
It was downloaded from <URL:http://ipmitool.sourceforge.net/>
|
||||
|
||||
Upstream Author: Duncan Laurie <duncan@iceblink.org>
|
||||
|
||||
Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -31,8 +34,3 @@ OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
usr/bin
|
||||
usr/lib/ipmitool
|
||||
usr/include/ipmitool
|
||||
usr/sbin
|
||||
usr/share/ipmitool
|
||||
usr/share/doc/ipmitool
|
||||
|
2
ipmitool/debian/docs
Normal file
2
ipmitool/debian/docs
Normal file
@ -0,0 +1,2 @@
|
||||
README
|
||||
AUTHORS
|
@ -1,290 +0,0 @@
|
||||
.TH "ipmitool" "1" "1.4.1.1" "Duncan Laurie" ""
|
||||
.SH "NAME"
|
||||
.LP
|
||||
ipmitool \- utility for IPMI control
|
||||
.SH "SYNTAX"
|
||||
.LP
|
||||
ipmitool [\fB\-hcvV\fR] \fB\-I\fR \fIlan\fP \fB\-H\fR \fIaddress\fP [\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
|
||||
.br
|
||||
ipmitool [\fB\-hcvV\fR] \fB\-I\fR \fIdev\fP <\fIexpression\fP>
|
||||
.SH "DESCRIPTION"
|
||||
.LP
|
||||
This program lets you perform various IPMI functions with either a kernel device driver or over a LAN interface. These functions include printing FRU information, LAN configuration, sensor readings, and remote chassis power control.
|
||||
.SH "OPTIONS"
|
||||
.LP
|
||||
.TP
|
||||
\fB\-h\fR
|
||||
Get basic usage help from the command line.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Make output suitable for parsing where possible by separating fields with commas instead of spaces.
|
||||
.TP
|
||||
\fB\-V\fR
|
||||
Display version information.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified multiple times to increase the level of debug output. If given three times you will get hexdumps of all incoming and outgoing packets.
|
||||
.TP
|
||||
\fB\-I\fR <\fIinterface\fP>
|
||||
Selects IPMI interface to use. Possible interfaces are \fIlan\fP or \fIdev\fP.
|
||||
.TP
|
||||
\fB\-H\fR <\fIaddress\fP>
|
||||
Remote server address, can be IP address or hostname. This option is required for the LAN interface connection.
|
||||
.TP
|
||||
\fB\-P\fR <\fIpassword\fP>
|
||||
Remote server password, 16 character maximum. This is optional for the LAN interface, if it is not provided the session will not be authenticated.
|
||||
.SH "EXPRESSIONS"
|
||||
.LP
|
||||
.TP
|
||||
.I help
|
||||
This can be used to get command-line help on ipmitool commands. It may also be placed at the end of commands to get option usage help.
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev help
|
||||
.br
|
||||
Commands: chassis, fru, lan, sdr, sel
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I dev chassis help
|
||||
.br
|
||||
Chassis Commands: status, power, identify, policy, restart_cause
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I dev chassis power help
|
||||
.br
|
||||
Chassis Power Commands: status, on, off, cycle, reset, diag, soft
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIraw\fP <\fBnetfn\fR> <\fBcmd\fR> [\fBdata\fR]
|
||||
This will allow you to execute raw IPMI commands. For example to query the POH counter with a raw command:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev raw 0x0 0xf
|
||||
.br
|
||||
RAW REQ (netfn=0x0 cmd=0xf data_len=0)
|
||||
.br
|
||||
RAW RSP (5 bytes)
|
||||
.br
|
||||
3c 72 0c 00 00
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIchaninfo\fP [\fBchannel\fR]
|
||||
This command will display information about the selected channel. If no channel is given it will display information about the currently used channel:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev chaninfo
|
||||
.br
|
||||
Channel 0xf info:
|
||||
.br
|
||||
Channel Medium Type : System Interface
|
||||
.br
|
||||
Channel Protocol Type : KCS
|
||||
.br
|
||||
Session Support : session-less
|
||||
.br
|
||||
Active Session Count : 0
|
||||
.br
|
||||
Protocol Vendor ID : 7154
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
.I chassis
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
This command returns information about the high-level status of the system chassis and main power subsystem.
|
||||
.TP
|
||||
.I poh
|
||||
This command will return the Power-On Hours counter.
|
||||
.TP
|
||||
\fIidentify\fP <\fBinterval\fR>
|
||||
Control the front panel identify light. Default is 15. Use 0 to turn off.
|
||||
.TP
|
||||
.I restart_cause
|
||||
Query the chassis for the cause of the last system restart.
|
||||
.TP
|
||||
.I policy
|
||||
Set the chassis power policy in the event power failure.
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
Return supported policies.
|
||||
.TP
|
||||
.I always-on
|
||||
Turn on when power is restored.
|
||||
.TP
|
||||
.I previous
|
||||
Returned to previous state when power is restored.
|
||||
.TP
|
||||
.I always-off
|
||||
Stay off after power is restored.
|
||||
.RE
|
||||
.TP
|
||||
.I power
|
||||
Performs a chassis control command to view and change the power state.
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
Show current chassis power status.
|
||||
.TP
|
||||
.I on
|
||||
Power up chassis.
|
||||
.TP
|
||||
.I off
|
||||
Power down chassis into soft off (S4/S5 state). WARNING: this command does not initiate a clean shutdown of the operating system prior to powering down the system.
|
||||
.TP
|
||||
.I cycle
|
||||
This command provides a power off interval of at least 1 second. No action should occur if chassis power is in S4/S5 state, but it is recommended to check power state first and only issue a power cycle command if the system power is on or in lower sleep state than S4/S5.
|
||||
.TP
|
||||
.I reset
|
||||
This command will perform a hard reset.
|
||||
.TP
|
||||
.I diag
|
||||
Pulse a version of a diagnostic interrupt (NMI) that goes directly to the processor(s).
|
||||
.TP
|
||||
.I soft
|
||||
Initiate a soft\-shutdown of OS via ACPI by emulating a fatal overtemperature.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I lan
|
||||
.RS
|
||||
.TP
|
||||
\fIprint\fP <\fBchannel\fR>
|
||||
Print the current configuration for the given channel.
|
||||
.TP
|
||||
\fIset\fP <\fBchannel\fR> <\fBparameter\fR>
|
||||
Set the given parameter on the given channel. Valid parameters are:
|
||||
.RS
|
||||
.TP
|
||||
\fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the IP address for this channel.
|
||||
.TP
|
||||
\fInetmask\fP <\fBx.x.x.x\fR>
|
||||
Set the netmask for this channel.
|
||||
.TP
|
||||
\fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the MAC adddress for this channel.
|
||||
.TP
|
||||
\fIdefgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the default gateway IP address.
|
||||
.TP
|
||||
\fIdefgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the default gateway MAC address.
|
||||
.TP
|
||||
\fIbakgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the backup gateway IP address.
|
||||
.TP
|
||||
\fIbakgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the backup gateway MAC address.
|
||||
.TP
|
||||
\fIpassword\fP <\fBpass\fR>
|
||||
Set the null user password.
|
||||
.TP
|
||||
\fIauth\fP <\fBlevel,...\fR> <\fBtype,...\fR>
|
||||
Set the valid authtypes for a given auth level.
|
||||
.RS
|
||||
Levels:
|
||||
.B callback
|
||||
.B user
|
||||
.B operator
|
||||
.B admin
|
||||
.br
|
||||
Types:
|
||||
.B none
|
||||
.B md2
|
||||
.B key
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I fru
|
||||
.RS
|
||||
.TP
|
||||
.I print
|
||||
This command will read all Field Replacable Unit inventory data and extract such information as serial number, part number, asset tags, and short strings describing the chassis, board, or product.
|
||||
.RE
|
||||
.TP
|
||||
.I sdr
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
This command will read the SDR and extract sensor information, then query each sensor and print its name, reading, and status.
|
||||
.RE
|
||||
.TP
|
||||
.I sel
|
||||
.RS
|
||||
.TP
|
||||
.I info
|
||||
This command will query the BMC for information about the SEL and its contents.
|
||||
.TP
|
||||
.I list
|
||||
This command will list the contents of the SEL.
|
||||
.RE
|
||||
.SH "DEV INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIdev\fP interface utilizes the MontaVista OpenIPMI kernel device driver. This driver is present in 2.5.57 and later development kernels and in 2.4.21pre1 and later stable kernels. There are also IPMI driver kernel patches for different versions available from the OpenIPMI homepage.
|
||||
.LP
|
||||
The following kernel modules must be loaded in order for ipmitool to work:
|
||||
.TP
|
||||
.B ipmi_msghandler
|
||||
Incoming and outgoing message handler for IPMI interfaces.
|
||||
.TP
|
||||
.B ipmi_kcs_drv
|
||||
An IPMI Keyboard Controler Style (KCS) interface driver for the message handler.
|
||||
.TP
|
||||
.B ipmi_devintf
|
||||
Linux character device interface for the message handler.
|
||||
.LP
|
||||
Once they are loaded there will be a dynamic char device entry that must exist at \fB/dev/ipmi/0\fR. Usually if this is the first dynamic device it will be major number \fB254\fR and minor number \fB0\fR so you would create the dev entry with:
|
||||
.LP
|
||||
.I mknod /dev/ipmi/0 c 254 0
|
||||
.LP
|
||||
In order to force ipmitool to make use of the device interface you can specifiy it on the command line:
|
||||
.PP
|
||||
ipmitool \-I dev [option...]
|
||||
.LP
|
||||
Alternatively if you do not provide a hostname on the command line ipmitool will assume you want to use the dev interface.
|
||||
.SH "LAN INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIlan\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. UDP datagrams are formatted to contain IPMI request/response messages with a IPMI session headers and RMCP headers.
|
||||
.LP
|
||||
IPMI\-over\-LAN uses version 1 of the Remote Management Control Protocol (RMCP) to support \fIpre\-OS\fP and \fIOS\-absent\fP management. RMCP is a request\-response protocol delivered using UDP datagrams to port 623.
|
||||
.LP
|
||||
The LAN interface is an authenticatiod multi\-session connection; messages delivered to the BMC can (and should) be authenticated with a challenge/response protocol with either straight password/key. ipmitool will attempt to connect with administrator privilege level as this is required to perform chassis power functions.
|
||||
.LP
|
||||
You can tell ipmitool to use the lan interface with the \fB\-I\fR option:
|
||||
.PP
|
||||
ipmitool \-I lan [option...] <address> [password]
|
||||
.LP
|
||||
A hostname \fBmust\fR be given on the command line in order to use the lan interface with ipmitool. The password field is optional; if you do not provide a password on the command line ipmitool will attempt to connect without authentication. If you specify a password it will use straight password/key.
|
||||
.SH "FILES"
|
||||
.TP
|
||||
.I /dev/ipmi/0
|
||||
This character device file is used by the OpenIPMI kernel driver.
|
||||
.SH "EXAMPLES"
|
||||
.LP
|
||||
If you want to remotely control the power of an IPMI\-over\-LAN enabled system you can use:
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power on
|
||||
.LP
|
||||
Chassis Power is off.
|
||||
.br
|
||||
Chassis Power Control: on
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power status
|
||||
.LP
|
||||
Chassis Power is on.
|
||||
.SH "AUTHOR"
|
||||
.LP
|
||||
Duncan Laurie <duncan@sun.com>
|
||||
.SH "SEE ALSO"
|
||||
.LP
|
||||
.TP
|
||||
Intelligent Platform Management Interface Specification
|
||||
http://www.intel.com/design/servers/ipmi/spec.htm
|
||||
.TP
|
||||
OpenIPMI project (MontaVista IPMI kernel driver)
|
||||
http://openipmi.sourceforge.net/
|
99
ipmitool/debian/ipmitool.ipmievd.init
Normal file
99
ipmitool/debian/ipmitool.ipmievd.init
Normal file
@ -0,0 +1,99 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $local_fs $remote_fs $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: S 0 1 6
|
||||
# Short-Description: IPMI event daemon
|
||||
# Description: ipmievd is a daemon which will listen for events
|
||||
# from the BMC that are being sent to the SEL and
|
||||
# also log those messages to syslog.
|
||||
### END INIT INFO
|
||||
#
|
||||
# Author: Elmar Hoffmann <elho@elho.net>
|
||||
# Licence: This script is public domain using the same
|
||||
# licence as ipmitool itself.
|
||||
# Modified by: Petter Reinholdtsen
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="IPMI event daemon"
|
||||
NAME=ipmievd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Backwards compatibility with version 1.8.6-2 and 1.8.6-1. The
|
||||
# variable was renamed to be compatible with upstream, SuSe and RedHat.
|
||||
if [ -n "$IPMIEVD_OPTS" ]; then
|
||||
echo "warning: /etc/default/$NAME variable IPMIEVD_OPTS should be renamed to IPMIEVD_OPTIONS"
|
||||
IPMIEVD_OPTIONS="$IPMIEVD_OPTS"
|
||||
fi
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
|
||||
}
|
||||
|
||||
CODE=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
|
||||
d_start || CODE=$?
|
||||
[ "$VERBOSE" != no ] && log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC" "$NAME"
|
||||
d_stop || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC" "$NAME"
|
||||
d_stop || true
|
||||
sleep 1
|
||||
d_start || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -18,9 +18,9 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
./configure --enable-intf-lan --enable-intf-open \
|
||||
--enable-ipmievd \
|
||||
--prefix=/usr --mandir=/usr/share/man
|
||||
./configure --prefix=/usr \
|
||||
--with-kerneldir \
|
||||
--mandir=/usr/share/man
|
||||
touch configure-stamp
|
||||
|
||||
#Architecture
|
||||
@ -41,10 +41,10 @@ build-indep-stamp: configure-stamp
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-arch-stamp build-indep-stamp config-stamp
|
||||
rm -f build-arch-stamp build-indep-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) clean
|
||||
-$(MAKE) distclean
|
||||
|
||||
dh_clean
|
||||
|
||||
@ -71,6 +71,17 @@ install-arch:
|
||||
# debian/tmp.
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/ipmitool
|
||||
|
||||
# No need to have two copies of the license text in the package.
|
||||
$(RM) $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/COPYING
|
||||
|
||||
# Move upstream changelog to correct filename.
|
||||
mv $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/ChangeLog \
|
||||
$(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/changelog
|
||||
|
||||
# Compress to avoid lintian warning. Not sure why dh_compress
|
||||
# isn't fixing this.
|
||||
gzip -9 $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/changelog
|
||||
|
||||
# dh_movefiles -a
|
||||
# Must not depend on anything. This is to be called by
|
||||
# binary-arch/binary-multi
|
||||
@ -78,27 +89,16 @@ install-arch:
|
||||
binary-common:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
# dh_installdebconf
|
||||
# dh_installdocs
|
||||
# dh_installexamples
|
||||
# dh_installmenu
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installmanpages
|
||||
# dh_installinfo
|
||||
# dh_undocumented
|
||||
# dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installchangelogs
|
||||
dh_installinit --name ipmievd
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# You may want to make some executables suid here.
|
||||
# dh_suidregister
|
||||
dh_makeshlibs
|
||||
dh_shlibdeps
|
||||
dh_installdeb
|
||||
# dh_perl
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
6
ipmitool/debian/watch
Normal file
6
ipmitool/debian/watch
Normal file
@ -0,0 +1,6 @@
|
||||
# Rename this file to "watch" and then you can run the "uscan" command
|
||||
# to check for upstream updates and more.
|
||||
# Site Directory Pattern Version Script
|
||||
version=2
|
||||
http://heanet.dl.sourceforge.net/sourceforge/ipmitool/ipmitool-(.*).tar.bz2
|
||||
# debian uupdate
|
@ -27,13 +27,10 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
man_MANS = ipmitool.1
|
||||
man_MANS = ipmitool.1 ipmievd.8
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
|
222
ipmitool/doc/ipmievd.8
Normal file
222
ipmitool/doc/ipmievd.8
Normal file
@ -0,0 +1,222 @@
|
||||
.TH "ipmievd" "8" "" "Duncan Laurie" ""
|
||||
.SH "NAME"
|
||||
ipmievd \- IPMI event daemon for sending events to syslog
|
||||
.SH "SYNOPSIS"
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIopen\fP <\fIopen\fR | \fIsel\fR> [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
|
||||
[\fB\-p\fR <\fIport\fP>]
|
||||
[\fB\-U\fR <\fIusername\fP>]
|
||||
[\fB\-A\fR <\fIauthtype\fP>]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
\fIsel\fP [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIlanplus\fP \fB\-H\fR <\fIhostname\fP>
|
||||
[\fB\-p\fR <\fIport\fP>]
|
||||
[\fB\-U\fR <\fIusername\fP>]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
[\fB\-C\fR <\fIciphersuite\fP>]
|
||||
\fIsel\fR [<\fIoption\fP>]
|
||||
.SH "DESCRIPTION"
|
||||
\fBipmievd\fP is a daemon which will listen for events from the
|
||||
BMC that are being sent to the SEL and also log those messages to
|
||||
syslog. It is able to run in one of two modes: either using the
|
||||
Event Message Buffer and asynchronous event notification from the
|
||||
OpenIPMI kernel driver or actively polling the contents of the
|
||||
SEL for new events. Upon receipt of an event via either mechanism
|
||||
it will be logged to syslog with the \fILOG_LOCAL4\fP facility.
|
||||
|
||||
It is based on the \fBipmitool\fR utility and shares the same IPMI
|
||||
interface support and session setup options. Please see the
|
||||
\fBipmitool\fR manpage for more information on supported IPMI
|
||||
interfaces.
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
\fB\-a\fR
|
||||
Prompt for the remote server password.
|
||||
.TP
|
||||
\fB\-A\fR <\fIauthtype\fP>
|
||||
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
|
||||
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Present output in CSV (comma separated variable) format.
|
||||
This is not available with all commands.
|
||||
.TP
|
||||
\fB\-C\fR <\fIciphersuite\fP>
|
||||
The remote server authentication, integrity, and encryption algorithms
|
||||
to use for IPMIv2 \fIlanplus\fP connections. See table 22\-19 in the
|
||||
IPMIv2 specification. The default is 3 which specifies RAKP\-HMAC\-SHA1
|
||||
authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorightms.
|
||||
.TP
|
||||
\fB\-E\fR
|
||||
The remote server password is specified by the environment
|
||||
variable \fIIPMI_PASSWORD\fP.
|
||||
.TP
|
||||
\fB\-f\fR <\fIpassword_file\fP>
|
||||
Specifies a file containing the remote server password. If this
|
||||
option is absent, or if password_file is empty, the password
|
||||
will default to NULL.
|
||||
.TP
|
||||
\fB\-h\fR
|
||||
Get basic usage help from the command line.
|
||||
.TP
|
||||
\fB\-H\fR <\fIaddress\fP>
|
||||
Remote server address, can be IP address or hostname. This
|
||||
option is required for \fIlan\fP and \fIlanplus\fP interfaces.
|
||||
.TP
|
||||
\fB\-I\fR <\fIinterface\fP>
|
||||
Selects IPMI interface to use. Supported interfaces that are
|
||||
compiled in are visible in the usage help output.
|
||||
.TP
|
||||
\fB\-L\fR <\fIprivlvl\fP>
|
||||
Force session privilege level. Can be CALLBACK, USER,
|
||||
OPERATOR, ADMIN. Default is ADMIN.
|
||||
.TP
|
||||
\fB\-m\fR <\fIlocal_address\fP>
|
||||
Set the local IPMB address. The default is 0x20 and there
|
||||
should be no need to change it for normal operation.
|
||||
.TP
|
||||
\fB\-o\fR <\fIoemtype\fP>
|
||||
Select OEM type to support. This usually involves minor hacks
|
||||
in place in the code to work around quirks in various BMCs from
|
||||
various manufacturers. Use \fI\-o list\fP to see a list of
|
||||
current supported OEM types.
|
||||
.TP
|
||||
\fB\-O\fR <\fIsel oem\fP>
|
||||
Open selected file and read OEM SEL event descriptions to be used
|
||||
during SEL listings. See examples in contrib dir for file format.
|
||||
.TP
|
||||
\fB\-p\fR <\fIport\fP>
|
||||
Remote server UDP port to connect to. Default is 623.
|
||||
.TP
|
||||
\fB\-P\fR <\fIpassword\fP>
|
||||
Remote server password is specified on the command line.
|
||||
If supported it will be obscured in the process list.
|
||||
\fBNote!\fR Specifying the password as a command line
|
||||
option is not recommended.
|
||||
.TP
|
||||
\fB\-S\fR <\fIsdr_cache_file\fP>
|
||||
Use local file for remote SDR cache. Using a local SDR cache
|
||||
can drastically increase performance for commands that require
|
||||
knowledge of the entire SDR to perform their function.
|
||||
.TP
|
||||
\fB\-t\fR <\fItarget_address\fP>
|
||||
Bridge IPMI requests to the remote target address.
|
||||
.TP
|
||||
\fB\-U\fR <\fIusername\fP>
|
||||
Remote server username, default is NULL user.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified
|
||||
multiple times to increase the level of debug output. If given
|
||||
three times you will get hexdumps of all incoming and
|
||||
outgoing packets.
|
||||
.TP
|
||||
\fB\-V\fR
|
||||
Display version information.
|
||||
|
||||
.LP
|
||||
If no password method is specified then ipmievd will prompt the
|
||||
user for a password. If no password is entered at the prompt,
|
||||
the remote server password will default to NULL.
|
||||
.SH "COMMANDS"
|
||||
.TP
|
||||
\fIhelp\fP
|
||||
This can be used to get command\-line help. It may also be
|
||||
placed at the end of commands to get option usage help.
|
||||
|
||||
> ipmievd help
|
||||
.br
|
||||
Commands:
|
||||
open Use OpenIPMI for asyncronous notification of events
|
||||
sel Poll SEL for notification of events
|
||||
|
||||
.TP
|
||||
\fIopen\fP
|
||||
This command starts ipmievd with the OpenIPMI event watching
|
||||
mechanism which relies on the Event Message Buffer feature of
|
||||
IPMI. This requires a properly installed and configured
|
||||
OpenIPMI driver on Linux and is only valid to be run through
|
||||
the \fIopen\fP interface. See the \fBipmitool\fR manpage
|
||||
and associated documentation for more information on setting
|
||||
up the OpenIPMI driver.
|
||||
|
||||
\fBNote\fR: Some BMC do not support the Event Message Buffer
|
||||
required for this command. Other BMCs claim to support it but
|
||||
do not actually deliver events to it. If this is the case please
|
||||
use the \fIsel\fP method.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
\fIdaemon\fP
|
||||
Launch process as a daemon and reparent to init process.
|
||||
All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fIsel\fP
|
||||
This command starts ipmievd with the SEL Polling event watching
|
||||
mechanism. This will poll the SEL periodically to determine if
|
||||
new events have been logged. This command should work with all
|
||||
BMCs and is capable of using the LAN interface as well to monitor
|
||||
a remote system and log its events to a local syslog.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
\fIdaemon\fP
|
||||
Launch process as a daemon and reparent to init process.
|
||||
All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid.
|
||||
.TP
|
||||
\fItimeout\fP=<\fBseconds\fR>
|
||||
Time between checks for SEL polling method. Default is 10 seconds.
|
||||
.RE
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fIExample 1\fP: Daemon process watching OpenIPMI for events
|
||||
|
||||
> ipmievd \-I open open daemon
|
||||
.TP
|
||||
\fIExample 2\fP: Local non\-daemon process checking remote SEL every 30 seconds
|
||||
|
||||
> ipmievd \-I lan \-H 1.2.3.4 \-f passfile sel nodaemon timeout=30
|
||||
.br
|
||||
Reading Sensors...
|
||||
.br
|
||||
Waiting for Events...
|
||||
.br
|
||||
.SH "AUTHOR"
|
||||
Duncan Laurie <duncan@iceblink.org>
|
||||
.SH "SEE ALSO"
|
||||
.TP
|
||||
IPMItool Homepage
|
||||
http://ipmitool.sourceforge.net
|
||||
.TP
|
||||
Intelligent Platform Management Interface Specification
|
||||
http://www.intel.com/design/servers/ipmi
|
||||
.TP
|
||||
OpenIPMI Homepage
|
||||
http://openipmi.sourceforge.net
|
File diff suppressed because it is too large
Load Diff
@ -27,10 +27,6 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
|
@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_H
|
||||
#define _IPMI_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/ipmi.h>
|
||||
|
||||
#define BUF_SIZE 256
|
||||
|
||||
extern int verbose;
|
||||
extern int csv_output;
|
||||
|
||||
struct ipmi_session {
|
||||
unsigned char username[16];
|
||||
unsigned char challenge[16];
|
||||
unsigned char password;
|
||||
unsigned char authtype;
|
||||
unsigned char authcode[16];
|
||||
unsigned char privlvl;
|
||||
unsigned long in_seq;
|
||||
unsigned long out_seq;
|
||||
unsigned long id;
|
||||
int active;
|
||||
};
|
||||
|
||||
struct ipmi_req_entry {
|
||||
struct ipmi_req req;
|
||||
struct ipmi_intf * intf;
|
||||
struct ipmi_session * session;
|
||||
unsigned char rq_seq;
|
||||
unsigned char * msg_data;
|
||||
int msg_len;
|
||||
struct ipmi_req_entry * next;
|
||||
};
|
||||
|
||||
struct ipmi_rsp {
|
||||
unsigned char ccode;
|
||||
unsigned char data[BUF_SIZE];
|
||||
int data_len;
|
||||
struct {
|
||||
unsigned char authtype;
|
||||
unsigned long seq;
|
||||
unsigned long id;
|
||||
} session;
|
||||
unsigned char msglen;
|
||||
struct {
|
||||
unsigned char rq_addr;
|
||||
unsigned char netfn;
|
||||
unsigned char rq_lun;
|
||||
unsigned char rs_addr;
|
||||
unsigned char rq_seq;
|
||||
unsigned char rs_lun;
|
||||
unsigned char cmd;
|
||||
} header;
|
||||
};
|
||||
|
||||
struct ipmi_intf {
|
||||
int fd;
|
||||
struct sockaddr_in addr;
|
||||
int (*open)(struct ipmi_intf *, char *, int, char *);
|
||||
void (*close)(struct ipmi_intf *);
|
||||
struct ipmi_rsp *(*sendrecv)(struct ipmi_intf *, struct ipmi_req *);
|
||||
int (*ll_send)(struct ipmi_intf *, unsigned char *, int);
|
||||
struct ipmi_rsp *(*ll_recv)(struct ipmi_intf *, int);
|
||||
};
|
||||
|
||||
#define IPMI_NETFN_CHASSIS 0x0
|
||||
#define IPMI_NETFN_BRIDGE 0x2
|
||||
#define IPMI_NETFN_SE 0x4
|
||||
#define IPMI_NETFN_APP 0x6
|
||||
#define IPMI_NETFN_FIRMWARE 0x8
|
||||
#define IPMI_NETFN_STORAGE 0xa
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
int handle_ipmi(struct ipmi_intf *intf, unsigned char * data, int data_len);
|
||||
|
||||
#endif /* _IPMI_H */
|
@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_ENTITY
|
||||
#define _IPMI_ENTITY
|
||||
|
||||
#include <helper.h>
|
||||
|
||||
const struct valstr entity_id_vals[] __attribute__((unused)) = {
|
||||
{ 0x00, "Unspecified" },
|
||||
{ 0x01, "Other" },
|
||||
{ 0x02, "Unknown" },
|
||||
{ 0x03, "Processor" },
|
||||
{ 0x04, "Disk or Disk Bay" },
|
||||
{ 0x05, "Peripheral Bay" },
|
||||
{ 0x06, "System Management Module" },
|
||||
{ 0x07, "System Board" },
|
||||
{ 0x08, "Memory Module" },
|
||||
{ 0x09, "Processor Module" },
|
||||
{ 0x0a, "Power Supply" },
|
||||
{ 0x0b, "Add-in Card" },
|
||||
{ 0x0c, "Front Panel Board" },
|
||||
{ 0x0d, "Back Panel Board" },
|
||||
{ 0x0e, "Power System Board" },
|
||||
{ 0x0f, "Drive Backplane" },
|
||||
{ 0x10, "System Internal Expansion Board" },
|
||||
{ 0x11, "Other System Board" },
|
||||
{ 0x12, "Processor Board" },
|
||||
{ 0x13, "Power Unit" },
|
||||
{ 0x14, "Power Module" },
|
||||
{ 0x15, "Power Management" },
|
||||
{ 0x16, "Chassis Back Panel Board" },
|
||||
{ 0x17, "System Chassis" },
|
||||
{ 0x18, "Sub-Chassis" },
|
||||
{ 0x19, "Other Chassis Board" },
|
||||
{ 0x1a, "Disk Drive Bay" },
|
||||
{ 0x1b, "Peripheral Bay" },
|
||||
{ 0x1c, "Device Bay" },
|
||||
{ 0x1d, "Fan Device" },
|
||||
{ 0x1e, "Cooling Unit" },
|
||||
{ 0x1f, "Cable/Interconnect" },
|
||||
{ 0x20, "Memory Device" },
|
||||
{ 0x21, "System Management Software" },
|
||||
{ 0x22, "BIOS" },
|
||||
{ 0x23, "Operating System" },
|
||||
{ 0x24, "System Bus" },
|
||||
{ 0x25, "Group" },
|
||||
{ 0x26, "Remote Management Device" },
|
||||
{ 0x27, "External Environment" },
|
||||
{ 0x28, "Battery" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
#endif /* _IPMI_ENTITY */
|
||||
|
@ -1,122 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_FRU_H
|
||||
#define _IPMI_FRU_H
|
||||
|
||||
#define GET_FRU_INFO 0x10
|
||||
#define GET_FRU_DATA 0x11
|
||||
#define SET_FRU_DATA 0x12
|
||||
|
||||
enum {
|
||||
FRU_CHASSIS_PARTNO,
|
||||
FRU_CHASSIS_SERIAL,
|
||||
FRU_BOARD_MANUF,
|
||||
FRU_BOARD_PRODUCT,
|
||||
FRU_BOARD_SERIAL,
|
||||
FRU_BOARD_PARTNO,
|
||||
FRU_PRODUCT_MANUF,
|
||||
FRU_PRODUCT_NAME,
|
||||
FRU_PRODUCT_PARTNO,
|
||||
FRU_PRODUCT_VERSION,
|
||||
FRU_PRODUCT_SERIAL,
|
||||
FRU_PRODUCT_ASSET,
|
||||
};
|
||||
|
||||
struct fru_info {
|
||||
unsigned short size;
|
||||
unsigned char access : 1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_header {
|
||||
unsigned char version;
|
||||
struct {
|
||||
unsigned char internal;
|
||||
unsigned char chassis;
|
||||
unsigned char board;
|
||||
unsigned char product;
|
||||
unsigned char multi;
|
||||
} offset;
|
||||
unsigned char pad;
|
||||
unsigned char checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_area_chassis {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char type;
|
||||
char * part;
|
||||
char * serial;
|
||||
};
|
||||
|
||||
struct fru_area_board {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char lang;
|
||||
unsigned long mfg_date_time;
|
||||
char * mfg;
|
||||
char * prod;
|
||||
char * serial;
|
||||
char * part;
|
||||
};
|
||||
|
||||
struct fru_area_product {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char lang;
|
||||
char * mfg;
|
||||
char * name;
|
||||
char * part;
|
||||
char * version;
|
||||
char * serial;
|
||||
char * asset;
|
||||
};
|
||||
|
||||
static const char * chassis_type_desc[] __attribute__((unused)) = {
|
||||
"Unspecified", "Other", "Unknown",
|
||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||
"Mini Tower", "Tower",
|
||||
"Portable", "LapTop", "Notebook", "Hand Held", "Docking Station",
|
||||
"All in One", "Sub Notebook", "Space-saving", "Lunch Box",
|
||||
"Main Server Chassis", "Expansion Chassis", "SubChassis",
|
||||
"Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis",
|
||||
"Rack Mount Chassis"
|
||||
};
|
||||
|
||||
void ipmi_print_fru(struct ipmi_intf *, unsigned char);
|
||||
int ipmi_fru_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* _IPMI_FRU_H */
|
@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_LAN_H
|
||||
#define _IPMI_LAN_H
|
||||
|
||||
#include <linux/ipmi.h>
|
||||
#include "ipmi.h"
|
||||
|
||||
#define IPMI_LAN_SET_CONFIG 0x01
|
||||
#define IPMI_LAN_GET_CONFIG 0x02
|
||||
#define IPMI_LAN_SUSPEND_ARP 0x03
|
||||
# define IPMI_LAN_SUSPEND_ARP_RESP (2)
|
||||
# define IPMI_LAN_SUSPEND_ARP_GRAT (1)
|
||||
#define IPMI_LAN_GET_STAT 0x04
|
||||
|
||||
#define IPMI_LAN_CHANNEL_1 0x07
|
||||
#define IPMI_LAN_CHANNEL_2 0x06
|
||||
#define IPMI_LAN_CHANNEL_E 0x0e
|
||||
|
||||
enum {
|
||||
IPMI_LANP_SET_IN_PROGRESS,
|
||||
IPMI_LANP_AUTH_TYPE,
|
||||
IPMI_LANP_AUTH_TYPE_ENABLE,
|
||||
IPMI_LANP_IP_ADDR,
|
||||
IPMI_LANP_IP_ADDR_SRC,
|
||||
IPMI_LANP_MAC_ADDR,
|
||||
IPMI_LANP_SUBNET_MASK,
|
||||
IPMI_LANP_IP_HEADER,
|
||||
IPMI_LANP_PRI_RMCP_PORT,
|
||||
IPMI_LANP_SEC_RMCP_PORT,
|
||||
IPMI_LANP_BMC_ARP,
|
||||
IPMI_LANP_GRAT_ARP,
|
||||
IPMI_LANP_DEF_GATEWAY_IP,
|
||||
IPMI_LANP_DEF_GATEWAY_MAC,
|
||||
IPMI_LANP_BAK_GATEWAY_IP,
|
||||
IPMI_LANP_BAK_GATEWAY_MAC,
|
||||
IPMI_LANP_SNMP_STRING,
|
||||
IPMI_LANP_NUM_DEST,
|
||||
IPMI_LANP_DEST_TYPE,
|
||||
IPMI_LANP_DEST_ADDR,
|
||||
IPMI_LANP_OEM_ALERT_STRING=96,
|
||||
IPMI_LANP_ALERT_RETRY=97,
|
||||
IPMI_LANP_UTC_OFFSET=98,
|
||||
IPMI_LANP_DHCP_SERVER_IP=192,
|
||||
IPMI_LANP_DHCP_SERVER_MAC=193,
|
||||
IPMI_LANP_DHCP_ENABLE=194,
|
||||
IPMI_LANP_CHAN_ACCESS_MODE=201,
|
||||
};
|
||||
|
||||
static struct lan_param {
|
||||
int cmd;
|
||||
int size;
|
||||
char desc[24];
|
||||
unsigned char * data;
|
||||
} ipmi_lan_params[] __attribute__((unused)) = {
|
||||
{ IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress" },
|
||||
{ IPMI_LANP_AUTH_TYPE, 1, "Auth Type" },
|
||||
{ IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable" },
|
||||
{ IPMI_LANP_IP_ADDR, 4, "IP Address" },
|
||||
{ IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source" },
|
||||
{ IPMI_LANP_MAC_ADDR, 6, "MAC Address" },
|
||||
{ IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask" },
|
||||
{ IPMI_LANP_IP_HEADER, 3, "IP Header" },
|
||||
{ IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port" },
|
||||
{ IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port" },
|
||||
{ IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" },
|
||||
{ IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl" },
|
||||
{ IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP" },
|
||||
{ IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC" },
|
||||
{ IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP" },
|
||||
{ IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" },
|
||||
{ IPMI_LANP_SNMP_STRING, 18, "Community String" },
|
||||
{ IPMI_LANP_NUM_DEST, 1, "Number of Destinations"},
|
||||
{ IPMI_LANP_DEST_TYPE, 4, "Destination Type" },
|
||||
{ IPMI_LANP_DEST_ADDR, 13, "Destination Addresses" },
|
||||
{ IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" },
|
||||
{ IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm" },
|
||||
{ IPMI_LANP_UTC_OFFSET, 3, "UTC Offset" },
|
||||
{ IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP" },
|
||||
{ IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" },
|
||||
{ IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" },
|
||||
{ IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode" },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
#define IPMI_SESSION_AUTHTYPE_NONE 0x0
|
||||
#define IPMI_SESSION_AUTHTYPE_MD2 0x1
|
||||
#define IPMI_SESSION_AUTHTYPE_KEY 0x4
|
||||
#define IPMI_SESSION_AUTHTYPE_OEM 0x5
|
||||
|
||||
#define IPMI_SESSION_PRIV_CALLBACK 0x1
|
||||
#define IPMI_SESSION_PRIV_USER 0x2
|
||||
#define IPMI_SESSION_PRIV_OPERATOR 0x3
|
||||
#define IPMI_SESSION_PRIV_ADMIN 0x4
|
||||
#define IPMI_SESSION_PRIV_OEM 0x5
|
||||
|
||||
extern struct ipmi_session lan_session;
|
||||
|
||||
unsigned char ipmi_csum(unsigned char * d, int s);
|
||||
|
||||
struct ipmi_rsp * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_req * req);
|
||||
int ipmi_lan_open(struct ipmi_intf * intf, char * hostname, int port, char * password);
|
||||
void ipmi_lan_close(struct ipmi_intf * intf);
|
||||
void ipmi_get_channel_info(struct ipmi_intf * intf, unsigned char channel);
|
||||
int ipmi_lan_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
struct ipmi_intf ipmi_lan_intf;
|
||||
|
||||
#endif /*_IPMI_LAN_H*/
|
@ -1,326 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_SDR_H
|
||||
#define _IPMI_SDR_H
|
||||
|
||||
#include <math.h>
|
||||
#include <byteswap.h>
|
||||
#include <ipmi.h>
|
||||
|
||||
int ipmi_sdr_main(struct ipmi_intf *, int, char **);
|
||||
int utos(unsigned val, unsigned bits);
|
||||
|
||||
#define __TO_TOL(mtol) (bswap_16(mtol) & 0x3f)
|
||||
#define __TO_M(mtol) (utos((((bswap_16(mtol) & 0xff00) >> 8) | ((bswap_16(mtol) & 0xc0) << 2)), 10))
|
||||
#define __TO_B(bacc) (utos((((bswap_32(bacc) & 0xff000000) >> 24) | \
|
||||
((bswap_32(bacc) & 0xc00000) >> 14)), 10))
|
||||
#define __TO_ACC(bacc) (((bswap_32(bacc) & 0x3f0000) >> 16) | ((bswap_32(bacc) & 0xf000) >> 6))
|
||||
#define __TO_ACC_EXP(bacc) ((bswap_32(bacc) & 0xc00) >> 10)
|
||||
#define __TO_R_EXP(bacc) (utos(((bswap_32(bacc) & 0xf0) >> 4), 4))
|
||||
#define __TO_B_EXP(bacc) (utos((bswap_32(bacc) & 0xf), 4))
|
||||
|
||||
#define CONVERT_RAW(val, m, b, k1, k2) (float)(((m * val) + (b * pow(10, k1))) * pow(10, k2))
|
||||
#define CONVERT_TOL(val, m, k2) (float)(((m * val) / 2) * pow(10, k2))
|
||||
|
||||
#define CONVERT_SENSOR_RAW(sensor, val) (float)(((__TO_M((sensor)->mtol) * val) + (__TO_B((sensor)->bacc) * pow(10, __TO_B_EXP((sensor)->bacc)))) * pow(10, __TO_R_EXP((sensor)->bacc)))
|
||||
#define CONVERT_SENSOR_TOL(sensor) (float)((((__TO_M((sensor)->mtol) * __TO_TOL((sensor)->mtol)) / 2) * pow(10, __TO_R_EXP((sensor)->bacc))))
|
||||
|
||||
#define GET_SDR_REPO_INFO 0x20
|
||||
#define GET_SDR_ALLOC_INFO 0x21
|
||||
|
||||
#define SDR_SENSOR_STAT_LO_NC (1<<0)
|
||||
#define SDR_SENSOR_STAT_LO_CR (1<<1)
|
||||
#define SDR_SENSOR_STAT_LO_NR (1<<2)
|
||||
#define SDR_SENSOR_STAT_HI_NC (1<<3)
|
||||
#define SDR_SENSOR_STAT_HI_CR (1<<4)
|
||||
#define SDR_SENSOR_STAT_HI_NR (1<<5)
|
||||
|
||||
struct sdr_repo_info_rs {
|
||||
unsigned char version; /* SDR version (51h) */
|
||||
unsigned short count; /* number of records */
|
||||
unsigned short free; /* free space in SDR */
|
||||
unsigned long add_stamp; /* last add timestamp */
|
||||
unsigned long erase_stamp; /* last del timestamp */
|
||||
unsigned char op_support; /* supported operations */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define GET_SDR_RESERVE_REPO 0x22
|
||||
struct sdr_reserve_repo_rs {
|
||||
unsigned short reserve_id; /* reservation ID */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define GET_SDR 0x23
|
||||
struct sdr_get_rq {
|
||||
unsigned short reserve_id; /* reservation ID */
|
||||
unsigned short id; /* record ID */
|
||||
unsigned char offset; /* offset into SDR */
|
||||
#define GET_SDR_ENTIRE_RECORD 0xff
|
||||
#define GET_SDR_MAX_LEN 30
|
||||
unsigned char length; /* length to read */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sdr_get_rs {
|
||||
unsigned short next; /* next record id */
|
||||
unsigned short id; /* record ID */
|
||||
unsigned char version; /* SDR version (51h) */
|
||||
#define SDR_RECORD_TYPE_FULL_SENSOR 0x01
|
||||
#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02
|
||||
unsigned char type; /* record type */
|
||||
unsigned char length; /* remaining record bytes */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sdr_record_compact_sensor {
|
||||
struct {
|
||||
unsigned char owner_id;
|
||||
unsigned char lun : 2, /* sensor owner lun */
|
||||
__reserved : 2,
|
||||
channel : 4; /* channel number */
|
||||
unsigned char sensor_num; /* unique sensor number */
|
||||
} keys;
|
||||
|
||||
struct {
|
||||
unsigned char id; /* physical entity id */
|
||||
unsigned char instance : 7, /* instance number */
|
||||
logical : 1; /* physical/logical */
|
||||
} entity;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
unsigned char sensor_scan : 1,
|
||||
event_gen : 1,
|
||||
type : 1,
|
||||
hysteresis : 1,
|
||||
thresholds : 1,
|
||||
events : 1,
|
||||
scanning : 1,
|
||||
__reserved : 1;
|
||||
} init;
|
||||
struct {
|
||||
unsigned char event_msg : 2,
|
||||
threshold : 2,
|
||||
hysteresis : 2,
|
||||
rearm : 1,
|
||||
ignore : 1;
|
||||
} capabilities;
|
||||
unsigned char type; /* sensor type */
|
||||
} sensor;
|
||||
|
||||
unsigned char event_type; /* event/reading type code */
|
||||
|
||||
union {
|
||||
struct {
|
||||
unsigned short assert_event; /* assertion event mask */
|
||||
unsigned short deassert_event; /* de-assertion event mask */
|
||||
unsigned short read; /* discrete reaading mask */
|
||||
} discrete;
|
||||
struct {
|
||||
unsigned short lower; /* lower threshold reading mask */
|
||||
unsigned short upper; /* upper threshold reading mask */
|
||||
unsigned char set; /* settable threshold mask */
|
||||
unsigned char read; /* readable threshold mask */
|
||||
} threshold;
|
||||
} mask;
|
||||
|
||||
struct {
|
||||
unsigned char pct : 1,
|
||||
modifier : 2,
|
||||
rate : 3,
|
||||
analog : 2;
|
||||
struct {
|
||||
unsigned char base;
|
||||
unsigned char modifier;
|
||||
} type;
|
||||
} unit;
|
||||
|
||||
struct {
|
||||
unsigned char count : 4,
|
||||
mod_type : 2,
|
||||
__reserved : 2;
|
||||
unsigned char mod_offset : 7,
|
||||
entity_inst : 1;
|
||||
} share;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
unsigned char positive;
|
||||
unsigned char negative;
|
||||
} hysteresis;
|
||||
} threshold;
|
||||
|
||||
unsigned char __reserved[3];
|
||||
unsigned char oem; /* reserved for OEM use */
|
||||
unsigned char id_code; /* sensor ID string type/length code */
|
||||
unsigned char id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sdr_record_full_sensor {
|
||||
struct {
|
||||
unsigned char owner_id;
|
||||
unsigned char lun : 2, /* sensor owner lun */
|
||||
__reserved : 2,
|
||||
channel : 4; /* channel number */
|
||||
unsigned char sensor_num; /* unique sensor number */
|
||||
} keys;
|
||||
|
||||
struct {
|
||||
unsigned char id; /* physical entity id */
|
||||
unsigned char instance : 7, /* instance number */
|
||||
logical : 1; /* physical/logical */
|
||||
} entity;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
unsigned char sensor_scan : 1,
|
||||
event_gen : 1,
|
||||
type : 1,
|
||||
hysteresis : 1,
|
||||
thresholds : 1,
|
||||
events : 1,
|
||||
scanning : 1,
|
||||
__reserved : 1;
|
||||
} init;
|
||||
struct {
|
||||
unsigned char event_msg : 2,
|
||||
threshold : 2,
|
||||
hysteresis : 2,
|
||||
rearm : 1,
|
||||
ignore : 1;
|
||||
} capabilities;
|
||||
unsigned char type;
|
||||
} sensor;
|
||||
|
||||
unsigned char event_type; /* event/reading type code */
|
||||
|
||||
union {
|
||||
struct {
|
||||
unsigned short assert_event; /* assertion event mask */
|
||||
unsigned short deassert_event; /* de-assertion event mask */
|
||||
unsigned short read; /* discrete reaading mask */
|
||||
} discrete;
|
||||
struct {
|
||||
unsigned short lower; /* lower threshold reading mask */
|
||||
unsigned short upper; /* upper threshold reading mask */
|
||||
unsigned char set; /* settable threshold mask */
|
||||
unsigned char read; /* readable threshold mask */
|
||||
} threshold;
|
||||
} mask;
|
||||
|
||||
struct {
|
||||
unsigned char pct : 1,
|
||||
modifier : 2,
|
||||
rate : 3,
|
||||
analog : 2;
|
||||
struct {
|
||||
unsigned char base;
|
||||
unsigned char modifier;
|
||||
} type;
|
||||
} unit;
|
||||
|
||||
unsigned char linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */
|
||||
|
||||
unsigned short mtol; /* M, tolerance */
|
||||
|
||||
unsigned long bacc; /* accuracy, B, Bexp, Rexp */
|
||||
|
||||
struct {
|
||||
unsigned char nominal_read : 1, /* nominal reading field specified */
|
||||
normal_max : 1, /* normal max field specified */
|
||||
normal_min : 1, /* normal min field specified */
|
||||
__reserved : 5;
|
||||
} analog_flag;
|
||||
|
||||
unsigned char nominal_read; /* nominal reading, raw value */
|
||||
unsigned char normal_max; /* normal maximum, raw value */
|
||||
unsigned char normal_min; /* normal minimum, raw value */
|
||||
unsigned char sensor_max; /* sensor maximum, raw value */
|
||||
unsigned char sensor_min; /* sensor minimum, raw value */
|
||||
|
||||
struct {
|
||||
struct {
|
||||
unsigned char non_recover;
|
||||
unsigned char critical;
|
||||
unsigned char non_critical;
|
||||
} upper;
|
||||
struct {
|
||||
unsigned char non_recover;
|
||||
unsigned char critical;
|
||||
unsigned char non_critical;
|
||||
} lower;
|
||||
struct {
|
||||
unsigned char positive;
|
||||
unsigned char negative;
|
||||
} hysteresis;
|
||||
} threshold;
|
||||
unsigned char __reserved[2];
|
||||
unsigned char oem; /* reserved for OEM use */
|
||||
unsigned char id_code; /* sensor ID string type/length code */
|
||||
unsigned char id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* unit description codes (IPMI v1.5 section 37.16) */
|
||||
#define UNIT_MAX 0x90
|
||||
static const char * unit_desc[] __attribute__((unused)) = {
|
||||
"unspecified",
|
||||
"degrees C", "degrees F", "degrees K",
|
||||
"Volts", "Amps", "Watts", "Joules",
|
||||
"Coulombs", "VA", "Nits",
|
||||
"lumen", "lux", "Candela",
|
||||
"kPa", "PSI", "Newton",
|
||||
"CFM", "RPM", "Hz",
|
||||
"microsecond", "millisecond", "second", "minute", "hour", "day", "week",
|
||||
"mil", "inches", "feet", "cu in", "cu feet", "mm", "cm", "m", "cu cm", "cu m",
|
||||
"liters", "fluid ounce",
|
||||
"radians", "steradians", "revolutions", "cycles", "gravities",
|
||||
"ounce", "pound", "ft-lb", "oz-in",
|
||||
"gauss", "gilberts", "henry", "millihenry",
|
||||
"farad", "microfarad", "ohms", "siemens", "mole", "becquerel",
|
||||
"PPM", "reserved",
|
||||
"Decibels", "DbA", "DbC",
|
||||
"gray", "sievert", "color temp deg K",
|
||||
"bit", "kilobit", "megabit", "gigabit",
|
||||
"byte", "kilobyte", "megabyte", "gigabyte",
|
||||
"word", "dword", "qword", "line",
|
||||
"hit", "miss", "retry", "reset",
|
||||
"overflow", "underrun",
|
||||
"collision", "packets",
|
||||
"messages", "characters",
|
||||
"error", "correctable error", "uncorrectable error",
|
||||
};
|
||||
|
||||
#endif /* _IPMI_SDR_H */
|
||||
|
@ -1,366 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_SEL_H
|
||||
#define _IPMI_SEL_H
|
||||
|
||||
#include <ipmi.h>
|
||||
|
||||
enum {
|
||||
IPMI_EVENT_CLASS_DISCRETE,
|
||||
IPMI_EVENT_CLASS_DIGITAL,
|
||||
IPMI_EVENT_CLASS_THRESHOLD,
|
||||
IPMI_EVENT_CLASS_OEM,
|
||||
};
|
||||
|
||||
struct sel_get_rq {
|
||||
unsigned short reserve_id;
|
||||
unsigned short record_id;
|
||||
unsigned char offset;
|
||||
unsigned char length;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_event_record {
|
||||
unsigned short next_id;
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned long timestamp;
|
||||
unsigned short gen_id;
|
||||
unsigned char evm_rev;
|
||||
unsigned char sensor_type;
|
||||
unsigned char sensor_num;
|
||||
unsigned char event_type : 7;
|
||||
unsigned char event_dir : 1;
|
||||
unsigned char event_data[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_oem_record_ts {
|
||||
unsigned short next_id;
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned long timestamp;
|
||||
unsigned char mfg_id[3];
|
||||
unsigned char oem_defined[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_oem_record_nots {
|
||||
unsigned short next_id;
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned char oem_defined[13];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct ipmi_event_type {
|
||||
unsigned char code;
|
||||
unsigned char offset;
|
||||
unsigned char class;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
static struct ipmi_event_type event_types[] __attribute__((unused)) = {
|
||||
/* Threshold Based States */
|
||||
{ 0x01, 0x00, IPMI_EVENT_CLASS_THRESHOLD, "Lower Non-critical - going low" },
|
||||
{ 0x01, 0x01, IPMI_EVENT_CLASS_THRESHOLD, "Lower Non-critical - going high" },
|
||||
{ 0x01, 0x02, IPMI_EVENT_CLASS_THRESHOLD, "Lower Critical - going low" },
|
||||
{ 0x01, 0x03, IPMI_EVENT_CLASS_THRESHOLD, "Lower Critical - going high" },
|
||||
{ 0x01, 0x04, IPMI_EVENT_CLASS_THRESHOLD, "Lower Non-recoverable - going low" },
|
||||
{ 0x01, 0x05, IPMI_EVENT_CLASS_THRESHOLD, "Lower Non-recoverable - going high" },
|
||||
{ 0x01, 0x06, IPMI_EVENT_CLASS_THRESHOLD, "Upper Non-critical - going low" },
|
||||
{ 0x01, 0x07, IPMI_EVENT_CLASS_THRESHOLD, "Upper Non-critical - going high" },
|
||||
{ 0x01, 0x08, IPMI_EVENT_CLASS_THRESHOLD, "Upper Critical - going low" },
|
||||
{ 0x01, 0x09, IPMI_EVENT_CLASS_THRESHOLD, "Upper Critical - going high" },
|
||||
{ 0x01, 0x0a, IPMI_EVENT_CLASS_THRESHOLD, "Upper Non-recoverable - going low" },
|
||||
{ 0x01, 0x0b, IPMI_EVENT_CLASS_THRESHOLD, "Upper Non-recoverable - going high" },
|
||||
/* DMI-based "usage state" States */
|
||||
{ 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Transition to Idle" },
|
||||
{ 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Transition to Active" },
|
||||
{ 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Transition to Busy" },
|
||||
/* Digital-Discrete Event States */
|
||||
{ 0x03, 0x00, IPMI_EVENT_CLASS_DIGITAL, "State Deasserted" },
|
||||
{ 0x03, 0x01, IPMI_EVENT_CLASS_DIGITAL, "State Asserted" },
|
||||
{ 0x04, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Predictive Failure Deasserted" },
|
||||
{ 0x04, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Predictive Failure Asserted" },
|
||||
{ 0x05, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Limit Not Exceeded" },
|
||||
{ 0x05, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Limit Exceeded" },
|
||||
{ 0x06, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Performance Met" },
|
||||
{ 0x06, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Performance Lags" },
|
||||
/* Severity Event States */
|
||||
{ 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Transition to OK" },
|
||||
{ 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Transition to Non-critial from OK" },
|
||||
{ 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Transition to Critical from less severe" },
|
||||
{ 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Transition to Non-recoverable from less severe" },
|
||||
{ 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Transition to Non-critical from more severe" },
|
||||
{ 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Transition to Critical from Non-recoverable" },
|
||||
{ 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Transition to Non-recoverable" },
|
||||
{ 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Monitor" },
|
||||
{ 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Informational" },
|
||||
/* Availability Status States */
|
||||
{ 0x08, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Device Removed/Absent" },
|
||||
{ 0x08, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Device Inserted/Present" },
|
||||
{ 0x09, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Device Disabled" },
|
||||
{ 0x09, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Device Enabled" },
|
||||
{ 0x0a, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Transition to Running" },
|
||||
{ 0x0a, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Transition to In Test" },
|
||||
{ 0x0a, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Transition to Power Off" },
|
||||
{ 0x0a, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Transition to On Line" },
|
||||
{ 0x0a, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Transition to Off Line" },
|
||||
{ 0x0a, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Transition to Off Duty" },
|
||||
{ 0x0a, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Transition to Degraded" },
|
||||
{ 0x0a, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Transition to Power Save" },
|
||||
{ 0x0a, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Install Error" },
|
||||
/* Redundancy States */
|
||||
{ 0x0b, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Fully Redundant" },
|
||||
{ 0x0b, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Redundancy Lost" },
|
||||
{ 0x0b, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Redundancy Degraded" },
|
||||
{ 0x0b, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Non-Redundant: Sufficient from Redundant" },
|
||||
{ 0x0b, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Non-Redundant: Sufficient from Insufficient" },
|
||||
{ 0x0b, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Non-Redundant: Insufficient Resources" },
|
||||
{ 0x0b, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Redundancy Degraded from Fully Redundant" },
|
||||
{ 0x0b, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Redundancy Degraded from Non-Redundant" },
|
||||
/* ACPI Device Power States */
|
||||
{ 0x0c, 0x00, IPMI_EVENT_CLASS_DISCRETE, "D0 Power State" },
|
||||
{ 0x0c, 0x01, IPMI_EVENT_CLASS_DISCRETE, "D1 Power State" },
|
||||
{ 0x0c, 0x02, IPMI_EVENT_CLASS_DISCRETE, "D2 Power State" },
|
||||
{ 0x0c, 0x03, IPMI_EVENT_CLASS_DISCRETE, "D3 Power State" },
|
||||
/* END */
|
||||
{ 0x00, 0x00, 0x00, NULL },
|
||||
};
|
||||
|
||||
struct ipmi_sensor_types {
|
||||
unsigned char code;
|
||||
unsigned char offset;
|
||||
const char * type;
|
||||
const char * event;
|
||||
};
|
||||
|
||||
static struct ipmi_sensor_types sensor_types[] __attribute__((unused)) = {
|
||||
{ 0x00, 0x00, "Reserved", NULL },
|
||||
{ 0x01, 0x00, "Temperature", NULL },
|
||||
{ 0x02, 0x00, "Voltage", NULL },
|
||||
{ 0x03, 0x00, "Current", NULL },
|
||||
{ 0x04, 0x00, "Fan", NULL },
|
||||
|
||||
{ 0x05, 0x00, "Chassis Intrusion", "General Chassis intrusion" },
|
||||
{ 0x05, 0x01, "Chassis Intrusion", "Drive Bay intrusion" },
|
||||
{ 0x05, 0x02, "Chassis Intrusion", "I/O Card area intrusion" },
|
||||
{ 0x05, 0x03, "Chassis Intrusion", "Processor area intrusion" },
|
||||
{ 0x05, 0x04, "Chassis Intrusion", "System unplugged from LAN" },
|
||||
{ 0x05, 0x05, "Chassis Intrusion", "Unauthorized dock/undock" },
|
||||
{ 0x05, 0x06, "Chassis Intrusion", "FAN area intrusion" },
|
||||
|
||||
{ 0x06, 0x00, "Platform Security", "Front Panel Lockout violation attempted" },
|
||||
{ 0x06, 0x01, "Platform Security", "Pre-boot password viiolation - user password" },
|
||||
{ 0x06, 0x02, "Platform Security", "Pre-boot password violation - setup password" },
|
||||
{ 0x06, 0x03, "Platform Security", "Pre-boot password violation - network boot password" },
|
||||
{ 0x06, 0x04, "Platform Security", "Other pre-boot password violation" },
|
||||
{ 0x06, 0x05, "Platform Security", "Out-of-band access password violation" },
|
||||
|
||||
{ 0x07, 0x00, "Processor", "IERR" },
|
||||
{ 0x07, 0x01, "Processor", "Thermal Trip" },
|
||||
{ 0x07, 0x02, "Processor", "FRB1/BIST failure" },
|
||||
{ 0x07, 0x03, "Processor", "FRB2/Hang in POST failure" },
|
||||
{ 0x07, 0x04, "Processor", "FRB3/Processor startup/init failure" },
|
||||
{ 0x07, 0x05, "Processor", "Configuration Error" },
|
||||
{ 0x07, 0x06, "Processor", "SM BIOS Uncorrectable CPU-complex Error" },
|
||||
{ 0x07, 0x07, "Processor", "Presence detected" },
|
||||
{ 0x07, 0x08, "Processor", "Disabled" },
|
||||
{ 0x07, 0x09, "Processor", "Terminator presence detected" },
|
||||
|
||||
{ 0x08, 0x00, "Power Supply", "Presence detected" },
|
||||
{ 0x08, 0x01, "Power Supply", "Failure detected" },
|
||||
{ 0x08, 0x02, "Power Supply", "Predictive failure" },
|
||||
{ 0x08, 0x03, "Power Supply", "Power Supply AC lost" },
|
||||
{ 0x08, 0x04, "Power Supply", "AC lost or out-of-range" },
|
||||
{ 0x08, 0x05, "Power Supply", "AC out-of-range, but present" },
|
||||
|
||||
{ 0x09, 0x00, "Power Unit", "Power off/down" },
|
||||
{ 0x09, 0x01, "Power Unit", "Power cycle" },
|
||||
{ 0x09, 0x02, "Power Unit", "240VA power down" },
|
||||
{ 0x09, 0x03, "Power Unit", "Interlock power down" },
|
||||
{ 0x09, 0x04, "Power Unit", "AC lost" },
|
||||
{ 0x09, 0x05, "Power Unit", "Soft-power control failure" },
|
||||
{ 0x09, 0x06, "Power Unit", "Failure detected" },
|
||||
{ 0x09, 0x07, "Power Unit", "Predictive failure" },
|
||||
|
||||
{ 0x0a, 0x00, "Cooling Device", NULL },
|
||||
{ 0x0b, 0x00, "Other Units-based Sensor", NULL },
|
||||
|
||||
{ 0x0c, 0x00, "Memory", "Correctable ECC" },
|
||||
{ 0x0c, 0x01, "Memory", "Uncorrectable ECC" },
|
||||
{ 0x0c, 0x02, "Memory", "Parity" },
|
||||
{ 0x0c, 0x03, "Memory", "Memory Scrub Failed" },
|
||||
{ 0x0c, 0x04, "Memory", "Memory Device Disabled" },
|
||||
{ 0x0c, 0x05, "Memory", "Correctable ECC logging limit reached" },
|
||||
|
||||
{ 0x0d, 0x00, "Drive Slot", NULL },
|
||||
{ 0x0e, 0x00, "POST Memory Resize", NULL },
|
||||
|
||||
{ 0x0f, 0x00, "System Firmware", "Error" },
|
||||
{ 0x0f, 0x01, "System Firmware", "Hang" },
|
||||
{ 0x0f, 0x02, "System Firmware", "Progress" },
|
||||
|
||||
{ 0x10, 0x00, "Event Logging Disabled", "Correctable memory error logging disabled" },
|
||||
{ 0x10, 0x01, "Event Logging Disabled", "Event logging disabled" },
|
||||
{ 0x10, 0x02, "Event Logging Disabled", "Log area reset/cleared" },
|
||||
{ 0x10, 0x03, "Event Logging Disabled", "All event logging disabled" },
|
||||
|
||||
{ 0x11, 0x00, "Watchdog 1", "BIOS Reset" },
|
||||
{ 0x11, 0x01, "Watchdog 1", "OS Reset" },
|
||||
{ 0x11, 0x02, "Watchdog 1", "OS Shut Down" },
|
||||
{ 0x11, 0x03, "Watchdog 1", "OS Power Down" },
|
||||
{ 0x11, 0x04, "Watchdog 1", "OS Power Cycle" },
|
||||
{ 0x11, 0x05, "Watchdog 1", "OS NMI/diag Interrupt" },
|
||||
{ 0x11, 0x06, "Watchdog 1", "OS Expired" },
|
||||
{ 0x11, 0x07, "Watchdog 1", "OS pre-timeout Interrupt" },
|
||||
|
||||
{ 0x12, 0x00, "System Event", "System Reconfigured" },
|
||||
{ 0x12, 0x01, "System Event", "OEM System boot event" },
|
||||
{ 0x12, 0x02, "System Event", "Undetermined system hardware failure" },
|
||||
{ 0x12, 0x03, "System Event", "Entry added to auxillary log" },
|
||||
{ 0x12, 0x04, "System Event", "PEF Action" },
|
||||
|
||||
{ 0x13, 0x00, "Critical Interrupt", "Front Panel NMI" },
|
||||
{ 0x13, 0x01, "Critical Interrupt", "Bus Timeout" },
|
||||
{ 0x13, 0x02, "Critical Interrupt", "I/O Channel check NMI" },
|
||||
{ 0x13, 0x03, "Critical Interrupt", "Software NMI" },
|
||||
{ 0x13, 0x04, "Critical Interrupt", "PCI PERR" },
|
||||
{ 0x13, 0x05, "Critical Interrupt", "PCI SERR" },
|
||||
{ 0x13, 0x06, "Critical Interrupt", "EISA failsafe timeout" },
|
||||
{ 0x13, 0x07, "Critical Interrupt", "Bus Correctable error" },
|
||||
{ 0x13, 0x08, "Critical Interrupt", "Bus Uncorrectable error" },
|
||||
{ 0x13, 0x09, "Critical Interrupt", "Fatal NMI" },
|
||||
|
||||
{ 0x14, 0x00, "Button", "Power Button pressed" },
|
||||
{ 0x14, 0x01, "Button", "Sleep Button pressed" },
|
||||
{ 0x14, 0x02, "Button", "Reset Button pressed" },
|
||||
|
||||
{ 0x15, 0x00, "Module/Board", NULL },
|
||||
{ 0x16, 0x00, "Microcontroller/Coprocessor", NULL },
|
||||
{ 0x17, 0x00, "Add-in Card", NULL },
|
||||
{ 0x18, 0x00, "Chassis", NULL },
|
||||
{ 0x19, 0x00, "Chip Set", NULL },
|
||||
{ 0x1a, 0x00, "Other FRU", NULL },
|
||||
{ 0x1b, 0x00, "Cable/Interconnect", NULL },
|
||||
{ 0x1c, 0x00, "Terminator", NULL },
|
||||
|
||||
{ 0x1d, 0x00, "System Boot Initiated", "Initiated by power up" },
|
||||
{ 0x1d, 0x01, "System Boot Initiated", "Initiated by hard reset" },
|
||||
{ 0x1d, 0x02, "System Boot Initiated", "Initiated by warm reset" },
|
||||
{ 0x1d, 0x03, "System Boot Initiated", "User requested PXE boot" },
|
||||
{ 0x1d, 0x04, "System Boot Initiated", "Automatic boot to diagnostic" },
|
||||
|
||||
{ 0x1e, 0x00, "Boot Error", "No bootable media" },
|
||||
{ 0x1e, 0x01, "Boot Error", "Non-bootable disk in drive" },
|
||||
{ 0x1e, 0x02, "Boot Error", "PXE server not found" },
|
||||
{ 0x1e, 0x03, "Boot Error", "Invalid boot sector" },
|
||||
{ 0x1e, 0x04, "Boot Error", "Timeout waiting for selection" },
|
||||
|
||||
{ 0x1f, 0x00, "OS Boot", "A: boot completed" },
|
||||
{ 0x1f, 0x01, "OS Boot", "C: boot completed" },
|
||||
{ 0x1f, 0x02, "OS Boot", "PXE boot completed" },
|
||||
{ 0x1f, 0x03, "OS Boot", "Diagnostic boot completed" },
|
||||
{ 0x1f, 0x04, "OS Boot", "CD-ROM boot completed" },
|
||||
{ 0x1f, 0x05, "OS Boot", "ROM boot completed" },
|
||||
{ 0x1f, 0x06, "OS Boot", "boot completed - device not specified" },
|
||||
|
||||
{ 0x20, 0x00, "OS Critical Stop", "Stop during OS load/init" },
|
||||
{ 0x20, 0x01, "OS Critical Stop", "Run-time stop" },
|
||||
|
||||
{ 0x21, 0x00, "Slot/Connector", "Fault Status asserted" },
|
||||
{ 0x21, 0x01, "Slot/Connector", "Identify Status asserted" },
|
||||
{ 0x21, 0x02, "Slot/Connector", "Slot/Connector Device installed/attached" },
|
||||
{ 0x21, 0x03, "Slot/Connector", "Slot/Connector ready for device installation" },
|
||||
{ 0x21, 0x04, "Slot/Connector", "Slot/Connector ready for device removal" },
|
||||
{ 0x21, 0x05, "Slot/Connector", "Slot Power is off" },
|
||||
{ 0x21, 0x06, "Slot/Connector", "Slot/Connector device removal request" },
|
||||
{ 0x21, 0x07, "Slot/Connector", "Interlock asserted" },
|
||||
{ 0x21, 0x08, "Slot/Connector", "Slot is disabled" },
|
||||
|
||||
{ 0x22, 0x00, "System ACPI Power State", "S0/G0: working" },
|
||||
{ 0x22, 0x01, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" },
|
||||
{ 0x22, 0x02, "System ACPI Power State", "S2: sleeping, processor context lost" },
|
||||
{ 0x22, 0x03, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" },
|
||||
{ 0x22, 0x04, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" },
|
||||
{ 0x22, 0x05, "System ACPI Power State", "S5/G2: soft-off" },
|
||||
{ 0x22, 0x06, "System ACPI Power State", "S4/S5: soft-off" },
|
||||
{ 0x22, 0x07, "System ACPI Power State", "G3: mechanical off" },
|
||||
{ 0x22, 0x08, "System ACPI Power State", "Sleeping in S1/S2/S3 state" },
|
||||
{ 0x22, 0x09, "System ACPI Power State", "G1: sleeping" },
|
||||
{ 0x22, 0x0a, "System ACPI Power State", "S5: entered by override" },
|
||||
{ 0x22, 0x0b, "System ACPI Power State", "Legacy ON state" },
|
||||
{ 0x22, 0x0c, "System ACPI Power State", "Legacy OFF state" },
|
||||
{ 0x22, 0x0e, "System ACPI Power State", "Unknown" },
|
||||
|
||||
{ 0x23, 0x00, "Watchdog 2", "Timer expired" },
|
||||
{ 0x23, 0x01, "Watchdog 2", "Hard reset" },
|
||||
{ 0x23, 0x02, "Watchdog 2", "Power down" },
|
||||
{ 0x23, 0x03, "Watchdog 2", "Power cycle" },
|
||||
{ 0x23, 0x04, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x05, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x06, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x07, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x08, "Watchdog 2", "Timer interrupt" },
|
||||
|
||||
{ 0x24, 0x00, "Platform Alert", "Platform generated page" },
|
||||
{ 0x24, 0x01, "Platform Alert", "Platform generated LAN alert" },
|
||||
{ 0x24, 0x02, "Platform Alert", "Platform Event Trap generated" },
|
||||
{ 0x24, 0x03, "Platform Alert", "Platform generated SNMP trap, OEM format" },
|
||||
|
||||
{ 0x25, 0x00, "Entity Presence", "Present" },
|
||||
{ 0x25, 0x01, "Entity Presence", "Absent" },
|
||||
{ 0x25, 0x02, "Entity Presence", "Disabled" },
|
||||
|
||||
{ 0x26, 0x00, "Monitor ASIC/IC", NULL },
|
||||
|
||||
{ 0x27, 0x00, "LAN", "Heartbeat Lost" },
|
||||
{ 0x27, 0x01, "LAN", "Heartbeat" },
|
||||
|
||||
{ 0x28, 0x00, "Management Subsystem Health", "Sensor access degraded or unavailable" },
|
||||
{ 0x28, 0x01, "Management Subsystem Health", "Controller access degraded or unavailable" },
|
||||
{ 0x28, 0x02, "Management Subsystem Health", "Management controller off-line" },
|
||||
{ 0x28, 0x03, "Management Subsystem Health", "Management controller unavailable" },
|
||||
|
||||
{ 0x29, 0x00, "Battery", "Low" },
|
||||
{ 0x29, 0x01, "Battery", "Failed" },
|
||||
{ 0x29, 0x02, "Battery", "Presence Detected" },
|
||||
|
||||
{ 0x00, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*_IPMI_SEL_H*/
|
@ -27,16 +27,15 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
ipmitooldir = $(includedir)/ipmitool
|
||||
|
||||
ipmitool_HEADERS = bswap.h helper.h ipmi.h ipmi_intf.h \
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_lanp.h \
|
||||
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_bmc.h
|
||||
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \
|
||||
ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
|
||||
ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.h \
|
||||
ipmi_oem.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
|
||||
ipmi_kontronoem.h
|
||||
|
||||
|
@ -28,28 +28,26 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_BSWAP_H
|
||||
#define IPMI_BSWAP_H
|
||||
|
||||
#if defined(__sun)
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
|
||||
#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\
|
||||
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
|
||||
#undef BSWAP_16
|
||||
#undef BSWAP_32
|
||||
|
||||
#if HAVE_BYTESWAP_H
|
||||
# include <byteswap.h>
|
||||
# define BSWAP_16(x) bswap_16(x)
|
||||
# define BSWAP_32(x) bswap_32(x)
|
||||
#else
|
||||
|
||||
#include <byteswap.h>
|
||||
|
||||
#define BSWAP_16(x) bswap_16(x)
|
||||
#define BSWAP_32(x) bswap_32(x)
|
||||
|
||||
# define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
|
||||
# define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\
|
||||
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
|
||||
#endif
|
||||
|
||||
#endif /* IPMI_BSWAP_H */
|
||||
|
@ -28,31 +28,51 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_HELPER_H
|
||||
#define IPMI_HELPER_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct valstr {
|
||||
unsigned char val;
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
const char * val2str(unsigned char val, const struct valstr * vs);
|
||||
const char * val2str(uint16_t val, const struct valstr * vs);
|
||||
uint16_t str2val(const char * str, const struct valstr * vs);
|
||||
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
|
||||
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
|
||||
|
||||
unsigned short buf2short(unsigned char * buf);
|
||||
unsigned long buf2long(unsigned char * buf);
|
||||
const char * buf2str(unsigned char * buf, int len);
|
||||
void printbuf(unsigned char * buf, int len, char * desc);
|
||||
|
||||
void signal_handler(int sig, void * handler);
|
||||
uint16_t buf2short(uint8_t * buf);
|
||||
uint32_t buf2long(uint8_t * buf);
|
||||
const char * buf2str(uint8_t * buf, int len);
|
||||
void printbuf(const uint8_t * buf, int len, const char * desc);
|
||||
uint8_t ipmi_csum(uint8_t * d, int s);
|
||||
FILE * ipmi_open_file(const char * file, int rw);
|
||||
void ipmi_start_daemon(void);
|
||||
|
||||
#define SIG_IGNORE(s) ((void)signal((s), SIG_IGN))
|
||||
#define SIG_DEFAULT(s) ((void)signal((s), SIG_DFL))
|
||||
#define SIG_HANDLE(s,h) ((void)signal_handler((s), (h)))
|
||||
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
|
||||
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
|
||||
|
||||
#ifndef __min
|
||||
# define __min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef __max
|
||||
# define __max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef __minlen
|
||||
# define __minlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x < y) ? x : y;})
|
||||
#endif
|
||||
|
||||
#ifndef __maxlen
|
||||
# define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;})
|
||||
#endif
|
||||
|
||||
#endif /* IPMI_HELPER_H */
|
||||
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_H
|
||||
@ -39,74 +35,189 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
#define BUF_SIZE 256
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
/* From table 13.16 of the IPMI v2 specification */
|
||||
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
|
||||
#define IPMI_PAYLOAD_TYPE_SOL 0x01
|
||||
#define IPMI_PAYLOAD_TYPE_OEM 0x02
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST 0x10
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE 0x11
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_1 0x12
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_2 0x13
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_3 0x14
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_4 0x15
|
||||
|
||||
extern int verbose;
|
||||
extern int csv_output;
|
||||
|
||||
struct ipmi_session {
|
||||
unsigned char username[16];
|
||||
unsigned char challenge[16];
|
||||
unsigned char password;
|
||||
unsigned char authtype;
|
||||
unsigned char authcode[16];
|
||||
unsigned char privlvl;
|
||||
unsigned long in_seq;
|
||||
unsigned long out_seq;
|
||||
unsigned long id;
|
||||
int active;
|
||||
};
|
||||
|
||||
struct ipmi_rq {
|
||||
struct {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
unsigned short data_len;
|
||||
unsigned char *data;
|
||||
uint8_t netfn:6;
|
||||
uint8_t lun:2;
|
||||
uint8_t cmd;
|
||||
uint8_t target_cmd;
|
||||
uint16_t data_len;
|
||||
uint8_t *data;
|
||||
} msg;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is what the sendrcv_v2() function would take as an argument. The common case
|
||||
* is for payload_type to be IPMI_PAYLOAD_TYPE_IPMI.
|
||||
*/
|
||||
struct ipmi_v2_payload {
|
||||
uint16_t payload_length;
|
||||
uint8_t payload_type;
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
uint8_t rq_seq;
|
||||
struct ipmi_rq *request;
|
||||
} ipmi_request;
|
||||
|
||||
struct {
|
||||
uint8_t rs_seq;
|
||||
struct ipmi_rs *response;
|
||||
} ipmi_response;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *request;
|
||||
} open_session_request;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_1_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_2_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_3_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_4_message;
|
||||
|
||||
struct {
|
||||
uint8_t data[IPMI_BUF_SIZE];
|
||||
uint16_t character_count;
|
||||
uint8_t packet_sequence_number;
|
||||
uint8_t acked_packet_number;
|
||||
uint8_t accepted_character_count;
|
||||
uint8_t is_nack; /* bool */
|
||||
uint8_t assert_ring_wor; /* bool */
|
||||
uint8_t generate_break; /* bool */
|
||||
uint8_t deassert_cts; /* bool */
|
||||
uint8_t deassert_dcd_dsr; /* bool */
|
||||
uint8_t flush_inbound; /* bool */
|
||||
uint8_t flush_outbound; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
struct ipmi_rq_entry {
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_intf * intf;
|
||||
struct ipmi_session * session;
|
||||
unsigned char rq_seq;
|
||||
unsigned char * msg_data;
|
||||
struct ipmi_intf *intf;
|
||||
uint8_t rq_seq;
|
||||
uint8_t *msg_data;
|
||||
int msg_len;
|
||||
struct ipmi_rq_entry * next;
|
||||
struct ipmi_rq_entry *next;
|
||||
};
|
||||
|
||||
struct ipmi_rs {
|
||||
unsigned char ccode;
|
||||
unsigned char data[BUF_SIZE];
|
||||
int data_len;
|
||||
struct {
|
||||
unsigned char authtype;
|
||||
unsigned long seq;
|
||||
unsigned long id;
|
||||
} session;
|
||||
unsigned char msglen;
|
||||
struct {
|
||||
unsigned char rq_addr;
|
||||
unsigned char netfn;
|
||||
unsigned char rq_lun;
|
||||
unsigned char rs_addr;
|
||||
unsigned char rq_seq;
|
||||
unsigned char rs_lun;
|
||||
unsigned char cmd;
|
||||
} header;
|
||||
};
|
||||
uint8_t ccode;
|
||||
uint8_t data[IPMI_BUF_SIZE];
|
||||
|
||||
struct ipmi_intf {
|
||||
int fd;
|
||||
struct sockaddr_in addr;
|
||||
int abort;
|
||||
int pedantic;
|
||||
int (*open)(struct ipmi_intf *, char *, int, char *);
|
||||
void (*close)(struct ipmi_intf *);
|
||||
struct ipmi_rs *(*sendrecv)(struct ipmi_intf *, struct ipmi_rq *);
|
||||
/*
|
||||
* Looks like this is the length of the entire packet, including the RMCP
|
||||
* stuff, then modified to be the length of the extra IPMI message data
|
||||
*/
|
||||
int data_len;
|
||||
|
||||
struct {
|
||||
uint8_t netfn;
|
||||
uint8_t cmd;
|
||||
uint8_t seq;
|
||||
uint8_t lun;
|
||||
} msg;
|
||||
|
||||
struct {
|
||||
uint8_t authtype;
|
||||
uint32_t seq;
|
||||
uint32_t id;
|
||||
uint8_t bEncrypted; /* IPMI v2 only */
|
||||
uint8_t bAuthenticated; /* IPMI v2 only */
|
||||
uint8_t payloadtype; /* IPMI v2 only */
|
||||
/* This is the total length of the payload or
|
||||
IPMI message. IPMI v2.0 requires this to
|
||||
be 2 bytes. Not really used for much. */
|
||||
uint16_t msglen;
|
||||
} session;
|
||||
|
||||
/*
|
||||
* A union of the different possible payload meta-data
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
uint8_t rq_addr;
|
||||
uint8_t netfn;
|
||||
uint8_t rq_lun;
|
||||
uint8_t rs_addr;
|
||||
uint8_t rq_seq;
|
||||
uint8_t rs_lun;
|
||||
uint8_t cmd;
|
||||
} ipmi_response;
|
||||
struct {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
uint8_t max_priv_level;
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
uint8_t auth_alg;
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
} open_session_response;
|
||||
struct {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
uint32_t console_id;
|
||||
uint8_t bmc_rand[16]; /* Random number generated by the BMC */
|
||||
uint8_t bmc_guid[16];
|
||||
uint8_t key_exchange_auth_code[20];
|
||||
} rakp2_message;
|
||||
struct {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
uint32_t console_id;
|
||||
uint8_t integrity_check_value[20];
|
||||
} rakp4_message;
|
||||
struct {
|
||||
uint8_t packet_sequence_number;
|
||||
uint8_t acked_packet_number;
|
||||
uint8_t accepted_character_count;
|
||||
uint8_t is_nack; /* bool */
|
||||
uint8_t transfer_unavailable; /* bool */
|
||||
uint8_t sol_inactive; /* bool */
|
||||
uint8_t transmit_overrun; /* bool */
|
||||
uint8_t break_detected; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
#define IPMI_NETFN_CHASSIS 0x0
|
||||
@ -116,11 +227,13 @@ struct ipmi_intf {
|
||||
#define IPMI_NETFN_FIRMWARE 0x8
|
||||
#define IPMI_NETFN_STORAGE 0xa
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_SOL 0x34
|
||||
#define IPMI_NETFN_PICMG 0x2C
|
||||
#define IPMI_NETFN_ISOL 0x34
|
||||
#define IPMI_NETFN_TSOL 0x30
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
int handle_ipmi(struct ipmi_intf *intf, unsigned char * data, int data_len);
|
||||
extern const struct valstr completion_code_vals[];
|
||||
|
||||
#endif /* IPMI_H */
|
||||
#endif /* IPMI_H */
|
||||
|
229
ipmitool/include/ipmitool/ipmi_channel.h
Normal file
229
ipmitool/include/ipmitool/ipmi_channel.h
Normal file
@ -0,0 +1,229 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHANNEL_H
|
||||
#define IPMI_CHANNEL_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
|
||||
#define IPMI_GET_CHANNEL_ACCESS 0x41
|
||||
#define IPMI_GET_CHANNEL_INFO 0x42
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
#define IPMI_GET_USER_NAME 0x46
|
||||
#define IPMI_SET_USER_PASSWORD 0x47
|
||||
#define IPMI_GET_CHANNEL_CIPHER_SUITES 0x54
|
||||
|
||||
|
||||
/*
|
||||
* The Get Authentication Capabilities response structure
|
||||
* From table 22-15 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_auth_cap_rsp {
|
||||
uint8_t channel_number;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
uint8_t __reserved1 : 1;
|
||||
uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
#else
|
||||
uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
uint8_t __reserved1 : 1;
|
||||
uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t kg_status : 1; /* two-key login status */
|
||||
uint8_t per_message_auth : 1; /* per-message authentication status */
|
||||
uint8_t user_level_auth : 1; /* user-level authentication status */
|
||||
uint8_t non_null_usernames : 1; /* one or more non-null users exist */
|
||||
uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
#else
|
||||
uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
uint8_t non_null_usernames : 1; /* one or more non-null users exist */
|
||||
uint8_t user_level_auth : 1; /* user-level authentication status */
|
||||
uint8_t per_message_auth : 1; /* per-message authentication status */
|
||||
uint8_t kg_status : 1; /* two-key login status */
|
||||
uint8_t __reserved2 : 2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 6;
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
#else
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
uint8_t __reserved3 : 6;
|
||||
#endif
|
||||
uint8_t oem_id[3]; /* IANA enterprise number for auth type */
|
||||
uint8_t oem_aux_data; /* Additional OEM specific data for oem auths */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The Get Channel Info response structure
|
||||
* From table 22-29 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_info_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 4;
|
||||
uint8_t channel_number : 4; /* channel number */
|
||||
#else
|
||||
uint8_t channel_number : 4; /* channel number */
|
||||
uint8_t __reserved1 : 4;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 1;
|
||||
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
|
||||
#else
|
||||
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
|
||||
uint8_t __reserved2 : 1;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 3;
|
||||
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
|
||||
#else
|
||||
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
|
||||
uint8_t __reserved3 : 3;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t session_support : 2; /* Description of session support */
|
||||
uint8_t active_sessions : 6; /* Count of active sessions */
|
||||
#else
|
||||
uint8_t active_sessions : 6; /* Count of active sessions */
|
||||
uint8_t session_support : 2; /* Description of session support */
|
||||
#endif
|
||||
uint8_t vendor_id[3]; /* For OEM that specified the protocol */
|
||||
uint8_t aux_info[2]; /* Not used*/
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The Get Channel Access response structure
|
||||
* From table 22-28 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t alerting : 1;
|
||||
uint8_t per_message_auth : 1;
|
||||
uint8_t user_level_auth : 1;
|
||||
uint8_t access_mode : 3;
|
||||
#else
|
||||
uint8_t access_mode : 3;
|
||||
uint8_t user_level_auth : 1;
|
||||
uint8_t per_message_auth : 1;
|
||||
uint8_t alerting : 1;
|
||||
uint8_t __reserved1 : 2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 4;
|
||||
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
#else
|
||||
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
uint8_t __reserved2 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct get_user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t max_user_ids : 6;
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t enabled_user_ids : 6;
|
||||
uint8_t __reserved3 : 2;
|
||||
uint8_t fixed_user_ids : 6;
|
||||
uint8_t __reserved4 : 1;
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t link_auth : 1;
|
||||
uint8_t ipmi_messaging : 1;
|
||||
uint8_t privilege_limit : 4;
|
||||
#else
|
||||
uint8_t max_user_ids : 6;
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t enabled_user_ids : 6;
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t fixed_user_ids : 6;
|
||||
uint8_t __reserved3 : 2;
|
||||
uint8_t privilege_limit : 4;
|
||||
uint8_t ipmi_messaging : 1;
|
||||
uint8_t link_auth : 1;
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct set_user_access_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t change_bits : 1;
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t link_auth : 1;
|
||||
uint8_t ipmi_messaging : 1;
|
||||
uint8_t channel : 4;
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t user_id : 6;
|
||||
uint8_t __reserved2 : 4;
|
||||
uint8_t privilege_limit : 4;
|
||||
uint8_t __reserved3 : 4;
|
||||
uint8_t session_limit : 4;
|
||||
#else
|
||||
uint8_t channel : 4;
|
||||
uint8_t ipmi_messaging : 1;
|
||||
uint8_t link_auth : 1;
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t change_bits : 1;
|
||||
uint8_t user_id : 6;
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t privilege_limit : 4;
|
||||
uint8_t __reserved2 : 4;
|
||||
uint8_t session_limit : 4;
|
||||
uint8_t __reserved3 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
|
||||
uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
|
||||
int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv);
|
||||
int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel);
|
||||
|
||||
#endif /*IPMI_CHANNEL_H*/
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHASSIS_H
|
||||
@ -51,6 +47,9 @@
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
|
||||
int ipmi_chassis_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_chassis_power_status(struct ipmi_intf * intf);
|
||||
int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl);
|
||||
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /*IPMI_CHASSIS_H*/
|
||||
|
123
ipmitool/include/ipmitool/ipmi_constants.h
Normal file
123
ipmitool/include/ipmitool/ipmi_constants.h
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CONSTANTS_H
|
||||
#define IPMI_CONSTANTS_H
|
||||
|
||||
|
||||
/*
|
||||
* COMMANDS
|
||||
*/
|
||||
#define IPMI_GET_SDR_REPOSITORY_INFO 0x20
|
||||
#define IMPI_SOL_ACTIVATING 0x20
|
||||
#define IMPI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IMPI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
#define IPMI_GET_USER_NAME 0x46
|
||||
#define IPMI_SET_USER_PASSWORD 0x47
|
||||
#define IPMI_ACTIVATE_PAYLOAD 0x48
|
||||
#define IPMI_DEACTIVATE_PAYLOAD 0x49
|
||||
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
|
||||
#define IPMI_GET_SEL_TIME 0x48
|
||||
#define IPMI_SET_SEL_TIME 0x49
|
||||
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_MD5 0x04
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_PASSWORD 0x10
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_OEM 0x20
|
||||
|
||||
#define IPMI_SESSION_AUTHTYPE_NONE 0x0
|
||||
#define IPMI_SESSION_AUTHTYPE_MD2 0x1
|
||||
#define IPMI_SESSION_AUTHTYPE_MD5 0x2
|
||||
#define IPMI_SESSION_AUTHTYPE_KEY 0x4
|
||||
#define IPMI_SESSION_AUTHTYPE_PASSWORD IPMI_SESSION_AUTHTYPE_KEY
|
||||
#define IPMI_SESSION_AUTHTYPE_OEM 0x5
|
||||
#define IPMI_SESSION_AUTHTYPE_RMCP_PLUS 0x6
|
||||
|
||||
#define IPMI_SESSION_PRIV_UNSPECIFIED 0x0
|
||||
#define IPMI_SESSION_PRIV_CALLBACK 0x1
|
||||
#define IPMI_SESSION_PRIV_USER 0x2
|
||||
#define IPMI_SESSION_PRIV_OPERATOR 0x3
|
||||
#define IPMI_SESSION_PRIV_ADMIN 0x4
|
||||
#define IPMI_SESSION_PRIV_OEM 0x5
|
||||
|
||||
#define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00
|
||||
#define IPMI_SET_IN_PROGRESS_IN_PROGRESS 0x01
|
||||
#define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
|
||||
#define IPMI_CHANNEL_MEDIUM_RESERVED 0x0
|
||||
#define IPMI_CHANNEL_MEDIUM_IPMB_I2C 0x1
|
||||
#define IPMI_CHANNEL_MEDIUM_ICMB_1 0x2
|
||||
#define IPMI_CHANNEL_MEDIUM_ICMB_09 0x3
|
||||
#define IPMI_CHANNEL_MEDIUM_LAN 0x4
|
||||
#define IPMI_CHANNEL_MEDIUM_SERIAL 0x5
|
||||
#define IPMI_CHANNEL_MEDIUM_LAN_OTHER 0x6
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_PCI 0x7
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_1 0x8
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_2 0x9
|
||||
#define IPMI_CHANNEL_MEDIUM_USB_1 0xa
|
||||
#define IPMI_CHANNEL_MEDIUM_USB_2 0xb
|
||||
#define IPMI_CHANNEL_MEDIUM_SYSTEM 0xc
|
||||
|
||||
#define IPMI_CHASSIS_CTL_POWER_DOWN 0x0
|
||||
#define IPMI_CHASSIS_CTL_POWER_UP 0x1
|
||||
#define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2
|
||||
#define IPMI_CHASSIS_CTL_HARD_RESET 0x3
|
||||
#define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4
|
||||
#define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5
|
||||
|
||||
#define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
|
||||
/* From table 13-17 of the IPMI v2 specification */
|
||||
#define IPMI_AUTH_RAKP_NONE 0x00
|
||||
#define IPMI_AUTH_RAKP_HMAC_SHA1 0x01
|
||||
#define IPMI_AUTH_RAKP_HMAC_MD5 0x02
|
||||
|
||||
/* From table 13-18 of the IPMI v2 specification */
|
||||
#define IPMI_INTEGRITY_NONE 0x00
|
||||
#define IPMI_INTEGRITY_HMAC_SHA1_96 0x01
|
||||
#define IPMI_INTEGRITY_HMAC_MD5_128 0x02
|
||||
#define IPMI_INTEGRITY_MD5_128 0x03
|
||||
|
||||
/* From table 13-19 of the IPMI v2 specfication */
|
||||
#define IPMI_CRYPT_NONE 0x00
|
||||
#define IPMI_CRYPT_AES_CBC_128 0x01
|
||||
#define IPMI_CRYPT_XRC4_128 0x02
|
||||
#define IPMI_CRYPT_XRC4_40 0x03
|
||||
|
||||
#endif /*IPMI_CONSTANTS_H*/
|
@ -28,61 +28,20 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ENTITY_H
|
||||
#define IPMI_ENTITY_H
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
const struct valstr entity_id_vals[] __attribute__((unused)) = {
|
||||
{ 0x00, "Unspecified" },
|
||||
{ 0x01, "Other" },
|
||||
{ 0x02, "Unknown" },
|
||||
{ 0x03, "Processor" },
|
||||
{ 0x04, "Disk or Disk Bay" },
|
||||
{ 0x05, "Peripheral Bay" },
|
||||
{ 0x06, "System Management Module" },
|
||||
{ 0x07, "System Board" },
|
||||
{ 0x08, "Memory Module" },
|
||||
{ 0x09, "Processor Module" },
|
||||
{ 0x0a, "Power Supply" },
|
||||
{ 0x0b, "Add-in Card" },
|
||||
{ 0x0c, "Front Panel Board" },
|
||||
{ 0x0d, "Back Panel Board" },
|
||||
{ 0x0e, "Power System Board" },
|
||||
{ 0x0f, "Drive Backplane" },
|
||||
{ 0x10, "System Internal Expansion Board" },
|
||||
{ 0x11, "Other System Board" },
|
||||
{ 0x12, "Processor Board" },
|
||||
{ 0x13, "Power Unit" },
|
||||
{ 0x14, "Power Module" },
|
||||
{ 0x15, "Power Management" },
|
||||
{ 0x16, "Chassis Back Panel Board" },
|
||||
{ 0x17, "System Chassis" },
|
||||
{ 0x18, "Sub-Chassis" },
|
||||
{ 0x19, "Other Chassis Board" },
|
||||
{ 0x1a, "Disk Drive Bay" },
|
||||
{ 0x1b, "Peripheral Bay" },
|
||||
{ 0x1c, "Device Bay" },
|
||||
{ 0x1d, "Fan Device" },
|
||||
{ 0x1e, "Cooling Unit" },
|
||||
{ 0x1f, "Cable/Interconnect" },
|
||||
{ 0x20, "Memory Device" },
|
||||
{ 0x21, "System Management Software" },
|
||||
{ 0x22, "BIOS" },
|
||||
{ 0x23, "Operating System" },
|
||||
{ 0x24, "System Bus" },
|
||||
{ 0x25, "Group" },
|
||||
{ 0x26, "Remote Management Device" },
|
||||
{ 0x27, "External Environment" },
|
||||
{ 0x28, "Battery" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
struct entity_id {
|
||||
uint8_t id; /* physical entity id */
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
uint8_t instance : 7; /* instance number */
|
||||
#else
|
||||
uint8_t instance : 7; /* instance number */
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* IPMI_ENTITY_H */
|
||||
|
||||
|
@ -28,29 +28,33 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_CHASSIS_H
|
||||
#define _IPMI_CHASSIS_H
|
||||
#ifndef IPMI_EVENT_H
|
||||
#define IPMI_EVENT_H
|
||||
|
||||
#include <ipmi.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define IPMI_CHASSIS_CTL_POWER_DOWN 0x0
|
||||
#define IPMI_CHASSIS_CTL_POWER_UP 0x1
|
||||
#define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2
|
||||
#define IPMI_CHASSIS_CTL_HARD_RESET 0x3
|
||||
#define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4
|
||||
#define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5
|
||||
#define EVENT_DIR_ASSERT 0
|
||||
#define EVENT_DIR_DEASSERT 1
|
||||
|
||||
#define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
struct platform_event_msg {
|
||||
uint8_t evm_rev;
|
||||
uint8_t sensor_type;
|
||||
uint8_t sensor_num;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t event_dir : 1;
|
||||
uint8_t event_type : 7;
|
||||
#else
|
||||
uint8_t event_type : 7;
|
||||
uint8_t event_dir : 1;
|
||||
#endif
|
||||
uint8_t event_data[3];
|
||||
} __attribute__((packed));
|
||||
|
||||
int ipmi_chassis_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_event_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*_IPMI_CHASSIS_H*/
|
||||
#endif /*IPMI_EVENT_H*/
|
106
ipmitool/include/ipmitool/ipmi_firewall.h
Normal file
106
ipmitool/include/ipmitool/ipmi_firewall.h
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FIREWALL_H
|
||||
#define IPMI_FIREWALL_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_firewall_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#define BMC_GET_NETFN_SUPPORT 0x09
|
||||
#define BMC_GET_COMMAND_SUPPORT 0x0A
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_SUPPORT 0x0B
|
||||
#define BMC_GET_CONFIGURABLE_COMMANDS 0x0C
|
||||
#define BMC_GET_CONFIGURABLE_COMMAND_SUBFUNCTIONS 0x0D
|
||||
#define BMC_SET_COMMAND_ENABLES 0x60
|
||||
#define BMC_GET_COMMAND_ENABLES 0x61
|
||||
#define BMC_SET_COMMAND_SUBFUNCTION_ENABLES 0x62
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_ENABLES 0x63
|
||||
#define BMC_OEM_NETFN_IANA_SUPPORT 0x64
|
||||
|
||||
#define SET_COMMAND_ENABLE_BYTE (BMC_SET_COMMAND_ENABLES / 8)
|
||||
#define SET_COMMAND_ENABLE_BIT (BMC_SET_COMMAND_ENABLES % 8)
|
||||
|
||||
#define MAX_LUN 4
|
||||
#define MAX_NETFN 64
|
||||
#define MAX_NETFN_PAIR (MAX_NETFN/2)
|
||||
#define MAX_COMMAND 256
|
||||
#define MAX_SUBFN 32
|
||||
#define MAX_COMMAND_BYTES (MAX_COMMAND>>3)
|
||||
#define MAX_SUBFN_BYTES (MAX_SUBFN>>3)
|
||||
|
||||
// support is a bitfield with the following bits set...
|
||||
#define BIT_AVAILABLE 0x01
|
||||
#define BIT_CONFIGURABLE 0x02
|
||||
#define BIT_ENABLED 0x04
|
||||
|
||||
extern int verbose;
|
||||
|
||||
struct command_support {
|
||||
unsigned char support;
|
||||
unsigned char version[3];
|
||||
unsigned char subfn_support[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_config[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_enable[MAX_SUBFN_BYTES];
|
||||
};
|
||||
struct lun_netfn_support {
|
||||
unsigned char support;
|
||||
struct command_support command[MAX_COMMAND];
|
||||
unsigned char command_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char config_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char enable_mask[MAX_COMMAND_BYTES];
|
||||
};
|
||||
struct lun_support {
|
||||
unsigned char support;
|
||||
struct lun_netfn_support netfn[MAX_NETFN_PAIR];
|
||||
};
|
||||
struct bmc_fn_support {
|
||||
struct lun_support lun[MAX_LUN];
|
||||
};
|
||||
struct ipmi_function_params {
|
||||
int channel;
|
||||
int lun;
|
||||
int netfn;
|
||||
int command;
|
||||
int subfn;
|
||||
unsigned char force;
|
||||
};
|
||||
|
||||
static inline int bit_test(const unsigned char * bf, int n) {
|
||||
return !!(bf[n>>3]&(1<<(n%8)));
|
||||
}
|
||||
static inline void bit_set(unsigned char * bf, int n, int v) {
|
||||
bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8));
|
||||
}
|
||||
|
||||
#endif /*IPMI_FIREWALL_H */
|
@ -28,16 +28,18 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FRU_H
|
||||
#define IPMI_FRU_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define GET_FRU_INFO 0x10
|
||||
#define GET_FRU_DATA 0x11
|
||||
@ -59,66 +61,258 @@ enum {
|
||||
};
|
||||
|
||||
struct fru_info {
|
||||
unsigned short size;
|
||||
unsigned char access : 1;
|
||||
uint16_t size;
|
||||
uint8_t access:1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_header {
|
||||
unsigned char version;
|
||||
uint8_t version;
|
||||
struct {
|
||||
unsigned char internal;
|
||||
unsigned char chassis;
|
||||
unsigned char board;
|
||||
unsigned char product;
|
||||
unsigned char multi;
|
||||
uint8_t internal;
|
||||
uint8_t chassis;
|
||||
uint8_t board;
|
||||
uint8_t product;
|
||||
uint8_t multi;
|
||||
} offset;
|
||||
unsigned char pad;
|
||||
unsigned char checksum;
|
||||
uint8_t pad;
|
||||
uint8_t checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_area_chassis {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char type;
|
||||
char * part;
|
||||
char * serial;
|
||||
uint8_t area_ver;
|
||||
uint8_t type;
|
||||
uint16_t area_len;
|
||||
char *part;
|
||||
char *serial;
|
||||
};
|
||||
|
||||
struct fru_area_board {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char lang;
|
||||
unsigned long mfg_date_time;
|
||||
char * mfg;
|
||||
char * prod;
|
||||
char * serial;
|
||||
char * part;
|
||||
uint8_t area_ver;
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
uint32_t mfg_date_time;
|
||||
char *mfg;
|
||||
char *prod;
|
||||
char *serial;
|
||||
char *part;
|
||||
char *fru;
|
||||
};
|
||||
|
||||
struct fru_area_product {
|
||||
unsigned char area_ver;
|
||||
unsigned char area_len;
|
||||
unsigned char lang;
|
||||
char * mfg;
|
||||
char * name;
|
||||
char * part;
|
||||
char * version;
|
||||
char * serial;
|
||||
char * asset;
|
||||
uint8_t area_ver;
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
char *mfg;
|
||||
char *name;
|
||||
char *part;
|
||||
char *version;
|
||||
char *serial;
|
||||
char *asset;
|
||||
char *fru;
|
||||
};
|
||||
|
||||
static const char * chassis_type_desc[] __attribute__((unused)) = {
|
||||
"Unspecified", "Other", "Unknown",
|
||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||
"Mini Tower", "Tower",
|
||||
"Portable", "LapTop", "Notebook", "Hand Held", "Docking Station",
|
||||
"All in One", "Sub Notebook", "Space-saving", "Lunch Box",
|
||||
"Main Server Chassis", "Expansion Chassis", "SubChassis",
|
||||
"Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis",
|
||||
"Rack Mount Chassis"
|
||||
};
|
||||
struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
|
||||
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
|
||||
#define FRU_RECORD_TYPE_DC_LOAD 0x02
|
||||
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
|
||||
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
|
||||
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
|
||||
#define FRU_RECORD_TYPE_PICMG_EXTENSION 0xc0
|
||||
uint8_t type;
|
||||
uint8_t format;
|
||||
uint8_t len;
|
||||
uint8_t record_checksum;
|
||||
uint8_t header_checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
void ipmi_print_fru(struct ipmi_intf *, unsigned char);
|
||||
int ipmi_fru_main(struct ipmi_intf *, int, char **);
|
||||
struct fru_multirec_powersupply {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t capacity;
|
||||
#else
|
||||
uint16_t capacity:12;
|
||||
uint16_t __reserved1:4;
|
||||
#endif
|
||||
uint16_t peak_va;
|
||||
uint8_t inrush_current;
|
||||
uint8_t inrush_interval;
|
||||
uint16_t lowend_input1;
|
||||
uint16_t highend_input1;
|
||||
uint16_t lowend_input2;
|
||||
uint16_t highend_input2;
|
||||
uint8_t lowend_freq;
|
||||
uint8_t highend_freq;
|
||||
uint8_t dropout_tolerance;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2:3;
|
||||
uint8_t tach:1;
|
||||
uint8_t hotswap:1;
|
||||
uint8_t autoswitch:1;
|
||||
uint8_t pfc:1;
|
||||
uint8_t predictive_fail:1;
|
||||
#else
|
||||
uint8_t predictive_fail:1;
|
||||
uint8_t pfc:1;
|
||||
uint8_t autoswitch:1;
|
||||
uint8_t hotswap:1;
|
||||
uint8_t tach:1;
|
||||
uint8_t __reserved2:3;
|
||||
#endif
|
||||
uint16_t peak_cap_ht;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t combined_voltage1:4;
|
||||
uint8_t combined_voltage2:4;
|
||||
#else
|
||||
uint8_t combined_voltage2:4;
|
||||
uint8_t combined_voltage1:4;
|
||||
#endif
|
||||
uint16_t combined_capacity;
|
||||
uint8_t rps_threshold;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* IPMI_FRU_H */
|
||||
static const char *combined_voltage_desc[] __attribute__ ((unused)) = {
|
||||
"12 V", "-12 V", "5 V", "3.3 V"};
|
||||
|
||||
struct fru_multirec_dcoutput {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t standby:1;
|
||||
uint8_t __reserved:3;
|
||||
uint8_t output_number:4;
|
||||
#else
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:3;
|
||||
uint8_t standby:1;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short max_neg_dev;
|
||||
short max_pos_dev;
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_multirec_dcload {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:4;
|
||||
uint8_t output_number:4;
|
||||
#else
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:4;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short min_voltage;
|
||||
short max_voltage;
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_multirec_picmgext_header {
|
||||
unsigned char mfg_id[3];
|
||||
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
||||
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
||||
#define FRU_PICMG_SHELF_POWER_DIST 0x11
|
||||
#define FRU_PICMG_SHELF_ACTIVATION 0x12
|
||||
#define FRU_PICMG_SHMC_IP_CONN 0x13
|
||||
#define FRU_PICMG_BOARD_P2P 0x14
|
||||
#define FRU_AMC_CURRENT 0x16
|
||||
#define FRU_AMC_ACTIVATION 0x17
|
||||
#define FRU_AMC_CARRIER_P2P 0x18
|
||||
#define FRU_AMC_P2P 0x19
|
||||
#define FRU_AMC_CARRIER_INFO 0x1a
|
||||
unsigned char record_id;
|
||||
unsigned char record_version;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_guid {
|
||||
unsigned char guid[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int designator:12;
|
||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
||||
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
||||
unsigned int type:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int grouping:8;
|
||||
#else
|
||||
unsigned int grouping:8;
|
||||
unsigned int ext:4;
|
||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
|
||||
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
|
||||
unsigned int type:8;
|
||||
unsigned int designator:12;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_chn_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_slot:8;
|
||||
unsigned char remote_chn:5;
|
||||
unsigned char local_chn:5;
|
||||
unsigned char:6;
|
||||
#else
|
||||
unsigned char:6;
|
||||
unsigned char local_chn:5;
|
||||
unsigned char remote_chn:5;
|
||||
unsigned char remote_slot:8;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_slot_desc {
|
||||
unsigned char chan_type;
|
||||
unsigned char slot_addr;
|
||||
unsigned char chn_count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
||||
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
||||
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
|
||||
#define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03
|
||||
|
||||
struct fru_picmgext_activation_record {
|
||||
unsigned char ibmb_addr;
|
||||
unsigned char max_module_curr;
|
||||
unsigned char reserved;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_carrier_p2p_record {
|
||||
unsigned char resource_id;
|
||||
unsigned char p2p_count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_carrier_p2p_descriptor {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_resource_id;
|
||||
unsigned short remote_port:5;
|
||||
unsigned short local_port:5;
|
||||
unsigned short reserved:6;
|
||||
#else
|
||||
unsigned short reserved:6;
|
||||
unsigned short local_port:5;
|
||||
unsigned short remote_port:5;
|
||||
unsigned char remote_resource_id;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static const char *chassis_type_desc[] __attribute__ ((unused)) = {
|
||||
"Unspecified", "Other", "Unknown",
|
||||
"Desktop", "Low Profile Desktop", "Pizza Box",
|
||||
"Mini Tower", "Tower",
|
||||
"Portable", "LapTop", "Notebook", "Hand Held",
|
||||
"Docking Station", "All in One", "Sub Notebook",
|
||||
"Space-saving", "Lunch Box", "Main Server Chassis",
|
||||
"Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
|
||||
"Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis"};
|
||||
|
||||
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
|
||||
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
|
||||
|
||||
#endif /* IPMI_FRU_H */
|
||||
|
@ -28,22 +28,15 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_BMC_H
|
||||
#define IPMI_BMC_H
|
||||
#ifndef IPMI_KFWUM_H
|
||||
#define IPMI_KFWUM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define BMC_GET_DEVICE_ID 0x01
|
||||
#define BMC_COLD_RESET 0x02
|
||||
#define BMC_WARM_RESET 0x03
|
||||
#define BMC_GET_SELF_TEST 0x04
|
||||
|
||||
int ipmi_bmc_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_fwum_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*IPMI_BMC_H*/
|
||||
#endif /* IPMI_KFWUM_H */
|
@ -28,19 +28,175 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_INTF_H
|
||||
#define IPMI_INTF_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_oem.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
/*
|
||||
* An enumeration that describes every possible session state for
|
||||
* an IPMIv2 / RMCP+ session.
|
||||
*/
|
||||
enum LANPLUS_SESSION_STATE {
|
||||
LANPLUS_STATE_PRESESSION = 0,
|
||||
LANPLUS_STATE_OPEN_SESSION_SENT,
|
||||
LANPLUS_STATE_OPEN_SESSION_RECEIEVED,
|
||||
LANPLUS_STATE_RAKP_1_SENT,
|
||||
LANPLUS_STATE_RAKP_2_RECEIVED,
|
||||
LANPLUS_STATE_RAKP_3_SENT,
|
||||
LANPLUS_STATE_ACTIVE,
|
||||
LANPLUS_STATE_CLOSE_SENT,
|
||||
};
|
||||
|
||||
|
||||
#define IPMI_AUTHCODE_BUFFER_SIZE 20
|
||||
#define IPMI_SIK_BUFFER_SIZE 20
|
||||
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
|
||||
|
||||
struct ipmi_session {
|
||||
uint8_t hostname[64];
|
||||
uint8_t username[17];
|
||||
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
|
||||
uint8_t challenge[16];
|
||||
uint8_t authtype;
|
||||
uint8_t authtype_set;
|
||||
#define IPMI_AUTHSTATUS_PER_MSG_DISABLED 0x10
|
||||
#define IPMI_AUTHSTATUS_PER_USER_DISABLED 0x08
|
||||
#define IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED 0x04
|
||||
#define IPMI_AUTHSTATUS_NULL_USERS_ENABLED 0x02
|
||||
#define IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED 0x01
|
||||
uint8_t authstatus;
|
||||
uint8_t authextra;
|
||||
uint8_t privlvl;
|
||||
uint8_t cipher_suite_id;
|
||||
char sol_escape_char;
|
||||
int password;
|
||||
int port;
|
||||
int active;
|
||||
int retry;
|
||||
|
||||
uint32_t session_id;
|
||||
uint32_t in_seq;
|
||||
uint32_t out_seq;
|
||||
uint32_t timeout;
|
||||
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addrlen;
|
||||
|
||||
/*
|
||||
* This struct holds state data specific to IMPI v2 / RMCP+ sessions
|
||||
*/
|
||||
struct {
|
||||
enum LANPLUS_SESSION_STATE session_state;
|
||||
|
||||
/* These are the algorithms agreed upon for the session */
|
||||
uint8_t requested_auth_alg;
|
||||
uint8_t requested_integrity_alg;
|
||||
uint8_t requested_crypt_alg;
|
||||
uint8_t auth_alg;
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
uint8_t max_priv_level;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
|
||||
/*
|
||||
* Values required for RAKP mesages
|
||||
*/
|
||||
|
||||
/* Random number generated byt the console */
|
||||
uint8_t console_rand[16];
|
||||
/* Random number generated by the BMC */
|
||||
uint8_t bmc_rand[16];
|
||||
|
||||
uint8_t bmc_guid[16];
|
||||
uint8_t requested_role; /* As sent in the RAKP 1 message */
|
||||
uint8_t rakp2_return_code;
|
||||
|
||||
uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
|
||||
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
|
||||
uint8_t k1[20]; /* Used for Integrity checking? */
|
||||
uint8_t k2[20]; /* First 16 bytes used for AES */
|
||||
} v2_data;
|
||||
|
||||
|
||||
/*
|
||||
* This data is specific to the Serial Over Lan session
|
||||
*/
|
||||
struct {
|
||||
uint16_t max_inbound_payload_size;
|
||||
uint16_t max_outbound_payload_size;
|
||||
uint16_t port;
|
||||
uint8_t sequence_number;
|
||||
|
||||
/* This data describes the last SOL packet */
|
||||
uint8_t last_received_sequence_number;
|
||||
uint8_t last_received_byte_count;
|
||||
void (*sol_input_handler)(struct ipmi_rs * rsp);
|
||||
} sol_data;
|
||||
};
|
||||
|
||||
struct ipmi_cmd {
|
||||
int (*func)(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
const char * name;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
struct ipmi_intf_support {
|
||||
const char * name;
|
||||
int supported;
|
||||
};
|
||||
|
||||
struct ipmi_intf {
|
||||
char name[16];
|
||||
char desc[128];
|
||||
int fd;
|
||||
int opened;
|
||||
int abort;
|
||||
int noanswer;
|
||||
|
||||
struct ipmi_session * session;
|
||||
struct ipmi_oem_handle * oem;
|
||||
struct ipmi_cmd * cmdlist;
|
||||
uint32_t my_addr;
|
||||
uint32_t target_addr;
|
||||
uint8_t target_lun;
|
||||
uint8_t target_channel;
|
||||
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
int (*open)(struct ipmi_intf * intf);
|
||||
void (*close)(struct ipmi_intf * intf);
|
||||
struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req);
|
||||
int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp);
|
||||
struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf);
|
||||
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
|
||||
int (*keepalive)(struct ipmi_intf * intf);
|
||||
};
|
||||
|
||||
int ipmi_intf_init(void);
|
||||
void ipmi_intf_exit(void);
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
void ipmi_intf_print(struct ipmi_intf_support * intflist);
|
||||
|
||||
void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||
void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
|
||||
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
|
||||
void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl);
|
||||
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
|
||||
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
|
||||
void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);
|
||||
void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
|
||||
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype);
|
||||
void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout);
|
||||
void ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry);
|
||||
void ipmi_cleanup(struct ipmi_intf * intf);
|
||||
|
||||
#endif /* IPMI_INTF_H */
|
||||
|
56
ipmitool/include/ipmitool/ipmi_isol.h
Normal file
56
ipmitool/include/ipmitool/ipmi_isol.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ISOL_H
|
||||
#define IPMI_ISOL_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define ACTIVATE_ISOL 0x01
|
||||
#define SET_ISOL_CONFIG 0x03
|
||||
#define GET_ISOL_CONFIG 0x04
|
||||
|
||||
#define ISOL_ENABLE_PARAM 0x01
|
||||
#define ISOL_AUTHENTICATION_PARAM 0x02
|
||||
#define ISOL_ENABLE_FLAG 0x01
|
||||
#define ISOL_PRIVILEGE_LEVEL_USER 0x02
|
||||
#define ISOL_BAUD_RATE_PARAM 0x05
|
||||
#define ISOL_BAUD_RATE_9600 0x06
|
||||
#define ISOL_BAUD_RATE_19200 0x07
|
||||
#define ISOL_BAUD_RATE_38400 0x08
|
||||
#define ISOL_BAUD_RATE_57600 0x09
|
||||
#define ISOL_BAUD_RATE_115200 0x0A
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_SOL_H */
|
45
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
45
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_KONTRONOEM_H
|
||||
#define IPMI_KONTRONOEM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KONTRONOEM_H */
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_LANP_H
|
||||
@ -46,21 +42,13 @@
|
||||
# define IPMI_LAN_SUSPEND_ARP_GRAT (1)
|
||||
#define IPMI_LAN_GET_STAT 0x04
|
||||
|
||||
#define IPMI_SESSION_AUTHTYPE_NONE 0x0
|
||||
#define IPMI_SESSION_AUTHTYPE_MD2 0x1
|
||||
#define IPMI_SESSION_AUTHTYPE_MD5 0x2
|
||||
#define IPMI_SESSION_AUTHTYPE_KEY 0x4
|
||||
#define IPMI_SESSION_AUTHTYPE_OEM 0x5
|
||||
#define IPMI_CHANNEL_NUMBER_MAX 0xe
|
||||
|
||||
#define IPMI_SESSION_PRIV_CALLBACK 0x1
|
||||
#define IPMI_SESSION_PRIV_USER 0x2
|
||||
#define IPMI_SESSION_PRIV_OPERATOR 0x3
|
||||
#define IPMI_SESSION_PRIV_ADMIN 0x4
|
||||
#define IPMI_SESSION_PRIV_OEM 0x5
|
||||
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr ipmi_authtype_vals[];
|
||||
extern struct ipmi_session lan_session;
|
||||
#define IPMI_LANP_TIMEOUT 3
|
||||
#define IPMI_LANP_RETRIES 10
|
||||
#define IPMI_LANP_WRITE_UNLOCK 0
|
||||
#define IPMI_LANP_WRITE_LOCK 1
|
||||
#define IPMI_LANP_WRITE_COMMIT 2
|
||||
|
||||
enum {
|
||||
IPMI_LANP_SET_IN_PROGRESS,
|
||||
@ -68,21 +56,26 @@ enum {
|
||||
IPMI_LANP_AUTH_TYPE_ENABLE,
|
||||
IPMI_LANP_IP_ADDR,
|
||||
IPMI_LANP_IP_ADDR_SRC,
|
||||
IPMI_LANP_MAC_ADDR,
|
||||
IPMI_LANP_MAC_ADDR, /* 5 */
|
||||
IPMI_LANP_SUBNET_MASK,
|
||||
IPMI_LANP_IP_HEADER,
|
||||
IPMI_LANP_PRI_RMCP_PORT,
|
||||
IPMI_LANP_SEC_RMCP_PORT,
|
||||
IPMI_LANP_BMC_ARP,
|
||||
IPMI_LANP_BMC_ARP, /* 10 */
|
||||
IPMI_LANP_GRAT_ARP,
|
||||
IPMI_LANP_DEF_GATEWAY_IP,
|
||||
IPMI_LANP_DEF_GATEWAY_MAC,
|
||||
IPMI_LANP_BAK_GATEWAY_IP,
|
||||
IPMI_LANP_BAK_GATEWAY_MAC,
|
||||
IPMI_LANP_BAK_GATEWAY_MAC, /* 15 */
|
||||
IPMI_LANP_SNMP_STRING,
|
||||
IPMI_LANP_NUM_DEST,
|
||||
IPMI_LANP_DEST_TYPE,
|
||||
IPMI_LANP_DEST_ADDR,
|
||||
IPMI_LANP_VLAN_ID, /* 20 */
|
||||
IPMI_LANP_VLAN_PRIORITY,
|
||||
IPMI_LANP_RMCP_CIPHER_SUPPORT,
|
||||
IPMI_LANP_RMCP_CIPHERS,
|
||||
IPMI_LANP_RMCP_PRIV_LEVELS,
|
||||
IPMI_LANP_OEM_ALERT_STRING=96,
|
||||
IPMI_LANP_ALERT_RETRY=97,
|
||||
IPMI_LANP_UTC_OFFSET=98,
|
||||
@ -96,39 +89,44 @@ static struct lan_param {
|
||||
int cmd;
|
||||
int size;
|
||||
char desc[24];
|
||||
unsigned char * data;
|
||||
uint8_t * data;
|
||||
int data_len;
|
||||
} ipmi_lan_params[] __attribute__((unused)) = {
|
||||
{ IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress" },
|
||||
{ IPMI_LANP_AUTH_TYPE, 1, "Auth Type" },
|
||||
{ IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support" },
|
||||
{ IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable" },
|
||||
{ IPMI_LANP_IP_ADDR, 4, "IP Address" },
|
||||
{ IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source" },
|
||||
{ IPMI_LANP_MAC_ADDR, 6, "MAC Address" },
|
||||
{ IPMI_LANP_MAC_ADDR, 6, "MAC Address" }, /* 5 */
|
||||
{ IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask" },
|
||||
{ IPMI_LANP_IP_HEADER, 3, "IP Header" },
|
||||
{ IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port" },
|
||||
{ IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port" },
|
||||
{ IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" },
|
||||
{ IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" }, /* 10 */
|
||||
{ IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl" },
|
||||
{ IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP" },
|
||||
{ IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC" },
|
||||
{ IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP" },
|
||||
{ IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" },
|
||||
{ IPMI_LANP_SNMP_STRING, 18, "Community String" },
|
||||
{ IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" }, /* 15 */
|
||||
{ IPMI_LANP_SNMP_STRING, 18, "SNMP Community String" },
|
||||
{ IPMI_LANP_NUM_DEST, 1, "Number of Destinations"},
|
||||
{ IPMI_LANP_DEST_TYPE, 4, "Destination Type" },
|
||||
{ IPMI_LANP_DEST_ADDR, 13, "Destination Addresses" },
|
||||
{ IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" },
|
||||
{ IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID" }, /* 20 */
|
||||
{ IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority" },
|
||||
{ IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count" },
|
||||
{ IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites" },
|
||||
{ IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max" },
|
||||
{ IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" }, /* 25 */
|
||||
{ IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm" },
|
||||
{ IPMI_LANP_UTC_OFFSET, 3, "UTC Offset" },
|
||||
{ IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP" },
|
||||
{ IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" },
|
||||
{ IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" },
|
||||
{ IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" },
|
||||
{ IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" }, /* 30 */
|
||||
{ IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode" },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
void ipmi_get_channel_info(struct ipmi_intf * intf, unsigned char channel);
|
||||
int ipmi_lanp_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*IPMI_LANP_H*/
|
||||
|
42
ipmitool/include/ipmitool/ipmi_main.h
Normal file
42
ipmitool/include/ipmitool/ipmi_main.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MAIN_H
|
||||
#define IPMI_MAIN_H
|
||||
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
|
||||
int ipmi_main(int argc, char ** argv, struct ipmi_cmd * cmdlist, struct ipmi_intf_support * intflist);
|
||||
void ipmi_cmd_print(struct ipmi_cmd * cmdlist);
|
||||
int ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_MAIN_H */
|
103
ipmitool/include/ipmitool/ipmi_mc.h
Normal file
103
ipmitool/include/ipmitool/ipmi_mc.h
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MC_H
|
||||
#define IPMI_MC_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define BMC_GET_DEVICE_ID 0x01
|
||||
#define BMC_COLD_RESET 0x02
|
||||
#define BMC_WARM_RESET 0x03
|
||||
#define BMC_GET_SELF_TEST 0x04
|
||||
#define BMC_SET_GLOBAL_ENABLES 0x2e
|
||||
#define BMC_GET_GLOBAL_ENABLES 0x2f
|
||||
#define BMC_GET_GUID 0x37
|
||||
|
||||
int ipmi_mc_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
/*
|
||||
* Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1)
|
||||
* The following really apply to any IPM device, not just BMCs...
|
||||
*/
|
||||
struct ipm_devid_rsp {
|
||||
uint8_t device_id;
|
||||
uint8_t device_revision;
|
||||
uint8_t fw_rev1;
|
||||
uint8_t fw_rev2;
|
||||
uint8_t ipmi_version;
|
||||
uint8_t adtl_device_support;
|
||||
uint8_t manufacturer_id[3];
|
||||
uint8_t product_id[2];
|
||||
uint8_t aux_fw_rev[4];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x07) /* BCD-enoded */
|
||||
|
||||
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
|
||||
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
|
||||
|
||||
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
|
||||
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
|
||||
#define IPM_DEV_IPMI_VER_MINOR_SHIFT (4) /* Minor rev shift */
|
||||
#define IPM_DEV_IPMI_VERSION_MAJOR(x) \
|
||||
(x & IPM_DEV_IPMI_VER_MAJOR_MASK)
|
||||
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
|
||||
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
|
||||
|
||||
#define IPM_DEV_MANUFACTURER_ID(x) \
|
||||
((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0]))
|
||||
|
||||
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
|
||||
|
||||
struct ipm_selftest_rsp {
|
||||
unsigned char code;
|
||||
unsigned char test;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define IPM_SFT_CODE_OK 0x55
|
||||
#define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56
|
||||
#define IPM_SFT_CODE_DEV_CORRUPTED 0x57
|
||||
#define IPM_SFT_CODE_FATAL_ERROR 0x58
|
||||
#define IPM_SFT_CODE_RESERVED 0xff
|
||||
|
||||
#define IPM_SELFTEST_SEL_ERROR 0x80
|
||||
#define IPM_SELFTEST_SDR_ERROR 0x40
|
||||
#define IPM_SELFTEST_FRU_ERROR 0x20
|
||||
#define IPM_SELFTEST_IPMB_ERROR 0x10
|
||||
#define IPM_SELFTEST_SDRR_EMPTY 0x08
|
||||
#define IPM_SELFTEST_INTERNAL_USE 0x04
|
||||
#define IPM_SELFTEST_FW_BOOTBLOCK 0x02
|
||||
#define IPM_SELFTEST_FW_CORRUPTED 0x01
|
||||
|
||||
#endif /*IPMI_MC_H */
|
47
ipmitool/include/ipmitool/ipmi_oem.h
Normal file
47
ipmitool/include/ipmitool/ipmi_oem.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_OEM_H
|
||||
#define IPMI_OEM_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* oem handler, see lib/ipmi_oem.c */
|
||||
struct ipmi_oem_handle {
|
||||
const char * name;
|
||||
const char * desc;
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
};
|
||||
|
||||
void ipmi_oem_print(void);
|
||||
int ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype);
|
||||
int ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype);
|
||||
|
||||
#endif /*IPMI_OEM_H*/
|
784
ipmitool/include/ipmitool/ipmi_pef.h
Normal file
784
ipmitool/include/ipmitool/ipmi_pef.h
Normal file
@ -0,0 +1,784 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Dell Computers. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Dell Computers, or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* DELL COMPUTERS ("DELL") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* DELL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_PEF_H
|
||||
#define IPMI_PEF_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PEF */
|
||||
|
||||
struct pef_capabilities { /* "get pef capabilities" response */
|
||||
uint8_t version;
|
||||
uint8_t actions; /* mapped by PEF_ACTION_xxx */
|
||||
uint8_t tblsize;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
P_TRUE,
|
||||
P_SUPP,
|
||||
P_ACTV,
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
|
||||
struct pef_table_entry {
|
||||
#define PEF_CONFIG_ENABLED 0x80
|
||||
#define PEF_CONFIG_PRECONFIGURED 0x40
|
||||
uint8_t config;
|
||||
#define PEF_ACTION_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_OEM 0x10
|
||||
#define PEF_ACTION_POWER_CYCLE 0x08
|
||||
#define PEF_ACTION_RESET 0x04
|
||||
#define PEF_ACTION_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ALERT 0x01
|
||||
uint8_t action;
|
||||
#define PEF_POLICY_NUMBER_MASK 0x0f
|
||||
uint8_t policy_number;
|
||||
#define PEF_SEVERITY_NON_RECOVERABLE 0x20
|
||||
#define PEF_SEVERITY_CRITICAL 0x10
|
||||
#define PEF_SEVERITY_WARNING 0x08
|
||||
#define PEF_SEVERITY_OK 0x04
|
||||
#define PEF_SEVERITY_INFORMATION 0x02
|
||||
#define PEF_SEVERITY_MONITOR 0x01
|
||||
uint8_t severity;
|
||||
uint8_t generator_ID_addr;
|
||||
uint8_t generator_ID_lun;
|
||||
uint8_t sensor_type;
|
||||
#define PEF_SENSOR_NUMBER_MATCH_ANY 0xff
|
||||
uint8_t sensor_number;
|
||||
#define PEF_EVENT_TRIGGER_UNSPECIFIED 0x0
|
||||
#define PEF_EVENT_TRIGGER_THRESHOLD 0x1
|
||||
#define PEF_EVENT_TRIGGER_SENSOR_SPECIFIC 0x6f
|
||||
#define PEF_EVENT_TRIGGER_MATCH_ANY 0xff
|
||||
uint8_t event_trigger;
|
||||
uint8_t event_data_1_offset_mask[2];
|
||||
uint8_t event_data_1_AND_mask;
|
||||
uint8_t event_data_1_compare_1;
|
||||
uint8_t event_data_1_compare_2;
|
||||
uint8_t event_data_2_AND_mask;
|
||||
uint8_t event_data_2_compare_1;
|
||||
uint8_t event_data_2_compare_2;
|
||||
uint8_t event_data_3_AND_mask;
|
||||
uint8_t event_data_3_compare_1;
|
||||
uint8_t event_data_3_compare_2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct desc_map { /* maps a description to a value/mask */
|
||||
const char *desc;
|
||||
uint32_t mask;
|
||||
};
|
||||
|
||||
struct bit_desc_map { /* description text container */
|
||||
#define BIT_DESC_MAP_LIST 0x1 /* index-based text array */
|
||||
#define BIT_DESC_MAP_ANY 0x2 /* bitwise, but only print 1st one */
|
||||
#define BIT_DESC_MAP_ALL 0x3 /* bitwise, print them all */
|
||||
uint32_t desc_map_type;
|
||||
struct desc_map desc_maps[128];
|
||||
};
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_actions __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_ALL,
|
||||
{ {"Alert", PEF_ACTION_ALERT},
|
||||
{"Power-off", PEF_ACTION_POWER_DOWN},
|
||||
{"Reset", PEF_ACTION_RESET},
|
||||
{"Power-cycle", PEF_ACTION_POWER_CYCLE},
|
||||
{"OEM-defined", PEF_ACTION_OEM},
|
||||
{"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_severities __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_ANY,
|
||||
{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE},
|
||||
{"Critical", PEF_SEVERITY_CRITICAL},
|
||||
{"Warning", PEF_SEVERITY_WARNING},
|
||||
{"OK", PEF_SEVERITY_OK},
|
||||
{"Information", PEF_SEVERITY_INFORMATION},
|
||||
{"Monitor", PEF_SEVERITY_MONITOR},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_sensortypes __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"Any", 255},
|
||||
{"Temperature", 1},
|
||||
{"Voltage", 2},
|
||||
{"Current", 3},
|
||||
{"Fan", 4},
|
||||
{"Chassis Intrusion", 5},
|
||||
{"Platform security breach", 6},
|
||||
{"Processor", 7},
|
||||
{"Power supply", 8},
|
||||
{"Power Unit", 9},
|
||||
{"Cooling device", 10},
|
||||
{"Other (units-based)", 11},
|
||||
{"Memory", 12},
|
||||
{"Drive Slot", 13},
|
||||
{"POST memory resize", 14},
|
||||
{"POST error", 15},
|
||||
{"Logging disabled", 16},
|
||||
{"Watchdog 1", 17},
|
||||
{"System event", 18},
|
||||
{"Critical Interrupt", 19},
|
||||
{"Button", 20},
|
||||
{"Module/board", 21},
|
||||
{"uController/coprocessor", 22},
|
||||
{"Add-in card", 23},
|
||||
{"Chassis", 24},
|
||||
{"Chipset", 25},
|
||||
{"Other (FRU)", 26},
|
||||
{"Cable/interconnect", 27},
|
||||
{"Terminator", 28},
|
||||
{"System boot", 29},
|
||||
{"Boot error", 30},
|
||||
{"OS boot", 31},
|
||||
{"OS critical stop", 32},
|
||||
{"Slot/connector", 33},
|
||||
{"ACPI power state", 34},
|
||||
{"Watchdog 2", 35},
|
||||
{"Platform alert", 36},
|
||||
{"Entity presence", 37},
|
||||
{"Monitor ASIC/IC", 38},
|
||||
{"LAN", 39},
|
||||
{"Management subsytem health",40},
|
||||
{"Battery", 41},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_1 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"<LNC", 0}, /* '<' : getting worse */
|
||||
{">LNC", 1}, /* '>' : getting better */
|
||||
{"<LC", 2},
|
||||
{">LC", 3},
|
||||
{"<LNR", 4},
|
||||
{">LNR", 5},
|
||||
{">UNC", 6},
|
||||
{"<UNC", 7},
|
||||
{">UC", 8},
|
||||
{"<UC", 9},
|
||||
{">UNR", 10},
|
||||
{"<UNR", 11},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_2 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"transition to idle", 0},
|
||||
{"transition to active", 1},
|
||||
{"transition to busy", 2},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_3 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"state deasserted", 0},
|
||||
{"state asserted", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_4 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"predictive failure deasserted", 0},
|
||||
{"predictive failure asserted", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_5 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"limit not exceeded", 0},
|
||||
{"limit exceeded", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_6 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"performance met", 0},
|
||||
{"performance lags", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_7 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"ok", 0},
|
||||
{"<warn", 1}, /* '<' : getting worse */
|
||||
{"<fail", 2},
|
||||
{"<dead", 3},
|
||||
{">warn", 4}, /* '>' : getting better */
|
||||
{">fail", 5},
|
||||
{"dead", 6},
|
||||
{"monitor", 7},
|
||||
{"informational", 8},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_8 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"device removed/absent", 0},
|
||||
{"device inserted/present", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_9 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"device disabled", 0},
|
||||
{"device enabled", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_10 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"transition to running", 0},
|
||||
{"transition to in test", 1},
|
||||
{"transition to power off", 2},
|
||||
{"transition to online", 3},
|
||||
{"transition to offline", 4},
|
||||
{"transition to off duty", 5},
|
||||
{"transition to degraded", 6},
|
||||
{"transition to power save", 7},
|
||||
{"install error", 8},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_11 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"fully redundant", 0},
|
||||
{"redundancy lost", 1},
|
||||
{"redundancy degraded", 2},
|
||||
{"<non-redundant/sufficient", 3}, /* '<' : getting worse */
|
||||
{">non-redundant/sufficient", 4}, /* '>' : getting better */
|
||||
{"non-redundant/insufficient", 5},
|
||||
{"<redundancy degraded", 6},
|
||||
{">redundancy degraded", 7},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_12 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"D0 power state", 0},
|
||||
{"D1 power state", 1},
|
||||
{"D2 power state", 2},
|
||||
{"D3 power state", 3},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map *
|
||||
pef_b2s_generic_ER[] __attribute__((unused)) = {
|
||||
&pef_b2s_gentype_1,
|
||||
&pef_b2s_gentype_2,
|
||||
&pef_b2s_gentype_3,
|
||||
&pef_b2s_gentype_4,
|
||||
&pef_b2s_gentype_5,
|
||||
&pef_b2s_gentype_6,
|
||||
&pef_b2s_gentype_7,
|
||||
&pef_b2s_gentype_8,
|
||||
&pef_b2s_gentype_9,
|
||||
&pef_b2s_gentype_10,
|
||||
&pef_b2s_gentype_11,
|
||||
&pef_b2s_gentype_12,
|
||||
};
|
||||
#define PEF_B2S_GENERIC_ER_ENTRIES \
|
||||
(sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
|
||||
|
||||
struct pef_policy_entry {
|
||||
#define PEF_POLICY_ID_MASK 0xf0
|
||||
#define PEF_POLICY_ID_SHIFT 4
|
||||
#define PEF_POLICY_ENABLED 0x08
|
||||
#define PEF_POLICY_FLAGS_MASK 0x07
|
||||
#define PEF_POLICY_FLAGS_MATCH_ALWAYS 0
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_SKIP 1
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET 2
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET 3
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET 4
|
||||
uint8_t policy;
|
||||
#define PEF_POLICY_CHANNEL_MASK 0xf0
|
||||
#define PEF_POLICY_CHANNEL_SHIFT 4
|
||||
#define PEF_POLICY_DESTINATION_MASK 0x0f
|
||||
uint8_t chan_dest;
|
||||
#define PEF_POLICY_EVENT_SPECIFIC 0x80
|
||||
uint8_t alert_string_key;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_policies __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS},
|
||||
{"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP},
|
||||
{"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET},
|
||||
{"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET},
|
||||
{"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_ch_medium __attribute__((unused)) = {
|
||||
#define PEF_CH_MEDIUM_TYPE_IPMB 1
|
||||
#define PEF_CH_MEDIUM_TYPE_ICMB_10 2
|
||||
#define PEF_CH_MEDIUM_TYPE_ICMB_09 3
|
||||
#define PEF_CH_MEDIUM_TYPE_LAN 4
|
||||
#define PEF_CH_MEDIUM_TYPE_SERIAL 5
|
||||
#define PEF_CH_MEDIUM_TYPE_XLAN 6
|
||||
#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7
|
||||
#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8
|
||||
#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9
|
||||
#define PEF_CH_MEDIUM_TYPE_USB_V1X 10
|
||||
#define PEF_CH_MEDIUM_TYPE_USB_V2X 11
|
||||
#define PEF_CH_MEDIUM_TYPE_SYSTEM 12
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB},
|
||||
{"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10},
|
||||
{"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09},
|
||||
{"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN},
|
||||
{"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL},
|
||||
{"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN},
|
||||
{"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS},
|
||||
{"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X},
|
||||
{"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X},
|
||||
{"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X},
|
||||
{"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X},
|
||||
{"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
struct pef_cfgparm_selector {
|
||||
#define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_CFGPARM_ID_SET_IN_PROGRESS 0
|
||||
#define PEF_CFGPARM_ID_PEF_CONTROL 1
|
||||
#define PEF_CFGPARM_ID_PEF_ACTION 2
|
||||
#define PEF_CFGPARM_ID_PEF_STARTUP_DELAY 3
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STARTUP_DELAY 4
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_SIZE 5
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY 6
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_DATA_1 7
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_SIZE 8
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY 9
|
||||
#define PEF_CFGPARM_ID_SYSTEM_GUID 10
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_SIZE 11
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_KEY 12
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_ENTRY 13
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_set_in_progress {
|
||||
#define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
#define PEF_SET_IN_PROGRESS 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_control {
|
||||
#define PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY 0x08
|
||||
#define PEF_CONTROL_ENABLE_STARTUP_DELAY 0x04
|
||||
#define PEF_CONTROL_ENABLE_EVENT_MESSAGES 0x02
|
||||
#define PEF_CONTROL_ENABLE 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_control __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_ALL,
|
||||
{ {"PEF", PEF_CONTROL_ENABLE},
|
||||
{"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES},
|
||||
{"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY},
|
||||
{"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_ENABLE_OEM 0x10
|
||||
#define PEF_ACTION_ENABLE_POWER_CYCLE 0x08
|
||||
#define PEF_ACTION_ENABLE_RESET 0x04
|
||||
#define PEF_ACTION_ENABLE_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ENABLE_ALERT 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_size {
|
||||
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_entry {
|
||||
#define PEF_FILTER_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_table_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_data_1 {
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_policy_table_size {
|
||||
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_policy_table_entry {
|
||||
#define PEF_POLICY_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_policy_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_system_guid {
|
||||
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
|
||||
uint8_t data1;
|
||||
uint8_t guid[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_table_size {
|
||||
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_keys {
|
||||
#define PEF_ALERT_STRING_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
#define PEF_EVENT_FILTER_ID_MASK 0x7f
|
||||
uint8_t data2;
|
||||
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_table_entry {
|
||||
uint8_t id;
|
||||
uint8_t blockno;
|
||||
uint8_t block[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* PEF - LAN */
|
||||
|
||||
struct pef_lan_cfgparm_selector {
|
||||
#define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_LAN_CFGPARM_CH_MASK 0x0f
|
||||
#define PEF_LAN_CFGPARM_ID_PET_COMMUNITY 16
|
||||
#define PEF_LAN_CFGPARM_ID_DEST_COUNT 17
|
||||
#define PEF_LAN_CFGPARM_ID_DESTTYPE 18
|
||||
#define PEF_LAN_CFGPARM_ID_DESTADDR 19
|
||||
uint8_t ch;
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_lan_cfgparm_dest_size {
|
||||
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_lan_cfgparm_dest_type {
|
||||
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_LAN_DEST_TYPE_ACK 0x80
|
||||
#define PEF_LAN_DEST_TYPE_MASK 0x07
|
||||
#define PEF_LAN_DEST_TYPE_PET 0
|
||||
#define PEF_LAN_DEST_TYPE_OEM_1 6
|
||||
#define PEF_LAN_DEST_TYPE_OEM_2 7
|
||||
uint8_t dest_type;
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_LAN_RETRIES_MASK 0x07
|
||||
uint8_t retries;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_lan_desttype __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK},
|
||||
{"PET", PEF_LAN_DEST_TYPE_PET},
|
||||
{"OEM 1", PEF_LAN_DEST_TYPE_OEM_1},
|
||||
{"OEM 2", PEF_LAN_DEST_TYPE_OEM_2},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
struct pef_lan_cfgparm_dest_info {
|
||||
#define PEF_LAN_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_LAN_DEST_ADDRTYPE_MASK 0xf0
|
||||
#define PEF_LAN_DEST_ADDRTYPE_SHIFT 4
|
||||
#define PEF_LAN_DEST_ADDRTYPE_IPV4_MAC 0x00
|
||||
uint8_t addr_type;
|
||||
#define PEF_LAN_DEST_GATEWAY_USE_BACKUP 0x01
|
||||
uint8_t gateway;
|
||||
uint8_t ip[4];
|
||||
uint8_t mac[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* PEF - Serial/PPP */
|
||||
|
||||
struct pef_serial_cfgparm_selector {
|
||||
#define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_SERIAL_CFGPARM_CH_MASK 0x0f
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_COUNT 16
|
||||
#define PEF_SERIAL_CFGPARM_ID_DESTINFO 17
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING_COUNT 20
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING 21
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_COUNT 24
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_INFO 25
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_PAGER_STRING 27
|
||||
uint8_t ch;
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dest_size {
|
||||
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_SERIAL_DEST_TYPE_ACK 0x80
|
||||
#define PEF_SERIAL_DEST_TYPE_MASK 0x0f
|
||||
#define PEF_SERIAL_DEST_TYPE_DIAL 0
|
||||
#define PEF_SERIAL_DEST_TYPE_TAP 1
|
||||
#define PEF_SERIAL_DEST_TYPE_PPP 2
|
||||
#define PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK 3
|
||||
#define PEF_SERIAL_DEST_TYPE_PPP_CALLBACK 4
|
||||
#define PEF_SERIAL_DEST_TYPE_OEM_1 14
|
||||
#define PEF_SERIAL_DEST_TYPE_OEM_2 15
|
||||
uint8_t dest_type;
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_SERIAL_RETRIES_MASK 0x77
|
||||
#define PEF_SERIAL_RETRIES_POST_CONNECT_MASK 0x70
|
||||
#define PEF_SERIAL_RETRIES_PRE_CONNECT_MASK 0x07
|
||||
uint8_t retries;
|
||||
#define PEF_SERIAL_DIALPAGE_STRING_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_DIALPAGE_STRING_ID_SHIFT 4
|
||||
#define PEF_SERIAL_TAP_PAGE_SERVICE_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_PPP_ACCT_IPADDR_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_PPP_ACCT_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_PPP_ACCT_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0
|
||||
uint8_t data5;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_serial_desttype __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK},
|
||||
{"TAP page", PEF_SERIAL_DEST_TYPE_TAP},
|
||||
{"PPP PET", PEF_SERIAL_DEST_TYPE_PPP},
|
||||
{"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK},
|
||||
{"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK},
|
||||
{"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1},
|
||||
{"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
struct pef_serial_cfgparm_dial_string_count {
|
||||
#define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dial_string {
|
||||
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_acct_count {
|
||||
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_acct_info {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT 4
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK 0x0f
|
||||
uint8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX 0x01
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX 0x02
|
||||
uint8_t confirmation_flags;
|
||||
uint8_t service_type[3];
|
||||
uint8_t escape_mask[4];
|
||||
uint8_t timeout_parms[3];
|
||||
uint8_t retry_parms[2];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_tap_svc_confirm __attribute__((unused)) = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX},
|
||||
{"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX},
|
||||
{"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#if 0 /* FYI : config parm groupings */
|
||||
struct pef_config_parms { /* PEF */
|
||||
struct pef_cfgparm_set_in_progress;
|
||||
struct pef_cfgparm_control;
|
||||
struct pef_cfgparm_action;
|
||||
struct pef_cfgparm_startup_delay; /* in seconds, 1-based */
|
||||
struct pef_cfgparm_alert_startup_delay; /* in seconds, 1-based */
|
||||
struct pef_cfgparm_filter_table_size; /* 1-based, READ-ONLY */
|
||||
struct pef_cfgparm_filter_table_entry;
|
||||
struct pef_cfgparm_filter_table_data_1;
|
||||
struct pef_cfgparm_policy_table_size;
|
||||
struct pef_cfgparm_policy_table_entry;
|
||||
struct pef_cfgparm_system_guid;
|
||||
struct pef_cfgparm_alert_string_table_size;
|
||||
struct pef_cfgparm_alert_string_keys;
|
||||
struct pef_cfgparm_alert_string_table_entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_lan_config_parms { /* LAN */
|
||||
struct pef_lan_cfgparm_set_in_progress;
|
||||
struct pef_lan_cfgparm_auth_capabilities;
|
||||
struct pef_lan_cfgparm_auth_type;
|
||||
struct pef_lan_cfgparm_ip_address;
|
||||
struct pef_lan_cfgparm_ip_address_source;
|
||||
struct pef_lan_cfgparm_mac_address;
|
||||
struct pef_lan_cfgparm_subnet_mask;
|
||||
struct pef_lan_cfgparm_ipv4_header_parms;
|
||||
struct pef_lan_cfgparm_primary_rmcp_port;
|
||||
struct pef_lan_cfgparm_secondary_rmcp_port;
|
||||
struct pef_lan_cfgparm_bmc_generated_arp_control;
|
||||
struct pef_lan_cfgparm_gratuitous_arp;
|
||||
struct pef_lan_cfgparm_default_gateway_ipaddr;
|
||||
struct pef_lan_cfgparm_default_gateway_macaddr;
|
||||
struct pef_lan_cfgparm_backup_gateway_ipaddr;
|
||||
struct pef_lan_cfgparm_backup_gateway_macaddr;
|
||||
struct pef_lan_cfgparm_pet_community;
|
||||
struct pef_lan_cfgparm_destination_count;
|
||||
struct pef_lan_cfgparm_destination_type;
|
||||
struct pef_lan_cfgparm_destination_ipaddr;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_config_parms { /* Serial/PPP */
|
||||
struct pef_serial_cfgparm_set_in_progress;
|
||||
struct pef_serial_cfgparm_auth_capabilities;
|
||||
struct pef_serial_cfgparm_auth_type;
|
||||
struct pef_serial_cfgparm_connection_mode;
|
||||
struct pef_serial_cfgparm_idle_timeout;
|
||||
struct pef_serial_cfgparm_callback_control;
|
||||
struct pef_serial_cfgparm_session_termination;
|
||||
struct pef_serial_cfgparm_ipmi_settings;
|
||||
struct pef_serial_cfgparm_mux_control;
|
||||
struct pef_serial_cfgparm_modem_ring_time;
|
||||
struct pef_serial_cfgparm_modem_init_string;
|
||||
struct pef_serial_cfgparm_modem_escape_sequence;
|
||||
struct pef_serial_cfgparm_modem_hangup_sequence;
|
||||
struct pef_serial_cfgparm_modem_dial_command;
|
||||
struct pef_serial_cfgparm_page_blackout_interval;
|
||||
struct pef_serial_cfgparm_pet_community;
|
||||
struct pef_serial_cfgparm_destination_count;
|
||||
struct pef_serial_cfgparm_destination_info;
|
||||
struct pef_serial_cfgparm_call_retry_interval;
|
||||
struct pef_serial_cfgparm_destination_settings;
|
||||
struct pef_serial_cfgparm_dialstring_count;
|
||||
struct pef_serial_cfgparm_dialstring_info;
|
||||
struct pef_serial_cfgparm_ipaddr_count;
|
||||
struct pef_serial_cfgparm_ipaddr_info;
|
||||
struct pef_serial_cfgparm_tap_acct_count;
|
||||
struct pef_serial_cfgparm_tap_acct_info;
|
||||
struct pef_serial_cfgparm_tap_acct_passwords; /* WRITE only */
|
||||
struct pef_serial_cfgparm_tap_pager_id_strings;
|
||||
struct pef_serial_cfgparm_tap_service_settings;
|
||||
struct pef_serial_cfgparm_terminal_mode_config;
|
||||
struct pef_serial_cfgparm_ppp_otions;
|
||||
struct pef_serial_cfgparm_ppp_primary_rmcp_port;
|
||||
struct pef_serial_cfgparm_ppp_secondary_rmcp_port;
|
||||
struct pef_serial_cfgparm_ppp_link_auth;
|
||||
struct pef_serial_cfgparm_ppp_chap_name;
|
||||
struct pef_serial_cfgparm_ppp_accm;
|
||||
struct pef_serial_cfgparm_ppp_snoop_accm;
|
||||
struct pef_serial_cfgparm_ppp_acct_count;
|
||||
struct pef_serial_cfgparm_ppp_acct_dialstring_selector;
|
||||
struct pef_serial_cfgparm_ppp_acct_ipaddrs;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_names;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_domains;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_passwords; /* WRITE only */
|
||||
struct pef_serial_cfgparm_ppp_acct_auth_settings;
|
||||
struct pef_serial_cfgparm_ppp_acct_connect_hold_times;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_ipheader;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_xmit_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_recv_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_remote_console_ipaddr;
|
||||
} __attribute__ ((packed));
|
||||
#endif
|
||||
|
||||
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
|
||||
#define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13
|
||||
#define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15
|
||||
#define IPMI_CMD_GET_SYSTEM_GUID 0x37
|
||||
#define IPMI_CMD_GET_CHANNEL_INFO 0x42
|
||||
#define IPMI_CMD_LAN_GET_CONFIG 0x02
|
||||
#define IPMI_CMD_SERIAL_GET_CONFIG 0x11
|
||||
|
||||
const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val);
|
||||
void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val);
|
||||
void ipmi_pef_print_dec(const char * text, uint32_t val);
|
||||
void ipmi_pef_print_hex(const char * text, uint32_t val);
|
||||
void ipmi_pef_print_1xd(const char * text, uint32_t val);
|
||||
void ipmi_pef_print_2xd(const char * text, uint8_t u1, uint8_t u2);
|
||||
void ipmi_pef_print_str(const char * text, const char * val);
|
||||
|
||||
int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_PEF_H */
|
75
ipmitool/include/ipmitool/ipmi_picmg.h
Normal file
75
ipmitool/include/ipmitool/ipmi_picmg.h
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PICMG commands */
|
||||
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
|
||||
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
|
||||
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
|
||||
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
|
||||
#define PICMG_FRU_CONTROL_CMD 0x04
|
||||
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
|
||||
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
|
||||
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
|
||||
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
|
||||
#define PICMG_SET_IPMB_CMD 0x09
|
||||
#define PICMG_SET_FRU_POLICY_CMD 0x0A
|
||||
#define PICMG_GET_FRU_POLICY_CMD 0x0B
|
||||
#define PICMG_FRU_ACTIVATION_CMD 0x0C
|
||||
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
|
||||
#define PICMG_SET_PORT_STATE_CMD 0x0E
|
||||
#define PICMG_GET_PORT_STATE_CMD 0x0F
|
||||
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
|
||||
#define PICMG_SET_POWER_LEVEL_CMD 0x11
|
||||
#define PICMG_GET_POWER_LEVEL_CMD 0x12
|
||||
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
|
||||
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
|
||||
#define PICMG_SET_FAN_LEVEL_CMD 0x15
|
||||
#define PICMG_GET_FAN_LEVEL_CMD 0x16
|
||||
#define PICMG_BUSED_RESOURCE_CMD 0x17
|
||||
|
||||
/* Site Types */
|
||||
#define PICMG_ATCA_BOARD 0x00
|
||||
#define PICMG_POWER_ENTRY 0x01
|
||||
#define PICMG_SHELF_FRU 0x02
|
||||
#define PICMG_DEDICATED_SHMC 0x03
|
||||
#define PICMG_FAN_TRAY 0x04
|
||||
#define PICMG_FAN_FILTER_TRAY 0x05
|
||||
#define PICMG_ALARM 0x06
|
||||
#define PICMG_AMC 0x07
|
||||
#define PICMG_PMC 0x08
|
||||
#define PICMG_RTM 0x09
|
||||
|
||||
|
||||
|
||||
struct picmg_set_fru_activation_cmd {
|
||||
unsigned char picmg_id; /* always 0*/
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_state; /* fru activation/deactivation */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
/* the LED color capabilities */
|
||||
static const char* led_color_str[] __attribute__((unused)) = {
|
||||
"reserved",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"GREEN",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"reserved"
|
||||
};
|
||||
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif
|
42
ipmitool/include/ipmitool/ipmi_raw.h
Normal file
42
ipmitool/include/ipmitool/ipmi_raw.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_RAW_H
|
||||
#define IPMI_RAW_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_RAW_H */
|
File diff suppressed because it is too large
Load Diff
@ -28,16 +28,27 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SEL_H
|
||||
#define IPMI_SEL_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
#define IPMI_CMD_GET_SEL_INFO 0x40
|
||||
#define IPMI_CMD_GET_SEL_ALLOC_INFO 0x41
|
||||
#define IPMI_CMD_RESERVE_SEL 0x42
|
||||
#define IPMI_CMD_GET_SEL_ENTRY 0x43
|
||||
#define IPMI_CMD_ADD_SEL_ENTRY 0x44
|
||||
#define IPMI_CMD_PARTIAL_ADD_SEL_ENTRY 0x45
|
||||
#define IPMI_CMD_DELETE_SEL_ENTRY 0x46
|
||||
#define IPMI_CMD_CLEAR_SEL 0x47
|
||||
#define IPMI_CMD_GET_SEL_TIME 0x48
|
||||
#define IPMI_CMD_SET_SEL_TIME 0x49
|
||||
#define IPMI_CMD_GET_AUX_LOG_STATUS 0x5A
|
||||
#define IPMI_CMD_SET_AUX_LOG_STATUS 0x5B
|
||||
|
||||
enum {
|
||||
IPMI_EVENT_CLASS_DISCRETE,
|
||||
@ -47,315 +58,493 @@ enum {
|
||||
};
|
||||
|
||||
struct sel_get_rq {
|
||||
unsigned short reserve_id;
|
||||
unsigned short record_id;
|
||||
unsigned char offset;
|
||||
unsigned char length;
|
||||
uint16_t reserve_id;
|
||||
uint16_t record_id;
|
||||
uint8_t offset;
|
||||
uint8_t length;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct standard_spec_sel_rec{
|
||||
uint32_t timestamp;
|
||||
uint16_t gen_id;
|
||||
uint8_t evm_rev;
|
||||
uint8_t sensor_type;
|
||||
uint8_t sensor_num;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t event_dir : 1;
|
||||
uint8_t event_type : 7;
|
||||
#else
|
||||
uint8_t event_type : 7;
|
||||
uint8_t event_dir : 1;
|
||||
#endif
|
||||
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
|
||||
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
|
||||
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
|
||||
uint8_t event_data[3];
|
||||
};
|
||||
|
||||
#define SEL_OEM_TS_DATA_LEN 6
|
||||
#define SEL_OEM_NOTS_DATA_LEN 13
|
||||
struct oem_ts_spec_sel_rec{
|
||||
uint32_t timestamp;
|
||||
uint8_t manf_id[3];
|
||||
uint8_t oem_defined[SEL_OEM_TS_DATA_LEN];
|
||||
};
|
||||
|
||||
struct oem_nots_spec_sel_rec{
|
||||
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
|
||||
};
|
||||
|
||||
struct sel_event_record {
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned long timestamp;
|
||||
unsigned short gen_id;
|
||||
unsigned char evm_rev;
|
||||
unsigned char sensor_type;
|
||||
unsigned char sensor_num;
|
||||
unsigned char event_type : 7;
|
||||
unsigned char event_dir : 1;
|
||||
unsigned char event_data[3];
|
||||
uint16_t record_id;
|
||||
uint8_t record_type;
|
||||
union{
|
||||
struct standard_spec_sel_rec standard_type;
|
||||
struct oem_ts_spec_sel_rec oem_ts_type;
|
||||
struct oem_nots_spec_sel_rec oem_nots_type;
|
||||
} sel_type;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_oem_record_ts {
|
||||
unsigned short next_id;
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned long timestamp;
|
||||
unsigned char mfg_id[3];
|
||||
unsigned char oem_defined[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_oem_record_nots {
|
||||
unsigned short next_id;
|
||||
unsigned short record_id;
|
||||
unsigned char record_type;
|
||||
unsigned char oem_defined[13];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct ipmi_event_sensor_types {
|
||||
unsigned char code;
|
||||
unsigned char offset;
|
||||
unsigned char class;
|
||||
uint8_t code;
|
||||
uint8_t offset;
|
||||
#define ALL_OFFSETS_SPECIFIED 0xff
|
||||
uint8_t data;
|
||||
uint8_t class;
|
||||
const char * type;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
|
||||
/* Threshold Based States */
|
||||
{ 0x01, 0x00, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical - going low" },
|
||||
{ 0x01, 0x01, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical - going high" },
|
||||
{ 0x01, 0x02, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical - going low" },
|
||||
{ 0x01, 0x03, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical - going high" },
|
||||
{ 0x01, 0x04, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable - going low" },
|
||||
{ 0x01, 0x05, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable - going high" },
|
||||
{ 0x01, 0x06, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical - going low" },
|
||||
{ 0x01, 0x07, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical - going high" },
|
||||
{ 0x01, 0x08, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical - going low" },
|
||||
{ 0x01, 0x09, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical - going high" },
|
||||
{ 0x01, 0x0a, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable - going low" },
|
||||
{ 0x01, 0x0b, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable - going high" },
|
||||
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
|
||||
{ 0x01, 0x01, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going high" },
|
||||
{ 0x01, 0x02, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going low " },
|
||||
{ 0x01, 0x03, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going high" },
|
||||
{ 0x01, 0x04, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going low " },
|
||||
{ 0x01, 0x05, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going high" },
|
||||
{ 0x01, 0x06, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going low " },
|
||||
{ 0x01, 0x07, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going high" },
|
||||
{ 0x01, 0x08, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going low " },
|
||||
{ 0x01, 0x09, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going high" },
|
||||
{ 0x01, 0x0a, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going low " },
|
||||
{ 0x01, 0x0b, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going high" },
|
||||
/* DMI-based "usage state" States */
|
||||
{ 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" },
|
||||
{ 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" },
|
||||
{ 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" },
|
||||
{ 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" },
|
||||
{ 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" },
|
||||
{ 0x02, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" },
|
||||
/* Digital-Discrete Event States */
|
||||
{ 0x03, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" },
|
||||
{ 0x03, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" },
|
||||
{ 0x04, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" },
|
||||
{ 0x04, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" },
|
||||
{ 0x05, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" },
|
||||
{ 0x05, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" },
|
||||
{ 0x06, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" },
|
||||
{ 0x06, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" },
|
||||
{ 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" },
|
||||
{ 0x03, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" },
|
||||
{ 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" },
|
||||
{ 0x04, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" },
|
||||
{ 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" },
|
||||
{ 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" },
|
||||
{ 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" },
|
||||
{ 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" },
|
||||
/* Severity Event States */
|
||||
{ 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" },
|
||||
{ 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critial from OK" },
|
||||
{ 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" },
|
||||
{ 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" },
|
||||
{ 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" },
|
||||
{ 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" },
|
||||
{ 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" },
|
||||
{ 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" },
|
||||
{ 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" },
|
||||
{ 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" },
|
||||
{ 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from OK" },
|
||||
{ 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" },
|
||||
{ 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" },
|
||||
{ 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" },
|
||||
{ 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" },
|
||||
{ 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" },
|
||||
{ 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" },
|
||||
{ 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" },
|
||||
/* Availability Status States */
|
||||
{ 0x08, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Removed/Absent" },
|
||||
{ 0x08, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Inserted/Present" },
|
||||
{ 0x09, 0x00, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" },
|
||||
{ 0x09, 0x01, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" },
|
||||
{ 0x0a, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" },
|
||||
{ 0x0a, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" },
|
||||
{ 0x0a, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" },
|
||||
{ 0x0a, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" },
|
||||
{ 0x0a, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" },
|
||||
{ 0x0a, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" },
|
||||
{ 0x0a, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" },
|
||||
{ 0x0a, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" },
|
||||
{ 0x0a, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" },
|
||||
{ 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Absent" },
|
||||
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Present" },
|
||||
{ 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" },
|
||||
{ 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" },
|
||||
{ 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" },
|
||||
{ 0x0a, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" },
|
||||
{ 0x0a, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" },
|
||||
{ 0x0a, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" },
|
||||
{ 0x0a, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" },
|
||||
{ 0x0a, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" },
|
||||
{ 0x0a, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" },
|
||||
{ 0x0a, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" },
|
||||
{ 0x0a, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" },
|
||||
/* Redundancy States */
|
||||
{ 0x0b, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" },
|
||||
{ 0x0b, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" },
|
||||
{ 0x0b, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" },
|
||||
{ 0x0b, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" },
|
||||
{ 0x0b, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" },
|
||||
{ 0x0b, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" },
|
||||
{ 0x0b, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" },
|
||||
{ 0x0b, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" },
|
||||
{ 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" },
|
||||
{ 0x0b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" },
|
||||
{ 0x0b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" },
|
||||
{ 0x0b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" },
|
||||
{ 0x0b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" },
|
||||
{ 0x0b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" },
|
||||
{ 0x0b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" },
|
||||
{ 0x0b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" },
|
||||
/* ACPI Device Power States */
|
||||
{ 0x0c, 0x00, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" },
|
||||
{ 0x0c, 0x01, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" },
|
||||
{ 0x0c, 0x02, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" },
|
||||
{ 0x0c, 0x03, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" },
|
||||
{ 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" },
|
||||
{ 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" },
|
||||
{ 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" },
|
||||
{ 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" },
|
||||
/* END */
|
||||
{ 0x00, 0x00, 0x00, NULL, NULL },
|
||||
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unused)) = {
|
||||
{ 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL },
|
||||
{ 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL },
|
||||
{ 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL },
|
||||
{ 0x03, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL },
|
||||
{ 0x04, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL },
|
||||
{ 0x00, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL },
|
||||
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL },
|
||||
{ 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL },
|
||||
{ 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL },
|
||||
{ 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL },
|
||||
|
||||
{ 0x05, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" },
|
||||
{ 0x05, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" },
|
||||
{ 0x05, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" },
|
||||
{ 0x05, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" },
|
||||
{ 0x05, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" },
|
||||
{ 0x05, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock/undock" },
|
||||
{ 0x05, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" },
|
||||
{ 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" },
|
||||
{ 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" },
|
||||
{ 0x05, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" },
|
||||
{ 0x05, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" },
|
||||
{ 0x05, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" },
|
||||
{ 0x05, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock" },
|
||||
{ 0x05, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" },
|
||||
|
||||
{ 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" },
|
||||
{ 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password viiolation - user password" },
|
||||
{ 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" },
|
||||
{ 0x06, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" },
|
||||
{ 0x06, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" },
|
||||
{ 0x06, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" },
|
||||
{ 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" },
|
||||
{ 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - user password" },
|
||||
{ 0x06, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" },
|
||||
{ 0x06, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" },
|
||||
{ 0x06, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" },
|
||||
{ 0x06, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" },
|
||||
|
||||
{ 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" },
|
||||
{ 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" },
|
||||
{ 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" },
|
||||
{ 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" },
|
||||
{ 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" },
|
||||
{ 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" },
|
||||
{ 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" },
|
||||
{ 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" },
|
||||
{ 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" },
|
||||
{ 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" },
|
||||
{ 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" },
|
||||
{ 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" },
|
||||
{ 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" },
|
||||
{ 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" },
|
||||
{ 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" },
|
||||
{ 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" },
|
||||
{ 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" },
|
||||
{ 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" },
|
||||
{ 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" },
|
||||
{ 0x07, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" },
|
||||
{ 0x07, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Throttled" },
|
||||
|
||||
{ 0x08, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" },
|
||||
{ 0x08, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" },
|
||||
{ 0x08, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" },
|
||||
{ 0x08, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" },
|
||||
{ 0x08, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" },
|
||||
{ 0x08, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" },
|
||||
{ 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" },
|
||||
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" },
|
||||
{ 0x08, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" },
|
||||
{ 0x08, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" },
|
||||
{ 0x08, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" },
|
||||
{ 0x08, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" },
|
||||
{ 0x08, 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Vendor Mismatch" },
|
||||
{ 0x08, 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Revision Mismatch" },
|
||||
{ 0x08, 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Processor Missing" },
|
||||
{ 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error" },
|
||||
|
||||
{ 0x09, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" },
|
||||
{ 0x09, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" },
|
||||
{ 0x09, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" },
|
||||
{ 0x09, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" },
|
||||
{ 0x09, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" },
|
||||
{ 0x09, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" },
|
||||
{ 0x09, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" },
|
||||
{ 0x09, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" },
|
||||
{ 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" },
|
||||
{ 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" },
|
||||
{ 0x09, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" },
|
||||
{ 0x09, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" },
|
||||
{ 0x09, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" },
|
||||
{ 0x09, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" },
|
||||
{ 0x09, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" },
|
||||
{ 0x09, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" },
|
||||
|
||||
{ 0x0a, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL },
|
||||
{ 0x0b, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL },
|
||||
{ 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL },
|
||||
{ 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL },
|
||||
|
||||
{ 0x0c, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" },
|
||||
{ 0x0c, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" },
|
||||
{ 0x0c, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" },
|
||||
{ 0x0c, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" },
|
||||
{ 0x0c, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" },
|
||||
{ 0x0c, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" },
|
||||
{ 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" },
|
||||
{ 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" },
|
||||
{ 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" },
|
||||
{ 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" },
|
||||
{ 0x0c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" },
|
||||
{ 0x0c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" },
|
||||
{ 0x0c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Presence Detected" },
|
||||
{ 0x0c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Configuration Error" },
|
||||
{ 0x0c, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Spare" },
|
||||
{ 0x0c, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Throttled" },
|
||||
|
||||
{ 0x0d, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", NULL },
|
||||
{ 0x0e, 0x00, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL },
|
||||
{ 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Present" },
|
||||
{ 0x0d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Fault" },
|
||||
{ 0x0d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Predictive Failure" },
|
||||
{ 0x0d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Hot Spare" },
|
||||
{ 0x0d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Parity Check In Progress" },
|
||||
{ 0x0d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Critical Array" },
|
||||
{ 0x0d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Failed Array" },
|
||||
{ 0x0d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild In Progress" },
|
||||
{ 0x0d, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild Aborted" },
|
||||
|
||||
{ 0x0f, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Error" },
|
||||
{ 0x0f, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Hang" },
|
||||
{ 0x0f, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress" },
|
||||
{ 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL },
|
||||
|
||||
{ 0x10, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" },
|
||||
{ 0x10, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" },
|
||||
{ 0x10, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" },
|
||||
{ 0x10, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" },
|
||||
{ 0x0f, 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unspecified" },
|
||||
{ 0x0f, 0x00, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No system memory installed" },
|
||||
{ 0x0f, 0x00, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No usable system memory" },
|
||||
{ 0x0f, 0x00, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable IDE device failure" },
|
||||
{ 0x0f, 0x00, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable system-board failure" },
|
||||
{ 0x0f, 0x00, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable diskette failure" },
|
||||
{ 0x0f, 0x00, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable hard-disk controller failure" },
|
||||
{ 0x0f, 0x00, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable PS/2 or USB keyboard failure" },
|
||||
{ 0x0f, 0x00, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Removable boot media not found" },
|
||||
{ 0x0f, 0x00, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable video controller failure" },
|
||||
{ 0x0f, 0x00, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No video device selected" },
|
||||
{ 0x0f, 0x00, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "BIOS corruption detected" },
|
||||
{ 0x0f, 0x00, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU voltage mismatch" },
|
||||
{ 0x0f, 0x00, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU speed mismatch failure" },
|
||||
{ 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unknown Error" },
|
||||
|
||||
{ 0x11, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" },
|
||||
{ 0x11, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" },
|
||||
{ 0x11, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" },
|
||||
{ 0x11, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" },
|
||||
{ 0x11, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" },
|
||||
{ 0x11, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/diag Interrupt" },
|
||||
{ 0x11, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" },
|
||||
{ 0x11, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" },
|
||||
{ 0x0f, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unspecified" },
|
||||
{ 0x0f, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Memory initialization" },
|
||||
{ 0x0f, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Hard-disk initialization" },
|
||||
{ 0x0f, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Secondary CPU Initialization" },
|
||||
{ 0x0f, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User authentication" },
|
||||
{ 0x0f, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User-initiated system setup" },
|
||||
{ 0x0f, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "USB resource configuration" },
|
||||
{ 0x0f, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "PCI resource configuration" },
|
||||
{ 0x0f, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Option ROM initialization" },
|
||||
{ 0x0f, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Video initialization" },
|
||||
{ 0x0f, 0x01, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Cache initialization" },
|
||||
{ 0x0f, 0x01, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "SMBus initialization" },
|
||||
{ 0x0f, 0x01, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard controller initialization" },
|
||||
{ 0x0f, 0x01, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Management controller initialization" },
|
||||
{ 0x0f, 0x01, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station attachment" },
|
||||
{ 0x0f, 0x01, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Enabling docking station" },
|
||||
{ 0x0f, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station ejection" },
|
||||
{ 0x0f, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Disabling docking station" },
|
||||
{ 0x0f, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Calling operating system wake-up vector" },
|
||||
{ 0x0f, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "System boot initiated" },
|
||||
{ 0x0f, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Motherboard initialization" },
|
||||
{ 0x0f, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "reserved" },
|
||||
{ 0x0f, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Floppy initialization" },
|
||||
{ 0x0f, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard test" },
|
||||
{ 0x0f, 0x01, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Pointing device test" },
|
||||
{ 0x0f, 0x01, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Primary CPU initialization" },
|
||||
{ 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unknown Hang" },
|
||||
|
||||
{ 0x12, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" },
|
||||
{ 0x12, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" },
|
||||
{ 0x12, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" },
|
||||
{ 0x12, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxillary log" },
|
||||
{ 0x12, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" },
|
||||
{ 0x12, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync." },
|
||||
{ 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unspecified" },
|
||||
{ 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Memory initialization" },
|
||||
{ 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Hard-disk initialization" },
|
||||
{ 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Secondary CPU Initialization" },
|
||||
{ 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User authentication" },
|
||||
{ 0x0f, 0x02, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User-initiated system setup" },
|
||||
{ 0x0f, 0x02, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "USB resource configuration" },
|
||||
{ 0x0f, 0x02, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "PCI resource configuration" },
|
||||
{ 0x0f, 0x02, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Option ROM initialization" },
|
||||
{ 0x0f, 0x02, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Video initialization" },
|
||||
{ 0x0f, 0x02, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Cache initialization" },
|
||||
{ 0x0f, 0x02, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "SMBus initialization" },
|
||||
{ 0x0f, 0x02, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard controller initialization" },
|
||||
{ 0x0f, 0x02, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Management controller initialization" },
|
||||
{ 0x0f, 0x02, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station attachment" },
|
||||
{ 0x0f, 0x02, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Enabling docking station" },
|
||||
{ 0x0f, 0x02, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station ejection" },
|
||||
{ 0x0f, 0x02, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Disabling docking station" },
|
||||
{ 0x0f, 0x02, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Calling operating system wake-up vector" },
|
||||
{ 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "System boot initiated" },
|
||||
{ 0x0f, 0x02, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Motherboard initialization" },
|
||||
{ 0x0f, 0x02, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "reserved" },
|
||||
{ 0x0f, 0x02, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Floppy initialization" },
|
||||
{ 0x0f, 0x02, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard test" },
|
||||
{ 0x0f, 0x02, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Pointing device test" },
|
||||
{ 0x0f, 0x02, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Primary CPU initialization" },
|
||||
{ 0x0f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unknown Progress" },
|
||||
|
||||
{ 0x13, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Front Panel NMI" },
|
||||
{ 0x13, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" },
|
||||
{ 0x13, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" },
|
||||
{ 0x13, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" },
|
||||
{ 0x13, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" },
|
||||
{ 0x13, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" },
|
||||
{ 0x13, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" },
|
||||
{ 0x13, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" },
|
||||
{ 0x13, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" },
|
||||
{ 0x13, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" },
|
||||
{ 0x10, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" },
|
||||
{ 0x10, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" },
|
||||
{ 0x10, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" },
|
||||
{ 0x10, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" },
|
||||
{ 0x10, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log full" },
|
||||
{ 0x10, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log almost full" },
|
||||
|
||||
{ 0x14, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" },
|
||||
{ 0x14, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" },
|
||||
{ 0x14, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" },
|
||||
{ 0x11, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" },
|
||||
{ 0x11, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" },
|
||||
{ 0x11, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" },
|
||||
{ 0x11, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" },
|
||||
{ 0x11, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" },
|
||||
{ 0x11, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/Diag Interrupt" },
|
||||
{ 0x11, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" },
|
||||
{ 0x11, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" },
|
||||
|
||||
{ 0x15, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL },
|
||||
{ 0x16, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL },
|
||||
{ 0x17, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL },
|
||||
{ 0x18, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL },
|
||||
{ 0x19, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL },
|
||||
{ 0x1a, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL },
|
||||
{ 0x1b, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", NULL },
|
||||
{ 0x1c, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL },
|
||||
{ 0x12, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" },
|
||||
{ 0x12, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" },
|
||||
{ 0x12, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" },
|
||||
{ 0x12, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxiliary log" },
|
||||
{ 0x12, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" },
|
||||
{ 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" },
|
||||
|
||||
{ 0x1d, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" },
|
||||
{ 0x1d, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" },
|
||||
{ 0x1d, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" },
|
||||
{ 0x1d, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" },
|
||||
{ 0x1d, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" },
|
||||
{ 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "NMI/Diag Interrupt" },
|
||||
{ 0x13, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" },
|
||||
{ 0x13, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" },
|
||||
{ 0x13, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" },
|
||||
{ 0x13, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" },
|
||||
{ 0x13, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" },
|
||||
{ 0x13, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" },
|
||||
{ 0x13, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" },
|
||||
{ 0x13, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" },
|
||||
{ 0x13, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" },
|
||||
{ 0x13, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Fatal Error" },
|
||||
|
||||
{ 0x1e, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" },
|
||||
{ 0x1e, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" },
|
||||
{ 0x1e, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" },
|
||||
{ 0x1e, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" },
|
||||
{ 0x1e, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" },
|
||||
{ 0x14, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" },
|
||||
{ 0x14, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" },
|
||||
{ 0x14, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" },
|
||||
{ 0x14, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Latch" },
|
||||
{ 0x14, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Service" },
|
||||
|
||||
{ 0x1f, 0x00, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" },
|
||||
{ 0x1f, 0x01, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" },
|
||||
{ 0x1f, 0x02, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" },
|
||||
{ 0x1f, 0x03, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" },
|
||||
{ 0x1f, 0x04, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" },
|
||||
{ 0x1f, 0x05, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" },
|
||||
{ 0x1f, 0x06, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" },
|
||||
{ 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL },
|
||||
{ 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL },
|
||||
{ 0x17, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL },
|
||||
{ 0x18, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL },
|
||||
{ 0x19, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL },
|
||||
{ 0x1a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL },
|
||||
|
||||
{ 0x20, 0x00, IPMI_EVENT_CLASS_DISCRETE, "OS Critical Stop", "Stop during OS load/init" },
|
||||
{ 0x20, 0x01, IPMI_EVENT_CLASS_DISCRETE, "OS Critical Stop", "Run-time stop" },
|
||||
{ 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" },
|
||||
{ 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" },
|
||||
|
||||
{ 0x21, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status asserted" },
|
||||
{ 0x21, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status asserted" },
|
||||
{ 0x21, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot/Connector Device installed/attached" },
|
||||
{ 0x21, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot/Connector ready for device installation" },
|
||||
{ 0x21, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot/Connector ready for device removal" },
|
||||
{ 0x21, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is off" },
|
||||
{ 0x21, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot/Connector device removal request" },
|
||||
{ 0x21, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock asserted" },
|
||||
{ 0x21, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is disabled" },
|
||||
{ 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL },
|
||||
|
||||
{ 0x22, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" },
|
||||
{ 0x22, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" },
|
||||
{ 0x22, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" },
|
||||
{ 0x22, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" },
|
||||
{ 0x22, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" },
|
||||
{ 0x22, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" },
|
||||
{ 0x22, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" },
|
||||
{ 0x22, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" },
|
||||
{ 0x22, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" },
|
||||
{ 0x22, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" },
|
||||
{ 0x22, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" },
|
||||
{ 0x22, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" },
|
||||
{ 0x22, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" },
|
||||
{ 0x22, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" },
|
||||
{ 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" },
|
||||
{ 0x1d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" },
|
||||
{ 0x1d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" },
|
||||
{ 0x1d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" },
|
||||
{ 0x1d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" },
|
||||
{ 0x1d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated hard reset" },
|
||||
{ 0x1d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated warm reset" },
|
||||
{ 0x1d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "System Restart" },
|
||||
|
||||
{ 0x23, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" },
|
||||
{ 0x23, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" },
|
||||
{ 0x23, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" },
|
||||
{ 0x23, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" },
|
||||
{ 0x23, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" },
|
||||
{ 0x1e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" },
|
||||
{ 0x1e, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" },
|
||||
{ 0x1e, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" },
|
||||
{ 0x1e, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" },
|
||||
{ 0x1e, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" },
|
||||
|
||||
{ 0x24, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" },
|
||||
{ 0x24, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" },
|
||||
{ 0x24, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" },
|
||||
{ 0x24, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" },
|
||||
{ 0x1f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" },
|
||||
{ 0x1f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" },
|
||||
{ 0x1f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" },
|
||||
{ 0x1f, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" },
|
||||
{ 0x1f, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" },
|
||||
{ 0x1f, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" },
|
||||
{ 0x1f, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" },
|
||||
|
||||
{ 0x25, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" },
|
||||
{ 0x25, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" },
|
||||
{ 0x25, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" },
|
||||
{ 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Error during system startup" },
|
||||
{ 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Run-time critical stop" },
|
||||
{ 0x20, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful stop" },
|
||||
{ 0x20, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful shutdown" },
|
||||
{ 0x20, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "PEF initiated soft shutdown" },
|
||||
{ 0x20, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Agent not responding" },
|
||||
|
||||
{ 0x26, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL },
|
||||
{ 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status" },
|
||||
{ 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status" },
|
||||
{ 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Installed" },
|
||||
{ 0x21, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Installation" },
|
||||
{ 0x21, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Removal" },
|
||||
{ 0x21, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is Off" },
|
||||
{ 0x21, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Removal Request" },
|
||||
{ 0x21, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock" },
|
||||
{ 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is Disabled" },
|
||||
{ 0x21, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Spare Device" },
|
||||
|
||||
{ 0x27, 0x00, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" },
|
||||
{ 0x27, 0x01, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" },
|
||||
{ 0x22, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" },
|
||||
{ 0x22, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" },
|
||||
{ 0x22, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" },
|
||||
{ 0x22, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" },
|
||||
{ 0x22, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" },
|
||||
{ 0x22, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" },
|
||||
{ 0x22, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" },
|
||||
{ 0x22, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" },
|
||||
{ 0x22, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" },
|
||||
{ 0x22, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" },
|
||||
{ 0x22, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" },
|
||||
{ 0x22, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" },
|
||||
{ 0x22, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" },
|
||||
{ 0x22, 0x0e, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" },
|
||||
|
||||
{ 0x28, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" },
|
||||
{ 0x28, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" },
|
||||
{ 0x28, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" },
|
||||
{ 0x28, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" },
|
||||
{ 0x23, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" },
|
||||
{ 0x23, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" },
|
||||
{ 0x23, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" },
|
||||
{ 0x23, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" },
|
||||
{ 0x23, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
|
||||
{ 0x23, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" },
|
||||
|
||||
{ 0x29, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" },
|
||||
{ 0x29, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" },
|
||||
{ 0x29, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" },
|
||||
{ 0x24, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" },
|
||||
{ 0x24, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" },
|
||||
{ 0x24, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" },
|
||||
{ 0x24, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" },
|
||||
|
||||
{ 0x00, 0x00, 0x00, NULL, NULL },
|
||||
{ 0x25, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" },
|
||||
{ 0x25, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" },
|
||||
{ 0x25, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" },
|
||||
|
||||
{ 0x26, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL },
|
||||
|
||||
{ 0x27, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" },
|
||||
{ 0x27, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" },
|
||||
|
||||
{ 0x28, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" },
|
||||
{ 0x28, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" },
|
||||
{ 0x28, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" },
|
||||
{ 0x28, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" },
|
||||
{ 0x28, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor failure" },
|
||||
{ 0x28, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "FRU failure" },
|
||||
|
||||
{ 0x29, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" },
|
||||
{ 0x29, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" },
|
||||
{ 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" },
|
||||
|
||||
{ 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" },
|
||||
{ 0x2b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
|
||||
{ 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" },
|
||||
{ 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" },
|
||||
{ 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" },
|
||||
{ 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" },
|
||||
{ 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" },
|
||||
{ 0x2b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
|
||||
|
||||
{ 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" },
|
||||
{ 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" },
|
||||
{ 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" },
|
||||
{ 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" },
|
||||
{ 0x2c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Active" },
|
||||
{ 0x2c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation Requested" },
|
||||
{ 0x2c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation in Progress" },
|
||||
{ 0x2c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Communication lost" },
|
||||
|
||||
{ 0xF0, 0x00, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M0" },
|
||||
{ 0xF0, 0x01, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M1" },
|
||||
{ 0xF0, 0x02, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M2" },
|
||||
{ 0xF0, 0x03, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M3" },
|
||||
{ 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" },
|
||||
{ 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" },
|
||||
{ 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" },
|
||||
{ 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" },
|
||||
|
||||
{ 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" },
|
||||
{ 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" },
|
||||
{ 0xF1, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B enabled" },
|
||||
{ 0xF1, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMP-B enabled" },
|
||||
|
||||
{ 0xF2, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Closed" },
|
||||
{ 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
|
||||
{ 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
|
||||
|
||||
{ 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
|
||||
|
||||
{ 0x00, 0x00, 0x00, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
} IPMI_OEM;
|
||||
|
||||
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
||||
void ipmi_sel_print_std_entry(int num, struct sel_event_record * evt);
|
||||
void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
|
||||
void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc);
|
||||
const char * ipmi_sel_get_sensor_type(uint8_t code);
|
||||
const char * ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset);
|
||||
uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt);
|
||||
char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
|
||||
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
int ipmi_sel_oem_init(const char * filename);
|
||||
|
||||
#endif /* IPMI_SEL_H */
|
||||
|
84
ipmitool/include/ipmitool/ipmi_sensor.h
Normal file
84
ipmitool/include/ipmitool/ipmi_sensor.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SENSOR_H
|
||||
#define IPMI_SENSOR_H
|
||||
|
||||
#include <math.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
/* threshold specification bits for analog sensors for get sensor threshold command
|
||||
* and set sensor threshold command
|
||||
*/
|
||||
#define UPPER_NON_RECOV_SPECIFIED 0x20
|
||||
#define UPPER_CRIT_SPECIFIED 0x10
|
||||
#define UPPER_NON_CRIT_SPECIFIED 0x08
|
||||
#define LOWER_NON_RECOV_SPECIFIED 0x04
|
||||
#define LOWER_CRIT_SPECIFIED 0x02
|
||||
#define LOWER_NON_CRIT_SPECIFIED 0x01
|
||||
|
||||
/* state assertion bits for discrete sensors for get sensor reading command */
|
||||
#define STATE_0_ASSERTED 0x01
|
||||
#define STATE_1_ASSERTED 0x02
|
||||
#define STATE_2_ASSERTED 0x04
|
||||
#define STATE_3_ASSERTED 0x08
|
||||
#define STATE_4_ASSERTED 0x10
|
||||
#define STATE_5_ASSERTED 0x20
|
||||
#define STATE_6_ASSERTED 0x40
|
||||
#define STATE_7_ASSERTED 0x80
|
||||
#define STATE_8_ASSERTED 0x01
|
||||
#define STATE_9_ASSERTED 0x02
|
||||
#define STATE_10_ASSERTED 0x04
|
||||
#define STATE_11_ASSERTED 0x08
|
||||
#define STATE_12_ASSERTED 0x10
|
||||
#define STATE_13_ASSERTED 0x20
|
||||
#define STATE_14_ASSERTED 0x40
|
||||
|
||||
struct sensor_set_thresh_rq {
|
||||
uint8_t sensor_num; /* sensor # */
|
||||
uint8_t set_mask; /* threshold setting mask */
|
||||
uint8_t lower_non_crit; /* new lower non critical threshold*/
|
||||
uint8_t lower_crit; /* new lower critical threshold*/
|
||||
uint8_t lower_non_recov; /* new lower non recoverable threshold*/
|
||||
uint8_t upper_non_crit; /* new upper non critical threshold*/
|
||||
uint8_t upper_crit; /* new upper critical threshold*/
|
||||
uint8_t upper_non_recov; /* new upper non recoverable threshold*/
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
int ipmi_sensor_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_sensor_print_full(struct ipmi_intf *, struct sdr_record_full_sensor *);
|
||||
int ipmi_sensor_print_compact(struct ipmi_intf *, struct sdr_record_compact_sensor *);
|
||||
|
||||
#endif /* IPMI_SENSOR_H */
|
125
ipmitool/include/ipmitool/ipmi_session.h
Normal file
125
ipmitool/include/ipmitool/ipmi_session.h
Normal file
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SESSION_H
|
||||
#define IPMI_SESSION_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define IPMI_GET_SESSION_INFO 0x3D
|
||||
|
||||
/*
|
||||
* From table 22.25 of the IPMIv2 specification
|
||||
*/
|
||||
struct get_session_info_rsp
|
||||
{
|
||||
uint8_t session_handle;
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t session_slot_count : 6; /* 1-based */
|
||||
#else
|
||||
uint8_t session_slot_count : 6; /* 1-based */
|
||||
uint8_t __reserved1 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t active_session_count : 6; /* 1-based */
|
||||
#else
|
||||
uint8_t active_session_count : 6; /* 1-based */
|
||||
uint8_t __reserved2 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 2;
|
||||
uint8_t user_id : 6;
|
||||
#else
|
||||
uint8_t user_id : 6;
|
||||
uint8_t __reserved3 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved4 : 4;
|
||||
uint8_t privilege_level : 4;
|
||||
#else
|
||||
uint8_t privilege_level : 4;
|
||||
uint8_t __reserved4 : 4;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t auxiliary_data : 4;
|
||||
uint8_t channel_number : 4;
|
||||
#else
|
||||
uint8_t channel_number : 4;
|
||||
uint8_t auxiliary_data : 4;
|
||||
#endif
|
||||
|
||||
union
|
||||
{
|
||||
/* Only exists if channel type is 802.3 LAN */
|
||||
struct
|
||||
{
|
||||
uint8_t console_ip[4]; /* MSBF */
|
||||
uint8_t console_mac[6]; /* MSBF */
|
||||
uint16_t console_port; /* LSBF */
|
||||
} lan_data;
|
||||
|
||||
/* Only exists if channel type is async. serial modem */
|
||||
struct
|
||||
{
|
||||
uint8_t session_channel_activity_type;
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved5 : 4;
|
||||
uint8_t destination_selector : 4;
|
||||
#else
|
||||
uint8_t destination_selector : 4;
|
||||
uint8_t __reserved5 : 4;
|
||||
#endif
|
||||
|
||||
uint8_t console_ip[4]; /* MSBF */
|
||||
|
||||
/* Only exists if session is PPP */
|
||||
uint16_t console_port; /* LSBF */
|
||||
} modem_data;
|
||||
} channel_data;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
int ipmi_session_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*IPMI_CHANNEL_H*/
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SOL_H
|
||||
@ -39,17 +35,50 @@
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define ACTIVATE_SOL 0x01
|
||||
#define SET_SOL_CONFIG 0x03
|
||||
#define GET_SOL_CONFIG 0x04
|
||||
#define SOL_ESCAPE_CHARACTER_DEFAULT '~'
|
||||
#define SOL_KEEPALIVE_TIMEOUT 30
|
||||
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_FAIL 0x00
|
||||
#define IPMI_SOL_BMC_ASSERTS_CTS_MASK_TRUE 0x00
|
||||
#define IPMI_SOL_BMC_ASSERTS_CTS_MASK_FALSE 0x02
|
||||
|
||||
|
||||
struct sol_config_parameters {
|
||||
uint8_t set_in_progress;
|
||||
uint8_t enabled;
|
||||
uint8_t force_encryption;
|
||||
uint8_t force_authentication;
|
||||
uint8_t privilege_level;
|
||||
uint8_t character_accumulate_level;
|
||||
uint8_t character_send_threshold;
|
||||
uint8_t retry_count;
|
||||
uint8_t retry_interval;
|
||||
uint8_t non_volatile_bit_rate;
|
||||
uint8_t volatile_bit_rate;
|
||||
uint8_t payload_channel;
|
||||
uint16_t payload_port;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* The ACTIVATE PAYLOAD command reponse structure
|
||||
* From table 24-2 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct activate_payload_rsp {
|
||||
uint8_t auxiliary_data[4];
|
||||
uint8_t inbound_payload_size[2]; /* LS byte first */
|
||||
uint8_t outbound_payload_size[2]; /* LS byte first */
|
||||
uint8_t payload_udp_port[2]; /* LS byte first */
|
||||
uint8_t payload_vlan_number[2]; /* LS byte first */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define SOL_ENABLE_PARAM 0x01
|
||||
#define SOL_AUTHENTICATION_PARAM 0x02
|
||||
#define SOL_ENABLE_FLAG 0x01
|
||||
#define SOL_PRIVILEGE_LEVEL_USER 0x02
|
||||
#define SOL_BAUD_RATE_PARAM 0x05
|
||||
#define SOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
int ipmi_sol_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_get_sol_info(struct ipmi_intf * intf,
|
||||
uint8_t channel,
|
||||
struct sol_config_parameters * params);
|
||||
|
||||
|
||||
#endif /* IPMI_SOL_H */
|
||||
|
57
ipmitool/include/ipmitool/ipmi_strings.h
Normal file
57
ipmitool/include/ipmitool/ipmi_strings.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_STRINGS_H
|
||||
#define IPMI_STRINGS_H
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
extern const struct valstr completion_code_vals[];
|
||||
extern const struct valstr entity_id_vals[];
|
||||
extern const struct valstr entity_device_type_vals[];
|
||||
extern const struct valstr ipmi_netfn_vals[];
|
||||
extern const struct valstr ipmi_channel_activity_type_vals[];
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr impi_bit_rate_vals[];
|
||||
extern const struct valstr ipmi_set_in_progress_vals[];
|
||||
extern const struct valstr ipmi_authtype_session_vals[];
|
||||
extern const struct valstr ipmi_authtype_vals[];
|
||||
extern const struct valstr ipmi_channel_protocol_vals[];
|
||||
extern const struct valstr ipmi_channel_medium_vals[];
|
||||
extern const struct valstr ipmi_chassis_power_control_vals[];
|
||||
extern const struct valstr ipmi_auth_algorithms[];
|
||||
extern const struct valstr ipmi_integrity_algorithms[];
|
||||
extern const struct valstr ipmi_encryption_algorithms[];
|
||||
extern const struct valstr ipmi_oem_info[];
|
||||
|
||||
|
||||
#endif /*IPMI_STRINGS_H*/
|
@ -28,31 +28,30 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef __HELPER_H
|
||||
#define __HELPER_H
|
||||
#ifndef IPMI_SUNOEM_H
|
||||
#define IPMI_SUNOEM_H
|
||||
|
||||
struct valstr {
|
||||
unsigned char val;
|
||||
const char * str;
|
||||
};
|
||||
const char * val2str(unsigned char val, const struct valstr * vs);
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
unsigned short buf2short(unsigned char * buf);
|
||||
unsigned long buf2long(unsigned char * buf);
|
||||
const char * buf2str(unsigned char * buf, int len);
|
||||
void printbuf(unsigned char * buf, int len, char * desc);
|
||||
#define IPMI_NETFN_SUNOEM 0x2e
|
||||
|
||||
void signal_handler(int sig, void * handler);
|
||||
#define IPMI_SUNOEM_SET_SSH_KEY 0x01
|
||||
#define IPMI_SUNOEM_DEL_SSH_KEY 0x02
|
||||
#define IPMI_SUNOEM_GET_HEALTH_STATUS 0x10
|
||||
#define IPMI_SUNOEM_SET_FAN_SPEED 0x20
|
||||
#define IPMI_SUNOEM_LED_GET 0x21
|
||||
#define IPMI_SUNOEM_LED_SET 0x22
|
||||
|
||||
#define SIG_IGNORE(s) ((void)signal((s), SIG_IGN))
|
||||
#define SIG_DEFAULT(s) ((void)signal((s), SIG_DFL))
|
||||
#define SIG_HANDLE(s,h) ((void)signal_handler((s), (h)))
|
||||
int ipmi_sunoem_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* __HELPER_H */
|
||||
struct ipmi_rs * sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype);
|
||||
struct ipmi_rs * sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype, int ledmode);
|
||||
|
||||
#endif /*IPMI_SUNOEM_H*/
|
||||
|
46
ipmitool/include/ipmitool/ipmi_tsol.h
Normal file
46
ipmitool/include/ipmitool/ipmi_tsol.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2005 Tyan Computer Corp. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_TSOL_H
|
||||
#define IPMI_TSOL_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define IPMI_TSOL_CMD_SENDKEY 0x03
|
||||
#define IPMI_TSOL_CMD_START 0x06
|
||||
#define IPMI_TSOL_CMD_STOP 0x02
|
||||
|
||||
#define IPMI_TSOL_DEF_PORT 6230
|
||||
|
||||
int ipmi_tsol_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_TSOL_H */
|
89
ipmitool/include/ipmitool/ipmi_user.h
Normal file
89
ipmitool/include/ipmitool/ipmi_user.h
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_USER_H
|
||||
#define IPMI_USER_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
/*
|
||||
* The GET USER ACCESS response from table 22-32 of the IMPI v2.0 spec
|
||||
*/
|
||||
struct user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
uint8_t maximum_ids : 6;
|
||||
#else
|
||||
uint8_t maximum_ids : 6;
|
||||
uint8_t __reserved1 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t enabled_user_count : 6;
|
||||
#else
|
||||
uint8_t enabled_user_count : 6;
|
||||
uint8_t __reserved2 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 2;
|
||||
uint8_t fixed_name_count : 6;
|
||||
#else
|
||||
uint8_t fixed_name_count : 6;
|
||||
uint8_t __reserved3 : 2;
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved4 : 1;
|
||||
uint8_t no_callin_access : 1;
|
||||
uint8_t link_auth_access : 1;
|
||||
uint8_t ipmi_messaging_access : 1;
|
||||
uint8_t channel_privilege_limit : 4;
|
||||
#else
|
||||
uint8_t channel_privilege_limit : 4;
|
||||
uint8_t ipmi_messaging_access : 1;
|
||||
uint8_t link_auth_access : 1;
|
||||
uint8_t no_callin_access : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
int ipmi_user_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_USER_H */
|
63
ipmitool/include/ipmitool/log.h
Normal file
63
ipmitool/include/ipmitool/log.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMITOOL_LOG_H
|
||||
#define IPMITOOL_LOG_H
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
/* sys/syslog.h:
|
||||
* LOG_EMERG 0 system is unusable
|
||||
* LOG_ALERT 1 action must be taken immediately
|
||||
* LOG_CRIT 2 critical conditions
|
||||
* LOG_ERR 3 error conditions
|
||||
* LOG_WARNING 4 warning conditions
|
||||
* LOG_NOTICE 5 normal but significant condition
|
||||
* LOG_INFO 6 informational
|
||||
* LOG_DEBUG 7 debug-level messages
|
||||
*/
|
||||
|
||||
#define LOG_ERROR LOG_ERR
|
||||
#define LOG_WARN LOG_WARNING
|
||||
|
||||
#define LOG_NAME_DEFAULT "ipmitool"
|
||||
#define LOG_MSG_LENGTH 1024
|
||||
|
||||
void log_init(const char * name, int isdaemon, int verbose);
|
||||
void log_halt(void);
|
||||
void log_level_set(int level);
|
||||
int log_level_get(void);
|
||||
void lprintf(int level, const char * format, ...);
|
||||
void lperror(int level, const char * format, ...);
|
||||
|
||||
#endif /*IPMITOOL_LOG_H*/
|
||||
|
@ -1,502 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <helper.h>
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_chassis.h>
|
||||
|
||||
static int ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x1;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("error in Chassis Status Command\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("Chassis Power is %s\n", (rsp->data[0] & 0x1) ? "on" : "off");
|
||||
|
||||
return rsp->data[0] & 0x1;
|
||||
}
|
||||
|
||||
static const struct valstr ipmi_chassis_power_control_vals[] = {
|
||||
{ 0x00, "Down/Off" },
|
||||
{ 0x01, "Up/On" },
|
||||
{ 0x02, "Cycle" },
|
||||
{ 0x03, "Reset" },
|
||||
{ 0x04, "Pulse" },
|
||||
{ 0x05, "Soft" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
static void ipmi_chassis_power_control(struct ipmi_intf * intf, unsigned char ctl)
|
||||
{
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x2;
|
||||
req.msg.data = &ctl;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
printf("Chassis Power Control: %s\n", val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
|
||||
intf->sendrecv(intf, &req);
|
||||
}
|
||||
|
||||
static void ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x4;
|
||||
|
||||
printf("Chassis identify interval: ");
|
||||
|
||||
if (arg) {
|
||||
unsigned char interval = (unsigned char)atoi(arg);
|
||||
|
||||
req.msg.data = &interval;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
if (interval)
|
||||
printf("%d seconds\n", interval);
|
||||
else
|
||||
printf("off\n");
|
||||
} else {
|
||||
printf("default (15 seconds)\n");
|
||||
}
|
||||
|
||||
intf->sendrecv(intf, &req);
|
||||
}
|
||||
|
||||
static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned long count;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0xf;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
|
||||
memcpy(&count, rsp->data+1, 4);
|
||||
|
||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||
count, (unsigned long)(count / 24), (unsigned long)(count % 24));
|
||||
}
|
||||
|
||||
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x7;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
|
||||
printf("System restart cause: ");
|
||||
|
||||
switch (rsp->data[0] & 0xf) {
|
||||
case 0:
|
||||
printf("unknown\n");
|
||||
break;
|
||||
case 1:
|
||||
printf("chassis power control command\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("reset via pushbutton\n");
|
||||
break;
|
||||
case 3:
|
||||
printf("power-up via pushbutton\n");
|
||||
break;
|
||||
case 4:
|
||||
printf("watchdog expired\n");
|
||||
break;
|
||||
case 5:
|
||||
printf("OEM\n");
|
||||
break;
|
||||
case 6:
|
||||
printf("power-up due to always-restore power policy\n");
|
||||
break;
|
||||
case 7:
|
||||
printf("power-up due to restore-previous power policy\n");
|
||||
break;
|
||||
case 8:
|
||||
printf("reset via PEF\n");
|
||||
break;
|
||||
case 9:
|
||||
printf("power-cycle via PEF\n");
|
||||
break;
|
||||
default:
|
||||
printf("error!\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
|
||||
/* byte 1 */
|
||||
printf("System Power : %s\n", (rsp->data[0] & 0x1) ? "on" : "off");
|
||||
printf("Power Overload : %s\n", (rsp->data[0] & 0x2) ? "true" : "false");
|
||||
printf("Power Interlock : %s\n", (rsp->data[0] & 0x4) ? "active" : "inactive");
|
||||
printf("Main Power Fault : %s\n", (rsp->data[0] & 0x8) ? "true" : "false");
|
||||
printf("Power Control Fault : %s\n", (rsp->data[0] & 0x10) ? "true" : "false");
|
||||
printf("Power Restore Policy : ");
|
||||
switch ((rsp->data[0] & 0x60) >> 5) {
|
||||
case 0x0:
|
||||
printf("always-off\n");
|
||||
break;
|
||||
case 0x1:
|
||||
printf("previous\n");
|
||||
break;
|
||||
case 0x2:
|
||||
printf("always-on\n");
|
||||
break;
|
||||
case 0x3:
|
||||
default:
|
||||
printf("unknown\n");
|
||||
}
|
||||
|
||||
/* byte 2 */
|
||||
printf("Last Power Event : ");
|
||||
if (rsp->data[1] & 0x1)
|
||||
printf("ac-failed ");
|
||||
if (rsp->data[1] & 0x2)
|
||||
printf("overload ");
|
||||
if (rsp->data[1] & 0x4)
|
||||
printf("interlock ");
|
||||
if (rsp->data[1] & 0x8)
|
||||
printf("fault ");
|
||||
if (rsp->data[1] & 0x10)
|
||||
printf("command");
|
||||
printf("\n");
|
||||
|
||||
/* byte 3 */
|
||||
printf("Chassis Intrusion : %s\n", (rsp->data[2] & 0x1) ? "active" : "inactive");
|
||||
printf("Front-Panel Lockout : %s\n", (rsp->data[2] & 0x2) ? "active" : "inactive");
|
||||
printf("Drive Fault : %s\n", (rsp->data[2] & 0x4) ? "true" : "false");
|
||||
printf("Cooling/Fan Fault : %s\n", (rsp->data[2] & 0x8) ? "true" : "false");
|
||||
}
|
||||
|
||||
static void ipmi_chassis_set_bootparam(struct ipmi_intf * intf, unsigned char param, unsigned char * data, int len)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char msg_data[16];
|
||||
|
||||
memset(msg_data, 0, 16);
|
||||
msg_data[0] = param & 0x7f;
|
||||
memcpy(msg_data+1, data, len);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x8;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = len + 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error setting Chassis Boot Parameter %d\n", param);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Chassis Set Boot Param %d to %s\n", param, data);
|
||||
}
|
||||
|
||||
static void ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char msg_data[3];
|
||||
|
||||
if (!arg)
|
||||
return;
|
||||
|
||||
memset(msg_data, 0, 3);
|
||||
|
||||
msg_data[0] = (unsigned char)atoi(arg) & 0x7f;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x9;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "Boot Option");
|
||||
|
||||
printf("Boot parameter version: %d\n", rsp->data[0]);
|
||||
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
}
|
||||
|
||||
static void ipmi_chassis_set_bootflag(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
unsigned char flags[5];
|
||||
|
||||
if (!arg) {
|
||||
printf("Error: no bootflag argument supplied\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(arg, "force_pxe", 9)) {
|
||||
flags[1] = 0x04; // 00000100
|
||||
}
|
||||
else if (!strncmp(arg, "force_disk", 10)) {
|
||||
flags[1] = 0x08; // 00001000
|
||||
}
|
||||
else if (!strncmp(arg, "force_diag", 10)) {
|
||||
flags[1] = 0x10; // 00010000
|
||||
}
|
||||
else if (!strncmp(arg, "force_cdrom", 11)) {
|
||||
flags[1] = 0x14; // 00010100
|
||||
}
|
||||
else if (!strncmp(arg, "force_floppy", 12)) {
|
||||
flags[1] = 0x3c; // 00111100
|
||||
}
|
||||
else {
|
||||
printf("Invalid bootflag: %s\n", arg);
|
||||
return;
|
||||
}
|
||||
|
||||
flags[0] = 0x80; /* set flag valid bit */
|
||||
ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
|
||||
flags[0] = 0x08; /* don't automatically clear boot flag valid bit in 60 seconds */
|
||||
ipmi_chassis_set_bootparam(intf, 3, flags, 1);
|
||||
}
|
||||
|
||||
static void ipmi_chassis_power_policy(struct ipmi_intf * intf, unsigned char policy)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
if (!policy)
|
||||
return;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x6;
|
||||
req.msg.data = &policy;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
|
||||
if (policy == IPMI_CHASSIS_POLICY_NO_CHANGE) {
|
||||
printf("Supported chassis power policy: ");
|
||||
if (rsp->data[0] & (1<<IPMI_CHASSIS_POLICY_ALWAYS_OFF))
|
||||
printf("always-off ");
|
||||
if (rsp->data[0] & (1<<IPMI_CHASSIS_POLICY_ALWAYS_ON))
|
||||
printf("always-on ");
|
||||
if (rsp->data[0] & (1<<IPMI_CHASSIS_POLICY_PREVIOUS))
|
||||
printf("previous");
|
||||
printf("\n");
|
||||
}
|
||||
else {
|
||||
printf("Set chassis power restore policy to ");
|
||||
switch (policy) {
|
||||
case IPMI_CHASSIS_POLICY_ALWAYS_ON:
|
||||
printf("always-on\n");
|
||||
break;
|
||||
case IPMI_CHASSIS_POLICY_ALWAYS_OFF:
|
||||
printf("always-off\n");
|
||||
break;
|
||||
case IPMI_CHASSIS_POLICY_PREVIOUS:
|
||||
printf("previous\n");
|
||||
break;
|
||||
default:
|
||||
printf("unknown\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc || !strncmp(argv[0], "help", 4)) {
|
||||
printf("Chassis Commands: status, power, identify, policy, restart_cause, poh\n");
|
||||
return 0;
|
||||
}
|
||||
else if (!strncmp(argv[0], "status", 6)) {
|
||||
ipmi_chassis_status(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "power", 5)) {
|
||||
unsigned char ctl = 0;
|
||||
|
||||
if (argc < 2 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis power Commands: status, on, off, cycle, reset, diag, soft\n");
|
||||
return 0;
|
||||
}
|
||||
if (!strncmp(argv[1], "status", 6)) {
|
||||
ipmi_chassis_power_status(intf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(argv[1], "up", 2) || !strncmp(argv[1], "on", 2))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_UP;
|
||||
else if (!strncmp(argv[1], "down", 4) || !strncmp(argv[1], "off", 3))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
|
||||
else if (!strncmp(argv[1], "cycle", 5))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
|
||||
else if (!strncmp(argv[1], "reset", 5))
|
||||
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
|
||||
else if (!strncmp(argv[1], "diag", 5))
|
||||
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
|
||||
else if (!strncmp (argv[1], "acpi", 4) || !strncmp(argv[1], "soft", 4))
|
||||
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
|
||||
else {
|
||||
printf("Invalid chassis power command: %s\n", argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipmi_chassis_power_control(intf, ctl);
|
||||
}
|
||||
else if (!strncmp(argv[0], "identify", 8)) {
|
||||
if (argc < 2) {
|
||||
ipmi_chassis_identify(intf, NULL);
|
||||
}
|
||||
else if (!strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis identify <interval>\n");
|
||||
printf(" default is 15 seconds\n");
|
||||
printf(" 0 to turn off\n");
|
||||
} else {
|
||||
ipmi_chassis_identify(intf, argv[1]);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "poh", 3)) {
|
||||
ipmi_chassis_poh(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "restart_cause", 13)) {
|
||||
ipmi_chassis_restart_cause(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "policy", 4)) {
|
||||
if (argc < 2 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis policy <state>\n");
|
||||
printf(" list : return supported policies\n");
|
||||
printf(" always-on : turn on when power is restored\n");
|
||||
printf(" previous : return to previous state when power is restored\n");
|
||||
printf(" always-off : stay off after power is restored\n");
|
||||
} else {
|
||||
unsigned char ctl;
|
||||
|
||||
if (!strncmp(argv[1], "list", 4))
|
||||
ctl = IPMI_CHASSIS_POLICY_NO_CHANGE;
|
||||
else if (!strncmp(argv[1], "always-on", 9))
|
||||
ctl = IPMI_CHASSIS_POLICY_ALWAYS_ON;
|
||||
else if (!strncmp(argv[1], "previous", 8))
|
||||
ctl = IPMI_CHASSIS_POLICY_PREVIOUS;
|
||||
else if (!strncmp(argv[1], "always-off", 10))
|
||||
ctl = IPMI_CHASSIS_POLICY_ALWAYS_OFF;
|
||||
else {
|
||||
printf("invalid chassis policy: %s\n", argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipmi_chassis_power_policy(intf, ctl);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "bootparam", 7)) {
|
||||
if (argc < 3 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("bootparam get|set <option> [value ...]\n");
|
||||
}
|
||||
else {
|
||||
if (!strncmp(argv[1], "get", 3)) {
|
||||
ipmi_chassis_get_bootparam(intf, argv[2]);
|
||||
}
|
||||
else if (!strncmp(argv[1], "set", 3)) {
|
||||
if (argc < 4) {
|
||||
printf("bootparam set <option> [value ...]\n");
|
||||
} else {
|
||||
if (!strncmp(argv[2], "bootflag", 8)) {
|
||||
ipmi_chassis_set_bootflag(intf, argv[3]);
|
||||
}
|
||||
else {
|
||||
printf("bootparam set <option> [value ...]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("bootparam get|set <option> [value]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Invalid Chassis command: %s\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,216 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_fru.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static char * get_fru_area_str(unsigned char * data, int * offset)
|
||||
{
|
||||
char * str;
|
||||
int len;
|
||||
int off = *offset;
|
||||
|
||||
len = data[off++];
|
||||
len &= 0x3f; /* bits 0:5 contain length */
|
||||
|
||||
str = malloc(len+1);
|
||||
if (!str)
|
||||
return NULL;
|
||||
str[len] = '\0';
|
||||
|
||||
memcpy(str, &data[off], len);
|
||||
|
||||
off += len;
|
||||
*offset = off;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static void ipmi_fru_print(struct ipmi_intf * intf, unsigned char id)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char fru_data[256], msg_data[4];
|
||||
int i, len, offset;
|
||||
|
||||
struct fru_area_chassis chassis;
|
||||
struct fru_area_board board;
|
||||
struct fru_area_product product;
|
||||
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
memcpy(&fru, rsp->data, sizeof(fru));
|
||||
|
||||
if (verbose > 1)
|
||||
printf("fru.size = %d bytes (accessed by %s)\n",
|
||||
fru.size, fru.access ? "words" : "bytes");
|
||||
|
||||
msg_data[0] = id;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (verbose > 1) {
|
||||
printf("fru.header.version: 0x%x\n", header.version);
|
||||
printf("fru.header.offset.internal: 0x%x\n", header.offset.internal * 8);
|
||||
printf("fru.header.offset.chassis: 0x%x\n", header.offset.chassis * 8);
|
||||
printf("fru.header.offset.board: 0x%x\n", header.offset.board * 8);
|
||||
printf("fru.header.offset.product: 0x%x\n", header.offset.product * 8);
|
||||
printf("fru.header.offset.multi: 0x%x\n", header.offset.multi * 8);
|
||||
}
|
||||
|
||||
offset = 0;
|
||||
memset(fru_data, 0, 256);
|
||||
do {
|
||||
msg_data[0] = id;
|
||||
msg_data[1] = offset;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 32;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
continue;
|
||||
|
||||
len = rsp->data[0];
|
||||
memcpy(&fru_data[offset], rsp->data + 1, len);
|
||||
offset += len;
|
||||
} while (offset < fru.size);
|
||||
|
||||
/* chassis area */
|
||||
i = header.offset.chassis * 8;
|
||||
chassis.area_ver = fru_data[i++];
|
||||
chassis.area_len = fru_data[i++];
|
||||
chassis.type = fru_data[i++];
|
||||
chassis.part = get_fru_area_str(fru_data, &i);
|
||||
chassis.serial = get_fru_area_str(fru_data, &i);
|
||||
|
||||
/* board area */
|
||||
i = header.offset.board * 8;
|
||||
board.area_ver = fru_data[i++];
|
||||
board.area_len = fru_data[i++];
|
||||
board.lang = fru_data[i++];
|
||||
i += 3; /* skip mfg. date time */
|
||||
board.mfg = get_fru_area_str(fru_data, &i);
|
||||
board.prod = get_fru_area_str(fru_data, &i);
|
||||
board.serial = get_fru_area_str(fru_data, &i);
|
||||
board.part = get_fru_area_str(fru_data, &i);
|
||||
|
||||
/* product area */
|
||||
i = header.offset.product * 8;
|
||||
product.area_ver = fru_data[i++];
|
||||
product.area_len = fru_data[i++];
|
||||
product.lang = fru_data[i++];
|
||||
product.mfg = get_fru_area_str(fru_data, &i);
|
||||
product.name = get_fru_area_str(fru_data, &i);
|
||||
product.part = get_fru_area_str(fru_data, &i);
|
||||
product.version = get_fru_area_str(fru_data, &i);
|
||||
product.serial = get_fru_area_str(fru_data, &i);
|
||||
product.asset = get_fru_area_str(fru_data, &i);
|
||||
|
||||
printf("Chassis Type : %s\n", chassis_type_desc[chassis.type]);
|
||||
printf("Chassis Part : %s\n", chassis.part);
|
||||
printf("Chassis Serial : %s\n", chassis.serial);
|
||||
|
||||
printf("Board Mfg : %s\n", board.mfg);
|
||||
printf("Board Product : %s\n", board.prod);
|
||||
printf("Board Serial : %s\n", board.serial);
|
||||
printf("Board Part : %s\n", board.part);
|
||||
|
||||
printf("Product Mfg : %s\n", product.mfg);
|
||||
printf("Product Name : %s\n", product.name);
|
||||
printf("Product Part : %s\n", product.part);
|
||||
printf("Product Version : %s\n", product.version);
|
||||
printf("Product Serial : %s\n", product.serial);
|
||||
printf("Product Asset : %s\n", product.asset);
|
||||
|
||||
free(chassis.part);
|
||||
free(chassis.serial);
|
||||
|
||||
free(board.mfg);
|
||||
free(board.prod);
|
||||
free(board.serial);
|
||||
free(board.part);
|
||||
|
||||
free(product.mfg);
|
||||
free(product.name);
|
||||
free(product.part);
|
||||
free(product.version);
|
||||
free(product.serial);
|
||||
free(product.asset);
|
||||
}
|
||||
|
||||
int ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (argc == 0) {
|
||||
ipmi_fru_print(intf, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(argv[0], "help", 4))
|
||||
printf("FRU Commands: print\n");
|
||||
else if (!strncmp(argv[0], "print", 4))
|
||||
ipmi_fru_print(intf, 0);
|
||||
else
|
||||
printf("Invalid FRU command: %s\n", argv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,483 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_lan.h>
|
||||
#include <helper.h>
|
||||
|
||||
static struct lan_param * get_lan_param(struct ipmi_intf * intf, unsigned char chan, int param)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char msg_data[4];
|
||||
|
||||
p = &ipmi_lan_params[param];
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = p->cmd;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_GET_CONFIG;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return NULL;
|
||||
|
||||
p->data = rsp->data + 1;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
static int set_lan_param(struct ipmi_intf * intf, unsigned char chan, int param, unsigned char * data, int len)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char msg_data[32];
|
||||
|
||||
if (param < 0)
|
||||
return -1;
|
||||
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = param;
|
||||
|
||||
memcpy(&msg_data[2], data, len);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_SET_CONFIG;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = len+2;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void suspend_lan_arp(struct ipmi_intf * intf, int suspend)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char msg_data[2];
|
||||
|
||||
msg_data[0] = IPMI_LAN_CHANNEL_1;
|
||||
msg_data[1] = suspend;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_SUSPEND_ARP;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp && !rsp->ccode)
|
||||
printf("Suspend BMC ARP status : 0x%x\n", rsp->data[0]);
|
||||
}
|
||||
|
||||
/* Enable Gratuitous ARP and Interval */
|
||||
static void lan_set_arp(struct ipmi_intf * intf)
|
||||
{
|
||||
unsigned char data;
|
||||
|
||||
data = 0x01;
|
||||
set_lan_param(intf, IPMI_LANP_BMC_ARP, &data, 1);
|
||||
|
||||
data = 0x03;
|
||||
set_lan_param(intf, IPMI_LANP_GRAT_ARP, &data, 1);
|
||||
}
|
||||
|
||||
static void set_lan_params(struct ipmi_intf * intf)
|
||||
{
|
||||
lan_set_auth(intf);
|
||||
lan_set_arp(intf);
|
||||
suspend_lan_arp(intf, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void ipmi_lan_print(struct ipmi_intf * intf, unsigned char chan)
|
||||
{
|
||||
struct lan_param * p;
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE);
|
||||
if (p) printf("%-24s: 0x%02x\n", p->desc, p->data[0]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE);
|
||||
if (p) printf("%-24s: callback=0x%02x user=0x%02x operator=0x%02x admin=0x%02x oem=0x%02x\n",
|
||||
p->desc, p->data[0], p->data[1], p->data[2], p->data[3], p->data[4]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR_SRC);
|
||||
if (p) printf("%-24s: 0x%02x\n", p->desc, p->data[0]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR);
|
||||
if (p) printf("%-24s: %d.%d.%d.%d\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_SUBNET_MASK);
|
||||
if (p) printf("%-24s: %d.%d.%d.%d\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_MAC_ADDR);
|
||||
if (p) printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_SNMP_STRING);
|
||||
if (p) printf("%-24s: %s\n", p->desc, p->data);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_IP_HEADER);
|
||||
if (p) printf("%-24s: TTL=0x%02x flags=0x%02x precedence=0x%02x TOS=0x%02x\n",
|
||||
p->desc, p->data[0], p->data[1] & 0xe0, p->data[2] & 0xe0, p->data[2] & 0x1e);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_BMC_ARP);
|
||||
if (p) printf("%-24s: 0x%02x\n", p->desc, p->data[0]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP);
|
||||
if (p) printf("%-24s: 0x%02x\n", p->desc, p->data[0]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_IP);
|
||||
if (p) printf("%-24s: %d.%d.%d.%d\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_MAC);
|
||||
if (p) printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_IP);
|
||||
if (p) printf("%-24s: %d.%d.%d.%d\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC);
|
||||
if (p) printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
|
||||
}
|
||||
|
||||
/* Configure Authentication Types */
|
||||
static void ipmi_lan_set_auth(struct ipmi_intf * intf, unsigned char chan, char * level, char * types)
|
||||
{
|
||||
unsigned char data[5];
|
||||
unsigned char authtype = 0;
|
||||
char * p;
|
||||
struct lan_param * lp;
|
||||
|
||||
if (!level || !types)
|
||||
return;
|
||||
|
||||
lp = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE);
|
||||
if (!lp)
|
||||
return;
|
||||
if (verbose > 1)
|
||||
printf("%-24s: callback=0x%02x user=0x%02x operator=0x%02x admin=0x%02x oem=0x%02x\n",
|
||||
lp->desc, lp->data[0], lp->data[1], lp->data[2], lp->data[3], lp->data[4]);
|
||||
memset(data, 0, 5);
|
||||
memcpy(data, lp->data, 5);
|
||||
|
||||
p = types;
|
||||
while (p) {
|
||||
if (!strncmp(p, "none", 4))
|
||||
authtype |= 1 << IPMI_SESSION_AUTHTYPE_NONE;
|
||||
else if (!strncmp(p, "md2", 3))
|
||||
authtype |= 1 << IPMI_SESSION_AUTHTYPE_MD2;
|
||||
else if (!strncmp(p, "key", 3))
|
||||
authtype |= 1 << IPMI_SESSION_AUTHTYPE_KEY;
|
||||
else
|
||||
printf("invalid authtype: %s\n", p);
|
||||
p = strchr(p, ',');
|
||||
if (p)
|
||||
p++;
|
||||
}
|
||||
|
||||
p = level;
|
||||
while (p) {
|
||||
if (!strncmp(p, "callback", 8))
|
||||
data[0] = authtype;
|
||||
else if (!strncmp(p, "user", 4))
|
||||
data[1] = authtype;
|
||||
else if (!strncmp(p, "operator", 8))
|
||||
data[2] = authtype;
|
||||
else if (!strncmp(p, "admin", 5))
|
||||
data[3] = authtype;
|
||||
else
|
||||
printf("invalid auth level: %s\n", p);
|
||||
p = strchr(p, ',');
|
||||
if (p)
|
||||
p++;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(data, 5, "authtype data");
|
||||
|
||||
set_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE, data, 5);
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_lan_set_password(struct ipmi_intf * intf,
|
||||
unsigned char userid, unsigned char * password)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned char data[18];
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data[0] = userid & 0x3f;/* user ID */
|
||||
data[1] = 0x02; /* set password */
|
||||
memcpy(data+2, password, (strlen(password) > 16) ? 16 : strlen(password));
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x47;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 18;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error:%x setting user %d password to %s\n",
|
||||
rsp ? rsp->ccode : 0, userid, password);
|
||||
return;
|
||||
}
|
||||
|
||||
/* adjust our session password
|
||||
* or we will no longer be able to communicate with BMC
|
||||
*/
|
||||
lan_session.password = 1;
|
||||
memset(lan_session.authcode, 0, 16);
|
||||
memcpy(lan_session.authcode, password, strlen(password));
|
||||
|
||||
printf("Password for user %d set to %s\n", userid, lan_session.authcode);
|
||||
}
|
||||
|
||||
static int
|
||||
get_cmdline_macaddr(char * arg, unsigned char * buf)
|
||||
{
|
||||
unsigned m1, m2, m3, m4, m5, m6;
|
||||
if (sscanf(arg, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
&m1, &m2, &m3, &m4, &m5, &m6) != 6) {
|
||||
printf("Invalid MAC address: %s\n", arg);
|
||||
return -1;
|
||||
}
|
||||
buf[0] = m1;
|
||||
buf[1] = m2;
|
||||
buf[2] = m3;
|
||||
buf[3] = m4;
|
||||
buf[4] = m5;
|
||||
buf[5] = m6;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
get_cmdline_ipaddr(char * arg, unsigned char * buf)
|
||||
{
|
||||
unsigned ip1, ip2, ip3, ip4;
|
||||
if (sscanf(arg, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4) != 4) {
|
||||
printf("Invalid IP address: %s\n", arg);
|
||||
return -1;
|
||||
}
|
||||
buf[0] = ip1;
|
||||
buf[1] = ip2;
|
||||
buf[2] = ip3;
|
||||
buf[3] = ip4;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
unsigned char data[32];
|
||||
unsigned char chan;
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if (argc < 2 || !strncmp(argv[0], "help", 4)) {
|
||||
printf("usage: lan set <channel> <command>\n");
|
||||
printf("LAN set commands: ipaddr, netmask, macaddr, defgw, bakgw, password, auth, ipsrc\n");
|
||||
return;
|
||||
}
|
||||
|
||||
chan = (unsigned char) strtod(argv[0], NULL);
|
||||
if (chan != 0x6 && chan != 0x7) {
|
||||
printf("valid LAN channels are 6 and 7\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* set authentication types */
|
||||
if (!strncmp(argv[1], "auth", 4)) {
|
||||
if (argc < 3 || !strncmp(argv[2], "help", 4)) {
|
||||
printf("lan set <channel> auth <level> <type,type,...>\n");
|
||||
printf(" level = callback, user, operator, admin\n");
|
||||
printf(" types = none, md2, key\n");
|
||||
printf("example: lan set 7 auth admin key\n");
|
||||
return;
|
||||
}
|
||||
ipmi_lan_set_auth(intf, chan, argv[2], argv[3]);
|
||||
return;
|
||||
}
|
||||
/* ip address source */
|
||||
else if (!strncmp(argv[1], "ipsrc", 5)) {
|
||||
if (argc < 3 || !strncmp(argv[2], "help", 4)) {
|
||||
printf("lan set <channel> ipsrc <source>\n");
|
||||
printf(" none = unspecified\n");
|
||||
printf(" static = static address (manually configured)\n");
|
||||
printf(" dhcp = address obtained by BMC running DHCP\n");
|
||||
printf(" bios = address loaded by BIOS or system software\n");
|
||||
return;
|
||||
}
|
||||
if (!strncmp(argv[2], "none", 4))
|
||||
data[0] = 0;
|
||||
else if (!strncmp(argv[2], "static", 5))
|
||||
data[0] = 1;
|
||||
else if (!strncmp(argv[2], "dhcp", 4))
|
||||
data[0] = 2;
|
||||
else if (!strncmp(argv[2], "bios", 4))
|
||||
data[0] = 3;
|
||||
else
|
||||
return;
|
||||
set_lan_param(intf, chan, IPMI_LANP_IP_ADDR_SRC, data, 1);
|
||||
}
|
||||
/* session password
|
||||
* not strictly a lan setting, but its used for lan connections */
|
||||
else if (!strncmp(argv[1], "password", 8)) {
|
||||
ipmi_lan_set_password(intf, 1, argv[2]);
|
||||
}
|
||||
/* ip address */
|
||||
else if (!strncmp(argv[1], "ipaddr", 6) &&
|
||||
!get_cmdline_ipaddr(argv[2], data)) {
|
||||
printf("Setting LAN %s to %d.%d.%d.%d\n",
|
||||
ipmi_lan_params[IPMI_LANP_IP_ADDR].desc,
|
||||
data[0], data[1], data[2], data[3]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_IP_ADDR, data, 4);
|
||||
/* also set ip address source to "static" */
|
||||
data[0] = 0x1;
|
||||
set_lan_param(intf, chan, IPMI_LANP_IP_ADDR_SRC, data, 1);
|
||||
}
|
||||
/* network mask */
|
||||
else if (!strncmp(argv[1], "netmask", 7) &&
|
||||
!get_cmdline_ipaddr(argv[2], data)) {
|
||||
printf("Setting LAN %s to %d.%d.%d.%d\n",
|
||||
ipmi_lan_params[IPMI_LANP_SUBNET_MASK].desc,
|
||||
data[0], data[1], data[2], data[3]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_SUBNET_MASK, data, 4);
|
||||
}
|
||||
/* mac address */
|
||||
else if (!strncmp(argv[1], "macaddr", 7) &&
|
||||
!get_cmdline_macaddr(argv[2], data)) {
|
||||
printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
ipmi_lan_params[IPMI_LANP_MAC_ADDR].desc,
|
||||
data[0], data[1], data[2], data[3], data[4], data[5]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_MAC_ADDR, data, 6);
|
||||
}
|
||||
/* default gateway settings */
|
||||
else if (!strncmp(argv[1], "defgw", 5)) {
|
||||
if (argc < 4 || !strncmp(argv[2], "help", 4)) {
|
||||
printf("LAN set default gateway Commands: ipaddr, mac\n");
|
||||
}
|
||||
else if (!strncmp(argv[2], "ipaddr", 5) &&
|
||||
!get_cmdline_ipaddr(argv[3], data)) {
|
||||
printf("Setting LAN %s to %d.%d.%d.%d\n",
|
||||
ipmi_lan_params[IPMI_LANP_DEF_GATEWAY_IP].desc,
|
||||
data[0], data[1], data[2], data[3]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_IP, data, 4);
|
||||
}
|
||||
else if (!strncmp(argv[2], "macaddr", 7) &&
|
||||
!get_cmdline_macaddr(argv[3], data)) {
|
||||
printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
ipmi_lan_params[IPMI_LANP_DEF_GATEWAY_MAC].desc,
|
||||
data[0], data[1], data[2], data[3], data[4], data[5]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_MAC, data, 6);
|
||||
}
|
||||
}
|
||||
/* backup gateway settings */
|
||||
else if (!strncmp(argv[1], "bakgw", 5)) {
|
||||
if (argc < 4 || !strncmp(argv[2], "help", 4)) {
|
||||
printf("LAN set backup gateway commands: ipaddr, mac\n");
|
||||
}
|
||||
else if (!strncmp(argv[2], "ipaddr", 5) &&
|
||||
!get_cmdline_ipaddr(argv[3], data)) {
|
||||
printf("Setting LAN %s to %d.%d.%d.%d\n",
|
||||
ipmi_lan_params[IPMI_LANP_BAK_GATEWAY_IP].desc,
|
||||
data[0], data[1], data[2], data[3]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_IP, data, 4);
|
||||
}
|
||||
else if (!strncmp(argv[2], "macaddr", 7) &&
|
||||
!get_cmdline_macaddr(argv[3], data)) {
|
||||
printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
ipmi_lan_params[IPMI_LANP_BAK_GATEWAY_MAC].desc,
|
||||
data[0], data[1], data[2], data[3], data[4], data[5]);
|
||||
set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC, data, 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ipmi_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc || !strncmp(argv[0], "help", 4))
|
||||
printf("LAN Commands: print, set\n");
|
||||
else if (!strncmp(argv[0], "printconf", 9) ||
|
||||
!strncmp(argv[0], "print", 5)) {
|
||||
unsigned char chan = 7;
|
||||
if (argc > 1)
|
||||
chan = (unsigned char) strtod(argv[1], NULL);
|
||||
ipmi_lan_print(intf, chan);
|
||||
}
|
||||
else if (!strncmp(argv[0], "set", 3))
|
||||
ipmi_lan_set(intf, argc-1, &(argv[1]));
|
||||
else
|
||||
printf("Invalid LAN command: %s\n", argv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,428 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_sdr.h>
|
||||
#include <ipmi_entity.h>
|
||||
|
||||
/* convert unsigned value to 2's complement signed */
|
||||
int utos(unsigned val, unsigned bits)
|
||||
{
|
||||
int x = pow(10, bits-1);
|
||||
if (val & x) {
|
||||
x = pow(2, bits-1);
|
||||
return -((~val & (x-1))+1);
|
||||
}
|
||||
else return val;
|
||||
}
|
||||
|
||||
static float
|
||||
sdr_convert_sensor_reading(struct sdr_record_full_sensor * sensor, unsigned char val)
|
||||
{
|
||||
int m, b, k1, k2;
|
||||
|
||||
m = __TO_M(sensor->mtol);
|
||||
b = __TO_B(sensor->bacc);
|
||||
k1 = __TO_B_EXP(sensor->bacc);
|
||||
k2 = __TO_R_EXP(sensor->bacc);
|
||||
|
||||
return (float)(((m * val) + (b * pow(10, k1))) * pow(10, k2));
|
||||
}
|
||||
|
||||
#define GET_SENSOR_READING 0x2d
|
||||
#define GET_SENSOR_FACTORS 0x23
|
||||
#define GET_SENSOR_THRES 0x27
|
||||
#define GET_SENSOR_TYPE 0x2f
|
||||
|
||||
static inline struct ipmi_rsp *
|
||||
ipmi_sdr_get_sensor_reading(struct ipmi_intf * intf, unsigned char sensor)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = GET_SENSOR_READING;
|
||||
req.msg.data = &sensor;
|
||||
req.msg.data_len = sizeof(sensor);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return NULL;
|
||||
|
||||
return rsp;
|
||||
}
|
||||
|
||||
static const char *
|
||||
ipmi_sdr_get_status(unsigned char stat)
|
||||
{
|
||||
/* cr = critical
|
||||
* nc = non-critical
|
||||
* us = unspecified
|
||||
* nr = non-recoverable
|
||||
* ok = ok
|
||||
*/
|
||||
if (stat & (SDR_SENSOR_STAT_LO_NR | SDR_SENSOR_STAT_HI_NR))
|
||||
return "nr";
|
||||
else if (stat & (SDR_SENSOR_STAT_LO_CR | SDR_SENSOR_STAT_HI_CR))
|
||||
return "cr";
|
||||
else if (stat & (SDR_SENSOR_STAT_LO_NC | SDR_SENSOR_STAT_HI_NC))
|
||||
return "nc";
|
||||
else
|
||||
return "ok";
|
||||
}
|
||||
|
||||
static struct sdr_get_rs *
|
||||
ipmi_sdr_get_header(struct ipmi_intf * intf, unsigned short reserve_id, unsigned short record_id)
|
||||
{
|
||||
struct ipmi_req req;
|
||||
struct ipmi_rsp * rsp;
|
||||
struct sdr_get_rq sdr_rq;
|
||||
static struct sdr_get_rs sdr_rs;
|
||||
|
||||
memset(&sdr_rq, 0, sizeof(sdr_rq));
|
||||
sdr_rq.reserve_id = reserve_id;
|
||||
sdr_rq.id = record_id;
|
||||
sdr_rq.offset = 0;
|
||||
sdr_rq.length = 5; /* only get the header */
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_SDR;
|
||||
req.msg.data = (unsigned char *)&sdr_rq;
|
||||
req.msg.data_len = sizeof(sdr_rq);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || !rsp->data_len) {
|
||||
printf("Error getting SDR record id 0x%04x\n", record_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printf("SDR Record ID : 0x%04x\n", record_id);
|
||||
|
||||
memcpy(&sdr_rs, rsp->data, sizeof(sdr_rs));
|
||||
|
||||
if (sdr_rs.length == 0) {
|
||||
printf("Error in SDR record id 0x%04x: invalid length %d\n",
|
||||
record_id, sdr_rs.length);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (verbose > 1) {
|
||||
printf("SDR record type : %d\n", sdr_rs.type);
|
||||
printf("SDR record next : %d\n", sdr_rs.next);
|
||||
printf("SDR record bytes: %d\n", sdr_rs.length);
|
||||
}
|
||||
|
||||
return &sdr_rs;
|
||||
}
|
||||
|
||||
static struct sdr_record_full_sensor *
|
||||
ipmi_sdr_get_entry(struct ipmi_intf * intf, unsigned short reserve_id, unsigned short record_id, int len)
|
||||
{
|
||||
struct ipmi_req req;
|
||||
struct ipmi_rsp * rsp;
|
||||
struct sdr_get_rq sdr_rq;
|
||||
struct sdr_get_rs sdr_rs;
|
||||
struct sdr_record_full_sensor * sensor;
|
||||
unsigned char data[256];
|
||||
int i;
|
||||
|
||||
memset(&sdr_rq, 0, sizeof(sdr_rq));
|
||||
sdr_rq.reserve_id = reserve_id;
|
||||
sdr_rq.id = record_id;
|
||||
sdr_rq.offset = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_SDR;
|
||||
req.msg.data = (unsigned char *)&sdr_rq;
|
||||
req.msg.data_len = sizeof(sdr_rq);
|
||||
|
||||
memcpy(&sdr_rs, rsp->data, sizeof(sdr_rs));
|
||||
|
||||
/* read SDR record with partial (30 byte) reads
|
||||
* because a full read (0xff) exceeds the maximum
|
||||
* transport buffer size. (completion code 0xca)
|
||||
*/
|
||||
memset(data, 0, sizeof(data));
|
||||
for (i=0; i<len; i+=GET_SDR_MAX_LEN) {
|
||||
sdr_rq.length = (len-i < GET_SDR_MAX_LEN) ? len-i : GET_SDR_MAX_LEN;
|
||||
sdr_rq.offset = i+5; /* 5 header bytes */
|
||||
if (verbose > 1)
|
||||
printf("getting %d bytes from SDR at offset %d\n",
|
||||
sdr_rq.length, sdr_rq.offset);
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp && rsp->data)
|
||||
memcpy(data+i, rsp->data+2, sdr_rq.length);
|
||||
}
|
||||
|
||||
sensor = malloc(sizeof(*sensor));
|
||||
memcpy(sensor, data, sizeof(*sensor));
|
||||
|
||||
if (verbose > 1) {
|
||||
printbuf(data, len, "SDR Entry");
|
||||
|
||||
printf("keys.owner_id: 0x%x\n", sensor->keys.owner_id);
|
||||
printf("keys.lun: 0x%x\n", sensor->keys.lun);
|
||||
printf("keys.channel: 0x%x\n", sensor->keys.channel);
|
||||
printf("keys.sensor_num: 0x%x\n", sensor->keys.sensor_num);
|
||||
|
||||
printf("entity: %d.%d\n", sensor->entity.id, sensor->entity.instance);
|
||||
|
||||
printf("entity.id: %s\n", val2str(sensor->entity.id, entity_id_vals));
|
||||
printf("entity.instance: %d\n", sensor->entity.instance);
|
||||
printf("entity.logical: %d\n", sensor->entity.logical);
|
||||
|
||||
printf("sensor unit.pct: 0x%x\n", sensor->unit.pct);
|
||||
printf("sensor unit.rate: 0x%x\n", sensor->unit.rate);
|
||||
printf("sensor unit.analog: 0x%x\n", sensor->unit.analog);
|
||||
printf("sensor unit.modifier: 0x%x\n", sensor->unit.modifier);
|
||||
printf("sensor unit.type.base: 0x%x\n", sensor->unit.type.base);
|
||||
printf("sensor unit.type.modifier: 0x%x\n", sensor->unit.type.modifier);
|
||||
|
||||
printf("sensor linearization: 0x%x\n", sensor->linearization);
|
||||
|
||||
printf("sensor tolerance: 0x%x\n", __TO_TOL(sensor->mtol));
|
||||
printf("sensor M: 0x%x\n", __TO_M(sensor->mtol));
|
||||
printf("sensor B: 0x%x\n", __TO_B(sensor->bacc));
|
||||
printf("sensor B exp: %d\n", __TO_B_EXP(sensor->bacc));
|
||||
printf("sensor R exp: %d\n", __TO_R_EXP(sensor->bacc));
|
||||
printf("sensor accuracy: 0x%x\n", __TO_ACC(sensor->bacc));
|
||||
printf("sensor accuracy exp: 0x%x\n", __TO_ACC_EXP(sensor->bacc));
|
||||
|
||||
printf("sensor.type: 0x%02x\n", sensor->sensor.type);
|
||||
printf("event_type: 0x%02x\n", sensor->event_type);
|
||||
|
||||
printf("sensor min=0x%x max=0x%x\n", sensor->sensor_min, sensor->sensor_max);
|
||||
printf("sensor id code: 0x%x\n", sensor->id_code);
|
||||
|
||||
printf("Nominal Reading : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->nominal_read));
|
||||
printf("Normal Minimum Reading : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->normal_min));
|
||||
printf("Normal Maximum Reading : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->normal_max));
|
||||
printf("Upper non-recoverable Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.upper.non_recover));
|
||||
printf("Upper critical Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.upper.critical));
|
||||
printf("Upper non-critical Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.upper.non_critical));
|
||||
printf("Lower non-recoverable Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.lower.non_recover));
|
||||
printf("Lower critical Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.lower.critical));
|
||||
printf("Lower non-critical Threshold : %.3f\n",
|
||||
sdr_convert_sensor_reading(sensor, sensor->threshold.lower.non_critical));
|
||||
|
||||
if (sensor->id_code)
|
||||
printf("sensor id: %s\n", sensor->id_string);
|
||||
}
|
||||
|
||||
return sensor;
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_sdr_print_sensors(struct ipmi_intf * intf, int do_unit)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
struct sdr_repo_info_rs sdr_info;
|
||||
struct sdr_reserve_repo_rs sdr_reserve;
|
||||
struct sdr_get_rs * header;
|
||||
struct sdr_record_full_sensor * sensor;
|
||||
|
||||
int next = 0, i = 0, total;
|
||||
unsigned short reservation;
|
||||
float val;
|
||||
char sval[16], unitstr[16];
|
||||
|
||||
if (verbose)
|
||||
printf("Querying SDR for sensor list\n");
|
||||
|
||||
/* get sdr repository info */
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_SDR_REPO_INFO;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || !rsp->data_len)
|
||||
return;
|
||||
memcpy(&sdr_info, rsp->data, sizeof(sdr_info));
|
||||
|
||||
/* byte 1 is SDR version, should be 51h */
|
||||
if (sdr_info.version != 0x51) {
|
||||
printf("SDR repository version mismatch!\n");
|
||||
return;
|
||||
}
|
||||
total = sdr_info.count;
|
||||
if (verbose > 1) {
|
||||
printf("SDR free space: %d\n", sdr_info.free);
|
||||
printf("SDR records: %d\n", total);
|
||||
}
|
||||
|
||||
/* obtain reservation ID */
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_SDR_RESERVE_REPO;
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || !rsp->data_len)
|
||||
return;
|
||||
memcpy(&sdr_reserve, rsp->data, sizeof(sdr_reserve));
|
||||
reservation = sdr_reserve.reserve_id;
|
||||
if (verbose > 1)
|
||||
printf("SDR reserveration ID %04x\n", reservation);
|
||||
|
||||
while (next < total) {
|
||||
i = 0;
|
||||
|
||||
header = ipmi_sdr_get_header(intf, reservation, next);
|
||||
if (!header)
|
||||
break;
|
||||
|
||||
if (header->type != SDR_RECORD_TYPE_FULL_SENSOR) {
|
||||
if (verbose > 1)
|
||||
printf("Invalid SDR type 0x%02x\n", header->type);
|
||||
next = header->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
sensor = ipmi_sdr_get_entry(intf, reservation, next, header->length);
|
||||
next = header->next;
|
||||
|
||||
/* only handle linear sensors (for now) */
|
||||
if (sensor->linearization) {
|
||||
printf("non-linear!\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_reading(intf, sensor->keys.sensor_num);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("error reading sensor\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* convert RAW reading into units */
|
||||
val = rsp->data[0] ? sdr_convert_sensor_reading(sensor, rsp->data[0]) : 0;
|
||||
|
||||
if (do_unit) {
|
||||
memset(unitstr, 0, sizeof(unitstr));
|
||||
/* determine units with possible modifiers */
|
||||
switch (sensor->unit.modifier) {
|
||||
case 2:
|
||||
i += snprintf(unitstr, sizeof(unitstr), "%s * %s",
|
||||
unit_desc[sensor->unit.type.base],
|
||||
unit_desc[sensor->unit.type.modifier]);
|
||||
break;
|
||||
case 1:
|
||||
i += snprintf(unitstr, sizeof(unitstr), "%s/%s",
|
||||
unit_desc[sensor->unit.type.base],
|
||||
unit_desc[sensor->unit.type.modifier]);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
i += snprintf(unitstr, sizeof(unitstr), "%s",
|
||||
unit_desc[sensor->unit.type.base]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!verbose) {
|
||||
/*
|
||||
* print sensor name, reading, state
|
||||
*/
|
||||
if (csv_output)
|
||||
printf("%s,",
|
||||
sensor->id_code ? sensor->id_string : NULL);
|
||||
else
|
||||
printf("%-16s | ",
|
||||
sensor->id_code ? sensor->id_string : NULL);
|
||||
|
||||
memset(sval, 0, sizeof(sval));
|
||||
i += snprintf(sval, sizeof(sval), "%.*f",
|
||||
(val==(int)val) ? 0 : 3, val);
|
||||
printf("%s", sval);
|
||||
|
||||
if (do_unit)
|
||||
printf(" %s", unitstr);
|
||||
|
||||
if (csv_output)
|
||||
printf(",");
|
||||
else {
|
||||
for (; i<sizeof(sval); i++)
|
||||
printf(" ");
|
||||
printf(" | ");
|
||||
}
|
||||
|
||||
printf("%s", ipmi_sdr_get_status(rsp->data[2]));
|
||||
printf("\n");
|
||||
}
|
||||
else {
|
||||
printf("Sensor | %s (0x%x)\n",
|
||||
sensor->id_code ? sensor->id_string : NULL,
|
||||
sensor->keys.sensor_num);
|
||||
printf("Entity | %d.%d (%s)\n",
|
||||
sensor->entity.id, sensor->entity.instance,
|
||||
val2str(sensor->entity.id, entity_id_vals));
|
||||
printf("Reading | %.*f %s\n",
|
||||
(val==(int)val) ? 0 : 3, val, unitstr);
|
||||
printf("Status | %s\n",
|
||||
ipmi_sdr_get_status(rsp->data[2]));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
free(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
int ipmi_sdr_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc)
|
||||
ipmi_sdr_print_sensors(intf, 1);
|
||||
else if (!strncmp(argv[0], "help", 4))
|
||||
printf("SDR Commands: list\n");
|
||||
else if (!strncmp(argv[0], "list", 4))
|
||||
ipmi_sdr_print_sensors(intf, 1);
|
||||
else
|
||||
printf("Invalid SDR command: %s\n", argv[0]);
|
||||
return 0;
|
||||
}
|
@ -1,297 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <helper.h>
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_sel.h>
|
||||
|
||||
static const struct valstr event_dir_vals[] = {
|
||||
{ 0, "Assertion Event" },
|
||||
{ 1, "Deassertion Event" },
|
||||
};
|
||||
|
||||
static int
|
||||
ipmi_get_event_class(unsigned char code)
|
||||
{
|
||||
if (code == 0)
|
||||
return -1;
|
||||
if (code == 1)
|
||||
return IPMI_EVENT_CLASS_THRESHOLD;
|
||||
if (code >= 0x02 && code <= 0x0b)
|
||||
return IPMI_EVENT_CLASS_DISCRETE;
|
||||
if (code == 0x6f)
|
||||
return IPMI_EVENT_CLASS_DISCRETE;
|
||||
if (code >= 0x70 && code <= 0x7f)
|
||||
return IPMI_EVENT_CLASS_OEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const char *
|
||||
ipmi_get_event_type(unsigned char code)
|
||||
{
|
||||
if (code == 0)
|
||||
return "Unspecified";
|
||||
if (code == 1)
|
||||
return "Threshold";
|
||||
if (code >= 0x02 && code <= 0x0b)
|
||||
return "Generic Discrete";
|
||||
if (code == 0x6f)
|
||||
return "Sensor-specific Discrete";
|
||||
if (code >= 0x70 && code <= 0x7f)
|
||||
return "OEM";
|
||||
return "Reserved";
|
||||
}
|
||||
|
||||
static const char *
|
||||
ipmi_get_event_desc(struct sel_event_record * rec)
|
||||
{
|
||||
int class;
|
||||
unsigned char offset = 0;
|
||||
struct ipmi_event_type *evt;
|
||||
|
||||
class = ipmi_get_event_class(rec->event_type);
|
||||
if (class < 0)
|
||||
return "Invalid Class";
|
||||
|
||||
switch (class) {
|
||||
case IPMI_EVENT_CLASS_DISCRETE:
|
||||
offset = rec->event_data[0] & 0xf;
|
||||
break;
|
||||
case IPMI_EVENT_CLASS_DIGITAL:
|
||||
offset = rec->event_data[0] & 0xf;
|
||||
break;
|
||||
case IPMI_EVENT_CLASS_THRESHOLD:
|
||||
offset = rec->event_data[0] & 0xf;
|
||||
break;
|
||||
default:
|
||||
return "Unknown Class";
|
||||
}
|
||||
|
||||
if (verbose > 2)
|
||||
printf("offset: 0x%02x\n", offset);
|
||||
|
||||
evt = event_types;
|
||||
while (evt->desc) {
|
||||
if (evt->code == rec->event_type && evt->offset == offset)
|
||||
return evt->desc;
|
||||
evt++;
|
||||
}
|
||||
|
||||
return "Unknown Event";
|
||||
}
|
||||
|
||||
static const char *
|
||||
ipmi_sel_get_sensor_type(unsigned char code)
|
||||
{
|
||||
struct ipmi_sensor_types *st = sensor_types;
|
||||
while (st->type) {
|
||||
if (st->code == code)
|
||||
return st->type;
|
||||
st++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ipmi_sel_get_info(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = 0x40;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error%x in Get SEL Info command\n",
|
||||
rsp ? rsp->ccode : 0);
|
||||
return;
|
||||
}
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "sel_info");
|
||||
|
||||
printf("SEL Information\n");
|
||||
printf(" Version : %x%x\n",
|
||||
(rsp->data[0] & 0xf0) >> 4, rsp->data[0] & 0xf);
|
||||
printf(" Entries : %d\n",
|
||||
buf2short(rsp->data + 1));
|
||||
printf(" Free Space : %d\n",
|
||||
buf2short(rsp->data + 3));
|
||||
printf(" Last Add Time : %08lx\n",
|
||||
buf2long(rsp->data + 5));
|
||||
printf(" Last Del Time : %08lx\n",
|
||||
buf2long(rsp->data + 9));
|
||||
printf(" Overflow : %s\n",
|
||||
rsp->data[13] & 0x80 ? "true" : "false");
|
||||
printf(" Delete cmd : %ssupported\n",
|
||||
rsp->data[13] & 0x8 ? "" : "un");
|
||||
printf(" Parial add cmd : %ssupported\n",
|
||||
rsp->data[13] & 0x4 ? "" : "un");
|
||||
printf(" Reserve cmd : %ssupported\n",
|
||||
rsp->data[13] & 0x2 ? "" : "un");
|
||||
printf(" Get Alloc Info : %ssupported\n",
|
||||
rsp->data[13] & 0x1 ? "" : "un");
|
||||
|
||||
if (rsp->data[13] & 0x1) {
|
||||
/* get sel allocation info */
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = 0x41;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("error%d in Get SEL Allocation Info command\n",
|
||||
rsp ? rsp->ccode : 0);
|
||||
return;
|
||||
}
|
||||
|
||||
printf(" # of Alloc Units : %d\n", buf2short(rsp->data));
|
||||
printf(" Alloc Unit Size : %d\n", buf2short(rsp->data + 2));
|
||||
printf(" # Free Units : %d\n", buf2short(rsp->data + 4));
|
||||
printf(" Largest Free Blk : %d\n", buf2short(rsp->data + 6));
|
||||
printf(" Max Record Size : %d\n", rsp->data[7]);
|
||||
}
|
||||
}
|
||||
|
||||
static void * ipmi_sel_get_entry(struct ipmi_intf * intf, unsigned short record_id)
|
||||
{
|
||||
struct ipmi_req req;
|
||||
struct ipmi_rsp * rsp;
|
||||
unsigned char msg_data[6];
|
||||
unsigned char type;
|
||||
|
||||
memset(msg_data, 0, 6);
|
||||
msg_data[0] = 0x00; /* no reserve id, not partial get */
|
||||
msg_data[1] = 0x00;
|
||||
memcpy(msg_data+2, &record_id, 2);
|
||||
msg_data[4] = 0x00; /* offset */
|
||||
msg_data[5] = 0xff; /* length */
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = 0x43;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 6;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error%x in Get SEL Entry %x Command\n",
|
||||
rsp ? rsp->ccode : 0, record_id);
|
||||
return NULL;
|
||||
}
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "SEL Entry");
|
||||
|
||||
type = rsp->data[2];
|
||||
if (type < 0xc0) {
|
||||
/* standard SEL event record */
|
||||
return (struct sel_event_record *) rsp->data;
|
||||
}
|
||||
else if (type < 0xe0) {
|
||||
/* OEM timestamp record */
|
||||
return (struct sel_oem_record_ts *) rsp->data;
|
||||
}
|
||||
else {
|
||||
/* OEM no-timestamp record */
|
||||
return (struct sel_oem_record_nots *) rsp->data;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ipmi_sel_list_entries(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rsp * rsp;
|
||||
struct ipmi_req req;
|
||||
unsigned short reserve_id, next_id;
|
||||
struct sel_event_record * evt;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = 0x42; /* reserve SEL */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error:%x unable to reserve SEL\n",
|
||||
rsp ? rsp->ccode : 0);
|
||||
return;
|
||||
}
|
||||
|
||||
reserve_id = rsp->data[0] | rsp->data[1] << 8;
|
||||
if (verbose)
|
||||
printf("SEL Reservation ID: %04x\n", reserve_id);
|
||||
|
||||
next_id = 0;
|
||||
while (next_id != 0xffff) {
|
||||
evt = (struct sel_event_record *) ipmi_sel_get_entry(intf, next_id);
|
||||
if (!evt)
|
||||
return;
|
||||
|
||||
printf("SEL Record ID : %04x\n", evt->record_id);
|
||||
printf(" Record Type : %02x\n", evt->record_type);
|
||||
printf(" Timestamp : %08lx\n", evt->timestamp);
|
||||
printf(" Generator ID : %04x\n", evt->gen_id);
|
||||
printf(" EvM Revision : %02x\n", evt->evm_rev);
|
||||
printf(" Sensor Type : %s\n", ipmi_sel_get_sensor_type(evt->sensor_type));
|
||||
printf(" Sensor Num : %02x\n", evt->sensor_num);
|
||||
printf(" Event Type : %s\n", ipmi_get_event_type(evt->event_type));
|
||||
printf(" Event Direction : %s\n", val2str(evt->event_dir, event_dir_vals));
|
||||
printf(" Event Data : %02x%02x%02x\n",
|
||||
evt->event_data[0], evt->event_data[1], evt->event_data[2]);
|
||||
printf(" Description : %s\n", ipmi_get_event_desc(evt));
|
||||
printf("\n");
|
||||
|
||||
next_id = evt->next_id;
|
||||
}
|
||||
}
|
||||
|
||||
int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc)
|
||||
ipmi_sel_get_info(intf);
|
||||
else if (!strncmp(argv[0], "help", 4))
|
||||
printf("SEL Commands: info\n");
|
||||
else if (!strncmp(argv[0], "info", 4))
|
||||
ipmi_sel_get_info(intf);
|
||||
else if (!strncmp(argv[0], "list", 4))
|
||||
ipmi_sel_list_entries(intf);
|
||||
else
|
||||
printf("Invalid SEL command: %s\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,290 +0,0 @@
|
||||
.TH "ipmitool" "1" "@@VERSION@@" "Duncan Laurie" ""
|
||||
.SH "NAME"
|
||||
.LP
|
||||
ipmitool \- utility for IPMI control
|
||||
.SH "SYNTAX"
|
||||
.LP
|
||||
ipmitool [\fB\-hcvV\fR] \fB\-I\fR \fIlan\fP \fB\-H\fR \fIaddress\fP [\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
|
||||
.br
|
||||
ipmitool [\fB\-hcvV\fR] \fB\-I\fR \fIdev\fP <\fIexpression\fP>
|
||||
.SH "DESCRIPTION"
|
||||
.LP
|
||||
This program lets you perform various IPMI functions with either a kernel device driver or over a LAN interface. These functions include printing FRU information, LAN configuration, sensor readings, and remote chassis power control.
|
||||
.SH "OPTIONS"
|
||||
.LP
|
||||
.TP
|
||||
\fB\-h\fR
|
||||
Get basic usage help from the command line.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Make output suitable for parsing where possible by separating fields with commas instead of spaces.
|
||||
.TP
|
||||
\fB\-V\fR
|
||||
Display version information.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified multiple times to increase the level of debug output. If given three times you will get hexdumps of all incoming and outgoing packets.
|
||||
.TP
|
||||
\fB\-I\fR <\fIinterface\fP>
|
||||
Selects IPMI interface to use. Possible interfaces are \fIlan\fP or \fIdev\fP.
|
||||
.TP
|
||||
\fB\-H\fR <\fIaddress\fP>
|
||||
Remote server address, can be IP address or hostname. This option is required for the LAN interface connection.
|
||||
.TP
|
||||
\fB\-P\fR <\fIpassword\fP>
|
||||
Remote server password, 16 character maximum. This is optional for the LAN interface, if it is not provided the session will not be authenticated.
|
||||
.SH "EXPRESSIONS"
|
||||
.LP
|
||||
.TP
|
||||
.I help
|
||||
This can be used to get command-line help on ipmitool commands. It may also be placed at the end of commands to get option usage help.
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev help
|
||||
.br
|
||||
Commands: chassis, fru, lan, sdr, sel
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I dev chassis help
|
||||
.br
|
||||
Chassis Commands: status, power, identify, policy, restart_cause
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I dev chassis power help
|
||||
.br
|
||||
Chassis Power Commands: status, on, off, cycle, reset, diag, soft
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIraw\fP <\fBnetfn\fR> <\fBcmd\fR> [\fBdata\fR]
|
||||
This will allow you to execute raw IPMI commands. For example to query the POH counter with a raw command:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev raw 0x0 0xf
|
||||
.br
|
||||
RAW REQ (netfn=0x0 cmd=0xf data_len=0)
|
||||
.br
|
||||
RAW RSP (5 bytes)
|
||||
.br
|
||||
3c 72 0c 00 00
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIchaninfo\fP [\fBchannel\fR]
|
||||
This command will display information about the selected channel. If no channel is given it will display information about the currently used channel:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I dev chaninfo
|
||||
.br
|
||||
Channel 0xf info:
|
||||
.br
|
||||
Channel Medium Type : System Interface
|
||||
.br
|
||||
Channel Protocol Type : KCS
|
||||
.br
|
||||
Session Support : session-less
|
||||
.br
|
||||
Active Session Count : 0
|
||||
.br
|
||||
Protocol Vendor ID : 7154
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
.I chassis
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
This command returns information about the high-level status of the system chassis and main power subsystem.
|
||||
.TP
|
||||
.I poh
|
||||
This command will return the Power-On Hours counter.
|
||||
.TP
|
||||
\fIidentify\fP <\fBinterval\fR>
|
||||
Control the front panel identify light. Default is 15. Use 0 to turn off.
|
||||
.TP
|
||||
.I restart_cause
|
||||
Query the chassis for the cause of the last system restart.
|
||||
.TP
|
||||
.I policy
|
||||
Set the chassis power policy in the event power failure.
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
Return supported policies.
|
||||
.TP
|
||||
.I always-on
|
||||
Turn on when power is restored.
|
||||
.TP
|
||||
.I previous
|
||||
Returned to previous state when power is restored.
|
||||
.TP
|
||||
.I always-off
|
||||
Stay off after power is restored.
|
||||
.RE
|
||||
.TP
|
||||
.I power
|
||||
Performs a chassis control command to view and change the power state.
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
Show current chassis power status.
|
||||
.TP
|
||||
.I on
|
||||
Power up chassis.
|
||||
.TP
|
||||
.I off
|
||||
Power down chassis into soft off (S4/S5 state). WARNING: this command does not initiate a clean shutdown of the operating system prior to powering down the system.
|
||||
.TP
|
||||
.I cycle
|
||||
This command provides a power off interval of at least 1 second. No action should occur if chassis power is in S4/S5 state, but it is recommended to check power state first and only issue a power cycle command if the system power is on or in lower sleep state than S4/S5.
|
||||
.TP
|
||||
.I reset
|
||||
This command will perform a hard reset.
|
||||
.TP
|
||||
.I diag
|
||||
Pulse a version of a diagnostic interrupt (NMI) that goes directly to the processor(s).
|
||||
.TP
|
||||
.I soft
|
||||
Initiate a soft\-shutdown of OS via ACPI by emulating a fatal overtemperature.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I lan
|
||||
.RS
|
||||
.TP
|
||||
\fIprint\fP <\fBchannel\fR>
|
||||
Print the current configuration for the given channel.
|
||||
.TP
|
||||
\fIset\fP <\fBchannel\fR> <\fBparameter\fR>
|
||||
Set the given parameter on the given channel. Valid parameters are:
|
||||
.RS
|
||||
.TP
|
||||
\fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the IP address for this channel.
|
||||
.TP
|
||||
\fInetmask\fP <\fBx.x.x.x\fR>
|
||||
Set the netmask for this channel.
|
||||
.TP
|
||||
\fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the MAC adddress for this channel.
|
||||
.TP
|
||||
\fIdefgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the default gateway IP address.
|
||||
.TP
|
||||
\fIdefgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the default gateway MAC address.
|
||||
.TP
|
||||
\fIbakgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the backup gateway IP address.
|
||||
.TP
|
||||
\fIbakgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the backup gateway MAC address.
|
||||
.TP
|
||||
\fIpassword\fP <\fBpass\fR>
|
||||
Set the null user password.
|
||||
.TP
|
||||
\fIauth\fP <\fBlevel,...\fR> <\fBtype,...\fR>
|
||||
Set the valid authtypes for a given auth level.
|
||||
.RS
|
||||
Levels:
|
||||
.B callback
|
||||
.B user
|
||||
.B operator
|
||||
.B admin
|
||||
.br
|
||||
Types:
|
||||
.B none
|
||||
.B md2
|
||||
.B key
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I fru
|
||||
.RS
|
||||
.TP
|
||||
.I print
|
||||
This command will read all Field Replacable Unit inventory data and extract such information as serial number, part number, asset tags, and short strings describing the chassis, board, or product.
|
||||
.RE
|
||||
.TP
|
||||
.I sdr
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
This command will read the SDR and extract sensor information, then query each sensor and print its name, reading, and status.
|
||||
.RE
|
||||
.TP
|
||||
.I sel
|
||||
.RS
|
||||
.TP
|
||||
.I info
|
||||
This command will query the BMC for information about the SEL and its contents.
|
||||
.TP
|
||||
.I list
|
||||
This command will list the contents of the SEL.
|
||||
.RE
|
||||
.SH "DEV INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIdev\fP interface utilizes the MontaVista OpenIPMI kernel device driver. This driver is present in 2.5.57 and later development kernels and in 2.4.21pre1 and later stable kernels. There are also IPMI driver kernel patches for different versions available from the OpenIPMI homepage.
|
||||
.LP
|
||||
The following kernel modules must be loaded in order for ipmitool to work:
|
||||
.TP
|
||||
.B ipmi_msghandler
|
||||
Incoming and outgoing message handler for IPMI interfaces.
|
||||
.TP
|
||||
.B ipmi_kcs_drv
|
||||
An IPMI Keyboard Controler Style (KCS) interface driver for the message handler.
|
||||
.TP
|
||||
.B ipmi_devintf
|
||||
Linux character device interface for the message handler.
|
||||
.LP
|
||||
Once they are loaded there will be a dynamic char device entry that must exist at \fB/dev/ipmi/0\fR. Usually if this is the first dynamic device it will be major number \fB254\fR and minor number \fB0\fR so you would create the dev entry with:
|
||||
.LP
|
||||
.I mknod /dev/ipmi/0 c 254 0
|
||||
.LP
|
||||
In order to force ipmitool to make use of the device interface you can specifiy it on the command line:
|
||||
.PP
|
||||
ipmitool \-I dev [option...]
|
||||
.LP
|
||||
Alternatively if you do not provide a hostname on the command line ipmitool will assume you want to use the dev interface.
|
||||
.SH "LAN INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIlan\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. UDP datagrams are formatted to contain IPMI request/response messages with a IPMI session headers and RMCP headers.
|
||||
.LP
|
||||
IPMI\-over\-LAN uses version 1 of the Remote Management Control Protocol (RMCP) to support \fIpre\-OS\fP and \fIOS\-absent\fP management. RMCP is a request\-response protocol delivered using UDP datagrams to port 623.
|
||||
.LP
|
||||
The LAN interface is an authenticatiod multi\-session connection; messages delivered to the BMC can (and should) be authenticated with a challenge/response protocol with either straight password/key. ipmitool will attempt to connect with administrator privilege level as this is required to perform chassis power functions.
|
||||
.LP
|
||||
You can tell ipmitool to use the lan interface with the \fB\-I\fR option:
|
||||
.PP
|
||||
ipmitool \-I lan [option...] <address> [password]
|
||||
.LP
|
||||
A hostname \fBmust\fR be given on the command line in order to use the lan interface with ipmitool. The password field is optional; if you do not provide a password on the command line ipmitool will attempt to connect without authentication. If you specify a password it will use straight password/key.
|
||||
.SH "FILES"
|
||||
.TP
|
||||
.I /dev/ipmi/0
|
||||
This character device file is used by the OpenIPMI kernel driver.
|
||||
.SH "EXAMPLES"
|
||||
.LP
|
||||
If you want to remotely control the power of an IPMI\-over\-LAN enabled system you can use:
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power on
|
||||
.LP
|
||||
Chassis Power is off.
|
||||
.br
|
||||
Chassis Power Control: on
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power status
|
||||
.LP
|
||||
Chassis Power is on.
|
||||
.SH "AUTHOR"
|
||||
.LP
|
||||
Duncan Laurie <duncan@sun.com>
|
||||
.SH "SEE ALSO"
|
||||
.LP
|
||||
.TP
|
||||
Intelligent Platform Management Interface Specification
|
||||
http://www.intel.com/design/servers/ipmi/spec.htm
|
||||
.TP
|
||||
OpenIPMI project (MontaVista IPMI kernel driver)
|
||||
http://openipmi.sourceforge.net/
|
@ -1,103 +0,0 @@
|
||||
Name: @IPMITOOL_PKG@
|
||||
Summary: @IPMITOOL_PKG@ - Utility for interfacing with IPMI devices
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
Copyright: BSD
|
||||
Group: Utilities
|
||||
Vendor: Sun Microsystems
|
||||
Packager: Duncan Laurie <duncan@sun.com>
|
||||
Source: @IPMITOOL_PKG@-@VERSION@.tar.gz
|
||||
Buildroot: /var/tmp/@IPMITOOL_PKG@-root
|
||||
|
||||
%package dev
|
||||
Summary: Development files for ipmitool
|
||||
Group: Utilities
|
||||
|
||||
%description
|
||||
This package contains a utility for interfacing with IPMI-enabled devices
|
||||
through either the OpenIPMI kernel driver or with IPMI-over-LAN protocol.
|
||||
It provides some basic functions for reading the SDR and displaying sensor
|
||||
values, displaying the contents of the SEL, printing FRU information,
|
||||
reading and setting LAN configuration, and chassis power control.
|
||||
|
||||
%description dev
|
||||
Additional development files for creating applications or interface plugins
|
||||
for ipmitool.
|
||||
|
||||
%prep
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure @ac_configure_args@ \
|
||||
--prefix=%{_prefix} \
|
||||
--bindir=%{_bindir} \
|
||||
--datadir=%{_datadir} \
|
||||
--includedir=%{_includedir} \
|
||||
--libdir=%{_libdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--sysconfdir=%{_sysconfdir}
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
%clean
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
rm -rf $RPM_BUILD_DIR/@IPMITOOL_PKG@-@VERSION@
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc %{_mandir}/man1/*
|
||||
%{_bindir}/*
|
||||
%dir %{_libdir}/ipmitool
|
||||
%attr(755,root,root) %{_libdir}/ipmitool/*
|
||||
|
||||
%files dev
|
||||
%defattr(-,root,root)
|
||||
%dir %{_includedir}/ipmitool
|
||||
%{_includedir}/ipmitool/*.h
|
||||
|
||||
%changelog
|
||||
* Fri Nov 14 2003 <duncan@sun.com> 1.5.4-1
|
||||
- pull interface plugin api into library
|
||||
- fix ipmievd
|
||||
|
||||
* Fri Oct 31 2003 <duncan@sun.com> 1.5.3-1
|
||||
- add -g optin for pedantic ipmi-over-lan communication
|
||||
|
||||
* Fri Oct 24 2003 <duncan@sun.com> 1.5.2-1
|
||||
- add gratuitous arp interval setting
|
||||
|
||||
* Wed Oct 8 2003 <duncan@sun.com> 1.5.1-1
|
||||
- better SEL support
|
||||
- fix display bug in SDR list
|
||||
|
||||
* Fri Sep 5 2003 <duncan@sun.com> 1.5.0-1
|
||||
- use automake/autoconf/libtool
|
||||
- dynamic loading interface plugins
|
||||
|
||||
* Wed May 28 2003 <duncan@sun.com> 1.4.0-1
|
||||
- make UDP packet handling more robust
|
||||
- fix imb driver support
|
||||
|
||||
* Thu May 22 2003 <duncan@sun.com> 1.3-1
|
||||
- update manpage
|
||||
- rework of low-level network handling
|
||||
- add basic imb driver support
|
||||
|
||||
* Wed Apr 2 2003 <duncan@sun.com> 1.2-1
|
||||
- change command line option parsing
|
||||
- support for more chassis commands
|
||||
|
||||
* Tue Apr 1 2003 <duncan@sun.com> 1.1-1
|
||||
- minor fixes.
|
||||
|
||||
* Sun Mar 30 2003 <duncan@sun.com> 1.0-1
|
||||
- Initial release.
|
||||
|
@ -27,17 +27,19 @@
|
||||
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = libipmitool.la
|
||||
libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_lanp.c \
|
||||
ipmi_fru.c ipmi_chassis.c ipmi_bmc.c ipmi_intf.c
|
||||
libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
|
||||
ipmi_lanp.c ipmi_fru.c ipmi_chassis.c ipmi_mc.c log.c \
|
||||
dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
|
||||
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
|
||||
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
|
||||
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c
|
||||
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
libipmitool_la_LIBADD = -lm $(LIBLTDL)
|
||||
libipmitool_la_DEPENDENCIES = $(LIBLTDL)
|
||||
libipmitool_la_LIBADD = -lm
|
||||
libipmitool_la_DEPENDENCIES =
|
||||
|
||||
|
794
ipmitool/lib/dimm_spd.c
Normal file
794
ipmitool/lib/dimm_spd.c
Normal file
@ -0,0 +1,794 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern int verbose;
|
||||
|
||||
const struct valstr spd_memtype_vals[] = {
|
||||
{ 0x02, "EDO" },
|
||||
{ 0x04, "SDRAM" },
|
||||
{ 0x07, "DDR" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr spd_config_vals[] = {
|
||||
{ 0x00, "None" },
|
||||
{ 0x01, "Parity" },
|
||||
{ 0x02, "ECC" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr spd_voltage_vals[] = {
|
||||
{ 0x00, "5.0V TTL" },
|
||||
{ 0x01, "LVTTL" },
|
||||
{ 0x02, "HSTL 1.5V" },
|
||||
{ 0x03, "SSTL 3.3V" },
|
||||
{ 0x04, "SSTL 2.5V" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* JEDEC Standard Manufacturers Identification Code
|
||||
* publication JEP106N, December 2003
|
||||
*/
|
||||
|
||||
const struct valstr jedec_id1_vals[] = {
|
||||
{ 0x01, "AMD" },
|
||||
{ 0x02, "AMI" },
|
||||
{ 0x83, "Fairchild" },
|
||||
{ 0x04, "Fujitsu" },
|
||||
{ 0x85, "GTE" },
|
||||
{ 0x86, "Harris" },
|
||||
{ 0x07, "Hitachi" },
|
||||
{ 0x08, "Inmos" },
|
||||
{ 0x89, "Intel" },
|
||||
{ 0x8a, "I.T.T." },
|
||||
{ 0x0b, "Intersil" },
|
||||
{ 0x8c, "Monolithic Memories" },
|
||||
{ 0x0d, "Mostek" },
|
||||
{ 0x0e, "Motorola" },
|
||||
{ 0x8f, "National" },
|
||||
{ 0x10, "NEC" },
|
||||
{ 0x91, "RCA" },
|
||||
{ 0x92, "Raytheon" },
|
||||
{ 0x13, "Conexant (Rockwell)" },
|
||||
{ 0x94, "Seeq" },
|
||||
{ 0x15, "Philips Semi. (Signetics)" },
|
||||
{ 0x16, "Synertek" },
|
||||
{ 0x97, "Texas Instruments" },
|
||||
{ 0x98, "Toshiba" },
|
||||
{ 0x19, "Xicor" },
|
||||
{ 0x1a, "Zilog" },
|
||||
{ 0x9b, "Eurotechnique" },
|
||||
{ 0x1c, "Mitsubishi" },
|
||||
{ 0x9d, "Lucent (AT&T)" },
|
||||
{ 0x9e, "Exel" },
|
||||
{ 0x1f, "Atmel" },
|
||||
{ 0x20, "SGS/Thomson" },
|
||||
{ 0xa1, "Lattice Semi." },
|
||||
{ 0xa2, "NCR" },
|
||||
{ 0x23, "Wafer Scale Integration" },
|
||||
{ 0xa4, "IBM" },
|
||||
{ 0x25, "Tristar" },
|
||||
{ 0x26, "Visic" },
|
||||
{ 0xa7, "Intl. CMOS Technology" },
|
||||
{ 0xa8, "SSSI" },
|
||||
{ 0x29, "Microchip Technology" },
|
||||
{ 0x2a, "Ricoh Ltd." },
|
||||
{ 0xab, "VLSI" },
|
||||
{ 0x2c, "Micron Technology" },
|
||||
{ 0xad, "Hyundai Electronics" },
|
||||
{ 0xae, "OKI Semiconductor" },
|
||||
{ 0x2f, "ACTEL" },
|
||||
{ 0xb0, "Sharp" },
|
||||
{ 0x31, "Catalyst" },
|
||||
{ 0x32, "Panasonic" },
|
||||
{ 0xb3, "IDT" },
|
||||
{ 0x34, "Cypress" },
|
||||
{ 0xb5, "DEC" },
|
||||
{ 0xb6, "LSI Logic" },
|
||||
{ 0x37, "Zarlink" },
|
||||
{ 0x38, "UTMC" },
|
||||
{ 0xb9, "Thinking Machine" },
|
||||
{ 0xba, "Thomson CSF" },
|
||||
{ 0x3b, "Integrated CMOS(Vertex)" },
|
||||
{ 0xbc, "Honeywell" },
|
||||
{ 0x3d, "Tektronix" },
|
||||
{ 0x3e, "Sun Microsystems" },
|
||||
{ 0xbf, "SST" },
|
||||
{ 0x40, "MOSEL" },
|
||||
{ 0xc1, "Infineon" },
|
||||
{ 0xc2, "Macronix" },
|
||||
{ 0x43, "Xerox" },
|
||||
{ 0xc4, "Plus Logic" },
|
||||
{ 0x45, "SunDisk" },
|
||||
{ 0x46, "Elan Circuit Tech." },
|
||||
{ 0xc7, "European Silicon Str." },
|
||||
{ 0xc8, "Apple Computer" },
|
||||
{ 0xc9, "Xilinx" },
|
||||
{ 0x4a, "Compaq" },
|
||||
{ 0xcb, "Protocol Engines" },
|
||||
{ 0x4c, "SCI" },
|
||||
{ 0xcd, "Seiko Instruments" },
|
||||
{ 0xce, "Samsung" },
|
||||
{ 0x4f, "I3 Design System" },
|
||||
{ 0xd0, "Klic" },
|
||||
{ 0x51, "Crosspoint Solutions" },
|
||||
{ 0x52, "Alliance Semiconductor" },
|
||||
{ 0xd3, "Tandem" },
|
||||
{ 0x54, "Hewlett-Packard" },
|
||||
{ 0xd5, "Intg. Silicon Solutions" },
|
||||
{ 0xd6, "Brooktree" },
|
||||
{ 0x57, "New Media" },
|
||||
{ 0x58, "MHS Electronic" },
|
||||
{ 0xd9, "Performance Semi." },
|
||||
{ 0xda, "Winbond Electronic" },
|
||||
{ 0x5b, "Kawasaki Steel" },
|
||||
{ 0xdc, "Bright Micro" },
|
||||
{ 0x5d, "TECMAR" },
|
||||
{ 0x5e, "Exar" },
|
||||
{ 0xdf, "PCMCIA" },
|
||||
{ 0xe0, "LG Semiconductor" },
|
||||
{ 0x61, "Northern Telecom" },
|
||||
{ 0x62, "Sanyo" },
|
||||
{ 0xe3, "Array Microsystems" },
|
||||
{ 0x64, "Crystal Semiconductor" },
|
||||
{ 0xe5, "Analog Devices" },
|
||||
{ 0xe6, "PMC-Sierra" },
|
||||
{ 0x67, "Asparix" },
|
||||
{ 0x68, "Convex Computer" },
|
||||
{ 0xe9, "Quality Semiconductor" },
|
||||
{ 0xea, "Nimbus Technology" },
|
||||
{ 0x6b, "Transwitch" },
|
||||
{ 0xec, "Micronas (ITT Intermetall)" },
|
||||
{ 0x6d, "Cannon" },
|
||||
{ 0x6e, "Altera" },
|
||||
{ 0xef, "NEXCOM" },
|
||||
{ 0x70, "QUALCOMM" },
|
||||
{ 0xf1, "Sony" },
|
||||
{ 0xf2, "Cray Research" },
|
||||
{ 0x73, "AMS (Austria Micro)" },
|
||||
{ 0xf4, "Vitesse" },
|
||||
{ 0x75, "Aster Electronics" },
|
||||
{ 0x76, "Bay Networks (Synoptic)" },
|
||||
{ 0xf7, "Zentrum" },
|
||||
{ 0xf8, "TRW" },
|
||||
{ 0x79, "Thesys" },
|
||||
{ 0x7a, "Solbourne Computer" },
|
||||
{ 0xfb, "Allied-Signal" },
|
||||
{ 0x7c, "Dialog" },
|
||||
{ 0xfd, "Media Vision" },
|
||||
{ 0xfe, "Level One Communication" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr jedec_id2_vals[] = {
|
||||
{ 0x01, "Cirrus Logic" },
|
||||
{ 0x02, "National Instruments" },
|
||||
{ 0x83, "ILC Data Device" },
|
||||
{ 0x04, "Alcatel Mietec" },
|
||||
{ 0x85, "Micro Linear" },
|
||||
{ 0x86, "Univ. of NC" },
|
||||
{ 0x07, "JTAG Technologies" },
|
||||
{ 0x08, "Loral" },
|
||||
{ 0x89, "Nchip" },
|
||||
{ 0x8A, "Galileo Tech" },
|
||||
{ 0x0B, "Bestlink Systems" },
|
||||
{ 0x8C, "Graychip" },
|
||||
{ 0x0D, "GENNUM" },
|
||||
{ 0x0E, "VideoLogic" },
|
||||
{ 0x8F, "Robert Bosch" },
|
||||
{ 0x10, "Chip Express" },
|
||||
{ 0x91, "DATARAM" },
|
||||
{ 0x92, "United Microelec Corp." },
|
||||
{ 0x13, "TCSI" },
|
||||
{ 0x94, "Smart Modular" },
|
||||
{ 0x15, "Hughes Aircraft" },
|
||||
{ 0x16, "Lanstar Semiconductor" },
|
||||
{ 0x97, "Qlogic" },
|
||||
{ 0x98, "Kingston" },
|
||||
{ 0x19, "Music Semi" },
|
||||
{ 0x1A, "Ericsson Components" },
|
||||
{ 0x9B, "SpaSE" },
|
||||
{ 0x1C, "Eon Silicon Devices" },
|
||||
{ 0x9D, "Programmable Micro Corp" },
|
||||
{ 0x9E, "DoD" },
|
||||
{ 0x1F, "Integ. Memories Tech." },
|
||||
{ 0x20, "Corollary Inc." },
|
||||
{ 0xA1, "Dallas Semiconductor" },
|
||||
{ 0xA2, "Omnivision" },
|
||||
{ 0x23, "EIV(Switzerland)" },
|
||||
{ 0xA4, "Novatel Wireless" },
|
||||
{ 0x25, "Zarlink (formerly Mitel)" },
|
||||
{ 0x26, "Clearpoint" },
|
||||
{ 0xA7, "Cabletron" },
|
||||
{ 0xA8, "Silicon Technology" },
|
||||
{ 0x29, "Vanguard" },
|
||||
{ 0x2A, "Hagiwara Sys-Com" },
|
||||
{ 0xAB, "Vantis" },
|
||||
{ 0x2C, "Celestica" },
|
||||
{ 0xAD, "Century" },
|
||||
{ 0xAE, "Hal Computers" },
|
||||
{ 0x2F, "Rohm Company Ltd." },
|
||||
{ 0xB0, "Juniper Networks" },
|
||||
{ 0x31, "Libit Signal Processing" },
|
||||
{ 0x32, "Enhanced Memories Inc." },
|
||||
{ 0xB3, "Tundra Semiconductor" },
|
||||
{ 0x34, "Adaptec Inc." },
|
||||
{ 0xB5, "LightSpeed Semi." },
|
||||
{ 0xB6, "ZSP Corp." },
|
||||
{ 0x37, "AMIC Technology" },
|
||||
{ 0x38, "Adobe Systems" },
|
||||
{ 0xB9, "Dynachip" },
|
||||
{ 0xBA, "PNY Electronics" },
|
||||
{ 0x3B, "Newport Digital" },
|
||||
{ 0xBC, "MMC Networks" },
|
||||
{ 0x3D, "T Square" },
|
||||
{ 0x3E, "Seiko Epson" },
|
||||
{ 0xBF, "Broadcom" },
|
||||
{ 0x40, "Viking Components" },
|
||||
{ 0xC1, "V3 Semiconductor" },
|
||||
{ 0xC2, "Flextronics (formerly Orbit)" },
|
||||
{ 0x43, "Suwa Electronics" },
|
||||
{ 0xC4, "Transmeta" },
|
||||
{ 0x45, "Micron CMS" },
|
||||
{ 0x46, "American Computer & Digital Components Inc" },
|
||||
{ 0xC7, "Enhance 3000 Inc" },
|
||||
{ 0xC8, "Tower Semiconductor" },
|
||||
{ 0x49, "CPU Design" },
|
||||
{ 0x4A, "Price Point" },
|
||||
{ 0xCB, "Maxim Integrated Product" },
|
||||
{ 0x4C, "Tellabs" },
|
||||
{ 0xCD, "Centaur Technology" },
|
||||
{ 0xCE, "Unigen Corporation" },
|
||||
{ 0x4F, "Transcend Information" },
|
||||
{ 0xD0, "Memory Card Technology" },
|
||||
{ 0x51, "CKD Corporation Ltd." },
|
||||
{ 0x52, "Capital Instruments, Inc." },
|
||||
{ 0xD3, "Aica Kogyo, Ltd." },
|
||||
{ 0x54, "Linvex Technology" },
|
||||
{ 0xD5, "MSC Vertriebs GmbH" },
|
||||
{ 0xD6, "AKM Company, Ltd." },
|
||||
{ 0x57, "Dynamem, Inc." },
|
||||
{ 0x58, "NERA ASA" },
|
||||
{ 0xD9, "GSI Technology" },
|
||||
{ 0xDA, "Dane-Elec (C Memory)" },
|
||||
{ 0x5B, "Acorn Computers" },
|
||||
{ 0xDC, "Lara Technology" },
|
||||
{ 0x5D, "Oak Technology, Inc." },
|
||||
{ 0x5E, "Itec Memory" },
|
||||
{ 0xDF, "Tanisys Technology" },
|
||||
{ 0xE0, "Truevision" },
|
||||
{ 0x61, "Wintec Industries" },
|
||||
{ 0x62, "Super PC Memory" },
|
||||
{ 0xE3, "MGV Memory" },
|
||||
{ 0x64, "Galvantech" },
|
||||
{ 0xE5, "Gadzoox Nteworks" },
|
||||
{ 0xE6, "Multi Dimensional Cons." },
|
||||
{ 0x67, "GateField" },
|
||||
{ 0x68, "Integrated Memory System" },
|
||||
{ 0xE9, "Triscend" },
|
||||
{ 0xEA, "XaQti" },
|
||||
{ 0x6B, "Goldenram" },
|
||||
{ 0xEC, "Clear Logic" },
|
||||
{ 0x6D, "Cimaron Communications" },
|
||||
{ 0x6E, "Nippon Steel Semi. Corp." },
|
||||
{ 0xEF, "Advantage Memory" },
|
||||
{ 0x70, "AMCC" },
|
||||
{ 0xF1, "LeCroy" },
|
||||
{ 0xF2, "Yamaha Corporation" },
|
||||
{ 0x73, "Digital Microwave" },
|
||||
{ 0xF4, "NetLogic Microsystems" },
|
||||
{ 0x75, "MIMOS Semiconductor" },
|
||||
{ 0x76, "Advanced Fibre" },
|
||||
{ 0xF7, "BF Goodrich Data." },
|
||||
{ 0xF8, "Epigram" },
|
||||
{ 0x79, "Acbel Polytech Inc." },
|
||||
{ 0x7A, "Apacer Technology" },
|
||||
{ 0xFB, "Admor Memory" },
|
||||
{ 0x7C, "FOXCONN" },
|
||||
{ 0xFD, "Quadratics Superconductor" },
|
||||
{ 0xFE, "3COM" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr jedec_id3_vals[] = {
|
||||
{ 0x01, "Camintonn Corporation" },
|
||||
{ 0x02, "ISOA Incorporated" },
|
||||
{ 0x83, "Agate Semiconductor" },
|
||||
{ 0x04, "ADMtek Incorporated" },
|
||||
{ 0x85, "HYPERTEC" },
|
||||
{ 0x86, "Adhoc Technologies" },
|
||||
{ 0x07, "MOSAID Technologies" },
|
||||
{ 0x08, "Ardent Technologies" },
|
||||
{ 0x89, "Switchcore" },
|
||||
{ 0x8A, "Cisco Systems, Inc." },
|
||||
{ 0x0B, "Allayer Technologies" },
|
||||
{ 0x8C, "WorkX AG" },
|
||||
{ 0x0D, "Oasis Semiconductor" },
|
||||
{ 0x0E, "Novanet Semiconductor" },
|
||||
{ 0x8F, "E-M Solutions" },
|
||||
{ 0x10, "Power General" },
|
||||
{ 0x91, "Advanced Hardware Arch." },
|
||||
{ 0x92, "Inova Semiconductors GmbH" },
|
||||
{ 0x13, "Telocity" },
|
||||
{ 0x94, "Delkin Devices" },
|
||||
{ 0x15, "Symagery Microsystems" },
|
||||
{ 0x16, "C-Port Corporation" },
|
||||
{ 0x97, "SiberCore Technologies" },
|
||||
{ 0x98, "Southland Microsystems" },
|
||||
{ 0x19, "Malleable Technologies" },
|
||||
{ 0x1A, "Kendin Communications" },
|
||||
{ 0x9B, "Great Technology Microcomputer" },
|
||||
{ 0x1C, "Sanmina Corporation" },
|
||||
{ 0x9D, "HADCO Corporation" },
|
||||
{ 0x9E, "Corsair" },
|
||||
{ 0x1F, "Actrans System Inc." },
|
||||
{ 0x20, "ALPHA Technologies" },
|
||||
{ 0xA1, "Cygnal Integrated Products Incorporated" },
|
||||
{ 0xA2, "Artesyn Technologies" },
|
||||
{ 0x23, "Align Manufacturing" },
|
||||
{ 0xA4, "Peregrine Semiconductor" },
|
||||
{ 0x25, "Chameleon Systems" },
|
||||
{ 0x26, "Aplus Flash Technology" },
|
||||
{ 0xA7, "MIPS Technologies" },
|
||||
{ 0xA8, "Chrysalis ITS" },
|
||||
{ 0x29, "ADTEC Corporation" },
|
||||
{ 0x2A, "Kentron Technologies" },
|
||||
{ 0xAB, "Win Technologies" },
|
||||
{ 0x2C, "ASIC Designs Inc" },
|
||||
{ 0xAD, "Extreme Packet Devices" },
|
||||
{ 0xAE, "RF Micro Devices" },
|
||||
{ 0x2F, "Siemens AG" },
|
||||
{ 0xB0, "Sarnoff Corporation" },
|
||||
{ 0x31, "Itautec Philco SA" },
|
||||
{ 0x32, "Radiata Inc." },
|
||||
{ 0xB3, "Benchmark Elect. (AVEX)" },
|
||||
{ 0x34, "Legend" },
|
||||
{ 0xB5, "SpecTek Incorporated" },
|
||||
{ 0xB6, "Hi/fn" },
|
||||
{ 0x37, "Enikia Incorporated" },
|
||||
{ 0x38, "SwitchOn Networks" },
|
||||
{ 0xB9, "AANetcom Incorporated" },
|
||||
{ 0xBA, "Micro Memory Bank" },
|
||||
{ 0x3B, "ESS Technology" },
|
||||
{ 0xBC, "Virata Corporation" },
|
||||
{ 0x3D, "Excess Bandwidth" },
|
||||
{ 0x3E, "West Bay Semiconductor" },
|
||||
{ 0xBF, "DSP Group" },
|
||||
{ 0x40, "Newport Communications" },
|
||||
{ 0xC1, "Chip2Chip Incorporated" },
|
||||
{ 0xC2, "Phobos Corporation" },
|
||||
{ 0x43, "Intellitech Corporation" },
|
||||
{ 0xC4, "Nordic VLSI ASA" },
|
||||
{ 0x45, "Ishoni Networks" },
|
||||
{ 0x46, "Silicon Spice" },
|
||||
{ 0xC7, "Alchemy Semiconductor" },
|
||||
{ 0xC8, "Agilent Technologies" },
|
||||
{ 0x49, "Centillium Communications" },
|
||||
{ 0x4A, "W.L. Gore" },
|
||||
{ 0xCB, "HanBit Electronics" },
|
||||
{ 0x4C, "GlobeSpan" },
|
||||
{ 0xCD, "Element 14" },
|
||||
{ 0xCE, "Pycon" },
|
||||
{ 0x4F, "Saifun Semiconductors" },
|
||||
{ 0xD0, "Sibyte, Incorporated" },
|
||||
{ 0x51, "MetaLink Technologies" },
|
||||
{ 0x52, "Feiya Technology" },
|
||||
{ 0xD3, "I & C Technology" },
|
||||
{ 0x54, "Shikatronics" },
|
||||
{ 0xD5, "Elektrobit" },
|
||||
{ 0xD6, "Megic" },
|
||||
{ 0x57, "Com-Tier" },
|
||||
{ 0x58, "Malaysia Micro Solutions" },
|
||||
{ 0xD9, "Hyperchip" },
|
||||
{ 0xDA, "Gemstone Communications" },
|
||||
{ 0x5B, "Anadyne Microelectronics" },
|
||||
{ 0xDC, "3ParData" },
|
||||
{ 0x5D, "Mellanox Technologies" },
|
||||
{ 0x5E, "Tenx Technologies" },
|
||||
{ 0xDF, "Helix AG" },
|
||||
{ 0xE0, "Domosys" },
|
||||
{ 0x61, "Skyup Technology" },
|
||||
{ 0x62, "HiNT Corporation" },
|
||||
{ 0xE3, "Chiaro" },
|
||||
{ 0x64, "MCI Computer GMBH" },
|
||||
{ 0xE5, "Exbit Technology A/S" },
|
||||
{ 0xE6, "Integrated Technology Express" },
|
||||
{ 0x67, "AVED Memory" },
|
||||
{ 0x68, "Legerity" },
|
||||
{ 0xE9, "Jasmine Networks" },
|
||||
{ 0xEA, "Caspian Networks" },
|
||||
{ 0x6B, "nCUBE" },
|
||||
{ 0xEC, "Silicon Access Networks" },
|
||||
{ 0x6D, "FDK Corporation" },
|
||||
{ 0x6E, "High Bandwidth Access" },
|
||||
{ 0xEF, "MultiLink Technology" },
|
||||
{ 0x70, "BRECIS" },
|
||||
{ 0xF1, "World Wide Packets" },
|
||||
{ 0xF2, "APW" },
|
||||
{ 0x73, "Chicory Systems" },
|
||||
{ 0xF4, "Xstream Logic" },
|
||||
{ 0x75, "Fast-Chip" },
|
||||
{ 0x76, "Zucotto Wireless" },
|
||||
{ 0xF7, "Realchip" },
|
||||
{ 0xF8, "Galaxy Power" },
|
||||
{ 0x79, "eSilicon" },
|
||||
{ 0x7A, "Morphics Technology" },
|
||||
{ 0xFB, "Accelerant Networks" },
|
||||
{ 0x7C, "Silicon Wave" },
|
||||
{ 0xFD, "SandCraft" },
|
||||
{ 0xFE, "Elpida" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr jedec_id4_vals[] = {
|
||||
{ 0x01, "Solectron" },
|
||||
{ 0x02, "Optosys Technologies" },
|
||||
{ 0x83, "Buffalo (Formerly Melco)" },
|
||||
{ 0x04, "TriMedia Technologies" },
|
||||
{ 0x85, "Cyan Technologies" },
|
||||
{ 0x86, "Global Locate" },
|
||||
{ 0x07, "Optillion" },
|
||||
{ 0x08, "Terago Communications" },
|
||||
{ 0x89, "Ikanos Communications" },
|
||||
{ 0x8A, "Princeton Technology" },
|
||||
{ 0x0B, "Nanya Technology" },
|
||||
{ 0x8C, "Elite Flash Storage" },
|
||||
{ 0x0D, "Mysticom" },
|
||||
{ 0x0E, "LightSand Communications" },
|
||||
{ 0x8F, "ATI Technologies" },
|
||||
{ 0x10, "Agere Systems" },
|
||||
{ 0x91, "NeoMagic" },
|
||||
{ 0x92, "AuroraNetics" },
|
||||
{ 0x13, "Golden Empire" },
|
||||
{ 0x94, "Muskin" },
|
||||
{ 0x15, "Tioga Technologies" },
|
||||
{ 0x16, "Netlist" },
|
||||
{ 0x97, "TeraLogic" },
|
||||
{ 0x98, "Cicada Semiconductor" },
|
||||
{ 0x19, "Centon Electronics" },
|
||||
{ 0x1A, "Tyco Electronics" },
|
||||
{ 0x9B, "Magis Works" },
|
||||
{ 0x1C, "Zettacom" },
|
||||
{ 0x9D, "Cogency Semiconductor" },
|
||||
{ 0x9E, "Chipcon AS" },
|
||||
{ 0x1F, "Aspex Technology" },
|
||||
{ 0x20, "F5 Networks" },
|
||||
{ 0xA1, "Programmable Silicon Solutions" },
|
||||
{ 0xA2, "ChipWrights" },
|
||||
{ 0x23, "Acorn Networks" },
|
||||
{ 0xA4, "Quicklogic" },
|
||||
{ 0x25, "Kingmax Semiconductor" },
|
||||
{ 0x26, "BOPS" },
|
||||
{ 0xA7, "Flasys" },
|
||||
{ 0xA8, "BitBlitz Communications" },
|
||||
{ 0x29, "eMemory Technology" },
|
||||
{ 0x2A, "Procket Networks" },
|
||||
{ 0xAB, "Purple Ray" },
|
||||
{ 0x2C, "Trebia Networks" },
|
||||
{ 0xAD, "Delta Electronics" },
|
||||
{ 0xAE, "Onex Communications" },
|
||||
{ 0x2F, "Ample Communications" },
|
||||
{ 0xB0, "Memory Experts Intl" },
|
||||
{ 0x31, "Astute Networks" },
|
||||
{ 0x32, "Azanda Network Devices" },
|
||||
{ 0xB3, "Dibcom" },
|
||||
{ 0x34, "Tekmos" },
|
||||
{ 0xB5, "API NetWorks" },
|
||||
{ 0xB6, "Bay Microsystems" },
|
||||
{ 0x37, "Firecron Ltd" },
|
||||
{ 0x38, "Resonext Communications" },
|
||||
{ 0xB9, "Tachys Technologies" },
|
||||
{ 0xBA, "Equator Technology" },
|
||||
{ 0x3B, "Concept Computer" },
|
||||
{ 0xBC, "SILCOM" },
|
||||
{ 0x3D, "3Dlabs" },
|
||||
{ 0x3E, "ct Magazine" },
|
||||
{ 0xBF, "Sanera Systems" },
|
||||
{ 0x40, "Silicon Packets" },
|
||||
{ 0xC1, "Viasystems Group" },
|
||||
{ 0xC2, "Simtek" },
|
||||
{ 0x43, "Semicon Devices Singapore" },
|
||||
{ 0xC4, "Satron Handelsges" },
|
||||
{ 0x45, "Improv Systems" },
|
||||
{ 0x46, "INDUSYS GmbH" },
|
||||
{ 0xC7, "Corrent" },
|
||||
{ 0xC8, "Infrant Technologies" },
|
||||
{ 0x49, "Ritek Corp" },
|
||||
{ 0x4A, "empowerTel Networks" },
|
||||
{ 0xCB, "Hypertec" },
|
||||
{ 0x4C, "Cavium Networks" },
|
||||
{ 0xCD, "PLX Technology" },
|
||||
{ 0xCE, "Massana Design" },
|
||||
{ 0x4F, "Intrinsity" },
|
||||
{ 0xD0, "Valence Semiconductor" },
|
||||
{ 0x51, "Terawave Communications" },
|
||||
{ 0x52, "IceFyre Semiconductor" },
|
||||
{ 0xD3, "Primarion" },
|
||||
{ 0x54, "Picochip Designs Ltd" },
|
||||
{ 0xD5, "Silverback Systems" },
|
||||
{ 0xD6, "Jade Star Technologies" },
|
||||
{ 0x57, "Pijnenburg Securealink" },
|
||||
{ 0x58, "MemorySolutioN" },
|
||||
{ 0xD9, "Cambridge Silicon Radio" },
|
||||
{ 0xDA, "Swissbit" },
|
||||
{ 0x5B, "Nazomi Communications" },
|
||||
{ 0xDC, "eWave System" },
|
||||
{ 0x5D, "Rockwell Collins" },
|
||||
{ 0x5E, "PAION" },
|
||||
{ 0xDF, "Alphamosaic Ltd" },
|
||||
{ 0xE0, "Sandburst" },
|
||||
{ 0x61, "SiCon Video" },
|
||||
{ 0x62, "NanoAmp Solutions" },
|
||||
{ 0xE3, "Ericsson Technology" },
|
||||
{ 0x64, "PrairieComm" },
|
||||
{ 0xE5, "Mitac International" },
|
||||
{ 0xE6, "Layer N Networks" },
|
||||
{ 0x67, "Atsana Semiconductor" },
|
||||
{ 0x68, "Allegro Networks" },
|
||||
{ 0xE9, "Marvell Semiconductors" },
|
||||
{ 0xEA, "Netergy Microelectronic" },
|
||||
{ 0x6B, "NVIDIA" },
|
||||
{ 0xEC, "Internet Machines" },
|
||||
{ 0x6D, "Peak Electronics" },
|
||||
{ 0xEF, "Accton Technology" },
|
||||
{ 0x70, "Teradiant Networks" },
|
||||
{ 0xF1, "Europe Technologies" },
|
||||
{ 0xF2, "Cortina Systems" },
|
||||
{ 0x73, "RAM Components" },
|
||||
{ 0xF4, "Raqia Networks" },
|
||||
{ 0x75, "ClearSpeed" },
|
||||
{ 0x76, "Matsushita Battery" },
|
||||
{ 0xF7, "Xelerated" },
|
||||
{ 0xF8, "SimpleTech" },
|
||||
{ 0x79, "Utron Technology" },
|
||||
{ 0x7A, "Astec International" },
|
||||
{ 0xFB, "AVM gmbH" },
|
||||
{ 0x7C, "Redux Communications" },
|
||||
{ 0xFD, "Dot Hill Systems" },
|
||||
{ 0xFE, "TeraChip" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr jedec_id5_vals[] = {
|
||||
{ 0x01, "T-RAM Incorporated" },
|
||||
{ 0x02, "Innovics Wireless" },
|
||||
{ 0x83, "Teknovus" },
|
||||
{ 0x04, "KeyEye Communications" },
|
||||
{ 0x85, "Runcom Technologies" },
|
||||
{ 0x86, "RedSwitch" },
|
||||
{ 0x07, "Dotcast" },
|
||||
{ 0x08, "Silicon Mountain Memory" },
|
||||
{ 0x89, "Signia Technologies" },
|
||||
{ 0x8A, "Pixim" },
|
||||
{ 0x0B, "Galazar Networks" },
|
||||
{ 0x8C, "White Electronic Designs" },
|
||||
{ 0x0D, "Patriot Scientific" },
|
||||
{ 0x0E, "Neoaxiom Corporation" },
|
||||
{ 0x8F, "3Y Power Technology" },
|
||||
{ 0x10, "Europe Technologies" },
|
||||
{ 0x91, "Potentia Power Systems" },
|
||||
{ 0x92, "C-guys Incorporated" },
|
||||
{ 0x13, "Digital Communications Technology Incorporated" },
|
||||
{ 0x94, "Silicon-Based Technology" },
|
||||
{ 0x15, "Fulcrum Microsystems" },
|
||||
{ 0x16, "Positivo Informatica Ltd" },
|
||||
{ 0x97, "XIOtech Corporation" },
|
||||
{ 0x98, "PortalPlayer" },
|
||||
{ 0x19, "Zhiying Software" },
|
||||
{ 0x1A, "Direct2Data" },
|
||||
{ 0x9B, "Phonex Broadband" },
|
||||
{ 0x1C, "Skyworks Solutions" },
|
||||
{ 0x9D, "Entropic Communications" },
|
||||
{ 0x9E, "Pacific Force Technology" },
|
||||
{ 0x1F, "Zensys A/S" },
|
||||
{ 0x20, "Legend Silicon Corp." },
|
||||
{ 0xA1, "sci-worx GmbH" },
|
||||
{ 0xA2, "Oasis Silicon Systems" },
|
||||
{ 0x23, "Renesas Technology" },
|
||||
{ 0xA4, "Raza Microelectronics" },
|
||||
{ 0x25, "Phyworks" },
|
||||
{ 0x26, "MediaTek" },
|
||||
{ 0xA7, "Non-cents Productions" },
|
||||
{ 0xA8, "US Modular" },
|
||||
{ 0x29, "Wintegra Ltd" },
|
||||
{ 0x2A, "Mathstar" },
|
||||
{ 0xAB, "StarCore" },
|
||||
{ 0x2C, "Oplus Technologies" },
|
||||
{ 0xAD, "Mindspeed" },
|
||||
{ 0xAE, "Just Young Computer" },
|
||||
{ 0x2F, "Radia Communications" },
|
||||
{ 0xB0, "OCZ" },
|
||||
{ 0x31, "Emuzed" },
|
||||
{ 0x32, "LOGIC Devices" },
|
||||
{ 0xB3, "Inphi Corporation" },
|
||||
{ 0x34, "Quake Technologies" },
|
||||
{ 0xB5, "Vixel" },
|
||||
{ 0xB6, "SolusTek" },
|
||||
{ 0x37, "Kongsberg Maritime" },
|
||||
{ 0x38, "Faraday Technology" },
|
||||
{ 0xB9, "Altium Ltd." },
|
||||
{ 0xBA, "Insyte" },
|
||||
{ 0x3B, "ARM Ltd." },
|
||||
{ 0xBC, "DigiVision" },
|
||||
{ 0x3D, "Vativ Technologies" },
|
||||
{ 0x3E, "Endicott Interconnect Technologies" },
|
||||
{ 0xBF, "Pericom" },
|
||||
{ 0x40, "Bandspeed" },
|
||||
{ 0xC1, "LeWiz Communications" },
|
||||
{ 0xC2, "CPU Technology" },
|
||||
{ 0x43, "Ramaxel Technology" },
|
||||
{ 0xC4, "DSP Group" },
|
||||
{ 0x45, "Axis Communications" },
|
||||
{ 0x46, "Legacy Electronics" },
|
||||
{ 0xC7, "Chrontel" },
|
||||
{ 0xC8, "Powerchip Semiconductor" },
|
||||
{ 0x49, "MobilEye Technologies" },
|
||||
{ 0x4A, "Excel Semiconductor" },
|
||||
{ 0xCB, "A-DATA Technology" },
|
||||
{ 0x4C, "VirtualDigm" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
int
|
||||
ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
uint8_t spd_data[256], msg_data[4];
|
||||
int len, offset, size;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
lprintf(LOG_DEBUG, "fru.size = %d bytes (accessed by %s)",
|
||||
fru.size, fru.access ? "words" : "bytes");
|
||||
|
||||
if (fru.size < 1) {
|
||||
lprintf(LOG_ERR, " Invalid FRU size %d", fru.size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
offset = 0;
|
||||
memset(spd_data, 0, 256);
|
||||
do {
|
||||
msg_data[0] = id;
|
||||
msg_data[1] = offset;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 32;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
|
||||
/* Timeouts are acceptable. No DIMM in the socket */
|
||||
if (rsp->ccode == 0xc3)
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
len = rsp->data[0];
|
||||
memcpy(&spd_data[offset], rsp->data + 1, len);
|
||||
offset += len;
|
||||
} while (offset < fru.size);
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(spd_data, offset, "SPD DATA");
|
||||
|
||||
if (offset < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
printf(" Voltage Intf : %s\n",
|
||||
val2str(spd_data[8], spd_voltage_vals));
|
||||
printf(" Error Detect/Cor : %s\n",
|
||||
val2str(spd_data[11], spd_config_vals));
|
||||
|
||||
/* handle jedec table bank continuation values */
|
||||
printf(" Manufacturer : ");
|
||||
if (spd_data[64] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[64], jedec_id1_vals));
|
||||
else {
|
||||
if (spd_data[65] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[65], jedec_id2_vals));
|
||||
else {
|
||||
if (spd_data[66] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[66], jedec_id3_vals));
|
||||
else {
|
||||
if (spd_data[67] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[67],
|
||||
jedec_id4_vals));
|
||||
else
|
||||
printf("%s\n",
|
||||
val2str(spd_data[68],
|
||||
jedec_id5_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spd_data[73]) {
|
||||
char part[19];
|
||||
memcpy(part, spd_data+73, 18);
|
||||
part[18] = 0;
|
||||
printf(" Part Number : %s\n", part);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -28,36 +28,53 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h> /* For TIOCNOTTY */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
unsigned long buf2long(unsigned char * buf)
|
||||
#ifdef HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
#endif
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
|
||||
extern int verbose;
|
||||
|
||||
uint32_t buf2long(uint8_t * buf)
|
||||
{
|
||||
return (unsigned long)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
|
||||
return (uint32_t)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
|
||||
}
|
||||
|
||||
unsigned short buf2short(unsigned char * buf)
|
||||
uint16_t buf2short(uint8_t * buf)
|
||||
{
|
||||
return (unsigned short)(buf[1] << 8 | buf[0]);
|
||||
return (uint16_t)(buf[1] << 8 | buf[0]);
|
||||
}
|
||||
|
||||
const char * buf2str(unsigned char * buf, int len)
|
||||
const char * buf2str(uint8_t * buf, int len)
|
||||
{
|
||||
static char str[1024];
|
||||
int i;
|
||||
|
||||
if (!len || len > 1024)
|
||||
if (len <= 0 || len > 1024)
|
||||
return NULL;
|
||||
|
||||
memset(str, 0, 1024);
|
||||
@ -70,58 +87,322 @@ const char * buf2str(unsigned char * buf, int len)
|
||||
return (const char *)str;
|
||||
}
|
||||
|
||||
void printbuf(unsigned char * buf, int len, char * desc)
|
||||
void printbuf(const uint8_t * buf, int len, const char * desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!len)
|
||||
if (len <= 0)
|
||||
return;
|
||||
|
||||
printf("%s (%d bytes)\n", desc, len);
|
||||
if (verbose < 1)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "%s (%d bytes)\n", desc, len);
|
||||
for (i=0; i<len; i++) {
|
||||
if (((i%16) == 0) && (i != 0))
|
||||
printf("\n");
|
||||
printf(" %2.2x", buf[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " %2.2x", buf[i]);
|
||||
}
|
||||
printf("\n");
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
const char * val2str(unsigned char val, const struct valstr *vs)
|
||||
const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
{
|
||||
static char un_str[16];
|
||||
int i = 0;
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
while (vs[i].str) {
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (vs[i].val == val)
|
||||
return vs[i].str;
|
||||
i++;
|
||||
}
|
||||
|
||||
memset(un_str, 0, 16);
|
||||
snprintf(un_str, 16, "Unknown (0x%02x)", val);
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%x)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
void signal_handler(int sig, void * handler)
|
||||
uint16_t str2val(const char *str, const struct valstr *vs)
|
||||
{
|
||||
struct sigaction act;
|
||||
int i;
|
||||
|
||||
if (!sig || !handler)
|
||||
return;
|
||||
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_handler = handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
if (sigemptyset(&act.sa_mask) < 0) {
|
||||
psignal(sig, "unable to empty signal set");
|
||||
return;
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (strncasecmp(vs[i].str, str, __maxlen(str, vs[i].str)) == 0)
|
||||
return vs[i].val;
|
||||
}
|
||||
|
||||
if (sigaction(sig, &act, NULL) < 0) {
|
||||
psignal(sig, "unable to register handler");
|
||||
return;
|
||||
}
|
||||
return vs[i].val;
|
||||
}
|
||||
|
||||
/* print_valstr - print value string list to log or stdout
|
||||
*
|
||||
* @vs: value string list to print
|
||||
* @title: name of this value string list
|
||||
* @loglevel: what log level to print, -1 for stdout
|
||||
*/
|
||||
void
|
||||
print_valstr(const struct valstr * vs, const char * title, int loglevel)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (vs == NULL)
|
||||
return;
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
|
||||
if (loglevel < 0) {
|
||||
printf(" VALUE\tHEX\tSTRING\n");
|
||||
printf("==============================================\n");
|
||||
} else {
|
||||
lprintf(loglevel, " VAL\tHEX\tSTRING");
|
||||
lprintf(loglevel, "==============================================");
|
||||
}
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (loglevel < 0) {
|
||||
if (vs[i].val < 256)
|
||||
printf(" %d\t0x%02x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
|
||||
else
|
||||
printf(" %d\t0x%04x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
|
||||
} else {
|
||||
if (vs[i].val < 256)
|
||||
lprintf(loglevel, " %d\t0x%02x\t%s", vs[i].val, vs[i].val, vs[i].str);
|
||||
else
|
||||
lprintf(loglevel, " %d\t0x%04x\t%s", vs[i].val, vs[i].val, vs[i].str);
|
||||
}
|
||||
}
|
||||
|
||||
if (loglevel < 0)
|
||||
printf("\n");
|
||||
else
|
||||
lprintf(loglevel, "");
|
||||
}
|
||||
|
||||
/* print_valstr_2col - print value string list in two columns to log or stdout
|
||||
*
|
||||
* @vs: value string list to print
|
||||
* @title: name of this value string list
|
||||
* @loglevel: what log level to print, -1 for stdout
|
||||
*/
|
||||
void
|
||||
print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (vs == NULL)
|
||||
return;
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (vs[i+1].str == NULL) {
|
||||
/* last one */
|
||||
if (loglevel < 0) {
|
||||
printf(" %4d %-32s\n", vs[i].val, vs[i].str);
|
||||
} else {
|
||||
lprintf(loglevel, " %4d %-32s\n", vs[i].val, vs[i].str);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (loglevel < 0) {
|
||||
printf(" %4d %-32s %4d %-32s\n",
|
||||
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
|
||||
} else {
|
||||
lprintf(loglevel, " %4d %-32s %4d %-32s\n",
|
||||
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (loglevel < 0)
|
||||
printf("\n");
|
||||
else
|
||||
lprintf(loglevel, "");
|
||||
}
|
||||
|
||||
/* ipmi_csum - calculate an ipmi checksum
|
||||
*
|
||||
* @d: buffer to check
|
||||
* @s: position in buffer to start checksum from
|
||||
*/
|
||||
uint8_t
|
||||
ipmi_csum(uint8_t * d, int s)
|
||||
{
|
||||
uint8_t c = 0;
|
||||
for (; s > 0; s--, d++)
|
||||
c += *d;
|
||||
return -c;
|
||||
}
|
||||
|
||||
/* ipmi_open_file - safely open a file for reading or writing
|
||||
*
|
||||
* @file: filename
|
||||
* @rw: read-write flag, 1=write
|
||||
*
|
||||
* returns pointer to file handler on success
|
||||
* returns NULL on error
|
||||
*/
|
||||
FILE *
|
||||
ipmi_open_file(const char * file, int rw)
|
||||
{
|
||||
struct stat st1, st2;
|
||||
FILE * fp;
|
||||
|
||||
/* verify existance */
|
||||
if (lstat(file, &st1) < 0) {
|
||||
if (rw) {
|
||||
/* does not exist, ok to create */
|
||||
fp = fopen(file, "w");
|
||||
if (fp == NULL) {
|
||||
lperror(LOG_ERR, "Unable to open file %s "
|
||||
"for write", file);
|
||||
return NULL;
|
||||
}
|
||||
/* created ok, now return the descriptor */
|
||||
return fp;
|
||||
} else {
|
||||
lprintf(LOG_ERR, "File %s does not exist", file);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_FILE_SECURITY
|
||||
if (!rw) {
|
||||
/* on read skip the extra checks */
|
||||
fp = fopen(file, "r");
|
||||
if (fp == NULL) {
|
||||
lperror(LOG_ERR, "Unable to open file %s", file);
|
||||
return NULL;
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* it exists - only regular files, not links */
|
||||
if (S_ISREG(st1.st_mode) == 0) {
|
||||
lprintf(LOG_ERR, "File %s has invalid mode: %d",
|
||||
file, st1.st_mode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* allow only files with 1 link (itself) */
|
||||
if (st1.st_nlink != 1) {
|
||||
lprintf(LOG_ERR, "File %s has invalid link count: %d != 1",
|
||||
file, (int)st1.st_nlink);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fp = fopen(file, rw ? "w+" : "r");
|
||||
if (fp == NULL) {
|
||||
lperror(LOG_ERR, "Unable to open file %s", file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* stat again */
|
||||
if (fstat(fileno(fp), &st2) < 0) {
|
||||
lperror(LOG_ERR, "Unable to stat file %s", file);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* verify inode */
|
||||
if (st1.st_ino != st2.st_ino) {
|
||||
lprintf(LOG_ERR, "File %s has invalid inode: %d != %d",
|
||||
file, st1.st_ino, st2.st_ino);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* verify owner */
|
||||
if (st1.st_uid != st2.st_uid) {
|
||||
lprintf(LOG_ERR, "File %s has invalid user id: %d != %d",
|
||||
file, st1.st_uid, st2.st_uid);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* verify inode */
|
||||
if (st2.st_nlink != 1) {
|
||||
lprintf(LOG_ERR, "File %s has invalid link count: %d != 1",
|
||||
file, st2.st_nlink);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return fp;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_start_daemon(void)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd;
|
||||
#ifdef SIGHUP
|
||||
sigset_t sighup;
|
||||
#endif
|
||||
|
||||
/* if we are started from init no need to become daemon */
|
||||
if (getppid() == 1)
|
||||
return;
|
||||
|
||||
#ifdef SIGHUP
|
||||
sigemptyset(&sighup);
|
||||
sigaddset(&sighup, SIGHUP);
|
||||
if (sigprocmask(SIG_UNBLOCK, &sighup, NULL) < 0)
|
||||
fprintf(stderr, "ERROR: could not unblock SIGHUP signal\n");
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGTTOU
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGTTIN
|
||||
signal(SIGTTIN, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
signal(SIGQUIT, SIG_IGN);
|
||||
#endif
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, SIG_IGN);
|
||||
#endif
|
||||
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
exit(0);
|
||||
|
||||
#if defined(SIGTSTP) && defined(TIOCNOTTY)
|
||||
if (setpgid(0, getpid()) == -1)
|
||||
exit(1);
|
||||
if ((fd = open(_PATH_TTY, O_RDWR)) >= 0) {
|
||||
ioctl(fd, TIOCNOTTY, NULL);
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
if (setpgrp() == -1)
|
||||
exit(1);
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
exit(0);
|
||||
#endif
|
||||
|
||||
chdir("/");
|
||||
umask(0);
|
||||
|
||||
for (fd=0; fd<64; fd++)
|
||||
close(fd);
|
||||
|
||||
open("/dev/null", O_RDWR);
|
||||
dup(0);
|
||||
dup(0);
|
||||
}
|
||||
|
||||
|
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_bmc.h>
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_bmc_reset(struct ipmi_intf * intf, int cmd)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp) {
|
||||
printf("Error in BMC Reset Command\n");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode) {
|
||||
printf("BMC Reset Command returned %x\n", rsp->ccode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ipmi_bmc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc || !strncmp(argv[0], "help", 4)) {
|
||||
printf("BMC Commands: reset\n");
|
||||
return 0;
|
||||
}
|
||||
else if (!strncmp(argv[0], "reset", 5)) {
|
||||
if (argc < 2 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("reset commands: warm, cold\n");
|
||||
}
|
||||
else if (!strncmp(argv[1], "cold", 4)) {
|
||||
ipmi_bmc_reset(intf, BMC_COLD_RESET);
|
||||
}
|
||||
else if (!strncmp(argv[1], "warm", 4)) {
|
||||
ipmi_bmc_reset(intf, BMC_WARM_RESET);
|
||||
}
|
||||
else {
|
||||
printf("reset commands: warm, cold\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
861
ipmitool/lib/ipmi_channel.c
Normal file
861
ipmitool/lib/ipmi_channel.c
Normal file
@ -0,0 +1,861 @@
|
||||
/* -*-mode: C; indent-tabs-mode: t; -*-
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi_lanp.h>
|
||||
#include <ipmitool/ipmi_channel.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
|
||||
extern int csv_output;
|
||||
extern int verbose;
|
||||
|
||||
void printf_channel_usage (void);
|
||||
|
||||
/**
|
||||
* ipmi_1_5_authtypes
|
||||
*
|
||||
* Create a string describing the supported authentication types as
|
||||
* specificed by the parameter n
|
||||
*/
|
||||
static const char *
|
||||
ipmi_1_5_authtypes(uint8_t n)
|
||||
{
|
||||
uint32_t i;
|
||||
static char supportedTypes[128];
|
||||
|
||||
bzero(supportedTypes, 128);
|
||||
|
||||
for (i = 0; ipmi_authtype_vals[i].val != 0; i++) {
|
||||
if (n & ipmi_authtype_vals[i].val) {
|
||||
strcat(supportedTypes, ipmi_authtype_vals[i].str);
|
||||
strcat(supportedTypes, " ");
|
||||
}
|
||||
}
|
||||
|
||||
return supportedTypes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ipmi_get_channel_auth_cap
|
||||
*
|
||||
* return 0 on success
|
||||
* -1 on failure
|
||||
*/
|
||||
int
|
||||
ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
uint8_t channel,
|
||||
uint8_t priv)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct get_channel_auth_cap_rsp auth_cap;
|
||||
uint8_t msg_data[2];
|
||||
|
||||
msg_data[0] = channel | 0x80; // Ask for IPMI v2 data as well
|
||||
msg_data[1] = priv;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; // 0x06
|
||||
req.msg.cmd = IPMI_GET_CHANNEL_AUTH_CAP; // 0x38
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if ((rsp == NULL) || (rsp->ccode > 0)) {
|
||||
/*
|
||||
* It's very possible that this failed because we asked for IPMI v2 data
|
||||
* Ask again, without requesting IPMI v2 data
|
||||
*/
|
||||
msg_data[0] &= 0x7F;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Authentication Capabilities");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Authentication Capabilities failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&auth_cap, rsp->data, sizeof(struct get_channel_auth_cap_rsp));
|
||||
|
||||
printf("Channel number : %d\n",
|
||||
auth_cap.channel_number);
|
||||
printf("IPMI v1.5 auth types : %s\n",
|
||||
ipmi_1_5_authtypes(auth_cap.enabled_auth_types));
|
||||
|
||||
if (auth_cap.v20_data_available)
|
||||
printf("KG status : %s\n",
|
||||
(auth_cap.kg_status) ? "non-zero" : "default (all zeroes)");
|
||||
|
||||
printf("Per message authentication : %sabled\n",
|
||||
(auth_cap.per_message_auth) ? "en" : "dis");
|
||||
printf("User level authentication : %sabled\n",
|
||||
(auth_cap.user_level_auth) ? "en" : "dis");
|
||||
|
||||
printf("Non-null user names exist : %s\n",
|
||||
(auth_cap.non_null_usernames) ? "yes" : "no");
|
||||
printf("Null user names exist : %s\n",
|
||||
(auth_cap.null_usernames) ? "yes" : "no");
|
||||
printf("Anonymous login enabled : %s\n",
|
||||
(auth_cap.anon_login_enabled) ? "yes" : "no");
|
||||
|
||||
if (auth_cap.v20_data_available) {
|
||||
printf("Channel supports IPMI v1.5 : %s\n",
|
||||
(auth_cap.ipmiv15_support) ? "yes" : "no");
|
||||
printf("Channel supports IPMI v2.0 : %s\n",
|
||||
(auth_cap.ipmiv20_support) ? "yes" : "no");
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is support for an OEM authentication type, there is some
|
||||
* information.
|
||||
*/
|
||||
if (auth_cap.enabled_auth_types & IPMI_1_5_AUTH_TYPE_BIT_OEM) {
|
||||
printf("IANA Number for OEM : %d\n",
|
||||
auth_cap.oem_id[0] |
|
||||
auth_cap.oem_id[1] << 8 |
|
||||
auth_cap.oem_id[2] << 16);
|
||||
printf("OEM Auxiliary Data : 0x%x\n",
|
||||
auth_cap.oem_aux_data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ipmi_get_channel_info
|
||||
*
|
||||
* returns 0 on success
|
||||
* -1 on failure
|
||||
*
|
||||
*/
|
||||
int
|
||||
ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[2];
|
||||
uint8_t medium;
|
||||
struct get_channel_info_rsp channel_info;
|
||||
struct get_channel_access_rsp channel_access;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; // 0x06
|
||||
req.msg.cmd = IPMI_GET_CHANNEL_INFO; // 0x42
|
||||
req.msg.data = &channel;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Info");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Info failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&channel_info, rsp->data, sizeof(struct get_channel_info_rsp));
|
||||
|
||||
printf("Channel 0x%x info:\n", channel_info.channel_number);
|
||||
|
||||
printf(" Channel Medium Type : %s\n",
|
||||
val2str(channel_info.channel_medium, ipmi_channel_medium_vals));
|
||||
|
||||
printf(" Channel Protocol Type : %s\n",
|
||||
val2str(channel_info.channel_protocol, ipmi_channel_protocol_vals));
|
||||
|
||||
printf(" Session Support : ");
|
||||
switch (channel_info.session_support) {
|
||||
case 0x0:
|
||||
printf("session-less\n");
|
||||
break;
|
||||
case 0x1:
|
||||
printf("single-session\n");
|
||||
break;
|
||||
case 0x2:
|
||||
printf("multi-session\n");
|
||||
break;
|
||||
case 0x3:
|
||||
default:
|
||||
printf("session-based\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" Active Session Count : %d\n",
|
||||
channel_info.active_sessions);
|
||||
|
||||
printf(" Protocol Vendor ID : %d\n",
|
||||
channel_info.vendor_id[0] |
|
||||
channel_info.vendor_id[1] << 8 |
|
||||
channel_info.vendor_id[2] << 16);
|
||||
|
||||
|
||||
/* only proceed if this is LAN channel */
|
||||
medium = ipmi_get_channel_medium(intf, channel);
|
||||
if (medium != IPMI_CHANNEL_MEDIUM_LAN &&
|
||||
medium != IPMI_CHANNEL_MEDIUM_LAN_OTHER) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
rqdata[0] = channel & 0xf;
|
||||
|
||||
/* get volatile settings */
|
||||
|
||||
rqdata[1] = 0x80; /* 0x80=active */
|
||||
req.msg.netfn = IPMI_NETFN_APP; // 0x06
|
||||
req.msg.cmd = IPMI_GET_CHANNEL_ACCESS; // 0x41
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Access (volatile)");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Access (volatile) failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&channel_access, rsp->data, sizeof(struct get_channel_access_rsp));
|
||||
|
||||
|
||||
printf(" Volatile(active) Settings\n");
|
||||
printf(" Alerting : %sabled\n",
|
||||
(channel_access.alerting) ? "dis" : "en");
|
||||
printf(" Per-message Auth : %sabled\n",
|
||||
(channel_access.per_message_auth) ? "dis" : "en");
|
||||
printf(" User Level Auth : %sabled\n",
|
||||
(channel_access.user_level_auth) ? "dis" : "en");
|
||||
|
||||
printf(" Access Mode : ");
|
||||
switch (channel_access.access_mode) {
|
||||
case 0:
|
||||
printf("disabled\n");
|
||||
break;
|
||||
case 1:
|
||||
printf("pre-boot only\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("always available\n");
|
||||
break;
|
||||
case 3:
|
||||
printf("shared\n");
|
||||
break;
|
||||
default:
|
||||
printf("unknown\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* get non-volatile settings */
|
||||
|
||||
rqdata[1] = 0x40; /* 0x40=non-volatile */
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Access (non-volatile)");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Access (non-volatile) failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&channel_access, rsp->data, sizeof(struct get_channel_access_rsp));
|
||||
|
||||
printf(" Non-Volatile Settings\n");
|
||||
printf(" Alerting : %sabled\n",
|
||||
(channel_access.alerting) ? "dis" : "en");
|
||||
printf(" Per-message Auth : %sabled\n",
|
||||
(channel_access.per_message_auth) ? "dis" : "en");
|
||||
printf(" User Level Auth : %sabled\n",
|
||||
(channel_access.user_level_auth) ? "dis" : "en");
|
||||
|
||||
printf(" Access Mode : ");
|
||||
switch (channel_access.access_mode) {
|
||||
case 0:
|
||||
printf("disabled\n");
|
||||
break;
|
||||
case 1:
|
||||
printf("pre-boot only\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("always available\n");
|
||||
break;
|
||||
case 3:
|
||||
printf("shared\n");
|
||||
break;
|
||||
default:
|
||||
printf("unknown\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_get_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req1, req2;
|
||||
uint8_t rqdata[2];
|
||||
struct get_user_access_rsp user_access;
|
||||
int curr_uid, max_uid = 0, init = 1;
|
||||
|
||||
curr_uid = userid ? : 1;
|
||||
|
||||
memset(&req1, 0, sizeof(req1));
|
||||
req1.msg.netfn = IPMI_NETFN_APP;
|
||||
req1.msg.cmd = IPMI_GET_USER_ACCESS;
|
||||
req1.msg.data = rqdata;
|
||||
req1.msg.data_len = 2;
|
||||
|
||||
memset(&req2, 0, sizeof(req2));
|
||||
req2.msg.netfn = IPMI_NETFN_APP;
|
||||
req2.msg.cmd = IPMI_GET_USER_NAME;
|
||||
req2.msg.data = rqdata;
|
||||
req2.msg.data_len = 1;
|
||||
|
||||
do
|
||||
{
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = curr_uid & 0x3f;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req1);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get User Access (channel %d id %d)",
|
||||
rqdata[0], rqdata[1]);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get User Access (channel %d id %d) failed: %s",
|
||||
rqdata[0], rqdata[1],
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&user_access, rsp->data, sizeof(struct get_user_access_rsp));
|
||||
|
||||
rqdata[0] = curr_uid & 0x3f;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req2);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get User Name (id %d)", rqdata[0]);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get User Name (id %d) failed: %s",
|
||||
rqdata[0], val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (init) {
|
||||
printf("Maximum User IDs : %d\n", user_access.max_user_ids);
|
||||
printf("Enabled User IDs : %d\n", user_access.enabled_user_ids);
|
||||
max_uid = user_access.max_user_ids;
|
||||
init = 0;
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
printf("User ID : %d\n", curr_uid);
|
||||
printf("User Name : %s\n", rsp->data);
|
||||
printf("Fixed Name : %s\n",
|
||||
(curr_uid <= user_access.fixed_user_ids) ? "Yes" : "No");
|
||||
printf("Access Available : %s\n",
|
||||
(user_access.callin_callback) ? "callback" : "call-in / callback");
|
||||
printf("Link Authentication : %sabled\n",
|
||||
(user_access.link_auth) ? "en" : "dis");
|
||||
printf("IPMI Messaging : %sabled\n",
|
||||
(user_access.ipmi_messaging) ? "en" : "dis");
|
||||
printf("Privilege Level : %s\n",
|
||||
val2str(user_access.privilege_limit, ipmi_privlvl_vals));
|
||||
|
||||
curr_uid ++;
|
||||
|
||||
} while (!userid && curr_uid <= max_uid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
uint8_t channel, userid;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[2];
|
||||
struct get_user_access_rsp user_access;
|
||||
struct set_user_access_data set_access;
|
||||
int i;
|
||||
|
||||
if ((argc < 3) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
printf_channel_usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
channel = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
userid = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_GET_USER_ACCESS;
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = userid & 0x3f;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get User Access (channel %d id %d)",
|
||||
rqdata[0], rqdata[1]);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get User Access (channel %d id %d) failed: %s",
|
||||
rqdata[0], rqdata[1],
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&user_access, rsp->data, sizeof(struct get_user_access_rsp));
|
||||
|
||||
memset(&set_access, 0, sizeof(set_access));
|
||||
set_access.change_bits = 1;
|
||||
set_access.callin_callback = user_access.callin_callback;
|
||||
set_access.link_auth = user_access.link_auth;
|
||||
set_access.ipmi_messaging = user_access.ipmi_messaging;
|
||||
set_access.channel = channel;
|
||||
set_access.user_id = userid;
|
||||
set_access.privilege_limit = user_access.privilege_limit;
|
||||
set_access.session_limit = 0;
|
||||
|
||||
for (i = 2; i < argc; i ++)
|
||||
{
|
||||
if (strncmp(argv[i], "callin=", 7) == 0) {
|
||||
set_access.callin_callback = !(strncmp (argv[i]+7, "off", 3));
|
||||
}
|
||||
else if (strncmp(argv[i], "link=", 5) == 0) {
|
||||
set_access.link_auth = strncmp (argv[i]+5, "off", 3);
|
||||
}
|
||||
else if (strncmp(argv[i], "ipmi=", 5) == 0) {
|
||||
set_access.ipmi_messaging = strncmp (argv[i]+5, "off", 3);
|
||||
}
|
||||
else if (strncmp(argv[i], "privilege=", 10) == 0) {
|
||||
set_access.privilege_limit = strtol (argv[i]+10, NULL, 0);
|
||||
}
|
||||
else {
|
||||
printf ("Invalid option: %s\n", argv [i]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_SET_USER_ACCESS;
|
||||
req.msg.data = (uint8_t *) &set_access;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Set User Access (channel %d id %d)",
|
||||
set_access.channel, set_access.user_id);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set User Access (channel %d id %d) failed: %s",
|
||||
set_access.channel, set_access.user_id,
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
iana_string(uint32_t iana)
|
||||
{
|
||||
static char s[10];
|
||||
|
||||
if (iana)
|
||||
{
|
||||
sprintf(s, "%06x", iana);
|
||||
return s;
|
||||
}
|
||||
else
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
|
||||
const char * payload_type,
|
||||
uint8_t channel)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
uint8_t oem_record;
|
||||
uint8_t rqdata[3];
|
||||
uint32_t iana;
|
||||
uint8_t auth_alg, integrity_alg, crypt_alg;
|
||||
uint8_t cipher_suite_id;
|
||||
uint8_t list_index = 0;
|
||||
uint8_t cipher_suite_data[1024]; // 0x40 sets * 16 bytes per set
|
||||
uint16_t offset = 0;
|
||||
uint16_t cipher_suite_data_length = 0; // how much was returned, total
|
||||
|
||||
memset(cipher_suite_data, 0, sizeof(cipher_suite_data));
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; // 0x06
|
||||
req.msg.cmd = IPMI_GET_CHANNEL_CIPHER_SUITES; // 0x54
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rqdata[0] = channel;
|
||||
rqdata[1] = ((strncmp(payload_type, "ipmi", 4) == 0)? 0: 1);
|
||||
rqdata[2] = 0x80; // Always ask for cipher suite format
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// Grab the returned channel number once. We assume it's the same
|
||||
// in future calls.
|
||||
if (rsp->data_len >= 1)
|
||||
channel = rsp->data[0];
|
||||
|
||||
|
||||
while ((rsp->data_len > 1) && (list_index < 0x3F))
|
||||
{
|
||||
//
|
||||
// We got back cipher suite data -- store it.
|
||||
//
|
||||
//printf("copying data to offset %d\n", offset);
|
||||
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
|
||||
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
|
||||
offset += rsp->data_len - 1;
|
||||
|
||||
//
|
||||
// Increment our list for the next call
|
||||
//
|
||||
++list_index;
|
||||
rqdata[2] = (rqdata[2] & 0x80) + list_index;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// We can chomp on all our data now.
|
||||
//
|
||||
cipher_suite_data_length = offset;
|
||||
offset = 0;
|
||||
|
||||
if (! csv_output)
|
||||
printf("ID IANA Auth Alg Integrity Alg Confidentiality Alg\n");
|
||||
|
||||
while (offset < cipher_suite_data_length)
|
||||
{
|
||||
if (cipher_suite_data[offset++] == 0xC0)
|
||||
{
|
||||
oem_record = 0; // standard type
|
||||
iana = 0;
|
||||
|
||||
// Verify that we have at least a full record left
|
||||
if ((cipher_suite_data_length - offset) < 4) // id + 3 algs
|
||||
{
|
||||
lprintf(LOG_ERR, "Incomplete data record in cipher suite data");
|
||||
return -1;
|
||||
}
|
||||
|
||||
cipher_suite_id = cipher_suite_data[offset++];
|
||||
|
||||
}
|
||||
else if (cipher_suite_data[offset++] == 0xC1)
|
||||
{
|
||||
oem_record = 1; // OEM record type
|
||||
|
||||
// Verify that we have at least a full record left
|
||||
if ((cipher_suite_data_length - offset) < 4) // id + iana + 3 algs
|
||||
{
|
||||
lprintf(LOG_ERR, "Incomplete data record in cipher suite data");
|
||||
return -1;
|
||||
}
|
||||
|
||||
cipher_suite_id = cipher_suite_data[offset++];
|
||||
|
||||
//
|
||||
// Grab the IANA
|
||||
//
|
||||
iana =
|
||||
cipher_suite_data[offset] |
|
||||
(cipher_suite_data[offset + 1] << 8) |
|
||||
(cipher_suite_data[offset + 2] << 16);
|
||||
offset += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Bad start of record byte in cipher suite data");
|
||||
return -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Grab the algorithms for this cipher suite. I guess we can't be
|
||||
// sure of what order they'll come in. Also, I suppose we default
|
||||
// to the NONE algorithm if one were absent. This part of the spec is
|
||||
// poorly written -- I have read the errata document. For now, I'm only
|
||||
// allowing one algorithm per type (auth, integrity, crypt) because I
|
||||
// don't I understand how it could be otherwise.
|
||||
//
|
||||
auth_alg = IPMI_AUTH_RAKP_NONE;
|
||||
integrity_alg = IPMI_INTEGRITY_NONE;
|
||||
crypt_alg = IPMI_CRYPT_NONE;
|
||||
|
||||
while (((cipher_suite_data[offset] & 0xC0) != 0xC0) &&
|
||||
((cipher_suite_data_length - offset) > 0))
|
||||
{
|
||||
switch (cipher_suite_data[offset] & 0xC0)
|
||||
{
|
||||
case 0x00:
|
||||
// Authentication algorithm specifier
|
||||
auth_alg = cipher_suite_data[offset++] & 0x3F;
|
||||
break;
|
||||
case 0x40:
|
||||
// Interity algorithm specifier
|
||||
integrity_alg = cipher_suite_data[offset++] & 0x3F;
|
||||
break;
|
||||
case 0x80:
|
||||
// Confidentiality algorithm specifier
|
||||
crypt_alg = cipher_suite_data[offset++] & 0x3F;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// We have everything we need to spit out a cipher suite record
|
||||
//
|
||||
printf((csv_output? "%d,%s,%s,%s,%s\n" :
|
||||
"%-4d %-7s %-15s %-15s %-15s\n"),
|
||||
cipher_suite_id,
|
||||
iana_string(iana),
|
||||
val2str(auth_alg, ipmi_auth_algorithms),
|
||||
val2str(integrity_alg, ipmi_integrity_algorithms),
|
||||
val2str(crypt_alg, ipmi_encryption_algorithms));
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t
|
||||
ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct get_channel_info_rsp info;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_GET_CHANNEL_INFO;
|
||||
req.msg.data = &channel;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get Channel Info command failed");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
if (rsp->ccode == 0xcc)
|
||||
return IPMI_CHANNEL_MEDIUM_RESERVED;
|
||||
lprintf(LOG_INFO, "Get Channel Info command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return IPMI_CHANNEL_MEDIUM_RESERVED;
|
||||
}
|
||||
|
||||
memcpy(&info, rsp->data, sizeof(struct get_channel_info_rsp));
|
||||
|
||||
lprintf(LOG_DEBUG, "Channel type: %s",
|
||||
val2str(info.channel_medium, ipmi_channel_medium_vals));
|
||||
|
||||
return info.channel_medium;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
ipmi_current_channel_medium(struct ipmi_intf * intf)
|
||||
{
|
||||
return ipmi_get_channel_medium(intf, 0xE);
|
||||
}
|
||||
|
||||
void
|
||||
printf_channel_usage()
|
||||
{
|
||||
lprintf(LOG_NOTICE, "Channel Commands: authcap <channel number> <max privilege>");
|
||||
lprintf(LOG_NOTICE, " getaccess <channel number> [user id]");
|
||||
lprintf(LOG_NOTICE, " setaccess <channel number> "
|
||||
"<user id> [callin=on|off] [ipmi=on|off] [link=on|off] [privilege=level]");
|
||||
lprintf(LOG_NOTICE, " info [channel number]");
|
||||
lprintf(LOG_NOTICE, " getciphers <ipmi | sol> [channel]\n");
|
||||
lprintf(LOG_NOTICE, "Possible privilege levels are:");
|
||||
lprintf(LOG_NOTICE, " 1 Callback level");
|
||||
lprintf(LOG_NOTICE, " 2 User level");
|
||||
lprintf(LOG_NOTICE, " 3 Operator level");
|
||||
lprintf(LOG_NOTICE, " 4 Administrator level");
|
||||
lprintf(LOG_NOTICE, " 5 OEM Proprietary level");
|
||||
lprintf(LOG_NOTICE, " 15 No access");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0))
|
||||
{
|
||||
printf_channel_usage();
|
||||
}
|
||||
else if (strncmp(argv[0], "authcap", 7) == 0)
|
||||
{
|
||||
if (argc != 3)
|
||||
printf_channel_usage();
|
||||
else
|
||||
retval = ipmi_get_channel_auth_cap(intf,
|
||||
(uint8_t)strtol(argv[1], NULL, 0),
|
||||
(uint8_t)strtol(argv[2], NULL, 0));
|
||||
}
|
||||
else if (strncmp(argv[0], "getaccess", 10) == 0)
|
||||
{
|
||||
if ((argc < 2) || (argc > 3))
|
||||
printf_channel_usage();
|
||||
else {
|
||||
uint8_t ch = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
uint8_t id = 0;
|
||||
if (argc == 3)
|
||||
id = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
retval = ipmi_get_user_access(intf, ch, id);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "setaccess", 9) == 0)
|
||||
{
|
||||
retval = ipmi_set_user_access(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (strncmp(argv[0], "info", 4) == 0)
|
||||
{
|
||||
if (argc > 2)
|
||||
printf_channel_usage();
|
||||
else {
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 2)
|
||||
ch = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
retval = ipmi_get_channel_info(intf, ch);
|
||||
}
|
||||
}
|
||||
|
||||
// it channel getciphers <ipmi | sol> [channel]
|
||||
else if (strncmp(argv[0], "getciphers", 10) == 0)
|
||||
{
|
||||
if ((argc < 2) || (argc > 3) ||
|
||||
(strncmp(argv[1], "ipmi", 4) && strncmp(argv[1], "sol", 3)))
|
||||
printf_channel_usage();
|
||||
else
|
||||
{
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 4)
|
||||
ch = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
retval = ipmi_get_channel_cipher_suites(intf,
|
||||
argv[1], // ipmi | sol
|
||||
ch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Invalid CHANNEL command: %s\n", argv[0]);
|
||||
printf_channel_usage();
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -28,10 +28,6 @@
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -40,11 +36,15 @@
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_chassis.h>
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
int
|
||||
ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -55,28 +55,36 @@ static int ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("error in Chassis Status Command\n");
|
||||
return 0;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to get Chassis Power Status");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power Status failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Power is %s\n", (rsp->data[0] & 0x1) ? "on" : "off");
|
||||
|
||||
return rsp->data[0] & 0x1;
|
||||
return rsp->data[0] & 1;
|
||||
}
|
||||
|
||||
static const struct valstr ipmi_chassis_power_control_vals[] = {
|
||||
{ 0x00, "Down/Off" },
|
||||
{ 0x01, "Up/On" },
|
||||
{ 0x02, "Cycle" },
|
||||
{ 0x03, "Reset" },
|
||||
{ 0x04, "Pulse" },
|
||||
{ 0x05, "Soft" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
static void ipmi_chassis_power_control(struct ipmi_intf * intf, unsigned char ctl)
|
||||
static int
|
||||
ipmi_chassis_print_power_status(struct ipmi_intf * intf)
|
||||
{
|
||||
int ps = ipmi_chassis_power_status(intf);
|
||||
|
||||
if (ps < 0)
|
||||
return -1;
|
||||
|
||||
printf("Chassis Power is %s\n", ps ? "on" : "off");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -85,62 +93,128 @@ static void ipmi_chassis_power_control(struct ipmi_intf * intf, unsigned char ct
|
||||
req.msg.data = &ctl;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to set Chassis Power Control to %s",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Power Control to %s failed: %s",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals),
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Power Control: %s\n",
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
|
||||
intf->sendrecv(intf, &req);
|
||||
#if 0 /* this can cause sessions to hang around after power commands */
|
||||
/* sessions often get lost when changing chassis power */
|
||||
intf->abort = 1;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
static int
|
||||
ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
|
||||
struct {
|
||||
uint8_t interval;
|
||||
uint8_t force_on;
|
||||
} identify_data;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x4;
|
||||
|
||||
printf("Chassis identify interval: ");
|
||||
|
||||
if (arg) {
|
||||
unsigned char interval = (unsigned char)atoi(arg);
|
||||
|
||||
req.msg.data = &interval;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
if (interval)
|
||||
printf("%d seconds\n", interval);
|
||||
else
|
||||
printf("off\n");
|
||||
} else {
|
||||
printf("default (15 seconds)\n");
|
||||
if (arg != NULL) {
|
||||
if (strncmp(arg, "force", 5) == 0) {
|
||||
identify_data.interval = 0;
|
||||
identify_data.force_on = 1;
|
||||
} else {
|
||||
identify_data.interval = (uint8_t)atoi(arg);
|
||||
identify_data.force_on = 0;
|
||||
}
|
||||
req.msg.data = (uint8_t *)&identify_data;
|
||||
/* The Force Identify On byte is optional and not
|
||||
* supported by all devices-- if force is not specified,
|
||||
* we pass only one data byte; if specified, we pass two
|
||||
* data bytes and check for an error completion code
|
||||
*/
|
||||
req.msg.data_len = (identify_data.force_on) ? 2 : 1;
|
||||
}
|
||||
|
||||
intf->sendrecv(intf, &req);
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to set Chassis Identify");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Identify failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
if (identify_data.force_on != 0) {
|
||||
/* Intel SE7501WV2 F/W 1.2 returns CC 0xC7, but
|
||||
* the IPMI v1.5 spec does not standardize a CC
|
||||
* if unsupported, so we warn
|
||||
*/
|
||||
lprintf(LOG_WARNING, "Chassis may not support Force Identify On\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis identify interval: ");
|
||||
if (arg == NULL) {
|
||||
printf("default (15 seconds)\n");
|
||||
} else {
|
||||
if (identify_data.force_on != 0) {
|
||||
printf("indefinate\n");
|
||||
} else {
|
||||
if (identify_data.interval == 0)
|
||||
printf("off\n");
|
||||
else
|
||||
printf("%i seconds\n", identify_data.interval);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
static int
|
||||
ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned long count;
|
||||
uint32_t count;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0xf;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to get Chassis Power-On-Hours");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power-On-Hours failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&count, rsp->data+1, 4);
|
||||
|
||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||
count, (unsigned long)(count / 24), (unsigned long)(count % 24));
|
||||
(long)count, (long)(count / 24), (long)(count % 24));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
static int
|
||||
ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -150,9 +224,15 @@ static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
req.msg.cmd = 0x7;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to get Chassis Restart Cause");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Restart Cause failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("System restart cause: ");
|
||||
|
||||
@ -188,11 +268,14 @@ static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
printf("power-cycle via PEF\n");
|
||||
break;
|
||||
default:
|
||||
printf("error!\n");
|
||||
printf("invalid\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
static int
|
||||
ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -202,8 +285,15 @@ static void ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
req.msg.cmd = 0x1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error sending Chassis Status command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error sending Chassis Status command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* byte 1 */
|
||||
printf("System Power : %s\n", (rsp->data[0] & 0x1) ? "on" : "off");
|
||||
@ -246,13 +336,101 @@ static void ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
printf("Front-Panel Lockout : %s\n", (rsp->data[2] & 0x2) ? "active" : "inactive");
|
||||
printf("Drive Fault : %s\n", (rsp->data[2] & 0x4) ? "true" : "false");
|
||||
printf("Cooling/Fan Fault : %s\n", (rsp->data[2] & 0x8) ? "true" : "false");
|
||||
|
||||
if (rsp->data_len > 3) {
|
||||
/* optional byte 4 */
|
||||
if (rsp->data[3] == 0) {
|
||||
printf("Front Panel Control : none\n");
|
||||
} else {
|
||||
printf("Sleep Button Disable : %s\n", (rsp->data[3] & 0x80) ? "allowed" : "not allowed");
|
||||
printf("Diag Button Disable : %s\n", (rsp->data[3] & 0x40) ? "allowed" : "not allowed");
|
||||
printf("Reset Button Disable : %s\n", (rsp->data[3] & 0x20) ? "allowed" : "not allowed");
|
||||
printf("Power Button Disable : %s\n", (rsp->data[3] & 0x10) ? "allowed" : "not allowed");
|
||||
printf("Sleep Button Disabled: %s\n", (rsp->data[3] & 0x80) ? "true" : "false");
|
||||
printf("Diag Button Disabled : %s\n", (rsp->data[3] & 0x40) ? "true" : "false");
|
||||
printf("Reset Button Disabled: %s\n", (rsp->data[3] & 0x20) ? "true" : "false");
|
||||
printf("Power Button Disabled: %s\n", (rsp->data[3] & 0x10) ? "true" : "false");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_set_bootparam(struct ipmi_intf * intf, unsigned char param, unsigned char * data, int len)
|
||||
|
||||
static int
|
||||
ipmi_chassis_selftest(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char msg_data[16];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error sending Get Self Test command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error sending Get Self Test command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Self Test Results : ");
|
||||
switch (rsp->data[0]) {
|
||||
case 0x55:
|
||||
printf("passed\n");
|
||||
break;
|
||||
|
||||
case 0x56:
|
||||
printf("not implemented\n");
|
||||
break;
|
||||
|
||||
case 0x57:
|
||||
{
|
||||
int i;
|
||||
const struct valstr broken_dev_vals[] = {
|
||||
{ 0, "firmware corrupted" },
|
||||
{ 1, "boot block corrupted" },
|
||||
{ 2, "FRU Internal Use Area corrupted" },
|
||||
{ 3, "SDR Repository empty" },
|
||||
{ 4, "IPMB not responding" },
|
||||
{ 5, "cannot access BMC FRU" },
|
||||
{ 6, "cannot access SDR Repository" },
|
||||
{ 7, "cannot access SEL Device" },
|
||||
{ 0xff, NULL },
|
||||
};
|
||||
printf("device error\n");
|
||||
for (i=0; i<8; i++) {
|
||||
if (rsp->data[1] & (1<<i)) {
|
||||
printf(" [%s]\n",
|
||||
val2str(i, broken_dev_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x58:
|
||||
printf("Fatal hardware error: %02xh\n", rsp->data[1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Device-specific failure %02xh:%02xh\n",
|
||||
rsp->data[0], rsp->data[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * data, int len)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[16];
|
||||
|
||||
memset(msg_data, 0, 16);
|
||||
msg_data[0] = param & 0x7f;
|
||||
@ -265,26 +443,33 @@ static void ipmi_chassis_set_bootparam(struct ipmi_intf * intf, unsigned char pa
|
||||
req.msg.data_len = len + 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode) {
|
||||
printf("Error setting Chassis Boot Parameter %d\n", param);
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error setting Chassis Boot Parameter %d", param);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Set Boot Param %d to %s\n", param, data);
|
||||
lprintf(LOG_DEBUG, "Chassis Set Boot Parameter %d to %s", param, buf2str(data, len));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
static int
|
||||
ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char msg_data[3];
|
||||
uint8_t msg_data[3];
|
||||
|
||||
if (!arg)
|
||||
return;
|
||||
if (arg == NULL)
|
||||
return -1;
|
||||
|
||||
memset(msg_data, 0, 3);
|
||||
|
||||
msg_data[0] = (unsigned char)atoi(arg) & 0x7f;
|
||||
msg_data[0] = (uint8_t)atoi(arg) & 0x7f;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
|
||||
@ -295,8 +480,15 @@ static void ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error Getting Chassis Boot Parameter %s", arg);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Boot Parameter %s failed: %s",
|
||||
arg, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "Boot Option");
|
||||
@ -305,52 +497,71 @@ static void ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_set_bootflag(struct ipmi_intf * intf, char * arg)
|
||||
static int
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
|
||||
{
|
||||
unsigned char flags[5];
|
||||
uint8_t flags[5];
|
||||
int rc = 0;
|
||||
|
||||
if (!arg) {
|
||||
printf("Error: no bootflag argument supplied\n");
|
||||
return;
|
||||
}
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
flags[1] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf, 4, flags, 2);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (!strncmp(arg, "force_pxe", 9)) {
|
||||
flags[1] = 0x04; // 00000100
|
||||
}
|
||||
else if (!strncmp(arg, "force_disk", 10)) {
|
||||
flags[1] = 0x08; // 00001000
|
||||
}
|
||||
else if (!strncmp(arg, "force_diag", 10)) {
|
||||
flags[1] = 0x10; // 00010000
|
||||
}
|
||||
else if (!strncmp(arg, "force_cdrom", 11)) {
|
||||
flags[1] = 0x14; // 00010100
|
||||
}
|
||||
else if (!strncmp(arg, "force_floppy", 12)) {
|
||||
flags[1] = 0x3c; // 00111100
|
||||
}
|
||||
memset(flags, 0, 5);
|
||||
if (arg == NULL)
|
||||
flags[1] = 0x00;
|
||||
else if (strncmp(arg, "none", 4) == 0)
|
||||
flags[1] = 0x00;
|
||||
else if (strncmp(arg, "pxe", 3) == 0 ||
|
||||
strncmp(arg, "force_pxe", 9) == 0)
|
||||
flags[1] = 0x04;
|
||||
else if (strncmp(arg, "disk", 4) == 0 ||
|
||||
strncmp(arg, "force_disk", 10) == 0)
|
||||
flags[1] = 0x08;
|
||||
else if (strncmp(arg, "safe", 4) == 0 ||
|
||||
strncmp(arg, "force_safe", 10) == 0)
|
||||
flags[1] = 0x0c;
|
||||
else if (strncmp(arg, "diag", 4) == 0 ||
|
||||
strncmp(arg, "force_diag", 10) == 0)
|
||||
flags[1] = 0x10;
|
||||
else if (strncmp(arg, "cdrom", 5) == 0 ||
|
||||
strncmp(arg, "force_cdrom", 11) == 0)
|
||||
flags[1] = 0x14;
|
||||
else if (strncmp(arg, "floppy", 6) == 0 ||
|
||||
strncmp(arg, "force_floppy", 12) == 0)
|
||||
flags[1] = 0x3c;
|
||||
else if (strncmp(arg, "bios", 4) == 0 ||
|
||||
strncmp(arg, "force_bios", 10) == 0)
|
||||
flags[1] = 0x18;
|
||||
else {
|
||||
printf("Invalid bootflag: %s\n", arg);
|
||||
return;
|
||||
lprintf(LOG_ERR, "Invalid argument: %s", arg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
flags[0] = 0x80; /* set flag valid bit */
|
||||
ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
if (clearcmos)
|
||||
flags[1] |= 0x80;
|
||||
|
||||
flags[0] = 0x08; /* don't automatically clear boot flag valid bit in 60 seconds */
|
||||
ipmi_chassis_set_bootparam(intf, 3, flags, 1);
|
||||
/* set flag valid bit */
|
||||
flags[0] = 0x80;
|
||||
rc = ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
if (rc == 0)
|
||||
printf("Set Boot Device to %s\n", arg);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void ipmi_chassis_power_policy(struct ipmi_intf * intf, unsigned char policy)
|
||||
static int
|
||||
ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
if (!policy)
|
||||
return;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x6;
|
||||
@ -358,8 +569,15 @@ static void ipmi_chassis_power_policy(struct ipmi_intf * intf, unsigned char pol
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp || rsp->ccode)
|
||||
return;
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Power Restore Policy command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Power Restore Policy command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (policy == IPMI_CHASSIS_POLICY_NO_CHANGE) {
|
||||
printf("Supported chassis power policy: ");
|
||||
@ -387,120 +605,187 @@ static void ipmi_chassis_power_policy(struct ipmi_intf * intf, unsigned char pol
|
||||
printf("unknown\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
int
|
||||
ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (!argc || !strncmp(argv[0], "help", 4)) {
|
||||
printf("Chassis Commands: status, power, identify, policy, restart_cause, poh\n");
|
||||
int rc = 0;
|
||||
uint8_t ctl = 0;
|
||||
|
||||
if ((argc < 1) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
|
||||
return 0;
|
||||
}
|
||||
else if (!strncmp(argv[0], "status", 6)) {
|
||||
ipmi_chassis_status(intf);
|
||||
if (strncmp(argv[0], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_print_power_status(intf);
|
||||
return rc;
|
||||
}
|
||||
if ((strncmp(argv[0], "up", 2) == 0) || (strncmp(argv[0], "on", 2) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_UP;
|
||||
else if ((strncmp(argv[0], "down", 4) == 0) || (strncmp(argv[0], "off", 3) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
|
||||
else if (strncmp(argv[0], "cycle", 5) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
|
||||
else if (strncmp(argv[0], "reset", 5) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
|
||||
else if (strncmp(argv[0], "diag", 4) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
|
||||
else if ((strncmp(argv[0], "acpi", 4) == 0) || (strncmp(argv[0], "soft", 4) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
else if (!strncmp(argv[0], "power", 5)) {
|
||||
unsigned char ctl = 0;
|
||||
|
||||
if (argc < 2 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis power Commands: status, on, off, cycle, reset, diag, soft\n");
|
||||
rc = ipmi_chassis_power_control(intf, ctl);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, selftest");
|
||||
}
|
||||
else if (strncmp(argv[0], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_status(intf);
|
||||
}
|
||||
else if (strncmp(argv[0], "selftest", 8) == 0) {
|
||||
rc = ipmi_chassis_selftest(intf);
|
||||
}
|
||||
else if (strncmp(argv[0], "power", 5) == 0) {
|
||||
uint8_t ctl = 0;
|
||||
|
||||
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
|
||||
return 0;
|
||||
}
|
||||
if (!strncmp(argv[1], "status", 6)) {
|
||||
ipmi_chassis_power_status(intf);
|
||||
return 0;
|
||||
if (strncmp(argv[1], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_print_power_status(intf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (!strncmp(argv[1], "up", 2) || !strncmp(argv[1], "on", 2))
|
||||
if ((strncmp(argv[1], "up", 2) == 0) || (strncmp(argv[1], "on", 2) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_UP;
|
||||
else if (!strncmp(argv[1], "down", 4) || !strncmp(argv[1], "off", 3))
|
||||
else if ((strncmp(argv[1], "down", 4) == 0) || (strncmp(argv[1], "off", 3) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
|
||||
else if (!strncmp(argv[1], "cycle", 5))
|
||||
else if (strncmp(argv[1], "cycle", 5) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
|
||||
else if (!strncmp(argv[1], "reset", 5))
|
||||
else if (strncmp(argv[1], "reset", 5) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
|
||||
else if (!strncmp(argv[1], "diag", 5))
|
||||
else if (strncmp(argv[1], "diag", 4) == 0)
|
||||
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
|
||||
else if (!strncmp (argv[1], "acpi", 4) || !strncmp(argv[1], "soft", 4))
|
||||
else if ((strncmp(argv[1], "acpi", 4) == 0) || (strncmp(argv[1], "soft", 4) == 0))
|
||||
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
|
||||
else {
|
||||
printf("Invalid chassis power command: %s\n", argv[1]);
|
||||
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipmi_chassis_power_control(intf, ctl);
|
||||
rc = ipmi_chassis_power_control(intf, ctl);
|
||||
}
|
||||
else if (!strncmp(argv[0], "identify", 8)) {
|
||||
else if (strncmp(argv[0], "identify", 8) == 0) {
|
||||
if (argc < 2) {
|
||||
ipmi_chassis_identify(intf, NULL);
|
||||
rc = ipmi_chassis_identify(intf, NULL);
|
||||
}
|
||||
else if (!strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis identify <interval>\n");
|
||||
printf(" default is 15 seconds\n");
|
||||
printf(" 0 to turn off\n");
|
||||
else if (strncmp(argv[1], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "chassis identify <interval>");
|
||||
lprintf(LOG_NOTICE, " default is 15 seconds");
|
||||
lprintf(LOG_NOTICE, " 0 to turn off");
|
||||
lprintf(LOG_NOTICE, " force to turn on indefinitely");
|
||||
} else {
|
||||
ipmi_chassis_identify(intf, argv[1]);
|
||||
rc = ipmi_chassis_identify(intf, argv[1]);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "poh", 3)) {
|
||||
ipmi_chassis_poh(intf);
|
||||
else if (strncmp(argv[0], "poh", 3) == 0) {
|
||||
rc = ipmi_chassis_poh(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "restart_cause", 13)) {
|
||||
ipmi_chassis_restart_cause(intf);
|
||||
else if (strncmp(argv[0], "restart_cause", 13) == 0) {
|
||||
rc = ipmi_chassis_restart_cause(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "policy", 4)) {
|
||||
if (argc < 2 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("chassis policy <state>\n");
|
||||
printf(" list : return supported policies\n");
|
||||
printf(" always-on : turn on when power is restored\n");
|
||||
printf(" previous : return to previous state when power is restored\n");
|
||||
printf(" always-off : stay off after power is restored\n");
|
||||
else if (strncmp(argv[0], "policy", 4) == 0) {
|
||||
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "chassis policy <state>");
|
||||
lprintf(LOG_NOTICE, " list : return supported policies");
|
||||
lprintf(LOG_NOTICE, " always-on : turn on when power is restored");
|
||||
lprintf(LOG_NOTICE, " previous : return to previous state when power is restored");
|
||||
lprintf(LOG_NOTICE, " always-off : stay off after power is restored");
|
||||
} else {
|
||||
unsigned char ctl;
|
||||
|
||||
if (!strncmp(argv[1], "list", 4))
|
||||
uint8_t ctl;
|
||||
if (strncmp(argv[1], "list", 4) == 0)
|
||||
ctl = IPMI_CHASSIS_POLICY_NO_CHANGE;
|
||||
else if (!strncmp(argv[1], "always-on", 9))
|
||||
else if (strncmp(argv[1], "always-on", 9) == 0)
|
||||
ctl = IPMI_CHASSIS_POLICY_ALWAYS_ON;
|
||||
else if (!strncmp(argv[1], "previous", 8))
|
||||
else if (strncmp(argv[1], "previous", 8) == 0)
|
||||
ctl = IPMI_CHASSIS_POLICY_PREVIOUS;
|
||||
else if (!strncmp(argv[1], "always-off", 10))
|
||||
else if (strncmp(argv[1], "always-off", 10) == 0)
|
||||
ctl = IPMI_CHASSIS_POLICY_ALWAYS_OFF;
|
||||
else {
|
||||
printf("invalid chassis policy: %s\n", argv[1]);
|
||||
lprintf(LOG_ERR, "Invalid chassis policy: %s", argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipmi_chassis_power_policy(intf, ctl);
|
||||
rc = ipmi_chassis_power_policy(intf, ctl);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[0], "bootparam", 7)) {
|
||||
if (argc < 3 || !strncmp(argv[1], "help", 4)) {
|
||||
printf("bootparam get|set <option> [value ...]\n");
|
||||
else if (strncmp(argv[0], "bootparam", 9) == 0) {
|
||||
if ((argc < 3) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "bootparam get <param #>");
|
||||
lprintf(LOG_NOTICE, "bootparam set bootflag <flag>");
|
||||
lprintf(LOG_NOTICE, " force_pxe : Force PXE boot");
|
||||
lprintf(LOG_NOTICE, " force_disk : Force boot from default Hard-drive");
|
||||
lprintf(LOG_NOTICE, " force_safe : Force boot from default Hard-drive, request Safe Mode");
|
||||
lprintf(LOG_NOTICE, " force_diag : Force boot from Diagnostic Partition");
|
||||
lprintf(LOG_NOTICE, " force_cdrom : Force boot from CD/DVD");
|
||||
lprintf(LOG_NOTICE, " force_bios : Force boot into BIOS Setup");
|
||||
}
|
||||
else {
|
||||
if (!strncmp(argv[1], "get", 3)) {
|
||||
ipmi_chassis_get_bootparam(intf, argv[2]);
|
||||
if (strncmp(argv[1], "get", 3) == 0) {
|
||||
rc = ipmi_chassis_get_bootparam(intf, argv[2]);
|
||||
}
|
||||
else if (!strncmp(argv[1], "set", 3)) {
|
||||
else if (strncmp(argv[1], "set", 3) == 0) {
|
||||
if (argc < 4) {
|
||||
printf("bootparam set <option> [value ...]\n");
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
} else {
|
||||
if (!strncmp(argv[2], "bootflag", 8)) {
|
||||
ipmi_chassis_set_bootflag(intf, argv[3]);
|
||||
}
|
||||
else {
|
||||
printf("bootparam set <option> [value ...]\n");
|
||||
}
|
||||
if (strncmp(argv[2], "bootflag", 8) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], 0);
|
||||
else
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("bootparam get|set <option> [value]\n");
|
||||
else
|
||||
lprintf(LOG_NOTICE, "bootparam get|set <option> [value ...]");
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "bootdev", 7) == 0) {
|
||||
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
|
||||
lprintf(LOG_NOTICE, " none : Do not change boot device order");
|
||||
lprintf(LOG_NOTICE, " pxe : Force PXE boot");
|
||||
lprintf(LOG_NOTICE, " disk : Force boot from default Hard-drive");
|
||||
lprintf(LOG_NOTICE, " safe : Force boot from default Hard-drive, request Safe Mode");
|
||||
lprintf(LOG_NOTICE, " diag : Force boot from Diagnostic Partition");
|
||||
lprintf(LOG_NOTICE, " cdrom : Force boot from CD/DVD");
|
||||
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
|
||||
} else {
|
||||
if (argc < 3)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 1);
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
}
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Invalid Chassis command: %s\n", argv[0]);
|
||||
lprintf(LOG_ERR, "Invalid Chassis command: %s", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/ipmi.h>
|
||||
#include <ipmi.h>
|
||||
#include <ipmi_dev.h>
|
||||
#include <helper.h>
|
||||
|
||||
static int curr_seq;
|
||||
extern int verbose;
|
||||
|
||||
struct ipmi_intf ipmi_dev_intf = {
|
||||
.open = ipmi_dev_open,
|
||||
.close = ipmi_dev_close,
|
||||
.sendrecv = ipmi_dev_send_cmd,
|
||||
};
|
||||
|
||||
void ipmi_dev_close(struct ipmi_intf * intf)
|
||||
{
|
||||
if (intf && intf->fd >= 0)
|
||||
close(intf->fd);
|
||||
}
|
||||
|
||||
int ipmi_dev_open(struct ipmi_intf * intf, char * dev, int __unused1, char * __unused2)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (!dev)
|
||||
intf->fd = open("/dev/ipmi/0", O_RDWR);
|
||||
else
|
||||
intf->fd = open(dev, O_RDWR);
|
||||
|
||||
if (intf->fd < 0) {
|
||||
perror("Could not open ipmi device");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i)) {
|
||||
perror("Could not set to get events");
|
||||
return -1;
|
||||
}
|
||||
|
||||
curr_seq = 0;
|
||||
|
||||
return intf->fd;
|
||||
}
|
||||
|
||||
struct ipmi_rsp * ipmi_dev_send_cmd(struct ipmi_intf * intf, struct ipmi_req * req)
|
||||
{
|
||||
struct ipmi_recv recv;
|
||||
struct ipmi_addr addr;
|
||||
struct ipmi_system_interface_addr bmc_addr;
|
||||
static struct ipmi_rsp rsp;
|
||||
fd_set rset;
|
||||
|
||||
if (!req)
|
||||
return NULL;
|
||||
|
||||
if (verbose > 2)
|
||||
printbuf(req->msg.data, req->msg.data_len, "send_ipmi_cmd_dev");
|
||||
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(intf->fd, &rset);
|
||||
|
||||
bmc_addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
|
||||
bmc_addr.channel = IPMI_BMC_CHANNEL;
|
||||
bmc_addr.lun = 0;
|
||||
req->addr = (char *) &bmc_addr;
|
||||
req->addr_len = sizeof(bmc_addr);
|
||||
req->msgid = curr_seq++;
|
||||
|
||||
if (ioctl(intf->fd, IPMICTL_SEND_COMMAND, req) < 0) {
|
||||
printf("Error sending command: %s\n", strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
if (select(intf->fd+1, &rset, NULL, NULL, NULL) < 0) {
|
||||
perror("select");
|
||||
return NULL;
|
||||
}
|
||||
if (!FD_ISSET(intf->fd, &rset)) {
|
||||
printf("Error no data available\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
recv.addr = (char *) &addr;
|
||||
recv.addr_len = sizeof(addr);
|
||||
recv.msg.data = rsp.data;
|
||||
recv.msg.data_len = sizeof(rsp.data);
|
||||
|
||||
/* get data */
|
||||
if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) {
|
||||
printf("Error receiving message: %s\n", strerror(errno));
|
||||
if (errno != EMSGSIZE)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (verbose > 1) {
|
||||
printf("Got message:\n");
|
||||
printf(" type = %d\n", recv.recv_type);
|
||||
printf(" channel = 0x%x\n", addr.channel);
|
||||
printf(" msgid = %ld\n", recv.msgid);
|
||||
printf(" netfn = 0x%x\n", recv.msg.netfn);
|
||||
printf(" cmd = 0x%x\n", recv.msg.cmd);
|
||||
if (recv.msg.data && recv.msg.data_len) {
|
||||
printf(" data_len = %d\n", recv.msg.data_len);
|
||||
printf(" data =");
|
||||
printbuf(recv.msg.data, recv.msg.data_len, "data");
|
||||
}
|
||||
}
|
||||
|
||||
rsp.ccode = recv.msg.data[0];
|
||||
rsp.data_len = recv.msg.data_len - 1;
|
||||
|
||||
if (!rsp.ccode && rsp.data_len) {
|
||||
memmove(rsp.data, rsp.data + 1, rsp.data_len);
|
||||
rsp.data[recv.msg.data_len] = 0;
|
||||
}
|
||||
|
||||
return &rsp;
|
||||
}
|
||||
|
637
ipmitool/lib/ipmi_event.c
Normal file
637
ipmitool/lib/ipmi_event.c
Normal file
@ -0,0 +1,637 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_channel.h>
|
||||
#include <ipmitool/ipmi_event.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
|
||||
static void
|
||||
ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
|
||||
{
|
||||
struct sel_event_record sel_event;
|
||||
|
||||
memset(&sel_event, 0, sizeof(struct sel_event_record));
|
||||
|
||||
sel_event.record_id = 0;
|
||||
sel_event.sel_type.standard_type.gen_id = 2;
|
||||
|
||||
sel_event.sel_type.standard_type.evm_rev = pmsg->evm_rev;
|
||||
sel_event.sel_type.standard_type.sensor_type = pmsg->sensor_type;
|
||||
sel_event.sel_type.standard_type.sensor_num = pmsg->sensor_num;
|
||||
sel_event.sel_type.standard_type.event_type = pmsg->event_type;
|
||||
sel_event.sel_type.standard_type.event_dir = pmsg->event_dir;
|
||||
sel_event.sel_type.standard_type.event_data[0] = pmsg->event_data[0];
|
||||
sel_event.sel_type.standard_type.event_data[1] = pmsg->event_data[1];
|
||||
sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2];
|
||||
|
||||
if (verbose)
|
||||
ipmi_sel_print_extended_entry_verbose(intf, &sel_event);
|
||||
else
|
||||
ipmi_sel_print_extended_entry(intf, &sel_event);
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_send_platform_event(struct ipmi_intf * intf, struct platform_event_msg * emsg)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[8];
|
||||
uint8_t chmed;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
memset(rqdata, 0, 8);
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = 0x02;
|
||||
req.msg.data = rqdata;
|
||||
|
||||
chmed = ipmi_current_channel_medium(intf);
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
|
||||
/* system interface, need extra generator ID */
|
||||
req.msg.data_len = 8;
|
||||
rqdata[0] = 0x20;
|
||||
memcpy(rqdata+1, emsg, sizeof(struct platform_event_msg));
|
||||
}
|
||||
else {
|
||||
req.msg.data_len = 7;
|
||||
memcpy(rqdata, emsg, sizeof(struct platform_event_msg));
|
||||
}
|
||||
|
||||
ipmi_event_msg_print(intf, emsg);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Platform Event Message command failed");
|
||||
return -1;
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Platform Event Message command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define EVENT_THRESH_STATE_LNC_LO 0
|
||||
#define EVENT_THRESH_STATE_LNC_HI 1
|
||||
#define EVENT_THRESH_STATE_LCR_LO 2
|
||||
#define EVENT_THRESH_STATE_LCR_HI 3
|
||||
#define EVENT_THRESH_STATE_LNR_LO 4
|
||||
#define EVENT_THRESH_STATE_LNR_HI 5
|
||||
#define EVENT_THRESH_STATE_UNC_LO 6
|
||||
#define EVENT_THRESH_STATE_UNC_HI 7
|
||||
#define EVENT_THRESH_STATE_UCR_LO 8
|
||||
#define EVENT_THRESH_STATE_UCR_HI 9
|
||||
#define EVENT_THRESH_STATE_UNR_LO 10
|
||||
#define EVENT_THRESH_STATE_UNR_HI 11
|
||||
|
||||
static const struct valstr ipmi_event_thresh_lo[] = {
|
||||
{ EVENT_THRESH_STATE_LNC_LO, "lnc" },
|
||||
{ EVENT_THRESH_STATE_LCR_LO, "lcr" },
|
||||
{ EVENT_THRESH_STATE_LNR_LO, "lnr" },
|
||||
{ EVENT_THRESH_STATE_UNC_LO, "unc" },
|
||||
{ EVENT_THRESH_STATE_UCR_LO, "ucr" },
|
||||
{ EVENT_THRESH_STATE_UNR_LO, "unr" },
|
||||
{ 0, NULL },
|
||||
};
|
||||
static const struct valstr ipmi_event_thresh_hi[] = {
|
||||
{ EVENT_THRESH_STATE_LNC_HI, "lnc" },
|
||||
{ EVENT_THRESH_STATE_LCR_HI, "lcr" },
|
||||
{ EVENT_THRESH_STATE_LNR_HI, "lnr" },
|
||||
{ EVENT_THRESH_STATE_UNC_HI, "unc" },
|
||||
{ EVENT_THRESH_STATE_UCR_HI, "ucr" },
|
||||
{ EVENT_THRESH_STATE_UNR_HI, "unr" },
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
static int
|
||||
ipmi_send_platform_event_num(struct ipmi_intf * intf, int num)
|
||||
{
|
||||
struct platform_event_msg emsg;
|
||||
|
||||
memset(&emsg, 0, sizeof(struct platform_event_msg));
|
||||
|
||||
/* IPMB/LAN/etc */
|
||||
switch (num) {
|
||||
case 1: /* temperature */
|
||||
printf("Sending SAMPLE event: Temperature - "
|
||||
"Upper Critical - Going High\n");
|
||||
emsg.evm_rev = 0x04;
|
||||
emsg.sensor_type = 0x01;
|
||||
emsg.sensor_num = 0x30;
|
||||
emsg.event_dir = EVENT_DIR_ASSERT;
|
||||
emsg.event_type = 0x01;
|
||||
emsg.event_data[0] = EVENT_THRESH_STATE_UCR_HI;
|
||||
emsg.event_data[1] = 0xff;
|
||||
emsg.event_data[2] = 0xff;
|
||||
break;
|
||||
case 2: /* voltage error */
|
||||
printf("Sending SAMPLE event: Voltage Threshold - "
|
||||
"Lower Critical - Going Low\n");
|
||||
emsg.evm_rev = 0x04;
|
||||
emsg.sensor_type = 0x02;
|
||||
emsg.sensor_num = 0x60;
|
||||
emsg.event_dir = EVENT_DIR_ASSERT;
|
||||
emsg.event_type = 0x01;
|
||||
emsg.event_data[0] = EVENT_THRESH_STATE_LCR_LO;
|
||||
emsg.event_data[1] = 0xff;
|
||||
emsg.event_data[2] = 0xff;
|
||||
break;
|
||||
case 3: /* correctable ECC */
|
||||
printf("Sending SAMPLE event: Memory - Correctable ECC\n");
|
||||
emsg.evm_rev = 0x04;
|
||||
emsg.sensor_type = 0x0c;
|
||||
emsg.sensor_num = 0x53;
|
||||
emsg.event_dir = EVENT_DIR_ASSERT;
|
||||
emsg.event_type = 0x6f;
|
||||
emsg.event_data[0] = 0x00;
|
||||
emsg.event_data[1] = 0xff;
|
||||
emsg.event_data[2] = 0xff;
|
||||
break;
|
||||
default:
|
||||
lprintf(LOG_ERR, "Invalid event number: %d", num);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ipmi_send_platform_event(intf, &emsg);
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_event_find_offset(uint8_t code,
|
||||
struct ipmi_event_sensor_types * evt,
|
||||
char * desc)
|
||||
{
|
||||
if (desc == NULL || code == 0)
|
||||
return 0x00;
|
||||
|
||||
while (evt->type) {
|
||||
if (evt->code == code && evt->desc != NULL &&
|
||||
strncasecmp(desc, evt->desc, __maxlen(desc, evt->desc)) == 0)
|
||||
return evt->offset;
|
||||
evt++;
|
||||
}
|
||||
|
||||
lprintf(LOG_WARN, "Unable to find matching event offset for '%s'", desc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
print_sensor_states(uint8_t sensor_type, uint8_t event_type)
|
||||
{
|
||||
printf("Sensor States: \n ");
|
||||
ipmi_sdr_print_discrete_state_mini("\n ", sensor_type,
|
||||
event_type, 0xff, 0xff);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * evdir)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct sdr_record_list * sdr;
|
||||
struct platform_event_msg emsg;
|
||||
int off;
|
||||
|
||||
if (id == NULL) {
|
||||
lprintf(LOG_ERR, "No sensor ID supplied");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&emsg, 0, sizeof(struct platform_event_msg));
|
||||
emsg.evm_rev = 0x04;
|
||||
|
||||
if (evdir == NULL)
|
||||
emsg.event_dir = EVENT_DIR_ASSERT;
|
||||
else if (strncasecmp(evdir, "assert", 6) == 0)
|
||||
emsg.event_dir = EVENT_DIR_ASSERT;
|
||||
else if (strncasecmp(evdir, "deassert", 8) == 0)
|
||||
emsg.event_dir = EVENT_DIR_DEASSERT;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid event direction %s. Must be 'assert' or 'deassert'", evdir);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Finding sensor %s... ", id);
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, id);
|
||||
if (sdr == NULL) {
|
||||
printf("not found!\n");
|
||||
return -1;
|
||||
}
|
||||
printf("ok\n");
|
||||
|
||||
switch (sdr->type)
|
||||
{
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
|
||||
emsg.sensor_type = sdr->record.full->sensor.type;
|
||||
emsg.sensor_num = sdr->record.full->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.full->event_type;
|
||||
break;
|
||||
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
|
||||
emsg.sensor_type = sdr->record.compact->sensor.type;
|
||||
emsg.sensor_num = sdr->record.compact->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.compact->event_type;
|
||||
break;
|
||||
|
||||
default:
|
||||
lprintf(LOG_ERR, "Unknown sensor type for id '%s'", id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
emsg.event_data[1] = 0xff;
|
||||
emsg.event_data[2] = 0xff;
|
||||
|
||||
switch (emsg.event_type)
|
||||
{
|
||||
/*
|
||||
* Threshold Class
|
||||
*/
|
||||
case 1:
|
||||
{
|
||||
int dir = 0;
|
||||
int hilo = 0;
|
||||
off = 1;
|
||||
|
||||
if (state == NULL || strncasecmp(state, "list", 4) == 0) {
|
||||
printf("Sensor States:\n");
|
||||
printf(" lnr : Lower Non-Recoverable \n");
|
||||
printf(" lcr : Lower Critical\n");
|
||||
printf(" lnc : Lower Non-Critical\n");
|
||||
printf(" unc : Upper Non-Critical\n");
|
||||
printf(" ucr : Upper Critical\n");
|
||||
printf(" unr : Upper Non-Recoverable\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 != strncasecmp(state, "lnr", 3) &&
|
||||
0 != strncasecmp(state, "lcr", 3) &&
|
||||
0 != strncasecmp(state, "lnc", 3) &&
|
||||
0 != strncasecmp(state, "unc", 3) &&
|
||||
0 != strncasecmp(state, "ucr", 3) &&
|
||||
0 != strncasecmp(state, "unr", 3))
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid threshold identifier %s", state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (state[0] == 'u')
|
||||
hilo = 1;
|
||||
else
|
||||
hilo = 0;
|
||||
|
||||
if (emsg.event_dir == EVENT_DIR_ASSERT)
|
||||
dir = hilo;
|
||||
else
|
||||
dir = !hilo;
|
||||
|
||||
if ((emsg.event_dir == EVENT_DIR_ASSERT && hilo == 1) ||
|
||||
(emsg.event_dir == EVENT_DIR_DEASSERT && hilo == 0))
|
||||
emsg.event_data[0] = (uint8_t)(str2val(state, ipmi_event_thresh_hi) & 0xf);
|
||||
else if ((emsg.event_dir == EVENT_DIR_ASSERT && hilo == 0) ||
|
||||
(emsg.event_dir == EVENT_DIR_DEASSERT && hilo == 1))
|
||||
emsg.event_data[0] = (uint8_t)(str2val(state, ipmi_event_thresh_lo) & 0xf);
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid Event\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num);
|
||||
|
||||
if (rsp != NULL && rsp->ccode == 0) {
|
||||
|
||||
/* threshold reading */
|
||||
emsg.event_data[2] = rsp->data[(emsg.event_data[0] / 2) + 1];
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num);
|
||||
if (rsp != NULL && rsp->ccode == 0)
|
||||
off = dir ? rsp->data[0] : rsp->data[1];
|
||||
if (off <= 0)
|
||||
off = 1;
|
||||
|
||||
/* trigger reading */
|
||||
if (dir) {
|
||||
if ((emsg.event_data[2] + off) > 0xff)
|
||||
emsg.event_data[1] = 0xff;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] + off;
|
||||
}
|
||||
else {
|
||||
if ((emsg.event_data[2] - off) < 0)
|
||||
emsg.event_data[1] = 0;
|
||||
else
|
||||
emsg.event_data[1] = emsg.event_data[2] - off;
|
||||
}
|
||||
|
||||
/* trigger in byte 2, threshold in byte 3 */
|
||||
emsg.event_data[0] |= 0x50;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* Digital Discrete
|
||||
*/
|
||||
case 3: case 4: case 5: case 6: case 8: case 9:
|
||||
{
|
||||
int x;
|
||||
const char * digi_on[] = { "present", "assert", "limit",
|
||||
"fail", "yes", "on", "up" };
|
||||
const char * digi_off[] = { "absent", "deassert", "nolimit",
|
||||
"nofail", "no", "off", "down" };
|
||||
/*
|
||||
* print list of available states for this sensor
|
||||
*/
|
||||
if (state == NULL || strncasecmp(state, "list", 4) == 0) {
|
||||
print_sensor_states(emsg.sensor_type, emsg.event_type);
|
||||
printf("Sensor State Shortcuts:\n");
|
||||
for (x = 0; x < sizeof(digi_on)/sizeof(*digi_on); x++) {
|
||||
printf(" %-9s %-9s\n", digi_on[x], digi_off[x]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
off = 0;
|
||||
for (x = 0; x < sizeof(digi_on)/sizeof(*digi_on); x++) {
|
||||
if (strncasecmp(state, digi_on[x], strlen(digi_on[x])) == 0) {
|
||||
emsg.event_data[0] = 1;
|
||||
off = 1;
|
||||
break;
|
||||
}
|
||||
else if (strncasecmp(state, digi_off[x], strlen(digi_off[x])) == 0) {
|
||||
emsg.event_data[0] = 0;
|
||||
off = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (off == 0) {
|
||||
off = ipmi_event_find_offset(
|
||||
emsg.event_type, generic_event_types, state);
|
||||
if (off < 0)
|
||||
return -1;
|
||||
emsg.event_data[0] = off;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* Generic Discrete
|
||||
*/
|
||||
case 2: case 7: case 10: case 11: case 12:
|
||||
{
|
||||
/*
|
||||
* print list of available states for this sensor
|
||||
*/
|
||||
if (state == NULL || strncasecmp(state, "list", 4) == 0) {
|
||||
print_sensor_states(emsg.sensor_type, emsg.event_type);
|
||||
return 0;
|
||||
}
|
||||
off = ipmi_event_find_offset(
|
||||
emsg.event_type, generic_event_types, state);
|
||||
if (off < 0)
|
||||
return -1;
|
||||
emsg.event_data[0] = off;
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
* Sensor-Specific Discrete
|
||||
*/
|
||||
case 0x6f:
|
||||
{
|
||||
/*
|
||||
* print list of available states for this sensor
|
||||
*/
|
||||
if (state == NULL || strncasecmp(state, "list", 4) == 0) {
|
||||
print_sensor_states(emsg.sensor_type, emsg.event_type);
|
||||
return 0;
|
||||
}
|
||||
off = ipmi_event_find_offset(
|
||||
emsg.sensor_type, sensor_specific_types, state);
|
||||
if (off < 0)
|
||||
return -1;
|
||||
emsg.event_data[0] = off;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
return ipmi_send_platform_event(intf, &emsg);
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
{
|
||||
FILE * fp;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct sel_event_record sel_event;
|
||||
uint8_t rqdata[8];
|
||||
char buf[1024];
|
||||
char * ptr, * tok;
|
||||
int i, j;
|
||||
uint8_t chmed;
|
||||
int rc = 0;
|
||||
|
||||
if (file == NULL)
|
||||
return -1;
|
||||
|
||||
memset(rqdata, 0, 8);
|
||||
|
||||
/* setup Platform Event Message command */
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = 0x02;
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 7;
|
||||
|
||||
chmed = ipmi_current_channel_medium(intf);
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
|
||||
/* system interface, need extra generator ID */
|
||||
rqdata[0] = 0x20;
|
||||
req.msg.data_len = 8;
|
||||
}
|
||||
|
||||
fp = ipmi_open_file_read(file);
|
||||
if (fp == NULL)
|
||||
return -1;
|
||||
|
||||
while (feof(fp) == 0) {
|
||||
if (fgets(buf, 1024, fp) == NULL)
|
||||
continue;
|
||||
|
||||
/* clip off optional comment tail indicated by # */
|
||||
ptr = strchr(buf, '#');
|
||||
if (ptr)
|
||||
*ptr = '\0';
|
||||
else
|
||||
ptr = buf + strlen(buf);
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace(*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
|
||||
/* parse the event, 7 bytes with optional comment */
|
||||
/* 0x00 0x00 0x00 0x00 0x00 0x00 0x00 # event */
|
||||
i = 0;
|
||||
tok = strtok(ptr, " ");
|
||||
while (tok) {
|
||||
if (i == 7)
|
||||
break;
|
||||
j = i++;
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM)
|
||||
j++;
|
||||
rqdata[j] = (uint8_t)strtol(tok, NULL, 0);
|
||||
tok = strtok(NULL, " ");
|
||||
}
|
||||
if (i < 7) {
|
||||
lprintf(LOG_ERR, "Invalid Event: %s",
|
||||
buf2str(rqdata, sizeof(rqdata)));
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(&sel_event, 0, sizeof(struct sel_event_record));
|
||||
sel_event.record_id = 0;
|
||||
sel_event.sel_type.standard_type.gen_id = 2;
|
||||
|
||||
j = (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) ? 1 : 0;
|
||||
sel_event.sel_type.standard_type.evm_rev = rqdata[j++];
|
||||
sel_event.sel_type.standard_type.sensor_type = rqdata[j++];
|
||||
sel_event.sel_type.standard_type.sensor_num = rqdata[j++];
|
||||
sel_event.sel_type.standard_type.event_type = rqdata[j] & 0x7f;
|
||||
sel_event.sel_type.standard_type.event_dir = (rqdata[j++] & 0x80) >> 7;
|
||||
sel_event.sel_type.standard_type.event_data[0] = rqdata[j++];
|
||||
sel_event.sel_type.standard_type.event_data[1] = rqdata[j++];
|
||||
sel_event.sel_type.standard_type.event_data[2] = rqdata[j++];
|
||||
|
||||
ipmi_sel_print_std_entry(intf, &sel_event);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Platform Event Message command failed");
|
||||
rc = -1;
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Platform Event Message command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_event_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, "usage: event <num>");
|
||||
lprintf(LOG_NOTICE, " Send generic test events");
|
||||
lprintf(LOG_NOTICE, " 1 : Temperature - Upper Critical - Going High");
|
||||
lprintf(LOG_NOTICE, " 2 : Voltage Threshold - Lower Critical - Going Low");
|
||||
lprintf(LOG_NOTICE, " 3 : Memory - Correctable ECC");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, "usage: event file <filename>");
|
||||
lprintf(LOG_NOTICE, " Read and generate events from file");
|
||||
lprintf(LOG_NOTICE, " Use the 'sel save' command to generate from SEL");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, "usage: event <sensorid> <state> [event_dir]");
|
||||
lprintf(LOG_NOTICE, " sensorid : Sensor ID to use for event data");
|
||||
lprintf(LOG_NOTICE, " state : Sensor state, use 'list' to see possible states for sensor");
|
||||
lprintf(LOG_NOTICE, " event_dir : assert, deassert [default=assert]");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_event_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
|
||||
ipmi_event_usage();
|
||||
return 0;
|
||||
}
|
||||
if (strncmp(argv[0], "file", 4) == 0) {
|
||||
if (argc < 2) {
|
||||
ipmi_event_usage();
|
||||
return 0;
|
||||
}
|
||||
return ipmi_event_fromfile(intf, argv[1]);
|
||||
}
|
||||
if (strlen(argv[0]) == 1) {
|
||||
switch (argv[0][0]) {
|
||||
case '1': return ipmi_send_platform_event_num(intf, 1);
|
||||
case '2': return ipmi_send_platform_event_num(intf, 2);
|
||||
case '3': return ipmi_send_platform_event_num(intf, 3);
|
||||
}
|
||||
}
|
||||
if (argc < 2)
|
||||
rc = ipmi_event_fromsensor(intf, argv[0], NULL, NULL);
|
||||
else if (argc < 3)
|
||||
rc = ipmi_event_fromsensor(intf, argv[0], argv[1], NULL);
|
||||
else
|
||||
rc = ipmi_event_fromsensor(intf, argv[0], argv[1], argv[2]);
|
||||
|
||||
return rc;
|
||||
}
|
1136
ipmitool/lib/ipmi_firewall.c
Normal file
1136
ipmitool/lib/ipmi_firewall.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1492
ipmitool/lib/ipmi_fwum.c
Normal file
1492
ipmitool/lib/ipmi_fwum.c
Normal file
File diff suppressed because it is too large
Load Diff
191
ipmitool/lib/ipmi_isol.c
Normal file
191
ipmitool/lib/ipmi_isol.c
Normal file
@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_isol.h>
|
||||
|
||||
const struct valstr ipmi_isol_baud_vals[] = {
|
||||
{ ISOL_BAUD_RATE_9600, "9600" },
|
||||
{ ISOL_BAUD_RATE_19200, "19200" },
|
||||
{ ISOL_BAUD_RATE_38400, "38400" },
|
||||
{ ISOL_BAUD_RATE_57600, "57600" },
|
||||
{ ISOL_BAUD_RATE_115200, "115200" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_isol_setup(struct ipmi_intf * intf, char baudsetting)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
|
||||
/* TEST FOR AVAILABILITY */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
data[2] = ISOL_ENABLE_FLAG;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode == 0xc1) {
|
||||
lprintf(LOG_ERR, "IPMI v1.5 Serial Over Lan (ISOL) not supported!");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* GET ISOL CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
req.msg.cmd = GET_ISOL_CONFIG;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "ISOL Config");
|
||||
|
||||
/* SET ISOL CONFIG - AUTHENTICATION */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
data[2] = ISOL_PRIVILEGE_LEVEL_USER | (rsp->data[1] & 0x80);
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Authentication) Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Authentication) Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* SET ISOL CONFIG - BAUD RATE */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_BAUD_RATE_PARAM;
|
||||
data[2] = baudsetting;
|
||||
req.msg.cmd = SET_ISOL_CONFIG;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Baud Rate) Command");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error in Set ISOL Config (Baud Rate) Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Set ISOL Baud Rate to %s\n",
|
||||
val2str(baudsetting, ipmi_isol_baud_vals));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "ISOL Commands: setup <baud>");
|
||||
lprintf(LOG_NOTICE, "ISOL Baud Rates: 9600, 19200, 38400, 57600, 115200");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strncmp(argv[0], "setup", 5) == 0) {
|
||||
if (strncmp(argv[1], "9600", 4) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_9600);
|
||||
}
|
||||
else if (strncmp(argv[1], "19200", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_19200);
|
||||
}
|
||||
else if (strncmp(argv[1], "38400", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_38400);
|
||||
}
|
||||
else if (strncmp(argv[1], "57600", 5) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_57600);
|
||||
}
|
||||
else if (strncmp(argv[1], "115200", 6) == 0) {
|
||||
ret = ipmi_isol_setup(intf, ISOL_BAUD_RATE_115200);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "ISOL - Unsupported baud rate: %s", argv[1]);
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
587
ipmitool/lib/ipmi_kontronoem.c
Normal file
587
ipmitool/lib/ipmi_kontronoem.c
Normal file
@ -0,0 +1,587 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tue Mar 7 14:36:12 2006
|
||||
* <stephane.filion@ca.kontron.com>
|
||||
*
|
||||
* This code implements an Kontron OEM proprietary commands.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
|
||||
extern int verbose;
|
||||
extern int read_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
uint8_t id, uint32_t offset, uint32_t length,
|
||||
uint8_t *frubuf);
|
||||
extern int write_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
unsigned char id, unsigned int soffset,
|
||||
unsigned int doffset, unsigned int length,
|
||||
unsigned char *pFrubuf);
|
||||
|
||||
extern char * get_fru_area_str(uint8_t * data, uint32_t * offset);
|
||||
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void);
|
||||
static int ipmi_kontron_set_serial_number(struct ipmi_intf * intf);
|
||||
static int ipmi_kontron_set_mfg_date (struct ipmi_intf * intf);
|
||||
|
||||
|
||||
|
||||
int
|
||||
ipmi_kontronoem_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc == 0)
|
||||
ipmi_kontron_help();
|
||||
else if (strncmp(argv[0], "help", 4) == 0)
|
||||
ipmi_kontron_help();
|
||||
|
||||
else if(!strncmp(argv[0], "setsn", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_serial_number(intf) > 0)
|
||||
{
|
||||
printf("FRU serial number setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU serial number set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setsn\n");
|
||||
}
|
||||
}
|
||||
else if(!strncmp(argv[0], "setmfgdate", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_mfg_date(intf) > 0)
|
||||
{
|
||||
printf("FRU manufacturing date setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU manufacturing date set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setmfgdate\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
printf("Invalid Kontron command: %s", argv[0]);
|
||||
ipmi_kontron_help();
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void)
|
||||
{
|
||||
printf("Kontron Commands: setsn setmfgdate\n");
|
||||
}
|
||||
|
||||
/* ipmi_fru_set_serial_number - Set the Serial Number in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_serial_number(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
char *sn;
|
||||
uint8_t sn_size, checksum,prev_lun;
|
||||
int ret = 0;
|
||||
uint8_t *fru_data, *fru_area;
|
||||
uint32_t fru_data_offset, fru_data_offset_tmp, board_sec_len, prod_sec_len, i;
|
||||
|
||||
sn = NULL;
|
||||
fru_data = NULL;
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0C;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
|
||||
/* Set Lun, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return -11;
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" This option is not implemented for this board\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
sn_size = rsp->data_len;
|
||||
|
||||
sn = malloc(sn_size + 1);
|
||||
|
||||
if(sn == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(sn, 0, sn_size + 1);
|
||||
memcpy(sn, rsp->data, sn_size);
|
||||
|
||||
if(verbose >= 1)
|
||||
{
|
||||
printf("Original serial number is : [%s]\n", sn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
free(sn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Board Section */
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Board Manufacturer*/
|
||||
fru_data_offset = (header.offset.board * 8) + 6;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Board Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
printf("The length of the serial number in the FRU Board Area is wrong.\n");
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the board section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Product Section */
|
||||
prod_sec_len = (header.offset.multi * 8) - (header.offset.product * 8);
|
||||
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.product * 8) ,prod_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Product Manufacturer*/
|
||||
fru_data_offset = (header.offset.product * 8) + 3;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Part*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Version*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
printf("The length of the serial number in the FRU Product Area is wrong.\n");
|
||||
return(-1);
|
||||
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the product section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.product * 8); i < (((header.offset.product * 8)+prod_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.product * 8)+prod_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.product * 8), (header.offset.product * 8), prod_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
|
||||
return(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_fru_set_mfg_date - Set the Manufacturing Date in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_mfg_date (struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
uint8_t mfg_date[3];
|
||||
|
||||
uint32_t board_sec_len, i;
|
||||
uint8_t *fru_data, checksum;
|
||||
int ret = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0E;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* Set Lun temporary, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf("This option is not implemented for this board\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if(rsp->data_len != 3)
|
||||
{
|
||||
printf("Invalid response for the Manufacturing date\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(mfg_date, 0, 3);
|
||||
memcpy(mfg_date, rsp->data, 3);
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
lprintf("Out of memory!");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new manufacturing date in the board section saved in memory*/
|
||||
memcpy(fru_data + (header.offset.board * 8) + 3, mfg_date, 3);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
free(fru_data);
|
||||
return(1);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user