libsyncml  0.5.4
sml_elements_internals.h
1 /*
2  * libsyncml - A syncml protocol implementation
3  * Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
4  * Copyright (C) 2007-2009 Michael Bell <michael.bell@opensync.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
29 
30 #ifndef _SML_ELEMENTS_INTERNALS_H_
31 #define _SML_ELEMENTS_INTERNALS_H_
32 
33 #include <libxml/xmlreader.h>
34 
35 struct SmlAnchor {
36  char *next;
37  char *last;
38 };
39 
40 struct SmlLocation {
41  gint refCount;
42  char *locURI;
43  char *locName;
44 };
45 
46 struct SmlItem {
47  gint refCount;
48 
49  SmlLocation *source;
50  SmlLocation *target;
51  SmlLocation *sourceParent;
52  SmlLocation *targetParent;
53  SmlAnchor *anchor;
54 
55  xmlBuffer *buffer;
56 
57  unsigned int size;
58 
59  char *contenttype;
60  SmlBool moreData;
61 
62  SmlBool disabled;
64  SmlBool raw;
65 };
66 
67 struct SmlMapItem {
68  gint refCount;
69  SmlLocation *source;
70  SmlLocation *target;
71 };
72 
73 struct SmlHeader {
74  char *sessionID;
75  SmlProtocolVersion version;
76  SmlProtocolType protocol;
77  SmlLocation *source;
78  SmlLocation *target;
79  char *responseURI;
80  SmlBool noResponse;
81  unsigned int messageID;
82  unsigned int maxmsgsize;
83  unsigned int maxobjsize;
84  char *emi;
85 };
86 
87 struct SmlCred {
88  SmlFormatType format;
89  SmlAuthType type;
90  char *data;
91  gint refCount;
92  char *username;
93  char *password;
94 };
95 
96 struct SmlChal {
97  SmlFormatType format;
98  SmlAuthType type;
99  char *nonce_plain;
100  unsigned int nonce_length;
101  char *nonce_b64;
102  gint refCount;
103 };
104 
105 void smlLocationSetURI(SmlLocation *loc, const char *uri);
106 
107 #endif //_SML_ELEMENTS_INTERNALS_H_
108