Kannel: Open Source WAP and SMS gateway  svn-r5335
wap-maps.h
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 /*
58 
59  * gw/wap-maps.h - URL mapping
60 
61  *
62 
63  * Bruno Rodrigues <bruno.rodrigues@litux.org>
64 
65  */
66 
67 
68 
69 /*
70 
71  * Adds a mapping entry to map an url into an (all optional)
72 
73  * - an description name
74 
75  * - new url
76 
77  * - a query-string parameter name to send msisdn, if available
78 
79  * - an header name to send msisdn, if available
80 
81  * - msisdn header format
82 
83  * - accept cookies (1), not accept (0) or use global settings (-1)
84 
85  */
86 
87 void wap_map_add_url(Octstr *name, Octstr *url, Octstr *map_url,
88 
89  Octstr *send_msisdn_query,
90 
91  Octstr *send_msisdn_header,
92 
93  Octstr *send_msisdn_format,
94 
95  int accept_cookies);
96 
97 
98 
99 /*
100 
101  * Adds a mapping entry to map user/pass into a description
102 
103  * name and a msisdn
104 
105  */
106 
108 
109  Octstr *msisdn);
110 
111 
112 
113 /*
114 
115  * Destruction routines
116 
117  */
118 
119 void wap_map_destroy(void);
120 
121 void wap_map_user_destroy(void);
122 
123 
124 
125 /*
126 
127  * Maybe rewrite URL, if there is a mapping. This is where the runtime
128 
129  * lookup comes in (called from further down this file, wsp_http.c)
130 
131  */
132 
133 void wap_map_url(Octstr **osp, Octstr **send_msisdn_query,
134 
135  Octstr **send_msisdn_header,
136 
137  Octstr **send_msisdn_format, int *accept_cookies);
138 
139 
140 
141 /*
142 
143  * Provides a mapping facility for resolving user and pass to an
144 
145  * predefined MSISDN.
146 
147  * Returns 1, if mapping has been found, 0 otherwise.
148 
149  */
150 
152 
153 
154 
155 /*
156 
157  * Called during configuration read, this adds a mapping for the source URL
158 
159  * "DEVICE:home", to the given destination. The mapping is configured
160 
161  * as an in/out prefix mapping.
162 
163  */
164 
165 void wap_map_url_config_device_home(char *to);
166 
167 
168 
169 /*
170 
171  * Called during configuration read, once for each "map-url" statement.
172 
173  * Interprets parameter value as a space-separated two-tuple of src and dst.
174 
175  */
176 
177 void wap_map_url_config(char *s);
178 
179 
180 
181 
182 
void wap_map_url_config(char *s)
Definition: wap-maps.c:185
void wap_map_add_user(Octstr *name, Octstr *user, Octstr *pass, Octstr *msisdn)
Definition: wap-maps.c:136
void wap_map_destroy(void)
Definition: wap-maps.c:152
void wap_map_user_destroy(void)
Definition: wap-maps.c:174
Octstr * msisdn
Definition: wap-maps.c:80
void wap_map_url_config_device_home(char *to)
Definition: wap-maps.c:201
char * name
Definition: smsc_cimd2.c:212
void wap_map_url(Octstr **osp, Octstr **send_msisdn_query, Octstr **send_msisdn_header, Octstr **send_msisdn_format, int *accept_cookies)
Definition: wap-maps.c:208
int wap_map_user(Octstr **msisdn, Octstr *user, Octstr *pass)
Definition: wap-maps.c:268
Definition: octstr.c:118
void wap_map_add_url(Octstr *name, Octstr *url, Octstr *map_url, Octstr *send_msisdn_query, Octstr *send_msisdn_header, Octstr *send_msisdn_format, int accept_cookies)
Definition: wap-maps.c:101
Octstr * user
Definition: wap-maps.c:78
Octstr * pass
Definition: wap-maps.c:79
static Octstr * url
Definition: test_xmlrpc.c:84
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.