diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-06-24 01:31:53 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-06-24 01:31:53 +0000 |
| commit | 5f722d964cfc9a02446ee20ca1bacb1118442b33 (patch) | |
| tree | 47c74c8814e5fd236eb73a88600afa417e673ef8 | |
| parent | 5c9c919917fb9cabc1ddd3b2bf641da3098ecb07 (diff) | |
Initial commit
| -rw-r--r-- | lasso/Attic/protocols/response.c | 110 | ||||
| -rw-r--r-- | lasso/Attic/protocols/response.h | 63 |
2 files changed, 173 insertions, 0 deletions
diff --git a/lasso/Attic/protocols/response.c b/lasso/Attic/protocols/response.c new file mode 100644 index 00000000..6c575cca --- /dev/null +++ b/lasso/Attic/protocols/response.c @@ -0,0 +1,110 @@ +/* $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/protocols/response.h> + +/*****************************************************************************/ +/* functions */ +/*****************************************************************************/ + +/*****************************************************************************/ +/* public methods */ +/*****************************************************************************/ + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +lasso_response_instance_init(LassoResponse *response) +{ +} + +static void +lasso_response_class_init(LassoResponseClass *class) +{ +} + +GType lasso_response_get_type() { + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoResponseClass), + NULL, + NULL, + (GClassInitFunc) lasso_response_class_init, + NULL, + NULL, + sizeof(LassoResponse), + 0, + (GInstanceInitFunc) lasso_response_instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP_RESPONSE, + "LassoResponse", + &this_info, 0); + } + return this_type; +} + +LassoNode* +lasso_response_new() +{ + LassoNode *response; + xmlChar *id, *time; + LassoNode *status, *status_code; + + response = lasso_samlp_response_new(); + + /* Set ONLY required elements/attributs */ + /* ResponseID */ + id = lasso_build_unique_id(32); + lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + (const xmlChar *)id); + xmlFree(id); + /* MajorVersion */ + lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMajorVersion); + /* MinorVersion */ + lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMinorVersion); + /* IssueInstant */ + time = lasso_get_current_time(); + lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + (const xmlChar *)time); + xmlFree(time); + + /* Add Status */ + status = lasso_samlp_status_new(); + status_code = lasso_samlp_status_code_new(); + lasso_samlp_status_code_set_value(LASSO_SAMLP_STATUS_CODE(status_code), lassoSamlStatusCodeSuccess); + lasso_samlp_status_set_statusCode(LASSO_SAMLP_STATUS(status), LASSO_SAMLP_STATUS_CODE(status_code)); + lasso_samlp_response_set_status(LASSO_SAMLP_RESPONSE(response), LASSO_SAMLP_STATUS(status)); + lasso_node_destroy(status_code); + lasso_node_destroy(status); + + return (response); +} diff --git a/lasso/Attic/protocols/response.h b/lasso/Attic/protocols/response.h new file mode 100644 index 00000000..9e2d828a --- /dev/null +++ b/lasso/Attic/protocols/response.h @@ -0,0 +1,63 @@ +/* $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 + */ + +#ifndef __LASSO_RESPONSE_H__ +#define __LASSO_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/samlp_response.h> + +#define LASSO_TYPE_RESPONSE (lasso_response_get_type()) +#define LASSO_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_RESPONSE, LassoResponse)) +#define LASSO_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_RESPONSE, LassoResponseClass)) +#define LASSO_IS_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_RESPONSE)) +#define LASSP_IS_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_RESPONSE)) +#define LASSO_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_RESPONSE, LassoResponseClass)) + +typedef struct _LassoResponse LassoResponse; +typedef struct _LassoResponseClass LassoResponseClass; + +struct _LassoResponse { + LassoSamlpResponse parent; + /*< public >*/ + /*< private >*/ +}; + +struct _LassoResponseClass { + LassoSamlpResponseClass parent; +}; + +LASSO_EXPORT GType lasso_response_get_type (void); + +LASSO_EXPORT LassoNode* lasso_response_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_RESPONSE_H__ */ |
