~ubuntu-branches/ubuntu/oneiric/open-iscsi/oneiric

« back to all changes in this revision

Viewing changes to usr/mgmt_ipc.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Zobel-Helas
  • Date: 2006-12-03 16:54:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20061203165421-udgd6i05ugt1byrh
Tags: upstream-2.0.730
ImportĀ upstreamĀ versionĀ 2.0.730

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define MGMT_IPC_H
21
21
 
22
22
#include "types.h"
 
23
#include "iscsi_if.h"
 
24
#include "config.h"
23
25
 
24
26
#define ISCSIADM_NAMESPACE      "ISCSIADM_ABSTRACT_NAMESPACE"
 
27
#define PEERUSER_MAX            64
25
28
 
26
29
typedef enum mgmt_ipc_err {
27
30
        MGMT_IPC_OK                     = 0,
28
31
        MGMT_IPC_ERR                    = 1,
29
32
        MGMT_IPC_ERR_NOT_FOUND          = 2,
30
33
        MGMT_IPC_ERR_NOMEM              = 3,
31
 
        MGMT_IPC_ERR_TCP_FAILURE        = 4,
 
34
        MGMT_IPC_ERR_TRANS_FAILURE      = 4,
32
35
        MGMT_IPC_ERR_LOGIN_FAILURE      = 5,
33
36
        MGMT_IPC_ERR_IDBM_FAILURE       = 6,
34
37
        MGMT_IPC_ERR_INVAL              = 7,
35
 
        MGMT_IPC_ERR_TCP_TIMEOUT        = 8,
 
38
        MGMT_IPC_ERR_TRANS_TIMEOUT      = 8,
36
39
        MGMT_IPC_ERR_INTERNAL           = 9,
37
40
        MGMT_IPC_ERR_LOGOUT_FAILURE     = 10,
38
41
        MGMT_IPC_ERR_PDU_TIMEOUT        = 11,
39
42
        MGMT_IPC_ERR_TRANS_NOT_FOUND    = 12,
40
43
        MGMT_IPC_ERR_ACCESS             = 13,
41
44
        MGMT_IPC_ERR_TRANS_CAPS         = 14,
 
45
        MGMT_IPC_ERR_EXISTS             = 15,
42
46
} mgmt_ipc_err_e;
43
47
 
44
48
typedef enum iscsiadm_cmd {
45
49
        MGMT_IPC_UNKNOWN                = 0,
46
50
        MGMT_IPC_SESSION_LOGIN          = 1,
47
51
        MGMT_IPC_SESSION_LOGOUT         = 2,
48
 
        MGMT_IPC_SESSION_ACTIVELIST     = 3,
49
52
        MGMT_IPC_SESSION_ACTIVESTAT     = 4,
50
53
        MGMT_IPC_CONN_ADD               = 5,
51
54
        MGMT_IPC_CONN_REMOVE            = 6,
53
56
        MGMT_IPC_CONFIG_INAME           = 8,
54
57
        MGMT_IPC_CONFIG_IALIAS          = 9,
55
58
        MGMT_IPC_CONFIG_FILE            = 10,
 
59
        MGMT_IPC_IMMEDIATE_STOP         = 11,
 
60
        MGMT_IPC_SESSION_SYNC           = 12,
56
61
} iscsiadm_cmd_e;
57
62
 
58
63
/* IPC Request */
62
67
        union {
63
68
                /* messages */
64
69
                struct msg_session {
65
 
                        int rid;
66
70
                        int sid;
 
71
                        node_rec_t rec;
67
72
                } session;
68
73
                struct msg_conn {
69
 
                        int rid;
70
74
                        int sid;
71
75
                        int cid;
72
76
                } conn;
79
83
        mgmt_ipc_err_e err;
80
84
 
81
85
        union {
82
 
                struct msg_activelist {
83
 
#define MGMT_IPC_ACTIVELIST_MAX         64
84
 
                        int sids[MGMT_IPC_ACTIVELIST_MAX];
85
 
                        int rids[MGMT_IPC_ACTIVELIST_MAX];
86
 
                        int cnt;
87
 
                } activelist;
88
86
#define MGMT_IPC_GETSTATS_BUF_MAX       (sizeof(struct iscsi_uevent) + \
89
87
                                        sizeof(struct iscsi_stats) + \
90
88
                                        sizeof(struct iscsi_stats_custom) * \
101
99
        } u;
102
100
} iscsiadm_rsp_t;
103
101
 
104
 
int mgmt_ipc_handle(int accept_fd);
 
102
struct iscsi_ipc *ipc;
 
103
 
 
104
void need_reap(void);
 
105
void event_loop(struct iscsi_ipc *ipc, int control_fd, int mgmt_ipc_fd);
105
106
int mgmt_ipc_listen(void);
106
107
void mgmt_ipc_close(int fd);
107
108