mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
move "struct ipmi_intf" and "struct ipmi_session" to ipmi_intf.h
This commit is contained in:
parent
2ab696dc17
commit
f179e04459
@ -48,19 +48,6 @@
|
|||||||
extern int verbose;
|
extern int verbose;
|
||||||
extern int csv_output;
|
extern int csv_output;
|
||||||
|
|
||||||
struct ipmi_session {
|
|
||||||
unsigned char username[16];
|
|
||||||
unsigned char challenge[16];
|
|
||||||
unsigned char password;
|
|
||||||
unsigned char authtype;
|
|
||||||
unsigned char authcode[16];
|
|
||||||
unsigned char privlvl;
|
|
||||||
uint32_t in_seq;
|
|
||||||
uint32_t out_seq;
|
|
||||||
uint32_t id;
|
|
||||||
int active;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ipmi_rq {
|
struct ipmi_rq {
|
||||||
struct {
|
struct {
|
||||||
unsigned char netfn;
|
unsigned char netfn;
|
||||||
@ -73,7 +60,6 @@ struct ipmi_rq {
|
|||||||
struct ipmi_rq_entry {
|
struct ipmi_rq_entry {
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
struct ipmi_intf * intf;
|
struct ipmi_intf * intf;
|
||||||
struct ipmi_session * session;
|
|
||||||
unsigned char rq_seq;
|
unsigned char rq_seq;
|
||||||
unsigned char * msg_data;
|
unsigned char * msg_data;
|
||||||
int msg_len;
|
int msg_len;
|
||||||
@ -88,7 +74,7 @@ struct ipmi_rs {
|
|||||||
unsigned char authtype;
|
unsigned char authtype;
|
||||||
uint32_t seq;
|
uint32_t seq;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
} session;
|
} session_hdr;
|
||||||
unsigned char msglen;
|
unsigned char msglen;
|
||||||
struct {
|
struct {
|
||||||
unsigned char rq_addr;
|
unsigned char rq_addr;
|
||||||
@ -101,16 +87,6 @@ struct ipmi_rs {
|
|||||||
} header;
|
} header;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ipmi_intf {
|
|
||||||
int fd;
|
|
||||||
struct sockaddr_in addr;
|
|
||||||
int abort;
|
|
||||||
int pedantic;
|
|
||||||
int (*open)(struct ipmi_intf *, char *, int, char *, char *);
|
|
||||||
void (*close)(struct ipmi_intf *);
|
|
||||||
struct ipmi_rs *(*sendrecv)(struct ipmi_intf *, struct ipmi_rq *);
|
|
||||||
};
|
|
||||||
|
|
||||||
#define IPMI_NETFN_CHASSIS 0x0
|
#define IPMI_NETFN_CHASSIS 0x0
|
||||||
#define IPMI_NETFN_BRIDGE 0x2
|
#define IPMI_NETFN_BRIDGE 0x2
|
||||||
#define IPMI_NETFN_SE 0x4
|
#define IPMI_NETFN_SE 0x4
|
||||||
|
@ -39,6 +39,32 @@
|
|||||||
|
|
||||||
#include <ipmitool/ipmi.h>
|
#include <ipmitool/ipmi.h>
|
||||||
|
|
||||||
|
struct ipmi_session {
|
||||||
|
unsigned char hostname[64];
|
||||||
|
unsigned char username[16];
|
||||||
|
unsigned char authcode[16];
|
||||||
|
unsigned char challenge[16];
|
||||||
|
unsigned char authtype;
|
||||||
|
unsigned char privlvl;
|
||||||
|
int password;
|
||||||
|
int port;
|
||||||
|
int active;
|
||||||
|
uint32_t session_id;
|
||||||
|
uint32_t in_seq;
|
||||||
|
uint32_t out_seq;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ipmi_intf {
|
||||||
|
int fd;
|
||||||
|
int opened;
|
||||||
|
int abort;
|
||||||
|
int pedantic;
|
||||||
|
int (*open)(struct ipmi_intf *);
|
||||||
|
void (*close)(struct ipmi_intf *);
|
||||||
|
struct ipmi_rs *(*sendrecv)(struct ipmi_intf *, struct ipmi_rq *);
|
||||||
|
struct ipmi_session * session;
|
||||||
|
};
|
||||||
|
|
||||||
struct static_intf {
|
struct static_intf {
|
||||||
char * name;
|
char * name;
|
||||||
int (*setup)(struct ipmi_intf ** intf);
|
int (*setup)(struct ipmi_intf ** intf);
|
||||||
@ -48,4 +74,10 @@ int ipmi_intf_init(void);
|
|||||||
void ipmi_intf_exit(void);
|
void ipmi_intf_exit(void);
|
||||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||||
|
|
||||||
|
int ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||||
|
int ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
|
||||||
|
int ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
|
||||||
|
int ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, unsigned char privlvl);
|
||||||
|
int ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
|
||||||
|
|
||||||
#endif /* IPMI_INTF_H */
|
#endif /* IPMI_INTF_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user