As part of the iscsid to iscsiuio communication socket.

Signed-off-by: Eddie Wai <eddie....@broadcom.com>
---
 usr/uip_mgmt_ipc.c |   41 +++++++++++++++++++++++++++++
 usr/uip_mgmt_ipc.h |   73 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 0 deletions(-)
 create mode 100644 usr/uip_mgmt_ipc.c
 create mode 100644 usr/uip_mgmt_ipc.h

diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
new file mode 100644
index 0000000..f3074ee
--- /dev/null
+++ b/usr/uip_mgmt_ipc.c
@@ -0,0 +1,41 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
+ *
+ * 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.
+ */
+
+#include <string.h>
+
+#include "log.h"
+#include "uip_mgmt_ipc.h"
+#include "iscsid_req.h"
+
+int uip_broadcast_params(struct iscsi_transport *t,
+                        struct iface_rec *iface,
+                        struct iscsi_session *session)
+{
+       struct iscsid_uip_broadcast broadcast;
+
+       log_debug(3, "broadcasting to uip\n");
+
+       memset(&broadcast, 0, sizeof(broadcast));
+
+       broadcast.header.command = ISCSID_UIP_IPC_GET_IFACE;
+       broadcast.header.payload_len = sizeof(*iface);
+
+       memcpy(&broadcast.u.iface_rec, iface, sizeof(*iface));
+
+       return uip_broadcast(&broadcast,
+                            sizeof(iscsid_uip_broadcast_header_t) +
+                            sizeof(*iface));
+}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
new file mode 100644
index 0000000..29a4769
--- /dev/null
+++ b/usr/uip_mgmt_ipc.h
@@ -0,0 +1,73 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
+ *
+ * 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 UIP_MGMT_IPC_H
+#define UIP_MGMT_IPC_H
+
+#include "types.h"
+#include "iscsi_if.h"
+#include "config.h"
+#include "mgmt_ipc.h"
+
+#include "initiator.h"
+#include "transport.h"
+
+#define ISCSID_UIP_NAMESPACE   "ISCSID_UIP_ABSTRACT_NAMESPACE"
+
+typedef enum iscsid_uip_cmd {
+       ISCSID_UIP_IPC_UNKNOWN                  = 0,
+       ISCSID_UIP_IPC_GET_IFACE                = 1,
+
+       __ISCSID_UIP_IPC_MAX_COMMAND
+} iscsid_uip_cmd_e;
+
+typedef struct iscsid_uip_broadcast_header {
+       iscsid_uip_cmd_e command;
+       uint32_t payload_len;
+} iscsid_uip_broadcast_header_t;
+
+/* IPC Request */
+typedef struct iscsid_uip_broadcast {
+       struct iscsid_uip_broadcast_header header;
+
+       union {
+               /* messages */
+               struct ipc_broadcast_iface_rec {
+                       struct iface_rec rec;
+               } iface_rec;
+       } u;
+} iscsid_uip_broadcast_t;
+
+typedef enum iscsid_uip_mgmt_ipc_err {
+       ISCSID_UIP_MGMT_IPC_OK                     = 0,
+       ISCSID_UIP_MGMT_IPC_ERR                    = 1,
+       ISCSID_UIP_MGMT_IPC_ERR_NOT_FOUND          = 2,
+       ISCSID_UIP_MGMT_IPC_ERR_NOMEM              = 3,
+       ISCSID_UIP_MGMT_IPC_DEVICE_UP              = 4,
+       ISCSID_UIP_MGMT_IPC_DEVICE_INITIALIZING    = 5,
+} iscsid_uip_mgmt_ipc_err_e;
+
+/* IPC Response */
+typedef struct iscsid_uip_mgmt_rsp {
+       iscsid_uip_cmd_e command;
+       iscsid_uip_mgmt_ipc_err_e err;
+} iscsid_uip_rsp_t;
+
+extern int uip_broadcast_params(struct iscsi_transport *t,
+                               struct iface_rec *iface,
+                               struct iscsi_session *session);
+
+
+#endif /* UIP_MGMT_IPC_H */
-- 
1.7.7.4


-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to