~ubuntu-branches/ubuntu/edgy/lasso/edgy

« back to all changes in this revision

Viewing changes to lasso/xml/samlp_request.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: samlp_request.c,v 1.6 2004/08/13 15:16:13 fpeters Exp $ 
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: Nicolas Clapies <nclapies@entrouvert.com>
 
9
 *          Valery Febvre <vfebvre@easter-eggs.com>
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 * 
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 * 
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#include <lasso/xml/samlp_request.h>
 
27
 
 
28
/*
 
29
<element name="Request" type="samlp:RequestType"/>
 
30
<complexType name="RequestType">
 
31
   <complexContent>
 
32
     <extension base="samlp:RequestAbstractType">
 
33
        <choice>
 
34
           <element ref="samlp:Query"/>
 
35
           <element ref="samlp:SubjectQuery"/>
 
36
           <element ref="samlp:AuthenticationQuery"/>
 
37
           <element ref="samlp:AttributeQuery"/>
 
38
           <element ref="samlp:AuthorizationDecisionQuery"/>
 
39
           <element ref="saml:AssertionIDReference" maxOccurs="unbounded"/>
 
40
           <element ref="samlp:AssertionArtifact" maxOccurs="unbounded"/>
 
41
        </choice>
 
42
     </extension>
 
43
   </complexContent>
 
44
</complexType>
 
45
 
 
46
<element name="AssertionArtifact" type="string"/>
 
47
 
 
48
*/
 
49
 
 
50
/*****************************************************************************/
 
51
/* public methods                                                            */
 
52
/*****************************************************************************/
 
53
 
 
54
void
 
55
lasso_samlp_request_set_assertionArtifact(LassoSamlpRequest *node,
 
56
                                          const xmlChar *assertionArtifact)
 
57
{
 
58
  LassoNodeClass *class;
 
59
  g_assert(LASSO_IS_SAMLP_REQUEST(node));
 
60
  g_assert(assertionArtifact != NULL);
 
61
 
 
62
  class = LASSO_NODE_GET_CLASS(node);
 
63
  class->new_child(LASSO_NODE (node), "AssertionArtifact", assertionArtifact, FALSE);
 
64
}
 
65
 
 
66
/*****************************************************************************/
 
67
/* instance and class init functions                                         */
 
68
/*****************************************************************************/
 
69
 
 
70
static void
 
71
lasso_samlp_request_instance_init(LassoSamlpRequest *node)
 
72
{
 
73
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
74
 
 
75
  /* namespace herited from samlp:RequestAbstract */
 
76
  class->set_name(LASSO_NODE(node), "Request");
 
77
}
 
78
 
 
79
static void
 
80
lasso_samlp_request_class_init(LassoSamlpRequestClass *klass)
 
81
{
 
82
}
 
83
 
 
84
GType lasso_samlp_request_get_type() {
 
85
  static GType this_type = 0;
 
86
 
 
87
  if (!this_type) {
 
88
    static const GTypeInfo this_info = {
 
89
      sizeof (LassoSamlpRequestClass),
 
90
      NULL,
 
91
      NULL,
 
92
      (GClassInitFunc) lasso_samlp_request_class_init,
 
93
      NULL,
 
94
      NULL,
 
95
      sizeof(LassoSamlpRequest),
 
96
      0,
 
97
      (GInstanceInitFunc) lasso_samlp_request_instance_init,
 
98
    };
 
99
    
 
100
    this_type = g_type_register_static(LASSO_TYPE_SAMLP_REQUEST_ABSTRACT,
 
101
                                       "LassoSamlpRequest",
 
102
                                       &this_info, 0);
 
103
  }
 
104
  return this_type;
 
105
}
 
106
 
 
107
LassoNode* lasso_samlp_request_new() {
 
108
  return LASSO_NODE(g_object_new(LASSO_TYPE_SAMLP_REQUEST,
 
109
                                 NULL));
 
110
}