1 |
mrness 09/03/01 16:04:24 |
2 |
|
3 |
Added: kannel-1.4.3-custom-wap-ports.patch |
4 |
kannel-1.4.3-external-libuuid.patch |
5 |
kannel-1.4.3-nolex.patch |
6 |
Log: |
7 |
Set LICENSE to Kannel. |
8 |
Version bump. |
9 |
Disable sqlite2 support. |
10 |
Use libuuid installed by e2fsprogs-libs (#252857). |
11 |
(Portage version: 2.1.6.7/cvs/Linux x86_64) |
12 |
|
13 |
Revision Changes Path |
14 |
1.1 app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch |
15 |
|
16 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch?rev=1.1&view=markup |
17 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch?rev=1.1&content-type=text/plain |
18 |
|
19 |
Index: kannel-1.4.3-custom-wap-ports.patch |
20 |
=================================================================== |
21 |
diff -Nru gateway-1.4.3.orig/gw/bb_udp.c gateway-1.4.3/gw/bb_udp.c |
22 |
--- gateway-1.4.3.orig/gw/bb_udp.c 2009-01-12 16:46:56.000000000 +0000 |
23 |
+++ gateway-1.4.3/gw/bb_udp.c 2009-03-01 14:20:38.000000000 +0000 |
24 |
@@ -78,7 +78,7 @@ |
25 |
#include "gwlib/gwlib.h" |
26 |
#include "msg.h" |
27 |
#include "bearerbox.h" |
28 |
- |
29 |
+#include "custports.h" |
30 |
/* passed from bearerbox core */ |
31 |
|
32 |
extern volatile sig_atomic_t bb_status; |
33 |
@@ -352,13 +352,13 @@ |
34 |
while (gwlist_len(ifs) > 0) { |
35 |
iface = gwlist_extract_first(ifs); |
36 |
info(0, "Adding interface %s", octstr_get_cstr(iface)); |
37 |
- add_service(9200, octstr_get_cstr(iface)); /* wsp */ |
38 |
- add_service(9201, octstr_get_cstr(iface)); /* wsp/wtp */ |
39 |
+ add_service(port_wsp, octstr_get_cstr(iface)); /* wsp */ |
40 |
+ add_service(port_wtp, octstr_get_cstr(iface)); /* wsp/wtp */ |
41 |
|
42 |
#ifdef HAVE_WTLS_OPENSSL |
43 |
if (allow_wtls) { |
44 |
- add_service(9202, octstr_get_cstr(iface)); /* wsp/wtls */ |
45 |
- add_service(9203, octstr_get_cstr(iface)); /* wsp/wtp/wtls */ |
46 |
+ add_service(port_wsps, octstr_get_cstr(iface)); /* wsp/wtls */ |
47 |
+ add_service(port_wtps, octstr_get_cstr(iface)); /* wsp/wtp/wtls */ |
48 |
} |
49 |
#else |
50 |
if (allow_wtls) |
51 |
diff -Nru gateway-1.4.3.orig/gw/bearerbox.c gateway-1.4.3/gw/bearerbox.c |
52 |
--- gateway-1.4.3.orig/gw/bearerbox.c 2009-01-12 16:46:56.000000000 +0000 |
53 |
+++ gateway-1.4.3/gw/bearerbox.c 2009-03-01 14:23:05.000000000 +0000 |
54 |
@@ -78,6 +78,7 @@ |
55 |
#include "shared.h" |
56 |
#include "dlr.h" |
57 |
#include "load.h" |
58 |
+#include "custports.h" |
59 |
|
60 |
/* global variables; included to other modules as needed */ |
61 |
|
62 |
@@ -365,6 +366,7 @@ |
63 |
int ssl_enabled = 0; |
64 |
#endif /* HAVE_LIBSSL */ |
65 |
|
66 |
+ ReadCustomPorts(cfg); |
67 |
/* defaults: use localtime and markers for access-log */ |
68 |
lf = m = 1; |
69 |
|
70 |
diff -Nru gateway-1.4.3.orig/gw/custports.c gateway-1.4.3/gw/custports.c |
71 |
--- gateway-1.4.3.orig/gw/custports.c 1970-01-01 00:00:00.000000000 +0000 |
72 |
+++ gateway-1.4.3/gw/custports.c 2009-03-01 14:20:38.000000000 +0000 |
73 |
@@ -0,0 +1,88 @@ |
74 |
+/* ==================================================================== |
75 |
+ * The Kannel Software License, Version 1.0 |
76 |
+ * |
77 |
+ * Copyright (c) 2001-2004 Kannel Group |
78 |
+ * Copyright (c) 1998-2001 WapIT Ltd. |
79 |
+ * All rights reserved. |
80 |
+ * |
81 |
+ * Redistribution and use in source and binary forms, with or without |
82 |
+ * modification, are permitted provided that the following conditions |
83 |
+ * are met: |
84 |
+ * |
85 |
+ * 1. Redistributions of source code must retain the above copyright |
86 |
+ * notice, this list of conditions and the following disclaimer. |
87 |
+ * |
88 |
+ * 2. Redistributions in binary form must reproduce the above copyright |
89 |
+ * notice, this list of conditions and the following disclaimer in |
90 |
+ * the documentation and/or other materials provided with the |
91 |
+ * distribution. |
92 |
+ * |
93 |
+ * 3. The end-user documentation included with the redistribution, |
94 |
+ * if any, must include the following acknowledgment: |
95 |
+ * "This product includes software developed by the |
96 |
+ * Kannel Group (http://www.kannel.org/)." |
97 |
+ * Alternately, this acknowledgment may appear in the software itself, |
98 |
+ * if and wherever such third-party acknowledgments normally appear. |
99 |
+ * |
100 |
+ * 4. The names "Kannel" and "Kannel Group" must not be used to |
101 |
+ * endorse or promote products derived from this software without |
102 |
+ * prior written permission. For written permission, please |
103 |
+ * contact org@××××××.org. |
104 |
+ * |
105 |
+ * 5. Products derived from this software may not be called "Kannel", |
106 |
+ * nor may "Kannel" appear in their name, without prior written |
107 |
+ * permission of the Kannel Group. |
108 |
+ * |
109 |
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
110 |
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
111 |
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
112 |
+ * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS |
113 |
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
114 |
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
115 |
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
116 |
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
117 |
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
118 |
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
119 |
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
120 |
+ * ==================================================================== |
121 |
+ * |
122 |
+ * This software consists of voluntary contributions made by many |
123 |
+ * individuals on behalf of the Kannel Group. For more information on |
124 |
+ * the Kannel Group, please see <http://www.kannel.org/>. |
125 |
+ * |
126 |
+ * Portions of this software are based upon software originally written at |
127 |
+ * WapIT Ltd., Helsinki, Finland for the Kannel project. |
128 |
+ */ |
129 |
+ |
130 |
+/* |
131 |
+ * gw/custports.c |
132 |
+ * |
133 |
+ * Implementation of reading custom UDP ports used by wapbox |
134 |
+ * |
135 |
+ * Lubor Kolar <kolar@××××××.cz>, 14.03.2006 |
136 |
+ */ |
137 |
+ |
138 |
+#include <custports.h> |
139 |
+ |
140 |
+long port_wsp = 9200; // connectionless default |
141 |
+long port_wtp = 9201; // connection-oriented default |
142 |
+long port_wsps = 9202; // connectionless secure default |
143 |
+long port_wtps = 9203; // connection-oriented secure |
144 |
+ |
145 |
+ |
146 |
+void ReadCustomPorts(Cfg *config) |
147 |
+{ |
148 |
+ CfgGroup *grp; |
149 |
+ grp = cfg_get_single_group(config, octstr_imm("wapbox")); |
150 |
+ if(grp == NULL) |
151 |
+ return; |
152 |
+ |
153 |
+ if(cfg_get_integer(&port_wsp, grp, octstr_imm("wsp-port")) != -1) |
154 |
+ info(0, "Using custom WSP port %ld", port_wsp); |
155 |
+ if(cfg_get_integer(&port_wtp, grp, octstr_imm("wtp-port")) != -1) |
156 |
+ info(0, "Using custom WSP/WTP port %ld", port_wtp); |
157 |
+ if(cfg_get_integer(&port_wsps, grp, octstr_imm("wsps-port")) != -1) |
158 |
+ info(0, "Using custom WSP/WTLS port %ld", port_wsps); |
159 |
+ if(cfg_get_integer(&port_wtps, grp, octstr_imm("wtps-port")) != -1) |
160 |
+ info(0, "Using custom WSP/WTP/WTLS port %ld", port_wtps); |
161 |
+} |
162 |
diff -Nru gateway-1.4.3.orig/gw/custports.h gateway-1.4.3/gw/custports.h |
163 |
--- gateway-1.4.3.orig/gw/custports.h 1970-01-01 00:00:00.000000000 +0000 |
164 |
+++ gateway-1.4.3/gw/custports.h 2009-03-01 14:20:38.000000000 +0000 |
165 |
@@ -0,0 +1,77 @@ |
166 |
+/* ==================================================================== |
167 |
+ * The Kannel Software License, Version 1.0 |
168 |
+ * |
169 |
+ * Copyright (c) 2001-2004 Kannel Group |
170 |
+ * Copyright (c) 1998-2001 WapIT Ltd. |
171 |
+ * All rights reserved. |
172 |
+ * |
173 |
+ * Redistribution and use in source and binary forms, with or without |
174 |
+ * modification, are permitted provided that the following conditions |
175 |
+ * are met: |
176 |
+ * |
177 |
+ * 1. Redistributions of source code must retain the above copyright |
178 |
+ * notice, this list of conditions and the following disclaimer. |
179 |
+ * |
180 |
+ * 2. Redistributions in binary form must reproduce the above copyright |
181 |
+ * notice, this list of conditions and the following disclaimer in |
182 |
+ * the documentation and/or other materials provided with the |
183 |
+ * distribution. |
184 |
+ * |
185 |
+ * 3. The end-user documentation included with the redistribution, |
186 |
+ * if any, must include the following acknowledgment: |
187 |
+ * "This product includes software developed by the |
188 |
+ * Kannel Group (http://www.kannel.org/)." |
189 |
+ * Alternately, this acknowledgment may appear in the software itself, |
190 |
+ * if and wherever such third-party acknowledgments normally appear. |
191 |
+ * |
192 |
+ * 4. The names "Kannel" and "Kannel Group" must not be used to |
193 |
+ * endorse or promote products derived from this software without |
194 |
+ * prior written permission. For written permission, please |
195 |
+ * contact org@××××××.org. |
196 |
+ * |
197 |
+ * 5. Products derived from this software may not be called "Kannel", |
198 |
+ * nor may "Kannel" appear in their name, without prior written |
199 |
+ * permission of the Kannel Group. |
200 |
+ * |
201 |
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
202 |
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
203 |
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
204 |
+ * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS |
205 |
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
206 |
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
207 |
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
208 |
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
209 |
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
210 |
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
211 |
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
212 |
+ * ==================================================================== |
213 |
+ * |
214 |
+ * This software consists of voluntary contributions made by many |
215 |
+ * individuals on behalf of the Kannel Group. For more information on |
216 |
+ * the Kannel Group, please see <http://www.kannel.org/>. |
217 |
+ * |
218 |
+ * Portions of this software are based upon software originally written at |
219 |
+ * WapIT Ltd., Helsinki, Finland for the Kannel project. |
220 |
+ */ |
221 |
+ |
222 |
+/* |
223 |
+ * gw/custports.h |
224 |
+ * |
225 |
+ * Implementation of wapbox custom UDP ports) |
226 |
+ * |
227 |
+ * Lubor Kolar <kolar@××××××.cz>, 14.03.2006 |
228 |
+ */ |
229 |
+ |
230 |
+#ifndef CUSTPORTS_H |
231 |
+#define CUSTPORTS_H |
232 |
+ |
233 |
+#include "gwlib/gwlib.h" |
234 |
+ |
235 |
+extern long port_wsp; // connectionless |
236 |
+extern long port_wtp; // connection-oriented |
237 |
+extern long port_wsps; // connectionless secure |
238 |
+extern long port_wtps; // connection-oriented secure |
239 |
+ |
240 |
+void ReadCustomPorts(Cfg *config); |
241 |
+#endif /* CUSTPORTS_H */ |
242 |
+ |
243 |
diff -Nru gateway-1.4.3.orig/gw/wapbox.c gateway-1.4.3/gw/wapbox.c |
244 |
--- gateway-1.4.3.orig/gw/wapbox.c 2009-01-12 16:46:57.000000000 +0000 |
245 |
+++ gateway-1.4.3/gw/wapbox.c 2009-03-01 14:20:38.000000000 +0000 |
246 |
@@ -84,17 +84,11 @@ |
247 |
#include "gwlib/pki.h" |
248 |
#endif |
249 |
#include "radius/radius_acct.h" |
250 |
+#include "custports.h" |
251 |
|
252 |
static void config_reload(int reload); |
253 |
static long logfilelevel=-1; |
254 |
|
255 |
-enum { |
256 |
- CONNECTIONLESS_PORT = 9200, |
257 |
- CONNECTION_ORIENTED_PORT = 9201, |
258 |
- WTLS_CONNECTIONLESS_PORT = 9202, |
259 |
- WTLS_CONNECTION_ORIENTED_PORT = 9203 |
260 |
-}; |
261 |
- |
262 |
enum { DEFAULT_TIMER_FREQ = 1}; |
263 |
|
264 |
static Octstr *bearerbox_host; |
265 |
@@ -131,6 +125,8 @@ |
266 |
|
267 |
cfg_dump(cfg); |
268 |
|
269 |
+ ReadCustomPorts(cfg); |
270 |
+ |
271 |
/* |
272 |
* Extract info from the core group. |
273 |
*/ |
274 |
@@ -776,9 +772,9 @@ |
275 |
* XXXX here should be suspend/resume, add RSN |
276 |
*/ |
277 |
} else if (msg_type(msg) == wdp_datagram) { |
278 |
- switch (msg->wdp_datagram.destination_port) { |
279 |
- case CONNECTIONLESS_PORT: |
280 |
- case CONNECTION_ORIENTED_PORT: |
281 |
+ if(msg->wdp_datagram.destination_port == port_wsp |
282 |
+ || msg->wdp_datagram.destination_port == port_wtp) |
283 |
+ { |
284 |
dgram = wap_event_create(T_DUnitdata_Ind); |
285 |
dgram->u.T_DUnitdata_Ind.addr_tuple = wap_addr_tuple_create( |
286 |
msg->wdp_datagram.source_address, |
287 |
@@ -789,19 +785,22 @@ |
288 |
msg->wdp_datagram.user_data = NULL; |
289 |
|
290 |
wap_dispatch_datagram(dgram); |
291 |
- break; |
292 |
- case WTLS_CONNECTIONLESS_PORT: |
293 |
- case WTLS_CONNECTION_ORIENTED_PORT: |
294 |
+ } |
295 |
+ else |
296 |
+ if(msg->wdp_datagram.destination_port == port_wsps |
297 |
+ || msg->wdp_datagram.destination_port == port_wtps) |
298 |
+ { |
299 |
#if (HAVE_WTLS_OPENSSL) |
300 |
dgram = wtls_unpack_wdp_datagram(msg); |
301 |
if (dgram != NULL) |
302 |
wtls_dispatch_event(dgram); |
303 |
#endif |
304 |
- break; |
305 |
- default: |
306 |
+ } |
307 |
+ else |
308 |
+ { |
309 |
panic(0,"Bad packet received! This shouldn't happen!"); |
310 |
break; |
311 |
- } |
312 |
+ } |
313 |
} else { |
314 |
warning(0, "Received other message than wdp/admin, ignoring!"); |
315 |
} |
316 |
diff -Nru gateway-1.4.3.orig/gw/wap_push_ppg.c gateway-1.4.3/gw/wap_push_ppg.c |
317 |
--- gateway-1.4.3.orig/gw/wap_push_ppg.c 2009-01-12 16:46:56.000000000 +0000 |
318 |
+++ gateway-1.4.3/gw/wap_push_ppg.c 2009-03-01 14:20:38.000000000 +0000 |
319 |
@@ -88,6 +88,7 @@ |
320 |
#include "wap_push_pap_compiler.h" |
321 |
#include "wap_push_pap_mime.h" |
322 |
#include "wap_push_ppg_pushuser.h" |
323 |
+#include "custports.h" |
324 |
|
325 |
enum { |
326 |
TIME_EXPIRED = 0, |
327 |
@@ -1779,10 +1780,10 @@ |
328 |
|
329 |
if (!cless_accepted) { |
330 |
cliport = CONNECTED_CLIPORT; |
331 |
- servport = CONNECTED_SERVPORT; |
332 |
+ servport = port_wtp; |
333 |
} else { |
334 |
cliport = CONNECTIONLESS_PUSH_CLIPORT; |
335 |
- servport = CONNECTIONLESS_SERVPORT; |
336 |
+ servport = port_wsp; |
337 |
} |
338 |
|
339 |
address_type = (**e).u.Push_Message.address_type; |
340 |
diff -Nru gateway-1.4.3.orig/gw/wap_push_ppg.h gateway-1.4.3/gw/wap_push_ppg.h |
341 |
--- gateway-1.4.3.orig/gw/wap_push_ppg.h 2009-01-12 16:46:57.000000000 +0000 |
342 |
+++ gateway-1.4.3/gw/wap_push_ppg.h 2009-03-01 14:20:38.000000000 +0000 |
343 |
@@ -167,9 +167,7 @@ |
344 |
*/ |
345 |
enum { |
346 |
CONNECTIONLESS_PUSH_CLIPORT = 2948, |
347 |
- CONNECTIONLESS_SERVPORT = 9200, |
348 |
CONNECTED_CLIPORT = 9209, |
349 |
- CONNECTED_SERVPORT = 9201 |
350 |
}; |
351 |
|
352 |
struct PPGSessionMachine { |
353 |
diff -Nru gateway-1.4.3.orig/gwlib/cfg.def gateway-1.4.3/gwlib/cfg.def |
354 |
--- gateway-1.4.3.orig/gwlib/cfg.def 2009-01-12 16:46:55.000000000 +0000 |
355 |
+++ gateway-1.4.3/gwlib/cfg.def 2009-03-01 14:20:38.000000000 +0000 |
356 |
@@ -159,6 +159,10 @@ |
357 |
OCTSTR(concatenation) |
358 |
OCTSTR(max-messages) |
359 |
OCTSTR(wml-strict) |
360 |
+ OCTSTR(wsp-port) |
361 |
+ OCTSTR(wtp-port) |
362 |
+ OCTSTR(wsps-port) |
363 |
+ OCTSTR(wtps-port) |
364 |
) |
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
1.1 app-mobilephone/kannel/files/kannel-1.4.3-external-libuuid.patch |
371 |
|
372 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-external-libuuid.patch?rev=1.1&view=markup |
373 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-external-libuuid.patch?rev=1.1&content-type=text/plain |
374 |
|
375 |
Index: kannel-1.4.3-external-libuuid.patch |
376 |
=================================================================== |
377 |
diff -Nru gateway-1.4.3.orig/configure.in gateway-1.4.3/configure.in |
378 |
--- gateway-1.4.3.orig/configure.in 2009-03-01 14:42:03.000000000 +0000 |
379 |
+++ gateway-1.4.3/configure.in 2009-03-01 15:06:37.000000000 +0000 |
380 |
@@ -173,6 +173,9 @@ |
381 |
AC_ARG_WITH(libs, |
382 |
[ --with-libs=FLAGS use FLAGS for extra libraries], |
383 |
LIBS="$LIBS $withval") |
384 |
+CFLAGS="$CFLAGS -I/usr/include/uuid" |
385 |
+LIBS="$LIBS -luuid" |
386 |
+ |
387 |
|
388 |
dnl Check whether compiler supports inline |
389 |
AC_C_INLINE |
390 |
@@ -1226,7 +1229,7 @@ |
391 |
dnl Final Output |
392 |
|
393 |
AC_CONFIG_SECTION([Generating output files]) |
394 |
-AC_OUTPUT(gwlib/gw_uuid_types.h Makefile) |
395 |
+AC_OUTPUT(Makefile) |
396 |
|
397 |
|
398 |
dnl LICENSE notice |
399 |
diff -Nru gateway-1.4.3.orig/gwlib/gwlib.c gateway-1.4.3/gwlib/gwlib.c |
400 |
--- gateway-1.4.3.orig/gwlib/gwlib.c 2009-01-12 16:46:54.000000000 +0000 |
401 |
+++ gateway-1.4.3/gwlib/gwlib.c 2009-03-01 15:01:36.000000000 +0000 |
402 |
@@ -79,7 +79,6 @@ |
403 |
{ |
404 |
gw_assert(!init); |
405 |
gw_init_mem(); |
406 |
- uuid_init(); |
407 |
octstr_init(); |
408 |
gwlib_protected_init(); |
409 |
gwthread_init(); |
410 |
@@ -100,7 +99,6 @@ |
411 |
gwthread_shutdown(); |
412 |
octstr_shutdown(); |
413 |
gwlib_protected_shutdown(); |
414 |
- uuid_shutdown(); |
415 |
cfg_shutdown(); |
416 |
gw_check_leaks(); |
417 |
log_shutdown(); |
418 |
diff -Nru gateway-1.4.3.orig/gwlib/gwlib.h gateway-1.4.3/gwlib/gwlib.h |
419 |
--- gateway-1.4.3.orig/gwlib/gwlib.h 2009-01-12 16:46:55.000000000 +0000 |
420 |
+++ gateway-1.4.3/gwlib/gwlib.h 2009-03-01 15:01:56.000000000 +0000 |
421 |
@@ -100,10 +100,12 @@ |
422 |
#include "semaphore.h" |
423 |
#include "xmlrpc.h" |
424 |
#include "md5.h" |
425 |
-#include "gw_uuid.h" |
426 |
+#include <uuid.h> |
427 |
#include "gw-rwlock.h" |
428 |
#include "gw-prioqueue.h" |
429 |
|
430 |
+#define UUID_STR_LEN 36 |
431 |
+ |
432 |
void gwlib_assert_init(void); |
433 |
void gwlib_init(void); |
434 |
void gwlib_shutdown(void); |
435 |
diff -Nru gateway-1.4.3.orig/gwlib/gw_uuid.c gateway-1.4.3/gwlib/gw_uuid.c |
436 |
--- gateway-1.4.3.orig/gwlib/gw_uuid.c 2004-01-05 16:37:10.000000000 +0000 |
437 |
+++ gateway-1.4.3/gwlib/gw_uuid.c 1970-01-01 00:00:00.000000000 +0000 |
438 |
@@ -1,632 +0,0 @@ |
439 |
-/* |
440 |
- * clear.c -- Clear a UUID |
441 |
- * |
442 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
443 |
- * |
444 |
- * %Begin-Header% |
445 |
- * This file may be redistributed under the terms of the GNU |
446 |
- * Library General Public License. |
447 |
- * %End-Header% |
448 |
- */ |
449 |
- |
450 |
-/* |
451 |
- * Force inclusion of SVID stuff since we need it if we're compiling in |
452 |
- * gcc-wall wall mode |
453 |
- */ |
454 |
-#ifndef _SVID_SOURCE |
455 |
-#define _SVID_SOURCE |
456 |
-#endif |
457 |
- |
458 |
-#include "gw-config.h" |
459 |
- |
460 |
-#ifdef HAVE_UNISTD_H |
461 |
-#include <unistd.h> |
462 |
-#endif |
463 |
-#ifdef HAVE_STDLIB_H |
464 |
-#include <stdlib.h> |
465 |
-#endif |
466 |
-#include <string.h> |
467 |
-#include <ctype.h> |
468 |
-#include <fcntl.h> |
469 |
-#include <errno.h> |
470 |
-#include <sys/types.h> |
471 |
-#include <sys/time.h> |
472 |
-#include <sys/stat.h> |
473 |
-#include <sys/file.h> |
474 |
-#ifdef HAVE_SYS_IOCTL_H |
475 |
-#include <sys/ioctl.h> |
476 |
-#endif |
477 |
-#ifdef HAVE_SYS_SOCKET_H |
478 |
-#include <sys/socket.h> |
479 |
-#endif |
480 |
-#ifdef HAVE_SYS_SOCKIO_H |
481 |
-#include <sys/sockio.h> |
482 |
-#endif |
483 |
-#ifdef HAVE_NET_IF_H |
484 |
-#include <net/if.h> |
485 |
-#endif |
486 |
-#ifdef HAVE_NETINET_IN_H |
487 |
-#include <netinet/in.h> |
488 |
-#endif |
489 |
-#include <stdio.h> |
490 |
- |
491 |
-#include "gwlib/gw_uuid_types.h" |
492 |
-#include "gwlib/gw_uuid.h" |
493 |
- |
494 |
-/* |
495 |
- * Offset between 15-Oct-1582 and 1-Jan-70 |
496 |
- */ |
497 |
-#define TIME_OFFSET_HIGH 0x01B21DD2 |
498 |
-#define TIME_OFFSET_LOW 0x13814000 |
499 |
- |
500 |
-struct uuid { |
501 |
- __u32 time_low; |
502 |
- __u16 time_mid; |
503 |
- __u16 time_hi_and_version; |
504 |
- __u16 clock_seq; |
505 |
- __u8 node[6]; |
506 |
-}; |
507 |
- |
508 |
- |
509 |
-/* |
510 |
- * prototypes |
511 |
- */ |
512 |
-static void uuid_pack(const struct uuid *uu, uuid_t ptr); |
513 |
-static void uuid_unpack(const uuid_t in, struct uuid *uu); |
514 |
-static int get_random_fd(void); |
515 |
- |
516 |
- |
517 |
-#ifdef HAVE_SRANDOM |
518 |
-#define srand(x) srandom(x) |
519 |
-#define rand() random() |
520 |
-#endif |
521 |
- |
522 |
- |
523 |
- |
524 |
-void uuid_init(void) |
525 |
-{ |
526 |
- /* |
527 |
- * open random device if any. |
528 |
- * We should do it here because otherwise it's |
529 |
- * possible that we open device twice. |
530 |
- */ |
531 |
- get_random_fd(); |
532 |
-} |
533 |
- |
534 |
- |
535 |
-void uuid_shutdown(void) |
536 |
-{ |
537 |
- int fd = get_random_fd(); |
538 |
- |
539 |
- if (fd > 0) |
540 |
- close(fd); |
541 |
-} |
542 |
- |
543 |
-void uuid_clear(uuid_t uu) |
544 |
-{ |
545 |
- memset(uu, 0, 16); |
546 |
-} |
547 |
- |
548 |
-/* |
549 |
- * compare.c --- compare whether or not two UUID's are the same |
550 |
- * |
551 |
- * Returns an integer less than, equal to, or greater than zero if |
552 |
- * uu1 respectively, to be less than, to match, or be greater than |
553 |
- * uu2. |
554 |
- * |
555 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
556 |
- * |
557 |
- * %Begin-Header% |
558 |
- * This file may be redistributed under the terms of the GNU |
559 |
- * Library General Public License. |
560 |
- * %End-Header% |
561 |
- */ |
562 |
-#define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1); |
563 |
- |
564 |
-int uuid_compare(const uuid_t uu1, const uuid_t uu2) |
565 |
-{ |
566 |
- struct uuid uuid1, uuid2; |
567 |
- |
568 |
- uuid_unpack(uu1, &uuid1); |
569 |
- uuid_unpack(uu2, &uuid2); |
570 |
- |
571 |
- UUCMP(uuid1.time_low, uuid2.time_low); |
572 |
- UUCMP(uuid1.time_mid, uuid2.time_mid); |
573 |
- UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version); |
574 |
- UUCMP(uuid1.clock_seq, uuid2.clock_seq); |
575 |
- return memcmp(uuid1.node, uuid2.node, 6); |
576 |
-} |
577 |
- |
578 |
-/* |
579 |
- * copy.c --- copy UUIDs |
580 |
- * |
581 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
582 |
- * |
583 |
- * %Begin-Header% |
584 |
- * This file may be redistributed under the terms of the GNU |
585 |
- * Library General Public License. |
586 |
- * %End-Header% |
587 |
- */ |
588 |
-void uuid_copy(uuid_t dst, const uuid_t src) |
589 |
-{ |
590 |
- unsigned char *cp1; |
591 |
- const unsigned char *cp2; |
592 |
- int i; |
593 |
- |
594 |
- for (i=0, cp1 = dst, cp2 = src; i < 16; i++) |
595 |
- *cp1++ = *cp2++; |
596 |
-} |
597 |
- |
598 |
- |
599 |
-/* |
600 |
- * gen_uuid.c --- generate a DCE-compatible uuid |
601 |
- * |
602 |
- * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. |
603 |
- * |
604 |
- * %Begin-Header% |
605 |
- * This file may be redistributed under the terms of the GNU |
606 |
- * Library General Public License. |
607 |
- * %End-Header% |
608 |
- */ |
609 |
-static int get_random_fd(void) |
610 |
-{ |
611 |
- struct timeval tv; |
612 |
- static int fd = -2; |
613 |
- int i; |
614 |
- |
615 |
- if (fd == -2) { |
616 |
- gettimeofday(&tv, 0); |
617 |
- fd = open("/dev/urandom", O_RDONLY); |
618 |
- if (fd == -1) |
619 |
- fd = open("/dev/random", O_RDONLY | O_NONBLOCK); |
620 |
- srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); |
621 |
- } |
622 |
- /* Crank the random number generator a few times */ |
623 |
- gettimeofday(&tv, 0); |
624 |
- for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) |
625 |
- rand(); |
626 |
- |
627 |
- return fd; |
628 |
-} |
629 |
- |
630 |
- |
631 |
-/* |
632 |
- * Generate a series of random bytes. Use /dev/urandom if possible, |
633 |
- * and if not, use srandom/random. |
634 |
- */ |
635 |
-static void get_random_bytes(void *buf, int nbytes) |
636 |
-{ |
637 |
- int i, n = nbytes, fd = get_random_fd(); |
638 |
- int lose_counter = 0; |
639 |
- unsigned char *cp = (unsigned char *) buf; |
640 |
- |
641 |
- if (fd >= 0) { |
642 |
- while (n > 0) { |
643 |
- i = read(fd, cp, n); |
644 |
- if (i <= 0) { |
645 |
- if (lose_counter++ > 16) |
646 |
- break; |
647 |
- continue; |
648 |
- } |
649 |
- n -= i; |
650 |
- cp += i; |
651 |
- lose_counter = 0; |
652 |
- } |
653 |
- } |
654 |
- |
655 |
- /* |
656 |
- * We do this all the time, but this is the only source of |
657 |
- * randomness if /dev/random/urandom is out to lunch. |
658 |
- */ |
659 |
- for (cp = buf, i = 0; i < nbytes; i++) |
660 |
- *cp++ ^= (rand() >> 7) & 0xFF; |
661 |
- return; |
662 |
-} |
663 |
- |
664 |
-/* |
665 |
- * Get the ethernet hardware address, if we can find it... |
666 |
- */ |
667 |
-static int get_node_id(unsigned char *node_id) |
668 |
-{ |
669 |
-#ifdef HAVE_NET_IF_H |
670 |
- int sd; |
671 |
- struct ifreq ifr, *ifrp; |
672 |
- struct ifconf ifc; |
673 |
- char buf[1024]; |
674 |
- int n, i; |
675 |
- unsigned char *a; |
676 |
- |
677 |
-/* |
678 |
- * BSD 4.4 defines the size of an ifreq to be |
679 |
- * max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len |
680 |
- * However, under earlier systems, sa_len isn't present, so the size is |
681 |
- * just sizeof(struct ifreq) |
682 |
- */ |
683 |
-#ifdef HAVE_SA_LEN |
684 |
-#ifndef max |
685 |
-#define max(a,b) ((a) > (b) ? (a) : (b)) |
686 |
-#endif |
687 |
-#define ifreq_size(i) max(sizeof(struct ifreq),\ |
688 |
- sizeof((i).ifr_name)+(i).ifr_addr.sa_len) |
689 |
-#else |
690 |
-#define ifreq_size(i) sizeof(struct ifreq) |
691 |
-#endif /* HAVE_SA_LEN*/ |
692 |
- |
693 |
- sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); |
694 |
- if (sd < 0) { |
695 |
- return -1; |
696 |
- } |
697 |
- memset(buf, 0, sizeof(buf)); |
698 |
- ifc.ifc_len = sizeof(buf); |
699 |
- ifc.ifc_buf = buf; |
700 |
- if (ioctl (sd, SIOCGIFCONF, (char *)&ifc) < 0) { |
701 |
- close(sd); |
702 |
- return -1; |
703 |
- } |
704 |
- n = ifc.ifc_len; |
705 |
- for (i = 0; i < n; i+= ifreq_size(*ifr) ) { |
706 |
- ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); |
707 |
- strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); |
708 |
-#ifdef SIOCGIFHWADDR |
709 |
- if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) |
710 |
- continue; |
711 |
- a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; |
712 |
-#else |
713 |
-#ifdef SIOCGENADDR |
714 |
- if (ioctl(sd, SIOCGENADDR, &ifr) < 0) |
715 |
- continue; |
716 |
- a = (unsigned char *) ifr.ifr_enaddr; |
717 |
-#else |
718 |
- /* |
719 |
- * XXX we don't have a way of getting the hardware |
720 |
- * address |
721 |
- */ |
722 |
- close(sd); |
723 |
- return 0; |
724 |
-#endif /* SIOCGENADDR */ |
725 |
-#endif /* SIOCGIFHWADDR */ |
726 |
- if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) |
727 |
- continue; |
728 |
- if (node_id) { |
729 |
- memcpy(node_id, a, 6); |
730 |
- close(sd); |
731 |
- return 1; |
732 |
- } |
733 |
- } |
734 |
- close(sd); |
735 |
-#endif |
736 |
- return 0; |
737 |
-} |
738 |
- |
739 |
-/* Assume that the gettimeofday() has microsecond granularity */ |
740 |
-#define MAX_ADJUSTMENT 10 |
741 |
- |
742 |
-static int get_clock(__u32 *clock_high, __u32 *clock_low, __u16 *ret_clock_seq) |
743 |
-{ |
744 |
- static int adjustment = 0; |
745 |
- static struct timeval last = {0, 0}; |
746 |
- static __u16 clock_seq; |
747 |
- struct timeval tv; |
748 |
- unsigned long long clock_reg; |
749 |
- |
750 |
-try_again: |
751 |
- gettimeofday(&tv, 0); |
752 |
- if ((last.tv_sec == 0) && (last.tv_usec == 0)) { |
753 |
- get_random_bytes(&clock_seq, sizeof(clock_seq)); |
754 |
- clock_seq &= 0x1FFF; |
755 |
- last = tv; |
756 |
- last.tv_sec--; |
757 |
- } |
758 |
- if ((tv.tv_sec < last.tv_sec) || |
759 |
- ((tv.tv_sec == last.tv_sec) && |
760 |
- (tv.tv_usec < last.tv_usec))) { |
761 |
- clock_seq = (clock_seq+1) & 0x1FFF; |
762 |
- adjustment = 0; |
763 |
- last = tv; |
764 |
- } else if ((tv.tv_sec == last.tv_sec) && |
765 |
- (tv.tv_usec == last.tv_usec)) { |
766 |
- if (adjustment >= MAX_ADJUSTMENT) |
767 |
- goto try_again; |
768 |
- adjustment++; |
769 |
- } else { |
770 |
- adjustment = 0; |
771 |
- last = tv; |
772 |
- } |
773 |
- |
774 |
- clock_reg = tv.tv_usec*10 + adjustment; |
775 |
- clock_reg += ((unsigned long long) tv.tv_sec)*10000000; |
776 |
- clock_reg += (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; |
777 |
- |
778 |
- *clock_high = clock_reg >> 32; |
779 |
- *clock_low = clock_reg; |
780 |
- *ret_clock_seq = clock_seq; |
781 |
- return 0; |
782 |
-} |
783 |
- |
784 |
-void uuid_generate_time(uuid_t out) |
785 |
-{ |
786 |
- static unsigned char node_id[6]; |
787 |
- static int has_init = 0; |
788 |
- struct uuid uu; |
789 |
- __u32 clock_mid; |
790 |
- |
791 |
- if (!has_init) { |
792 |
- if (get_node_id(node_id) <= 0) { |
793 |
- get_random_bytes(node_id, 6); |
794 |
- /* |
795 |
- * Set multicast bit, to prevent conflicts |
796 |
- * with IEEE 802 addresses obtained from |
797 |
- * network cards |
798 |
- */ |
799 |
- node_id[0] |= 0x80; |
800 |
- } |
801 |
- has_init = 1; |
802 |
- } |
803 |
- get_clock(&clock_mid, &uu.time_low, &uu.clock_seq); |
804 |
- uu.clock_seq |= 0x8000; |
805 |
- uu.time_mid = (__u16) clock_mid; |
806 |
- uu.time_hi_and_version = (clock_mid >> 16) | 0x1000; |
807 |
- memcpy(uu.node, node_id, 6); |
808 |
- uuid_pack(&uu, out); |
809 |
-} |
810 |
- |
811 |
-void uuid_generate_random(uuid_t out) |
812 |
-{ |
813 |
- uuid_t buf; |
814 |
- struct uuid uu; |
815 |
- |
816 |
- get_random_bytes(buf, sizeof(buf)); |
817 |
- uuid_unpack(buf, &uu); |
818 |
- |
819 |
- uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; |
820 |
- uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000; |
821 |
- uuid_pack(&uu, out); |
822 |
-} |
823 |
- |
824 |
-/* |
825 |
- * This is the generic front-end to uuid_generate_random and |
826 |
- * uuid_generate_time. It uses uuid_generate_random only if |
827 |
- * /dev/urandom is available, since otherwise we won't have |
828 |
- * high-quality randomness. |
829 |
- */ |
830 |
-void uuid_generate(uuid_t out) |
831 |
-{ |
832 |
- if (get_random_fd() >= 0) { |
833 |
- uuid_generate_random(out); |
834 |
- } |
835 |
- else |
836 |
- uuid_generate_time(out); |
837 |
-} |
838 |
- |
839 |
-/* |
840 |
- * isnull.c --- Check whether or not the UUID is null |
841 |
- * |
842 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
843 |
- * |
844 |
- * %Begin-Header% |
845 |
- * This file may be redistributed under the terms of the GNU |
846 |
- * Library General Public License. |
847 |
- * %End-Header% |
848 |
- */ |
849 |
-/* Returns 1 if the uuid is the NULL uuid */ |
850 |
-int uuid_is_null(const uuid_t uu) |
851 |
-{ |
852 |
- const unsigned char *cp; |
853 |
- int i; |
854 |
- |
855 |
- for (i=0, cp = uu; i < 16; i++) |
856 |
- if (*cp++) |
857 |
- return 0; |
858 |
- return 1; |
859 |
-} |
860 |
- |
861 |
-/* |
862 |
- * Internal routine for packing UUID's |
863 |
- * |
864 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
865 |
- * |
866 |
- * %Begin-Header% |
867 |
- * This file may be redistributed under the terms of the GNU |
868 |
- * Library General Public License. |
869 |
- * %End-Header% |
870 |
- */ |
871 |
-void uuid_pack(const struct uuid *uu, uuid_t ptr) |
872 |
-{ |
873 |
- __u32 tmp; |
874 |
- unsigned char *out = ptr; |
875 |
- |
876 |
- tmp = uu->time_low; |
877 |
- out[3] = (unsigned char) tmp; |
878 |
- tmp >>= 8; |
879 |
- out[2] = (unsigned char) tmp; |
880 |
- tmp >>= 8; |
881 |
- out[1] = (unsigned char) tmp; |
882 |
- tmp >>= 8; |
883 |
- out[0] = (unsigned char) tmp; |
884 |
- |
885 |
- tmp = uu->time_mid; |
886 |
- out[5] = (unsigned char) tmp; |
887 |
- tmp >>= 8; |
888 |
- out[4] = (unsigned char) tmp; |
889 |
- |
890 |
- tmp = uu->time_hi_and_version; |
891 |
- out[7] = (unsigned char) tmp; |
892 |
- tmp >>= 8; |
893 |
- out[6] = (unsigned char) tmp; |
894 |
- |
895 |
- tmp = uu->clock_seq; |
896 |
- out[9] = (unsigned char) tmp; |
897 |
- tmp >>= 8; |
898 |
- out[8] = (unsigned char) tmp; |
899 |
- |
900 |
- memcpy(out+10, uu->node, 6); |
901 |
-} |
902 |
- |
903 |
-/* |
904 |
- * parse.c --- UUID parsing |
905 |
- * |
906 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
907 |
- * |
908 |
- * %Begin-Header% |
909 |
- * This file may be redistributed under the terms of the GNU |
910 |
- * Library General Public License. |
911 |
- * %End-Header% |
912 |
- */ |
913 |
-int uuid_parse(const char *in, uuid_t uu) |
914 |
-{ |
915 |
- struct uuid uuid; |
916 |
- int i; |
917 |
- const char *cp; |
918 |
- char buf[3]; |
919 |
- |
920 |
- if (strlen(in) != 36) |
921 |
- return -1; |
922 |
- for (i=0, cp = in; i <= 36; i++,cp++) { |
923 |
- if ((i == 8) || (i == 13) || (i == 18) || |
924 |
- (i == 23)) { |
925 |
- if (*cp == '-') |
926 |
- continue; |
927 |
- else |
928 |
- return -1; |
929 |
- } |
930 |
- if (i== 36) |
931 |
- if (*cp == 0) |
932 |
- continue; |
933 |
- if (!isxdigit(*cp)) |
934 |
- return -1; |
935 |
- } |
936 |
- uuid.time_low = strtoul(in, NULL, 16); |
937 |
- uuid.time_mid = strtoul(in+9, NULL, 16); |
938 |
- uuid.time_hi_and_version = strtoul(in+14, NULL, 16); |
939 |
- uuid.clock_seq = strtoul(in+19, NULL, 16); |
940 |
- cp = in+24; |
941 |
- buf[2] = 0; |
942 |
- for (i=0; i < 6; i++) { |
943 |
- buf[0] = *cp++; |
944 |
- buf[1] = *cp++; |
945 |
- uuid.node[i] = strtoul(buf, NULL, 16); |
946 |
- } |
947 |
- |
948 |
- uuid_pack(&uuid, uu); |
949 |
- return 0; |
950 |
-} |
951 |
- |
952 |
- |
953 |
-/* |
954 |
- * Internal routine for unpacking UUID |
955 |
- * |
956 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
957 |
- * |
958 |
- * %Begin-Header% |
959 |
- * This file may be redistributed under the terms of the GNU |
960 |
- * Library General Public License. |
961 |
- * %End-Header% |
962 |
- */ |
963 |
-void uuid_unpack(const uuid_t in, struct uuid *uu) |
964 |
-{ |
965 |
- const __u8 *ptr = in; |
966 |
- __u32 tmp; |
967 |
- |
968 |
- tmp = *ptr++; |
969 |
- tmp = (tmp << 8) | *ptr++; |
970 |
- tmp = (tmp << 8) | *ptr++; |
971 |
- tmp = (tmp << 8) | *ptr++; |
972 |
- uu->time_low = tmp; |
973 |
- |
974 |
- tmp = *ptr++; |
975 |
- tmp = (tmp << 8) | *ptr++; |
976 |
- uu->time_mid = tmp; |
977 |
- |
978 |
- tmp = *ptr++; |
979 |
- tmp = (tmp << 8) | *ptr++; |
980 |
- uu->time_hi_and_version = tmp; |
981 |
- |
982 |
- tmp = *ptr++; |
983 |
- tmp = (tmp << 8) | *ptr++; |
984 |
- uu->clock_seq = tmp; |
985 |
- |
986 |
- memcpy(uu->node, ptr, 6); |
987 |
-} |
988 |
- |
989 |
-/* |
990 |
- * unparse.c -- convert a UUID to string |
991 |
- * |
992 |
- * Copyright (C) 1996, 1997 Theodore Ts'o. |
993 |
- * |
994 |
- * %Begin-Header% |
995 |
- * This file may be redistributed under the terms of the GNU |
996 |
- * Library General Public License. |
997 |
- * %End-Header% |
998 |
- */ |
999 |
-void uuid_unparse(const uuid_t uu, char *out) |
1000 |
-{ |
1001 |
- struct uuid uuid; |
1002 |
- |
1003 |
- uuid_unpack(uu, &uuid); |
1004 |
- sprintf(out, |
1005 |
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", |
1006 |
- uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, |
1007 |
- uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, |
1008 |
- uuid.node[0], uuid.node[1], uuid.node[2], |
1009 |
- uuid.node[3], uuid.node[4], uuid.node[5]); |
1010 |
-} |
1011 |
- |
1012 |
-/* |
1013 |
- * uuid_time.c --- Interpret the time field from a uuid. This program |
1014 |
- * violates the UUID abstraction barrier by reaching into the guts |
1015 |
- * of a UUID and interpreting it. |
1016 |
- * |
1017 |
- * Copyright (C) 1998, 1999 Theodore Ts'o. |
1018 |
- * |
1019 |
- * %Begin-Header% |
1020 |
- * This file may be redistributed under the terms of the GNU |
1021 |
- * Library General Public License. |
1022 |
- * %End-Header% |
1023 |
- */ |
1024 |
-time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) |
1025 |
-{ |
1026 |
- struct uuid uuid; |
1027 |
- __u32 high; |
1028 |
- struct timeval tv; |
1029 |
- unsigned long long clock_reg; |
1030 |
- |
1031 |
- uuid_unpack(uu, &uuid); |
1032 |
- |
1033 |
- high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); |
1034 |
- clock_reg = uuid.time_low | ((unsigned long long) high << 32); |
1035 |
- |
1036 |
- clock_reg -= (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; |
1037 |
- tv.tv_sec = clock_reg / 10000000; |
1038 |
- tv.tv_usec = (clock_reg % 10000000) / 10; |
1039 |
- |
1040 |
- if (ret_tv) |
1041 |
- *ret_tv = tv; |
1042 |
- |
1043 |
- return tv.tv_sec; |
1044 |
-} |
1045 |
- |
1046 |
-int uuid_type(const uuid_t uu) |
1047 |
-{ |
1048 |
- struct uuid uuid; |
1049 |
- |
1050 |
- uuid_unpack(uu, &uuid); |
1051 |
- return ((uuid.time_hi_and_version >> 12) & 0xF); |
1052 |
-} |
1053 |
- |
1054 |
-int uuid_variant(const uuid_t uu) |
1055 |
-{ |
1056 |
- struct uuid uuid; |
1057 |
- int var; |
1058 |
- |
1059 |
- uuid_unpack(uu, &uuid); |
1060 |
- var = uuid.clock_seq; |
1061 |
- |
1062 |
- if ((var & 0x8000) == 0) |
1063 |
- return UUID_VARIANT_NCS; |
1064 |
- if ((var & 0x4000) == 0) |
1065 |
- return UUID_VARIANT_DCE; |
1066 |
- if ((var & 0x2000) == 0) |
1067 |
- return UUID_VARIANT_MICROSOFT; |
1068 |
- return UUID_VARIANT_OTHER; |
1069 |
-} |
1070 |
- |
1071 |
diff -Nru gateway-1.4.3.orig/gwlib/gw_uuid.h gateway-1.4.3/gwlib/gw_uuid.h |
1072 |
--- gateway-1.4.3.orig/gwlib/gw_uuid.h 2005-06-14 09:31:34.000000000 +0000 |
1073 |
+++ gateway-1.4.3/gwlib/gw_uuid.h 1970-01-01 00:00:00.000000000 +0000 |
1074 |
@@ -1,84 +0,0 @@ |
1075 |
-/* |
1076 |
- * Public include file for the UUID library |
1077 |
- * |
1078 |
- * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. |
1079 |
- * |
1080 |
- * %Begin-Header% |
1081 |
- * This file may be redistributed under the terms of the GNU |
1082 |
- * Library General Public License. |
1083 |
- * %End-Header% |
1084 |
- */ |
1085 |
- |
1086 |
-#ifndef _UUID_UUID_H |
1087 |
-#define _UUID_UUID_H |
1088 |
- |
1089 |
-#include <sys/types.h> |
1090 |
-#include <sys/time.h> |
1091 |
-#include <time.h> |
1092 |
- |
1093 |
-#define UUID_STR_LEN 36 |
1094 |
- |
1095 |
-#ifdef DARWIN |
1096 |
- |
1097 |
-#ifndef _POSIX_C_SOURCE |
1098 |
-#ifndef _UUID_T |
1099 |
-#define _UUID_T |
1100 |
-typedef __darwin_uuid_t uuid_t; |
1101 |
-#endif /* _UUID_T */ |
1102 |
-#endif /* _POSIX_C_SOURCE */ |
1103 |
- |
1104 |
-#else |
1105 |
- |
1106 |
-typedef unsigned char uuid_t[16]; |
1107 |
- |
1108 |
-#endif |
1109 |
- |
1110 |
-/* UUID Variant definitions */ |
1111 |
-#define UUID_VARIANT_NCS 0 |
1112 |
-#define UUID_VARIANT_DCE 1 |
1113 |
-#define UUID_VARIANT_MICROSOFT 2 |
1114 |
-#define UUID_VARIANT_OTHER 3 |
1115 |
- |
1116 |
-#ifdef __cplusplus |
1117 |
-extern "C" { |
1118 |
-#endif |
1119 |
- |
1120 |
-/* initialize uuid library */ |
1121 |
-void uuid_init(void); |
1122 |
- |
1123 |
-/* shutdown uuid library */ |
1124 |
-void uuid_shutdown(void); |
1125 |
- |
1126 |
-/* clear.c */ |
1127 |
-void uuid_clear(uuid_t uu); |
1128 |
- |
1129 |
-/* compare.c */ |
1130 |
-int uuid_compare(const uuid_t uu1, const uuid_t uu2); |
1131 |
- |
1132 |
-/* copy.c */ |
1133 |
-void uuid_copy(uuid_t dst, const uuid_t src); |
1134 |
- |
1135 |
-/* gen_uuid.c */ |
1136 |
-void uuid_generate(uuid_t out); |
1137 |
-void uuid_generate_random(uuid_t out); |
1138 |
-void uuid_generate_time(uuid_t out); |
1139 |
- |
1140 |
-/* isnull.c */ |
1141 |
-int uuid_is_null(const uuid_t uu); |
1142 |
- |
1143 |
-/* parse.c */ |
1144 |
-int uuid_parse(const char *in, uuid_t uu); |
1145 |
- |
1146 |
-/* unparse.c */ |
1147 |
-void uuid_unparse(const uuid_t uu, char *out); |
1148 |
- |
1149 |
-/* uuid_time.c */ |
1150 |
-time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); |
1151 |
-int uuid_type(const uuid_t uu); |
1152 |
-int uuid_variant(const uuid_t uu); |
1153 |
- |
1154 |
-#ifdef __cplusplus |
1155 |
-} |
1156 |
-#endif |
1157 |
- |
1158 |
-#endif /* _UUID_UUID_H */ |
1159 |
diff -Nru gateway-1.4.3.orig/gwlib/gw_uuid_types.h.in gateway-1.4.3/gwlib/gw_uuid_types.h.in |
1160 |
--- gateway-1.4.3.orig/gwlib/gw_uuid_types.h.in 2003-12-08 11:25:44.000000000 +0000 |
1161 |
+++ gateway-1.4.3/gwlib/gw_uuid_types.h.in 1970-01-01 00:00:00.000000000 +0000 |
1162 |
@@ -1,51 +0,0 @@ |
1163 |
-/* |
1164 |
- * If linux/types.h is already been included, assume it has defined |
1165 |
- * everything we need. (cross fingers) Other header files may have |
1166 |
- * also defined the types that we need. |
1167 |
- */ |
1168 |
-#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ |
1169 |
- !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H)) |
1170 |
-#define _UUID_TYPES_H |
1171 |
- |
1172 |
-typedef unsigned char __u8; |
1173 |
-typedef signed char __s8; |
1174 |
- |
1175 |
-#if (@SIZEOF_INT@ == 8) |
1176 |
-typedef int __s64; |
1177 |
-typedef unsigned int __u64; |
1178 |
-#elif (@SIZEOF_LONG@ == 8) |
1179 |
-typedef long __s64; |
1180 |
-typedef unsigned long __u64; |
1181 |
-#elif (@SIZEOF_LONG_LONG@ == 8) |
1182 |
-#if defined(__GNUC__) |
1183 |
-typedef __signed__ long long __s64; |
1184 |
-#else |
1185 |
-typedef signed long long __s64; |
1186 |
-#endif |
1187 |
-typedef unsigned long long __u64; |
1188 |
-#endif |
1189 |
- |
1190 |
-#if (@SIZEOF_INT@ == 2) |
1191 |
-typedef int __s16; |
1192 |
-typedef unsigned int __u16; |
1193 |
-#elif (@SIZEOF_SHORT@ == 2) |
1194 |
-typedef short __s16; |
1195 |
-typedef unsigned short __u16; |
1196 |
-#else |
1197 |
- ?==error: undefined 16 bit type |
1198 |
-#endif |
1199 |
- |
1200 |
-#if (@SIZEOF_INT@ == 4) |
1201 |
-typedef int __s32; |
1202 |
-typedef unsigned int __u32; |
1203 |
-#elif (@SIZEOF_LONG@ == 4) |
1204 |
-typedef long __s32; |
1205 |
-typedef unsigned long __u32; |
1206 |
-#elif (@SIZEOF_SHORT@ == 4) |
1207 |
-typedef short __s32; |
1208 |
-typedef unsigned short __u32; |
1209 |
-#else |
1210 |
- ?== error: undefined 32 bit type |
1211 |
-#endif |
1212 |
- |
1213 |
-#endif /* _*_TYPES_H */ |
1214 |
diff -Nru gateway-1.4.3.orig/Makefile.in gateway-1.4.3/Makefile.in |
1215 |
--- gateway-1.4.3.orig/Makefile.in 2009-03-01 14:42:03.000000000 +0000 |
1216 |
+++ gateway-1.4.3/Makefile.in 2009-03-01 15:03:45.000000000 +0000 |
1217 |
@@ -322,7 +322,7 @@ |
1218 |
rm -f $(benchoutputs) |
1219 |
|
1220 |
distclean: clean |
1221 |
- rm -f Makefile gw-config.h config.cache config.log config.status config.nice .depend gwlib/gw_uuid_types.h |
1222 |
+ rm -f Makefile gw-config.h config.cache config.log config.status config.nice .depend |
1223 |
|
1224 |
nag: |
1225 |
utils/find-long-lines |
1226 |
|
1227 |
|
1228 |
|
1229 |
1.1 app-mobilephone/kannel/files/kannel-1.4.3-nolex.patch |
1230 |
|
1231 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-nolex.patch?rev=1.1&view=markup |
1232 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-mobilephone/kannel/files/kannel-1.4.3-nolex.patch?rev=1.1&content-type=text/plain |
1233 |
|
1234 |
Index: kannel-1.4.3-nolex.patch |
1235 |
=================================================================== |
1236 |
diff -Nru gateway-1.4.3.orig/configure.in gateway-1.4.3/configure.in |
1237 |
--- gateway-1.4.3.orig/configure.in 2009-01-12 16:47:01.000000000 +0000 |
1238 |
+++ gateway-1.4.3/configure.in 2009-03-01 14:18:51.000000000 +0000 |
1239 |
@@ -112,7 +112,6 @@ |
1240 |
AC_PROG_INSTALL |
1241 |
AC_PROG_RANLIB |
1242 |
AC_PROG_YACC |
1243 |
-AC_PROG_LEX |
1244 |
AC_CHECK_TOOL(AR, ar) |
1245 |
AC_PATH_PROG(CONVERT, convert) |
1246 |
AC_PATH_PROG(PERL, perl) |
1247 |
diff -Nru gateway-1.4.3.orig/Makefile.in gateway-1.4.3/Makefile.in |
1248 |
--- gateway-1.4.3.orig/Makefile.in 2008-06-24 15:05:24.000000000 +0000 |
1249 |
+++ gateway-1.4.3/Makefile.in 2009-03-01 14:18:14.000000000 +0000 |
1250 |
@@ -61,7 +61,6 @@ |
1251 |
SHELL = @SHELL@ |
1252 |
VERSION = @VERSION@ |
1253 |
SUFFIX = @SUFFIX@ |
1254 |
-LEX = @LEX@ |
1255 |
PERL = @PERL@ |
1256 |
YACC = @YACC@ |