summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-12-08 09:53:41 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-12-08 09:53:41 +0000
commit7ece831c1ab98d5b1de28dd90befa72ecb6ac7b0 (patch)
treefbf2a8008b66cf5168ec13dac314545484a7965f
parent3352a6daa262fff7d9b38b9fd6f7c35e8b9e512d (diff)
Added LassoDiscoResourceID and LassoDiscoEncryptedResourceID classes
-rw-r--r--lasso/xml/Makefile.am4
-rw-r--r--lasso/xml/disco_encrypted_resource_id.c111
-rw-r--r--lasso/xml/disco_encrypted_resource_id.h73
-rw-r--r--lasso/xml/disco_resource_id.c108
-rw-r--r--lasso/xml/disco_resource_id.h72
5 files changed, 368 insertions, 0 deletions
diff --git a/lasso/xml/Makefile.am b/lasso/xml/Makefile.am
index 6f589e8b..ca5b6560 100644
--- a/lasso/xml/Makefile.am
+++ b/lasso/xml/Makefile.am
@@ -16,6 +16,7 @@ liblasso_xml_la_SOURCES = \
xml.c \
disco_credentials.c \
disco_description.c \
+ disco_encrypted_resource_id.c \
disco_insert_entry.c \
disco_modify.c \
disco_modify_response.c \
@@ -24,6 +25,7 @@ liblasso_xml_la_SOURCES = \
disco_query_response.c \
disco_remove_entry.c \
disco_requested_service_type.c \
+ disco_resource_id.c \
disco_resource_offering.c \
disco_service_instance.c \
dst_data.c \
@@ -83,6 +85,7 @@ liblassoinclude_HEADERS = \
xml.h \
disco_credentials.h \
disco_description.h \
+ disco_encrypted_resource_id.h \
disco_insert_entry.h \
disco_modify.h \
disco_modify_response.h \
@@ -91,6 +94,7 @@ liblassoinclude_HEADERS = \
disco_query_response.h \
disco_remove_entry.h \
disco_requested_service_type.h \
+ disco_resource_id.h \
disco_resource_offering.h \
disco_service_instance.h \
dst_data.h \
diff --git a/lasso/xml/disco_encrypted_resource_id.c b/lasso/xml/disco_encrypted_resource_id.c
new file mode 100644
index 00000000..872e37c5
--- /dev/null
+++ b/lasso/xml/disco_encrypted_resource_id.c
@@ -0,0 +1,111 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/xml/disco_encrypted_resource_id.h>
+
+/*
+ * Schema fragment (liberty-idwsf-disco-svc-1.0-errata-v1.0.xsd):
+ *
+ * <xs:element name="EncryptedResourceID" type="EncryptedResourceIDType"/>
+ * <xs:complexType name="EncryptedResourceIDType">
+ * <xs:sequence>
+ * <xs:element ref="xenc:EncryptedData"/>
+ * <xs:element ref="xenc:EncryptedKey"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ */
+
+/*****************************************************************************/
+/* private methods */
+/*****************************************************************************/
+
+static struct XmlSnippet schema_snippets[] = {
+#if 0
+ { "EncryptedData", SNIPPET_NODE,
+ G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedData) },
+ { "EncryptedKey", SNIPPET_NODE,
+ G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedKey) },
+#endif
+ { NULL, 0, 0}
+};
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+instance_init(LassoDiscoEncryptedResourceID *node)
+{
+#if 0
+ node->EncryptedData = NULL;
+ node->EncryptedKey = NULL;
+#endif
+}
+
+static void
+class_init(LassoDiscoEncryptedResourceIDClass *klass)
+{
+ LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
+
+ nclass->node_data = g_new0(LassoNodeClassData, 1);
+ lasso_node_class_set_nodename(nclass, "EncryptedResourceID");
+ lasso_node_class_set_ns(nclass, LASSO_DISCO_HREF, LASSO_DISCO_PREFIX);
+ lasso_node_class_add_snippets(nclass, schema_snippets);
+}
+
+GType
+lasso_disco_encrypted_resource_id_get_type()
+{
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoDiscoEncryptedResourceIDClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) class_init,
+ NULL,
+ NULL,
+ sizeof(LassoDiscoEncryptedResourceID),
+ 0,
+ (GInstanceInitFunc) instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_NODE,
+ "LassoDiscoEncryptedResourceID",
+ &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoDiscoEncryptedResourceID*
+lasso_disco_encrypted_resource_id_new()
+{
+ LassoDiscoEncryptedResourceID *node;
+
+ node = g_object_new(LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID, NULL);
+
+ return node;
+}
diff --git a/lasso/xml/disco_encrypted_resource_id.h b/lasso/xml/disco_encrypted_resource_id.h
new file mode 100644
index 00000000..fe88ff51
--- /dev/null
+++ b/lasso/xml/disco_encrypted_resource_id.h
@@ -0,0 +1,73 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_DISCO_ENCRYPTED_RESOURCE_ID_H__
+#define __LASSO_DISCO_ENCRYPTED_RESOURCE_ID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/xml.h>
+
+#define LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID (lasso_disco_encrypted_resource_id_get_type())
+#define LASSO_DISCO_ENCRYPTED_RESOURCE_ID(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID, LassoDiscoEncryptedResourceID))
+#define LASSO_DISCO_ENCRYPTED_RESOURCE_ID_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID, \
+ LassoDiscoEncryptedResourceIDClass))
+#define LASSO_IS_DISCO_ENCRYPTED_RESOURCE_ID(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID))
+#define LASSO_IS_DISCO_ENCRYPTED_RESOURCE_ID_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID))
+#define LASSO_DISCO_ENCRYPTED_RESOURCE_ID_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_DISCO_ENCRYPTED_RESOURCE_ID, \
+ LassoDiscoEncryptedResourceIDClass))
+
+typedef struct _LassoDiscoEncryptedResourceID LassoDiscoEncryptedResourceID;
+typedef struct _LassoDiscoEncryptedResourceIDClass LassoDiscoEncryptedResourceIDClass;
+
+struct _LassoDiscoEncryptedResourceID {
+ LassoNode parent;
+
+#if 0 /* missing from lasso */
+ LassoXencEncryptedData *EncryptedData;
+ LassoXencEncryptedKey *EncryptedKey;
+#endif
+};
+
+struct _LassoDiscoEncryptedResourceIDClass {
+ LassoNodeClass parent;
+};
+
+LASSO_EXPORT GType lasso_disco_encrypted_resource_id_get_type(void);
+
+LASSO_EXPORT LassoDiscoEncryptedResourceID* lasso_disco_encrypted_resource_id_new();
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_DISCO_ENCRYPTED_RESOURCE_ID_H__ */
diff --git a/lasso/xml/disco_resource_id.c b/lasso/xml/disco_resource_id.c
new file mode 100644
index 00000000..fba2ec1a
--- /dev/null
+++ b/lasso/xml/disco_resource_id.c
@@ -0,0 +1,108 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/xml/disco_resource_id.h>
+
+/*
+ * Schema fragment (liberty-idwsf-disco-svc-1.0-errata-v1.0.xsd):
+ *
+ * <xs:element name="ResourceID" type="ResourceIDType"/>
+ * <xs:complexType name="ResourceIDType">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:anyURI">
+ * <xs:attribute name="id" type="xs:ID" use="optional"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
+ */
+
+/*****************************************************************************/
+/* private methods */
+/*****************************************************************************/
+
+static struct XmlSnippet schema_snippets[] = {
+ { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDiscoResourceID, id) },
+ { "", SNIPPET_TEXT_CHILD, G_STRUCT_OFFSET(LassoDiscoResourceID, content) },
+ { NULL, 0, 0}
+};
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+instance_init(LassoDiscoResourceID *node)
+{
+ node->id = NULL;
+ node->content = NULL;
+}
+
+static void
+class_init(LassoDiscoResourceIDClass *klass)
+{
+ LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
+
+ nclass->node_data = g_new0(LassoNodeClassData, 1);
+ lasso_node_class_set_nodename(nclass, "ResourceID");
+ lasso_node_class_set_ns(nclass, LASSO_DISCO_HREF, LASSO_DISCO_PREFIX);
+ lasso_node_class_add_snippets(nclass, schema_snippets);
+}
+
+GType
+lasso_disco_resource_id_get_type()
+{
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoDiscoResourceIDClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) class_init,
+ NULL,
+ NULL,
+ sizeof(LassoDiscoResourceID),
+ 0,
+ (GInstanceInitFunc) instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_NODE,
+ "LassoDiscoResourceID", &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoDiscoResourceID*
+lasso_disco_resource_id_new(const gchar *content)
+{
+ LassoDiscoResourceID *node;
+
+ g_return_val_if_fail(content != NULL, NULL);
+
+ node = g_object_new(LASSO_TYPE_DISCO_RESOURCE_ID, NULL);
+ node->content = g_strdup(content);
+
+ return node;
+}
diff --git a/lasso/xml/disco_resource_id.h b/lasso/xml/disco_resource_id.h
new file mode 100644
index 00000000..7fbd15d5
--- /dev/null
+++ b/lasso/xml/disco_resource_id.h
@@ -0,0 +1,72 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_DISCO_RESOURCE_ID_H__
+#define __LASSO_DISCO_RESOURCE_ID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/xml.h>
+
+#define LASSO_TYPE_DISCO_RESOURCE_ID (lasso_disco_resource_id_get_type())
+#define LASSO_DISCO_RESOURCE_ID(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_DISCO_RESOURCE_ID, LassoDiscoResourceID))
+#define LASSO_DISCO_RESOURCE_ID_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_DISCO_RESOURCE_ID, \
+ LassoDiscoResourceIDClass))
+#define LASSO_IS_DISCO_RESOURCE_ID(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_DISCO_RESOURCE_ID))
+#define LASSO_IS_DISCO_RESOURCE_ID_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_DISCO_RESOURCE_ID))
+#define LASSO_DISCO_RESOURCE_ID_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_DISCO_RESOURCE_ID, \
+ LassoDiscoResourceIDClass))
+
+typedef struct _LassoDiscoResourceID LassoDiscoResourceID;
+typedef struct _LassoDiscoResourceIDClass LassoDiscoResourceIDClass;
+
+struct _LassoDiscoResourceID {
+ LassoNode parent;
+
+ gchar *content;
+
+ gchar *id;
+};
+
+struct _LassoDiscoResourceIDClass {
+ LassoNodeClass parent;
+};
+
+LASSO_EXPORT GType lasso_disco_resource_id_get_type(void);
+
+LASSO_EXPORT LassoDiscoResourceID* lasso_disco_resource_id_new(const gchar *content);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_DISCO_RESOURCE_ID_H__ */