Kannel: Open Source WAP and SMS gateway  $Revision: 5037 $
wap_push_ppg.h
Go to the documentation of this file.
1 /* ====================================================================
2  * The Kannel Software License, Version 1.0
3  *
4  * Copyright (c) 2001-2016 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 /*
58  * Push PPG main module header
59  *
60  * This module implements following Wapforum specifications:
61  * WAP-151-PPGService-19990816-a (called afterwards ppg),
62  * WAP-164-PAP-19991108-a (pap),
63  * WAP-164_100-PAP-20000218-a (pap implementation note).
64  *
65  * We refer following Wapforum specifications:
66  * WAP-145-PushMessage-19990816-a (push message)
67  * WAP-200-WDP-20001212-a (wdp)
68  * WAP-203-WSP-20000504-a (wsp)
69  * WAP-189-PushOTA-20000217-a (ota).
70  *
71  * In addition, rfcs 1521, 2045 and 2617 are referred.
72  *
73  * By Aarno Syvšnen for Wapit Ltd and for Wiral Ltd.
74  */
75 
76 #ifndef WAP_PUSH_PPG_H
77 #define WAP_PUSH_PPG_H
78 
79 #include "wap/wap_events.h"
80 #include "wap/wap.h"
81 #include "wap/wap_addr.h"
82 #include "gwlib/gwlib.h"
83 
86 
87 /*
88  * Enumerations used by PPG main module for PAP attribute, see PPG Services,
89  * Chapter 6.
90  *
91  * Message state
92  */
93 enum {
94  PAP_UNDELIVERABLE, /* general message status */
95  PAP_UNDELIVERABLE1, /* transformation failure */
96  PAP_UNDELIVERABLE2, /* no bearer support */
99  PAP_DELIVERED, /* general message status */
100  PAP_DELIVERED1, /* for unconfirmed push, PPG internal */
101  PAP_DELIVERED2, /* for confirmed push, PPG internal */
105 };
106 
107 /*
108  * PAP protocol status codes used by PPG main module. See Push Access Protocol,
109  * 9.13 and 9.14.
110  */
111 enum {
112  PAP_OK = 1000,
125 };
126 
127 /*
128  * Values for last attribute (it is, is this message last using this bearer).
129  */
130 enum {
133 };
134 
135 /*
136  * Enumerations used by PAP message fields, see Push Access Protocol, Chapter
137  * 9. Default values are the first ones (ones having value 0)
138  *
139  * Simple answer to question is something required or not
140  */
141 enum {
144 };
145 
146 /*
147  * Priority
148  */
149 enum {
153 };
154 
155 /*
156  * Delivery method
157  */
158 enum {
163 };
164 
165 /*
166  * Port number definitions
167  */
168 enum {
173 };
174 
176  #define OCTSTR(name) Octstr *name;
177  #define ADDRTUPLE(name) WAPAddrTuple *name;
178  #define INTEGER(name) long name;
179  #define PUSHMACHINES(name) List *name;
180  #define CAPABILITIES(name) List *name;
181  #define MACHINE(fields) fields
182  #include "wap_ppg_session_machine.def"
183 };
184 
186  #define OCTSTR(name) Octstr *name;
187  #define OPTIONAL_OCTSTR(name) Octstr *name;
188  #define INTEGER(name) long name;
189  #define ADDRTUPLE(name) WAPAddrTuple *name;
190  #define HTTPHEADER(name) List *name;
191  #define CAPABILITIES(name) List *name;
192  #define MACHINE(fields) fields
193  #include "wap_ppg_push_machine.def"
194 };
195 
196 void wap_push_ppg_init(wap_dispatch_func_t *ota_dispatch,
197  wap_dispatch_func_t *appl_dispatch, Cfg *cfg);
198 void wap_push_ppg_shutdown(void);
200 
201 /*
202  * Check do we have established a session with an initiator for this push.
203  * Initiators are identified by their address tuple (ppg main module does not
204  * know wsp sessions until told.
205  */
207 
208 /*
209  * Now iniator are identified by their session id. This function is used after
210  * the session is established.
211  */
213 
214 #endif
PPGSessionMachine * wap_push_ppg_have_push_session_for_sid(long sid)
Definition: wap_push_ppg.c:503
void wap_push_ppg_dispatch_event(WAPEvent *e)
Definition: wap_push_ppg.c:476
Definition: cfg.c:164
void wap_push_ppg_init(wap_dispatch_func_t *ota_dispatch, wap_dispatch_func_t *appl_dispatch, Cfg *cfg)
Definition: wap_push_ppg.c:397
PPGSessionMachine * wap_push_ppg_have_push_session_for(WAPAddrTuple *tuple)
Definition: wap_push_ppg.c:488
static Cfg * cfg
Definition: smsbox.c:115
void wap_push_ppg_shutdown(void)
Definition: wap_push_ppg.c:433
void wap_dispatch_func_t(WAPEvent *event)
Definition: wap.h:85
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.