summaryrefslogtreecommitdiff
path: root/util/ipmicmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/ipmicmd.c')
-rw-r--r--util/ipmicmd.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/util/ipmicmd.c b/util/ipmicmd.c
index 8501359..9d56630 100644
--- a/util/ipmicmd.c
+++ b/util/ipmicmd.c
@@ -267,7 +267,7 @@ uchar my_devid[20] = {0,0,0,0,0,0,0,0}; /*saved devid, only needs 16 bytes*/
int gshutdown = 0; /* see ipmilan.c ipmilanplus.c */
LAN_OPT lanp = { "localhost","","", IPMI_SESSION_AUTHTYPE_MD5,
- IPMI_PRIV_LEVEL_USER, 3, "", 0 };
+ IPMI_PRIV_LEVEL_USER, 3, "", 0, RMCP_PRI_RMCP_PORT };
static char *gnode = lanp.node;
//char *guser = lanp.user;
//char *gpswd = lanp.pswd;
@@ -655,7 +655,7 @@ int ipmi_open(char fdebugcmd)
/* first time, so try each */
if (fipmi_lan) {
/* Try IPMI LAN 1.5 first */
- rc = ipmi_open_lan(gnode,lanp.user,lanp.pswd,fdebugcmd);
+ rc = ipmi_open_lan(gnode,lanp.port,lanp.user,lanp.pswd,fdebugcmd);
fDriverTyp = DRV_LAN;
if (rc == LAN_ERR_V2) {
/* Use IPMI LAN 2.0 if BMC said it only supports LAN2 */
@@ -1125,9 +1125,15 @@ int ipmi_sendrecv(struct ipmi_rq * req, uchar *rsp, int *rsp_len)
rlen = IPMI_RSPBUF_SIZE;
*rsp_len = 0;
- rv = ipmi_cmdraw_mc(req->msg.cmd, req->msg.netfn,
- req->msg.data, (uchar)req->msg.data_len,
- rsp, &rlen, &ccode, fdebug);
+ if ((fDriverTyp != DRV_MV) && (mc->adrtype == ADDR_IPMB) && !fipmi_lan) {
+ rv = ipmi_cmd_ipmb( req->msg.cmd, req->msg.netfn, mc->sa,mc->bus,
+ req->msg.lun, req->msg.data, (uchar)req->msg.data_len,
+ rsp, &rlen, &ccode, fdebug);
+ } else { /* use ADDR_SMI */
+ rv = ipmi_cmdraw(req->msg.cmd, req->msg.netfn, mc->sa,mc->bus,
+ req->msg.lun, req->msg.data, (uchar)req->msg.data_len,
+ rsp, &rlen, &ccode, fdebug);
+ }
if (rv == 0 && ccode != 0) rv = ccode;
if (rv == 0) { /*success*/
*rsp_len = rlen;
@@ -1340,6 +1346,12 @@ void parse_lan_options(int c, char *popt, char fdebugcmd)
switch(c)
{
+ case 'p':
+ i = atoi(popt);
+ if (i > 0) lanp.port = i;
+ else printf("-p port %d < 0, defaults to %d\n",
+ i,RMCP_PRI_RMCP_PORT);
+ break;
case 'F': /* force driver type */
i = set_driver_type(popt);
if (i == 0) fset_dtype = 1;
@@ -1406,11 +1418,13 @@ void parse_lan_options(int c, char *popt, char fdebugcmd)
#endif
} /*end parse_lan_options*/
-void print_lan_opt_usage(void)
+void print_lan_opt_usage(int opt)
{
#if defined(EFI) | defined(DOS)
return;
#else
+ if (opt == 1) /*port ok*/
+ printf(" -p port UDP Port of target system\n");
printf(" -N node Nodename or IP address of target system\n");
printf(" -U user Username for remote node\n");
printf(" -P/-R pswd Remote Password\n");