#include <OpenIPMI/ipmiif.h>#include <OpenIPMI/ipmi_addr.h>#include <OpenIPMI/ipmi_conn.h>#include <netinet/in.h>Go to the source code of this file.
|
|
Definition at line 46 of file ipmi_lan.h. Referenced by handle_activate_payload_response(). |
|
|
Definition at line 47 of file ipmi_lan.h. Referenced by get_sock_addr(), and ipmi_lanp_setup_con(). |
|
|
Definition at line 141 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 142 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), lan_parse_args(), and send_rmcpp_open_session(). |
|
|
Definition at line 145 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(). |
|
|
Definition at line 144 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(), ipmi_lanp_setup_con(), lan_con_alloc_args(), and lan_parse_args(). |
|
|
Definition at line 143 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(), and lan_parse_args(). |
|
|
Definition at line 170 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 152 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 155 of file ipmi_lan.h. Referenced by _ipmi_aes_cbc_init(), ipmi_lanp_setup_con(), lan_con_alloc_args(), and lan_parse_args(). |
|
|
Definition at line 153 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), lan_parse_args(), and send_rmcpp_open_session(). |
|
|
Definition at line 154 of file ipmi_lan.h. Referenced by handle_rmcpp_recv(), lan_parse_args(), reset_session_data(), rmcpp_format_msg(), and start_rmcpp(). |
|
|
Definition at line 156 of file ipmi_lan.h. Referenced by lan_parse_args(). |
|
|
Definition at line 157 of file ipmi_lan.h. |
|
|
Definition at line 146 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 147 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), lan_parse_args(), and send_rmcpp_open_session(). |
|
|
Definition at line 150 of file ipmi_lan.h. Referenced by _ipmi_hmac_init(), and lan_parse_args(). |
|
|
Definition at line 149 of file ipmi_lan.h. Referenced by _ipmi_hmac_init(), ipmi_lanp_setup_con(), lan_con_alloc_args(), and lan_parse_args(). |
|
|
Definition at line 151 of file ipmi_lan.h. Referenced by _ipmi_md5_init(). |
|
|
Definition at line 148 of file ipmi_lan.h. Referenced by handle_rmcpp_recv(), lan_parse_args(), reset_session_data(), rmcpp_format_msg(), and start_rmcpp(). |
|
|
Definition at line 165 of file ipmi_lan.h. Referenced by ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 120 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 91 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 101 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 135 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 96 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 106 of file ipmi_lan.h. Referenced by ipmi_ip_setup_con(), ipmi_lanp_setup_con(), and lan_connect_args(). |
|
|
Definition at line 251 of file ipmi_lan.h. Referenced by ipmi_sol_open(), and lan_send_addr(). |
|
|
Definition at line 240 of file ipmi_lan.h. Referenced by handle_lan15_recv(), ipmi_rmcpp_register_payload(), and lan_send_addr(). |
|
|
Definition at line 242 of file ipmi_lan.h. Referenced by handle_payload(), handle_rmcpp_recv(), ipmi_rmcpp_register_oem_payload(), ipmi_rmcpp_register_payload(), lan_send_addr(), rmcpp_find_ipmi(), and rmcpp_format_msg(). |
|
|
Definition at line 244 of file ipmi_lan.h. Referenced by ipmi_rmcpp_register_payload(), and send_rmcpp_open_session(). |
|
|
Definition at line 245 of file ipmi_lan.h. Referenced by handle_payload(), and ipmi_rmcpp_register_payload(). |
|
|
Definition at line 246 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(), and send_rakp1(). |
|
|
Definition at line 247 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(). |
|
|
Definition at line 248 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(), and send_rakp3(). |
|
|
Definition at line 249 of file ipmi_lan.h. Referenced by _ipmi_rakp_init(). |
|
|
Definition at line 241 of file ipmi_lan.h. Referenced by _ipmi_sol_init(), _ipmi_sol_shutdown(), handle_get_channel_payload_support_response(), handle_lan15_recv(), send_activate_payload(), send_close(), and send_get_payload_activation_status_command(). |
|
|
|
|
|
|
|
|
Definition at line 344 of file ipmi_lan.h. |
|
|
|
|
|
|
|
|
Definition at line 398 of file ipmi_lan.h. |
|
|
|
|
|
Definition at line 402 of file ipmi_lan.h. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||
|
Definition at line 5620 of file ipmi_lan.c. References lan_data_s::cparm, hash_lan_addr(), lan_conn_parms_s::ip_addr, lan_data_s::ipmi, ipmi_lock(), ipmi_mem_alloc(), ipmi_mem_free(), ipmi_unlock(), lan_do_evt_s::lan, lan_link_s::lan, lan_put(), lan_do_evt_s::next, lan_link_s::next, lan_conn_parms_s::num_ip_addr, lan_data_s::refcount, sockaddr_ip_s::s_ipsock, and snmp_got_match(). Referenced by ipmi_handle_snmp_trap_data(). 05623 { 05624 lan_link_t *l; 05625 lan_data_t *lan; 05626 int i; 05627 int idx; 05628 lan_do_evt_t *found = NULL; 05629 lan_do_evt_t *next = NULL; 05630 05631 idx = hash_lan_addr(src_addr); 05632 ipmi_lock(lan_list_lock); 05633 l = lan_ip_list[idx].next; 05634 /* Note that we call all the connections with the given IP 05635 address, not just the first one we find. There may be more 05636 than one. */ 05637 while (l->lan) { 05638 lan = NULL; 05639 for (i=0; i<l->lan->cparm.num_ip_addr; i++) { 05640 if (l->lan->cparm.ip_addr[i].s_ipsock.s_addr.sa_family 05641 != src_addr->sa_family) 05642 { 05643 continue; 05644 } 05645 switch (src_addr->sa_family) 05646 { 05647 case PF_INET: 05648 { 05649 struct sockaddr_in *src, *dst; 05650 src = (struct sockaddr_in *) src_addr; 05651 dst = &(l->lan->cparm.ip_addr[i].s_ipsock.s_addr4); 05652 if (dst->sin_addr.s_addr == src->sin_addr.s_addr) { 05653 /* We have a match, handle it */ 05654 lan = l->lan; 05655 lan->refcount++; 05656 } 05657 } 05658 break; 05659 #ifdef PF_INET6 05660 case PF_INET6: 05661 { 05662 struct sockaddr_in6 *src, *dst; 05663 src = (struct sockaddr_in6 *) src_addr; 05664 dst = &(l->lan->cparm.ip_addr[i].s_ipsock.s_addr6); 05665 if (memcmp(dst->sin6_addr.s6_addr, 05666 src->sin6_addr.s6_addr, 05667 sizeof(struct in6_addr)) 05668 == 0) 05669 { 05670 /* We have a match, handle it */ 05671 lan = l->lan; 05672 lan->refcount++; 05673 } 05674 } 05675 break; 05676 #endif 05677 } 05678 05679 if (lan) { 05680 next = ipmi_mem_alloc(sizeof(*next)); 05681 if (!next) 05682 /* Can't do anything, just go on. It's not 05683 fatal, it just delays things. */ 05684 continue; 05685 next->lan = lan; 05686 next->next = found; 05687 found = next; 05688 } 05689 } 05690 l = l->next; 05691 } 05692 ipmi_unlock(lan_list_lock); 05693 05694 while (found) { 05695 next = found; 05696 found = found->next; 05697 snmp_got_match(next->lan, msg, pet_ack); 05698 lan_put(next->lan->ipmi); 05699 ipmi_mem_free(next); 05700 } 05701 05702 /* Next will be left non-NULL if something was delivered, it will 05703 be NULL if nothing was delivered. */ 05704 return next != NULL; 05705 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 3458 of file ipmi_lan.c. References os_handler_s::alloc_timer, ipmi_con_s::con_data, ipmi_msg_item_s::data4, ipmi_msg::data_len, os_handler_s::free_timer, handle_msg_send(), lan_data_s::in_cleanup, ipmi_lock(), IPMI_MAX_MSG_LENGTH, ipmi_mem_alloc(), ipmi_mem_free(), ipmi_unlock(), lan_send_addr(), MAX_IP_ADDR, ipmi_msg::netfn, ipmi_con_s::os_hnd, lan_data_s::outstanding_msg_count, and lan_data_s::seq_num_lock. Referenced by send_activate_session(), send_auth_cap(), send_challenge(), send_get_dev_id(), send_rakp1(), send_rakp3(), send_rmcpp_open_session(), and send_set_session_privilege(). 03465 { 03466 lan_timer_info_t *info; 03467 lan_data_t *lan; 03468 int rv; 03469 /* We store the address number in data4. */ 03470 03471 if (addr_num >= MAX_IP_ADDR) 03472 return EINVAL; 03473 03474 if (addr_len > sizeof(ipmi_addr_t)) 03475 return EINVAL; 03476 03477 if (msg->data_len > IPMI_MAX_MSG_LENGTH) 03478 return EINVAL; 03479 03480 lan = (lan_data_t *) ipmi->con_data; 03481 03482 if (lan->in_cleanup) 03483 return ECANCELED; 03484 03485 /* Odd netfns are responses or unacknowledged data. Just send 03486 them. */ 03487 if (msg->netfn & 1) 03488 return lan_send_addr(lan, addr, addr_len, msg, 0, addr_num, NULL); 03489 03490 info = ipmi_mem_alloc(sizeof(*info)); 03491 if (!info) 03492 return ENOMEM; 03493 memset(info, 0, sizeof(*info)); 03494 03495 /* Put it in the list first. */ 03496 info->ipmi = ipmi; 03497 info->cancelled = 0; 03498 03499 rv = ipmi->os_hnd->alloc_timer(ipmi->os_hnd, &(info->timer)); 03500 if (rv) { 03501 ipmi_mem_free(info); 03502 return rv; 03503 } 03504 03505 ipmi_lock(lan->seq_num_lock); 03506 03507 if (lan->outstanding_msg_count >= 60) { 03508 rv = EAGAIN; 03509 goto out_unlock; 03510 } 03511 03512 rspi->data4 = (void *) (long) addr_num; 03513 rv = handle_msg_send(info, addr_num, addr, addr_len, msg, 03514 rsp_handler, rspi); 03515 /* handle_msg_send handles freeing the timer and info on an error */ 03516 info = NULL; 03517 if (! rv) 03518 lan->outstanding_msg_count++; 03519 ipmi_unlock(lan->seq_num_lock); 03520 return rv; 03521 03522 out_unlock: 03523 ipmi_unlock(lan->seq_num_lock); 03524 if (rv) { 03525 if (info) { 03526 if (info->timer) 03527 ipmi->os_hnd->free_timer(ipmi->os_hnd, info->timer); 03528 ipmi_mem_free(info); 03529 } 03530 } 03531 return rv; 03532 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 5151 of file ipmi_lan.c. References ipmi_ip_setup_con(), MAX_IP_ADDR, and p. 05163 { 05164 char s_ip_addrs[MAX_IP_ADDR][20]; 05165 char s_ports[MAX_IP_ADDR][10]; 05166 char *paddrs[MAX_IP_ADDR], *pports[MAX_IP_ADDR]; 05167 unsigned char *p; 05168 int i,rv; 05169 05170 if ((num_ip_addrs < 1) || (num_ip_addrs > MAX_IP_ADDR)) 05171 return EINVAL; 05172 for (i=0; i<num_ip_addrs; i++) { 05173 p = (unsigned char *)&(ip_addrs[i]); 05174 sprintf(s_ip_addrs[i], "%u.%u.%u.%u", *p, *(p+1), *(p+2), *(p+3)); 05175 sprintf(s_ports[i], "%u", ports[i]); 05176 paddrs[i] = s_ip_addrs[i]; 05177 pports[i]= s_ports[i]; 05178 } 05179 rv = ipmi_ip_setup_con(paddrs, 05180 pports, 05181 num_ip_addrs, 05182 authtype, 05183 privilege, 05184 username, 05185 username_len, 05186 password, 05187 password_len, 05188 handlers, 05189 user_data, 05190 new_con); 05191 return rv; 05192 }
|
|
||||||||||||||||||||||||