Kannel: Open Source WAP and SMS gateway  svn-r5335
wsp_pdu.def
Go to the documentation of this file.
1 /* ====================================================================
2  * The Kannel Software License, Version 1.0
3  *
4  * Copyright (c) 2001-2018 Kannel Group
5  * Copyright (c) 1998-2001 WapIT Ltd.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Kannel Group (http://www.kannel.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Kannel" and "Kannel Group" must not be used to
28  * endorse or promote products derived from this software without
29  * prior written permission. For written permission, please
30  * contact org@kannel.org.
31  *
32  * 5. Products derived from this software may not be called "Kannel",
33  * nor may "Kannel" appear in their name, without prior written
34  * permission of the Kannel Group.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
40  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
41  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
42  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
45  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
46  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Kannel Group. For more information on
51  * the Kannel Group, please see <http://www.kannel.org/>.
52  *
53  * Portions of this software are based upon software originally written at
54  * WapIT Ltd., Helsinki, Finland for the Kannel project.
55  */
56 
57 PDU(Connect, "...",
58  TYPE(8, 1)
59  UINT(version, "WSP protocol version", 8)
60  UINTVAR(capabilities_len, "Length of capabilities")
61  UINTVAR(headers_len, "Length of session headers")
62  OCTSTR(capabilities, "Requested capabilities", capabilities_len)
63  OCTSTR(headers, "Session headers", headers_len)
64  , 1)
65 
66 PDU(ConnectReply, "...",
67  TYPE(8, 2)
68  UINTVAR(sessionid, "Session ID")
69  UINTVAR(capabilities_len, "Length of capabilities")
70  UINTVAR(headers_len, "Length of session headers")
71  OCTSTR(capabilities, "Accepted capabilities", capabilities_len)
72  OCTSTR(headers, "Session headers", headers_len)
73  , 1)
74 
75 PDU(Redirect, "Problem: need REPEAT structure to parse addresses",
76  TYPE(8, 3)
77  UINT(permanent, "Permanent Redirect flag", 1)
78  UINT(reuse_security, "Reuse Security Session flag", 1)
79  RESERVED(6)
80  REST(addresses, "Redirect addresses")
81  , 1)
82 
83 PDU(Disconnect, "...",
84  TYPE(8, 5)
85  UINTVAR(sessionid, "Session ID")
86  , 1)
87 
88 PDU(Get, "...",
89  TYPE(4, 0x4)
90  UINT(subtype, "GET, OPTIONS, HEAD, DELETE, or TRACE", 4)
91  UINTVAR(uri_len, "Length of URI")
92  OCTSTR(uri, "URI", uri_len)
93  REST(headers, "Request headers")
94  , p->subtype <= 4)
95 
96 PDU(Post, "...",
97  TYPE(4, 0x6)
98  UINT(subtype, "POST or PUT", 4)
99  UINTVAR(uri_len, "Length of URI")
100  UINTVAR(headers_len, "Length of headers")
101  OCTSTR(uri, "URI", uri_len)
102  OCTSTR(headers, "Content type and request headers", headers_len)
103  REST(data, "Request data")
104  , p->subtype <= 1)
105 
106 PDU(Reply, "...",
107  TYPE(8, 4)
108  UINT(status, "Status code", 8)
109  UINTVAR(headers_len, "Length of headers")
110  OCTSTR(headers, "Content type and reply headers", headers_len)
111  REST(data, "Reply data")
112  , 1)
113 
114 PDU(Push, "...",
115  TYPE(8, 6)
116  UINTVAR(headers_len, "Length of headers")
117  OCTSTR(headers, "Content type and headers", headers_len)
118  REST(data, "Push data")
119  , 1)
120 
121 PDU(ConfirmedPush, "...",
122  TYPE(8, 7)
123  UINTVAR(headers_len, "Length of headers")
124  OCTSTR(headers, "Content type and headers", headers_len)
125  REST(data, "Push data")
126  , 1)
127 
128 PDU(Suspend, "...",
129  TYPE(8, 8)
130  UINTVAR(sessionid, "Session ID")
131  , 1)
132 
133 PDU(Resume, "...",
134  TYPE(8, 9)
135  UINTVAR(sessionid, "Session ID")
136  UINTVAR(capabilities_len, "Length of capabilities")
137  OCTSTR(capabilities, "Reserved capabilities field", capabilities_len)
138  REST(headers, "Session headers")
139  , 1)
140 
141 PDU(sia, "...",
142  UINT(version, "sia version", 8)
143  UINTVAR(appidlist_len, "Length of application id list")
144  OCTSTR(application_id_list, "application id list", appidlist_len)
145  UINTVAR(contactpoints_len, "Length of contact point list")
146  OCTSTR(contactpoints, "list of contact points", contactpoints_len)
147  , 1)
148 
149 
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.