Lines Matching +full:non +full:- +full:volatile
1 /* -*-mode: C; indent-tabs-mode: t; -*-
22 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
60 /* _ipmi_get_channel_access - Get Channel Access for given channel. Results are
63 * @intf - IPMI interface
64 * @channel_access - ptr to channel_access_t with Channel set.
65 * @get_volatile_settings - get volatile if != 0, else non-volatile settings.
67 * returns - negative number means error, positive is a ccode.
79 return (-3); in _ipmi_get_channel_access()
81 data[0] = channel_access->channel & 0x0F; in _ipmi_get_channel_access()
82 /* volatile - 0x80; non-volatile - 0x40 */ in _ipmi_get_channel_access()
89 rsp = intf->sendrecv(intf, &req); in _ipmi_get_channel_access()
91 return (-1); in _ipmi_get_channel_access()
92 } else if (rsp->ccode != 0) { in _ipmi_get_channel_access()
93 return rsp->ccode; in _ipmi_get_channel_access()
94 } else if (rsp->data_len != 2) { in _ipmi_get_channel_access()
95 return (-2); in _ipmi_get_channel_access()
97 channel_access->alerting = rsp->data[0] & 0x20; in _ipmi_get_channel_access()
98 channel_access->per_message_auth = rsp->data[0] & 0x10; in _ipmi_get_channel_access()
99 channel_access->user_level_auth = rsp->data[0] & 0x08; in _ipmi_get_channel_access()
100 channel_access->access_mode = rsp->data[0] & 0x07; in _ipmi_get_channel_access()
101 channel_access->privilege_limit = rsp->data[1] & 0x0F; in _ipmi_get_channel_access()
105 /* _ipmi_get_channel_info - Get Channel Info for given channel. Results are
108 * @intf - IPMI interface
109 * @channel_info - ptr to channel_info_t with Channel set.
111 * returns - negative number means error, positive is a ccode.
122 return (-3); in _ipmi_get_channel_info()
124 data[0] = channel_info->channel & 0x0F; in _ipmi_get_channel_info()
130 rsp = intf->sendrecv(intf, &req); in _ipmi_get_channel_info()
132 return (-1); in _ipmi_get_channel_info()
133 } else if (rsp->ccode != 0) { in _ipmi_get_channel_info()
134 return rsp->ccode; in _ipmi_get_channel_info()
135 } else if (rsp->data_len != 9) { in _ipmi_get_channel_info()
136 return (-2); in _ipmi_get_channel_info()
138 channel_info->channel = rsp->data[0] & 0x0F; in _ipmi_get_channel_info()
139 channel_info->medium = rsp->data[1] & 0x7F; in _ipmi_get_channel_info()
140 channel_info->protocol = rsp->data[2] & 0x1F; in _ipmi_get_channel_info()
141 channel_info->session_support = rsp->data[3] & 0xC0; in _ipmi_get_channel_info()
142 channel_info->active_sessions = rsp->data[3] & 0x3F; in _ipmi_get_channel_info()
143 memcpy(channel_info->vendor_id, &rsp->data[4], in _ipmi_get_channel_info()
144 sizeof(channel_info->vendor_id)); in _ipmi_get_channel_info()
145 memcpy(channel_info->aux_info, &rsp->data[7], in _ipmi_get_channel_info()
146 sizeof(channel_info->aux_info)); in _ipmi_get_channel_info()
150 /* _ipmi_set_channel_access - Set Channel Access values for given channel.
152 * @intf - IPMI interface
153 * @channel_access - channel_access_t with desired values and channel set.
155 * - 0 = don't set/change Channel Access
156 * - 1 = set non-volatile settings of Channel Access
157 * - 2 = set volatile settings of Channel Access
159 * - 0 = don't set/change Privilege Level Limit
160 * - 1 = set non-volatile settings of Privilege Limit
161 * - 2 = set volatile settings of Privilege Limit
163 * returns - negative number means error, positive is a ccode. See IPMI
165 * 0x82 - set not supported on selected channel, eg. session-less channel.
166 * 0x83 - access mode not supported
179 return (-3); in _ipmi_set_channel_access()
204 rsp = intf->sendrecv(intf, &req); in _ipmi_set_channel_access()
206 return (-1); in _ipmi_set_channel_access()
208 return rsp->ccode; in _ipmi_set_channel_access()
257 * -1 on failure
277 rsp = intf->sendrecv(intf, &req); in ipmi_get_channel_auth_cap()
279 if ((rsp == NULL) || (rsp->ccode > 0)) { in ipmi_get_channel_auth_cap()
286 rsp = intf->sendrecv(intf, &req); in ipmi_get_channel_auth_cap()
289 return (-1); in ipmi_get_channel_auth_cap()
291 if (rsp->ccode > 0) { in ipmi_get_channel_auth_cap()
293 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_channel_auth_cap()
294 return (-1); in ipmi_get_channel_auth_cap()
298 memcpy(&auth_cap, rsp->data, sizeof(struct get_channel_auth_cap_rsp)); in ipmi_get_channel_auth_cap()
307 (auth_cap.kg_status) ? "non-zero" : "default (all zeroes)"); in ipmi_get_channel_auth_cap()
315 printf("Non-null user names exist : %s\n", in ipmi_get_channel_auth_cap()
376 rsp = intf->sendrecv(intf, &req); in ipmi_get_channel_cipher_suites()
379 return -1; in ipmi_get_channel_cipher_suites()
381 if (rsp->ccode > 0) { in ipmi_get_channel_cipher_suites()
383 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_channel_cipher_suites()
384 return -1; in ipmi_get_channel_cipher_suites()
392 if (rsp->data_len >= 1) { in ipmi_get_channel_cipher_suites()
393 channel = rsp->data[0]; in ipmi_get_channel_cipher_suites()
396 while ((rsp->data_len > 1) && (rsp->data_len == 17) && (list_index < 0x3F)) { in ipmi_get_channel_cipher_suites()
398 * We got back cipher suite data -- store it. in ipmi_get_channel_cipher_suites()
400 * printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data"); in ipmi_get_channel_cipher_suites()
402 memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1); in ipmi_get_channel_cipher_suites()
403 offset += rsp->data_len - 1; in ipmi_get_channel_cipher_suites()
411 rsp = intf->sendrecv(intf, &req); in ipmi_get_channel_cipher_suites()
414 return -1; in ipmi_get_channel_cipher_suites()
416 if (rsp->ccode > 0) { in ipmi_get_channel_cipher_suites()
418 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_channel_cipher_suites()
419 return -1; in ipmi_get_channel_cipher_suites()
424 if(rsp->data_len > 1) { in ipmi_get_channel_cipher_suites()
426 * We got back cipher suite data -- store it. in ipmi_get_channel_cipher_suites()
428 * printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data"); in ipmi_get_channel_cipher_suites()
430 memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1); in ipmi_get_channel_cipher_suites()
431 offset += rsp->data_len - 1; in ipmi_get_channel_cipher_suites()
447 if ((cipher_suite_data_length - offset) < 4) { in ipmi_get_channel_cipher_suites()
449 return -1; in ipmi_get_channel_cipher_suites()
457 if ((cipher_suite_data_length - offset) < 4) { in ipmi_get_channel_cipher_suites()
459 return -1; in ipmi_get_channel_cipher_suites()
472 return -1; in ipmi_get_channel_cipher_suites()
479 * poorly written -- I have read the errata document. For now, I'm only in ipmi_get_channel_cipher_suites()
488 ((cipher_suite_data_length - offset) > 0)) in ipmi_get_channel_cipher_suites()
508 "%-4d %-7s %-15s %-15s %-15s\n"), in ipmi_get_channel_cipher_suites()
522 * -1 on failure
536 return (-1); in ipmi_get_channel_info()
549 printf("session-less\n"); in ipmi_get_channel_info()
552 printf("single-session\n"); in ipmi_get_channel_info()
555 printf("multi-session\n"); in ipmi_get_channel_info()
558 printf("session-based\n"); in ipmi_get_channel_info()
580 lprintf(LOG_ERR, "Unable to Get Channel Access (volatile)"); in ipmi_get_channel_info()
581 return (-1); in ipmi_get_channel_info()
584 printf(" Volatile(active) Settings\n"); in ipmi_get_channel_info()
587 printf(" Per-message Auth : %sabled\n", in ipmi_get_channel_info()
597 printf("pre-boot only\n"); in ipmi_get_channel_info()
612 /* get non-volatile settings */ in ipmi_get_channel_info()
615 lprintf(LOG_ERR, "Unable to Get Channel Access (non-volatile)"); in ipmi_get_channel_info()
616 return (-1); in ipmi_get_channel_info()
619 printf(" Non-Volatile Settings\n"); in ipmi_get_channel_info()
622 printf(" Per-message Auth : %sabled\n", in ipmi_get_channel_info()
632 printf("pre-boot only\n"); in ipmi_get_channel_info()
647 /* ipmi_get_channel_medium - Return Medium of given IPMI Channel.
649 * @channel - IPMI Channel
651 * returns - IPMI Channel Medium, IPMI_CHANNEL_MEDIUM_RESERVED if ccode > 0,
676 /* ipmi_get_user_access - Get User Access for given Channel and User or Users.
678 * @intf - IPMI interface
679 * @channel - IPMI Channel we're getting access for
680 * @user_id - User ID. If 0 is passed, all IPMI users will be listed
682 * returns - 0 on success, (-1) on error
704 return (-1); in ipmi_get_user_access()
712 return (-1); in ipmi_get_user_access()
727 (user_access.callin_callback) ? "callback" : "call-in / callback"); in ipmi_get_user_access()
741 /* ipmi_set_user_access - Query BMC for current Channel ACLs, parse CLI args
744 * returns - 0 on success, (-1) on error
761 return (-1); in ipmi_set_user_access()
765 return (-1); in ipmi_set_user_access()
774 return (-1); in ipmi_set_user_access()
800 return (-1); in ipmi_set_user_access()
805 return (-1); in ipmi_set_user_access()
813 return (-1); in ipmi_set_user_access()
829 return (-1); in ipmi_channel_main()
836 return (-1); in ipmi_channel_main()
840 return (-1); in ipmi_channel_main()
848 return (-1); in ipmi_channel_main()
851 return (-1); in ipmi_channel_main()
855 return (-1); in ipmi_channel_main()
860 return ipmi_set_user_access(intf, (argc - 1), &(argv[1])); in ipmi_channel_main()
865 return (-1); in ipmi_channel_main()
869 return (-1); in ipmi_channel_main()
879 return (-1); in ipmi_channel_main()
883 return (-1); in ipmi_channel_main()
892 retval = -1; in ipmi_channel_main()
897 /* printf_channel_usage - print-out help. */