mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 10:13:35 +00:00
Compare commits
1026 Commits
IPMITOOL_S
...
ipmitool
Author | SHA1 | Date | |
---|---|---|---|
81b2750667 | |||
6a02cccb70 | |||
3d9c5ae746 | |||
49350157fe | |||
c6f6550f27 | |||
ad86adac54 | |||
f04ccaf79e | |||
fa74f3bf3a | |||
8e95964938 | |||
558bf55c41 | |||
393ae97425 | |||
ee6c9be382 | |||
5177966867 | |||
f6dbaf231b | |||
8cd3acb188 | |||
2c6ca03f8a | |||
aebc7d3616 | |||
157132be8c | |||
8525fdd2a3 | |||
f8cecaa71a | |||
a771107c47 | |||
afd015709b | |||
bfba2f83f5 | |||
8e94374cf1 | |||
ced5794e48 | |||
a298d2e704 | |||
2d71d428f3 | |||
2e5fbc878b | |||
8b7969a46f | |||
04ba23bc5d | |||
977c587fde | |||
dd377108ee | |||
4aea72e46f | |||
39bcb37d14 | |||
7770739372 | |||
2ac947f6e1 | |||
c94c7a5c86 | |||
4fdbe5bbd0 | |||
c49bc06c39 | |||
55524327ce | |||
85ff7dc46a | |||
8c5013b0ba | |||
ea8ce15131 | |||
6d89531096 | |||
e56e914866 | |||
cee8fc659a | |||
25fa0f80ae | |||
22e38bc46f | |||
3bd53a2f78 | |||
30e4efe8a4 | |||
bf8acad458 | |||
2db7f5f6b9 | |||
71dea69efc | |||
9f51d8f188 | |||
8a40297308 | |||
fb5d8559e6 | |||
2a260d32e9 | |||
94c0bd0a6c | |||
3cb937f15e | |||
edc700ed9a | |||
287b313e26 | |||
47d53000ce | |||
66399810f0 | |||
0ab78dbf02 | |||
c048c9f311 | |||
c32228d7c1 | |||
a855c37619 | |||
6a66405177 | |||
4a4331ef6d | |||
41288eb5e4 | |||
dbd2db71f2 | |||
a472c382f4 | |||
e8125c2405 | |||
c0f41fa647 | |||
5c74d2935e | |||
cd6b7039f0 | |||
b4cb02a4d9 | |||
91fdb17260 | |||
2302e83db5 | |||
b0294b96fd | |||
f1f2cbb18b | |||
eb65a625a2 | |||
516fe51505 | |||
5d5251f7da | |||
5819b314af | |||
630934cb89 | |||
d44be6e5f5 | |||
078ff3a04e | |||
865c435b4c | |||
1d9dd4e2de | |||
e95a4cf998 | |||
38f89a449d | |||
64e0b9ab64 | |||
e30f3726a6 | |||
63ba1cc610 | |||
384618d1bc | |||
b0020e0bae | |||
7a861ffba6 | |||
811da1307a | |||
8489426a63 | |||
dbe514a558 | |||
d5ab51f2cd | |||
0cea01e42f | |||
38d71179e9 | |||
cc48c433fd | |||
51dd9cf1f0 | |||
44247a8743 | |||
d82a29d813 | |||
c5324e879c | |||
a8f6341728 | |||
7472986e1c | |||
72dd3edde4 | |||
cf6740b3f6 | |||
14e26ac8a0 | |||
cee211da31 | |||
3818c0d296 | |||
ae05861b62 | |||
c29cf4bcd3 | |||
723e3da037 | |||
c72afa37ee | |||
fa5bdb2f3d | |||
49784a9ec8 | |||
d1d404fef4 | |||
de1dee44bd | |||
e1728327f6 | |||
3b77db9a86 | |||
2abad0e504 | |||
0411186443 | |||
1e96d20277 | |||
de4de4fc96 | |||
4299cfa385 | |||
184994586e | |||
692861f292 | |||
39408ea589 | |||
1602e0a7a2 | |||
f074f76620 | |||
87e6c7279d | |||
1f1dc806fe | |||
8afb3c315b | |||
4aae41904d | |||
41a44b037f | |||
49a7ceee70 | |||
3687a6cbb8 | |||
627cadaa39 | |||
eb63058bc3 | |||
15f1255237 | |||
2dfa02ba24 | |||
9d6a201911 | |||
ad01921281 | |||
d27d2f7ae3 | |||
26c17eeb91 | |||
fdbef84866 | |||
3a383608dd | |||
66fcf484a4 | |||
52c07d61f9 | |||
fd752420ec | |||
7a74ab32a8 | |||
3ea41bda4b | |||
992b42ceee | |||
002c8becf4 | |||
6f1bd51f1e | |||
4719d371b7 | |||
ba9a313911 | |||
4a9af33734 | |||
e320e266b1 | |||
95df7b2499 | |||
665f2f7ee9 | |||
e99e525a53 | |||
39ad0d62cc | |||
db56cc3f86 | |||
108dc8aa0b | |||
b6c97d8318 | |||
fd2ab0b7bb | |||
8c91abfa19 | |||
4c009309eb | |||
ed1865da0a | |||
c726a09482 | |||
a70de993cf | |||
c53a3cbb8e | |||
69e43dc87f | |||
5fa202f7d3 | |||
c070fc00d6 | |||
bd4f34b035 | |||
6e87e423eb | |||
37861d60e4 | |||
bd5ffa4756 | |||
c958de2870 | |||
86805c2146 | |||
c97d9d5b85 | |||
76ed820e03 | |||
091ba2ea58 | |||
3f53760062 | |||
83794843b5 | |||
4a12bdebd6 | |||
8a4139e1b8 | |||
15d683d86d | |||
6eda3b5482 | |||
6a82e95988 | |||
28f93df807 | |||
3f9b728e57 | |||
9a8a8b7dad | |||
75d6c72c5d | |||
8882955891 | |||
22b283b210 | |||
2bb3100395 | |||
5dbb6b69de | |||
791268a61c | |||
970c5ff8b6 | |||
4728863d5b | |||
a3d872c73d | |||
9b3000e329 | |||
bd851bab8f | |||
b4754b5edb | |||
99e4ac0399 | |||
6733b66a9c | |||
daf4c4831f | |||
d2d2f4789d | |||
cce3f84896 | |||
3018b229b1 | |||
fc62075b76 | |||
a5384fa12e | |||
7973f44304 | |||
8d9b434b5a | |||
5b90f68407 | |||
2edc474cef | |||
472d8ab1b3 | |||
4af83567b0 | |||
66bdb86f04 | |||
9ef6162f3c | |||
629a96d9c3 | |||
122e11a2e8 | |||
a974ab2c69 | |||
f8f6d51fd2 | |||
8d828f6c72 | |||
d54e20c545 | |||
44310bd898 | |||
a9f7a7b92e | |||
d65cccc32a | |||
131846fb40 | |||
c62359bd79 | |||
1e83f7c88a | |||
4a4b2e3b59 | |||
c88b139452 | |||
6011359cb3 | |||
23a5477d6e | |||
700ee7d27d | |||
2d725c2cd6 | |||
5c9addb8c4 | |||
c0290ef09a | |||
6c1e3e2ecc | |||
77d9e49290 | |||
0d62e6f6e0 | |||
f0f9e187c9 | |||
89037b5158 | |||
342e71d577 | |||
e196d85e43 | |||
7528b89b36 | |||
e07a644672 | |||
fbb778c469 | |||
fdc403302d | |||
3f712fe2fc | |||
3631bd877c | |||
0ef4c3e254 | |||
5d960089c9 | |||
31cb04f155 | |||
7289f70ec9 | |||
4b058899a2 | |||
79fdc68950 | |||
6a18254c9d | |||
2dfaeac27d | |||
aab226da28 | |||
180aaaabbf | |||
bf9406249a | |||
56828dbaf7 | |||
219f67e41a | |||
62df3e6ea8 | |||
f1fced7ec8 | |||
75a7ebf5c7 | |||
53df70235f | |||
8ed8ace59d | |||
c08bded0f3 | |||
90d40c6d7a | |||
7733416d2b | |||
5f11bb25b0 | |||
8de0428bdc | |||
f907245d39 | |||
fbd0c88ae6 | |||
373e4fe28d | |||
fdf1176fa0 | |||
062bd1f9a4 | |||
6e5043f289 | |||
83b34749c5 | |||
403c86e51c | |||
89759cbdec | |||
89243c2929 | |||
9d8aa74a54 | |||
ad4065a370 | |||
e230427138 | |||
4a462cd714 | |||
29d82210b4 | |||
adbdafb535 | |||
8a6343ff0d | |||
a1dcd5790a | |||
a2485a3b5e | |||
bb632de830 | |||
78d7ae8d88 | |||
904cbebce5 | |||
09fc12a929 | |||
2902784cf3 | |||
a9b78ab736 | |||
3d5e378e90 | |||
d4c2577a16 | |||
f681fe89b7 | |||
ca062647be | |||
3423c1d92f | |||
e0b75fba8c | |||
7dd969f2c6 | |||
a9c68c76c3 | |||
e29166e4e8 | |||
9217312cc4 | |||
fbf75dd075 | |||
bf1e9952e1 | |||
5ed7f6ac0a | |||
b6d2f7e302 | |||
bb40822d34 | |||
835fe8886c | |||
55ee48696a | |||
fedd6f187f | |||
a6cad674d0 | |||
c1e46b35cd | |||
a65d5add66 | |||
ba6f2fe2a2 | |||
ebab3919ef | |||
e6db6a04b5 | |||
fb75f8d8fc | |||
9660e90ad2 | |||
e0ed4351d0 | |||
619233e14b | |||
7c9baca424 | |||
c9b53b1b32 | |||
54cc84adf2 | |||
37d672412d | |||
1b1efca7e2 | |||
c9bd5b5b90 | |||
19295a5483 | |||
d06ddcd28b | |||
335d444213 | |||
0cbc38746a | |||
348cd98287 | |||
eb22beb537 | |||
019a9de626 | |||
c5c6315525 | |||
7fc4ce6eae | |||
061272f595 | |||
fab9a60f71 | |||
3e2211dc47 | |||
f798f74234 | |||
74e2376bf9 | |||
2f1773a819 | |||
9ab06ee09e | |||
94e47fb2c6 | |||
13bb060366 | |||
fdf49777b9 | |||
2a180f8038 | |||
799a0846c2 | |||
60b62d4f34 | |||
31bee2ebff | |||
5e0e128eb3 | |||
d9e5ff1878 | |||
9f52686526 | |||
801e6f1136 | |||
b97d1b74e2 | |||
c0e63cefbb | |||
cad476e5b1 | |||
fe43278196 | |||
c3b8410fcc | |||
58e82be3c4 | |||
cf63a9d593 | |||
5348236e65 | |||
c4ece9a1eb | |||
92cb687630 | |||
362bb42cf8 | |||
4b230f13d7 | |||
e1c25a988f | |||
2902422eeb | |||
ca0932532a | |||
ea105cd83b | |||
c098938a4b | |||
235f475e60 | |||
023a2797b8 | |||
050055e8f0 | |||
9a1a15d134 | |||
9b56a57890 | |||
ab48fc0f55 | |||
6878547f27 | |||
57dc49803e | |||
0762cdd324 | |||
cf3dd06818 | |||
0dfd0d494a | |||
e41a6aacb3 | |||
50c514e336 | |||
021728965c | |||
fae2b40020 | |||
b78f1194c9 | |||
3083c1dd7a | |||
6f0ecadabd | |||
ebb60eebee | |||
a3dd05510a | |||
ba83ecd7d3 | |||
b23f858ee3 | |||
fb0d4e7fc1 | |||
a0673a77b3 | |||
6d4fccf922 | |||
c30f036391 | |||
72d66edc6c | |||
8582569149 | |||
7cc935f2f1 | |||
461ade4994 | |||
09adafacd8 | |||
0ea2ba5f14 | |||
b5fb1221c1 | |||
92a2b12fe1 | |||
a9c626e67e | |||
9e1bf929c2 | |||
dece10b9d6 | |||
ebce6517f5 | |||
ccb0aba6b9 | |||
0f1e92a450 | |||
b1ffd29ee6 | |||
e2b72d82de | |||
756c22a866 | |||
1f0bbcd8dd | |||
afbec90dc2 | |||
96df77742c | |||
956b421ef8 | |||
e427ed4423 | |||
6c02a74a31 | |||
b16dc1bf5a | |||
3268e0d9c1 | |||
79ed9ec34e | |||
2579bbe542 | |||
1d927c8c45 | |||
37cb538e5a | |||
025f196aec | |||
928da786e5 | |||
10f4a1a5c5 | |||
ca90a4b48b | |||
c5d1894531 | |||
90244733b4 | |||
4787c3de81 | |||
8680d3dc4e | |||
be5db2df38 | |||
63eaecf469 | |||
b7ae2149e9 | |||
e807543023 | |||
a1684a2e0b | |||
e31ba93a23 | |||
653c9b20d5 | |||
e3abbf667a | |||
7924e052ca | |||
264b95cd21 | |||
f8b3d70c13 | |||
b1cef77bcf | |||
3b08cc6002 | |||
1593341ed7 | |||
35daac42a5 | |||
5b8255f671 | |||
abf77904a0 | |||
cceb1ff803 | |||
c81563434b | |||
185b23a5c4 | |||
6377070275 | |||
77740c39cc | |||
2acce3766c | |||
86eef09b2f | |||
09011bb590 | |||
03c5c6a639 | |||
52dc545d2e | |||
4ef4e3c298 | |||
b120e11c3d | |||
d09e279c79 | |||
1eda5611dd | |||
9689fe6199 | |||
34dd10feda | |||
c344f2ffe0 | |||
c23b875c8b | |||
d0155c3917 | |||
a2e7888156 | |||
a724a38c42 | |||
72831c6d22 | |||
1e8967b1f9 | |||
bf815d0093 | |||
c3aefda148 | |||
1c784e80ec | |||
2793990a94 | |||
1d3a7ff50a | |||
b3d5558a40 | |||
5cf45e711e | |||
3c94523f11 | |||
b3563716bd | |||
1aeaa97475 | |||
4dcfe6d6c8 | |||
3be848a82a | |||
513dabb395 | |||
6a269e5741 | |||
d9e561a4cf | |||
6e4a63bdfe | |||
8aad659697 | |||
c306d08d7e | |||
0b9f0d6a35 | |||
e6f0e459dd | |||
5e455132c1 | |||
107257210d | |||
a654ca2683 | |||
431421c6ff | |||
027fc1139c | |||
7e9cd85e8d | |||
e8ad5be7fb | |||
86c4e40277 | |||
b0c04f8577 | |||
8824e41b48 | |||
270a50c8c5 | |||
8df490955c | |||
de63f9a9d5 | |||
170c14560c | |||
d3badb58b2 | |||
db735bf685 | |||
7959b894b4 | |||
71a6dde3f8 | |||
8954fe454b | |||
56adf15b23 | |||
ab18a0e335 | |||
997ca1fa4d | |||
b06f6bdbb5 | |||
798228cb72 | |||
a022f1e792 | |||
a6e1840e4f | |||
86364dec74 | |||
61318c0158 | |||
14004d0749 | |||
ec9cddc21a | |||
cedb32d569 | |||
9a508d1f19 | |||
f6cb3516b3 | |||
fa7a690e26 | |||
5f018c9516 | |||
664848112e | |||
a703e41949 | |||
3938d15098 | |||
76bb61de6c | |||
0faade4b8a | |||
4e39200eff | |||
a4676f7b6e | |||
3b384a306f | |||
0fcf7acdba | |||
d04f496c7a | |||
a263209bb6 | |||
d824af51a9 | |||
e655394a7a | |||
07c3456330 | |||
80b8d3b318 | |||
ed84ac0a9b | |||
fa7d4b3ec7 | |||
f34245e46e | |||
f8bc5ae591 | |||
b3d5150acd | |||
2faf5857c8 | |||
f4a6a73184 | |||
94865441a1 | |||
32fbd909b2 | |||
568e75e147 | |||
2e7571daf2 | |||
c13966f04b | |||
56b892cea1 | |||
bec24b9019 | |||
45185b23ec | |||
ecca25ed2b | |||
eccd10200f | |||
0bad3feabd | |||
edb0ba9c6d | |||
c4a368edfb | |||
b136863199 | |||
628c3ca854 | |||
0a682dbedd | |||
b3dde472ce | |||
22f0fc7c00 | |||
6eaa2e8305 | |||
992b36bc0f | |||
6a68dc2e65 | |||
66958d8c52 | |||
333dc5bedc | |||
a62287c589 | |||
43a529bff0 | |||
cf96efd47d | |||
9cbe0938f1 | |||
7acd1310ec | |||
77b47d3751 | |||
9a4979ac62 | |||
9e4bbc2e65 | |||
8fc8e1a69a | |||
18b6d4cc08 | |||
a74e7d396a | |||
88af9d3652 | |||
968e97d905 | |||
459770d58c | |||
c28da79cab | |||
b548d3573b | |||
68afc1b001 | |||
c78911c730 | |||
6ac87eed90 | |||
9f66ac2cd3 | |||
3bd95062ba | |||
86a32205be | |||
583a5e7cd0 | |||
381783786a | |||
cea777a51d | |||
e3c97ddd3d | |||
e7f7209c32 | |||
5d21a9d8a8 | |||
74e028690b | |||
fda2c028fe | |||
19f9d13807 | |||
9fcde40c97 | |||
34b21d2d57 | |||
9e14d37835 | |||
981a24365f | |||
729bf0e7c3 | |||
db4a2e5951 | |||
ef20239926 | |||
e672819a9d | |||
f61c3acbaf | |||
eab4dfe679 | |||
89199b49f3 | |||
96dec6ddc7 | |||
153965aca2 | |||
4e79265a7c | |||
1c60cbf500 | |||
b82cfdf945 | |||
09a6e0e917 | |||
760de11c71 | |||
50f36dd841 | |||
0d6fecc737 | |||
ab58809b3b | |||
d572add750 | |||
fa21266ec2 | |||
f63189780f | |||
7849cc978f | |||
6013cec710 | |||
9f6133936d | |||
580f416693 | |||
c99e8595e4 | |||
a92765fbc9 | |||
cc63758d53 | |||
388b9e058d | |||
520aa05c07 | |||
533582e9e3 | |||
c3289bb6f4 | |||
b3d2bb937d | |||
070f36d1ae | |||
882d9ce81c | |||
d0e5434790 | |||
4ab522ab29 | |||
ce3636894d | |||
83a924d7ed | |||
28a7f2c14b | |||
10154ba9ce | |||
12a6554416 | |||
78f8f0793f | |||
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 |
@ -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.
|
||||
|
@ -1,3 +1,530 @@
|
||||
version 1.8.13 2013-09-09
|
||||
* ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
|
||||
* ID: 3577766 - configure's knobs and switches don't work
|
||||
* ID: 3611253 - do not override OS-default values for interfaces
|
||||
* ID: 65 - Fixes for configure.in for cross compilation
|
||||
* ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
|
||||
* numerous ipmitool man page updates
|
||||
* ID: 3611226 - Bridging support for PICMG Platforms
|
||||
* Add support for getsysinfo/setsysinfo commands to ipmi mc
|
||||
* Cleanup Dell OEM code to use new sysinfo interface
|
||||
* ID: 93 - str-to-int conversion is weak
|
||||
* ID: 3582307 - ipmi_fru - ipmi_fru_main() return codes
|
||||
* ID: 3582310 - ipmi_fru - ipmi_fru_main() - misuse of printf()
|
||||
* ID: 3576213 - ipmi_fru - unused variable
|
||||
* ID: 3578276 - ipmi_fru - free() on freed memory possible
|
||||
* ID: 3578275 - ipmi_fru - memory leaks
|
||||
* ID: 3528271 - ipmi_fru - possible *flow via FRUID
|
||||
* ID: 3578277 - ipmi_fru - possible NULL pointer
|
||||
* ID: 3612372 - Recognize Broadcom IANA number and BCM5725 product
|
||||
* ID: 3608758 - add IPMI_NETFN_OEM
|
||||
* ID: 143 - Reversed 'channel authcap' capabilities
|
||||
Fixes reversed IPMIv1.5/2.0 'channel authcap' capabilities
|
||||
* ID: 3587318 - "dcmi discover" is not DCMI 1.5 compatible
|
||||
* ID: 3608757 - ipmi_fru - various fixes
|
||||
* ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
|
||||
* ID: 3597782 - ipmi_mc - sysinfo_param() has two consecutive returns
|
||||
* ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos
|
||||
* ID: 3608763 - ipmi_sdr - code cleanup & output display cleanup
|
||||
* ID: 3610286 - ipmi_sdr - ipmi_sdr_print_type - incorrect eval
|
||||
* ID: 3600930 - ipmi_sdr - code cleanup
|
||||
* ID: 3602439 - ipmi_sdr - memory leaks
|
||||
* ID: 3595199 - ipmi_sdr - Add support for 'ipmitool sdr <list|elist> help'
|
||||
* ID: 3592773 - 'ipmitool sdr info'; prints incorrect info
|
||||
* ID: 3592770 - 'ipmitool sdr list|elist INV_INPUT' return code
|
||||
* ID: 3577159 - ipmi_sdr - uint32_t cast to uint8_t and back
|
||||
* ID: 3528368 - ipmi_sdr - possible int *flow
|
||||
* ID: 226 - ipmi_sdradd - typo
|
||||
* ID: 258 - ipmi_sdradd - error printed on STDOUT
|
||||
* Fixed ipmievd start under systemd.
|
||||
* ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
|
||||
* ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
|
||||
* ID: 3600907 - defined value for "Chassis may not support Force Identify"
|
||||
* ID: 256 - ipmitool could crash when IPv6 address is returned
|
||||
* ID: 211 - 'lib/ipmi_dcmi.c' - typo & error printed on STDOUT
|
||||
* ID: 3612237 - If DCMI command fails, incorrect completion code is printed
|
||||
* ID: 3608149 - ipmitool - set pointer to NULL after free()
|
||||
* ID: 3603419 - DCMI - waste of resources
|
||||
* ID: 3600908 - DMCI - crash in ipmi_print_sensor_info(), NULL ref
|
||||
* ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
|
||||
* ID: 113 - delloem exec file won't handle more than one command
|
||||
* ID: 28 - delloem - clean up the code
|
||||
* ID: 3608261 - delloem - code formatting
|
||||
* ID: 3528247 - delloem - fix possible *int flows
|
||||
* ID: 3600910 - delloem - code cleanup
|
||||
* ID: 3576211 - delloem - unused variable
|
||||
* ID: 3578022 - delloem - fix typos
|
||||
* ID: 263 - ipmi_ek* - cleanup
|
||||
* ID: 3308765 - ipmi_ek* - cleanup
|
||||
* ID: 3586228 - ipmi_ek* - ipmi_ekanalyzer_usage() rework
|
||||
* ID: 3528388 - ipmi_ek* - a typo in error message
|
||||
* ID: 3576212 - ipmi_event - better rsp handling
|
||||
* ID: 3607393 - ipmi_event - redundant '\n' in error message
|
||||
* ID: 153 - ipmi_firewall - printf() used instead of lprintf()
|
||||
* ID: 3608003 - ipmi_fru - atol() should be replaced with str2*()
|
||||
* ID: 3600911 - ipmi_fru - fix multiple increments in args to printf
|
||||
* ID: 3600914 - no more crash on no response. allow more send/recv loops of waiting.
|
||||
* ID: 70 - Fixes and updates for ipmitool hpm
|
||||
* ID: 3528308 - ipmi_hpmfwupg - possible int *flow
|
||||
* ID: 3608762 - ipmi_hpmfwup - Fixed help messages for hpm command
|
||||
* ID: 3607981 - ipmi_lanp - replace atoi() calls
|
||||
* ID: 3607320 - ipmi_lanp - possible NULL reference
|
||||
* ID: 3600926 - ipmi_lanp - code cleanup
|
||||
* ID: 3613575 - memory leak - ipmi_password_file_read()
|
||||
* ID: 3522740 - reading password from file is limited to 16byte passwords
|
||||
* ID: 3613605 - ipmi_main - call free() on pointer to static data
|
||||
* ID: 3608761 - ipmi_main - PICMG Get Device Locator was never run
|
||||
* ID: 3577155 - ipmi_main' - memory leaks
|
||||
* ID: 239 - typo in 'mc selftest', add details
|
||||
* ID: 3597471 - ipmi_mc - needs a bit of re-work - rc, inv. options
|
||||
* ID: 3597468 - ipmi_mc - print_mc_usage() prints to STDOUT
|
||||
* ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
|
||||
* ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
|
||||
* ID: 3611254 - OEM handle for Intel 82751 in SPT mode
|
||||
* ID: 3600927 - change eval order of input param in ipmi_oem_setup()
|
||||
* ID: 3600928 - ipmi_pef - code cleanup
|
||||
* ID: 3592732 - ipmi_picmg.c - printf() misuse
|
||||
* ID: 3528310 - ipmi_picmg.c - NULL reference
|
||||
* ID: 3528347 - ipmi_raw.c - possible int *flow
|
||||
* ID: 3587913 - Command % ipmitool raw help; returns 1
|
||||
* Added code to support sensors on other luns (On behalf of Kontron Germany)
|
||||
* ID: 3611912 - Add missing newlines when cvs output is specified
|
||||
* ID: 244 - ipmi_sel - "0.0" displayed for unspecified threshold values
|
||||
* ID: 3612371 - Typo in impi_sel debug output
|
||||
* ID: 3016359 - ipmi_sel - Get SEL Alloc Information is incorrect
|
||||
* ID: 3568976 - 'sel set time' behaviour is inconsistent
|
||||
* ID: 3528371 - ipmi_sensor - possible int *flow
|
||||
* ID: 3601265 - 'ipmitool sensor get' leaks memory
|
||||
* ID: 3601106 - 'ipmitool sensor get NACname' output incorrect/inconsistent
|
||||
* ID: 3608007 - ipmi_session - typo in error message
|
||||
* ID: 101 - ipmi_sol - possible int *flow
|
||||
* ID: 3600933 - ipmi_sol - use of deprecated bzero()
|
||||
* ID: 3609472 - ipmi_sol - Add the instance to the SOL commands
|
||||
* ID: 3588726 - 'ipmitool sol payload status ...;'segfaults on no rsp
|
||||
* ID: 3522731 - ipmi_sol - ipmi_get_sol_info() returns always 0
|
||||
* ID: 3613042 - add missing Entity IDs
|
||||
* ID: 3611306 - ipmi_tsol - fix always fail in case of error
|
||||
* ID: 259 - ipmi_user - memory leak
|
||||
* ID: 260 - ipmi_user - replace atoi() call
|
||||
* ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
|
||||
* ID: 3600960 - check the copy of password exists
|
||||
* ID: 3609473 - Add assertion/deassertion to threshold events
|
||||
* ID: 104 - ipmishell - possible int *flow
|
||||
* ID: 262 - 'set' segfaults when no IPMI inf present
|
||||
* ID: 257 ipmitool exec segfaults if invalid input given
|
||||
* ID: 254 - Fix retry of authentication capabilities retrieval
|
||||
* ID: 3611303 - lan - error check is missing braces
|
||||
* ID: 253 - Fix lanplus retransmission
|
||||
* ID: 212 - 'lib/ipmi_dcmi.c' - possible int *flow
|
||||
* ID: 264 - incorrect array index in get_lan_param_select()
|
||||
* ID: 269 - Fixes for configure.in for cross compilation
|
||||
* ID: 267 - Corruption in "lan alert print" output
|
||||
* ID: 41 - ipmi_sel_interpret() - clean up formatting, indentation
|
||||
* ID: 242 - Incorrect DCMI Power Reading "IPMI timestamp" interpretation
|
||||
* ID: 229 - 'lib/ipmi_ekanalyzer.c' - a typo ``Too few argument!''
|
||||
* ID: 266 - file descriptor leak in ipmi_fwum and ipmi_ekanalyzer
|
||||
* ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
|
||||
* ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
|
||||
* ID: 35 - Script to setup redirection of SNMP to/from BMC
|
||||
* ID: 273 - Reduce SOL Input buffer size by SOL header size
|
||||
|
||||
|
||||
version 1.8.12 released 2012-08-09
|
||||
* Added IPMB dual bridge support (no need for driver support)
|
||||
* Enable compiler warnings and resolve all compiler warning so that
|
||||
ipmitool compiles and links with no warning or error messages
|
||||
* add ipmishell line to configure
|
||||
* fail configure when no curses or readline is found
|
||||
* support sensor bridging in free interface
|
||||
* applied fix for issue #2865160 (AIX build)
|
||||
* Document the ipmitool dcmi commands in the ipmitool man page
|
||||
* Document that some commands are blocked by OpenIPMI. ID 2962306
|
||||
* Document the -N and -R options per tracker ID 3489643
|
||||
* fix manpage misdocumentation on cipher suite privilige configuration
|
||||
* Add build support for Dell OEM commands
|
||||
* Add new Dell OEM commands and update man page
|
||||
* added hpm and fwum in man page
|
||||
* man page update for fwum and hpm commands
|
||||
* Added documentation for 'ime' operating mode, used to update Intel ME.
|
||||
* add new -Y option to prompt user to enter kgkey
|
||||
* Add DCMI module (Data Center Management Interface)
|
||||
* fixed oem/iana data type to allow 24 bits definition
|
||||
* Fixed AMC point-to-point record parsing in FRU
|
||||
* Fixed detection of packing support in GCC
|
||||
* Added packing support detection magic on all packed structures
|
||||
in project
|
||||
* Dell specific mac sub command is updated to support the latest 12G
|
||||
Dell servers. Support for virtual mac is also implemented.
|
||||
* Use consistent netfn/cmd for getsysinfo command
|
||||
* Add Dell OEM network commands
|
||||
* Resolve incorect Board Mfg Data due to incorrect date constant
|
||||
* Update ipmi_fru.h to SMBIOS spec 2.6.1 - ID 2916398
|
||||
* Support for analog readings in discrete sensors on HP platforms.
|
||||
* Change device id mask (IPM_DEV_DEVICE_ID_REV_MASK) 0x07 for 0x0F.
|
||||
As per in IPMI spec V2:
|
||||
* Added PICMG clock e-keying and bused resource control identifiers
|
||||
* Added PICMG major version (ATCA/AMC/uTCA) identifiers
|
||||
* Correct Threshold/Discrete Sensor Display - Patch Tracker ID 3508759
|
||||
* Sensor units now handle percentage units - ID 3014014
|
||||
* Fixes ID 3421347 Sensor list command should use channel field from SDR
|
||||
* Added packing directive for ARM cross compile with GCC 3.4.5,
|
||||
otherwise the sdr structures gets padded and the pointer cast
|
||||
result in incorrect alignement
|
||||
* Added 'sdr fill sensors nosats' support to speed up SDR discovery
|
||||
* Added SDR name display during discovery (with -v)
|
||||
* Added support for sensor types - Processor related sensor
|
||||
type 0x07, system incharectorization 0x20, Memory sensor type.
|
||||
* Give more description for SEL which is generated for Uncorrectable
|
||||
ECC and errors with respect to each Memory Bank,Card or DIMM.
|
||||
The Sensor type supporting this are 0x0C and 0x10.
|
||||
* Add more details about Version Change event (source of
|
||||
firmware update)
|
||||
* enhanced PICMG fru control
|
||||
* Integrated Andy Wray's DDR3 SPD parser patch
|
||||
* Adds function str2uint() to convert from string to uint32_t with
|
||||
checks for valid input.
|
||||
* Fix possible buffer overflow in buf2str()
|
||||
* Fixes ID 3485004 - misuse of strtol()
|
||||
* Replaces calls to strtol() with str2uchar() calls and adds error
|
||||
messages if invalid input is given.
|
||||
* Don't overwite the iflags bits prior to setting the boot parameters.
|
||||
This fixes ipmitool so that
|
||||
chassis bootdev bios clear-cmos=yes
|
||||
will correctly clear the bios cmos.
|
||||
* Clarify DCMI get limit activation (add if activate or not).
|
||||
* Bug fixes for delloem lan command. This includes the support for 12G
|
||||
Dell license and 12G LAN Specific command.
|
||||
* delloem commands should not be executed before parsing command line.
|
||||
* Fix stack overflow in delloem setled
|
||||
* Fix delloem powermonitor on big-endian platforms.
|
||||
* ipmitool delloem powermonitor command should convert data from
|
||||
network-format to the native one, otherwise it shows garbage
|
||||
on ppc/ppc64 platform.
|
||||
* Add ipmi_getsysinfo command
|
||||
* Add support for drive backplane SetLED functionality
|
||||
* Fix for Platform Event Message incorrect Generator ID
|
||||
* Fix fru print so that it will display FRU info from satellite
|
||||
controllers.
|
||||
* Add support for AMC type 17h record.
|
||||
* Fix in fru edit. It is now possible to edit field 0 of sections
|
||||
* New FRU get OEM record command
|
||||
* fixed segfault for fru edit when "field id" is not supported and
|
||||
added user feedback for string substitution(success or failure)
|
||||
* Improvement to hpm upgrade during activation. This resolves issue
|
||||
where activation seems to have failed because ipmitool received
|
||||
an unsupported completion code.
|
||||
* hpm Fixes for multi-platform support.
|
||||
* hpm Fix for timeouts during firmware rollback. If completion code
|
||||
is C3, wait till timeout has expired before reporting it.
|
||||
* hpm During manual rollback, code now gets target capabilities
|
||||
instead of using a default timeout of 60 seconds.
|
||||
* Added firmware auxilliary bytes to hpm outputs
|
||||
* hpm Add support for BIG Buffer (Use when -z option is used)
|
||||
* Fix the case where ipmitool loses the iol connection during the upload
|
||||
block process. Once IPMITool was successfully sent the first
|
||||
byte, IPMITool will not resize the block size.
|
||||
* Fix the problem when we try to upgrade specific component and the
|
||||
component is already updated,
|
||||
* updated HPM firmware agent to version 1.04
|
||||
* Fix exit code to return zero on '-o list' or '-o help' option
|
||||
* limit length of user name and password that can be supplied by user.
|
||||
Password is limited to 16 bytes, resp. 20 bytes, for LAN, resp.
|
||||
LAN+, interface. User name is limited to 16 bytes, no interface
|
||||
limitations. ID 3184687, ID 3001519
|
||||
* Add retry / timeout options for LAN
|
||||
* Changed default cipher suite to 1 instead of 3 for iol20
|
||||
* added fix for tracker ID 2849300 "Incorrect Firmware Revision"
|
||||
* avoid reopening the interface when already opened
|
||||
* Remove message for unsupported PEF capabilities that return valid
|
||||
CC (80h)
|
||||
* Added OEM byte (47) to verbose output
|
||||
* Add option to provide a list when filling sdr repository
|
||||
* SDR discovery speedups
|
||||
* Added support for Dell specific sensors
|
||||
* Fix segmentation fault on unrecognize OEM events.
|
||||
* changed SEL timestamp formatting for 'preinit' SEL entries, allowing
|
||||
the number of seconds to be displayed.
|
||||
* Added sensor raw data in verbose mode. Useful for OEM sensor type.
|
||||
* Add sensor hysteresis (positive & negative) to the following command
|
||||
ipmitool sensor -v
|
||||
* Fixes bug ID 3484936 - missing user input validation
|
||||
* Add missing RMCP+ auth type strings
|
||||
* Add new Kontron Product in ipmi_strings for product ID. Kontron
|
||||
KTC5520/EATX Server Motherboard with integrated iBMC/KVM/VM
|
||||
added identification support for Kontron AT8050 ATCA board
|
||||
* Constrain setting of the username to no greater than 16 characters
|
||||
per the IPMI specification. ID 3001519
|
||||
* Constrain User ID between 1 and 63. ID 3519225
|
||||
* Fixes ID 3485340 - user input not handled in 'lib/ipmi_user.c'
|
||||
* Fixes ignorance of existing daemon PID file which results in PID being
|
||||
overwritten. Adds proper umask() before writing PID file.
|
||||
* applied fix for ID 2865111 (AIX build)
|
||||
* Fix a proplem when using bridged IPMI commands on the lanplus
|
||||
interface (-I lanplus with -b -t or -m switches) resulting in
|
||||
"Close Session command failure".
|
||||
* Add fix with usage of CFh (duplicate request). Usefull for
|
||||
slow commands
|
||||
* Fix issue with sequence number. (Speed up transfer)
|
||||
|
||||
version 1.8.11 released 2009-02-25
|
||||
* Fix new GCC compilation issues in regards to Packing
|
||||
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
* New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
* New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
* Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
* Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
* Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
* Fix lan and lanplus request list entry removal bugs
|
||||
* Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
* Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
* Added PICMG 2.0 and 2.3 support
|
||||
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
* Add IANA support for Pigeon Point
|
||||
* Add OEM SW/FW Record identification
|
||||
* Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
* Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
* Add support for SOL payload status command
|
||||
* SOL set parameter range checking added
|
||||
* Fixed SOL activate options usage
|
||||
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
* Added retries to SOL keepalive
|
||||
* Fixed wrong mask values for Front Panel disable/enable status
|
||||
* Add support to access fru internal use area
|
||||
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write
|
||||
protected.
|
||||
* Fix node reporting in GUID; Tracker bug #2339675
|
||||
* Fix watchdog use/action print strings
|
||||
* Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
* Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
* Fix occasional SDR dump segfault; #1793076
|
||||
* Allow ipmitool sel delete to accept hex list entry numbers
|
||||
* Fix SEL total space reporting.
|
||||
* Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
* ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
version 1.8.10 released 2008-08-08
|
||||
* Added support for BULL IANA number.
|
||||
* Fixed contrib build so the oem_ibm_sel_map file gets included in
|
||||
rpm builds again.
|
||||
* Added support for Debian packages to be built from CVS
|
||||
* Fix for sdr and sel timestamp reporting issues
|
||||
* Fix for discrete sensor state print routines to address state
|
||||
bits 8-14
|
||||
* Change ipmi_chassis_status() to non-static so it can be used
|
||||
externally
|
||||
* Added retries to SOL keepalive
|
||||
* Fix to stop sensor list command from reporting a failure due
|
||||
to missing sensor
|
||||
* Fix bug in sdr free space reporting
|
||||
* Add support for IANA number to vendor name conversion for many
|
||||
vendors
|
||||
* Fix segfault bug in lan set command
|
||||
* Fix bug in population of raw i2c wdata buffer
|
||||
* Fix bug in ipmb sensor reading
|
||||
* Fix misspellings, typos, incorrect strncmp lengths, white space
|
||||
* Update/fix printed help and usages for many commands
|
||||
* Add and update support for all commands in ipmitool man page
|
||||
* Fix for lanplus session re-open when the target becomes unavailable
|
||||
following a fw upgrade activation
|
||||
* Add support for watchdog timer shutoff, reset, and get info
|
||||
* Add support for more ibm systems in oem_ibm_sel_map
|
||||
* Add more JEDEC support info for DIMMs; decrease request size
|
||||
for DIMM FRU info to 16 bytes at a time to allow more
|
||||
DIMM FRUs to respond.
|
||||
* Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
|
||||
buffer length more aggressively when no response from iol
|
||||
* Fix HPM firmware activation via IOL; fake a timeout after IOL
|
||||
session re-open to force get upgrade status retry;
|
||||
Added retries on 0xD3 completion code
|
||||
* Add support for freeipmi 0.6.0; adjust autoconf for changes
|
||||
* Fix for oemval2str size
|
||||
* Add support for product name resolution in mc info
|
||||
* Fix FRU display format
|
||||
* Added PICMG ekeying analyzer module support (ekanalyzer);
|
||||
display point to point physical connectivity and power
|
||||
supply information between carriers and AMC modules;
|
||||
display matched results of ekeying match between an
|
||||
on-carrier device and AMC module or between 2 AMC modules
|
||||
* Fix AMC GUID display support
|
||||
* Improved amcportstate operations
|
||||
* Added resolution for new sensor types
|
||||
* Fix segfault in SOL
|
||||
* Fix bug that caused infinite loop on BMCs with empty SDRs
|
||||
* Fix to move out Kontron OEM sensor resolution for other OEMs
|
||||
which could lead to bad event descriptions
|
||||
* Add new FRU edit mode thereby allowing serial numbers, etc. to be
|
||||
changed; improvements to OEM edit mode
|
||||
* Added SPD support for parms: channel number, max read size
|
||||
* Add SDR support for adding SDR records from a dumped file,
|
||||
clearing SDR, adding partial SDR records
|
||||
* Add updates and fixes to hpmfwupg: upload block size to 32 bytes
|
||||
for KCS, handle long response option, implement rollback
|
||||
override, garbage output fix
|
||||
* Add double bridge lan support , fix bridging issue
|
||||
* Add HPM support to pre-check which components need to be skipped
|
||||
* Fix autodetection of maximum packet size when using IPMB
|
||||
* Add new Kontron OEM command to set the BIOS boot option sequence
|
||||
* Add support for dual-bridge/ dual send message
|
||||
* Add auto-detect for local IPMB address using PICMG 2.X extension
|
||||
* Add support for HPM.1 1.0 specification compliance
|
||||
* Fix for improper lan/lanplus addressing
|
||||
* Added transit_channel and transit_addr to ipmi_intf struct
|
||||
* Fix bad password assertion bug due to rakp2 HMAC not being checked
|
||||
properly
|
||||
* Added ability to interpret PPS shelf manager clia sel dump
|
||||
* Corrected PICMG M7 state event definition macros
|
||||
* Added FRU parsing enhancements
|
||||
* Added "isol info", "isol set" and "isol activate" commands
|
||||
to support Intel IPMI v1.5 SOL functionality. Removed
|
||||
"isol setup" command.
|
||||
* Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
|
||||
* Fix bug in "chassis poh" command.
|
||||
* Fix HPM.1 upgrade to apply to only given component when instructed
|
||||
to do so
|
||||
* Added configure auto-detection if dual bridge extension
|
||||
is supported by OpenIPMI
|
||||
|
||||
version 1.8.9 released 2007-03-06
|
||||
* Added initial AMC ekey query operation support
|
||||
* Improvements to ekeying support (PICMG 3.x only)
|
||||
* Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
* Added edit support for AMC activation "Maximum Internal Current"
|
||||
* Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
* Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
* Fix lan set access command to use value already saved within
|
||||
parameters for PEF and authentication
|
||||
* Fix bug in cmd ipmitool lan stats get 1
|
||||
* Add support to allow ipmitool/ipmievd to target specific device
|
||||
nodes on multi-BMC systems
|
||||
* Add support for name+privilege lookup for lanplus sessions
|
||||
* Fix time_t conversion bug for 64-bit OS
|
||||
* Added prefix of hostname on sel ipmievd sessions
|
||||
* Fixed FWUM Get Info
|
||||
* Fix ipmievd fd closing bug
|
||||
* Add set-in-progress flag support to chassis bootdev
|
||||
* Added new chassis bootdev options
|
||||
* Add sol payload enable/disable comman
|
||||
* Fix SOL set errors when commit-write not supported
|
||||
* Fix reset of session timeout for lanplus interface
|
||||
* Fixed lan interface accessibility timeout handling
|
||||
* Fix bug with Function Get Channel Cipher Suites command when
|
||||
more than 1 page used.
|
||||
* Fix missing firmware firewall top-level command
|
||||
* Fix bug in SOL keepalive functionality
|
||||
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
* Added ipmi_sel_get_oem_sensor* APIs
|
||||
* Added HPM.1 support
|
||||
* Fix segfault when incorrect oem option supplied
|
||||
* Fix bus problem with spd command
|
||||
* Fix segfault in SOL when remote BMC does not return packet
|
||||
* Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
* Added lan packet size reduction mechanism
|
||||
* Fix bug with sendMessage of bad length with different target
|
||||
* Fix for big endian (PPC) architecture
|
||||
* NetBSD fixes
|
||||
* Fix segfault and channel problem with user priv command
|
||||
* Add support for bus/chan on i2c raw command
|
||||
* Add freeipmi interface support
|
||||
* Add remote spd printing
|
||||
* Add better detection of linux/compiler.h to config
|
||||
* Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
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
|
||||
|
@ -27,13 +27,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.
|
||||
|
||||
DOCDIR = $(DESTDIR)/$(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = README COPYING AUTHORS ChangeLog
|
||||
DOCDIR = $(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
|
||||
|
||||
EXTRA_DIST = $(DOCLIST) \
|
||||
debian/changelog debian/control debian/copyright \
|
||||
@ -52,8 +48,11 @@ dist-hook:
|
||||
cp control/ipmitool.spec $(distdir)
|
||||
|
||||
install-data-local:
|
||||
mkdir -p $(DOCDIR)
|
||||
install -m 644 $(DOCLIST) $(DOCDIR)
|
||||
mkdir -p $(DESTDIR)$(DOCDIR)
|
||||
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
|
||||
|
||||
uninstall-local:
|
||||
-rm -rf $(DESTDIR)$(DOCDIR)
|
||||
|
||||
.PHONY: pkg
|
||||
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
|
||||
@ -80,4 +79,3 @@ rpm: control/ipmitool.spec dist
|
||||
.PHONY: clean-rpm
|
||||
clean-rpm:
|
||||
-rm -rf $(RPMDIR)
|
||||
|
||||
|
105
ipmitool/README
105
ipmitool/README
@ -1,7 +1,7 @@
|
||||
|
||||
ipmitool
|
||||
Duncan Laurie
|
||||
duncan@iceblink.org
|
||||
ipmitool-devel@lists.sourceforge.net
|
||||
|
||||
Overview
|
||||
========
|
||||
@ -131,6 +131,109 @@ 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.
|
||||
|
||||
IPMB Dual Bridging in IPMITOOL
|
||||
-------------------------------
|
||||
|
||||
IPMI offers a standard messaging interface.
|
||||
|
||||
The following concepts are related to this messaging interface:
|
||||
|
||||
Channel type : Communication channel type (SMS/KCS, IPMB, LAN)
|
||||
Channel number : Channel descriptor
|
||||
Requester : Address of the requester
|
||||
Responder : Address of the responder
|
||||
NetFN : The logical function for the request/response.
|
||||
Command : The command number
|
||||
Sequence : An ID identifiying the request/response pair
|
||||
Message tracking : The ability to match request/response pair.
|
||||
|
||||
When a communication is issued through any of the channels, an application
|
||||
formats a request and expect a response.
|
||||
|
||||
Direct Command
|
||||
--------------
|
||||
The simplest form of communication is a "direct command" using SMS/KCS
|
||||
|
||||
Example:
|
||||
ipmitool raw 6 4
|
||||
55 00
|
||||
|
||||
This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver
|
||||
takes care of 'message tracking' and provides the answer.
|
||||
|
||||
Hopefully, the application also includes a "human readable" instance of the API:
|
||||
ipmitool mc selftest
|
||||
Selftest: passed
|
||||
|
||||
Bridged Command
|
||||
---------------
|
||||
One slightly more complicated communication mode is the so-called
|
||||
"bridged command" using IPMB.
|
||||
|
||||
Example:
|
||||
ipmitool -m 0x94 -t 0x9a raw 6 4
|
||||
55 00
|
||||
|
||||
or
|
||||
|
||||
ipmitool -m 0x94 -t 0x9a mc selftest
|
||||
Selftest: passed
|
||||
|
||||
|
||||
This still sends the same command 4 (selftest) from netfn 6(application) to
|
||||
the target. However, to do so, the command is encapsulated (by the driver) and
|
||||
sent using the command 0x34 (send message) from netfn 6(application) to KCS.
|
||||
Then KCS is polled by the driver until a message has been received, then the
|
||||
driver uses command 0x33 (get message). The driver also tracks the message
|
||||
and makes sure the response matches the request. Then it decapsultates the
|
||||
message and gives the response back to the application.
|
||||
|
||||
Dual Bridged Command
|
||||
--------------------
|
||||
Things get a little more ugly when the application needs to reach a management
|
||||
controller sitting on an interface (or channel) not directly connected to the
|
||||
BMC/IPMC. In the case the application must encapsulate its message itself and
|
||||
request the IPMC to deal with message tracking itself.
|
||||
|
||||
Its been working well with IPMITOOL on the LAN interface with:
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x20 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
However, trying to dual bridge commands locally with :
|
||||
ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work
|
||||
(it returned the same data as ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
|
||||
|
||||
The reason was that the "openipmi" interface pluging didn't
|
||||
encapsulate/decapsulate the message and didn't even detect the intent
|
||||
to double bridge the request.
|
||||
|
||||
./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
|
||||
|
||||
-B 0 : transit channel for first bridge level (channel 0: IPMB-0)
|
||||
-T 0x8a : transit destination address (remote IPMC address)
|
||||
-m 0x94 : source address (local IPMC address on IPMB-0)
|
||||
-t 0x7a : remote target (AMC IPMB-L address)
|
||||
-b 7 : remote channel (channel 7: IPMB-L)
|
||||
|
||||
The transit source address (remote IPMC address on remote channel) is
|
||||
automatically assigned by the remote IPMC.
|
||||
|
||||
Payload Size Limit
|
||||
------------------
|
||||
Because some commands return a lot of data (fru read/get sdr) and because 2
|
||||
levels of encapsulation are used, some command will fail.
|
||||
|
||||
For instance this works.
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
but this does not:
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
fru print.
|
||||
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
@ -29,10 +29,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.
|
||||
|
||||
aclocal
|
||||
libtoolize --automake --copy
|
||||
|
@ -3,7 +3,7 @@ dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.7.0])
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.13-cvs])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
@ -18,7 +18,7 @@ AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
|
||||
AC_CHECK_PROG([SED], [sed], [sed])
|
||||
|
||||
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])
|
||||
|
||||
@ -33,7 +33,7 @@ AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
@ -44,13 +44,25 @@ AC_SEARCH_LIBS([socket], [socket], [],
|
||||
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
|
||||
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix="$ac_default_prefix"
|
||||
prefix="$ac_default_prefix"
|
||||
fi
|
||||
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix="$prefix"
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl set default option values
|
||||
dnl
|
||||
|
||||
xenable_intf_bmc=no
|
||||
xenable_intf_imb=yes
|
||||
xenable_intf_open=yes
|
||||
xenable_intf_lipmi=yes
|
||||
#xenable_intf_serial=yes
|
||||
xenable_all_options=yes
|
||||
xenable_ipmishell=yes
|
||||
|
||||
dnl set some things so we build with GNU tools on Solaris
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
@ -58,12 +70,41 @@ solaris*)
|
||||
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
|
||||
enable_intf_bmc=yes
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_ipmievd=no
|
||||
enable_ipmishell=no
|
||||
xenable_intf_bmc=yes
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_ipmishell=no
|
||||
xenable_all_options=no
|
||||
;;
|
||||
*cygwin*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
;;
|
||||
*darwin*|aix*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
xenable_ipmishell=no
|
||||
;;
|
||||
*freebsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
;;
|
||||
*netbsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_intf_bmc=no
|
||||
xenable_intf_open=no
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -72,69 +113,104 @@ 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]])],
|
||||
[xenable_solaris_opt=$enableval],
|
||||
[xenable_solaris_opt=no])
|
||||
if test "x$xenable_all_options" = "xyes" || test "x$xenable_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])
|
||||
[xenable_internal_md5=$enableval],
|
||||
[xenable_internal_md5=no])
|
||||
|
||||
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
have_crypto=yes; LIBS="$LIBS -lcrypto"
|
||||
fi], [have_crypto=no], [-lcrypto])
|
||||
fi],
|
||||
[have_crypto=no], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD5_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
|
||||
fi], [], [-lcrypto])
|
||||
fi],
|
||||
[], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD2_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
[if test "x$xenable_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])
|
||||
fi],
|
||||
[], [-lcrypto])
|
||||
|
||||
dnl enable IPMIv1.5 LAN interface
|
||||
AC_ARG_ENABLE([intf-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
|
||||
[xenable_intf_lan=$enableval],
|
||||
[xenable_intf_lan=yes])
|
||||
if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_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
|
||||
|
||||
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
|
||||
[xenable_intf_lanplus=$enableval],
|
||||
[xenable_intf_lanplus=$have_crypto])
|
||||
if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
if test "x$xenable_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
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
ORIG_CPPFLAGS=$CPPFLAGS
|
||||
|
||||
dnl enable serial interface
|
||||
AC_ARG_ENABLE([intf-serial],
|
||||
[AC_HELP_STRING([--enable-intf-serial],
|
||||
[enable direct Serial Basic/Terminal mode interface [default=yes]])],
|
||||
[xenable_intf_serial=$enableval], [xenable_intf_serial=yes])
|
||||
if test "x$enable_intf_serial" = "xstatic" || test "x$enable_intf_serial" = "xplugin"; then
|
||||
xenable_intf_serial=yes
|
||||
fi
|
||||
if test "x$xenable_intf_serial" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_SERIAL, [1], [Define to 1 to enable serial interface.])
|
||||
AC_SUBST(INTF_SERIAL, [serial])
|
||||
AC_SUBST(INTF_SERIAL_LIB, [libintf_serial.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB serial/libintf_serial.la"
|
||||
else
|
||||
xenable_intf_serial=no
|
||||
fi
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
@ -146,47 +222,248 @@ AC_ARG_WITH([kerneldir],
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CFLAGS)
|
||||
CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CPPFLAGS)
|
||||
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)
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
|
||||
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
|
||||
AC_MSG_CHECKING([for linux/compiler.h])
|
||||
|
||||
m4_version_prereq([2.68],
|
||||
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <linux/compiler.h>]])],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])],
|
||||
[AC_PREPROC_IFELSE([#include <linux/compiler.h>],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])])
|
||||
|
||||
CPPFLAGS=$ORIG_CPPFLAGS
|
||||
AC_SUBST(CPPFLAGS)
|
||||
|
||||
AC_CHECK_HEADER([sys/ioccom.h],
|
||||
[AC_DEFINE(HAVE_SYS_IOCCOM_H, [1],
|
||||
[Define to 1 if you have the <sys/ioccom.h> header file.])])
|
||||
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])
|
||||
[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."])])
|
||||
|
||||
dnl look for FreeIPMI files
|
||||
AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no])
|
||||
if test "x$have_free" != "xyes"; then
|
||||
AC_CHECK_LIB(freeipmi, ipmi_ctx_open_inband, [have_free=yes], [have_free=no])
|
||||
fi
|
||||
AC_ARG_ENABLE([intf-free],
|
||||
[AC_HELP_STRING([--enable-intf-free],
|
||||
[enable FreeIPMI IPMI interface [default=auto]])],
|
||||
[xenable_intf_free=$enableval],
|
||||
[xenable_intf_free=$have_free])
|
||||
if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
|
||||
xenable_intf_free=yes
|
||||
fi
|
||||
if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
|
||||
echo "** Unable to build FreeIPMI interface support!"
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
if test "x$xenable_intf_free" = "xyes"; then
|
||||
dnl Determine if you got the right FreeIPMI version
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.3.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev;
|
||||
dev = ipmi_open_inband(IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_3_0=yes, ac_free_version_0_3_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_3_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.4.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_4_0=yes, ac_free_version_0_4_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_4_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.5.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_5_0=yes, ac_free_version_0_5_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_5_0)
|
||||
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.6.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
], [
|
||||
ipmi_ctx_t ctx = NULL;
|
||||
int rv;
|
||||
ctx = ipmi_ctx_create();
|
||||
rv = ipmi_ctx_open_inband(ctx,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_6_0=yes, ac_free_version_0_6_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_6_0)
|
||||
|
||||
if test "x$ac_free_version_0_3_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_4_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_5_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE, [1], [Define to 1 to enable FreeIPMI interface.])
|
||||
AC_SUBST(INTF_FREE, [free])
|
||||
AC_SUBST(INTF_FREE_LIB, [libintf_free.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la"
|
||||
if test "x$ac_free_version_0_3_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_3_0, [1], [Define to 1 for FreeIPMI 0.3.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_4_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_4_0, [1], [Define to 1 for FreeIPMI 0.4.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_5_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_5_0, [1], [Define to 1 for FreeIPMI 0.5.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.])
|
||||
fi
|
||||
else
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(freeipmi,
|
||||
ipmi_cmd_raw_ipmb,
|
||||
AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1],
|
||||
[Define to 1 to enable FreeIPMI Bridging Support.]))
|
||||
fi
|
||||
|
||||
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."])])
|
||||
|
||||
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)])
|
||||
|
||||
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)
|
||||
|
||||
dnl enable Linux OpenIPMI interface
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[AC_HELP_STRING([--enable-intf-open],
|
||||
[enable Linux OpenIPMI interface [default=yes]])],
|
||||
[], [enable_intf_open=yes])
|
||||
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
|
||||
enable_intf_open=yes
|
||||
[enable Linux OpenIPMI interface [default=auto]])],
|
||||
[xenable_intf_open=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_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"
|
||||
|
||||
dnl Check for dual bridge support in OpenIPMI
|
||||
AC_MSG_CHECKING([for OpenIPMI dual bridge support])
|
||||
have_openipmi_dual_bridge=no
|
||||
ORIG_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -Isrc/plugins/open -DENABLE_INTF_OPEN_DUAL_BRIDGE"
|
||||
AC_TRY_COMPILE([
|
||||
#if defined(HAVE_OPENIPMI_H)
|
||||
# if defined(HAVE_LINUX_COMPILER_H)
|
||||
# include <linux/compiler.h>
|
||||
# endif
|
||||
# include <linux/ipmi.h>
|
||||
#elif defined(HAVE_FREEBSD_IPMI_H)
|
||||
# include <sys/ipmi.h>
|
||||
#else
|
||||
# include "open.h"
|
||||
#endif
|
||||
], [
|
||||
struct ipmi_ipmb_addr a;
|
||||
a.transit_slave_addr = 0;
|
||||
], [have_openipmi_dual_bridge=yes])
|
||||
if test x"$have_openipmi_dual_bridge" = x"yes"; then
|
||||
AC_DEFINE(ENABLE_INTF_OPEN_DUAL_BRIDGE, [1],
|
||||
[Define to 1 to enable OpenIPMI interface dual bridge support])
|
||||
fi
|
||||
CPPFLAGS="$ORIG_CPPFLAGS"
|
||||
AC_MSG_RESULT([$have_openipmi_dual_bridge])
|
||||
fi
|
||||
|
||||
dnl enable Intel IMB interface
|
||||
AC_ARG_ENABLE([intf-imb],
|
||||
[AC_HELP_STRING([--enable-intf-imb],
|
||||
[enable Intel IMB driver interface [default=yes]])],
|
||||
[], [enable_intf_imb=yes])
|
||||
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
|
||||
enable_intf_imb=yes
|
||||
[enable Intel IMB driver interface [default=auto]])],
|
||||
[xenable_intf_imb=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_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
|
||||
@ -194,71 +471,116 @@ 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
|
||||
[xenable_intf_lipmi=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
|
||||
xenable_intf_lipmi=no
|
||||
fi
|
||||
if test "x$xenable_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=no]])],,
|
||||
[enable_intf_bmc=no])
|
||||
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then
|
||||
enable_intf_bmc=yes
|
||||
[enable Solaris 10 x86 IPMI interface [default=auto]])],
|
||||
[xenable_intf_bmc=$enableval],
|
||||
[xenable_intf_bmc=no])
|
||||
if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
|
||||
xenable_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"
|
||||
if test "x$xenable_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([initscr], [curses ncurses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline], [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.])
|
||||
if test "x$xenable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
|
||||
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
|
||||
xenable_ipmishell=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl enable IPMI Event Daemon
|
||||
AC_ARG_ENABLE([ipmievd],
|
||||
[AC_HELP_STRING([--enable-ipmievd],
|
||||
[enable IPMI Event daemon [default=yes]])],
|
||||
[], [enable_ipmievd=yes])
|
||||
AM_CONDITIONAL(IPMIEVD, [test "x$enable_ipmievd" = "xyes"])
|
||||
if test "x$enable_ipmievd" = "xyes"; then
|
||||
AC_SUBST(IPMIEVD_BIN, [ipmievd])
|
||||
dnl check for readline library to enable ipmi shell
|
||||
AC_ARG_ENABLE([ipmishell],
|
||||
[AC_HELP_STRING([--enable-ipmishell],
|
||||
[enable IPMI shell interface [default=auto]])],
|
||||
[xenable_ipmishell=$enableval],
|
||||
[])
|
||||
if test "x$xenable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
|
||||
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" != "xyes"; then
|
||||
AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
|
||||
fi
|
||||
if test "x$have_readline" != "xyes"; then
|
||||
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
|
||||
fi
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
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"
|
||||
fi], [])
|
||||
|
||||
[xenable_buildcheck=$enableval],
|
||||
[xenable_buildcheck=no])
|
||||
if test "x$xenable_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]])],
|
||||
[xenable_file_security=$enableval],
|
||||
[xenable_file_security=no])
|
||||
if test "x$xenable_file_security" != "xno"; then
|
||||
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
|
||||
fi
|
||||
|
||||
|
||||
AC_TRY_COMPILE([],[
|
||||
#include <stdio.h>
|
||||
|
||||
struct packstruct {
|
||||
unsigned char t0 :5;
|
||||
unsigned char t1 :5;
|
||||
unsigned char t2 :5;
|
||||
unsigned char t3 :5;
|
||||
unsigned char t4 :4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
if(sizeof(struct packstruct) != 3)
|
||||
return(1);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
],
|
||||
[],
|
||||
[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
|
||||
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
|
||||
)
|
||||
|
||||
|
||||
dnl Generate files for build
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
@ -266,6 +588,7 @@ AC_CONFIG_FILES([Makefile
|
||||
control/Makefile
|
||||
control/pkginfo
|
||||
control/prototype
|
||||
control/rpmmacros
|
||||
control/ipmitool.spec
|
||||
lib/Makefile
|
||||
include/Makefile
|
||||
@ -273,11 +596,13 @@ AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
src/plugins/Makefile
|
||||
src/plugins/lan/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/open/Makefile
|
||||
src/plugins/free/Makefile
|
||||
src/plugins/imb/Makefile
|
||||
src/plugins/bmc/Makefile
|
||||
src/plugins/lipmi/Makefile])
|
||||
src/plugins/lipmi/Makefile
|
||||
src/plugins/serial/Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@ -285,14 +610,17 @@ 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([ lan : $xenable_intf_lan])
|
||||
AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
|
||||
AC_MSG_RESULT([ open : $xenable_intf_open])
|
||||
AC_MSG_RESULT([ free : $xenable_intf_free])
|
||||
AC_MSG_RESULT([ imb : $xenable_intf_imb])
|
||||
AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
|
||||
AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
|
||||
AC_MSG_RESULT([ serial : $xenable_intf_serial])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Extra tools])
|
||||
AC_MSG_RESULT([ ipmievd : $enable_ipmievd])
|
||||
AC_MSG_RESULT([ ipmievd : yes])
|
||||
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
|
||||
AC_MSG_RESULT([])
|
||||
|
||||
|
@ -27,14 +27,13 @@
|
||||
# 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
|
||||
|
||||
dist_pkgdata_DATA = bmclanconf README \
|
||||
ipmi.init.basic ipmi.init.redhat \
|
||||
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh
|
||||
dist_pkgdata_DATA = oem_ibm_sel_map
|
||||
|
||||
EXTRA_DIST = README \
|
||||
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 \
|
||||
bmc-snmp-proxy bmc-snmp-proxy.service bmc-snmp-proxy.sysconf
|
||||
|
381
ipmitool/contrib/bmc-snmp-proxy
Normal file
381
ipmitool/contrib/bmc-snmp-proxy
Normal file
@ -0,0 +1,381 @@
|
||||
#!/bin/sh
|
||||
#############################################################################
|
||||
#
|
||||
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
|
||||
#
|
||||
# version: 0.6
|
||||
#
|
||||
# Authors: Charles Rose <charles_rose@dell.com>
|
||||
# Jordan Hargrave <jordan_hargrave@dell.com>
|
||||
#
|
||||
# Description: Script to set snmp proxy to the BMC for certain OID
|
||||
# See here for details:
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
#
|
||||
# Assumptions: This script will work only when /etc/snmp/ is writable.
|
||||
#
|
||||
#############################################################################
|
||||
# GLOBALS
|
||||
#############################################################################
|
||||
SYSCONF_DIR="/etc/sysconfig"
|
||||
CONFIG="${SYSCONF_DIR}/bmc-snmp-proxy"
|
||||
|
||||
SNMPD_LOCAL_CONF_DIR="/etc/snmp/bmc"
|
||||
SNMPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmpd.local.conf"
|
||||
TRAPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmptrapd.local.conf"
|
||||
|
||||
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
|
||||
|
||||
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
|
||||
BMC_INFO="/var/run/bmc-info"
|
||||
|
||||
IPMITOOL=`which ipmitool`
|
||||
|
||||
#Default config
|
||||
BMC_COMMUNITY="public"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
TRAP_FORWARD="no"
|
||||
RELOAD_SERVICES="yes"
|
||||
|
||||
#############################################################################
|
||||
|
||||
#TODO: Use inotify and daemonize when $BMC_INFO changes
|
||||
|
||||
# source config
|
||||
[ -r ${CONFIG} ] && . ${CONFIG}
|
||||
|
||||
. gettext.sh
|
||||
|
||||
SCRIPT_NAME=$(basename $0)
|
||||
RETVAL=0
|
||||
|
||||
# Check if bmc-info created by exchange-bmc-os-info
|
||||
bmc_info_exists()
|
||||
{
|
||||
if [ -r "${BMC_INFO}" ]; then
|
||||
. ${BMC_INFO}
|
||||
else
|
||||
RETVAL=2
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
check_snmp()
|
||||
{
|
||||
if [ ! -d /etc/snmp ] && [ ! -x /usr/sbin/snmpd ]; then
|
||||
RETVAL=12
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# configure SNMP proxy
|
||||
#############################################################################
|
||||
write_snmp_conf()
|
||||
{
|
||||
# SNMPv3 security: bmcview, bmc_ctx, bmc_sec, bmc_grp, bmc_cmty
|
||||
printf "###############################################\n"
|
||||
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
|
||||
printf "###############################################\n"
|
||||
printf "view bmcview included %s 80\n" "${BMC_OID}"
|
||||
printf "com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
|
||||
printf "group bmc_grp v1 bmc_sec\n"
|
||||
printf "access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
|
||||
printf "proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
|
||||
printf "###############################################\n"
|
||||
}
|
||||
|
||||
valid_ip()
|
||||
{
|
||||
#Thanks to mkyong.com
|
||||
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
|
||||
|
||||
printf -- "%s" "${1}"| grep -Eq \
|
||||
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
|
||||
return $?
|
||||
}
|
||||
|
||||
check_vars()
|
||||
{
|
||||
[ -z ${BMC_COMMUNITY} ] && BMC_COMMUNITY="public"
|
||||
[ -z ${BMC_OID} ] && return 1
|
||||
|
||||
if [ -n "${BMC_IPv4}" ] && valid_ip ${BMC_IPv4}; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_snmp_proxy()
|
||||
{
|
||||
if check_vars; then
|
||||
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
|
||||
|
||||
if [ ! -d ${SNMPD_LOCAL_CONF_DIR} ] && \
|
||||
mkdir ${SNMPD_LOCAL_CONF_DIR}; then
|
||||
write_snmp_conf > ${SNMPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=4
|
||||
fi
|
||||
else
|
||||
RETVAL=3
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
set_snmpd_conf_path()
|
||||
{
|
||||
for SYSCONF in ${SYSCONF_DIR}/snmp*d;
|
||||
do
|
||||
if grep -q "${SNMPD_LOCAL_CONF_DIR}" "${SYSCONF}" > \
|
||||
/dev/null 2>&1; then
|
||||
continue
|
||||
else
|
||||
printf "SNMPCONFPATH=%s\n" "${SNMPD_LOCAL_CONF_DIR}" \
|
||||
>> ${SYSCONF} || RETVAL=7
|
||||
fi
|
||||
done
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
disable_snmp_proxy()
|
||||
{
|
||||
if [ -f ${SNMPD_LOCAL_CONF} ]; then
|
||||
rm -f ${SNMPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=5
|
||||
fi
|
||||
}
|
||||
#############################################################################
|
||||
# Trap Forwarding
|
||||
#############################################################################
|
||||
|
||||
pick_alert_dest()
|
||||
{
|
||||
test_ip="$1"
|
||||
for ALERT_DEST in `seq 1 4`
|
||||
do
|
||||
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
|
||||
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
|
||||
|
||||
[ "${temp_ip}" = "${test_ip}" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
set_alert_dest_ip()
|
||||
{
|
||||
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
|
||||
retry 4 type pet >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && RETVAL=8
|
||||
}
|
||||
|
||||
bmc_alert_dest()
|
||||
{
|
||||
# Pick the first active LAN channel
|
||||
for CHANNEL in `seq 1 14`
|
||||
do
|
||||
[ $(${IPMI_TOOL} -I open channel info ${CHANNEL} 2>/dev/null \
|
||||
| grep -q "802\.3") ] || break
|
||||
done
|
||||
|
||||
# If TRAPD_IP is already set as an alert dest,
|
||||
if pick_alert_dest "${TRAPD_IP}"; then
|
||||
# reset: reset it if we are called with reset
|
||||
[ "${1}" = "reset" ] && \
|
||||
set_alert_dest_ip "0.0.0.0"
|
||||
# else, find the next free alert dest,
|
||||
elif pick_alert_dest "0.0.0.0"; then
|
||||
[ "${1}" = "reset" ] && \
|
||||
return $RETVAL
|
||||
# set: the TRAPD_IP
|
||||
set_alert_dest_ip "${TRAPD_IP}"
|
||||
else
|
||||
# No free alert destinations
|
||||
RETVAL=9
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
set_ipmi_alert()
|
||||
{
|
||||
${IPMITOOL} lan set ${CHANNEL} alert "${1}" >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && RETVAL=10
|
||||
}
|
||||
|
||||
get_host_ip()
|
||||
{
|
||||
# Get host's IP that the BMC can reach.
|
||||
IFACE=$(/usr/sbin/ip -o -f inet address |awk '!/: lo/ {print $2}')
|
||||
for dev in ${IFACE}
|
||||
do
|
||||
ping -c 1 -I ${dev} ${BMC_IPv4} > /dev/null 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
config_bmc_alert()
|
||||
{
|
||||
# Get Host's IP that the BMC can send traps to
|
||||
TRAPD_IP=$(get_host_ip)
|
||||
|
||||
# Set Host's IP as the alert destination in the BMC
|
||||
valid_ip ${TRAPD_IP} && bmc_alert_dest "${ACTION}"
|
||||
|
||||
# Enable alerting on the LAN channel
|
||||
[ $RETVAL -eq 0 ] && set_ipmi_alert "${ACTION}"
|
||||
}
|
||||
|
||||
write_trapd_conf()
|
||||
{
|
||||
printf "###############################################\n"
|
||||
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
|
||||
printf "forward %s %s\n" "${BMC_OID}*" "${FORWARD_HOST}"
|
||||
printf "###############################################\n"
|
||||
}
|
||||
|
||||
config_trapd()
|
||||
{
|
||||
# Proceed only if snmptrapd is available on the system
|
||||
if [ -f ${TRAPD_CONF} ]; then
|
||||
write_trapd_conf > ${TRAPD_LOCAL_CONF}
|
||||
[ $? -ne 0 ] && RETVAL=11
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
trap_sink_exists()
|
||||
{
|
||||
# TODO: We only set the first match. We should be able to set
|
||||
# multiple
|
||||
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
|
||||
/etc/snmp/snmpd*conf | head -1)
|
||||
if [ -z "${FORWARD_HOST}" ]; then
|
||||
# there is no trapsink setup.
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Forward SNMP traps from the BMC to trapsink.
|
||||
trap_forward()
|
||||
{
|
||||
NO_TRAP=0
|
||||
ACTION=${1} # set or reset
|
||||
|
||||
if [ "${ACTION}" = "set" ]; then
|
||||
# Get trapd config,
|
||||
if trap_sink_exists; then
|
||||
config_trapd && config_bmc_alert
|
||||
else
|
||||
# exit silently if there is no sink
|
||||
NO_TRAP=1
|
||||
fi
|
||||
else
|
||||
if [ -f ${TRAPD_LOCAL_CONF} ]; then
|
||||
rm -f ${TRAPD_LOCAL_CONF} >/dev/null 2>&1
|
||||
else
|
||||
NO_TRAP=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
service_reload()
|
||||
{
|
||||
#TODO: do this in systemd
|
||||
if [ ${RETVAL} -eq 0 ] && [ "${RELOAD_SERVICES}" = "yes" ]; then
|
||||
service $1 reload
|
||||
[ $? -ne 0 ] && RETVAL=6
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
start()
|
||||
{
|
||||
if bmc_info_exists && check_snmp; then
|
||||
touch ${LOCKFILE}
|
||||
set_snmpd_conf_path && set_snmp_proxy
|
||||
[ $RETVAL -eq 0 ] && service_reload snmpd
|
||||
|
||||
if [ "${TRAP_FORWARD}" = "yes" ]; then
|
||||
trap_forward "set"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
stop()
|
||||
{
|
||||
[ ! -f ${LOCKFILE} ] && return
|
||||
if bmc_info_exists && check_snmp; then
|
||||
disable_snmp_proxy
|
||||
[ $RETVAL -eq 0 ] && service_reload snmpd
|
||||
|
||||
if [ "${TRAP_FORWARD}" = "yes" ]; then
|
||||
trap_forward "reset"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
rm -f ${LOCKFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
status()
|
||||
{
|
||||
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
|
||||
# Checking for lockfile is better.
|
||||
#if grep -q "^proxy" "${SNMPD_LOCAL_CONF}" > /dev/null 2>&1 ; then
|
||||
if [ -f ${LOCKFILE} ]; then
|
||||
eval_gettext "set"
|
||||
else
|
||||
eval_gettext "not set"
|
||||
fi
|
||||
echo
|
||||
RETVAL=0
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
usage()
|
||||
{
|
||||
eval_gettext "Usage: $0 {start|stop|status}"; echo 1>&2
|
||||
RETVAL=1
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# MAIN
|
||||
#############################################################################
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
status) status ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
|
||||
case "$RETVAL" in
|
||||
0|1) ;;
|
||||
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
|
||||
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
|
||||
4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_LOCAL_CONF}." 1>&2 ;;
|
||||
5) eval_gettext "${SCRIPT_NAME}: failed to disable snmp proxy." 1>&2 ;;
|
||||
6) eval_gettext "${SCRIPT_NAME}: failed to reload snmpd." 1>&2 ;;
|
||||
7) eval_gettext "${SCRIPT_NAME}: failed to update ${SYSCONF}." 1>&2 ;;
|
||||
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
|
||||
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
|
||||
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
|
||||
11) eval_gettext "${SCRIPT_NAME}: failed to write snmptrapd.conf." 1>&2 ;;
|
||||
12) eval_gettext "${SCRIPT_NAME}: snmpd not found." 1>&2 ;;
|
||||
*) eval_gettext "${SCRIPT_NAME}: unknown error." 1>&2 ;;
|
||||
esac
|
||||
|
||||
if [ ${RETVAL} -gt 1 ]; then
|
||||
eval_gettext " Return code: ${RETVAL}"; echo
|
||||
fi
|
||||
exit ${RETVAL}
|
||||
#############################################################################
|
||||
# end of file
|
||||
#############################################################################
|
18
ipmitool/contrib/bmc-snmp-proxy.service
Normal file
18
ipmitool/contrib/bmc-snmp-proxy.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Setup SNMP proxy to BMC
|
||||
|
||||
After=exchange-bmc-os-info.service
|
||||
Requires=exchange-bmc-os-info.service
|
||||
PartOf=exchange-bmc-os-info.service
|
||||
|
||||
ConditionPathExists=/var/run/bmc-info
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
ExecStart=/usr/libexec/bmc-snmp-proxy start
|
||||
ExecStop=/usr/libexec/bmc-snmp-proxy stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
48
ipmitool/contrib/bmc-snmp-proxy.sysconf
Normal file
48
ipmitool/contrib/bmc-snmp-proxy.sysconf
Normal file
@ -0,0 +1,48 @@
|
||||
# bmc-snmp-proxy
|
||||
#
|
||||
# Config file to control SNMP redirection between
|
||||
# the OS and Service Processor/Baseboard Management Controller (BMC)
|
||||
#
|
||||
# bmc-snnmp-proxy helps redirect certain SNMP requests (to this host)
|
||||
# destined to the Service Processor. We will need the Service Processor's
|
||||
# SNMP community string and the OID of the Service Processor's SNMP agent.
|
||||
#
|
||||
# For redirecting Traps from the Service Processor to the trap sink
|
||||
# configured in the host (this system), we will have to set
|
||||
# TRAP_FORWARD below.
|
||||
#
|
||||
# See here for details
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
|
||||
### Configure SNMP proxy to BMC/Service Processor ###
|
||||
|
||||
### Service Processor/BMC SNMP Community String.
|
||||
# Name: BMC_COMMUNITY
|
||||
# Description: Set community string of the Service Processor (BMC)'s
|
||||
# SNMP agent.
|
||||
# Default: public
|
||||
#
|
||||
BMC_COMMUNITY="public"
|
||||
|
||||
### OEM Specific OID of Service Processor
|
||||
# Name: BMC_OID
|
||||
# Description: SNMP OID that we would like to redirect to the Service
|
||||
# Processor (BMC). This can be unique to each OEM.
|
||||
# Default: ".1.3.6.1.4.1.674.10892.2"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
|
||||
### Forward Traps from the Service Processor to trap sink
|
||||
# Name: TRAP_FORWARD
|
||||
# Description: Enabling this will allow traps from the Service Processor
|
||||
# to be directed to this system and configure snmptrapd
|
||||
# Note: This option will have no effect if trap sink on the system is
|
||||
# not configured
|
||||
# Default: "no"
|
||||
TRAP_FORWARD="yes"
|
||||
|
||||
### Reload snmpd and snmptrapd
|
||||
# Name: RELOAD_SERVICES
|
||||
# Description: Reload snmpd and snmptrapd after making changes to their config
|
||||
# files.
|
||||
# Default: "yes"
|
||||
RELOAD_SERVICES="yes"
|
@ -29,11 +29,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.
|
||||
#
|
||||
|
||||
|
||||
# This script is designed for Sun Fire LX50, V60x and V65x systems.
|
||||
|
@ -5,7 +5,7 @@ echo "Setting up OpenIPMI driver..."
|
||||
# load the ipmi modules
|
||||
modprobe ipmi_msghandler
|
||||
modprobe ipmi_devintf
|
||||
if ! modprobe ipmi_kcs_drv ; then
|
||||
if ! modprobe ipmi_si_drv ; then
|
||||
modprobe ipmi_si # try new module name
|
||||
fi
|
||||
|
||||
|
@ -38,7 +38,7 @@ start() {
|
||||
# module if that fails.
|
||||
if ! /sbin/modprobe ipmi_si >/dev/null 2>&1
|
||||
then
|
||||
/sbin/modprobe ipmi_kcs_drv || RETVAL=1
|
||||
/sbin/modprobe ipmi_si_drv || RETVAL=1
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -48,6 +48,12 @@ start() {
|
||||
# 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
|
||||
@ -167,7 +173,7 @@ remove () {
|
||||
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_si_drv 2>/dev/null
|
||||
/sbin/rmmod ipmi_devintf
|
||||
/sbin/rmmod ipmi_msghandler
|
||||
else
|
||||
|
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
|
229
ipmitool/contrib/oem_ibm_sel_map
Normal file
229
ipmitool/contrib/oem_ibm_sel_map
Normal file
@ -0,0 +1,229 @@
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause "triple fault" a software address problem"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x01","Chassis Number","Failed Memory Card","Spare Memory Card","0x00","Memory Mirrored Failover Occurred - System running from mirrored memory image"
|
||||
"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 removed, 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 added, 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","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","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","0x01","0x04","Chassis Number","R","R","R","R","R","R","R","R","R","0x00","Invalid configuration of processor card."
|
||||
"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","0x02","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card enabled"
|
||||
"0xE0","0x02","0x03","0x01","Chassis Number","Memory Card","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)"
|
||||
"0xE0","0x02","0x00","0x05","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, multi-bit or multi-symbol error"
|
||||
"0xE0","0x02","0x01","0x00","Chassis","Failed Channel","R","R","R","R","R","R","R","0x01","AMB Failure Detected on Channel X During Last Boot"
|
||||
"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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","0x02","0x00","0x00","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, done 1"
|
||||
"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"
|
||||
"0xE1","0x05","0x01","0x04","Bus","Device","Function Number","R","R","R","R","R","R","0x00","Link Degrade Event"
|
||||
"0xE1","0x05","0x01","0x05","R","R","R","R","R","R","R","R","R","0x00","Spurious Memory Event"
|
||||
"0xE2","0x00","Register ID","R","First Fire Bit (0xFF=N/A)","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","0x03","0x01","0x07","R","R","0x00","Merge Failure - BIOS version is newer than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x08","R","R","0x00","Merge Failure - BIOS version is older than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x09","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0A","R","R","0x00","Merge Failure - Communication error occurred with secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0B","R","R","0x00","Merge Failure - Timed out waiting for secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x10","R","R","0x00","Merge Failure - No path through partition"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x11","Expected Chassis Count","R","0x00","Merge Information - Expected chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x12","Actual Chassis Count","R","0x00","Merge Information - Actual chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x19","R","R","0x00","Merge Failure - No secondary servers found to merge"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x34","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x35","R","R","0x00","Merge Failure - Communication error occurred with primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x36","R","R","0x00","Merge Failure - Secondary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x41","R","R","0x00","Merge Failure - Timeout occurred waiting for primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x46","R","R","0x00","Merge Failure - BIOS version is newer than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x47","R","R","0x00","Merge Failure - BIOS version is older than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x52","R","R","0x00","Merge Failure - Scalability hardware not detected"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x53","R","R","0x00","Merge Failure - No partition descriptor found"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x54","R","R","0x00","Merge Failure - Error Reading partition descriptor"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x55","R","R","0x00","Merge Failure - Error Reading system UUID"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x56","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x57","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x58","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x59","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5A","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5B","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5C","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"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"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x01","PostVersion","BMCVersion","R","0x00","Incompatible BIOS-BMC Power Executive support"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x02","R","R","R","0x00","Boot denied due to power limitations"
|
@ -27,15 +27,11 @@
|
||||
# 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
|
||||
|
||||
EXTRA_DIST = pkginfo.in prototype.in ipmitool.spec.in \
|
||||
rpmrc rpmmacros
|
||||
EXTRA_DIST = pkginfo.in prototype.in \
|
||||
ipmitool.spec.in rpmmacros.in rpmrc
|
||||
|
||||
dist-hook: pkginfo prototype
|
||||
dist-hook: pkginfo prototype rpmmacros
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: 1%{?_distro:.%{_distro}}
|
||||
Copyright: BSD
|
||||
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
|
||||
License: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
Packager: Jim Mankovich <jmank@hp.com>
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Buildroot: /var/tmp/ipmitool-root
|
||||
|
||||
%description
|
||||
@ -32,8 +32,10 @@ fi
|
||||
|
||||
%build
|
||||
./configure --with-kerneldir \
|
||||
--with-rpm-distro=@DISTRO@ \
|
||||
--prefix=%{_prefix} \
|
||||
--bindir=%{_bindir} \
|
||||
--sbindir=%{_sbindir} \
|
||||
--datadir=%{_datadir} \
|
||||
--includedir=%{_includedir} \
|
||||
--libdir=%{_libdir} \
|
||||
@ -48,16 +50,269 @@ make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
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}/*
|
||||
%defattr(755,root,root)
|
||||
%attr(755,root,root) %{_bindir}/*
|
||||
%attr(755,root,root) %{_sbindir}/*
|
||||
%{_datadir}/ipmitool/*
|
||||
%doc %{_mandir}/man1/*
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
%{_mandir}/man*/*
|
||||
%doc %{_datadir}/doc/ipmitool
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Feb 25 2009 <pere@hungry.com> 1.8.11-1
|
||||
- Fix new GCC compilation issues in regards to Packing
|
||||
- Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
- New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
- New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
- Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
- Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
- Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
- Fix lan and lanplus request list entry removal bugs
|
||||
- Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
- Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
- Added PICMG 2.0 and 2.3 support
|
||||
- Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
- Add IANA support for Pigeon Point
|
||||
- Add OEM SW/FW Record identification
|
||||
- Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
- Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
- Add support for SOL payload status command
|
||||
- SOL set parameter range checking added
|
||||
- Fixed SOL activate options usage
|
||||
- Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
- Added retries to SOL keepalive
|
||||
- Fixed wrong mask values for Front Panel disable/enable status
|
||||
- Add support to access fru internal use area
|
||||
- Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write protected.
|
||||
- Fix node reporting in GUID; Tracker bug #2339675
|
||||
- Fix watchdog use/action print strings
|
||||
- Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
- Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
- Fix occasional SDR dump segfault; #1793076
|
||||
- Allow ipmitool sel delete to accept hex list entry numbers
|
||||
- Fix SEL total space reporting.
|
||||
- Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
- ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
* Fri Aug 08 2008 <pere@hungry.com> 1.8.10-1
|
||||
- Added support for BULL IANA number.
|
||||
- Fixed contrib build so the oem_ibm_sel_map file gets included in rpm
|
||||
builds again.
|
||||
- Added support for Debian packages to be built from CVS
|
||||
- Fix for sdr and sel timestamp reporting issues
|
||||
- Fix for discrete sensor state print routines to address state bits 8-14
|
||||
- Change ipmi_chassis_status() to non-static so it can be used externally
|
||||
- Added retries to SOL keepalive
|
||||
- Fix to stop sensor list command from reporting a failure due to missing
|
||||
sensor
|
||||
- Fix bug in sdr free space reporting
|
||||
- Add support for IANA number to vendor name conversion for many vendors
|
||||
- Fix segfault bug in lan set command
|
||||
- Fix bug in population of raw i2c wdata buffer
|
||||
- Fix bug in ipmb sensor reading
|
||||
- Fix misspellings, typos, incorrect strncmp lengths, white space
|
||||
- Update/fix printed help and usages for many commands
|
||||
- Add and update support for all commands in ipmitool man page
|
||||
- Fix for lanplus session re-open when the target becomes unavailable following
|
||||
a fw upgrade activation
|
||||
- Add support for watchdog timer shutoff, reset, and get info
|
||||
- Add support for more ibm systems in oem_ibm_sel_map
|
||||
- Add more JEDEC support info for DIMMs; decrease request size for DIMM FRU
|
||||
info to 16 bytes at a time to allow more DIMM FRUs to respond.
|
||||
- Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg buffer
|
||||
length more aggressively when no response from iol
|
||||
- Fix HPM firmware activation via IOL; fake a timeout after IOL session
|
||||
re-open to force get upgrade status retry; Added retries on 0xD3
|
||||
completion code
|
||||
- Add support for freeipmi 0.6.0; adjust autoconf for changes
|
||||
- Fix for oemval2str size
|
||||
- Add support for product name resolution in mc info
|
||||
- Fix FRU display format
|
||||
- Added PICMG ekeying analyzer module support (ekanalyzer); display point
|
||||
to point physical connectivity and power supply information between
|
||||
carriers and AMC modules; display matched results of ekeying match
|
||||
between an on-carrier device and AMC module or between 2 AMC modules
|
||||
- Fix AMC GUID display support
|
||||
- Improved amcportstate operations
|
||||
- Added resolution for new sensor types
|
||||
- Fix segfault in SOL
|
||||
- Fix bug that caused infinite loop on BMCs with empty SDRs
|
||||
- Fix to move out Kontron OEM sensor resolution for other OEMs which could
|
||||
lead to bad event descriptions
|
||||
- Add new FRU edit mode thereby allowing serial numbers, etc. to be changed;
|
||||
improvements to OEM edit mode
|
||||
- Added SPD support for parms: channel number, max read size
|
||||
- Add SDR support for adding SDR records from a dumped file, clearing SDR,
|
||||
adding partial SDR records
|
||||
- Add updates and fixes to hpmfwupg: upload block size to 32 bytes for KCS,
|
||||
handle long response option, implement rollback override, garbage output fix
|
||||
- Add double bridge lan support , fix bridging issue
|
||||
- Add HPM support to pre-check which components need to be skipped
|
||||
- Fix autodetection of maximum packet size when using IPMB
|
||||
- Add new Kontron OEM command to set the BIOS boot option sequence
|
||||
- Add support for dual-bridge/ dual send message
|
||||
- Add auto-detect for local IPMB address using PICMG 2.X extension
|
||||
- Add support for HPM.1 1.0 specification compliance
|
||||
- Fix for improper lan/lanplus addressing
|
||||
- Added transit_channel and transit_addr to ipmi_intf struct
|
||||
- Fix bad password assertion bug due to rakp2 HMAC not being checked properly
|
||||
- Added ability to interpret PPS shelf manager clia sel dump
|
||||
- Corrected PICMG M7 state event definition macros
|
||||
- Added FRU parsing enhancements
|
||||
- Added "isol info", "isol set" and "isol activate" commands to support
|
||||
Intel IPMI v1.5 SOL functionality. Removed "isol setup" command.
|
||||
- Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
|
||||
- Fix bug in "chassis poh" command.
|
||||
- Fix HPM.1 upgrade to apply to only given component when instructed to do so
|
||||
- Added configure auto-detection if dual bridge extension is supported
|
||||
by OpenIPMI
|
||||
|
||||
* Tue Mar 6 2007 <pere@hungry.com> 1.8.9-1
|
||||
- Added initial AMC ekey query operation support
|
||||
- Improvements to ekeying support (PICMG 3.x only)
|
||||
- Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
- Added edit support for AMC activation "Maximum Internal Current"
|
||||
- Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
- Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
- Fix lan set access command to use value already saved within parameters
|
||||
for PEF and authentication
|
||||
- Fix bug in cmd ipmitool lan stats get 1
|
||||
- Add support to allow ipmitool/ipmievd to target specific device nodes
|
||||
on multi-BMC systems
|
||||
- Add support for name+privilege lookup for lanplus sessions
|
||||
- Fix time_t conversion bug for 64-bit OS
|
||||
- Added prefix of hostname on sel ipmievd sessions
|
||||
- Fixed FWUM Get Info
|
||||
- Fix ipmievd fd closing bug
|
||||
- Add set-in-progress flag support to chassis bootdev
|
||||
- Added new chassis bootdev options
|
||||
- Add sol payload enable/disable comman
|
||||
- Fix SOL set errors when commit-write not supported
|
||||
- Fix reset of session timeout for lanplus interface
|
||||
- Fixed lan interface accessibility timeout handling
|
||||
- Fix bug with Function Get Channel Cipher Suites command when more
|
||||
than 1 page used.
|
||||
- Fix missing firmware firewall top-level command
|
||||
- Fix bug in SOL keepalive functionality
|
||||
- Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
- Added ipmi_sel_get_oem_sensor* APIs
|
||||
- Added HPM.1 support
|
||||
- Fix segfault when incorrect oem option supplied
|
||||
- Fix bus problem with spd command
|
||||
- Fix segfault in SOL when remote BMC does not return packet
|
||||
- Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
- Added lan packet size reduction mechanism
|
||||
- Fix bug with sendMessage of bad length with different target
|
||||
- Fix for big endian (PPC) architecture
|
||||
- NetBSD fixes
|
||||
- Fix segfault and channel problem with user priv command
|
||||
- Add support for bus/chan on i2c raw command
|
||||
- Add freeipmi interface support
|
||||
- Add remote spd printing
|
||||
- Add better detection of linux/compiler.h to config
|
||||
- Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
* 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
|
||||
|
@ -4,7 +4,7 @@ ARCH="@ARCH@"
|
||||
VERSION="@VERSION@"
|
||||
CATEGORY="system"
|
||||
VENDOR="Duncan Laurie"
|
||||
EMAIL="duncan@sun.com"
|
||||
EMAIL="duncan@iceblink.org"
|
||||
PSTAMP="@PSTAMP@"
|
||||
BASEDIR="@BASEDIR@"
|
||||
CLASSES="none"
|
||||
|
@ -1,7 +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
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
%_buildroot %{_topdir}/%{_tmppath}/%{name}-%{version}-root
|
||||
%_rpmdir %{_topdir}/RPMS
|
||||
%_srcrpmdir %{_topdir}/SRPMS
|
||||
%_distro @DISTRO@
|
||||
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
|
||||
%packager duncan@iceblink.org
|
||||
%packager jmank@hp.com
|
||||
%distribution Sourceforge Build
|
@ -1 +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,3 +1,176 @@
|
||||
version (1.8.11) unstable; urgency=low
|
||||
* Fix new GCC compilation issues in regards to Packing
|
||||
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
|
||||
for 2.4 kernel instead of ipmi_si_drv driver module
|
||||
* New -y option added to allow specification of kg keys with
|
||||
non-printable characters
|
||||
* New -K option added to allow kgkey settings via environmental
|
||||
variable IPMI_KGKEY
|
||||
* Generic device support added for EEPROM with SDR Type 10h (gendev)
|
||||
* Fix to lan-bridging for a double-bridging crash and to fix
|
||||
an issue with bridging multiple concurrent requests and
|
||||
erroneous handling of raw Send Message
|
||||
* Lanplus fix for commands like 'sensor list' without the -t option
|
||||
causing wrong double bridged requests of a sensor is located
|
||||
on another satellite controller
|
||||
* Fix lan and lanplus request list entry removal bugs
|
||||
* Fix non-working issue when trying to send a bridge message with
|
||||
Cipher 3
|
||||
* Change bridge message handling to reuse command ipmi_lan_poll_recv
|
||||
* Added PICMG 2.0 and 2.3 support
|
||||
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
|
||||
values for "major" and "minor" fields
|
||||
* Add IANA support for Pigeon Point
|
||||
* Add OEM SW/FW Record identification
|
||||
* Fix to include I2C and LUN addresses so sensors are correctly managed
|
||||
* Patch ID 1990560 to get readings from non-linear analog sensors
|
||||
* Add support for SOL payload status command
|
||||
* SOL set parameter range checking added
|
||||
* Fixed SOL activate options usage
|
||||
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
|
||||
* Added retries to SOL keepalive
|
||||
* Fixed wrong mask values for Front Panel disable/enable status
|
||||
* Add support to access fru internal use area
|
||||
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
|
||||
blocks of data within the FRU storage area to be write
|
||||
protected.
|
||||
* Fix node reporting in GUID; Tracker bug #2339675
|
||||
* Fix watchdog use/action print strings
|
||||
* Fix endian bug in SDR add from file; Tracker bug #2075258
|
||||
* Fix crash when dumping SDRs in a file and there's an error
|
||||
getting an SDR; improve algorithm for optimal packet size
|
||||
* Fix occasional SDR dump segfault; #1793076
|
||||
* Allow ipmitool sel delete to accept hex list entry numbers
|
||||
* Fix SEL total space reporting.
|
||||
* Fix for garbage sensor threshold values reported when none
|
||||
returned. Tracker Bug #863748
|
||||
* ipmievd change to Monitor %used in SEL buffer and log warnings when
|
||||
the buffer is 80% and 100% full
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Wed, 25 Feb 2009 09:44:31 +0200
|
||||
|
||||
ipmitool (1.8.10) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
* Patch to allow Debian package builds from cvs.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Fri, 8 Aug 2008 09:44:31 +0200
|
||||
|
||||
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
|
||||
@ -55,7 +228,7 @@ ipmitool (1.5.9) unstable; urgency=low
|
||||
* Add configure option for changing binary to ipmiadm for Solaris
|
||||
* Fix compile problem on Solaris 8
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Sat, 27 Mar 2004 00:11:37 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Sat, 27 Mar 2004 00:11:37 -0700
|
||||
|
||||
ipmitool (1.5.8) unstable; urgency=low
|
||||
|
||||
@ -69,7 +242,7 @@ ipmitool (1.5.8) unstable; urgency=low
|
||||
* Add support for Linux kernel panic messages in SEL output
|
||||
* Add support for type 3 SDR records
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Tue, 27 Jan 2004 16:23:25 -0700
|
||||
-- Duncan Laurie <duncan@iceblink.org> Tue, 27 Jan 2004 16:23:25 -0700
|
||||
|
||||
ipmitool (1.5.7) unstable; urgency=low
|
||||
|
||||
@ -78,49 +251,49 @@ ipmitool (1.5.7) unstable; urgency=low
|
||||
* better handling of SDR printing
|
||||
* contrib scripts for creating rrdtool graphs
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Mon, 5 Jan 2004 17:29:50 -0700
|
||||
-- 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 <EFBFBD>hrn
|
||||
* Fix for CSV display of sensor readings/units from Fredrik Öhrn
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Thu, 4 Dec 2003 14:47:19 -0700
|
||||
-- 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@sun.com> Tue, 25 Nov 2003 15:10:48 -0700
|
||||
-- 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
|
||||
|
||||
@ -128,24 +301,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@iceblink.org>
|
||||
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, autoconf, automake1.9 | automake, autotools-dev, libtool
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: ipmitool
|
||||
Architecture: i386 amd64
|
||||
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/sbin
|
||||
usr/share/ipmitool
|
||||
usr/share/doc/ipmitool
|
||||
|
@ -1,4 +1,2 @@
|
||||
README
|
||||
COPYING
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
|
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,6 +18,9 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
|
||||
./bootstrap
|
||||
|
||||
./configure --prefix=/usr \
|
||||
--with-kerneldir \
|
||||
--mandir=/usr/share/man
|
||||
@ -41,10 +44,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 +74,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 +92,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_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,14 +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)
|
||||
|
||||
|
231
ipmitool/doc/ipmievd.8
Normal file
231
ipmitool/doc/ipmievd.8
Normal file
@ -0,0 +1,231 @@
|
||||
.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\-d \fIN\fP\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\-d \fIN\fP\fR
|
||||
Use device number N to specify the /dev/ipmiN (or
|
||||
/dev/ipmi/N or /dev/ipmidev/N) device to use for in-band
|
||||
BMC communication. Used to target a specific BMC on a
|
||||
multi-node, multi-BMC system through the ipmi device
|
||||
driver interface. Default is 0.
|
||||
.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\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.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\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.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
|
||||
|
||||
|
@ -27,17 +27,16 @@
|
||||
# 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
|
||||
|
||||
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 \
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.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_oem.h ipmi_sdradd.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 ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
|
||||
ipmi_delloem.h ipmi_dcmi.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_BSWAP_H
|
||||
@ -41,6 +37,9 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#undef BSWAP_16
|
||||
#undef BSWAP_32
|
||||
|
||||
#if HAVE_BYTESWAP_H
|
||||
# include <byteswap.h>
|
||||
# define BSWAP_16(x) bswap_16(x)
|
||||
|
@ -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_HELPER_H
|
||||
@ -40,13 +36,61 @@
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef tboolean
|
||||
#define tboolean int
|
||||
#endif
|
||||
|
||||
/* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */
|
||||
#ifndef IPMI_UID_MIN
|
||||
# define IPMI_UID_MIN 1
|
||||
#endif
|
||||
#ifndef IPMI_UID_MAX
|
||||
# define IPMI_UID_MAX 63
|
||||
#endif
|
||||
|
||||
struct ipmi_intf;
|
||||
|
||||
struct valstr {
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
struct oemvalstr {
|
||||
uint32_t oem;
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr * vs);
|
||||
const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs);
|
||||
|
||||
int str2double(const char * str, double * double_ptr);
|
||||
int str2long(const char * str, int64_t * lng_ptr);
|
||||
int str2ulong(const char * str, uint64_t * ulng_ptr);
|
||||
int str2int(const char * str, int32_t * int_ptr);
|
||||
int str2uint(const char * str, uint32_t * uint_ptr);
|
||||
int str2short(const char * str, int16_t * shrt_ptr);
|
||||
int str2ushort(const char * str, uint16_t * ushrt_ptr);
|
||||
int str2char(const char * str, int8_t * chr_ptr);
|
||||
int str2uchar(const char * str, uint8_t * uchr_ptr);
|
||||
|
||||
int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr);
|
||||
int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr);
|
||||
int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
uint16_t buf2short(uint8_t * buf);
|
||||
uint32_t buf2long(uint8_t * buf);
|
||||
@ -54,6 +98,7 @@ 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(struct ipmi_intf *intf);
|
||||
|
||||
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
|
||||
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
|
||||
@ -62,4 +107,16 @@ FILE * ipmi_open_file(const char * file, int rw);
|
||||
# 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
|
||||
@ -43,12 +39,25 @@
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_cc.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
#if HAVE_PRAGMA_PACK
|
||||
#define ATTRIBUTE_PACKING
|
||||
#else
|
||||
#define ATTRIBUTE_PACKING __attribute__ ((packed))
|
||||
#endif
|
||||
|
||||
|
||||
/* 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
|
||||
@ -56,13 +65,13 @@
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_3 0x14
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_4 0x15
|
||||
|
||||
|
||||
extern int verbose;
|
||||
extern int csv_output;
|
||||
|
||||
struct ipmi_rq {
|
||||
struct {
|
||||
uint8_t netfn;
|
||||
uint8_t netfn:6;
|
||||
uint8_t lun:2;
|
||||
uint8_t cmd;
|
||||
uint8_t target_cmd;
|
||||
uint16_t data_len;
|
||||
@ -70,50 +79,49 @@ struct ipmi_rq {
|
||||
} 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;
|
||||
uint8_t payload_type;
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
uint8_t rq_seq;
|
||||
struct ipmi_rq * request;
|
||||
uint8_t rq_seq;
|
||||
struct ipmi_rq *request;
|
||||
} ipmi_request;
|
||||
|
||||
struct {
|
||||
uint8_t rs_seq;
|
||||
struct ipmi_rs * response;
|
||||
uint8_t rs_seq;
|
||||
struct ipmi_rs *response;
|
||||
} ipmi_response;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t * request;
|
||||
uint8_t *request;
|
||||
} open_session_request;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t * message;
|
||||
uint8_t *message;
|
||||
} rakp_1_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t * message;
|
||||
uint8_t *message;
|
||||
} rakp_2_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t * message;
|
||||
uint8_t *message;
|
||||
} rakp_3_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t * message;
|
||||
uint8_t *message;
|
||||
} rakp_4_message;
|
||||
|
||||
struct {
|
||||
@ -122,32 +130,28 @@ struct ipmi_v2_payload {
|
||||
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 */
|
||||
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_intf *intf;
|
||||
uint8_t rq_seq;
|
||||
uint8_t * msg_data;
|
||||
uint8_t *msg_data;
|
||||
int msg_len;
|
||||
struct ipmi_rq_entry * next;
|
||||
int bridging_level;
|
||||
struct ipmi_rq_entry *next;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct ipmi_rs {
|
||||
uint8_t ccode;
|
||||
uint8_t data[IPMI_BUF_SIZE];
|
||||
@ -166,19 +170,18 @@ struct ipmi_rs {
|
||||
} 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 */
|
||||
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
|
||||
*/
|
||||
@ -196,8 +199,8 @@ struct ipmi_rs {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
uint8_t max_priv_level;
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
uint8_t auth_alg;
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
@ -205,45 +208,82 @@ struct ipmi_rs {
|
||||
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 */
|
||||
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;
|
||||
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 */
|
||||
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
|
||||
#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_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_PICMG 0x2C
|
||||
#define IPMI_NETFN_DCGRP 0x2C
|
||||
#define IPMI_NETFN_OEM 0x2E
|
||||
#define IPMI_NETFN_ISOL 0x34
|
||||
#define IPMI_NETFN_TSOL 0x30
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_HP = 11,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_NOKIA = 94,
|
||||
IPMI_OEM_BULL = 107,
|
||||
IPMI_OEM_HITACHI_116 = 116,
|
||||
IPMI_OEM_NEC = 119,
|
||||
IPMI_OEM_TOSHIBA = 186,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TATUNG = 373,
|
||||
IPMI_OEM_HITACHI_399 = 399,
|
||||
IPMI_OEM_DELL = 674,
|
||||
IPMI_OEM_LMC = 2168,
|
||||
IPMI_OEM_RADISYS = 4337,
|
||||
IPMI_OEM_BROADCOM = 4413,
|
||||
IPMI_OEM_MAGNUM = 5593,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_FUJITSU_SIEMENS = 10368,
|
||||
IPMI_OEM_AVOCENT = 10418,
|
||||
IPMI_OEM_PEPPERCON = 10437,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_OSA = 11102,
|
||||
IPMI_OEM_GOOGLE = 11129,
|
||||
IPMI_OEM_PICMG = 12634,
|
||||
IPMI_OEM_RARITAN = 13742,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
IPMI_OEM_PPS = 16394,
|
||||
IPMI_OEM_AMI = 20974,
|
||||
IPMI_OEM_NOKIA_SIEMENS_NETWORKS = 28458
|
||||
} IPMI_OEM;
|
||||
|
||||
extern const struct valstr completion_code_vals[];
|
||||
|
||||
#endif /* IPMI_H */
|
||||
#endif /* IPMI_H */
|
||||
|
76
ipmitool/include/ipmitool/ipmi_cc.h
Normal file
76
ipmitool/include/ipmitool/ipmi_cc.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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_CC_H
|
||||
#define IPMI_CC_H
|
||||
|
||||
/*
|
||||
Thu Jan 11 09:32:41 2007
|
||||
francois.isabelle@ca.kontron.com
|
||||
|
||||
I just noticed that most modules refer to IPMI completion codes using
|
||||
hard coded values ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* CC
|
||||
* See IPMI specification table 5-2 Generic Completion Codes
|
||||
*/
|
||||
|
||||
#define IPMI_CC_OK 0x00
|
||||
#define IPMI_CC_NODE_BUSY 0xc0
|
||||
#define IPMI_CC_INV_CMD 0xc1
|
||||
#define IPMI_CC_INV_CMD_FOR_LUN 0xc2
|
||||
#define IPMI_CC_TIMEOUT 0xc3
|
||||
#define IPMI_CC_OUT_OF_SPACE 0xc4
|
||||
#define IPMI_CC_RES_CANCELED 0xc5
|
||||
#define IPMI_CC_REQ_DATA_TRUNC 0xc6
|
||||
#define IPMI_CC_REQ_DATA_INV_LENGTH 0xc7
|
||||
#define IPMI_CC_REQ_DATA_FIELD_EXCEED 0xc8
|
||||
#define IPMI_CC_PARAM_OUT_OF_RANGE 0xc9
|
||||
#define IPMI_CC_CANT_RET_NUM_REQ_BYTES 0xca
|
||||
#define IPMI_CC_REQ_DATA_NOT_PRESENT 0xcb
|
||||
#define IPMI_CC_INV_DATA_FIELD_IN_REQ 0xcc
|
||||
#define IPMI_CC_ILL_SENSOR_OR_RECORD 0xcd
|
||||
#define IPMI_CC_RESP_COULD_NOT_BE_PRV 0xce
|
||||
#define IPMI_CC_CANT_RESP_DUPLI_REQ 0xcf
|
||||
#define IPMI_CC_CANT_RESP_SDRR_UPDATE 0xd0
|
||||
#define IPMI_CC_CANT_RESP_FIRM_UPDATE 0xd1
|
||||
#define IPMI_CC_CANT_RESP_BMC_INIT 0xd2
|
||||
#define IPMI_CC_DESTINATION_UNAVAILABLE 0xd3
|
||||
#define IPMI_CC_INSUFFICIENT_PRIVILEGES 0xd4
|
||||
#define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5
|
||||
#define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6
|
||||
#define IPMI_CC_UNSPECIFIED_ERROR 0xff
|
||||
|
||||
|
||||
#endif /*IPMI_CC_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_CHANNEL_H
|
||||
@ -42,20 +38,25 @@
|
||||
#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_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
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_auth_cap_rsp {
|
||||
uint8_t channel_number;
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -86,16 +87,19 @@ struct get_channel_auth_cap_rsp {
|
||||
#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 */
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 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 ipmiv20_support : 1; /* channel supports IPMI v2.0 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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -103,6 +107,9 @@ struct get_channel_auth_cap_rsp {
|
||||
* The Get Channel Info response structure
|
||||
* From table 22-29 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_info_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 4;
|
||||
@ -134,7 +141,10 @@ struct get_channel_info_rsp {
|
||||
#endif
|
||||
uint8_t vendor_id[3]; /* For OEM that specified the protocol */
|
||||
uint8_t aux_info[2]; /* Not used*/
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -142,6 +152,9 @@ struct get_channel_info_rsp {
|
||||
* The Get Channel Access response structure
|
||||
* From table 22-28 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
@ -163,9 +176,14 @@ struct get_channel_access_rsp {
|
||||
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
uint8_t __reserved2 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved1 : 2;
|
||||
@ -192,8 +210,14 @@ struct get_user_access_rsp {
|
||||
uint8_t callin_callback : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct set_user_access_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t change_bits : 1;
|
||||
@ -220,7 +244,10 @@ struct set_user_access_data {
|
||||
uint8_t session_limit : 4;
|
||||
uint8_t __reserved3 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
|
||||
uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
|
||||
|
@ -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*/
|
||||
|
@ -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_CONSTANTS_H
|
||||
@ -42,9 +38,9 @@
|
||||
* 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_SOL_ACTIVATING 0x20
|
||||
#define IPMI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IPMI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
@ -55,6 +51,8 @@
|
||||
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
|
||||
#define IPMI_GET_SEL_TIME 0x48
|
||||
#define IPMI_SET_SEL_TIME 0x49
|
||||
#define IPMI_SET_USER_PAYLOAD_ACCESS 0x4c
|
||||
#define IPMI_GET_USER_PAYLOAD_ACCESS 0x4d
|
||||
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02
|
||||
@ -70,6 +68,7 @@
|
||||
#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
|
||||
@ -81,7 +80,7 @@
|
||||
#define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
|
||||
#define IPMI_CHANNEL_MEDIUM_RESERVED 0x0
|
||||
#define IPMI_CHANNEL_MEDIUM_IPMB 0x1
|
||||
#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
|
||||
@ -94,4 +93,42 @@
|
||||
#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
|
||||
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS 0
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT 1
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN 2
|
||||
#define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID 3
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INFO_ACK 4
|
||||
#define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS 5
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_INFO 6
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX 7
|
||||
|
||||
/* 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*/
|
||||
|
129
ipmitool/include/ipmitool/ipmi_dcmi.h
Normal file
129
ipmitool/include/ipmitool/ipmi_dcmi.h
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* All rights reserved
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef IPMI_DCMI_H
|
||||
#define IPMI_DCMI_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* DCMI commands per DCMI 1.5 SPEC */
|
||||
|
||||
#define IPMI_DCMI 0xDC /* Group Extension Identification */
|
||||
#define IPMI_DCMI_COMPAT 0x01
|
||||
#define IPMI_DCMI_GETRED 0x02
|
||||
#define IPMI_DCMI_GETLMT 0x03
|
||||
#define IPMI_DCMI_SETLMT 0x04
|
||||
#define IPMI_DCMI_PWRACT 0x05
|
||||
#define IPMI_DCMI_GETASSET 0x06
|
||||
#define IPMI_DCMI_SETASSET 0x08
|
||||
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
|
||||
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
|
||||
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
|
||||
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
|
||||
#define IPMI_DCMI_GETSNSR 0x07
|
||||
#define IPMI_DCMI_PWRMGT 0x08
|
||||
#define IPMI_DCMI_GETTEMPRED 0x10
|
||||
#define IPMI_DCMI_SETCONFPARAM 0x12
|
||||
#define IPMI_DCMI_GETCONFPARAM 0x13
|
||||
|
||||
#define IPMI_DCMI_CONFORM 0x0001
|
||||
#define IPMI_DCMI_1_1_CONFORM 0x0101
|
||||
#define IPMI_DCMI_1_5_CONFORM 0x0501
|
||||
|
||||
#define DCMI_MAX_BYTE_SIZE 0x10
|
||||
#define DCMI_MAX_BYTE_TEMP_READ_SIZE 0x08
|
||||
|
||||
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
|
||||
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
|
||||
|
||||
|
||||
struct dcmi_cmd {
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* make a struct for the return from the get limit command */
|
||||
struct power_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t reserved_1; /* second and third bytes are reserved */
|
||||
uint8_t action; /* fourth byte is the exception action */
|
||||
uint16_t limit; /* fifth through sixth byte are the power limit in watts */
|
||||
uint32_t correction; /* seventh - 10th bytes are the correction period */
|
||||
uint16_t reserved_2; /* 11th - 12th are reserved bytes */
|
||||
uint16_t sample; /* 13th - 14th are sample period time */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the reading command */
|
||||
struct power_reading {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t curr_pwr;
|
||||
uint16_t min_sample;
|
||||
uint16_t max_sample;
|
||||
uint16_t avg_pwr;
|
||||
uint32_t time_stamp; /* time since epoch */
|
||||
uint32_t sample;
|
||||
uint8_t state;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the capabilites command */
|
||||
struct capabilities {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t conformance;
|
||||
uint8_t revision;
|
||||
uint8_t data_byte1;
|
||||
uint8_t data_byte2;
|
||||
uint8_t data_byte3;
|
||||
uint8_t data_byte4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the sensor info command */
|
||||
struct sensor_info {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t i_instances;
|
||||
uint8_t i_records;
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get asset tag command */
|
||||
struct asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the set asset tag command */
|
||||
struct set_asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
uint8_t *data;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get thermal limit command */
|
||||
struct thermal_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t exceptionActions;
|
||||
uint8_t tempLimit;
|
||||
uint16_t exceptionTime;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /*IPMI_DCMI_H*/
|
366
ipmitool/include/ipmitool/ipmi_delloem.h
Normal file
366
ipmitool/include/ipmitool/ipmi_delloem.h
Normal file
@ -0,0 +1,366 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2008, Dell 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions 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 Inc nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
*****************************************************************************/
|
||||
#ifndef IPMI_DELLOEM_H
|
||||
#define IPMI_DELLOEM_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* Dell selector for LCD control - get and set unless specified */
|
||||
#define IPMI_DELL_LCD_STRING_SELECTOR 0xC1 /* RW get/set the user string */
|
||||
#define IPMI_DELL_LCD_CONFIG_SELECTOR 0xC2 /* RW set to user/default/none */
|
||||
#define IPMI_DELL_LCD_GET_CAPS_SELECTOR 0xCF /* RO use when available*/
|
||||
#define IPMI_DELL_LCD_STRINGEX_SELECTOR 0xD0 /* RW get/set the user string use first when available*/
|
||||
#define IPMI_DELL_LCD_STATUS_SELECTOR 0xE7 /* LCD string when config set to default.*/
|
||||
#define IPMI_DELL_PLATFORM_MODEL_NAME_SELECTOR 0xD1 /* LCD string when config set to default.*/
|
||||
|
||||
/* Dell defines for picking which string to use */
|
||||
#define IPMI_DELL_LCD_CONFIG_USER_DEFINED 0x00 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_CONFIG_DEFAULT 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_CONFIG_NONE 0x02 /* blank*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV4ADRESS 0x04 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_IDRAC_MAC_ADDRESS 0x08 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_OS_SYSTEM_NAME 0x10 /* blank*/
|
||||
|
||||
#define IPMI_DELL_LCD_SERVICE_TAG 0x20 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV6ADRESS 0x40 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_AMBEINT_TEMP 0x80 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_SYSTEM_WATTS 0x100 /* blank*/
|
||||
#define IPMI_DELL_LCD_ASSET_TAG 0x200
|
||||
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_SEL 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_VERBOSE 0x02 /* blank*/
|
||||
|
||||
#define IPMI_DELL_IDRAC_VALIDATOR 0xDD
|
||||
#define IPMI_DELL_POWER_CAP_STATUS 0xBA
|
||||
#define IPMI_DELL_AVG_POWER_CONSMP_HST 0xEB
|
||||
#define IPMI_DELL_PEAK_POWER_CONSMP_HST 0xEC
|
||||
#define SYSTEM_BOARD_SYSTEM_LEVEL_SENSOR_NUM 0x98
|
||||
|
||||
#define IDRAC_11G 1
|
||||
#define IDRAC_12G 2
|
||||
// Return Error code for license
|
||||
#define LICENSE_NOT_SUPPORTED 0x6F
|
||||
#define VFL_NOT_LICENSED 0x33
|
||||
#define btuphr 0x01
|
||||
#define watt 0x00
|
||||
#define IPMI_DELL_POWER_CAP 0xEA
|
||||
#define percent 0x03
|
||||
|
||||
/* Not on all Dell servers. If there, use it.*/
|
||||
typedef struct _tag_ipmi_dell_lcd_caps
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t char_set; /* always 1 for printable ASCII 0x20-0x7E */
|
||||
uint8_t number_lines; /* 0-4, 1 for 9G. 10G tbd */
|
||||
uint8_t max_chars[4]; /* 62 for triathlon, 0 if not present (glacier) */
|
||||
/* [0] is max chars for line 1 */
|
||||
}IPMI_DELL_LCD_CAPS;
|
||||
|
||||
#define IPMI_DELL_LCD_STRING_LENGTH_MAX 62 /* Valid for 9G. Glacier ??. */
|
||||
#define IPMI_DELL_LCD_STRING1_SIZE 14
|
||||
#define IPMI_DELL_LCD_STRINGN_SIZE 16
|
||||
|
||||
/* vFlash subcommands */
|
||||
#define IPMI_GET_EXT_SD_CARD_INFO 0xA4
|
||||
|
||||
|
||||
typedef struct _tag_ipmi_dell_lcd_string
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
}selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
}lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRING;
|
||||
|
||||
/* Only found on servers with more than 1 line. Use if available. */
|
||||
typedef struct _tag_ipmi_dell_lcd_stringex
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t line_number; /* LCD line number 1 to 4 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
} selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
} lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRINGEX;
|
||||
|
||||
|
||||
typedef struct _lcd_status
|
||||
{
|
||||
char parametersel;
|
||||
char vKVM_status;
|
||||
char lock_status;
|
||||
char Resv1;
|
||||
char Resv;
|
||||
} __attribute__ ((packed)) LCD_STATUS;
|
||||
|
||||
typedef struct _lcd_mode
|
||||
{
|
||||
uint8_t parametersel;
|
||||
uint32_t lcdmode;
|
||||
uint16_t lcdquallifier;
|
||||
uint32_t capabilites;
|
||||
uint8_t error_display;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) LCD_MODE;
|
||||
|
||||
#define PARAM_REV_OFFSET (uint8_t)(0x1)
|
||||
#define VIRTUAL_MAC_OFFSET (uint8_t)(0x1)
|
||||
|
||||
#define LOM_MACTYPE_ETHERNET 0
|
||||
#define LOM_MACTYPE_ISCSI 1
|
||||
#define LOM_MACTYPE_RESERVED 3
|
||||
|
||||
#define LOM_ETHERNET_ENABLED 0
|
||||
#define LOM_ETHERNET_DISABLED 1
|
||||
#define LOM_ETHERNET_PLAYINGDEAD 2
|
||||
#define LOM_ETHERNET_RESERVED 3
|
||||
|
||||
#define LOM_ACTIVE 1
|
||||
#define LOM_INACTIVE 0
|
||||
|
||||
#define MACADDRESSLENGH 6
|
||||
#define MAX_LOM 8
|
||||
|
||||
|
||||
#define EMB_NIC_MAC_ADDRESS_11G (uint8_t)(0xDA)
|
||||
#define EMB_NIC_MAC_ADDRESS_9G_10G (uint8_t)(0xCB)
|
||||
|
||||
#define IMC_IDRAC_10G (uint8_t) (0x08)
|
||||
#define IMC_CMC (uint8_t) (0x09)
|
||||
#define IMC_IDRAC_11G_MONOLITHIC (uint8_t) (0x0A)
|
||||
#define IMC_IDRAC_11G_MODULAR (uint8_t) (0x0B)
|
||||
#define IMC_UNUSED (uint8_t) (0x0C)
|
||||
#define IMC_MASER_LITE_BMC (uint8_t) (0x0D)
|
||||
#define IMC_MASER_LITE_NU (uint8_t) (0x0E)
|
||||
#define IMC_IDRAC_12G_MONOLITHIC (uint8_t) (0x10)
|
||||
#define IMC_IDRAC_12G_MODULAR (uint8_t) (0x11)
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int BladSlotNumber : 4;
|
||||
unsigned int MacType : 2;
|
||||
unsigned int EthernetStatus : 2;
|
||||
unsigned int NICNumber : 5;
|
||||
unsigned int Reserved : 3;
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} LOMMacAddressType;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LOMMacAddressType LOMMacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} MacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MacAddressType MacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType_10G;
|
||||
|
||||
|
||||
|
||||
#define TRANSPORT_NETFN (uint8_t)(0xc)
|
||||
#define GET_LAN_PARAM_CMD (uint8_t)(0x02)
|
||||
#define MAC_ADDR_PARAM (uint8_t)(0x05)
|
||||
#define LAN_CHANNEL_NUMBER (uint8_t)(0x01)
|
||||
|
||||
#define IDRAC_NIC_NUMBER (uint8_t)(0x8)
|
||||
|
||||
#define TOTAL_N0_NICS_INDEX (uint8_t)(0x1)
|
||||
|
||||
|
||||
// 12g supported
|
||||
#define SET_NIC_SELECTION_12G_CMD (uint8_t)(0x28)
|
||||
#define GET_NIC_SELECTION_12G_CMD (uint8_t)(0x29)
|
||||
|
||||
// 11g supported
|
||||
#define SET_NIC_SELECTION_CMD (uint8_t)(0x24)
|
||||
#define GET_NIC_SELECTION_CMD (uint8_t)(0x25)
|
||||
#define GET_ACTIVE_NIC_CMD (uint8_t)(0xc1)
|
||||
#define POWER_EFFICENCY_CMD (uint8_t)(0xc0)
|
||||
#define SERVER_POWER_CONSUMPTION_CMD (uint8_t)(0x8F)
|
||||
|
||||
#define POWER_SUPPLY_INFO (uint8_t)(0xb0)
|
||||
#define IPMI_ENTITY_ID_POWER_SUPPLY (uint8_t)(0x0a)
|
||||
#define SENSOR_STATE_STR_SIZE (uint8_t)(64)
|
||||
#define SENSOR_NAME_STR_SIZE (uint8_t)(64)
|
||||
|
||||
#define GET_PWRMGMT_INFO_CMD (uint8_t)(0x9C)
|
||||
#define CLEAR_PWRMGMT_INFO_CMD (uint8_t)(0x9D)
|
||||
#define GET_PWR_HEADROOM_CMD (uint8_t)(0xBB)
|
||||
#define GET_PWR_CONSUMPTION_CMD (uint8_t)(0xB3)
|
||||
#define GET_FRONT_PANEL_INFO_CMD (uint8_t)0xb5
|
||||
|
||||
|
||||
typedef struct _ipmi_power_monitor
|
||||
{
|
||||
uint32_t cumStartTime;
|
||||
uint32_t cumReading;
|
||||
uint32_t maxPeakStartTime;
|
||||
uint32_t ampPeakTime;
|
||||
uint16_t ampReading;
|
||||
uint32_t wattPeakTime;
|
||||
uint16_t wattReading;
|
||||
} __attribute__ ((packed)) IPMI_POWER_MONITOR;
|
||||
|
||||
|
||||
#define MAX_POWER_FW_VERSION 8
|
||||
|
||||
typedef struct _ipmi_power_supply_infoo
|
||||
{
|
||||
/*No param_rev it is not a System Information Command */
|
||||
uint16_t ratedWatts;
|
||||
uint16_t ratedAmps;
|
||||
uint16_t ratedVolts;
|
||||
uint32_t vendorid;
|
||||
uint8_t FrimwareVersion[MAX_POWER_FW_VERSION];
|
||||
uint8_t Powersupplytype;
|
||||
uint16_t ratedDCWatts;
|
||||
uint16_t Resv;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_POWER_SUPPLY_INFO;
|
||||
|
||||
|
||||
typedef struct ipmi_power_consumption_data
|
||||
{
|
||||
uint16_t actualpowerconsumption;
|
||||
uint16_t powerthreshold;
|
||||
uint16_t warningthreshold;
|
||||
uint8_t throttlestate;
|
||||
uint16_t maxpowerconsumption;
|
||||
uint16_t throttlepowerconsumption;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMPTION_DATA;
|
||||
|
||||
|
||||
typedef struct ipmi_inst_power_consumption_data
|
||||
{
|
||||
uint16_t instanpowerconsumption;
|
||||
uint16_t instanApms;
|
||||
uint16_t resv1;
|
||||
uint8_t resv;
|
||||
} __attribute__ ((packed)) IPMI_INST_POWER_CONSUMPTION_DATA;
|
||||
|
||||
typedef struct _ipmi_avgpower_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_AVGPOWER_CONSUMP_HISTORY;
|
||||
|
||||
typedef struct _ipmi_power_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
uint32_t lastminutepowertime;
|
||||
uint32_t lasthourpowertime;
|
||||
uint32_t lastdaypowertime;
|
||||
uint32_t lastweekpowertime;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMP_HISTORY;
|
||||
|
||||
|
||||
typedef struct _ipmi_delloem_power_cap
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t PowerCap;
|
||||
uint8_t unit;
|
||||
uint16_t MaximumPowerConsmp;
|
||||
uint16_t MinimumPowerConsmp;
|
||||
uint16_t totalnumpowersupp;
|
||||
uint16_t AvailablePower ;
|
||||
uint16_t SystemThrottling;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CAP;
|
||||
|
||||
typedef struct _power_headroom
|
||||
{
|
||||
uint16_t instheadroom;
|
||||
uint16_t peakheadroom;
|
||||
} __attribute__ ((packed)) POWER_HEADROOM;
|
||||
|
||||
struct vFlashstr {
|
||||
uint8_t val;
|
||||
const char * str;
|
||||
};
|
||||
typedef struct ipmi_vFlash_extended_info
|
||||
{
|
||||
uint8_t vflashcompcode;
|
||||
uint8_t sdcardstatus;
|
||||
uint32_t sdcardsize;
|
||||
uint32_t sdcardavailsize;
|
||||
uint8_t bootpartion;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_DELL_SDCARD_INFO;
|
||||
|
||||
|
||||
typedef struct _SensorReadingType
|
||||
{
|
||||
uint8_t sensorReading;
|
||||
uint8_t sensorFlags;
|
||||
uint16_t sensorState;
|
||||
}SensorReadingType;
|
||||
uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage);
|
||||
int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /*IPMI_DELLOEM_H*/
|
68
ipmitool/include/ipmitool/ipmi_ekanalyzer.h
Normal file
68
ipmitool/include/ipmitool/ipmi_ekanalyzer.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2007 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_EKANALYZER_H
|
||||
#define IPMI_EKANALYZER_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
#define RTM_FRU_FILE 0x00
|
||||
#define A1_AMC_FRU_FILE 0x01
|
||||
#define A2_AMC_FRU_FILE 0x02
|
||||
#define A3_AMC_FRU_FILE 0x03
|
||||
#define A4_AMC_FRU_FILE 0x04
|
||||
#define B1_AMC_FRU_FILE 0x05
|
||||
#define B2_AMC_FRU_FILE 0x06
|
||||
#define B3_AMC_FRU_FILE 0x07
|
||||
#define B4_AMC_FRU_FILE 0x08
|
||||
#define ON_CARRIER_FRU_FILE 0x09
|
||||
#define CONFIG_FILE 0x0A
|
||||
#define SHELF_MANAGER_FRU_FILE 0x0B
|
||||
|
||||
#define MIN_ARGUMENT 0x02
|
||||
#define RTM_IPMB_L 0x90
|
||||
|
||||
#define MAX_FILE_NUMBER 8
|
||||
/* this voltag is specified in AMC.0 specification Table 3-10 */
|
||||
#define AMC_VOLTAGE 12 /*volts*/
|
||||
|
||||
#define SIZE_OF_GUID 16
|
||||
#define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15
|
||||
|
||||
int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_EKANALYZER_H */
|
@ -28,15 +28,14 @@
|
||||
* 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
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct entity_id {
|
||||
uint8_t id; /* physical entity id */
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -46,6 +45,9 @@ struct entity_id {
|
||||
uint8_t instance : 7; /* instance number */
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#endif /* IPMI_ENTITY_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_EVENT_H
|
||||
@ -42,6 +38,29 @@
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define EVENT_DIR_ASSERT 0
|
||||
#define EVENT_DIR_DEASSERT 1
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
int ipmi_event_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#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,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_FRU_H
|
||||
@ -66,9 +62,12 @@ enum {
|
||||
|
||||
struct fru_info {
|
||||
uint16_t size;
|
||||
uint8_t access : 1;
|
||||
} __attribute__ ((packed));
|
||||
uint8_t access:1;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_header {
|
||||
uint8_t version;
|
||||
struct {
|
||||
@ -80,7 +79,10 @@ struct fru_header {
|
||||
} offset;
|
||||
uint8_t pad;
|
||||
uint8_t checksum;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct fru_area_chassis {
|
||||
uint8_t area_ver;
|
||||
@ -115,6 +117,9 @@ struct fru_area_product {
|
||||
char * fru;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
|
||||
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
|
||||
@ -122,70 +127,82 @@ struct fru_multirec_header {
|
||||
#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_OEM_EXTENSION 0xc0
|
||||
uint8_t type;
|
||||
uint8_t format;
|
||||
uint8_t len;
|
||||
uint8_t record_checksum;
|
||||
uint8_t header_checksum;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_powersupply {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t capacity;
|
||||
#else
|
||||
uint16_t capacity : 12;
|
||||
uint16_t __reserved1 : 4;
|
||||
uint16_t capacity:12;
|
||||
uint16_t __reserved1:4;
|
||||
#endif
|
||||
uint16_t peak_va;
|
||||
uint8_t inrush_current;
|
||||
uint8_t inrush_interval;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
uint8_t combined_voltage1:4;
|
||||
uint8_t combined_voltage2:4;
|
||||
#else
|
||||
uint8_t combined_voltage2 : 4;
|
||||
uint8_t combined_voltage1 : 4;
|
||||
uint8_t combined_voltage2:4;
|
||||
uint8_t combined_voltage1:4;
|
||||
#endif
|
||||
uint16_t combined_capacity;
|
||||
uint8_t rps_threshold;
|
||||
} __attribute__ ((packed));
|
||||
uint8_t rps_threshold;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static const char * combined_voltage_desc[] __attribute__((unused)) = {
|
||||
"12 V", "-12 V", "5 V", "3.3 V"
|
||||
};
|
||||
"12 V", "-12 V", "5 V", "3.3 V"};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcoutput {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t standby : 1;
|
||||
uint8_t __reserved : 3;
|
||||
uint8_t output_number : 4;
|
||||
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;
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:3;
|
||||
uint8_t standby:1;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short max_neg_dev;
|
||||
@ -193,15 +210,21 @@ struct fru_multirec_dcoutput {
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcload {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved : 4;
|
||||
uint8_t output_number : 4;
|
||||
uint8_t __reserved:4;
|
||||
uint8_t output_number:4;
|
||||
#else
|
||||
uint8_t output_number : 4;
|
||||
uint8_t __reserved : 4;
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:4;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short min_voltage;
|
||||
@ -209,20 +232,373 @@ struct fru_multirec_dcload {
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_oem_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
|
||||
#define FRU_UTCA_FRU_INFO_TABLE 0x20
|
||||
#define FRU_UTCA_CARRIER_MNG_IP 0x21
|
||||
#define FRU_UTCA_CARRIER_INFO 0x22
|
||||
#define FRU_UTCA_CARRIER_LOCATION 0x23
|
||||
#define FRU_UTCA_SHMC_IP_LINK 0x24
|
||||
#define FRU_UTCA_POWER_POLICY 0x25
|
||||
#define FRU_UTCA_ACTIVATION 0x26
|
||||
#define FRU_UTCA_PM_CAPABILTY 0x27
|
||||
#define FRU_UTCA_FAN_GEOGRAPHY 0x28
|
||||
#define FRU_UTCA_CLOCK_MAPPING 0x29
|
||||
#define FRU_UTCA_MSG_BRIDGE_POLICY 0x2A
|
||||
#define FRU_UTCA_OEM_MODULE_DESC 0x2B
|
||||
#define FRU_PICMG_CLK_CARRIER_P2P 0x2C
|
||||
#define FRU_PICMG_CLK_CONFIG 0x2D
|
||||
unsigned char record_id;
|
||||
unsigned char record_version;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_guid {
|
||||
unsigned char guid[16];
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int desig_channel:6;
|
||||
unsigned int desig_if:2;
|
||||
unsigned int desig_port: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 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 desig_port:4;
|
||||
unsigned int desig_if:2;
|
||||
unsigned int desig_channel:6;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* This is used in command, not in FRU */
|
||||
struct fru_picmgext_amc_link_info {
|
||||
unsigned char linkInfo[3];
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_core {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int designator:12;
|
||||
unsigned int type:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int grouping:8;
|
||||
#else
|
||||
unsigned int grouping:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int type:8;
|
||||
unsigned int designator:12;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_extra {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char asymetricMatch:2;
|
||||
unsigned char reserved:6;
|
||||
#else
|
||||
unsigned char reserved:6;
|
||||
unsigned char asymetricMatch:2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
#else
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_OEM_SWFW 0x03
|
||||
#define OEM_SWFW_NBLOCK_OFFSET 0x05
|
||||
#define OEM_SWFW_FIELD_START_OFFSET 0x06
|
||||
|
||||
#define FRU_PICMGEXT_CHN_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_chn_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int remote_slot:8;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int res:14;
|
||||
#else
|
||||
unsigned int res:14;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int remote_slot:8;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_slot_desc {
|
||||
unsigned char chan_type;
|
||||
unsigned char slot_addr;
|
||||
unsigned char chn_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_activation_record {
|
||||
unsigned short max_internal_curr;
|
||||
unsigned char allowance_for_readiness;
|
||||
unsigned char module_activation_record_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_activation_record {
|
||||
unsigned char ibmb_addr;
|
||||
unsigned char max_module_curr;
|
||||
unsigned char reserved;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_p2p_record {
|
||||
unsigned char resource_id;
|
||||
unsigned char p2p_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_p2p_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char resource_id :4;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char record_type :1;
|
||||
#else
|
||||
unsigned char record_type :1;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char resource_id :4;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_channel_desc_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int lane0port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int /* reserved */ :12;
|
||||
#else
|
||||
unsigned int /* reserved */ :12;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane0port :5;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE 5
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_record {
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_NSSC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_SSC 0x01
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_NSSC 0x02
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_SSC 0x03
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_ETH_1000_BX 0x00
|
||||
#define AMC_LINK_TYPE_EXT_ETH_10G_XAUI 0x01
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_FC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SATA 0x01
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SAS 0x02
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int channel_id :8;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int type :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int group_id :8;
|
||||
unsigned int asym_match :2;
|
||||
unsigned int /* reserved */ :30;
|
||||
#else
|
||||
unsigned int group_id :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int type :8;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int channel_id :8;
|
||||
|
||||
unsigned int /* reserved */ :30;
|
||||
unsigned int asym_match :2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* FRU Board manufacturing date */
|
||||
static const uint64_t secs_from_1970_1996 = 820454400;
|
||||
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"
|
||||
"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",
|
||||
"Sealed-case PC", "Multi-system Chassis", "CompactPCI",
|
||||
"AdvancedTCA", "Blade", "Blade Enclosure"
|
||||
};
|
||||
|
||||
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);
|
||||
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 */
|
||||
|
42
ipmitool/include/ipmitool/ipmi_fwum.h
Normal file
42
ipmitool/include/ipmitool/ipmi_fwum.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_KFWUM_H
|
||||
#define IPMI_KFWUM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_fwum_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KFWUM_H */
|
48
ipmitool/include/ipmitool/ipmi_gendev.h
Normal file
48
ipmitool/include/ipmitool/ipmi_gendev.h
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Kontron Canada, 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_GENDEV_H
|
||||
#define IPMI_GENDEV_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
|
||||
int ipmi_gendev_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_GENDEV_H */
|
41
ipmitool/include/ipmitool/ipmi_hpmfwupg.h
Normal file
41
ipmitool/include/ipmitool/ipmi_hpmfwupg.h
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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_HPMFWUPG_H
|
||||
#define IPMI_HPMFWUPG_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KFWUM_H */
|
45
ipmitool/include/ipmitool/ipmi_ime.h
Executable file
45
ipmitool/include/ipmitool/ipmi_ime.h
Executable file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2007 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_IME_H
|
||||
#define IPMI_IME_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_ime_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_IME_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_INTF_H
|
||||
@ -68,7 +64,7 @@ enum LANPLUS_SESSION_STATE {
|
||||
|
||||
struct ipmi_session {
|
||||
uint8_t hostname[64];
|
||||
uint8_t username[16];
|
||||
uint8_t username[17];
|
||||
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
|
||||
uint8_t challenge[16];
|
||||
uint8_t authtype;
|
||||
@ -81,9 +77,12 @@ struct ipmi_session {
|
||||
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;
|
||||
@ -94,16 +93,20 @@ struct ipmi_session {
|
||||
socklen_t addrlen;
|
||||
|
||||
/*
|
||||
* This struct holds state data specific to IMPI v2 / RMCP+ sessions
|
||||
* This struct holds state data specific to IPMI 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;
|
||||
uint8_t lookupbit;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
@ -144,17 +147,41 @@ struct ipmi_session {
|
||||
} 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];
|
||||
char *devfile;
|
||||
int fd;
|
||||
int opened;
|
||||
int abort;
|
||||
int noanswer;
|
||||
int picmg_avail;
|
||||
IPMI_OEM manufacturer_id;
|
||||
|
||||
struct ipmi_session * session;
|
||||
struct ipmi_oem_handle * oem;
|
||||
struct ipmi_cmd * cmdlist;
|
||||
uint8_t target_ipmb_addr;
|
||||
uint32_t my_addr;
|
||||
uint32_t target_addr;
|
||||
uint8_t target_lun;
|
||||
uint8_t target_channel;
|
||||
uint32_t transit_addr;
|
||||
uint8_t transit_channel;
|
||||
uint8_t channel_buf_size;
|
||||
|
||||
uint8_t devnum;
|
||||
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
int (*open)(struct ipmi_intf * intf);
|
||||
@ -164,17 +191,24 @@ struct ipmi_intf {
|
||||
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 (*set_my_addr)(struct ipmi_intf * intf, uint8_t addr);
|
||||
};
|
||||
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
void ipmi_intf_print(void);
|
||||
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_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
|
||||
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 */
|
||||
|
57
ipmitool/include/ipmitool/ipmi_isol.h
Normal file
57
ipmitool/include/ipmitool/ipmi_isol.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_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_BAUD_RATE_PARAM 0x05
|
||||
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
struct isol_config_parameters {
|
||||
uint8_t enabled;
|
||||
uint8_t privilege_level;
|
||||
uint8_t bit_rate;
|
||||
};
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_SOL_H */
|
46
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
46
ipmitool/include/ipmitool/ipmi_kontronoem.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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 **);
|
||||
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
|
||||
|
||||
#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,7 +42,7 @@
|
||||
# define IPMI_LAN_SUSPEND_ARP_GRAT (1)
|
||||
#define IPMI_LAN_GET_STAT 0x04
|
||||
|
||||
#define IPMI_CHANNEL_NUMBER_MAX 0xd
|
||||
#define IPMI_CHANNEL_NUMBER_MAX 0xe
|
||||
|
||||
#define IPMI_LANP_TIMEOUT 3
|
||||
#define IPMI_LANP_RETRIES 10
|
||||
@ -60,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,27 +97,32 @@ static struct lan_param {
|
||||
{ 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_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 }
|
||||
};
|
||||
|
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 */
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* 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
|
||||
@ -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_MC_H
|
||||
@ -39,19 +35,26 @@
|
||||
|
||||
#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_DEVICE_ID 0x01
|
||||
#define BMC_COLD_RESET 0x02
|
||||
#define BMC_WARM_RESET 0x03
|
||||
#define BMC_GET_SELF_TEST 0x04
|
||||
#define BMC_RESET_WATCHDOG_TIMER 0x22
|
||||
#define BMC_SET_WATCHDOG_TIMER 0x24
|
||||
#define BMC_GET_WATCHDOG_TIMER 0x25
|
||||
#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...
|
||||
* The following really apply to any IPM device, not just BMCs...
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_devid_rsp {
|
||||
uint8_t device_id;
|
||||
uint8_t device_revision;
|
||||
@ -62,17 +65,20 @@ struct ipm_devid_rsp {
|
||||
uint8_t manufacturer_id[3];
|
||||
uint8_t product_id[2];
|
||||
uint8_t aux_fw_rev[4];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x07) /* BCD-enoded */
|
||||
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* 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_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_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) \
|
||||
@ -81,6 +87,84 @@ struct ipm_devid_rsp {
|
||||
#define IPM_DEV_MANUFACTURER_ID(x) \
|
||||
((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0]))
|
||||
|
||||
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
|
||||
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
|
||||
|
||||
#endif /*IPMI_MC_H*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_selftest_rsp {
|
||||
unsigned char code;
|
||||
unsigned char test;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct ipm_get_watchdog_rsp {
|
||||
unsigned char timer_use;
|
||||
unsigned char timer_actions;
|
||||
unsigned char pre_timeout;
|
||||
unsigned char timer_use_exp;
|
||||
unsigned char initial_countdown_lsb;
|
||||
unsigned char initial_countdown_msb;
|
||||
unsigned char present_countdown_lsb;
|
||||
unsigned char present_countdown_msb;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define IPM_WATCHDOG_RESET_ERROR 0x80
|
||||
|
||||
#define IPM_WATCHDOG_BIOS_FRB2 0x01
|
||||
#define IPM_WATCHDOG_BIOS_POST 0x02
|
||||
#define IPM_WATCHDOG_OS_LOAD 0x03
|
||||
#define IPM_WATCHDOG_SMS_OS 0x04
|
||||
#define IPM_WATCHDOG_OEM 0x05
|
||||
|
||||
#define IPM_WATCHDOG_NO_ACTION 0x00
|
||||
#define IPM_WATCHDOG_HARD_RESET 0x01
|
||||
#define IPM_WATCHDOG_POWER_DOWN 0x02
|
||||
#define IPM_WATCHDOG_POWER_CYCLE 0x03
|
||||
|
||||
#define IPM_WATCHDOG_CLEAR_OEM 0x20
|
||||
#define IPM_WATCHDOG_CLEAR_SMS_OS 0x10
|
||||
#define IPM_WATCHDOG_CLEAR_OS_LOAD 0x08
|
||||
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
|
||||
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
|
||||
|
||||
/* IPMI 2.0 command for system information*/
|
||||
#define IPMI_SET_SYS_INFO 0x58
|
||||
#define IPMI_GET_SYS_INFO 0x59
|
||||
#define IPMI_SYSINFO_SET0_SIZE 14
|
||||
#define IPMI_SYSINFO_SETN_SIZE 16
|
||||
|
||||
#define IPMI_SYSINFO_HOSTNAME 0x02
|
||||
#define IPMI_SYSINFO_PRIMARY_OS_NAME 0x03
|
||||
#define IPMI_SYSINFO_OS_NAME 0x04
|
||||
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
|
||||
#define IPMI_SYSINFO_DELL_URL 0xde
|
||||
|
||||
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
|
||||
int len, void *buffer);
|
||||
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
|
||||
|
||||
#endif /*IPMI_MC_H */
|
||||
|
@ -26,10 +26,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_OEM_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 DELL 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_PEF_H
|
||||
@ -47,6 +43,16 @@ struct pef_capabilities { /* "get pef capabilities" response */
|
||||
uint8_t tblsize;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
P_TRUE,
|
||||
P_SUPP,
|
||||
P_ACTV,
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_table_entry {
|
||||
#define PEF_CONFIG_ENABLED 0x80
|
||||
#define PEF_CONFIG_PRECONFIGURED 0x40
|
||||
@ -87,7 +93,10 @@ struct pef_table_entry {
|
||||
uint8_t event_data_3_AND_mask;
|
||||
uint8_t event_data_3_compare_1;
|
||||
uint8_t event_data_3_compare_2;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct desc_map { /* maps a description to a value/mask */
|
||||
const char *desc;
|
||||
@ -321,6 +330,9 @@ pef_b2s_generic_ER[] __attribute__((unused)) = {
|
||||
#define PEF_B2S_GENERIC_ER_ENTRIES \
|
||||
(sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_policy_entry {
|
||||
#define PEF_POLICY_ID_MASK 0xf0
|
||||
#define PEF_POLICY_ID_SHIFT 4
|
||||
@ -338,7 +350,10 @@ struct pef_policy_entry {
|
||||
uint8_t chan_dest;
|
||||
#define PEF_POLICY_EVENT_SPECIFIC 0x80
|
||||
uint8_t alert_string_key;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_policies __attribute__((unused)) = {
|
||||
@ -381,6 +396,9 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_selector {
|
||||
#define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_CFGPARM_ID_SET_IN_PROGRESS 0
|
||||
@ -400,21 +418,36 @@ struct pef_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_control __attribute__((unused)) = {
|
||||
@ -426,6 +459,9 @@ BIT_DESC_MAP_ALL,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_ENABLE_OEM 0x10
|
||||
@ -434,54 +470,114 @@ struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ENABLE_ALERT 0x01
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_startup_delay {
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_size {
|
||||
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_entry {
|
||||
#define PEF_FILTER_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_table_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_data_1 {
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_size {
|
||||
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_entry {
|
||||
#define PEF_POLICY_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_policy_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_system_guid {
|
||||
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
|
||||
uint8_t data1;
|
||||
uint8_t guid[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_size {
|
||||
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_keys {
|
||||
#define PEF_ALERT_STRING_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
@ -489,16 +585,27 @@ struct pef_cfgparm_alert_string_keys {
|
||||
uint8_t data2;
|
||||
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_entry {
|
||||
uint8_t id;
|
||||
uint8_t blockno;
|
||||
uint8_t block[16];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - LAN */
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_selector {
|
||||
#define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_LAN_CFGPARM_CH_MASK 0x0f
|
||||
@ -510,13 +617,25 @@ struct pef_lan_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_size {
|
||||
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_type {
|
||||
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -529,7 +648,10 @@ struct pef_lan_cfgparm_dest_type {
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_LAN_RETRIES_MASK 0x07
|
||||
uint8_t retries;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_lan_desttype __attribute__((unused)) = {
|
||||
@ -541,6 +663,9 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_info {
|
||||
#define PEF_LAN_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -552,10 +677,15 @@ struct pef_lan_cfgparm_dest_info {
|
||||
uint8_t gateway;
|
||||
uint8_t ip[4];
|
||||
uint8_t mac[6];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - Serial/PPP */
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_selector {
|
||||
#define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_SERIAL_CFGPARM_CH_MASK 0x0f
|
||||
@ -570,13 +700,25 @@ struct pef_serial_cfgparm_selector {
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_size {
|
||||
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
@ -605,7 +747,10 @@ struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0
|
||||
uint8_t data5;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_serial_desttype __attribute__((unused)) = {
|
||||
@ -620,31 +765,58 @@ BIT_DESC_MAP_LIST,
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string_count {
|
||||
#define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string {
|
||||
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
uint8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_acct_count {
|
||||
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0
|
||||
@ -655,7 +827,10 @@ struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t escape_mask[4];
|
||||
uint8_t timeout_parms[3];
|
||||
uint8_t retry_parms[2];
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_tap_svc_confirm __attribute__((unused)) = {
|
||||
@ -682,7 +857,7 @@ BIT_DESC_MAP_LIST,
|
||||
struct pef_cfgparm_alert_string_table_size;
|
||||
struct pef_cfgparm_alert_string_keys;
|
||||
struct pef_cfgparm_alert_string_table_entry;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_lan_config_parms { /* LAN */
|
||||
struct pef_lan_cfgparm_set_in_progress;
|
||||
@ -705,7 +880,7 @@ BIT_DESC_MAP_LIST,
|
||||
struct pef_lan_cfgparm_destination_count;
|
||||
struct pef_lan_cfgparm_destination_type;
|
||||
struct pef_lan_cfgparm_destination_ipaddr;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_serial_config_parms { /* Serial/PPP */
|
||||
struct pef_serial_cfgparm_set_in_progress;
|
||||
@ -757,7 +932,7 @@ BIT_DESC_MAP_LIST,
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#endif
|
||||
|
||||
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
|
||||
@ -769,7 +944,7 @@ BIT_DESC_MAP_LIST,
|
||||
#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, uint32_t type, 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);
|
||||
|
211
ipmitool/include/ipmitool/ipmi_picmg.h
Normal file
211
ipmitool/include/ipmitool/ipmi_picmg.h
Normal file
@ -0,0 +1,211 @@
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PICMG version */
|
||||
#define PICMG_CPCI_MAJOR_VERSION 1
|
||||
#define PICMG_ATCA_MAJOR_VERSION 2
|
||||
#define PICMG_AMC_MAJOR_VERSION 4
|
||||
|
||||
/* 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
|
||||
|
||||
/* AMC.0 commands */
|
||||
#define PICMG_AMC_SET_PORT_STATE_CMD 0x19
|
||||
#define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
|
||||
/* AMC.0 R2.0 commands */
|
||||
#define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
|
||||
#define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
|
||||
|
||||
/* 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
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
typedef enum picmg_busres_board_cmd_types {
|
||||
PICMG_BUSRES_BOARD_CMD_QUERY =0,
|
||||
PICMG_BUSRES_BOARD_CMD_RELEASE,
|
||||
PICMG_BUSRES_BOARD_CMD_FORCE,
|
||||
PICMG_BUSRES_BOARD_CMD_BUS_FREE
|
||||
} t_picmg_busres_board_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_shmc_cmd_types {
|
||||
PICMG_BUSRES_SHMC_CMD_REQUEST =0,
|
||||
PICMG_BUSRES_SHMC_CMD_RELINQUISH,
|
||||
PICMG_BUSRES_SHMC_CMD_NOTIFY
|
||||
} t_picmg_busres_shmc_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_resource_id {
|
||||
PICMG_BUSRES_METAL_TEST_BUS_1=0,
|
||||
PICMG_BUSRES_METAL_TEST_BUS_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
|
||||
} t_picmg_busres_resource_id;
|
||||
|
||||
/* the LED color capabilities */
|
||||
static const char* led_color_str[] __attribute__((unused)) = {
|
||||
"reserved",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"GREEN",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"reserved"
|
||||
};
|
||||
|
||||
|
||||
static const char* amc_link_type_str[] __attribute__((unused)) = {
|
||||
"RESERVED",
|
||||
"RESERVED1",
|
||||
"PCI EXPRESS",
|
||||
"ADVANCED SWITCHING1",
|
||||
"ADVANCED SWITCHING2",
|
||||
"ETHERNET",
|
||||
"RAPIDIO",
|
||||
"STORAGE",
|
||||
};
|
||||
|
||||
static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
|
||||
{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
|
||||
{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
|
||||
{
|
||||
"Gen 1 - NSSC",
|
||||
"Gen 1 - SSC",
|
||||
"Gen 2 - NSSC",
|
||||
"Gen 2 - SSC",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
|
||||
{
|
||||
"1000BASE-BX (SerDES Gigabit)",
|
||||
"10GBASE-BX410 Gigabit XAUI",
|
||||
"", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
|
||||
{
|
||||
"1.25 Gbaud transmission rate",
|
||||
"2.5 Gbaud transmission rate",
|
||||
"3.125 Gbaud transmission rate",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "", "", "", ""
|
||||
},
|
||||
/* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
|
||||
{
|
||||
"Fibre Channel",
|
||||
"Serial ATA",
|
||||
"Serial Attached SCSI",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "", "", "", ""
|
||||
}
|
||||
};
|
||||
|
||||
struct sAmcPortState {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned short lane0 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short type : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned char group_id : 8;
|
||||
#else
|
||||
unsigned char group_id : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned short type : 8;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane0 : 1;
|
||||
#endif
|
||||
|
||||
unsigned char state;
|
||||
};
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
uint8_t picmg_discover(struct ipmi_intf *intf);
|
||||
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
|
||||
|
||||
#endif
|
@ -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_RAW_H
|
||||
@ -40,5 +36,9 @@
|
||||
#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 bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_RAW_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
46
ipmitool/include/ipmitool/ipmi_sdradd.h
Normal file
46
ipmitool/include/ipmitool/ipmi_sdradd.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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_SDRADD_H
|
||||
#define IPMI_SDRADD_H
|
||||
|
||||
/*
|
||||
* Methods to add SDRs to repository from built-in sensors or files
|
||||
*/
|
||||
int
|
||||
ipmi_sdr_add_from_sensors(struct ipmi_intf *intf, int maxslot);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList);
|
||||
|
||||
#endif /* IPMI_SDRADD_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_SEL_H
|
||||
@ -39,6 +35,7 @@
|
||||
|
||||
#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
|
||||
@ -60,69 +57,187 @@ enum {
|
||||
IPMI_EVENT_CLASS_OEM,
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sel_get_rq {
|
||||
uint16_t reserve_id;
|
||||
uint16_t record_id;
|
||||
uint8_t offset;
|
||||
uint8_t length;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct sel_event_record {
|
||||
uint16_t record_id;
|
||||
uint8_t record_type;
|
||||
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;
|
||||
#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 */
|
||||
#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];
|
||||
} __attribute__ ((packed));
|
||||
};
|
||||
/* Dell Specific MACRO's */
|
||||
#define OEM_CODE_IN_BYTE2 0x80 /* Dell specific OEM Byte in Byte 2 Mask */
|
||||
#define OEM_CODE_IN_BYTE3 0x20 /* Dell specific OEM Byte in Byte 3 Mask */
|
||||
/* MASK MACROS */
|
||||
#define MASK_LOWER_NIBBLE 0x0F
|
||||
#define MASK_HIGHER_NIBBLE 0xF0
|
||||
/*Senosr type Macro's */
|
||||
#define SENSOR_TYPE_MEMORY 0x0C
|
||||
#define SENSOR_TYPE_CRIT_INTR 0x13
|
||||
#define SENSOR_TYPE_EVT_LOG 0x10
|
||||
#define SENSOR_TYPE_SYS_EVENT 0x12
|
||||
#define SENSOR_TYPE_PROCESSOR 0x07
|
||||
#define SENSOR_TYPE_OEM_SEC_EVENT 0xC1
|
||||
#define SENSOR_TYPE_VER_CHANGE 0x2B
|
||||
#define SENSOR_TYPE_FRM_PROG 0x0F
|
||||
#define SENSOR_TYPE_WTDOG 0x23
|
||||
#define SENSOR_TYPE_OEM_NFATAL_ERROR 0xC2
|
||||
#define SENSOR_TYPE_OEM_FATAL_ERROR 0xC3
|
||||
#define SENSOR_TYPE_TXT_CMD_ERROR 0x20
|
||||
/* End of Macro for DELL Specific */
|
||||
#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 sel_oem_record_ts {
|
||||
uint16_t next_id;
|
||||
struct oem_nots_spec_sel_rec{
|
||||
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sel_event_record {
|
||||
uint16_t record_id;
|
||||
uint8_t record_type;
|
||||
uint32_t timestamp;
|
||||
uint8_t mfg_id[3];
|
||||
uint8_t oem_defined[6];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct sel_oem_record_nots {
|
||||
uint16_t next_id;
|
||||
uint16_t record_id;
|
||||
uint8_t record_type;
|
||||
uint8_t oem_defined[13];
|
||||
} __attribute__ ((packed));
|
||||
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_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct ipmi_event_sensor_types {
|
||||
uint8_t code;
|
||||
uint8_t offset;
|
||||
#define ALL_OFFSETS_SPECIFIED 0xff
|
||||
uint8_t data;
|
||||
uint8_t data;
|
||||
uint8_t class;
|
||||
const char * type;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* The sel module uses the "iana" number to select the appropriate array at run time
|
||||
This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
|
||||
using a similar constuct, look for switch(iana) in ipmi_sel.c
|
||||
*/
|
||||
static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
|
||||
|
||||
/* event type details uses an oem event type */
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
|
||||
{ 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
|
||||
{ 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
|
||||
{ 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
|
||||
{ 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
|
||||
{ 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
|
||||
{ 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
|
||||
{ 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
|
||||
{ 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
|
||||
{ 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
|
||||
|
||||
/* Uses standard digital reading type */
|
||||
{ 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
|
||||
|
||||
/* based on PICMG IPMB-0 Link state sensor */
|
||||
{ 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
|
||||
{ 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
|
||||
|
||||
{ 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
|
||||
{ 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
|
||||
{ 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
|
||||
{ 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
|
||||
{ 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
|
||||
{ 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
|
||||
{ 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
|
||||
{ 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
|
||||
{ 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
|
||||
{ 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
|
||||
|
||||
/* event type details uses a standard */
|
||||
{ 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
|
||||
|
||||
{ 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
|
||||
|
||||
{ 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
|
||||
{ 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
|
||||
{ 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
|
||||
{ 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
|
||||
{ 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occured" },
|
||||
|
||||
{ 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
|
||||
{ 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
|
||||
{ 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
|
||||
{ 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
|
||||
|
||||
{ 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
|
||||
{ 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
|
||||
{ 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
|
||||
|
||||
{ 0xCA , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "In progress"},
|
||||
{ 0xCA , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Success"},
|
||||
{ 0xCA , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Failure"},
|
||||
|
||||
{ 0xCB , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Asserted"},
|
||||
{ 0xCB , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Deasserted"},
|
||||
|
||||
{ 0xCC , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Asserted"},
|
||||
{ 0xCC , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Deasserted"},
|
||||
|
||||
{ 0xCD , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Asserted"},
|
||||
{ 0xCD , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Deasserted"},
|
||||
|
||||
{ 0xCF , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Asserted"},
|
||||
{ 0xCF , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Deasserted"},
|
||||
|
||||
/* END */
|
||||
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
|
||||
/* Threshold Based States */
|
||||
{ 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" },
|
||||
{ 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, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" },
|
||||
{ 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" },
|
||||
@ -147,8 +262,8 @@ static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unuse
|
||||
{ 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, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Removed/Absent" },
|
||||
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Inserted/Present" },
|
||||
{ 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" },
|
||||
@ -190,7 +305,7 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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/undock" },
|
||||
{ 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, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" },
|
||||
@ -210,6 +325,7 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" },
|
||||
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" },
|
||||
@ -217,6 +333,10 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" },
|
||||
{ 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" },
|
||||
@ -236,31 +356,108 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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, 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" },
|
||||
|
||||
{ 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", NULL },
|
||||
{ 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL },
|
||||
|
||||
{ 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Error" },
|
||||
{ 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Hang" },
|
||||
{ 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress 1" },
|
||||
{ 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress 2" },
|
||||
{ 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress 3" },
|
||||
{ 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress 4" },
|
||||
{ 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "Progress 5" },
|
||||
{ 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware", "System Boot Initiated" },
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
|
||||
{ 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, 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" },
|
||||
|
||||
@ -269,9 +466,9 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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." },
|
||||
{ 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" },
|
||||
|
||||
{ 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Front Panel NMI" },
|
||||
{ 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" },
|
||||
@ -281,10 +478,13 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
|
||||
{ 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL },
|
||||
{ 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL },
|
||||
@ -292,7 +492,10 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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 },
|
||||
{ 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", NULL },
|
||||
|
||||
{ 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" },
|
||||
{ 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" },
|
||||
|
||||
{ 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL },
|
||||
|
||||
{ 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" },
|
||||
@ -300,6 +503,9 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
@ -315,18 +521,23 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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" },
|
||||
|
||||
{ 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Critical Stop", "Stop during OS load/init" },
|
||||
{ 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Critical Stop", "Run-time stop" },
|
||||
{ 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" },
|
||||
|
||||
{ 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status asserted" },
|
||||
{ 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status asserted" },
|
||||
{ 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device installed/attached" },
|
||||
{ 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 asserted" },
|
||||
{ 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is disabled" },
|
||||
{ 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" },
|
||||
|
||||
{ 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" },
|
||||
@ -371,18 +582,112 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 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, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
|
||||
{ 0x2b, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Id" },
|
||||
{ 0x2b, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
|
||||
{ 0x2b, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
|
||||
{ 0x2b, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
|
||||
{ 0x2b, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
|
||||
{ 0x2b, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
|
||||
{ 0x2b, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
|
||||
{ 0x2b, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Other" },
|
||||
{ 0x2b, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, BIOS/EFI change" },
|
||||
{ 0x2b, 0x01, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, SMBIOS change" },
|
||||
{ 0x2b, 0x01, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S change" },
|
||||
{ 0x2b, 0x01, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S loader change" },
|
||||
{ 0x2b, 0x01, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Service Diag change" },
|
||||
{ 0x2b, 0x01, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW agent change" },
|
||||
{ 0x2b, 0x01, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW App change" },
|
||||
{ 0x2b, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW Middle" },
|
||||
{ 0x2b, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Prog HW Change (FPGA)" },
|
||||
{ 0x2b, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU module change" },
|
||||
{ 0x2b, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU component change" },
|
||||
{ 0x2b, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace equ ver" },
|
||||
{ 0x2b, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace new ver" },
|
||||
{ 0x2b, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace old ver" },
|
||||
{ 0x2b, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU HW conf change" },
|
||||
{ 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, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
|
||||
{ 0x2b, 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Id" },
|
||||
{ 0x2b, 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Rev" },
|
||||
{ 0x2b, 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Rev" },
|
||||
{ 0x2b, 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Manuf Id" },
|
||||
{ 0x2b, 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
|
||||
{ 0x2b, 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
|
||||
{ 0x2b, 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
|
||||
{ 0x2b, 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Other" },
|
||||
{ 0x2b, 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, BIOS/EFI change" },
|
||||
{ 0x2b, 0x07, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, SMBIOS change" },
|
||||
{ 0x2b, 0x07, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S change" },
|
||||
{ 0x2b, 0x07, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S loader change" },
|
||||
{ 0x2b, 0x07, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Service Diag change" },
|
||||
{ 0x2b, 0x07, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW agent change" },
|
||||
{ 0x2b, 0x07, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW App change" },
|
||||
{ 0x2b, 0x07, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW Middle" },
|
||||
{ 0x2b, 0x07, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Prog HW Change (FPGA)" },
|
||||
{ 0x2b, 0x07, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU module change" },
|
||||
{ 0x2b, 0x07, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU component change" },
|
||||
{ 0x2b, 0x07, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace equ ver" },
|
||||
{ 0x2b, 0x07, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace new ver" },
|
||||
{ 0x2b, 0x07, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace old ver" },
|
||||
{ 0x2b, 0x07, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU HW conf change" },
|
||||
|
||||
{ 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, 0x07, 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 },
|
||||
};
|
||||
|
||||
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
||||
void ipmi_sel_print_std_entry(struct sel_event_record * evt);
|
||||
void ipmi_sel_print_std_entry_verbose(struct sel_event_record * evt);
|
||||
void ipmi_get_event_desc(struct sel_event_record * rec, char ** desc);
|
||||
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 */
|
||||
|
@ -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_SENSOR_H
|
||||
@ -42,13 +38,6 @@
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
/* ipmi sensor commands */
|
||||
#define GET_SENSOR_READING 0x2d
|
||||
#define GET_SENSOR_FACTORS 0x23
|
||||
#define SET_SENSOR_THRESHOLDS 0x26
|
||||
#define GET_SENSOR_THRESHOLDS 0x27
|
||||
#define GET_SENSOR_TYPE 0x2f
|
||||
|
||||
/* threshold specification bits for analog sensors for get sensor threshold command
|
||||
* and set sensor threshold command
|
||||
*/
|
||||
@ -76,6 +65,9 @@
|
||||
#define STATE_13_ASSERTED 0x20
|
||||
#define STATE_14_ASSERTED 0x40
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sensor_set_thresh_rq {
|
||||
uint8_t sensor_num; /* sensor # */
|
||||
uint8_t set_mask; /* threshold setting mask */
|
||||
@ -85,11 +77,13 @@ struct sensor_set_thresh_rq {
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
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 *);
|
||||
|
||||
int ipmi_sensor_print_fc(struct ipmi_intf *, struct sdr_record_common_sensor *, uint8_t);
|
||||
int ipmi_sensor_get_sensor_reading_factors( struct ipmi_intf * intf, struct sdr_record_full_sensor * sensor, uint8_t reading);
|
||||
#endif /* IPMI_SENSOR_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_SESSION_H
|
||||
@ -47,6 +43,9 @@
|
||||
/*
|
||||
* From table 22.25 of the IPMIv2 specification
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_session_info_rsp
|
||||
{
|
||||
uint8_t session_handle;
|
||||
@ -120,7 +119,10 @@ struct get_session_info_rsp
|
||||
uint16_t console_port; /* LSBF */
|
||||
} modem_data;
|
||||
} channel_data;
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -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,6 +35,9 @@
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define SOL_ESCAPE_CHARACTER_DEFAULT '~'
|
||||
#define SOL_KEEPALIVE_TIMEOUT 15
|
||||
#define SOL_KEEPALIVE_RETRIES 3
|
||||
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
|
||||
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
|
||||
@ -68,14 +67,37 @@ struct sol_config_parameters {
|
||||
* The ACTIVATE PAYLOAD command reponse structure
|
||||
* From table 24-2 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef PRAGMA_PACK
|
||||
#pramga pack(1)
|
||||
#endif
|
||||
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));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef PRAGMA_PACK
|
||||
#pramga pack(0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Small function to validate that user-supplied SOL
|
||||
* configuration parameter values we store in uint8_t
|
||||
* data type falls within valid range. With minval
|
||||
* and maxval parameters we can use the same function
|
||||
* to validate parameters that have different ranges
|
||||
* of values.
|
||||
*
|
||||
* function will return -1 if value is not valid, or
|
||||
* will return 0 if valid.
|
||||
*/
|
||||
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
|
||||
const char *name,
|
||||
int base,
|
||||
uint8_t minval,
|
||||
uint8_t maxval,
|
||||
uint8_t *out_value);
|
||||
|
||||
int ipmi_sol_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_get_sol_info(struct ipmi_intf * intf,
|
||||
|
@ -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_STRINGS_H
|
||||
@ -42,14 +38,38 @@
|
||||
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_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[];
|
||||
|
||||
extern const struct valstr picmg_frucontrol_vals[];
|
||||
extern const struct valstr picmg_clk_family_vals[];
|
||||
extern const struct oemvalstr picmg_clk_accuracy_vals[];
|
||||
extern const struct oemvalstr picmg_clk_resource_vals[];
|
||||
extern const struct oemvalstr picmg_clk_id_vals[];
|
||||
|
||||
extern const struct valstr picmg_busres_id_vals[];
|
||||
extern const struct valstr picmg_busres_board_cmd_vals[];
|
||||
extern const struct valstr picmg_busres_shmc_cmd_vals[];
|
||||
extern const struct oemvalstr picmg_busres_board_status_vals[];
|
||||
extern const struct oemvalstr picmg_busres_shmc_status_vals[];
|
||||
|
||||
/* these are similar, expect that the lookup takes the IANA number
|
||||
as first parameter */
|
||||
extern const struct oemvalstr ipmi_oem_product_info[];
|
||||
extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
|
||||
|
||||
|
||||
|
||||
#endif /*IPMI_STRINGS_H*/
|
||||
|
57
ipmitool/include/ipmitool/ipmi_sunoem.h
Normal file
57
ipmitool/include/ipmitool/ipmi_sunoem.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_SUNOEM_H
|
||||
#define IPMI_SUNOEM_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
#define IPMI_NETFN_SUNOEM 0x2e
|
||||
|
||||
#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
|
||||
|
||||
int ipmi_sunoem_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
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 */
|
@ -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_USER_H
|
||||
@ -44,7 +40,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* The GET USER ACCESS response from table 22-32 of the IMPI v2.0 spec
|
||||
* The GET USER ACCESS response from table 22-32 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -71,6 +67,9 @@ struct user_access_rsp {
|
||||
uint8_t __reserved3 : 2;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved4 : 1;
|
||||
uint8_t no_callin_access : 1;
|
||||
@ -84,7 +83,10 @@ struct user_access_rsp {
|
||||
uint8_t no_callin_access : 1;
|
||||
uint8_t __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -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 IPMITOOL_LOG_H
|
||||
|
@ -27,20 +27,21 @@
|
||||
# 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_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
|
||||
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 \
|
||||
ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
|
||||
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c \
|
||||
../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
|
||||
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
libipmitool_la_LIBADD = -lm
|
||||
libipmitool_la_DEPENDENCIES =
|
||||
|
@ -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 <ipmitool/ipmi.h>
|
||||
@ -45,10 +41,56 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
/*
|
||||
* Also, see ipmi_fru.c.
|
||||
*
|
||||
* Apparently some systems have problems with FRU access greater than 16 bytes
|
||||
* at a time, even when using byte (not word) access. In order to ensure we
|
||||
* work with the widest variety of hardware request size is capped at 16 bytes.
|
||||
* Since this may result in slowdowns on some systems with lots of FRU data you
|
||||
* can change this define to enable larger (up to 32 bytes at a time) access.
|
||||
*/
|
||||
#define FRU_DATA_RQST_SIZE 16;
|
||||
|
||||
const struct valstr spd_memtype_vals[] = {
|
||||
{ 0x01, "STD FPM DRAM" },
|
||||
{ 0x02, "EDO" },
|
||||
{ 0x04, "SDRAM" },
|
||||
{ 0x07, "DDR" },
|
||||
{ 0x05, "ROM" },
|
||||
{ 0x06, "DDR SGRAM" },
|
||||
{ 0x07, "DDR SDRAM" },
|
||||
{ 0x08, "DDR2 SDRAM" },
|
||||
{ 0x09, "DDR2 SDRAM FB-DIMM" },
|
||||
{ 0x0A, "DDR2 SDRAM FB-DIMM Probe" },
|
||||
{ 0x0B, "DDR3 SDRAM" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_density_vals[] =
|
||||
{
|
||||
{ 0, "256 Mb" },
|
||||
{ 1, "512 Mb" },
|
||||
{ 2, "1 Gb" },
|
||||
{ 3, "2 Gb" },
|
||||
{ 4, "4 Gb" },
|
||||
{ 5, "8 Gb" },
|
||||
{ 6, "16 Gb" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_banks_vals[] =
|
||||
{
|
||||
{ 0, "3 (8 Banks)" },
|
||||
{ 1, "4 (16 Banks)" },
|
||||
{ 2, "5 (32 Banks)" },
|
||||
{ 3, "6 (64 Banks)" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ddr3_ecc_vals[] =
|
||||
{
|
||||
{ 0, "0 bits" },
|
||||
{ 1, "8 bits" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -56,6 +98,7 @@ const struct valstr spd_config_vals[] = {
|
||||
{ 0x00, "None" },
|
||||
{ 0x01, "Parity" },
|
||||
{ 0x02, "ECC" },
|
||||
{ 0x04, "Addr Cmd Parity" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -65,6 +108,7 @@ const struct valstr spd_voltage_vals[] = {
|
||||
{ 0x02, "HSTL 1.5V" },
|
||||
{ 0x03, "SSTL 3.3V" },
|
||||
{ 0x04, "SSTL 2.5V" },
|
||||
{ 0x05, "SSTL 1.8V" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
@ -673,13 +717,151 @@ const struct valstr jedec_id5_vals[] = {
|
||||
};
|
||||
|
||||
int
|
||||
ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
ipmi_spd_print(uint8_t *spd_data, int len)
|
||||
{
|
||||
int size;
|
||||
|
||||
if (len < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
|
||||
if (spd_data[2] == 0x0B) /* DDR3 SDRAM */
|
||||
{
|
||||
int iPN;
|
||||
char *pchPN = spd_data+128;
|
||||
int sdram_cap = 0;
|
||||
int pri_bus_width = 0;
|
||||
int sdram_width = 0;
|
||||
int ranks = 0;
|
||||
int mem_size = 0;
|
||||
|
||||
if (len < 148)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
|
||||
sdram_cap = ldexp(256,(spd_data[4]&15));
|
||||
pri_bus_width = ldexp(8,(spd_data[8]&7));
|
||||
sdram_width = ldexp(4,(spd_data[7]&7));
|
||||
ranks = ldexp(1,((spd_data[7]&0x3F)>>3));
|
||||
mem_size = (sdram_cap/8) * (pri_bus_width/sdram_width) * ranks;
|
||||
printf(" SDRAM Capacity : %d MB\n", sdram_cap );
|
||||
printf(" Memory Banks : %s\n", val2str(spd_data[4]>>4, ddr3_banks_vals));
|
||||
printf(" Primary Bus Width : %d bits\n", pri_bus_width );
|
||||
printf(" SDRAM Device Width : %d bits\n", sdram_width );
|
||||
printf(" Number of Ranks : %d\n", ranks );
|
||||
printf(" Memory size : %d MB\n", mem_size );
|
||||
|
||||
/* printf(" Memory Density : %s\n", val2str(spd_data[4]&15, ddr3_density_vals)); */
|
||||
printf(" 1.5 V Nominal Op : %s\n", (((spd_data[6]&1) != 0) ? "No":"Yes" ) );
|
||||
printf(" 1.35 V Nominal Op : %s\n", (((spd_data[6]&2) != 0) ? "No":"Yes" ) );
|
||||
printf(" 1.2X V Nominal Op : %s\n", (((spd_data[6]&4) != 0) ? "No":"Yes" ) );
|
||||
printf(" Error Detect/Cor : %s\n", val2str(spd_data[8]>>3, ddr3_ecc_vals));
|
||||
|
||||
printf(" Manufacturer : ");
|
||||
switch (spd_data[117]&127)
|
||||
{
|
||||
case 0:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id1_vals));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id2_vals));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id3_vals));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id4_vals));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
printf("%s\n", val2str(spd_data[118], jedec_id5_vals));
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("%s\n", "JEDEC JEP106 update required" );
|
||||
|
||||
}
|
||||
|
||||
printf(" Manufacture Date : year %c%c week %c%c\n",
|
||||
'0'+(spd_data[120]>>4), '0'+(spd_data[120]&15), '0'+(spd_data[121]>>4), '0'+(spd_data[121]&15) );
|
||||
|
||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||
spd_data[122], spd_data[123], spd_data[124], spd_data[125]);
|
||||
|
||||
printf(" Part Number : ");
|
||||
for (iPN=0; iPN < 19; iPN++)
|
||||
{
|
||||
printf( "%c", *pchPN++ );
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
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);
|
||||
}
|
||||
|
||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
printf("\n");
|
||||
printbuf(spd_data, len, "SPD DATA");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_spd_print_fru(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;
|
||||
int len, offset;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
@ -723,7 +905,7 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
msg_data[0] = id;
|
||||
msg_data[1] = offset;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 32;
|
||||
msg_data[3] = FRU_DATA_RQST_SIZE;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -733,6 +915,11 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -741,53 +928,8 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
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);
|
||||
}
|
||||
/* now print spd info */
|
||||
ipmi_spd_print(spd_data, offset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,23 +28,35 @@
|
||||
* 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 <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
#endif
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
|
||||
@ -62,13 +74,13 @@ uint16_t buf2short(uint8_t * buf)
|
||||
|
||||
const char * buf2str(uint8_t * buf, int len)
|
||||
{
|
||||
static char str[1024];
|
||||
static char str[2049];
|
||||
int i;
|
||||
|
||||
if (len <= 0 || len > 1024)
|
||||
return NULL;
|
||||
|
||||
memset(str, 0, 1024);
|
||||
memset(str, 0, 2049);
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
sprintf(str+i+i, "%2.2x", buf[i]);
|
||||
@ -99,32 +111,388 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
|
||||
|
||||
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 != NULL) {
|
||||
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%02X)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
uint16_t str2val(const char *str, const struct valstr *vs)
|
||||
const char * oemval2str(uint32_t oem, uint16_t val,
|
||||
const struct oemvalstr *vs)
|
||||
{
|
||||
int i = 0;
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
while (vs[i].str != NULL) {
|
||||
if (!strncasecmp(vs[i].str, str, strlen(str)))
|
||||
return vs[i].val;
|
||||
i++;
|
||||
for (i = 0; vs[i].oem != 0xffffff && vs[i].str != NULL; i++) {
|
||||
/* FIXME: for now on we assume PICMG capability on all IANAs */
|
||||
if ( (vs[i].oem == oem || vs[i].oem == IPMI_OEM_PICMG) &&
|
||||
vs[i].val == val ) {
|
||||
return vs[i].str;
|
||||
}
|
||||
}
|
||||
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%X)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
/* str2double - safely convert string to double
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @double_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2double(const char * str, double * double_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !double_ptr)
|
||||
return (-1);
|
||||
|
||||
*double_ptr = 0;
|
||||
errno = 0;
|
||||
*double_ptr = strtod(str, &end_ptr);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2double(...) */
|
||||
|
||||
/* str2long - safely convert string to int64_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @lng_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2long(const char * str, int64_t * lng_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !lng_ptr)
|
||||
return (-1);
|
||||
|
||||
*lng_ptr = 0;
|
||||
errno = 0;
|
||||
*lng_ptr = strtol(str, &end_ptr, 0);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2long(...) */
|
||||
|
||||
/* str2ulong - safely convert string to uint64_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @ulng_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2ulong(const char * str, uint64_t * ulng_ptr)
|
||||
{
|
||||
char * end_ptr = 0;
|
||||
if (!str || !ulng_ptr)
|
||||
return (-1);
|
||||
|
||||
*ulng_ptr = 0;
|
||||
errno = 0;
|
||||
*ulng_ptr = strtoul(str, &end_ptr, 0);
|
||||
|
||||
if (*end_ptr != '\0')
|
||||
return (-2);
|
||||
|
||||
if (errno != 0)
|
||||
return (-3);
|
||||
|
||||
return 0;
|
||||
} /* str2ulong(...) */
|
||||
|
||||
/* str2int - safely convert string to int32_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @int_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2int(const char * str, int32_t * int_ptr)
|
||||
{
|
||||
int rc = 0;
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !int_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2long(str, &arg_long)) != 0 ) {
|
||||
*int_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_long < INT32_MIN || arg_long > INT32_MAX)
|
||||
return (-3);
|
||||
|
||||
*int_ptr = (int32_t)arg_long;
|
||||
return 0;
|
||||
} /* str2int(...) */
|
||||
|
||||
/* str2uint - safely convert string to uint32_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @uint_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2uint(const char * str, uint32_t * uint_ptr)
|
||||
{
|
||||
int rc = 0;
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !uint_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0) {
|
||||
*uint_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT32_MAX)
|
||||
return (-3);
|
||||
|
||||
*uint_ptr = (uint32_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2uint(...) */
|
||||
|
||||
/* str2short - safely convert string to int16_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @shrt_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2short(const char * str, int16_t * shrt_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !shrt_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2long(str, &arg_long)) != 0 ) {
|
||||
*shrt_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_long < INT16_MIN || arg_long > INT16_MAX)
|
||||
return (-3);
|
||||
|
||||
*shrt_ptr = (int16_t)arg_long;
|
||||
return 0;
|
||||
} /* str2short(...) */
|
||||
|
||||
/* str2ushort - safely convert string to uint16_t
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @ushrt_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) invalid input, (-3) for *flow
|
||||
*/
|
||||
int str2ushort(const char * str, uint16_t * ushrt_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !ushrt_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0 ) {
|
||||
*ushrt_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT16_MAX)
|
||||
return (-3);
|
||||
|
||||
*ushrt_ptr = (uint16_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2ushort(...) */
|
||||
|
||||
/* str2char - safely convert string to int8
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @chr_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) or (-3) if conversion fails
|
||||
*/
|
||||
int str2char(const char *str, int8_t * chr_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
int64_t arg_long = 0;
|
||||
if (!str || !chr_ptr) {
|
||||
return (-1);
|
||||
}
|
||||
if ((rc = str2long(str, &arg_long)) != 0) {
|
||||
*chr_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
if (arg_long < INT8_MIN || arg_long > INT8_MAX) {
|
||||
return (-3);
|
||||
}
|
||||
return 0;
|
||||
} /* str2char(...) */
|
||||
|
||||
/* str2uchar - safely convert string to uint8
|
||||
*
|
||||
* @str: source string to convert from
|
||||
* @uchr_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) if one of args is NULL, (-2) or (-3) if conversion fails
|
||||
*/
|
||||
int str2uchar(const char * str, uint8_t * uchr_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
uint64_t arg_ulong = 0;
|
||||
if (!str || !uchr_ptr)
|
||||
return (-1);
|
||||
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0 ) {
|
||||
*uchr_ptr = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (arg_ulong > UINT8_MAX)
|
||||
return (-3);
|
||||
|
||||
*uchr_ptr = (uint8_t)arg_ulong;
|
||||
return 0;
|
||||
} /* str2uchar(...) */
|
||||
|
||||
uint16_t str2val(const char *str, const struct valstr *vs)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (strncasecmp(vs[i].str, str, __maxlen(str, vs[i].str)) == 0)
|
||||
return vs[i].val;
|
||||
}
|
||||
|
||||
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
|
||||
@ -173,6 +541,18 @@ ipmi_open_file(const char * file, int rw)
|
||||
}
|
||||
}
|
||||
|
||||
#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",
|
||||
@ -227,3 +607,152 @@ ipmi_open_file(const char * file, int rw)
|
||||
return fp;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd;
|
||||
#ifdef SIGHUP
|
||||
sigset_t sighup;
|
||||
#endif
|
||||
|
||||
#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 (setpgid(0, 0) == -1)
|
||||
exit(1);
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
exit(0);
|
||||
#endif
|
||||
|
||||
chdir("/");
|
||||
umask(0);
|
||||
|
||||
for (fd=0; fd<64; fd++) {
|
||||
if (fd != intf->fd)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
open("/dev/null", O_RDWR);
|
||||
dup(0);
|
||||
dup(0);
|
||||
}
|
||||
|
||||
/* is_fru_id - wrapper for str-2-int FRU ID conversion. Message is printed
|
||||
* on error.
|
||||
* FRU ID range: <0..255>
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @fru_id_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr)
|
||||
{
|
||||
if (!argv_ptr || !fru_id_ptr) {
|
||||
lprintf(LOG_ERR, "is_fru_id(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (str2uchar(argv_ptr, fru_id_ptr) == 0) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR, "FRU ID '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
return (-1);
|
||||
} /* is_fru_id(...) */
|
||||
|
||||
/* is_ipmi_channel_num - wrapper for str-2-int Channel conversion. Message is
|
||||
* printed on error.
|
||||
*
|
||||
* 6.3 Channel Numbers, p. 45, IPMIv2 spec.
|
||||
* Valid channel numbers are: <0..7>, <E-F>
|
||||
* Reserved channel numbers: <8-D>
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @channel_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr)
|
||||
{
|
||||
if (!argv_ptr || !channel_ptr) {
|
||||
lprintf(LOG_ERR,
|
||||
"is_ipmi_channel_num(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
if ((str2uchar(argv_ptr, channel_ptr) == 0)
|
||||
&& ((*channel_ptr >= 0x0 && *channel_ptr <= 0x7)
|
||||
|| (*channel_ptr >= 0xE && *channel_ptr <= 0xF))) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR,
|
||||
"Given Channel number '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
lprintf(LOG_ERR, "Channel number must be from ranges: <0..7>, <0xE..0xF>");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* is_ipmi_user_id() - wrapper for str-2-uint IPMI UID conversion. Message is
|
||||
* printed on error.
|
||||
*
|
||||
* @argv_ptr: source string to convert from; usually argv
|
||||
* @ipmi_uid_ptr: pointer where to store result
|
||||
*
|
||||
* returns zero on success
|
||||
* returns (-1) on error and message is printed on STDERR
|
||||
*/
|
||||
int
|
||||
is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr)
|
||||
{
|
||||
if (!argv_ptr || !ipmi_uid_ptr) {
|
||||
lprintf(LOG_ERR,
|
||||
"is_ipmi_user_id(): invalid argument(s).");
|
||||
return (-1);
|
||||
}
|
||||
if ((str2uchar(argv_ptr, ipmi_uid_ptr) == 0)
|
||||
&& *ipmi_uid_ptr >= IPMI_UID_MIN
|
||||
&& *ipmi_uid_ptr <= IPMI_UID_MAX) {
|
||||
return 0;
|
||||
}
|
||||
lprintf(LOG_ERR,
|
||||
"Given User ID '%s' is either invalid or out of range.",
|
||||
argv_ptr);
|
||||
lprintf(LOG_ERR, "User ID is limited to range <%i..%i>.",
|
||||
IPMI_UID_MIN, IPMI_UID_MAX);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/* -*-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
|
||||
@ -28,15 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@ -54,6 +51,9 @@
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
|
||||
extern int csv_output;
|
||||
extern int verbose;
|
||||
|
||||
void printf_channel_usage (void);
|
||||
|
||||
/**
|
||||
@ -140,9 +140,9 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
(auth_cap.kg_status) ? "non-zero" : "default (all zeroes)");
|
||||
|
||||
printf("Per message authentication : %sabled\n",
|
||||
(auth_cap.per_message_auth) ? "en" : "dis");
|
||||
(auth_cap.per_message_auth) ? "dis" : "en");
|
||||
printf("User level authentication : %sabled\n",
|
||||
(auth_cap.user_level_auth) ? "en" : "dis");
|
||||
(auth_cap.user_level_auth) ? "dis" : "en");
|
||||
|
||||
printf("Non-null user names exist : %s\n",
|
||||
(auth_cap.non_null_usernames) ? "yes" : "no");
|
||||
@ -171,7 +171,7 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
auth_cap.oem_aux_data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -189,6 +189,7 @@ 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;
|
||||
|
||||
@ -221,16 +222,16 @@ ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
|
||||
|
||||
printf(" Session Support : ");
|
||||
switch (channel_info.session_support) {
|
||||
case 0x00:
|
||||
case 0x0:
|
||||
printf("session-less\n");
|
||||
break;
|
||||
case 0x40:
|
||||
case 0x1:
|
||||
printf("single-session\n");
|
||||
break;
|
||||
case 0x80:
|
||||
case 0x2:
|
||||
printf("multi-session\n");
|
||||
break;
|
||||
case 0xc0:
|
||||
case 0x3:
|
||||
default:
|
||||
printf("session-based\n");
|
||||
break;
|
||||
@ -245,6 +246,12 @@ ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
|
||||
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;
|
||||
@ -353,8 +360,6 @@ ipmi_get_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
|
||||
struct get_user_access_rsp user_access;
|
||||
int curr_uid, max_uid = 0, init = 1;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
curr_uid = userid ? : 1;
|
||||
|
||||
memset(&req1, 0, sizeof(req1));
|
||||
@ -433,7 +438,7 @@ ipmi_get_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
|
||||
static int
|
||||
ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
uint8_t channel, userid;
|
||||
uint8_t channel, privilege_limit, userid;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[2];
|
||||
@ -441,15 +446,19 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct set_user_access_data set_access;
|
||||
int i;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
if ((argc < 3) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
if ((argc < 3) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
printf_channel_usage();
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
channel = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
userid = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (str2uchar(argv[0], &channel) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[0]);
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(argv[1], &userid) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
@ -475,6 +484,7 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
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;
|
||||
@ -496,7 +506,11 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
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);
|
||||
if (str2uchar(argv[i]+10, &privilege_limit) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[i]+10);
|
||||
return (-1);
|
||||
}
|
||||
set_access.privilege_limit = privilege_limit;
|
||||
}
|
||||
else {
|
||||
printf ("Invalid option: %s\n", argv [i]);
|
||||
@ -526,6 +540,212 @@ ipmi_set_user_access(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
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) && (rsp->data_len == 17) && (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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy last chunk */
|
||||
if(rsp->data_len > 1)
|
||||
{
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
//
|
||||
// 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)
|
||||
{
|
||||
@ -542,12 +762,14 @@ ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel)
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get Channel Info command failed");
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Channel Info command failed: %s",
|
||||
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 -1;
|
||||
return IPMI_CHANNEL_MEDIUM_RESERVED;
|
||||
}
|
||||
|
||||
memcpy(&info, rsp->data, sizeof(struct get_channel_info_rsp));
|
||||
@ -571,7 +793,8 @@ printf_channel_usage()
|
||||
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]\n");
|
||||
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");
|
||||
@ -586,6 +809,7 @@ int
|
||||
ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int retval = 0;
|
||||
uint8_t channel, priv = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0))
|
||||
{
|
||||
@ -593,22 +817,38 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
else if (strncmp(argv[0], "authcap", 7) == 0)
|
||||
{
|
||||
if (argc != 3)
|
||||
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));
|
||||
return (-1);
|
||||
} else {
|
||||
if (str2uchar(argv[1], &channel) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(argv[2], &priv) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
retval = ipmi_get_channel_auth_cap(intf, channel, priv);
|
||||
}
|
||||
}
|
||||
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 ch = 0;
|
||||
uint8_t id = 0;
|
||||
if (argc == 3)
|
||||
id = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
if (str2uchar(argv[1], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
if (argc == 3) {
|
||||
if (str2uchar(argv[2], &id) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
retval = ipmi_get_user_access(intf, ch, id);
|
||||
}
|
||||
}
|
||||
@ -622,11 +862,36 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
printf_channel_usage();
|
||||
else {
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 2)
|
||||
ch = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (argc == 2) {
|
||||
if (str2uchar(argv[1], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[1]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
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 == 3) {
|
||||
if (str2uchar(argv[2], &ch) != 0) {
|
||||
lprintf(LOG_ERR, "Numeric value expected, but '%s' given.", argv[2]);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
retval = ipmi_get_channel_cipher_suites(intf,
|
||||
argv[1], // ipmi | sol
|
||||
ch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Invalid CHANNEL command: %s\n", argv[0]);
|
||||
@ -636,4 +901,3 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -28,25 +28,24 @@
|
||||
* 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 <time.h>
|
||||
|
||||
#include <ipmitool/bswap.h>
|
||||
#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
|
||||
int
|
||||
ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
@ -64,33 +63,32 @@ ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power Status failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Power is %s\n", (rsp->data[0] & 0x1) ? "on" : "off");
|
||||
return rsp->data[0] & 1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 int
|
||||
int
|
||||
ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x2;
|
||||
@ -100,21 +98,23 @@ ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl)
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
val2str(ctl, ipmi_chassis_power_control_vals));
|
||||
|
||||
#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;
|
||||
}
|
||||
@ -124,13 +124,12 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
int rc = (-3);
|
||||
|
||||
struct {
|
||||
uint8_t interval;
|
||||
uint8_t force_on;
|
||||
} identify_data;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
} identify_data = { .interval = 0, .force_on = 0 };
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
@ -138,18 +137,23 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
|
||||
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;
|
||||
if ( (rc = str2uchar(arg, &identify_data.interval)) != 0) {
|
||||
if (rc == (-2)) {
|
||||
lprintf(LOG_ERR, "Invalid interval given.");
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Given interval is too big.");
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -160,7 +164,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Identify failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
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
|
||||
@ -176,7 +180,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
printf("default (15 seconds)\n");
|
||||
} else {
|
||||
if (identify_data.force_on != 0) {
|
||||
printf("indefinate\n");
|
||||
printf("indefinite\n");
|
||||
} else {
|
||||
if (identify_data.interval == 0)
|
||||
printf("off\n");
|
||||
@ -192,7 +196,10 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t mins_per_count;
|
||||
uint32_t count;
|
||||
float minutes;
|
||||
uint32_t days, hours;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
@ -205,14 +212,30 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Power-On-Hours failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
mins_per_count = rsp->data[0];
|
||||
memcpy(&count, rsp->data+1, 4);
|
||||
#if WORDS_BIGENDIAN
|
||||
count = BSWAP_32(count);
|
||||
#endif
|
||||
|
||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||
(long)count, (long)(count / 24), (long)(count % 24));
|
||||
minutes = (float)count * mins_per_count;
|
||||
days = minutes / 1440;
|
||||
minutes -= (float)days * 1440;
|
||||
hours = minutes / 60;
|
||||
minutes -= hours * 60;
|
||||
|
||||
if (mins_per_count < 60) {
|
||||
printf("POH Counter : %i days, %i hours, %li minutes\n",
|
||||
days, hours, (long)minutes);
|
||||
} else {
|
||||
printf("POH Counter : %i days, %i hours\n", days, hours);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -232,7 +255,7 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Restart Cause failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -276,7 +299,7 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
@ -293,7 +316,7 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error sending Chassis Status command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -339,7 +362,7 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
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) {
|
||||
if (rsp->data_len > 3) {
|
||||
/* optional byte 4 */
|
||||
if (rsp->data[3] == 0) {
|
||||
printf("Front Panel Control : none\n");
|
||||
@ -348,12 +371,81 @@ ipmi_chassis_status(struct ipmi_intf * intf)
|
||||
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");
|
||||
printf("Sleep Button Disabled: %s\n", (rsp->data[3] & 0x08) ? "true" : "false");
|
||||
printf("Diag Button Disabled : %s\n", (rsp->data[3] & 0x04) ? "true" : "false");
|
||||
printf("Reset Button Disabled: %s\n", (rsp->data[3] & 0x02) ? "true" : "false");
|
||||
printf("Power Button Disabled: %s\n", (rsp->data[3] & 0x01) ? "true" : "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ipmi_chassis_selftest(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
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;
|
||||
}
|
||||
@ -365,8 +457,6 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[16];
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
memset(msg_data, 0, 16);
|
||||
msg_data[0] = param & 0x7f;
|
||||
memcpy(msg_data+1, data, len);
|
||||
@ -383,12 +473,14 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
if (param != 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Chassis Set Boot Parameter %d to %s\n", param, data);
|
||||
lprintf(LOG_DEBUG, "Chassis Set Boot Parameter %d to %s", param, buf2str(data, len));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -398,13 +490,20 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[3];
|
||||
uint8_t param_id = 0;
|
||||
|
||||
if (arg == NULL)
|
||||
return -1;
|
||||
|
||||
if (str2uchar(arg, ¶m_id) != 0) {
|
||||
lprintf(LOG_ERR, "Invalid parameter '%s' given instead of bootparam.",
|
||||
arg);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(msg_data, 0, 3);
|
||||
|
||||
msg_data[0] = (uint8_t)atoi(arg) & 0x7f;
|
||||
msg_data[0] = param_id & 0x7f;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
|
||||
@ -421,53 +520,340 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get Chassis Boot Parameter %s failed: %s",
|
||||
arg, val2str(rsp->ccode, completion_code_vals));
|
||||
arg, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "Boot Option");
|
||||
|
||||
param_id = 0;
|
||||
param_id = (rsp->data[1] & 0x7f);
|
||||
|
||||
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");
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
|
||||
switch(param_id)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
printf(" Set In Progress : ");
|
||||
switch((rsp->data[2]) &0x03)
|
||||
{
|
||||
case 0: printf("set complete\n"); break;
|
||||
case 1: printf("set in progress\n"); break;
|
||||
case 2: printf("commit write\n"); break;
|
||||
default: printf("error, reserved bit\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
printf(" Service Partition Selector : ");
|
||||
if((rsp->data[2]) == 0)
|
||||
{
|
||||
printf("unspecified\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%d\n",(rsp->data[2]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
printf( " Service Partition Scan :\n");
|
||||
if((rsp->data[2]&0x03) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Request BIOS to scan\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Service Partition Discovered\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
printf( " BMC boot flag valid bit clearing :\n");
|
||||
if((rsp->data[2]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x10) == 0x10)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by PEF\n");
|
||||
if((rsp->data[2]&0x08) == 0x08)
|
||||
printf(" - Don't automatically clear boot flag valid bit on timeout\n");
|
||||
if((rsp->data[2]&0x04) == 0x04)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by watchdog\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Don't clear valid bit on push button reset // soft reset\n");
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Don't clear valid bit on power up via power push button or wake event\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
printf( " Boot Info Acknowledge :\n");
|
||||
if((rsp->data[3]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[3]&0x10) == 0x10)
|
||||
printf(" - OEM has handled boot info\n");
|
||||
if((rsp->data[3]&0x08) == 0x08)
|
||||
printf(" - SMS has handled boot info\n");
|
||||
if((rsp->data[3]&0x04) == 0x04)
|
||||
printf(" - OS // service partition has handled boot info\n");
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - OS Loader has handled boot info\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - BIOS/POST has handled boot info\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
printf( " Boot Flags :\n");
|
||||
|
||||
if((rsp->data[2]&0x80) == 0x80)
|
||||
printf(" - Boot Flag Valid\n");
|
||||
else
|
||||
printf(" - Boot Flag Invalid\n");
|
||||
|
||||
if((rsp->data[2]&0x40) == 0x40)
|
||||
printf(" - Options apply to all future boots\n");
|
||||
else
|
||||
printf(" - Options apply to only next boot\n");
|
||||
|
||||
if((rsp->data[2]&0x20) == 0x20)
|
||||
printf(" - BIOS EFI boot \n");
|
||||
else
|
||||
printf(" - BIOS PC Compatible (legacy) boot \n");
|
||||
|
||||
if((rsp->data[3]&0x80) == 0x80)
|
||||
printf(" - CMOS Clear\n");
|
||||
if((rsp->data[3]&0x40) == 0x40)
|
||||
printf(" - Lock Keyboard\n");
|
||||
printf(" - Boot Device Selector : ");
|
||||
switch( ((rsp->data[3]>>2)&0x0f))
|
||||
{
|
||||
case 0: printf("No override\n"); break;
|
||||
case 1: printf("Force PXE\n"); break;
|
||||
case 2: printf("Force Boot from default Hard-Drive\n"); break;
|
||||
case 3: printf("Force Boot from default Hard-Drive, request Safe-Mode\n"); break;
|
||||
case 4: printf("Force Boot from Diagnostic Partition\n"); break;
|
||||
case 5: printf("Force Boot from CD/DVD\n"); break;
|
||||
case 6: printf("Force Boot into BIOS Setup\n"); break;
|
||||
case 15: printf("Force Boot from Floppy/primary removable media\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - Screen blank\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - Lock out Reset buttons\n");
|
||||
|
||||
if((rsp->data[4]&0x80) == 0x80)
|
||||
printf(" - Lock out (power off/sleep request) vi Power Button\n");
|
||||
printf(" - Console Redirection control : ");
|
||||
switch( ((rsp->data[4]>>5)&0x03))
|
||||
{
|
||||
case 0: printf("System Default\n"); break;
|
||||
case 1: printf("Request Quiet Display\n"); break;
|
||||
case 2: printf("Request Verbose Display\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[4]&0x10) == 0x10)
|
||||
printf(" - Force progress event traps\n");
|
||||
if((rsp->data[4]&0x08) == 0x08)
|
||||
printf(" - User password bypass\n");
|
||||
if((rsp->data[4]&0x04) == 0x04)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
if((rsp->data[4]&0x02) == 0x02)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
printf(" - BIOS verbosity : ");
|
||||
switch( ((rsp->data[4]>>0)&0x03))
|
||||
{
|
||||
case 0: printf("Console redirection occurs per BIOS configuration setting (default)\n"); break;
|
||||
case 1: printf("Suppress (skip) console redirection if enabled\n"); break;
|
||||
case 2: printf("Request console redirection be enabled\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
|
||||
if((rsp->data[5]&0x08) == 0x08)
|
||||
printf(" - BIOS Shared Mode Override\n");
|
||||
printf(" - BIOS Mux Control Override : ");
|
||||
switch( ((rsp->data[5]>>0)&0x07))
|
||||
{
|
||||
case 0: printf("BIOS uses recommended setting of the mux at the end of POST\n"); break;
|
||||
case 1: printf("Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot\n"); break;
|
||||
case 2: printf("Requests BIOS to force mux to system at conclusion of POST/start of OS boot\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
unsigned long session_id;
|
||||
unsigned long timestamp;
|
||||
char time_buf[40];
|
||||
time_t out_time;
|
||||
|
||||
session_id = ((unsigned long) rsp->data[3]);
|
||||
session_id |= (((unsigned long) rsp->data[4])<<8);
|
||||
session_id |= (((unsigned long) rsp->data[5])<<16);
|
||||
session_id |= (((unsigned long) rsp->data[6])<<24);
|
||||
|
||||
timestamp = ((unsigned long) rsp->data[7]);
|
||||
timestamp |= (((unsigned long) rsp->data[8])<<8);
|
||||
timestamp |= (((unsigned long) rsp->data[9])<<16);
|
||||
timestamp |= (((unsigned long) rsp->data[10])<<24);
|
||||
|
||||
memset(time_buf, 0, 40);
|
||||
strftime(
|
||||
time_buf,
|
||||
sizeof(time_buf),
|
||||
"%m/%d/%Y %H:%M:%S", localtime(&out_time)
|
||||
);
|
||||
|
||||
printf(" Boot Initiator Info :\n");
|
||||
printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f));
|
||||
printf(" Session Id : %08lXh\n",session_id);
|
||||
if(timestamp != 0)
|
||||
{
|
||||
printf(" Timestamp : %08lXh, %s\n",timestamp,time_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Timestamp : %08lXh, undefined\n",timestamp);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
printf(" Selector : %d\n", rsp->data[2] );
|
||||
printf(" Block Data : %s\n", buf2str(rsp->data+3, rsp->data_len - 2));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf(" Undefined byte\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_chassis_set_bootflag(struct ipmi_intf * intf, char * arg)
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
|
||||
{
|
||||
uint8_t flags[5];
|
||||
int rc = 0;
|
||||
int use_progress = 1;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
if (arg == NULL) {
|
||||
lprintf(LOG_ERR, "No bootflag argument supplied");
|
||||
return -1;
|
||||
if (use_progress) {
|
||||
/* set set-in-progress flag */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
|
||||
if (rc < 0)
|
||||
use_progress = 0;
|
||||
}
|
||||
|
||||
if (strncmp(arg, "force_pxe", 9) == 0)
|
||||
flags[1] = 0x04;
|
||||
else if (strncmp(arg, "force_disk", 10) == 0)
|
||||
flags[1] = 0x08;
|
||||
else if (strncmp(arg, "force_diag", 10) == 0)
|
||||
flags[1] = 0x10;
|
||||
else if (strncmp(arg, "force_cdrom", 11) == 0)
|
||||
flags[1] = 0x14;
|
||||
else if (strncmp(arg, "force_floppy", 12) == 0)
|
||||
flags[1] = 0x3c;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid bootflag: %s", arg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
flags[0] = 0x80; /* set flag valid bit */
|
||||
rc = ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
flags[1] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
|
||||
flags, 2);
|
||||
|
||||
if (rc < 0) {
|
||||
flags[0] = 0x08; /* don't automatically clear boot flag valid bit in 60 seconds */
|
||||
rc = ipmi_chassis_set_bootparam(intf, 3, flags, 1);
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (iflags == NULL)
|
||||
memset(flags, 0, 5);
|
||||
else
|
||||
memcpy(flags, iflags, sizeof (flags));
|
||||
|
||||
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 {
|
||||
lprintf(LOG_ERR, "Invalid argument: %s", arg);
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* set flag valid bit */
|
||||
flags[0] |= 0x80;
|
||||
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
|
||||
flags, 5);
|
||||
if (rc == 0) {
|
||||
if (use_progress) {
|
||||
/* set-in-progress = commit-write */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x02;
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
printf("Set Boot Device to %s\n", arg);
|
||||
}
|
||||
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -479,8 +865,6 @@ ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_CHASSIS;
|
||||
req.msg.cmd = 0x6;
|
||||
@ -494,7 +878,7 @@ ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Power Restore Policy command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -527,17 +911,55 @@ ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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");
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, 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;
|
||||
|
||||
@ -546,7 +968,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return 0;
|
||||
}
|
||||
if (strncmp(argv[1], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_power_status(intf);
|
||||
rc = ipmi_chassis_print_power_status(intf);
|
||||
return rc;
|
||||
}
|
||||
if ((strncmp(argv[1], "up", 2) == 0) || (strncmp(argv[1], "on", 2) == 0))
|
||||
@ -611,9 +1033,16 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
rc = ipmi_chassis_power_policy(intf, ctl);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "bootparam", 7) == 0) {
|
||||
else if (strncmp(argv[0], "bootparam", 9) == 0) {
|
||||
if ((argc < 3) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "bootparam get|set <option> [value ...]");
|
||||
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) == 0) {
|
||||
@ -624,7 +1053,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
} else {
|
||||
if (strncmp(argv[2], "bootflag", 8) == 0)
|
||||
rc = ipmi_chassis_set_bootflag(intf, argv[3]);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], NULL);
|
||||
else
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
}
|
||||
@ -633,6 +1062,123 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
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, "bootdev <device> [options=help,...]");
|
||||
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");
|
||||
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
|
||||
} else {
|
||||
if (argc < 3)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0) {
|
||||
uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
} else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
}
|
||||
else if (strncmp(argv[2], "options=", 8) == 0) {
|
||||
char *token;
|
||||
char *saveptr = NULL;
|
||||
int optionError = 0;
|
||||
unsigned char flags[5];
|
||||
static struct {
|
||||
char *name;
|
||||
int i;
|
||||
unsigned char mask;
|
||||
unsigned char value;
|
||||
char *desc;
|
||||
} options[] = {
|
||||
/* data 1 */
|
||||
{"valid", 0, (1<<7), (1<<7),
|
||||
"Boot flags valid"},
|
||||
{"persistent", 0, (1<<6), (1<<6),
|
||||
"Changes are persistent for all future boots"},
|
||||
{"efiboot", 0, (1<<5), (1<<5),
|
||||
"Extensible Firmware Interface Boot (EFI)"},
|
||||
/* data 2 */
|
||||
{"clear-cmos", 1, (1<<7), (1<<7),
|
||||
"CMOS clear"},
|
||||
{"lockkbd", 1, (1<<6), (1<<6),
|
||||
"Lock Keyboard"},
|
||||
/* data2[5:2] is parsed elsewhere */
|
||||
{"screenblank", 1, (1<<1), (1<<1),
|
||||
"Screen Blank"},
|
||||
{"lockoutreset", 1, (1<<0), (1<<0),
|
||||
"Lock out Resetbuttons"},
|
||||
/* data 3 */
|
||||
{"lockout_power", 2, (1<<7), (1<<7),
|
||||
"Lock out (power off/sleep request) via Power Button"},
|
||||
{"verbose=default", 2, (3<<5), (0<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=no", 2, (3<<5), (1<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=yes", 2, (3<<5), (2<<5),
|
||||
"Request verbose BIOS display"},
|
||||
{"force_pet", 2, (1<<4), (1<<4),
|
||||
"Force progress event traps"},
|
||||
{"upw_bypass", 2, (1<<3), (1<<3),
|
||||
"User password bypass"},
|
||||
{"lockout_sleep", 2, (1<<2), (1<<2),
|
||||
"Log Out Sleep Button"},
|
||||
{"cons_redirect=default", 2, (3<<0), (0<<0),
|
||||
"Console redirection occurs per BIOS configuration setting"},
|
||||
{"cons_redirect=skip", 2, (3<<0), (1<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
{"cons_redirect=enable", 2, (3<<0), (2<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
/* data 4 */
|
||||
/* data4[7:4] reserved */
|
||||
/* data4[3] BIOS Shared Mode Override, not implemented here */
|
||||
/* data4[2:0] BIOS Mux Control Override, not implemented here */
|
||||
|
||||
/* data5 reserved */
|
||||
|
||||
{NULL} /* End marker */
|
||||
}, *op;
|
||||
|
||||
memset(&flags[0], 0, sizeof(flags));
|
||||
token = strtok_r(argv[2] + 8, ",", &saveptr);
|
||||
while (token != NULL) {
|
||||
if (strcmp(token, "help") == 0) {
|
||||
optionError = 1;
|
||||
break;
|
||||
}
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
if (strcmp(token, op->name) == 0) {
|
||||
flags[op->i] &= op->mask;
|
||||
flags[op->i] |= op->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (op->name == NULL) {
|
||||
/* Option not found */
|
||||
optionError = 1;
|
||||
lprintf(LOG_ERR, "Invalid option: %s", token);
|
||||
}
|
||||
token = strtok_r(NULL, ",", &saveptr);
|
||||
}
|
||||
if (optionError) {
|
||||
lprintf(LOG_NOTICE, "Legal options are:");
|
||||
lprintf(LOG_NOTICE, "\thelp:\tprint this message");
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
}
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid Chassis command: %s", argv[0]);
|
||||
return -1;
|
||||
|
2096
ipmitool/lib/ipmi_dcmi.c
Executable file
2096
ipmitool/lib/ipmi_dcmi.c
Executable file
File diff suppressed because it is too large
Load Diff
4225
ipmitool/lib/ipmi_delloem.c
Normal file
4225
ipmitool/lib/ipmi_delloem.c
Normal file
File diff suppressed because it is too large
Load Diff
4190
ipmitool/lib/ipmi_ekanalyzer.c
Normal file
4190
ipmitool/lib/ipmi_ekanalyzer.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -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>
|
||||
@ -53,17 +49,42 @@
|
||||
#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, int num)
|
||||
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;
|
||||
int p = 0;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
memset(rqdata, 0, 8);
|
||||
@ -71,53 +92,20 @@ ipmi_send_platform_event(struct ipmi_intf * intf, int num)
|
||||
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 */
|
||||
req.msg.data_len = 8;
|
||||
rqdata[p++] = 0x20;
|
||||
rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
|
||||
memcpy(rqdata+1, emsg, sizeof(struct platform_event_msg));
|
||||
}
|
||||
else {
|
||||
req.msg.data_len = 7;
|
||||
memcpy(rqdata, emsg, sizeof(struct platform_event_msg));
|
||||
}
|
||||
|
||||
/* IPMB/LAN/etc */
|
||||
switch (num) {
|
||||
case 1: /* temperature */
|
||||
printf("Sending SAMPLE event: Temperature - "
|
||||
"Upper Critical - Going High\n");
|
||||
rqdata[p++] = 0x04; /* EvMRev */
|
||||
rqdata[p++] = 0x01; /* Sensor Type */
|
||||
rqdata[p++] = 0x30; /* Sensor # */
|
||||
rqdata[p++] = 0x01; /* Event Dir / Event Type */
|
||||
rqdata[p++] = 0x59; /* Event Data 1 */
|
||||
rqdata[p++] = 0x00; /* Event Data 2 */
|
||||
rqdata[p++] = 0x00; /* Event Data 3 */
|
||||
break;
|
||||
case 2: /* voltage error */
|
||||
printf("Sending SAMPLE event: Voltage Threshold - "
|
||||
"Lower Critical - Going Low\n");
|
||||
rqdata[p++] = 0x04; /* EvMRev */
|
||||
rqdata[p++] = 0x02; /* Sensor Type */
|
||||
rqdata[p++] = 0x60; /* Sensor # */
|
||||
rqdata[p++] = 0x01; /* Event Dir / Event Type */
|
||||
rqdata[p++] = 0x52; /* Event Data 1 */
|
||||
rqdata[p++] = 0x00; /* Event Data 2 */
|
||||
rqdata[p++] = 0x00; /* Event Data 3 */
|
||||
break;
|
||||
case 3: /* correctable ECC */
|
||||
printf("Sending SAMPLE event: Memory - Correctable ECC\n");
|
||||
rqdata[p++] = 0x04; /* EvMRev */
|
||||
rqdata[p++] = 0x0c; /* Sensor Type */
|
||||
rqdata[p++] = 0x53; /* Sensor # */
|
||||
rqdata[p++] = 0x6f; /* Event Dir / Event Type */
|
||||
rqdata[p++] = 0x00; /* Event Data 1 */
|
||||
rqdata[p++] = 0x00; /* Event Data 2 */
|
||||
rqdata[p++] = 0x00; /* Event Data 3 */
|
||||
break;
|
||||
default:
|
||||
lprintf(LOG_ERR, "Invalid event number: %d", num);
|
||||
return -1;
|
||||
}
|
||||
ipmi_event_msg_print(intf, emsg);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -133,6 +121,363 @@ ipmi_send_platform_event(struct ipmi_intf * intf, int num)
|
||||
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)
|
||||
{
|
||||
ipmi_sdr_print_discrete_state_mini(
|
||||
"Sensor States: \n ", "\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;
|
||||
uint8_t target, lun, channel;
|
||||
|
||||
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:
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
|
||||
emsg.sensor_type = sdr->record.common->sensor.type;
|
||||
emsg.sensor_num = sdr->record.common->keys.sensor_num;
|
||||
emsg.event_type = sdr->record.common->event_type;
|
||||
target = sdr->record.common->keys.owner_id;
|
||||
lun = sdr->record.common->keys.lun;
|
||||
channel = sdr->record.common->keys.channel;
|
||||
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");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num,
|
||||
target, lun, channel);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR,
|
||||
"Command Get Sensor Thresholds failed: invalid response.");
|
||||
return (-1);
|
||||
} else if (rsp->ccode != 0) {
|
||||
lprintf(LOG_ERR, "Command Get Sensor Thresholds failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* threshold reading */
|
||||
emsg.event_data[2] = rsp->data[(emsg.event_data[0] / 2) + 1];
|
||||
|
||||
rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num,
|
||||
target, lun, channel);
|
||||
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)
|
||||
{
|
||||
@ -150,9 +495,6 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
if (file == NULL)
|
||||
return -1;
|
||||
|
||||
/* must be admin privilege to do this */
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
memset(rqdata, 0, 8);
|
||||
|
||||
/* setup Platform Event Message command */
|
||||
@ -165,7 +507,7 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
chmed = ipmi_current_channel_medium(intf);
|
||||
if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
|
||||
/* system interface, need extra generator ID */
|
||||
rqdata[0] = 0x20;
|
||||
rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
|
||||
req.msg.data_len = 8;
|
||||
}
|
||||
|
||||
@ -173,7 +515,7 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
if (fp == NULL)
|
||||
return -1;
|
||||
|
||||
while (feof(fp) != 0) {
|
||||
while (feof(fp) == 0) {
|
||||
if (fgets(buf, 1024, fp) == NULL)
|
||||
continue;
|
||||
|
||||
@ -186,10 +528,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
while (isspace((int)*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace(*ptr))
|
||||
while (isspace((int)*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
@ -215,19 +557,19 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
|
||||
memset(&sel_event, 0, sizeof(struct sel_event_record));
|
||||
sel_event.record_id = 0;
|
||||
sel_event.gen_id = 2;
|
||||
sel_event.sel_type.standard_type.gen_id = 2;
|
||||
|
||||
j = (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) ? 1 : 0;
|
||||
sel_event.evm_rev = rqdata[j++];
|
||||
sel_event.sensor_type = rqdata[j++];
|
||||
sel_event.sensor_num = rqdata[j++];
|
||||
sel_event.event_type = rqdata[j] & 0x7f;
|
||||
sel_event.event_dir = (rqdata[j++] & 0x80) >> 7;
|
||||
sel_event.event_data[0] = rqdata[j++];
|
||||
sel_event.event_data[1] = rqdata[j++];
|
||||
sel_event.event_data[2] = rqdata[j++];
|
||||
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(&sel_event);
|
||||
ipmi_sel_print_std_entry(intf, &sel_event);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -245,33 +587,56 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
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 string 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)
|
||||
{
|
||||
uint8_t c;
|
||||
int rc = 0;
|
||||
|
||||
if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "usage: event <num>");
|
||||
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, "usage: event file <filename>");
|
||||
lprintf(LOG_NOTICE, " Will read list of events from file");
|
||||
ipmi_event_usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strncmp(argv[0], "file", 4) == 0) {
|
||||
if (argc < 2) {
|
||||
lprintf(LOG_NOTICE, "usage: event file <filename>\n");
|
||||
rc = -1;
|
||||
} else {
|
||||
rc = ipmi_event_fromfile(intf, argv[1]);
|
||||
ipmi_event_usage();
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
c = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
rc = ipmi_send_platform_event(intf, c);
|
||||
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;
|
||||
}
|
||||
|
1191
ipmitool/lib/ipmi_firewall.c
Normal file
1191
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
1681
ipmitool/lib/ipmi_fwum.c
Normal file
1681
ipmitool/lib/ipmi_fwum.c
Normal file
File diff suppressed because it is too large
Load Diff
640
ipmitool/lib/ipmi_gendev.c
Normal file
640
ipmitool/lib/ipmi_gendev.c
Normal file
@ -0,0 +1,640 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Kontron Canada, 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 <string.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
#include <ipmitool/ipmi_gendev.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
extern int verbose;
|
||||
|
||||
|
||||
#define GENDEV_RETRY_COUNT 5
|
||||
#define GENDEV_MAX_SIZE 16
|
||||
|
||||
typedef struct gendev_eeprom_info
|
||||
{
|
||||
uint32_t size;
|
||||
uint16_t page_size;
|
||||
uint8_t address_span;
|
||||
uint8_t address_length;
|
||||
}t_gendev_eeprom_info;
|
||||
|
||||
|
||||
static int
|
||||
ipmi_gendev_get_eeprom_size(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
t_gendev_eeprom_info *info
|
||||
)
|
||||
{
|
||||
int eeprom_size = 0;
|
||||
/*
|
||||
lprintf(LOG_ERR, "Gen Device : %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "Access Addr: %x", dev->dev_access_addr);
|
||||
lprintf(LOG_ERR, "Slave Addr : %x", dev->dev_slave_addr);
|
||||
lprintf(LOG_ERR, "Channel Num: %x", dev->channel_num);
|
||||
lprintf(LOG_ERR, "Lun : %x", dev->lun);
|
||||
lprintf(LOG_ERR, "Bus : %x", dev->bus);
|
||||
lprintf(LOG_ERR, "Addr Span : %x", dev->addr_span);
|
||||
lprintf(LOG_ERR, "DevType : %x", dev->dev_type);
|
||||
lprintf(LOG_ERR, "DevType Mod: %x", dev->dev_type_modifier);
|
||||
*/
|
||||
if( info != NULL)
|
||||
{
|
||||
switch(dev->dev_type)
|
||||
{
|
||||
case 0x08: // 24C01
|
||||
info->size = 128;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 1;
|
||||
break;
|
||||
case 0x09: // 24C02
|
||||
info->size = 256;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 1;
|
||||
break;
|
||||
case 0x0A: // 24C04
|
||||
info->size = 512;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0B: // 24C08
|
||||
info->size = 1024;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0C: // 24C16
|
||||
info->size = 2048;
|
||||
info->page_size = 256;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0D: // 24C17
|
||||
info->size = 2048;
|
||||
info->page_size = 256;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0E: // 24C32
|
||||
info->size = 4096;
|
||||
info->page_size = 8;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0x0F: // 24C64
|
||||
info->size = 8192;
|
||||
info->page_size = 32;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC0: // Proposed OEM Code for 24C128
|
||||
info->size = 16384;
|
||||
info->page_size = 64;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC1: // Proposed OEM Code for 24C256
|
||||
info->size = 32748;
|
||||
info->page_size = 64;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC2: // Proposed OEM Code for 24C512
|
||||
info->size = 65536;
|
||||
info->page_size = 128;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
case 0xC3: // Proposed OEM Code for 24C1024
|
||||
info->size = 131072;
|
||||
info->page_size = 128;
|
||||
info->address_span = dev->addr_span;
|
||||
info->address_length = 2;
|
||||
break;
|
||||
/* Please reserved up to CFh for future update */
|
||||
default: // Not a eeprom, return size = 0;
|
||||
info->size = 0;
|
||||
info->page_size = 0;
|
||||
info->address_span = 0;
|
||||
info->address_length = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
eeprom_size = info->size;
|
||||
}
|
||||
|
||||
return eeprom_size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
ipmi_gendev_read_file(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
const char *ofile
|
||||
)
|
||||
{
|
||||
int rc = 0;
|
||||
int eeprom_size;
|
||||
t_gendev_eeprom_info eeprom_info;
|
||||
|
||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
||||
|
||||
if(eeprom_size > 0)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
/* now write to file */
|
||||
fp = ipmi_open_file_write(ofile);
|
||||
|
||||
if(fp)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
int numWrite;
|
||||
uint32_t counter;
|
||||
uint8_t msize;
|
||||
uint8_t channel = dev->channel_num;
|
||||
uint8_t i2cbus = dev->bus;
|
||||
uint8_t i2caddr = dev->dev_slave_addr;
|
||||
uint8_t privatebus = 1;
|
||||
uint32_t address_span_size;
|
||||
uint8_t percentCompleted = 0;
|
||||
|
||||
|
||||
/* Handle Address Span */
|
||||
if( eeprom_info.address_span != 0)
|
||||
{
|
||||
address_span_size =
|
||||
(eeprom_info.size / (eeprom_info.address_span+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
address_span_size = eeprom_info.size;
|
||||
}
|
||||
|
||||
/* Setup read/write size */
|
||||
if( eeprom_info.page_size < GENDEV_MAX_SIZE)
|
||||
{
|
||||
msize = eeprom_info.page_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
msize = GENDEV_MAX_SIZE;
|
||||
// All eeprom with page higher than 32 is on the
|
||||
// 16 bytes boundary
|
||||
}
|
||||
|
||||
/* Setup i2c bus byte */
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | privatebus;
|
||||
|
||||
/*
|
||||
lprintf(LOG_ERR, "Generic device: %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "I2C Chnl: %x", channel);
|
||||
lprintf(LOG_ERR, "I2C Bus : %x", i2cbus);
|
||||
lprintf(LOG_ERR, "I2C Addr: %x", i2caddr); */
|
||||
|
||||
for (
|
||||
counter = 0;
|
||||
(counter < (eeprom_info.size)) && (rc == 0);
|
||||
counter+= msize
|
||||
)
|
||||
{
|
||||
uint8_t retryCounter;
|
||||
|
||||
for(
|
||||
retryCounter = 0;
|
||||
retryCounter<GENDEV_RETRY_COUNT;
|
||||
retryCounter ++
|
||||
)
|
||||
{
|
||||
uint8_t wrByte[GENDEV_MAX_SIZE+2];
|
||||
|
||||
wrByte[0] = (uint8_t) (counter>>0);
|
||||
if(eeprom_info.address_length > 1)
|
||||
{
|
||||
wrByte[1] = (uint8_t) (counter>>8);
|
||||
}
|
||||
|
||||
i2caddr+= (((eeprom_info.size) % address_span_size) * 2);
|
||||
|
||||
rsp = ipmi_master_write_read(
|
||||
intf,
|
||||
i2cbus,
|
||||
i2caddr,
|
||||
(uint8_t *) wrByte,
|
||||
eeprom_info.address_length,
|
||||
msize
|
||||
);
|
||||
|
||||
if (rsp != NULL)
|
||||
{
|
||||
retryCounter = GENDEV_RETRY_COUNT;
|
||||
rc = 0;
|
||||
}
|
||||
else if(retryCounter < GENDEV_RETRY_COUNT)
|
||||
{
|
||||
retryCounter ++;
|
||||
lprintf(LOG_ERR, "Retry");
|
||||
sleep(1);
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if( rc == 0 )
|
||||
{
|
||||
static uint8_t previousCompleted = 101;
|
||||
numWrite = fwrite(rsp->data, 1, msize, fp);
|
||||
if (numWrite != msize)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error writing file %s", ofile);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
percentCompleted = ((counter * 100) / eeprom_info.size );
|
||||
|
||||
if(percentCompleted != previousCompleted)
|
||||
{
|
||||
printf("\r%i percent completed", percentCompleted);
|
||||
previousCompleted = percentCompleted;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\rError: %i percent completed, read not completed \n", percentCompleted);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "The selected generic device is not an eeprom");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_gendev_write_file - Read raw SDR from binary file
|
||||
*
|
||||
* used for writing generic locator device Eeprom type
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @dev: generic device to read
|
||||
* @ofile: output filename
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_gendev_write_file(
|
||||
struct ipmi_intf *intf,
|
||||
struct sdr_record_generic_locator *dev,
|
||||
const char *ofile
|
||||
)
|
||||
{
|
||||
int rc = 0;
|
||||
int eeprom_size;
|
||||
t_gendev_eeprom_info eeprom_info;
|
||||
|
||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
||||
|
||||
if(eeprom_size > 0)
|
||||
{
|
||||
FILE *fp;
|
||||
uint32_t fileLength = 0;
|
||||
|
||||
/* now write to file */
|
||||
fp = ipmi_open_file_read(ofile);
|
||||
|
||||
if(fp)
|
||||
{
|
||||
/* Retreive file length, check if it's fits the Eeprom Size */
|
||||
fseek(fp, 0 ,SEEK_END);
|
||||
fileLength = ftell(fp);
|
||||
|
||||
lprintf(LOG_ERR, "File Size: %i", fileLength);
|
||||
lprintf(LOG_ERR, "Eeprom Size: %i", eeprom_size);
|
||||
if(fileLength != eeprom_size)
|
||||
{
|
||||
lprintf(LOG_ERR, "File size does not fit Eeprom Size");
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
fseek(fp, 0 ,SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
if(fp)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
int numRead;
|
||||
uint32_t counter;
|
||||
uint8_t msize;
|
||||
uint8_t channel = dev->channel_num;
|
||||
uint8_t i2cbus = dev->bus;
|
||||
uint8_t i2caddr = dev->dev_slave_addr;
|
||||
uint8_t privatebus = 1;
|
||||
uint32_t address_span_size;
|
||||
uint8_t percentCompleted = 0;
|
||||
|
||||
|
||||
/* Handle Address Span */
|
||||
if( eeprom_info.address_span != 0)
|
||||
{
|
||||
address_span_size =
|
||||
(eeprom_info.size / (eeprom_info.address_span+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
address_span_size = eeprom_info.size;
|
||||
}
|
||||
|
||||
/* Setup read/write size */
|
||||
if( eeprom_info.page_size < GENDEV_MAX_SIZE)
|
||||
{
|
||||
msize = eeprom_info.page_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
msize = GENDEV_MAX_SIZE;
|
||||
// All eeprom with page higher than 32 is on the
|
||||
// 16 bytes boundary
|
||||
}
|
||||
|
||||
/* Setup i2c bus byte */
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | privatebus;
|
||||
|
||||
/*
|
||||
lprintf(LOG_ERR, "Generic device: %s", dev->id_string);
|
||||
lprintf(LOG_ERR, "I2C Chnl: %x", channel);
|
||||
lprintf(LOG_ERR, "I2C Bus : %x", i2cbus);
|
||||
lprintf(LOG_ERR, "I2C Addr: %x", i2caddr); */
|
||||
|
||||
for (
|
||||
counter = 0;
|
||||
(counter < (eeprom_info.size)) && (rc == 0);
|
||||
counter+= msize
|
||||
)
|
||||
{
|
||||
uint8_t retryCounter;
|
||||
uint8_t readByte[GENDEV_MAX_SIZE];
|
||||
|
||||
numRead = fread(readByte, 1, msize, fp);
|
||||
if (numRead != msize)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error reading file %s", ofile);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(
|
||||
retryCounter = 0;
|
||||
retryCounter<GENDEV_RETRY_COUNT;
|
||||
retryCounter ++
|
||||
)
|
||||
{
|
||||
uint8_t wrByte[GENDEV_MAX_SIZE+2];
|
||||
wrByte[0] = (uint8_t) (counter>>0);
|
||||
if(eeprom_info.address_length > 1)
|
||||
{
|
||||
wrByte[1] = (uint8_t) (counter>>8);
|
||||
}
|
||||
memcpy(&wrByte[eeprom_info.address_length], readByte, msize);
|
||||
|
||||
i2caddr+= (((eeprom_info.size) % address_span_size) * 2);
|
||||
|
||||
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr, (uint8_t *) wrByte, eeprom_info.address_length+msize, 0);
|
||||
if (rsp != NULL)
|
||||
{
|
||||
retryCounter = GENDEV_RETRY_COUNT;
|
||||
rc = 0;
|
||||
}
|
||||
else if(retryCounter < GENDEV_RETRY_COUNT)
|
||||
{
|
||||
retryCounter ++;
|
||||
lprintf(LOG_ERR, "Retry");
|
||||
sleep(1);
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if( rc == 0 )
|
||||
{
|
||||
static uint8_t previousCompleted = 101;
|
||||
percentCompleted = ((counter * 100) / eeprom_info.size );
|
||||
|
||||
if(percentCompleted != previousCompleted)
|
||||
{
|
||||
printf("\r%i percent completed", percentCompleted);
|
||||
previousCompleted = percentCompleted;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\rError: %i percent completed, read not completed \n", percentCompleted);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "The selected generic device is not an eeprom");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_gendev_main - top-level handler for generic device
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @argc: number of arguments
|
||||
* @argv: argument list
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
int
|
||||
ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
/* initialize random numbers used later */
|
||||
srand(time(NULL));
|
||||
|
||||
lprintf(LOG_ERR, "Rx gendev command: %s", argv[0]);
|
||||
|
||||
if (
|
||||
(argc == 0)
|
||||
||
|
||||
(strncmp(argv[0], "help", 4) == 0)
|
||||
)
|
||||
{
|
||||
lprintf(LOG_ERR,
|
||||
"SDR Commands: list read write");
|
||||
lprintf(LOG_ERR,
|
||||
" list List All Generic Device Locators");
|
||||
lprintf(LOG_ERR,
|
||||
" read <sdr name> <file> Read to file eeprom specify by Generic Device Locators");
|
||||
lprintf(LOG_ERR,
|
||||
" write <sdr name> <file> Write from file eeprom specify by Generic Device Locators");
|
||||
}
|
||||
else if ( strncmp(argv[0], "list", 4) == 0)
|
||||
{
|
||||
rc = ipmi_sdr_print_sdr(intf,
|
||||
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
|
||||
}
|
||||
else if (strncmp(argv[0], "read", 4) == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
lprintf(LOG_ERR, "usage: gendev read <gendev> <filename>");
|
||||
else
|
||||
{
|
||||
struct sdr_record_list *sdr;
|
||||
|
||||
lprintf(LOG_ERR, "Gendev read sdr name : %s", argv[1]);
|
||||
|
||||
printf("Locating sensor record '%s'...\n", argv[1]);
|
||||
|
||||
/* lookup by sensor name */
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
|
||||
if (sdr == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Sensor data record not found!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
|
||||
{
|
||||
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
|
||||
return -1;
|
||||
}
|
||||
|
||||
lprintf(LOG_ERR, "Gendev read file name: %s", argv[2]);
|
||||
ipmi_gendev_read_file(intf, sdr->record.genloc, argv[2]);
|
||||
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "write", 5) == 0)
|
||||
{
|
||||
if (argc < 3)
|
||||
lprintf(LOG_ERR, "usage: gendev write <gendev> <filename>");
|
||||
else
|
||||
{
|
||||
struct sdr_record_list *sdr;
|
||||
|
||||
lprintf(LOG_ERR, "Gendev write sdr name : %s", argv[1]);
|
||||
|
||||
printf("Locating sensor record '%s'...\n", argv[1]);
|
||||
|
||||
/* lookup by sensor name */
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
|
||||
if (sdr == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Sensor data record not found!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
|
||||
{
|
||||
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
|
||||
return -1;
|
||||
}
|
||||
|
||||
lprintf(LOG_ERR, "Gendev write file name: %s", argv[2]);
|
||||
ipmi_gendev_write_file(intf, sdr->record.genloc, argv[2]);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid gendev command: %s", argv[0]);
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
3979
ipmitool/lib/ipmi_hpmfwupg.c
Normal file
3979
ipmitool/lib/ipmi_hpmfwupg.c
Normal file
File diff suppressed because it is too large
Load Diff
1044
ipmitool/lib/ipmi_ime.c
Executable file
1044
ipmitool/lib/ipmi_ime.c
Executable file
File diff suppressed because it is too large
Load Diff
828
ipmitool/lib/ipmi_isol.c
Normal file
828
ipmitool/lib/ipmi_isol.c
Normal file
@ -0,0 +1,828 @@
|
||||
/*
|
||||
* 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 <strings.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <termios.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>
|
||||
|
||||
static struct termios _saved_tio;
|
||||
static int _in_raw_mode = 0;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
#define ISOL_ESCAPE_CHARACTER '~'
|
||||
|
||||
/*
|
||||
* ipmi_get_isol_info
|
||||
*/
|
||||
static int ipmi_get_isol_info(struct ipmi_intf * intf,
|
||||
struct isol_config_parameters * params)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = GET_ISOL_CONFIG;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* GET ISOL ENABLED CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error in Get 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 Get ISOL Config Command: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
params->enabled = rsp->data[1];
|
||||
|
||||
/* GET ISOL AUTHENTICATON CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
|
||||
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;
|
||||
}
|
||||
params->privilege_level = rsp->data[1];
|
||||
|
||||
/* GET ISOL BAUD RATE CONFIG */
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00;
|
||||
data[1] = ISOL_BAUD_RATE_PARAM;
|
||||
data[2] = 0x00; /* block */
|
||||
data[3] = 0x00; /* selector */
|
||||
|
||||
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;
|
||||
}
|
||||
params->bit_rate = rsp->data[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipmi_print_isol_info(struct ipmi_intf * intf)
|
||||
{
|
||||
struct isol_config_parameters params = {0};
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
if (csv_output)
|
||||
{
|
||||
printf("%s,", (params.enabled & 0x1)?"true": "false");
|
||||
printf("%s,",
|
||||
val2str((params.privilege_level & 0xf), ipmi_privlvl_vals));
|
||||
printf("%s,",
|
||||
val2str((params.bit_rate & 0xf), ipmi_bit_rate_vals));
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Enabled : %s\n",
|
||||
(params.enabled & 0x1)?"true": "false");
|
||||
printf("Privilege Level : %s\n",
|
||||
val2str((params.privilege_level & 0xf), ipmi_privlvl_vals));
|
||||
printf("Bit Rate (kbps) : %s\n",
|
||||
val2str((params.bit_rate & 0xf), ipmi_bit_rate_vals));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipmi_isol_set_param(struct ipmi_intf * intf,
|
||||
const char *param,
|
||||
const char *value)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
struct isol_config_parameters params = {0};
|
||||
|
||||
/* We need other values to complete the request */
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
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;
|
||||
|
||||
memset(data, 0, 6);
|
||||
|
||||
/*
|
||||
* enabled
|
||||
*/
|
||||
if (strcmp(param, "enabled") == 0)
|
||||
{
|
||||
data[1] = ISOL_ENABLE_PARAM;
|
||||
if (strcmp(value, "true") == 0)
|
||||
data[2] = 0x01;
|
||||
else if (strcmp(value, "false") == 0)
|
||||
data[2] = 0x00;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid value %s for parameter %s",
|
||||
value, param);
|
||||
lprintf(LOG_ERR, "Valid values are true and false");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* privilege-level
|
||||
*/
|
||||
else if (strcmp(param, "privilege-level") == 0)
|
||||
{
|
||||
data[1] = ISOL_AUTHENTICATION_PARAM;
|
||||
if (! strcmp(value, "user"))
|
||||
data[2] = 0x02;
|
||||
else if (! strcmp(value, "operator"))
|
||||
data[2] = 0x03;
|
||||
else if (! strcmp(value, "admin"))
|
||||
data[2] = 0x04;
|
||||
else if (! strcmp(value, "oem"))
|
||||
data[2] = 0x05;
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid value %s for parameter %s",
|
||||
value, param);
|
||||
lprintf(LOG_ERR, "Valid values are user, operator, admin, and oem");
|
||||
return -1;
|
||||
}
|
||||
/* We need to mask bit7 from the fetched value */
|
||||
data[2] |= (params.privilege_level & 0x80) ? 0x80 : 0x00;
|
||||
}
|
||||
|
||||
/*
|
||||
* bit-rate
|
||||
*/
|
||||
else if (strcmp(param, "bit-rate") == 0)
|
||||
{
|
||||
data[1] = ISOL_BAUD_RATE_PARAM;
|
||||
if (strncmp(value, "9.6", 3) == 0) {
|
||||
data[2] = 0x06;
|
||||
}
|
||||
else if (strncmp(value, "19.2", 4) == 0) {
|
||||
data[2] = 0x07;
|
||||
}
|
||||
else if (strncmp(value, "38.4", 4) == 0) {
|
||||
data[2] = 0x08;
|
||||
}
|
||||
else if (strncmp(value, "57.6", 4) == 0) {
|
||||
data[2] = 0x09;
|
||||
}
|
||||
else if (strncmp(value, "115.2", 5) == 0) {
|
||||
data[2] = 0x0A;
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "ISOL - Unsupported baud rate: %s", value);
|
||||
lprintf(LOG_ERR, "Valid values are 9.6, 19.2, 38.4, 57.6 and 115.2");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Error: invalid ISOL parameter %s", param);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute the request
|
||||
*/
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error setting ISOL parameter '%s'", param);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error setting ISOL parameter '%s': %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
leave_raw_mode(void)
|
||||
{
|
||||
if (!_in_raw_mode)
|
||||
return;
|
||||
if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1)
|
||||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
enter_raw_mode(void)
|
||||
{
|
||||
struct termios tio;
|
||||
if (tcgetattr(fileno(stdin), &tio) == -1) {
|
||||
perror("tcgetattr");
|
||||
return;
|
||||
}
|
||||
_saved_tio = tio;
|
||||
tio.c_iflag |= IGNPAR;
|
||||
tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF)\
|
||||
;
|
||||
tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
|
||||
// #ifdef IEXTEN
|
||||
tio.c_lflag &= ~IEXTEN;
|
||||
// #endif
|
||||
tio.c_oflag &= ~OPOST;
|
||||
tio.c_cc[VMIN] = 1;
|
||||
tio.c_cc[VTIME] = 0;
|
||||
if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1)
|
||||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 1;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sendBreak(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_v2_payload v2_payload;
|
||||
|
||||
memset(&v2_payload, 0, sizeof(v2_payload));
|
||||
|
||||
v2_payload.payload.sol_packet.character_count = 0;
|
||||
v2_payload.payload.sol_packet.generate_break = 1;
|
||||
|
||||
intf->send_sol(intf, &v2_payload);
|
||||
}
|
||||
|
||||
/*
|
||||
* suspendSelf
|
||||
*
|
||||
* Put ourself in the background
|
||||
*
|
||||
* param bRestoreTty specifies whether we will put our self back
|
||||
* in raw mode when we resume
|
||||
*/
|
||||
static void
|
||||
suspendSelf(int bRestoreTty)
|
||||
{
|
||||
leave_raw_mode();
|
||||
kill(getpid(), SIGTSTP);
|
||||
|
||||
if (bRestoreTty)
|
||||
enter_raw_mode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* printiSolEscapeSequences
|
||||
*
|
||||
* Send some useful documentation to the user
|
||||
*/
|
||||
static void
|
||||
printiSolEscapeSequences(void)
|
||||
{
|
||||
printf(
|
||||
"%c?\n\
|
||||
Supported escape sequences:\n\
|
||||
%c. - terminate connection\n\
|
||||
%c^Z - suspend ipmitool\n\
|
||||
%c^X - suspend ipmitool, but don't restore tty on restart\n\
|
||||
%cB - send break\n\
|
||||
%c? - this message\n\
|
||||
%c%c - send the escape character by typing it twice\n\
|
||||
(Note that escapes are only recognized immediately after newline.)\n",
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER,
|
||||
ISOL_ESCAPE_CHARACTER);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* output
|
||||
*
|
||||
* Send the specified data to stdout
|
||||
*/
|
||||
static void
|
||||
output(struct ipmi_rs * rsp)
|
||||
{
|
||||
if (rsp)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < rsp->data_len; ++i)
|
||||
putc(rsp->data[i], stdout);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_deactivate
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_deactivate(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t data[6];
|
||||
struct isol_config_parameters params;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = ACTIVATE_ISOL;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 5;
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x00; /* Deactivate */
|
||||
data[1] = 0x00;
|
||||
data[2] = 0x00;
|
||||
data[3] = 0x00;
|
||||
data[5] = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error deactivating ISOL");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Error deactivating ISOL: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
/* response contain 4 additional bytes : 80 00 32 ff
|
||||
Don't know what to use them for yet... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* processiSolUserInput
|
||||
*
|
||||
* Act on user input into the ISOL session. The only reason this
|
||||
* is complicated is that we have to process escape sequences.
|
||||
*
|
||||
* return 0 on success
|
||||
* 1 if we should exit
|
||||
* < 0 on error (BMC probably closed the session)
|
||||
*/
|
||||
static int
|
||||
processiSolUserInput(struct ipmi_intf * intf,
|
||||
uint8_t * input,
|
||||
uint16_t buffer_length)
|
||||
{
|
||||
static int escape_pending = 0;
|
||||
static int last_was_cr = 1;
|
||||
struct ipmi_v2_payload v2_payload;
|
||||
int length = 0;
|
||||
int retval = 0;
|
||||
char ch;
|
||||
int i;
|
||||
|
||||
memset(&v2_payload, 0, sizeof(v2_payload));
|
||||
|
||||
/*
|
||||
* Our first order of business is to check the input for escape
|
||||
* sequences to act on.
|
||||
*/
|
||||
for (i = 0; i < buffer_length; ++i)
|
||||
{
|
||||
ch = input[i];
|
||||
|
||||
if (escape_pending){
|
||||
escape_pending = 0;
|
||||
|
||||
/*
|
||||
* Process a possible escape sequence.
|
||||
*/
|
||||
switch (ch) {
|
||||
case '.':
|
||||
printf("%c. [terminated ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
retval = 1;
|
||||
break;
|
||||
case 'Z' - 64:
|
||||
printf("%c^Z [suspend ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
suspendSelf(1); /* Restore tty back to raw */
|
||||
continue;
|
||||
|
||||
case 'X' - 64:
|
||||
printf("%c^X [suspend ipmitool]\n", ISOL_ESCAPE_CHARACTER);
|
||||
suspendSelf(0); /* Don't restore to raw mode */
|
||||
continue;
|
||||
|
||||
case 'B':
|
||||
printf("%cb [send break]\n", ISOL_ESCAPE_CHARACTER);
|
||||
sendBreak(intf);
|
||||
continue;
|
||||
|
||||
case '?':
|
||||
printiSolEscapeSequences();
|
||||
continue;
|
||||
default:
|
||||
if (ch != ISOL_ESCAPE_CHARACTER)
|
||||
v2_payload.payload.sol_packet.data[length++] =
|
||||
ISOL_ESCAPE_CHARACTER;
|
||||
v2_payload.payload.sol_packet.data[length++] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (last_was_cr && (ch == ISOL_ESCAPE_CHARACTER)) {
|
||||
escape_pending = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
v2_payload.payload.sol_packet.data[length++] = ch;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Normal character. Record whether it was a newline.
|
||||
*/
|
||||
last_was_cr = (ch == '\r' || ch == '\n');
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is anything left to process we dispatch it to the BMC,
|
||||
* send intf->session->sol_data.max_outbound_payload_size bytes
|
||||
* at a time.
|
||||
*/
|
||||
if (length)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
|
||||
v2_payload.payload.sol_packet.flush_outbound = 1; /* Not sure if necessary ? */
|
||||
v2_payload.payload.sol_packet.character_count = length;
|
||||
rsp = intf->send_sol(intf, &v2_payload);
|
||||
|
||||
if (! rsp) {
|
||||
lprintf(LOG_ERR, "Error sending SOL data");
|
||||
retval = -1;
|
||||
}
|
||||
|
||||
/* If the sequence number is set we know we have new data */
|
||||
else if ((rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) &&
|
||||
(rsp->payload.sol_packet.packet_sequence_number))
|
||||
output(rsp);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_red_pill
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_red_pill(struct ipmi_intf * intf)
|
||||
{
|
||||
char * buffer;
|
||||
int numRead;
|
||||
int bShouldExit = 0;
|
||||
int bBmcClosedSession = 0;
|
||||
fd_set read_fds;
|
||||
struct timeval tv;
|
||||
int retval;
|
||||
int buffer_size = 255;
|
||||
int timedout = 0;
|
||||
|
||||
buffer = (char*)malloc(buffer_size);
|
||||
if (buffer == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return -1;
|
||||
}
|
||||
|
||||
enter_raw_mode();
|
||||
|
||||
while (! bShouldExit)
|
||||
{
|
||||
FD_ZERO(&read_fds);
|
||||
FD_SET(0, &read_fds);
|
||||
FD_SET(intf->fd, &read_fds);
|
||||
|
||||
/* Wait up to half a second */
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 500000;
|
||||
|
||||
retval = select(intf->fd + 1, &read_fds, NULL, NULL, &tv);
|
||||
|
||||
if (retval)
|
||||
{
|
||||
if (retval == -1)
|
||||
{
|
||||
/* ERROR */
|
||||
perror("select");
|
||||
return -1;
|
||||
}
|
||||
|
||||
timedout = 0;
|
||||
|
||||
/*
|
||||
* Process input from the user
|
||||
*/
|
||||
if (FD_ISSET(0, &read_fds))
|
||||
{
|
||||
memset(buffer, 0, buffer_size);
|
||||
numRead = read(fileno(stdin),
|
||||
buffer,
|
||||
buffer_size);
|
||||
|
||||
if (numRead > 0)
|
||||
{
|
||||
int rc = processiSolUserInput(intf, buffer, numRead);
|
||||
|
||||
if (rc)
|
||||
{
|
||||
if (rc < 0)
|
||||
bShouldExit = bBmcClosedSession = 1;
|
||||
else
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process input from the BMC
|
||||
*/
|
||||
else if (FD_ISSET(intf->fd, &read_fds))
|
||||
{
|
||||
struct ipmi_rs * rs = intf->recv_sol(intf);
|
||||
if (! rs)
|
||||
{
|
||||
bShouldExit = bBmcClosedSession = 1;
|
||||
}
|
||||
else
|
||||
output(rs);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ERROR in select
|
||||
*/
|
||||
else
|
||||
{
|
||||
lprintf(LOG_ERR, "Error: Select returned with nothing to read");
|
||||
bShouldExit = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((++timedout) == 20) /* Every 10 seconds we send a keepalive */
|
||||
{
|
||||
intf->keepalive(intf);
|
||||
timedout = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leave_raw_mode();
|
||||
|
||||
if (bBmcClosedSession)
|
||||
{
|
||||
lprintf(LOG_ERR, "SOL session closed by BMC");
|
||||
}
|
||||
else
|
||||
ipmi_isol_deactivate(intf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_isol_activate
|
||||
*/
|
||||
static int
|
||||
ipmi_isol_activate(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t data[6];
|
||||
struct isol_config_parameters params;
|
||||
|
||||
if (ipmi_get_isol_info(intf, ¶ms))
|
||||
return -1;
|
||||
|
||||
if (!(params.enabled & 0x1)) {
|
||||
lprintf(LOG_ERR, "ISOL is not enabled!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup a callback so that the lanplus processing knows what
|
||||
* to do with packets that come unexpectedly (while waiting for
|
||||
* an ACK, perhaps.
|
||||
*/
|
||||
intf->session->sol_data.sol_input_handler = output;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_ISOL;
|
||||
req.msg.cmd = ACTIVATE_ISOL;
|
||||
req.msg.data = data;
|
||||
req.msg.data_len = 5;
|
||||
|
||||
memset(data, 0, 6);
|
||||
data[0] = 0x01;
|
||||
data[1] = 0x00;
|
||||
data[2] = 0x00;
|
||||
data[3] = 0x00;
|
||||
data[5] = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (NULL != rsp) {
|
||||
switch (rsp->ccode) {
|
||||
case 0x00:
|
||||
if (rsp->data_len == 4) {
|
||||
break;
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Error: Unexpected data length (%d) received "
|
||||
"in ISOL activation response",
|
||||
rsp->data_len);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 0x80:
|
||||
lprintf(LOG_ERR, "Info: ISOL already active on another session");
|
||||
return -1;
|
||||
case 0x81:
|
||||
lprintf(LOG_ERR, "Info: ISOL disabled");
|
||||
return -1;
|
||||
case 0x82:
|
||||
lprintf(LOG_ERR, "Info: ISOL activation limit reached");
|
||||
return -1;
|
||||
default:
|
||||
lprintf(LOG_ERR, "Error activating ISOL: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Error: No response activating ISOL");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* response contain 4 additional bytes : 80 01 32 ff
|
||||
Don't know what to use them for yet... */
|
||||
|
||||
printf("[SOL Session operational. Use %c? for help]\n",
|
||||
ISOL_ESCAPE_CHARACTER);
|
||||
|
||||
/*
|
||||
* At this point we are good to go with our SOL session. We
|
||||
* need to listen to
|
||||
* 1) STDIN for user input
|
||||
* 2) The FD for incoming SOL packets
|
||||
*/
|
||||
if (ipmi_isol_red_pill(intf)) {
|
||||
lprintf(LOG_ERR, "Error in SOL session");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void print_isol_set_usage(void) {
|
||||
lprintf(LOG_NOTICE, "\nISOL set parameters and values: \n");
|
||||
lprintf(LOG_NOTICE, " enabled true | false");
|
||||
lprintf(LOG_NOTICE, " privilege-level user | operator | admin | oem");
|
||||
lprintf(LOG_NOTICE, " bit-rate "
|
||||
"9.6 | 19.2 | 38.4 | 57.6 | 115.2");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
static void print_isol_usage(void) {
|
||||
lprintf(LOG_NOTICE, "ISOL Commands: info");
|
||||
lprintf(LOG_NOTICE, " set <parameter> <setting>");
|
||||
lprintf(LOG_NOTICE, " activate");
|
||||
}
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
* Help
|
||||
*/
|
||||
if (!argc || !strncmp(argv[0], "help", 4))
|
||||
print_isol_usage();
|
||||
|
||||
/*
|
||||
* Info
|
||||
*/
|
||||
else if (!strncmp(argv[0], "info", 4)) {
|
||||
ret = ipmi_print_isol_info(intf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set a parameter value
|
||||
*/
|
||||
else if (!strncmp(argv[0], "set", 3)) {
|
||||
if (argc < 3) {
|
||||
print_isol_set_usage();
|
||||
return -1;
|
||||
}
|
||||
ret = ipmi_isol_set_param(intf, argv[1], argv[2]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Activate
|
||||
*/
|
||||
else if (!strncmp(argv[0], "activate", 8)) {
|
||||
ret = ipmi_isol_activate(intf);
|
||||
}
|
||||
|
||||
else {
|
||||
print_isol_usage();
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
806
ipmitool/lib/ipmi_kontronoem.c
Normal file
806
ipmitool/lib/ipmi_kontronoem.c
Normal file
@ -0,0 +1,806 @@
|
||||
/*
|
||||
* 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);
|
||||
|
||||
static void ipmi_kontron_nextboot_help(void);
|
||||
static int ipmi_kontron_nextboot_set(struct ipmi_intf * intf,
|
||||
int argc, char **argv);
|
||||
|
||||
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf * intf,
|
||||
unsigned char channel,
|
||||
unsigned char size);
|
||||
|
||||
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 if (!strncmp(argv[0], "nextboot", sizeof("nextboot")-1))
|
||||
{
|
||||
if (argc > 1)
|
||||
{
|
||||
if ((rc = ipmi_kontron_nextboot_set(intf, argc-1, argv+1)) == 0)
|
||||
{
|
||||
printf("Nextboot set successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Nextboot set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ipmi_kontron_nextboot_help();
|
||||
}
|
||||
}
|
||||
|
||||
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 nextboot\n");
|
||||
}
|
||||
|
||||
|
||||
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf * intf, unsigned char size)
|
||||
{
|
||||
uint8_t error_occurs = 0;
|
||||
uint32_t prev_target_addr = intf->target_addr ;
|
||||
|
||||
if ( intf->target_addr > 0 && (intf->target_addr != intf->my_addr) )
|
||||
{
|
||||
intf->target_addr = intf->my_addr;
|
||||
|
||||
printf("Set local big buffer\n");
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, size ) == 0)
|
||||
{
|
||||
printf("Set local big buffer:success\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
error_occurs = 1;
|
||||
}
|
||||
|
||||
if (error_occurs == 0)
|
||||
{
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x00, size ) == 0)
|
||||
{
|
||||
printf("IPMB was set\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Revert back the previous set large buffer */
|
||||
error_occurs = 1;
|
||||
ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore target address */
|
||||
intf->target_addr = prev_target_addr;
|
||||
}
|
||||
|
||||
if (error_occurs == 0)
|
||||
{
|
||||
if(ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, size ) == 0)
|
||||
{
|
||||
//printf("Set remote big buffer\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( intf->target_addr > 0 && (intf->target_addr != intf->my_addr) )
|
||||
{
|
||||
/* Error occurs revert back the previous set large buffer*/
|
||||
intf->target_addr = intf->my_addr;
|
||||
|
||||
//ipmi_kontronoem_send_set_large_buffer( intf, 0x00, 0 );
|
||||
ipmi_kontronoem_send_set_large_buffer( intf, 0x0e, 0 );
|
||||
|
||||
intf->target_addr = prev_target_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return error_occurs;
|
||||
}
|
||||
|
||||
|
||||
int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf * intf, unsigned char channel,unsigned char size)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
int i;
|
||||
|
||||
memset(msg_data, 0, sizeof(msg_data));
|
||||
msg_data[0] = channel/*0x0e*/; // Currently running interface
|
||||
msg_data[1] = size;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E; /* OEM NetFn */
|
||||
req.msg.cmd = 0x82; /* Set Channel Buffer Length - OEM */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
req.msg.lun = 0x00;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Cannot send large buffer command\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf("Invalid length for the selected interface (%s) %d\n",
|
||||
val2str(rsp->ccode, completion_code_vals), rsp->ccode);
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* 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;
|
||||
uint8_t *fru_data;
|
||||
char *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 -1;
|
||||
}
|
||||
|
||||
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);
|
||||
sn = NULL;
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(sn);
|
||||
sn = NULL;
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
printf("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);
|
||||
fru_data = NULL;
|
||||
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);
|
||||
fru_data = NULL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
free(fru_data);
|
||||
fru_data = NULL;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
static char *bootdev[] = {"BIOS", "FDD", "HDD", "CDROM", "network", 0};
|
||||
|
||||
static void
|
||||
ipmi_kontron_nextboot_help(void)
|
||||
{
|
||||
int i;
|
||||
printf("nextboot <device>\n"
|
||||
"Supported devices:\n");
|
||||
for (i = 0; bootdev[i] != 0; i++) {
|
||||
printf("- %s\n", bootdev[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* ipmi_kontron_next_boot_set - Select the next boot order on CP6012
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_nextboot_set(struct ipmi_intf * intf, int argc, char **argv)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[8];
|
||||
int i;
|
||||
|
||||
memset(msg_data, 0, sizeof(msg_data));
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
msg_data[4] = 0x9d;
|
||||
msg_data[5] = 0xFF;
|
||||
msg_data[6] = 0xFF; /* any */
|
||||
|
||||
for (i = 0; bootdev[i] != 0; i++) {
|
||||
if (strcmp(argv[0], bootdev[i]) == 0) {
|
||||
msg_data[5] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Invalid device selected? */
|
||||
if (msg_data[5] == 0xFF) {
|
||||
printf("Unknown boot device: %s\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x02;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 7;
|
||||
|
||||
/* 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("Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
1054
ipmitool/lib/ipmi_main.c
Normal file
1054
ipmitool/lib/ipmi_main.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* 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
|
||||
@ -28,18 +28,16 @@
|
||||
* 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 <time.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
@ -47,6 +45,10 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv,
|
||||
int is_set);
|
||||
static void printf_sysinfo_usage(int full_help);
|
||||
|
||||
/* ipmi_mc_reset - attempt to reset an MC
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
@ -63,25 +65,42 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
if( !intf->opened )
|
||||
intf->open(intf);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
if (cmd == BMC_COLD_RESET)
|
||||
intf->noanswer = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Reset command failed");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Reset command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
|
||||
if (cmd == BMC_COLD_RESET)
|
||||
intf->abort = 1;
|
||||
|
||||
if (cmd == BMC_COLD_RESET && rsp == NULL) {
|
||||
/* This is expected. See 20.2 Cold Reset Command, p.243, IPMIv2.0 rev1.0 */
|
||||
} else if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "MC reset command failed.");
|
||||
return (-1);
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "MC reset command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
printf("Sent %s reset command to MC\n",
|
||||
(cmd == BMC_WARM_RESET) ? "warm" : "cold");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct bmc_enables_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t oem2 : 1;
|
||||
@ -102,7 +121,10 @@ struct bmc_enables_data {
|
||||
uint8_t oem1 : 1;
|
||||
uint8_t oem2 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct bitfield_data {
|
||||
const char * name;
|
||||
@ -150,18 +172,68 @@ struct bitfield_data mc_enables_bf[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
printf_mc_usage()
|
||||
printf_mc_reset_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: mc reset <warm|cold>");
|
||||
} /* printf_mc_reset_usage(void) */
|
||||
|
||||
static void
|
||||
printf_mc_usage(void)
|
||||
{
|
||||
struct bitfield_data * bf;
|
||||
printf("MC Commands:\n");
|
||||
printf(" reset <warm|cold>\n");
|
||||
printf(" info\n");
|
||||
printf(" getenables\n");
|
||||
printf(" setenables <option=on|off> ...\n");
|
||||
|
||||
lprintf(LOG_NOTICE, "MC Commands:");
|
||||
lprintf(LOG_NOTICE, " reset <warm|cold>");
|
||||
lprintf(LOG_NOTICE, " guid");
|
||||
lprintf(LOG_NOTICE, " info");
|
||||
lprintf(LOG_NOTICE, " watchdog <get|reset|off>");
|
||||
lprintf(LOG_NOTICE, " selftest");
|
||||
lprintf(LOG_NOTICE, " getenables");
|
||||
lprintf(LOG_NOTICE, " setenables <option=on|off> ...");
|
||||
for (bf = mc_enables_bf; bf->name != NULL; bf++) {
|
||||
printf(" %-20s %s\n", bf->name, bf->desc);
|
||||
lprintf(LOG_NOTICE, " %-20s %s", bf->name, bf->desc);
|
||||
}
|
||||
printf_sysinfo_usage(0);
|
||||
}
|
||||
|
||||
static void
|
||||
printf_sysinfo_usage(int full_help)
|
||||
{
|
||||
if (full_help != 0)
|
||||
lprintf(LOG_NOTICE, "usage:");
|
||||
|
||||
lprintf(LOG_NOTICE, " getsysinfo <argument>");
|
||||
|
||||
if (full_help != 0) {
|
||||
lprintf(LOG_NOTICE,
|
||||
" Retrieves system info from BMC for given argument");
|
||||
}
|
||||
|
||||
lprintf(LOG_NOTICE, " setsysinfo <argument> <string>");
|
||||
|
||||
if (full_help != 0) {
|
||||
lprintf(LOG_NOTICE,
|
||||
" Stores system info string for given argument to BMC");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " Valid arguments are:");
|
||||
}
|
||||
lprintf(LOG_NOTICE,
|
||||
" primary_os_name Primary operating system name");
|
||||
lprintf(LOG_NOTICE, " os_name Operating system name");
|
||||
lprintf(LOG_NOTICE,
|
||||
" system_name System Name of server(vendor dependent)");
|
||||
lprintf(LOG_NOTICE,
|
||||
" delloem_os_version Running version of operating system");
|
||||
lprintf(LOG_NOTICE, " delloem_url URL of BMC webserver");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
static void
|
||||
print_watchdog_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: watchdog <command>:");
|
||||
lprintf(LOG_NOTICE, " get : Get Current Watchdog settings");
|
||||
lprintf(LOG_NOTICE, " reset : Restart Watchdog timer based on most recent settings");
|
||||
lprintf(LOG_NOTICE, " off : Shut off a running Watchdog timer");
|
||||
}
|
||||
|
||||
/* ipmi_mc_get_enables - print out MC enables
|
||||
@ -219,9 +291,11 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
uint8_t en;
|
||||
int i;
|
||||
|
||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
if (argc < 1) {
|
||||
printf_mc_usage();
|
||||
return (-1);
|
||||
}
|
||||
else if (strncmp(argv[0], "help", 4) == 0) {
|
||||
printf_mc_usage();
|
||||
return 0;
|
||||
}
|
||||
@ -249,12 +323,12 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (strncmp(argv[i], bf->name, nl) != 0)
|
||||
continue;
|
||||
if (strncmp(argv[i]+nl+1, "off", 3) == 0) {
|
||||
printf("Disabling %s\n", bf->desc);
|
||||
en &= ~bf->mask;
|
||||
printf("Disabling %s\n", bf->desc);
|
||||
en &= ~bf->mask;
|
||||
}
|
||||
else if (strncmp(argv[i]+nl+1, "on", 2) == 0) {
|
||||
printf("Enabling %s\n", bf->desc);
|
||||
en |= bf->mask;
|
||||
printf("Enabling %s\n", bf->desc);
|
||||
en |= bf->mask;
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Unrecognized option: %s", argv[i]);
|
||||
@ -279,7 +353,7 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Global Enables command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -291,14 +365,14 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
/* IPM Device, Get Device ID Command - Additional Device Support */
|
||||
const char *ipm_dev_adtl_dev_support[8] = {
|
||||
"Sensor Device", /* bit 0 */
|
||||
"SDR Repository Device", /* bit 1 */
|
||||
"SEL Device", /* bit 2 */
|
||||
"FRU Inventory Device", /* ... */
|
||||
"IPMB Event Receiver",
|
||||
"IPMB Event Generator",
|
||||
"Bridge",
|
||||
"Chassis Device" /* bit 7 */
|
||||
"Sensor Device", /* bit 0 */
|
||||
"SDR Repository Device", /* bit 1 */
|
||||
"SEL Device", /* bit 2 */
|
||||
"FRU Inventory Device", /* ... */
|
||||
"IPMB Event Receiver",
|
||||
"IPMB Event Generator",
|
||||
"Bridge",
|
||||
"Chassis Device" /* bit 7 */
|
||||
};
|
||||
|
||||
/* ipmi_mc_get_deviceid - print information about this MC
|
||||
@ -315,6 +389,7 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct ipm_devid_rsp *devid;
|
||||
int i;
|
||||
const char *product=NULL;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
@ -333,11 +408,11 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
devid = (struct ipm_devid_rsp *) rsp->data;
|
||||
printf("Device ID : %i\n",
|
||||
printf("Device ID : %i\n",
|
||||
devid->device_id);
|
||||
printf("Device Revision : %i\n",
|
||||
devid->device_revision & IPM_DEV_DEVICE_ID_REV_MASK);
|
||||
printf("Firmware Revision : %u.%x\n",
|
||||
printf("Firmware Revision : %u.%02x\n",
|
||||
devid->fw_rev1 & IPM_DEV_FWREV1_MAJOR_MASK,
|
||||
devid->fw_rev2);
|
||||
printf("IPMI Version : %x.%x\n",
|
||||
@ -345,11 +420,24 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
IPM_DEV_IPMI_VERSION_MINOR(devid->ipmi_version));
|
||||
printf("Manufacturer ID : %lu\n",
|
||||
(long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
|
||||
printf("Manufacturer Name : %s\n",
|
||||
val2str( (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
|
||||
ipmi_oem_info) );
|
||||
|
||||
printf("Product ID : %u (0x%02x%02x)\n",
|
||||
buf2short((uint8_t *)(devid->product_id)),
|
||||
devid->product_id[1], devid->product_id[0]);
|
||||
|
||||
product=oemval2str(IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
|
||||
(devid->product_id[1]<<8)+devid->product_id[0],
|
||||
ipmi_oem_product_info);
|
||||
|
||||
if (product!=NULL) {
|
||||
printf("Product Name : %s\n", product);
|
||||
}
|
||||
|
||||
printf("Device Available : %s\n",
|
||||
(devid->fw_rev1 & IPM_DEV_FWREV1_AVAIL_MASK) ?
|
||||
(devid->fw_rev1 & IPM_DEV_FWREV1_AVAIL_MASK) ?
|
||||
"no" : "yes");
|
||||
printf("Provides Device SDRs : %s\n",
|
||||
(devid->device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) ?
|
||||
@ -360,13 +448,343 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
|
||||
printf(" %s\n", ipm_dev_adtl_dev_support[i]);
|
||||
}
|
||||
}
|
||||
printf("Aux Firmware Rev Info : \n");
|
||||
/* These values could be looked-up by vendor if documented,
|
||||
* so we put them on individual lines for better treatment later
|
||||
if (rsp->data_len == sizeof(*devid)) {
|
||||
printf("Aux Firmware Rev Info : \n");
|
||||
/* These values could be looked-up by vendor if documented,
|
||||
* so we put them on individual lines for better treatment later
|
||||
*/
|
||||
printf(" 0x%02x\n 0x%02x\n 0x%02x\n 0x%02x\n",
|
||||
devid->aux_fw_rev[0],
|
||||
devid->aux_fw_rev[1],
|
||||
devid->aux_fw_rev[2],
|
||||
devid->aux_fw_rev[3]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Structure follow the IPMI V.2 Rev 1.0
|
||||
* See Table 20-10 */
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
||||
struct ipmi_guid {
|
||||
uint32_t time_low; /* timestamp low field */
|
||||
uint16_t time_mid; /* timestamp middle field */
|
||||
uint16_t time_hi_and_version; /* timestamp high field and version number */
|
||||
uint8_t clock_seq_hi_variant;/* clock sequence high field and variant */
|
||||
uint8_t clock_seq_low; /* clock sequence low field */
|
||||
uint8_t node[6]; /* node */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* ipmi_mc_get_guid - print this MC GUID
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_mc_get_guid(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_guid guid;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_GET_GUID;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get GUID command failed");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Get GUID command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->data_len == sizeof(struct ipmi_guid)) {
|
||||
char tbuf[40];
|
||||
time_t s;
|
||||
memset(tbuf, 0, 40);
|
||||
memset(&guid, 0, sizeof(struct ipmi_guid));
|
||||
memcpy(&guid, rsp->data, rsp->data_len);
|
||||
|
||||
/* Kipp - changed order of last field (node) to follow specification */
|
||||
printf("System GUID : %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n",
|
||||
guid.time_low, guid.time_mid, guid.time_hi_and_version,
|
||||
guid.clock_seq_hi_variant << 8 | guid.clock_seq_low,
|
||||
guid.node[0], guid.node[1], guid.node[2],
|
||||
guid.node[3], guid.node[4], guid.node[5]);
|
||||
|
||||
s = (time_t)guid.time_low; /* Kipp - removed the BSWAP_32, it was not needed here */
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
|
||||
printf("Timestamp : %s\n", tbuf);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid GUID length %d", rsp->data_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_mc_get_selftest - returns and print selftest results
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*/
|
||||
static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
|
||||
{
|
||||
int rv = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct ipm_selftest_rsp *sft_res;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_GET_SELF_TEST;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp) {
|
||||
lprintf(LOG_ERR, "No response from devices\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Bad response: (%s)",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
sft_res = (struct ipm_selftest_rsp *) rsp->data;
|
||||
|
||||
if (sft_res->code == IPM_SFT_CODE_OK) {
|
||||
printf("Selftest: passed\n");
|
||||
rv = 0;
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_NOT_IMPLEMENTED) {
|
||||
printf("Selftest: not implemented\n");
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_DEV_CORRUPTED) {
|
||||
printf("Selftest: device corrupted\n");
|
||||
rv = -1;
|
||||
|
||||
if (sft_res->test & IPM_SELFTEST_SEL_ERROR) {
|
||||
printf(" -> SEL device not accessible\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_SDR_ERROR) {
|
||||
printf(" -> SDR repository not accesible\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_FRU_ERROR) {
|
||||
printf("FRU device not accessible\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_IPMB_ERROR) {
|
||||
printf("IPMB signal lines do not respond\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_SDRR_EMPTY) {
|
||||
printf("SDR repository empty\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_INTERNAL_USE) {
|
||||
printf("Internal Use Area corrupted\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_FW_BOOTBLOCK) {
|
||||
printf("Controller update boot block corrupted\n");
|
||||
}
|
||||
if (sft_res->test & IPM_SELFTEST_FW_CORRUPTED) {
|
||||
printf("controller operational firmware corrupted\n");
|
||||
}
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_FATAL_ERROR) {
|
||||
printf("Selftest : fatal error\n");
|
||||
printf("Failure code : %02x\n", sft_res->test);
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
else if (sft_res->code == IPM_SFT_CODE_RESERVED) {
|
||||
printf("Selftest: N/A");
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
else {
|
||||
printf("Selftest : device specific (%02Xh)\n", sft_res->code);
|
||||
printf("Failure code : %02Xh\n", sft_res->test);
|
||||
rv = 0;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* ipmi_mc_get_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
|
||||
const char *wdt_use_string[8] = {
|
||||
"Reserved",
|
||||
"BIOS FRB2",
|
||||
"BIOS/POST",
|
||||
"OS Load",
|
||||
"SMS/OS",
|
||||
"OEM",
|
||||
"Reserved",
|
||||
"Reserved"
|
||||
};
|
||||
|
||||
const char *wdt_action_string[8] = {
|
||||
"No action",
|
||||
"Hard Reset",
|
||||
"Power Down",
|
||||
"Power Cycle",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved"
|
||||
};
|
||||
|
||||
static int
|
||||
ipmi_mc_get_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct ipm_get_watchdog_rsp * wdt_res;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_GET_WATCHDOG_TIMER;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Get Watchdog Timer command failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Get Watchdog Timer command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
wdt_res = (struct ipm_get_watchdog_rsp *) rsp->data;
|
||||
|
||||
printf("Watchdog Timer Use: %s (0x%02x)\n",
|
||||
wdt_use_string[(wdt_res->timer_use & 0x07 )], wdt_res->timer_use);
|
||||
printf("Watchdog Timer Is: %s\n",
|
||||
wdt_res->timer_use & 0x40 ? "Started/Running" : "Stopped");
|
||||
printf("Watchdog Timer Actions: %s (0x%02x)\n",
|
||||
wdt_action_string[(wdt_res->timer_actions&0x07)], wdt_res->timer_actions);
|
||||
printf("Pre-timeout interval: %d seconds\n", wdt_res->pre_timeout);
|
||||
printf("Timer Expiration Flags: 0x%02x\n", wdt_res->timer_use_exp);
|
||||
printf("Initial Countdown: %i sec\n",
|
||||
((wdt_res->initial_countdown_msb << 8) | wdt_res->initial_countdown_lsb)/10);
|
||||
printf("Present Countdown: %i sec\n",
|
||||
(((wdt_res->present_countdown_msb << 8) | wdt_res->present_countdown_lsb)) / 10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_mc_shutoff_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_mc_shutoff_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char msg_data[6];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_SET_WATCHDOG_TIMER;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 6;
|
||||
|
||||
/*
|
||||
* The only set cmd we're allowing is to shut off the timer.
|
||||
* Turning on the timer should be the job of the ipmi watchdog driver.
|
||||
* See 'modinfo ipmi_watchdog' for more info. (NOTE: the reset
|
||||
* command will restart the timer if it's already been initialized.)
|
||||
*
|
||||
* Out-of-band watchdog set commands can still be sent via the raw
|
||||
* command interface but this is a very dangerous thing to do since
|
||||
* a periodic "poke"/reset over a network is unreliable. This is
|
||||
* not a recommended way to use the IPMI watchdog commands.
|
||||
*/
|
||||
printf(" 0x%02x\n 0x%02x\n 0x%02x\n 0x%02x\n",
|
||||
devid->aux_fw_rev[0], devid->aux_fw_rev[1],
|
||||
devid->aux_fw_rev[2], devid->aux_fw_rev[3]);
|
||||
|
||||
msg_data[0] = IPM_WATCHDOG_SMS_OS;
|
||||
msg_data[1] = IPM_WATCHDOG_NO_ACTION;
|
||||
msg_data[2] = 0x00; /* pretimeout interval */
|
||||
msg_data[3] = IPM_WATCHDOG_CLEAR_SMS_OS;
|
||||
msg_data[4] = 0xb8; /* countdown lsb (100 ms/count) */
|
||||
msg_data[5] = 0x0b; /* countdown msb - 5 mins */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed! %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Watchdog Timer Shutoff successful -- timer stopped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_mc_rst_watchdog
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
*
|
||||
* returns 0 on success
|
||||
* returns -1 on error
|
||||
*/
|
||||
static int
|
||||
ipmi_mc_rst_watchdog(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = BMC_RESET_WATCHDOG_TIMER;
|
||||
req.msg.data_len = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Reset Watchdog Timer command failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Reset Watchdog Timer command failed: %s",
|
||||
(rsp->ccode == IPM_WATCHDOG_RESET_ERROR) ?
|
||||
"Attempt to reset unitialized watchdog" :
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("IPMI Watchdog Timer Reset - countdown restarted!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -384,12 +802,24 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
if (argc < 1) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_mc_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[0], "help", 4) == 0) {
|
||||
printf_mc_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[0], "reset", 5) == 0) {
|
||||
if (argc < 2 || strncmp(argv[1], "help", 4) == 0) {
|
||||
lprintf(LOG_ERR, "reset commands: warm, cold");
|
||||
if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_mc_reset_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[1], "help", 4) == 0) {
|
||||
printf_mc_reset_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[1], "cold", 4) == 0) {
|
||||
rc = ipmi_mc_reset(intf, BMC_COLD_RESET);
|
||||
@ -398,18 +828,285 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
rc = ipmi_mc_reset(intf, BMC_WARM_RESET);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "reset commands: warm, cold");
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
printf_mc_reset_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "info", 4) == 0) {
|
||||
rc = ipmi_mc_get_deviceid(intf);
|
||||
}
|
||||
else if (strncmp(argv[0], "guid", 4) == 0) {
|
||||
rc = ipmi_mc_get_guid(intf);
|
||||
}
|
||||
else if (strncmp(argv[0], "getenables", 10) == 0) {
|
||||
rc = ipmi_mc_get_enables(intf);
|
||||
}
|
||||
else if (strncmp(argv[0], "setenables", 10) == 0) {
|
||||
rc = ipmi_mc_set_enables(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
|
||||
else if (!strncmp(argv[0], "selftest", 8)) {
|
||||
rc = ipmi_mc_get_selftest(intf);
|
||||
}
|
||||
else if (!strncmp(argv[0], "watchdog", 8)) {
|
||||
if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
print_watchdog_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
else if (strncmp(argv[1], "help", 4) == 0) {
|
||||
print_watchdog_usage();
|
||||
rc = 0;
|
||||
}
|
||||
else if (strncmp(argv[1], "get", 3) == 0) {
|
||||
rc = ipmi_mc_get_watchdog(intf);
|
||||
}
|
||||
else if(strncmp(argv[1], "off", 3) == 0) {
|
||||
rc = ipmi_mc_shutoff_watchdog(intf);
|
||||
}
|
||||
else if(strncmp(argv[1], "reset", 5) == 0) {
|
||||
rc = ipmi_mc_rst_watchdog(intf);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
print_watchdog_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[0], "getsysinfo", 10) == 0) {
|
||||
rc = ipmi_sysinfo_main(intf, argc, argv, 0);
|
||||
}
|
||||
else if (strncmp(argv[0], "setsysinfo", 10) == 0) {
|
||||
rc = ipmi_sysinfo_main(intf, argc, argv, 1);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc command: %s", argv[0]);
|
||||
printf_mc_usage();
|
||||
rc = (-1);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* sysinfo_param() - function converts sysinfo param to int
|
||||
*
|
||||
* @str - user input string
|
||||
* @maxset - ?
|
||||
*
|
||||
* returns (-1) on error
|
||||
* returns > 0 on success
|
||||
*/
|
||||
static int
|
||||
sysinfo_param(const char *str, int *maxset)
|
||||
{
|
||||
if (!str || !maxset)
|
||||
return (-1);
|
||||
|
||||
*maxset = 4;
|
||||
if (!strcmp(str, "system_name"))
|
||||
return IPMI_SYSINFO_HOSTNAME;
|
||||
else if (!strcmp(str, "primary_os_name"))
|
||||
return IPMI_SYSINFO_PRIMARY_OS_NAME;
|
||||
else if (!strcmp(str, "os_name"))
|
||||
return IPMI_SYSINFO_OS_NAME;
|
||||
else if (!strcmp(str, "delloem_os_version"))
|
||||
return IPMI_SYSINFO_DELL_OS_VERSION;
|
||||
else if (!strcmp(str, "delloem_url")) {
|
||||
*maxset = 2;
|
||||
return IPMI_SYSINFO_DELL_URL;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_mc_getsysinfo() - function processes the IPMI Get System Info command
|
||||
*
|
||||
* @intf - ipmi interface
|
||||
* @param - parameter eg. 0xC0..0xFF = OEM
|
||||
* @block - number of block parameters
|
||||
* @set - number of set parameters
|
||||
* @len - length of buffer
|
||||
* @buffer - pointer to buffer
|
||||
*
|
||||
* returns (-1) on failure
|
||||
* returns 0 on success
|
||||
* returns > 0 IPMI code
|
||||
*/
|
||||
int
|
||||
ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
|
||||
int len, void *buffer)
|
||||
{
|
||||
uint8_t data[4];
|
||||
struct ipmi_rs *rsp = NULL;
|
||||
struct ipmi_rq req = {0};
|
||||
|
||||
memset(buffer, 0, len);
|
||||
memset(data, 0, 4);
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.lun = 0;
|
||||
req.msg.cmd = IPMI_GET_SYS_INFO;
|
||||
req.msg.data_len = 4;
|
||||
req.msg.data = data;
|
||||
|
||||
if (verbose > 1)
|
||||
printf("getsysinfo: %.2x/%.2x/%.2x\n", param, block, set);
|
||||
|
||||
data[0] = 0; /* get/set */
|
||||
data[1] = param;
|
||||
data[2] = block;
|
||||
data[3] = set;
|
||||
|
||||
/*
|
||||
* Format of get output is:
|
||||
* u8 param_rev
|
||||
* u8 selector
|
||||
* u8 encoding bit[0-3];
|
||||
* u8 length
|
||||
* u8 data0[14]
|
||||
*/
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
return (-1);
|
||||
|
||||
if (rsp->ccode == 0) {
|
||||
if (len > rsp->data_len)
|
||||
len = rsp->data_len;
|
||||
if (len && buffer)
|
||||
memcpy(buffer, rsp->data, len);
|
||||
}
|
||||
return rsp->ccode;
|
||||
}
|
||||
|
||||
/*
|
||||
* ipmi_mc_setsysinfo() - function processes the IPMI Set System Info command
|
||||
*
|
||||
* @intf - ipmi interface
|
||||
* @len - length of buffer
|
||||
* @buffer - pointer to buffer
|
||||
*
|
||||
* returns (-1) on failure
|
||||
* returns 0 on success
|
||||
* returns > 0 IPMI code
|
||||
*/
|
||||
int
|
||||
ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer)
|
||||
{
|
||||
struct ipmi_rs *rsp = NULL;
|
||||
struct ipmi_rq req = {0};
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.lun = 0;
|
||||
req.msg.cmd = IPMI_SET_SYS_INFO;
|
||||
req.msg.data_len = len;
|
||||
req.msg.data = buffer;
|
||||
|
||||
/*
|
||||
* Format of set input:
|
||||
* u8 param rev
|
||||
* u8 selector
|
||||
* u8 data1[16]
|
||||
*/
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp != NULL) {
|
||||
return rsp->ccode;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv, int is_set)
|
||||
{
|
||||
char *str;
|
||||
unsigned char infostr[256];
|
||||
unsigned char paramdata[18];
|
||||
int len, maxset, param, pos, rc, set;
|
||||
|
||||
if (argc == 2 && strcmp(argv[1], "help") == 0) {
|
||||
printf_sysinfo_usage(1);
|
||||
return 0;
|
||||
}
|
||||
else if (argc < 2 || (is_set == 1 && argc < 3)) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
printf_sysinfo_usage(1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Get Parameters */
|
||||
if ((param = sysinfo_param(argv[1], &maxset)) < 0) {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc %s command: %s", argv[0], argv[1]);
|
||||
printf_sysinfo_usage(1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
if (is_set != 0) {
|
||||
str = argv[2];
|
||||
set = pos = 0;
|
||||
len = strlen(str);
|
||||
|
||||
/* first block holds 14 bytes, all others hold 16 */
|
||||
if ((len + 2 + 15) / 16 >= maxset)
|
||||
len = (maxset * 16) - 2;
|
||||
|
||||
do {
|
||||
memset(paramdata, 0, sizeof(paramdata));
|
||||
paramdata[0] = param;
|
||||
paramdata[1] = set;
|
||||
if (set == 0) {
|
||||
/* First block is special case */
|
||||
paramdata[2] = 0; /* ascii encoding */
|
||||
paramdata[3] = len; /* length */
|
||||
strncpy(paramdata + 4, str + pos, IPMI_SYSINFO_SET0_SIZE);
|
||||
pos += IPMI_SYSINFO_SET0_SIZE;
|
||||
}
|
||||
else {
|
||||
strncpy(paramdata + 2, str + pos, IPMI_SYSINFO_SETN_SIZE);
|
||||
pos += IPMI_SYSINFO_SETN_SIZE;
|
||||
}
|
||||
rc = ipmi_mc_setsysinfo(intf, 18, paramdata);
|
||||
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
set++;
|
||||
} while (pos < len);
|
||||
}
|
||||
else {
|
||||
memset(infostr, 0, sizeof(infostr));
|
||||
/* Read blocks of data */
|
||||
pos = 0;
|
||||
for (set = 0; set < maxset; set++) {
|
||||
rc = ipmi_mc_getsysinfo(intf, param, set, 0, 18, paramdata);
|
||||
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
if (set == 0) {
|
||||
/* First block is special case */
|
||||
if ((paramdata[2] & 0xF) == 0) {
|
||||
/* Determine max number of blocks to read */
|
||||
maxset = ((paramdata[3] + 2) + 15) / 16;
|
||||
}
|
||||
memcpy(infostr + pos, paramdata + 4, IPMI_SYSINFO_SET0_SIZE);
|
||||
pos += IPMI_SYSINFO_SET0_SIZE;
|
||||
}
|
||||
else {
|
||||
memcpy(infostr + pos, paramdata + 2, IPMI_SYSINFO_SETN_SIZE);
|
||||
pos += IPMI_SYSINFO_SETN_SIZE;
|
||||
}
|
||||
}
|
||||
printf("%s\n", infostr);
|
||||
}
|
||||
if (rc < 0) {
|
||||
lprintf(LOG_ERR, "%s %s set %d command failed", argv[0], argv[1], set);
|
||||
}
|
||||
else if (rc == 0x80) {
|
||||
lprintf(LOG_ERR, "%s %s parameter not supported", argv[0], argv[1]);
|
||||
}
|
||||
else if (rc > 0) {
|
||||
lprintf(LOG_ERR, "%s command failed: %s", argv[0],
|
||||
val2str(rc, completion_code_vals));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -26,10 +26,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 <string.h>
|
||||
@ -39,20 +35,39 @@
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
|
||||
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
|
||||
static int ipmi_oem_ibm(struct ipmi_intf * intf);
|
||||
|
||||
static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||
{
|
||||
name: "supermicro",
|
||||
desc: "Supermicro BMC with OEM LAN authentication support",
|
||||
desc: "Supermicro IPMIv1.5 BMC with OEM LAN authentication support",
|
||||
setup: ipmi_oem_supermicro,
|
||||
},
|
||||
{
|
||||
name: "intelwv2",
|
||||
desc: "Intel SE7501WV2 BMC with extra LAN communication support",
|
||||
desc: "Intel SE7501WV2 IPMIv1.5 BMC with extra LAN communication support",
|
||||
},
|
||||
{ 0 },
|
||||
{
|
||||
name: "intelplus",
|
||||
desc: "Intel IPMI 2.0 BMC with RMCP+ communication support",
|
||||
},
|
||||
{
|
||||
name: "icts",
|
||||
desc: "IPMI 2.0 ICTS compliance support",
|
||||
},
|
||||
{
|
||||
name: "ibm",
|
||||
desc: "IBM OEM support",
|
||||
setup: ipmi_oem_ibm,
|
||||
},
|
||||
{
|
||||
name: "i82571spt",
|
||||
desc: "Intel 82571 MAC with integrated RMCP+ support in super pass-through mode",
|
||||
},
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
/* Supermicro IPMIv2 BMCs use OEM authtype */
|
||||
@ -63,6 +78,17 @@ ipmi_oem_supermicro(struct ipmi_intf * intf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_oem_ibm(struct ipmi_intf * intf)
|
||||
{
|
||||
char * filename;
|
||||
if ((filename = getenv("IPMI_OEM_IBM_DATAFILE")) == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
|
||||
return -1;
|
||||
}
|
||||
return ipmi_sel_oem_init((const char *)filename);
|
||||
}
|
||||
|
||||
/* ipmi_oem_print - print list of OEM handles
|
||||
*/
|
||||
void
|
||||
@ -70,9 +96,7 @@ ipmi_oem_print(void)
|
||||
{
|
||||
struct ipmi_oem_handle * oem;
|
||||
lprintf(LOG_NOTICE, "\nOEM Support:");
|
||||
for (oem=ipmi_oem_list; oem->setup != NULL; oem++) {
|
||||
if (oem->name == NULL || oem->desc == NULL)
|
||||
continue;
|
||||
for (oem=ipmi_oem_list; oem->name != NULL && oem->desc != NULL; oem++) {
|
||||
lprintf(LOG_NOTICE, "\t%-12s %s", oem->name, oem->desc);
|
||||
}
|
||||
lprintf(LOG_NOTICE, "");
|
||||
@ -92,25 +116,20 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
|
||||
struct ipmi_oem_handle * oem;
|
||||
int rc = 0;
|
||||
|
||||
if (strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0 ||
|
||||
oemtype == NULL) {
|
||||
if (oemtype == NULL ||
|
||||
strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0) {
|
||||
ipmi_oem_print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (oem=ipmi_oem_list; oem->setup != NULL; oem++) {
|
||||
if (oem->name == NULL)
|
||||
continue;
|
||||
for (oem=ipmi_oem_list; oem->name != NULL; oem++) {
|
||||
if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (oem->name == NULL) {
|
||||
/* nothing was found */
|
||||
lprintf(LOG_ERR, "OEM support not found for \"%s\"", oemtype);
|
||||
if (oem->name == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* save pointer for later use */
|
||||
intf->oem = oem;
|
||||
@ -143,4 +162,3 @@ ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -28,16 +28,13 @@
|
||||
* 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.
|
||||
*
|
||||
* 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 <time.h>
|
||||
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -76,12 +73,6 @@ static const char * pef_flag_fmts[][3] = {
|
||||
{"active", "in", ""},
|
||||
{"abled", "dis", "en"},
|
||||
};
|
||||
typedef enum {
|
||||
P_TRUE,
|
||||
P_SUPP,
|
||||
P_ACTV,
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
static const char * listitem[] = {" | %s", ",%s", "%s"};
|
||||
|
||||
const char *
|
||||
@ -199,15 +190,17 @@ ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt)
|
||||
// common IPMItool rqst/resp handling
|
||||
*/
|
||||
struct ipmi_rs * rsp = intf->sendrecv(intf, req);
|
||||
if (!rsp)
|
||||
if (!rsp) {
|
||||
return(NULL);
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, " **Error %x in '%s' command",
|
||||
rsp ? rsp->ccode : 0, txt);
|
||||
} else if (rsp->ccode == 0x80) {
|
||||
return(NULL); /* Do not output error, just unsupported parameters */
|
||||
} else if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, " **Error %x in '%s' command", rsp->ccode, txt);
|
||||
return(NULL);
|
||||
}
|
||||
if (verbose > 2)
|
||||
if (verbose > 2) {
|
||||
printbuf(rsp->data, rsp->data_len, txt);
|
||||
}
|
||||
return(rsp);
|
||||
}
|
||||
|
||||
@ -291,8 +284,8 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
||||
return;
|
||||
}
|
||||
tbl_size = (rsp->data[1] & PEF_LAN_DEST_TABLE_SIZE_MASK);
|
||||
if (!dest || tbl_size == 0) /* LAN alerting not supported */
|
||||
return;
|
||||
//if (tbl_size == 0 || dest == 0) /* LAN alerting not supported */
|
||||
// return;
|
||||
|
||||
lsel.id = PEF_LAN_CFGPARM_ID_DESTTYPE;
|
||||
lsel.set = dest;
|
||||
@ -317,7 +310,7 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
||||
"PET community");
|
||||
else {
|
||||
rsp->data[19] = '\0';
|
||||
ipmi_pef_print_str("PET Community", &rsp->data[1]);
|
||||
ipmi_pef_print_str("PET Community", (const char *)&rsp->data[1]);
|
||||
}
|
||||
}
|
||||
ipmi_pef_print_dec("ACK timeout/retry (secs)", timeout);
|
||||
@ -570,7 +563,11 @@ ipmi_pef_print_event_info(struct pef_cfgparm_filter_table_entry * pef, char * bu
|
||||
p = strchr(buf, '\0');
|
||||
for (i=0; i<PEF_B2S_GENERIC_ER_ENTRIES; i++) {
|
||||
if (offmask & 1) {
|
||||
sprintf(p, ",%s", ipmi_pef_bit_desc(pef_b2s_generic_ER[t-1], i));
|
||||
if ((t-1) >= PEF_B2S_GENERIC_ER_ENTRIES) {
|
||||
sprintf(p, ", Unrecognized event trigger");
|
||||
} else {
|
||||
sprintf(p, ",%s", ipmi_pef_bit_desc(pef_b2s_generic_ER[t-1], i));
|
||||
}
|
||||
p = strchr(p, '\0');
|
||||
}
|
||||
offmask >>= 1;
|
||||
@ -670,13 +667,19 @@ ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl, * ptmp;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl = NULL;
|
||||
struct pef_cfgparm_policy_table_entry * ptmp = NULL;
|
||||
uint32_t i;
|
||||
uint8_t wrk, ch, medium, tbl_size;
|
||||
|
||||
tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
|
||||
if (!tbl_size)
|
||||
if (!tbl_size) {
|
||||
if (!ptbl) {
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_CMD_GET_CHANNEL_INFO;
|
||||
@ -696,7 +699,7 @@ ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
|
||||
if (ptmp->entry.alert_string_key & PEF_POLICY_EVENT_SPECIFIC) {
|
||||
ipmi_pef_print_str("Event-specific", "true");
|
||||
continue;
|
||||
// continue;
|
||||
}
|
||||
wrk = ptmp->entry.chan_dest;
|
||||
|
||||
@ -729,6 +732,7 @@ ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
}
|
||||
}
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -740,6 +744,7 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
char tbuf[40];
|
||||
uint32_t timei;
|
||||
time_t ts;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -751,12 +756,13 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
"Last S/W processed ID");
|
||||
return;
|
||||
}
|
||||
memcpy(&timei, rsp->data, sizeof(timei));
|
||||
#if WORDS_BIGENDIAN
|
||||
ts = (time_t)(rsp->data[0]<<24 + rsp->data[1]<<16 + rsp->data[2]<<8 + rsp->data[3]);
|
||||
#else
|
||||
ts = (time_t)(*(long *)rsp->data);
|
||||
timei = BSWAP_32(timei);
|
||||
#endif
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&ts));
|
||||
ts = (time_t)timei;
|
||||
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", gmtime(&ts));
|
||||
|
||||
ipmi_pef_print_str("Last SEL addition", tbuf);
|
||||
ipmi_pef_print_2xd("Last SEL record ID", rsp->data[5], rsp->data[4]);
|
||||
@ -777,6 +783,15 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
return;
|
||||
}
|
||||
ipmi_pef_print_flags(&pef_b2s_control, P_ABLE, rsp->data[1]);
|
||||
|
||||
psel.id = PEF_CFGPARM_ID_PEF_ACTION;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PEF action");
|
||||
if (!rsp) {
|
||||
lprintf(LOG_ERR, " **Error retrieving %s",
|
||||
"PEF action");
|
||||
return;
|
||||
}
|
||||
ipmi_pef_print_flags(&pef_b2s_actions, P_ACTV, rsp->data[1]);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -788,12 +803,15 @@ ipmi_pef_get_info(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct pef_capabilities * pcap;
|
||||
struct pef_cfgparm_selector psel;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl = NULL;
|
||||
uint8_t * uid;
|
||||
uint8_t actions, tbl_size;
|
||||
|
||||
if ((tbl_size = ipmi_pef_get_policy_table(intf, &ptbl)) > 0)
|
||||
tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
|
||||
if (!ptbl) {
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
@ -802,6 +820,7 @@ ipmi_pef_get_info(struct ipmi_intf * intf)
|
||||
if (!rsp)
|
||||
return;
|
||||
pcap = (struct pef_capabilities *)rsp->data;
|
||||
|
||||
ipmi_pef_print_1xd("Version", pcap->version);
|
||||
ipmi_pef_print_dec("PEF table size", pcap->tblsize);
|
||||
ipmi_pef_print_dec("Alert policy table size", tbl_size);
|
||||
@ -844,6 +863,7 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
// PEF subcommand handling
|
||||
*/
|
||||
int help = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!argc || !strncmp(argv[0], "info", 4))
|
||||
ipmi_pef_get_info(intf);
|
||||
@ -857,11 +877,14 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_pef_list_entries(intf);
|
||||
else {
|
||||
help = 1;
|
||||
rc = -1;
|
||||
lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
|
||||
}
|
||||
|
||||
if (help)
|
||||
lprintf(LOG_NOTICE, "PEF commands: info status policy list");
|
||||
else if (!verbose)
|
||||
printf("\n");
|
||||
return 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
2371
ipmitool/lib/ipmi_picmg.c
Normal file
2371
ipmitool/lib/ipmi_picmg.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -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 <string.h>
|
||||
@ -43,38 +39,344 @@
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
|
||||
#define IPMI_I2C_MASTER_MAX_SIZE 0x40 /* 64 bytes */
|
||||
|
||||
static int is_valid_param(const char *input_param, uint8_t *uchr_ptr,
|
||||
const char *label);
|
||||
|
||||
/* ipmi_master_write_read - Perform I2C write/read transactions
|
||||
*
|
||||
* This function performs an I2C master write-read function through
|
||||
* IPMI interface. It has a maximum transfer size of 32 bytes.
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @bus: channel number, i2c bus id and type
|
||||
* @addr: i2c slave address
|
||||
* @wdata: data to write
|
||||
* @wsize: length of data to write (max 64 bytes)
|
||||
* @rsize: length of data to read (max 64 bytes)
|
||||
*
|
||||
* Returns pointer to IPMI Response
|
||||
*/
|
||||
struct ipmi_rs *
|
||||
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
uint8_t rqdata[IPMI_I2C_MASTER_MAX_SIZE + 3];
|
||||
|
||||
if (rsize > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
lprintf(LOG_ERR, "Master Write-Read: Too many bytes (%d) to read", rsize);
|
||||
return NULL;
|
||||
}
|
||||
if (wsize > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
lprintf(LOG_ERR, "Master Write-Read: Too many bytes (%d) to write", wsize);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(struct ipmi_rq));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x52; /* master write-read */
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
memset(rqdata, 0, IPMI_I2C_MASTER_MAX_SIZE + 3);
|
||||
rqdata[0] = bus; /* channel number, bus id, bus type */
|
||||
rqdata[1] = addr; /* slave address */
|
||||
rqdata[2] = rsize; /* number of bytes to read */
|
||||
|
||||
if (wsize > 0) {
|
||||
/* copy in data to write */
|
||||
memcpy(rqdata+3, wdata, wsize);
|
||||
req.msg.data_len += wsize;
|
||||
lprintf(LOG_DEBUG, "Writing %d bytes to i2cdev %02Xh", wsize, addr);
|
||||
}
|
||||
|
||||
if (rsize > 0) {
|
||||
lprintf(LOG_DEBUG, "Reading %d bytes from i2cdev %02Xh", rsize, addr);
|
||||
}
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed");
|
||||
return NULL;
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
switch (rsp->ccode) {
|
||||
case 0x81:
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed: Lost Arbitration");
|
||||
break;
|
||||
case 0x82:
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed: Bus Error");
|
||||
break;
|
||||
case 0x83:
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed: NAK on Write");
|
||||
break;
|
||||
case 0x84:
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed: Truncated Read");
|
||||
break;
|
||||
default:
|
||||
lprintf(LOG_ERR, "I2C Master Write-Read command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return rsp;
|
||||
}
|
||||
|
||||
#define RAW_SPD_SIZE 256
|
||||
|
||||
int
|
||||
ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
uint8_t msize = IPMI_I2C_MASTER_MAX_SIZE; /* allow to override default */
|
||||
uint8_t channel = 0;
|
||||
uint8_t i2cbus = 0;
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t spd_data[RAW_SPD_SIZE];
|
||||
int i;
|
||||
|
||||
memset(spd_data, 0, RAW_SPD_SIZE);
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "usage: spd <i2cbus> <i2caddr> [channel] [maxread]");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_valid_param(argv[0], &i2cbus, "i2cbus") != 0)
|
||||
return (-1);
|
||||
|
||||
if (is_valid_param(argv[1], &i2caddr, "i2caddr") != 0)
|
||||
return (-1);
|
||||
|
||||
if (argc >= 3) {
|
||||
if (is_valid_param(argv[2], &channel, "channel") != 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (argc >= 4) {
|
||||
if (is_valid_param(argv[3], &msize, "maxread") != 0)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
i2cbus = ((channel & 0xF) << 4) | ((i2cbus & 7) << 1) | 1;
|
||||
|
||||
for (i = 0; i < RAW_SPD_SIZE; i+= msize) {
|
||||
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr,
|
||||
(uint8_t *)&i, 1, msize );
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(spd_data+i, rsp->data, msize);
|
||||
}
|
||||
|
||||
ipmi_spd_print(spd_data, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rawi2c_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: i2c [bus=public|# [chan=#] <i2caddr> <read bytes> [write data]");
|
||||
lprintf(LOG_NOTICE, " bus=public is default");
|
||||
lprintf(LOG_NOTICE, " chan=0 is default, bus= must be specified to use chan=");
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
uint8_t wdata[IPMI_I2C_MASTER_MAX_SIZE];
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t rsize = 0;
|
||||
uint8_t wsize = 0;
|
||||
unsigned int rbus = 0;
|
||||
uint8_t bus = 0;
|
||||
int i = 0;
|
||||
|
||||
/* handle bus= argument */
|
||||
if (argc > 2 && strncmp(argv[0], "bus=", 4) == 0) {
|
||||
i = 1;
|
||||
if (strncmp(argv[0], "bus=public", 10) == 0)
|
||||
bus = 0;
|
||||
else if (sscanf(argv[0], "bus=%u", &rbus) == 1)
|
||||
bus = ((rbus & 7) << 1) | 1;
|
||||
else
|
||||
bus = 0;
|
||||
|
||||
/* handle channel= argument
|
||||
* the bus= argument must be supplied first on command line */
|
||||
if (argc > 3 && strncmp(argv[1], "chan=", 5) == 0) {
|
||||
i = 2;
|
||||
if (sscanf(argv[1], "chan=%u", &rbus) == 1)
|
||||
bus |= rbus << 4;
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc-i) < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
rawi2c_usage();
|
||||
return 0;
|
||||
}
|
||||
else if (argc-i-2 > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
lprintf(LOG_ERR, "Raw command input limit (%d bytes) exceeded",
|
||||
IPMI_I2C_MASTER_MAX_SIZE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_valid_param(argv[i++], &i2caddr, "i2caddr") != 0)
|
||||
return (-1);
|
||||
|
||||
if (is_valid_param(argv[i++], &rsize, "read size") != 0)
|
||||
return (-1);
|
||||
|
||||
if (i2caddr == 0) {
|
||||
lprintf(LOG_ERR, "Invalid I2C address 0");
|
||||
rawi2c_usage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(wdata, 0, IPMI_I2C_MASTER_MAX_SIZE);
|
||||
for (; i < argc; i++) {
|
||||
uint8_t val = 0;
|
||||
|
||||
if (is_valid_param(argv[i], &val, "parameter") != 0)
|
||||
return (-1);
|
||||
|
||||
wdata[wsize] = val;
|
||||
wsize++;
|
||||
}
|
||||
|
||||
lprintf(LOG_INFO, "RAW I2C REQ (i2caddr=%x readbytes=%d writebytes=%d)",
|
||||
i2caddr, rsize, wsize);
|
||||
printbuf(wdata, wsize, "WRITE DATA");
|
||||
|
||||
rsp = ipmi_master_write_read(intf, bus, i2caddr, wdata, wsize, rsize);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (wsize > 0) {
|
||||
if (verbose || rsize == 0)
|
||||
printf("Wrote %d bytes to I2C device %02Xh\n", wsize, i2caddr);
|
||||
}
|
||||
|
||||
if (rsize > 0) {
|
||||
if (verbose || wsize == 0)
|
||||
printf("Read %d bytes from I2C device %02Xh\n", rsp->data_len, i2caddr);
|
||||
|
||||
if (rsp->data_len < rsize)
|
||||
return -1;
|
||||
|
||||
/* print the raw response buffer */
|
||||
for (i=0; i<rsp->data_len; i++) {
|
||||
if (((i%16) == 0) && (i != 0))
|
||||
printf("\n");
|
||||
printf(" %2.2x", rsp->data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if (rsp->data_len <= 4) {
|
||||
uint32_t bit;
|
||||
int j;
|
||||
for (i = 0; i < rsp->data_len; i++) {
|
||||
for (j = 1, bit = 0x80; bit > 0; bit /= 2, j++) {
|
||||
printf("%s", (rsp->data[i] & bit) ? "1" : "0");
|
||||
}
|
||||
printf(" ");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ipmi_raw_help() - print 'raw' help text
|
||||
*
|
||||
* returns void
|
||||
*/
|
||||
void
|
||||
ipmi_raw_help()
|
||||
{
|
||||
lprintf(LOG_NOTICE, "RAW Commands: raw <netfn> <cmd> [data]");
|
||||
print_valstr(ipmi_netfn_vals, "Network Function Codes", LOG_NOTICE);
|
||||
lprintf(LOG_NOTICE, "(can also use raw hex values)");
|
||||
} /* ipmi_raw_help() */
|
||||
|
||||
int
|
||||
ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t netfn, cmd;
|
||||
uint8_t netfn, cmd, lun;
|
||||
uint16_t netfn_tmp = 0;
|
||||
int i;
|
||||
uint8_t data[32];
|
||||
uint8_t data[256];
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "RAW Commands: raw <netfn> <cmd> [data]");
|
||||
if (argc == 1 && strncmp(argv[0], "help", 4) == 0) {
|
||||
ipmi_raw_help();
|
||||
return 0;
|
||||
}
|
||||
else if (argc < 2) {
|
||||
lprintf(LOG_ERR, "Not enough parameters given.");
|
||||
ipmi_raw_help();
|
||||
return (-1);
|
||||
}
|
||||
else if (argc > sizeof(data))
|
||||
{
|
||||
lprintf(LOG_NOTICE, "Raw command input limit (256 bytes) exceeded");
|
||||
return -1;
|
||||
}
|
||||
|
||||
netfn = (uint8_t)strtol(argv[0], NULL, 0);
|
||||
cmd = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
ipmi_intf_session_set_timeout(intf, 15);
|
||||
ipmi_intf_session_set_retry(intf, 1);
|
||||
|
||||
lun = intf->target_lun;
|
||||
netfn_tmp = str2val(argv[0], ipmi_netfn_vals);
|
||||
if (netfn_tmp == 0xff) {
|
||||
if (is_valid_param(argv[0], &netfn, "netfn") != 0)
|
||||
return (-1);
|
||||
} else {
|
||||
if (netfn_tmp >= UINT8_MAX) {
|
||||
lprintf(LOG_ERR, "Given netfn \"%s\" is out of range.", argv[0]);
|
||||
return (-1);
|
||||
}
|
||||
netfn = netfn_tmp;
|
||||
}
|
||||
|
||||
if (is_valid_param(argv[1], &cmd, "command") != 0)
|
||||
return (-1);
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = netfn;
|
||||
req.msg.lun = lun;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data = data;
|
||||
|
||||
for (i=2; i<argc; i++) {
|
||||
uint8_t val = (uint8_t)strtol(argv[i], NULL, 0);
|
||||
uint8_t val = 0;
|
||||
|
||||
if (is_valid_param(argv[i], &val, "data") != 0)
|
||||
return (-1);
|
||||
|
||||
req.msg.data[i-2] = val;
|
||||
req.msg.data_len++;
|
||||
}
|
||||
|
||||
lprintf(LOG_INFO, "RAW REQ (netfn=0x%x cmd=0x%x data_len=%d)",
|
||||
req.msg.netfn, req.msg.cmd, req.msg.data_len);
|
||||
lprintf(LOG_INFO,
|
||||
"RAW REQ (channel=0x%x netfn=0x%x lun=0x%x cmd=0x%x data_len=%d)",
|
||||
intf->target_channel & 0x0f, req.msg.netfn,req.msg.lun ,
|
||||
req.msg.cmd, req.msg.data_len);
|
||||
|
||||
printbuf(req.msg.data, req.msg.data_len, "RAW REQUEST");
|
||||
|
||||
@ -82,14 +384,14 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to send RAW command "
|
||||
"(netfn=0x%x cmd=0x%x)",
|
||||
req.msg.netfn, req.msg.cmd);
|
||||
"(channel=0x%x netfn=0x%x lun=0x%x cmd=0x%x)",
|
||||
intf->target_channel & 0x0f, req.msg.netfn, req.msg.lun, req.msg.cmd);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Unable to send RAW command "
|
||||
"(netfn=0x%x cmd=0x%x): %s",
|
||||
req.msg.netfn, req.msg.cmd,
|
||||
"(channel=0x%x netfn=0x%x lun=0x%x cmd=0x%x rsp=0x%x): %s",
|
||||
intf->target_channel & 0x0f, req.msg.netfn, req.msg.lun, req.msg.cmd, rsp->ccode,
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
@ -107,3 +409,24 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* is_valid_param -
|
||||
*
|
||||
* @input_param: string to convert from
|
||||
* @uchr_ptr: pointer where to store converted value
|
||||
* @label: string used in error message
|
||||
*
|
||||
* returns 0 if parameter is valid
|
||||
* returns (-1) if parameter is invalid/on error
|
||||
*/
|
||||
int
|
||||
is_valid_param(const char *input_param, uint8_t *uchr_ptr, const char *label) {
|
||||
if (input_param == NULL || label == NULL) {
|
||||
lprintf(LOG_ERROR, "ERROR: NULL pointer passed.");
|
||||
return (-1);
|
||||
}
|
||||
if (str2uchar(input_param, uchr_ptr) == 0)
|
||||
return 0;
|
||||
|
||||
lprintf(LOG_ERR, "Given %s \"%s\" is invalid.", label, input_param);
|
||||
return (-1);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user