~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to lasso/xml/saml_subject_locality.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: saml_subject_locality.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Samlerty 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/saml_subject_locality.h>
 
27
 
 
28
/*
 
29
The schema fragment (oasis-sstc-saml-schema-assertion-1.0.xsd):
 
30
 
 
31
<element name="SubjectLocality" type="saml:SubjectLocalityType"/>
 
32
<complexType name="SubjectLocalityType">
 
33
  <attribute name="IPAddress" type="string" use="optional"/>
 
34
  <attribute name="DNSAddress" type="string" use="optional"/>
 
35
</complexType>
 
36
*/
 
37
 
 
38
/*****************************************************************************/
 
39
/* public methods                                                            */
 
40
/*****************************************************************************/
 
41
 
 
42
void
 
43
lasso_saml_subject_locality_set_dnsAddress(LassoSamlSubjectLocality *node,
 
44
                                           const xmlChar *dnsAddress)
 
45
{
 
46
  LassoNodeClass *class;
 
47
  g_assert(LASSO_IS_SAML_SUBJECT_LOCALITY(node));
 
48
  g_assert(dnsAddress != NULL);
 
49
 
 
50
  class = LASSO_NODE_GET_CLASS(node);
 
51
  class->set_prop(LASSO_NODE (node), "DNSAddress", dnsAddress);
 
52
}
 
53
 
 
54
void
 
55
lasso_saml_subject_locality_set_ipAddress(LassoSamlSubjectLocality *node,
 
56
                                          const xmlChar *ipAddress)
 
57
{
 
58
  LassoNodeClass *class;
 
59
  g_assert(LASSO_IS_SAML_SUBJECT_LOCALITY(node));
 
60
  g_assert(ipAddress != NULL);
 
61
 
 
62
  class = LASSO_NODE_GET_CLASS(node);
 
63
  class->set_prop(LASSO_NODE (node), "IPAddress", ipAddress);
 
64
}
 
65
 
 
66
/*****************************************************************************/
 
67
/* instance and class init functions                                         */
 
68
/*****************************************************************************/
 
69
 
 
70
static void
 
71
lasso_saml_subject_locality_instance_init(LassoSamlSubjectLocality *node)
 
72
{
 
73
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
74
 
 
75
  class->set_ns(LASSO_NODE(node), lassoSamlAssertionHRef,
 
76
                lassoSamlAssertionPrefix);
 
77
  class->set_name(LASSO_NODE(node), "SubjectLocality");
 
78
}
 
79
 
 
80
static void
 
81
lasso_saml_subject_locality_class_init(LassoSamlSubjectLocalityClass *klass)
 
82
{
 
83
}
 
84
 
 
85
GType lasso_saml_subject_locality_get_type() {
 
86
  static GType this_type = 0;
 
87
 
 
88
  if (!this_type) {
 
89
    static const GTypeInfo this_info = {
 
90
      sizeof (LassoSamlSubjectLocalityClass),
 
91
      NULL,
 
92
      NULL,
 
93
      (GClassInitFunc) lasso_saml_subject_locality_class_init,
 
94
      NULL,
 
95
      NULL,
 
96
      sizeof(LassoSamlSubjectLocality),
 
97
      0,
 
98
      (GInstanceInitFunc) lasso_saml_subject_locality_instance_init,
 
99
    };
 
100
    
 
101
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
102
                                       "LassoSamlSubjectLocality",
 
103
                                       &this_info, 0);
 
104
  }
 
105
  return this_type;
 
106
}
 
107
 
 
108
/**
 
109
 * lasso_saml_subject_locality_new:
 
110
 * 
 
111
 * Creates a new <saml:SubjectLocality> node object.
 
112
 * 
 
113
 * Return value: the new @LassoSamlSubjectLocality
 
114
 **/
 
115
LassoNode* lasso_saml_subject_locality_new()
 
116
{
 
117
  return LASSO_NODE(g_object_new(LASSO_TYPE_SAML_SUBJECT_LOCALITY, NULL));
 
118
}