diff options
author | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-04-09 02:33:23 +0000 |
---|---|---|
committer | dmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6> | 2005-04-09 02:33:23 +0000 |
commit | a4b4adc25d2b02baee7049fa4c24120cfb5d1000 (patch) | |
tree | b4ad4a18dfaa6942e4d8f553e7c1793ac180e4ec /usr/mgmt_ipc.h | |
parent | d92ebb97cbe99d52735163c70dd2b3458c2e4330 (diff) | |
download | open-iscsi-a4b4adc25d2b02baee7049fa4c24120cfb5d1000.tar.gz |
kernel ipc cleanup. added and implemented iscsi_ipc callback structure
receive pool for control PDU's per-connection added
git-svn-id: svn://svn.berlios.de/open-iscsi@222 d7303112-9cec-0310-bdd2-e83a94d6c2b6
Diffstat (limited to 'usr/mgmt_ipc.h')
-rw-r--r-- | usr/mgmt_ipc.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/usr/mgmt_ipc.h b/usr/mgmt_ipc.h new file mode 100644 index 0000000..7c2f7da --- /dev/null +++ b/usr/mgmt_ipc.h @@ -0,0 +1,87 @@ +/* + * iSCSI Daemon/Admin Management IPC + * + * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman + * maintained by open-iscsi@googlegroups.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * See the file COPYING included with this distribution for more details. + */ +#ifndef MGMT_IPC_H +#define MGMT_IPC_H + +#include "types.h" + +#define ISCSIADM_NAMESPACE "ISCSIADM_ABSTRACT_NAMESPACE" + +typedef enum mgmt_ipc_err { + MGMT_IPC_OK = 0, + MGMT_IPC_ERR = 1, + MGMT_IPC_ERR_NOT_FOUND = 2, + MGMT_IPC_ERR_NOMEM = 3, + MGMT_IPC_ERR_TCP_FAILURE = 4, + MGMT_IPC_ERR_LOGIN_FAILURE = 5, + MGMT_IPC_ERR_IDBM_FAILURE = 6, + MGMT_IPC_ERR_INVAL = 7, + MGMT_IPC_ERR_TCP_TIMEOUT = 8, + MGMT_IPC_ERR_INTERNAL = 9, + MGMT_IPC_ERR_LOGOUT_FAILURE = 10, + MGMT_IPC_ERR_PDU_TIMEOUT = 11, + MGMT_IPC_ERR_TRANS_NOT_FOUND = 12, +} mgmt_ipc_err_e; + +typedef enum iscsiadm_cmd { + MGMT_IPC_UNKNOWN = 0, + MGMT_IPC_SESSION_LOGIN = 1, + MGMT_IPC_SESSION_LOGOUT = 2, + MGMT_IPC_SESSION_ACTIVELIST = 3, + MGMT_IPC_SESSION_ACTIVESTAT = 4, + MGMT_IPC_CONN_ADD = 5, + MGMT_IPC_CONN_REMOVE = 6, +} iscsiadm_cmd_e; + +/* IPC Request */ +typedef struct iscsiadm_req { + iscsiadm_cmd_e command; + + union { + /* messages */ + struct msg_session { + int rid; + } session; + struct msg_conn { + int rid; + int cid; + } conn; + } u; +} iscsiadm_req_t; + +/* IPC Response */ +typedef struct iscsiadm_rsp { + iscsiadm_cmd_e command; + mgmt_ipc_err_e err; + + union { + struct msg_activelist { +#define MGMT_IPC_ACTIVELIST_MAX 64 + int sids[MGMT_IPC_ACTIVELIST_MAX]; + int rids[MGMT_IPC_ACTIVELIST_MAX]; + int cnt; + } activelist; + } u; +} iscsiadm_rsp_t; + +int mgmt_ipc_handle(int accept_fd); +int mgmt_ipc_listen(void); +void mgmt_ipc_close(int fd); + +#endif /* MGMT_IPC_H */ |