remove dynamic interface support,

remove my stupid spec-violating pedantic packets
This commit is contained in:
Duncan Laurie 2004-08-27 16:31:53 +00:00
parent c52b6e80ba
commit 66aaa91ff2
2 changed files with 18 additions and 51 deletions

View File

@ -53,7 +53,6 @@
#include <config.h> #include <config.h>
#include <ipmitool/helper.h> #include <ipmitool/helper.h>
#include <ipmitool/ipmi.h> #include <ipmitool/ipmi.h>
#include <ipmitool/md5.h>
#include <ipmitool/ipmi_lanp.h> #include <ipmitool/ipmi_lanp.h>
#include <ipmitool/ipmi_channel.h> #include <ipmitool/ipmi_channel.h>
#include <ipmitool/ipmi_intf.h> #include <ipmitool/ipmi_intf.h>
@ -80,6 +79,7 @@ static struct ipmi_rq_entry * ipmi_req_entries_tail;
static sigjmp_buf jmpbuf; static sigjmp_buf jmpbuf;
static int ipmi_lanplus_setup(struct ipmi_intf * intf);
static int ipmi_lan_send_packet(struct ipmi_intf * intf, unsigned char * data, int data_len); static int ipmi_lan_send_packet(struct ipmi_intf * intf, unsigned char * data, int data_len);
static struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf); static struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf);
static struct ipmi_rs * ipmi_lan_poll_recv(struct ipmi_intf * intf); static struct ipmi_rs * ipmi_lan_poll_recv(struct ipmi_intf * intf);
@ -114,11 +114,15 @@ static void ack_sol_packet(
struct ipmi_intf ipmi_lanplus_intf = { struct ipmi_intf ipmi_lanplus_intf = {
.open = ipmi_lanplus_open, name: "lanplus",
.close = ipmi_lanplus_close, desc: "IPMI v2.0 RMCP+ LAN Interface",
.sendrecv = ipmi_lanplus_send_ipmi_cmd, setup: ipmi_lanplus_setup,
.recv_sol = ipmi_lanplus_recv_sol, open: ipmi_lanplus_open,
.send_sol = ipmi_lanplus_send_sol close: ipmi_lanplus_close,
sendrecv: ipmi_lanplus_send_ipmi_cmd,
recv_sol: ipmi_lanplus_recv_sol,
send_sol: ipmi_lanplus_send_sol,
target_addr: IPMI_BMC_SLAVE_ADDR,
}; };
@ -434,26 +438,6 @@ ipmiv2_lan_ping(struct ipmi_intf * intf)
} }
/* special packet, no idea what it does */
static int
ipmiv2_lan_first(struct ipmi_intf * intf)
{
unsigned char data[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x20, 0x18, 0xc8, 0xc2, 0x01, 0x01, 0x3c };
ipmi_lan_send_packet(intf, data, 16);
return 0;
}
static int
ipmi_lan_pedantic(struct ipmi_intf * intf)
{
unsigned char data[10] = "dummy";
ipmi_lan_send_packet(intf, data, 10);
return 0;
}
/** /**
* *
* ipmi_lan_poll_recv * ipmi_lan_poll_recv
@ -1460,7 +1444,7 @@ ipmi_lanplus_build_v2x_msg(
if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) && if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) &&
(session->v2_data.auth_alg != IPMI_AUTH_RAKP_NONE)) (session->v2_data.auth_alg != IPMI_AUTH_RAKP_NONE))
{ {
unsigned int i, hmac_length, integrity_pad_size, hmac_input_size; unsigned int i, hmac_length, integrity_pad_size = 0, hmac_input_size;
unsigned char * hmac_output; unsigned char * hmac_output;
unsigned int start_of_session_trailer = unsigned int start_of_session_trailer =
IPMI_LANPLUS_OFFSET_PAYLOAD + IPMI_LANPLUS_OFFSET_PAYLOAD +
@ -1927,9 +1911,6 @@ ipmi_lanplus_send_payload(
return NULL; return NULL;
} }
if (intf->pedantic)
ipmi_lan_pedantic(intf);
usleep(100); /* Not sure what this is for */ usleep(100); /* Not sure what this is for */
/* Remember our connection state */ /* Remember our connection state */
@ -2843,6 +2824,7 @@ ipmi_lanplus_close(struct ipmi_intf * intf)
free(intf->session); free(intf->session);
intf->session = NULL; intf->session = NULL;
intf->opened = 0;
intf = NULL; intf = NULL;
} }
@ -2938,10 +2920,6 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
} }
if (intf->pedantic)
ipmiv2_lan_first(intf);
/* /*
* *
* Make sure the BMC supports IPMI v2 / RMCP+ * Make sure the BMC supports IPMI v2 / RMCP+
@ -3095,22 +3073,15 @@ void test_crypt2()
/** /**
* lanplus_intf_setup * lanplus_intf_setup
*/ */
int static int ipmi_lanplus_setup(struct ipmi_intf * intf)
lanplus_intf_setup(struct ipmi_intf ** intf)
{ {
//test_crypt1(); //test_crypt1();
assert("lanplus_intf_setup"); assert("lanplus_intf_setup");
if (lanplus_seed_prng(16)) if (lanplus_seed_prng(16))
return -1; return -1;
*intf = &ipmi_lanplus_intf; intf->session = malloc(sizeof(struct ipmi_session));
(*intf)->session = malloc(sizeof(struct ipmi_session)); memset(intf->session, 0, sizeof(struct ipmi_session));
memset((*intf)->session, 0, sizeof(struct ipmi_session)); return (intf->session) ? 0 : -1;
return ((*intf)->session) ? 0 : -1;
} }
int
intf_setup(struct ipmi_intf ** intf)
__attribute__ ((weak, alias("lanplus_intf_setup")));

View File

@ -137,15 +137,11 @@
extern const struct valstr ipmi_privlvl_vals[]; extern const struct valstr ipmi_privlvl_vals[];
extern const struct valstr ipmi_authtype_vals[]; extern const struct valstr ipmi_authtype_vals[];
extern struct ipmi_session lan_session; extern struct ipmi_intf ipmi_lanplus_intf;
struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req); struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req);
int ipmi_lanplus_open(struct ipmi_intf * intf); int ipmi_lanplus_open(struct ipmi_intf * intf);
void ipmi_lanplus_close(struct ipmi_intf * intf); void ipmi_lanplus_close(struct ipmi_intf * intf);
int ipmiv2_lan_ping(struct ipmi_intf * intf); int ipmiv2_lan_ping(struct ipmi_intf * intf);
int lanplus_intf_setup(struct ipmi_intf ** intf);
#endif /*IPMI_LAN_H*/ #endif /*IPMI_LAN_H*/